Search
Module:
Directory

   Desktop Functions:

   Smart Device Functions:


Show Recent Changes
Subscribe (RSS)
Misc. Pages
Comments
FAQ
Helpful Tools
Playground
Suggested Reading
Website TODO List
Download Visual Studio Add-In

GetSystemWindowsDirectory (kernel32)
 
.
Summary

C# Signature:

[DllImport("kernel32.dll")]
static extern uint GetSystemWindowsDirectory([Out] StringBuilder lpBuffer,
   uint uSize);

VB.NET Signature:

''' <summary>
''' Retrieves the path of the shared Windows directory on a multi-user system.
''' </summary>
''' <param name="lpBuffer">A pointer to the buffer to receive the path. This path does not end with a backslash unless the Windows directory is the root directory.</param>
''' <param name="uSize">The maximum size of the buffer specified by the lpBuffer parameter, in TCHARs.</param>
''' <returns>
''' If the function succeeds, the return value is the length of the string copied to the buffer, in TCHARs, not including the terminating null character.
''' If the length is greater than the size of the buffer, the return value is the size of the buffer required to hold the path.
''' If the function fails, the return value is zero. To get extended error information, call GetLastError.
''' </returns>
''' <remarks>
''' On a system that is running Terminal Services, each user has a unique Windows directory.
''' The system Windows directory is shared by all users, so it is the directory where an application should store initialization and help files that apply to all users.
''' With Terminal Services, the GetSystemWindowsDirectory function retrieves the path of the system Windows directory,
''' while the GetWindowsDirectory function retrieves the path of a Windows directory that is private for each user. On a single-user system, GetSystemWindowsDirectory is the same as GetWindowsDirectory.
''' </remarks>
<DllImport("Kernel32.dll", EntryPoint:="GetSystemWindowsDirectoryW", SetLastError:=True, CharSet:=CharSet.Unicode)> _
Public Function GetSystemWindowsDirectory(<MarshalAs(UnmanagedType.LPTStr)>lpBuffer As System.Text.StringBuilder, _
              uSize As UInteger) As UInteger
End Function

VB Signature:

Public Declare Function GetSystemWindowsDirectory Lib "kernel" Alias "GetSystemWindowsDirectoryA" _
        (ByVal pszBuffer As String, _
         ByVal uSize As Integer) As Integer

User-Defined Types:

None.

Notes:

None.

Tips & Tricks:

Please add some!

Sample Code:

Please add some!

Alternative Managed API:

Do you know one? Please contribute it!

www.freewebs.com\omnicoder\apireplacement.dll

Documentation

Please edit this page!

Do you have...

  • helpful tips or sample code to share for using this API in managed code?
  • corrections to the existing content?
  • variations of the signature you want to share?
  • additional languages you want to include?

Select "Edit This Page" on the right hand toolbar and edit it! Or add new pages containing supporting types needed for this API (structures, delegates, and more).

 
Access PInvoke.net directly from VS:
Terms of Use
Find References
Show Printable Version
Revisions