GetSystemWow64DirectoryA function (wow64apiset.h)

Retrieves the path of the system directory used by WOW64. This directory is not present on 32-bit Windows.


UINT GetSystemWow64DirectoryA(
  [out] LPSTR lpBuffer,
  [in]  UINT  uSize


[out] lpBuffer

A pointer to the buffer to receive the path. This path does not end with a backslash.

[in] uSize

The maximum size of the buffer, in TCHARs.

Return value

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.

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

On 32-bit Windows, the function always fails, and the extended error is set to ERROR_CALL_NOT_IMPLEMENTED.


WOW64 uses the system directory to store shared 32-bit code on 64-bit Windows. Most applications have no need to access this directory explicitly.

For more information on WOW64, see Running 32-bit Applications.

To compile an application that uses this function, define _WIN32_WINNT as 0x0501 or later. For more information, see Using the Windows Headers.


The wow64apiset.h header defines GetSystemWow64Directory as an alias which 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 not encoding-neutral can lead to mismatches that result in compilation or runtime errors. For more information, see Conventions for Function Prototypes.


Requirement Value
Minimum supported client Windows XP [desktop apps only]
Minimum supported server Windows Server 2003 [desktop apps only]
Target Platform Windows
Header wow64apiset.h (include Windows.h)
Library Kernel32.lib
DLL Kernel32.dll

See also

System Information Functions