|
@@ -7,7 +7,6 @@
|
|
|
#include <util/pipe.h>
|
|
|
|
|
|
#include <windows.h>
|
|
|
-#include <shlobj.h>
|
|
|
#include "graphics-hook-info.h"
|
|
|
|
|
|
extern struct graphics_offsets offsets32;
|
|
@@ -98,12 +97,16 @@ static bool get_32bit_system_dll_ver(const wchar_t *system_lib,
|
|
|
struct win_version_info *ver)
|
|
|
{
|
|
|
wchar_t path[MAX_PATH];
|
|
|
-
|
|
|
- HRESULT hr = SHGetFolderPathW(NULL, CSIDL_SYSTEMX86, NULL,
|
|
|
- SHGFP_TYPE_CURRENT, path);
|
|
|
- if (hr != S_OK) {
|
|
|
+ UINT ret;
|
|
|
+
|
|
|
+#ifdef _WIN64
|
|
|
+ ret = GetSystemWow64DirectoryW(path, MAX_PATH);
|
|
|
+#else
|
|
|
+ ret = GetSystemDirectoryW(path, MAX_PATH);
|
|
|
+#endif
|
|
|
+ if (!ret) {
|
|
|
blog(LOG_ERROR, "Failed to get windows 32bit system path: "
|
|
|
- "%08lX", hr);
|
|
|
+ "%lu", GetLastError());
|
|
|
return false;
|
|
|
}
|
|
|
|