tst: passthrough, passthrough-fuse: WinFspLoad: eliminate RRF_SUBKEY_WOW6432KEY

This commit is contained in:
Bill Zissimopoulos
2017-01-31 15:27:15 -08:00
parent b7a06c7046
commit 06f6c192ed
3 changed files with 37 additions and 22 deletions

View File

@ -925,19 +925,24 @@ static NTSTATUS WinFspLoad(VOID)
#endif
#define FSP_DLLPATH "bin\\" FSP_DLLNAME
WCHAR PathBuf[MAX_PATH - (sizeof L"" FSP_DLLPATH / sizeof(WCHAR) - 1)];
WCHAR PathBuf[MAX_PATH];
DWORD Size;
HKEY RegKey;
LONG Result;
HMODULE Module;
Module = LoadLibraryW(L"" FSP_DLLNAME);
if (0 == Module)
{
Size = sizeof PathBuf;
Result = RegGetValueW(
HKEY_LOCAL_MACHINE, L"Software\\WinFsp", L"InstallDir",
RRF_RT_REG_SZ | 0x00020000/*RRF_SUBKEY_WOW6432KEY*/,
0, PathBuf, &Size);
Result = RegOpenKeyExW(HKEY_LOCAL_MACHINE, L"Software\\WinFsp",
0, KEY_READ | KEY_WOW64_32KEY, &RegKey);
if (ERROR_SUCCESS == Result)
{
Size = sizeof PathBuf - sizeof L"" FSP_DLLPATH + sizeof(WCHAR);
Result = RegGetValueW(RegKey, 0, L"InstallDir",
RRF_RT_REG_SZ, 0, PathBuf, &Size);
RegCloseKey(RegKey);
}
if (ERROR_SUCCESS != Result)
return STATUS_OBJECT_NAME_NOT_FOUND;