diff options
author | Toni Uhlig <matzeton@googlemail.com> | 2020-06-28 17:47:19 +0200 |
---|---|---|
committer | Toni Uhlig <matzeton@googlemail.com> | 2020-06-28 17:48:11 +0200 |
commit | e3ceff428598a688500fdec2ce7e9e82b0b08105 (patch) | |
tree | 5289720abc825522e1096f1b76708d8efb348d4e | |
parent | 324f441c9731c5c83261ff8f5564d7af75258a6e (diff) |
get path of sysWow64 directory (required later for some sys dll path checks)
Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
-rw-r--r-- | include/compat.h | 2 | ||||
-rw-r--r-- | include/xor_strings.h | 1 | ||||
-rw-r--r-- | source/compat.c | 5 | ||||
-rw-r--r-- | source/tests/test_compat.c | 8 |
4 files changed, 16 insertions, 0 deletions
diff --git a/include/compat.h b/include/compat.h index 46070f1..4dd1843 100644 --- a/include/compat.h +++ b/include/compat.h @@ -189,6 +189,8 @@ BOOL WINAPI _GetCurrentHwProfile(LPHW_PROFILE_INFOA lpHwProfileInfo); UINT WINAPI _GetSystemDirectory (LPTSTR lpBuffer, UINT uSize); +UINT WINAPI _GetSystemWow64Directory(LPTSTR lpBuffer, UINT uSize); + DWORD WINAPI _GetCurrentDirectory(DWORD nBufferLength, LPTSTR lpBuffer); DWORD WINAPI _GetFileAttributes (LPCTSTR lpFileName); diff --git a/include/xor_strings.h b/include/xor_strings.h index 26b0a22..b7e6dfd 100644 --- a/include/xor_strings.h +++ b/include/xor_strings.h @@ -156,6 +156,7 @@ #define INFO_GETSYSTEMINFO "GetSystemInfo" #define INFO_GETVOLINFO "GetVolumeInformationA" #define INFO_GETSYSDIR "GetSystemDirectoryA" +#define INFO_GETSYSWOW64DIR "GetSystemWow64DirectoryA" #define INFO_GETCURDIR "GetCurrentDirectoryA" #define INFO_GETFILEATTRS "GetFileAttributesA" /* ENDSECTION */ diff --git a/source/compat.c b/source/compat.c index d1ceffc..f1de75c 100644 --- a/source/compat.c +++ b/source/compat.c @@ -750,6 +750,11 @@ UINT WINAPI _GetSystemDirectory(LPTSTR lpBuffer, UINT uSize) return RUN_FUNC(INFO_GETSYSDIR_ENUM, GetSystemDirectoryFunc, lpBuffer, uSize); } +UINT WINAPI _GetSystemWow64Directory(LPTSTR lpBuffer, UINT uSize) +{ + return RUN_FUNC(INFO_GETSYSWOW64DIR_ENUM, GetSystemDirectoryFunc, lpBuffer, uSize); +} + DWORD WINAPI _GetCurrentDirectory(DWORD nBufferLength, LPTSTR lpBuffer) { return RUN_FUNC(INFO_GETCURDIR_ENUM, GetCurrentDirectoryFunc, nBufferLength, lpBuffer); diff --git a/source/tests/test_compat.c b/source/tests/test_compat.c index f760a6e..741aa78 100644 --- a/source/tests/test_compat.c +++ b/source/tests/test_compat.c @@ -148,5 +148,13 @@ BOOL test_stdio(void) ERRETCP( wStr != NULL ); COMPAT(free)(wStr); + char sysDir[512]; + char sysWow64Dir[512]; + UINT sysDirRetVal = _GetSystemDirectory(sysDir, sizeof(sysDir)); + ERRETCP( sysDirRetVal > 0 && sysDirRetVal <= sizeof(sysDir) ); + sysDirRetVal = _GetSystemWow64Directory(sysWow64Dir, sizeof(sysWow64Dir)); + ERRETCP( sysDirRetVal > 0 && sysDirRetVal <= sizeof(sysDir) ); + ERRETCP( strncmp(sysDir, sysWow64Dir, sizeof(sysDir)) != 0 ); + return TRUE; } |