Skip to content

Latest commit

 

History

History
118 lines (84 loc) · 4.3 KB

nf-sysinfoapi-getsystemdirectorya.md

File metadata and controls

118 lines (84 loc) · 4.3 KB
UID title description helpviewer_keywords old-location tech.root ms.assetid ms.date ms.keywords req.header req.include-header req.target-type req.target-min-winverclnt req.target-min-winversvr req.kmdf-ver req.umdf-ver req.ddi-compliance req.unicode-ansi req.idl req.max-support req.namespace req.assembly req.type-library req.lib req.dll req.irql targetos req.typenames req.redist ms.custom f1_keywords dev_langs topic_type api_type api_location api_name
NF:sysinfoapi.GetSystemDirectoryA
GetSystemDirectoryA function (sysinfoapi.h)
Retrieves the path of the system directory. (ANSI)
GetSystemDirectoryA
sysinfoapi/GetSystemDirectoryA
base\getsystemdirectory.htm
winprog
79f045b2-40d9-498a-b720-e729c92bf50b
12/05/2018
GetSystemDirectory, GetSystemDirectory function, GetSystemDirectoryA, GetSystemDirectoryW, _win32_getsystemdirectory, base.getsystemdirectory, sysinfoapi/GetSystemDirectory, sysinfoapi/GetSystemDirectoryA, sysinfoapi/GetSystemDirectoryW
sysinfoapi.h
Windows.h
Windows
Windows 2000 Professional [desktop apps \| UWP apps]
Windows 2000 Server [desktop apps \| UWP apps]
GetSystemDirectoryW (Unicode) and GetSystemDirectoryA (ANSI)
Kernel32.lib
Kernel32.dll
Windows
19H1
GetSystemDirectoryA
sysinfoapi/GetSystemDirectoryA
c++
APIRef
kbSyntax
DllExport
Kernel32.dll
API-MS-Win-Core-SysInfo-l1-1-0.dll
KernelBase.dll
API-MS-Win-Core-SysInfo-l1-2-0.dll
API-MS-Win-Core-SysInfo-l1-2-1.dll
API-MS-Win-Core-SysInfo-l1-2-2.dll
API-MS-Win-DownLevel-Kernel32-l1-1-0.dll
MinKernelBase.dll
API-MS-Win-Core-SysInfo-l1-2-3.dll
GetSystemDirectory
GetSystemDirectoryA
GetSystemDirectoryW

GetSystemDirectoryA function

-description

Retrieves the path of the system directory. The system directory contains system files such as dynamic-link libraries and drivers.

This function is provided primarily for compatibility. Applications should store code in the Program Files folder and persistent data in the Application Data folder in the user's profile. For more information, see ShGetFolderPath.

-parameters

-param lpBuffer [out]

A pointer to the buffer to receive the path. This path does not end with a backslash unless the system directory is the root directory. For example, if the system directory is named Windows\System32 on drive C, the path of the system directory retrieved by this function is C:\Windows\System32.

-param uSize [in]

The maximum size of the buffer, in TCHARs.

-returns

If the function succeeds, the return value is the length, in TCHARs, of the string copied to the buffer, 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, including the terminating null character.

If the function fails, the return value is zero. To get extended error information, call GetLastError.

-remarks

Applications should not create files in the system directory. If the user is running a shared version of the operating system, the application does not have write access to the system directory.

Examples

For an example, see Getting System Information.

Note

The sysinfoapi.h header defines GetSystemDirectory as an alias that automatically selects the ANSI or Unicode version of this function based on the definition of the UNICODE preprocessor constant. Mixing usage of the encoding-neutral alias with code that is not encoding-neutral can lead to mismatches that result in compilation or runtime errors. For more information, see Conventions for Function Prototypes.

-see-also

GetCurrentDirectory

GetWindowsDirectory

SetCurrentDirectory

System Information Functions