From e3ceff428598a688500fdec2ce7e9e82b0b08105 Mon Sep 17 00:00:00 2001 From: Toni Uhlig Date: Sun, 28 Jun 2020 17:47:19 +0200 Subject: get path of sysWow64 directory (required later for some sys dll path checks) Signed-off-by: Toni Uhlig --- source/compat.c | 5 +++++ source/tests/test_compat.c | 8 ++++++++ 2 files changed, 13 insertions(+) (limited to 'source') 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; } -- cgit v1.2.3