Fix SysWow64 path conversion (64bit drivers loaded from SysWOW64)
@@ -6913,6 +6913,19 @@ PPH_STRING PhGetFileName(
newFileName->Buffer[systemRoot.Length / sizeof(WCHAR)] = OBJ_NAME_PATH_SEPARATOR;
memcpy(PTR_ADD_OFFSET(newFileName->Buffer, systemRoot.Length + sizeof(UNICODE_NULL)), FileName->Buffer, FileName->Length);
}
+#ifdef _WIN64
+ // "SysWOW64\" means "C:\Windows\SysWOW64\".
+ else if (PhStartsWithString2(FileName, L"SysWOW64\\", TRUE))
+ {
+ PH_STRINGREF systemRoot;
+
+ PhGetSystemRoot(&systemRoot);
+ newFileName = PhCreateStringEx(NULL, systemRoot.Length + sizeof(UNICODE_NULL) + FileName->Length);
+ memcpy(newFileName->Buffer, systemRoot.Buffer, systemRoot.Length);
+ newFileName->Buffer[systemRoot.Length / sizeof(WCHAR)] = OBJ_NAME_PATH_SEPARATOR;
+ memcpy(PTR_ADD_OFFSET(newFileName->Buffer, systemRoot.Length + sizeof(UNICODE_NULL)), FileName->Buffer, FileName->Length);
+ }
+#endif
else if (FileName->Length != 0 && FileName->Buffer[0] == OBJ_NAME_PATH_SEPARATOR)
{
PPH_STRING resolvedName;
