diff options
| author | Lenny Komow <lenny@lunarg.com> | 2017-08-31 10:44:17 -0600 |
|---|---|---|
| committer | Lenny Komow <lenny@lunarg.com> | 2017-09-06 11:54:17 -0600 |
| commit | a344ad370f44866607a1f8047fb2a99a1c922cf1 (patch) | |
| tree | d7e32423eedbe87d788d9717ff54b8ab6f2d7ea5 /loader/vk_loader_platform.h | |
| parent | 34861ad9f10066f2fae77ee023ce4318c46360f2 (diff) | |
| download | usermoji-a344ad370f44866607a1f8047fb2a99a1c922cf1.tar.xz | |
loader: Fix PnP 32-bit registry handling
Change-Id: I25eae83b4783e702ca5fbe74a99d7bdeae6218f0
Diffstat (limited to 'loader/vk_loader_platform.h')
| -rw-r--r-- | loader/vk_loader_platform.h | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/loader/vk_loader_platform.h b/loader/vk_loader_platform.h index 324de88e..1fa4952f 100644 --- a/loader/vk_loader_platform.h +++ b/loader/vk_loader_platform.h @@ -172,11 +172,6 @@ static inline void loader_platform_thread_cond_broadcast(loader_platform_thread_ #define SECONDARY_VK_REGISTRY_HIVE HKEY_CURRENT_USER #define SECONDARY_VK_REGISTRY_HIVE_STR "HKEY_CURRENT_USER" #define DEFAULT_VK_DRIVERS_INFO "SOFTWARE\\Khronos\\" API_NAME "\\Drivers" -#ifdef _WIN64 -#define HKR_VK_DRIVER_NAME API_NAME "DriverName" -#else -#define HKR_VK_DRIVER_NAME API_NAME "DriverNameWow" -#endif #define DEFAULT_VK_DRIVERS_PATH "" #define DEFAULT_VK_ELAYERS_INFO "SOFTWARE\\Khronos\\" API_NAME "\\ExplicitLayers" #define DEFAULT_VK_ILAYERS_INFO "SOFTWARE\\Khronos\\" API_NAME "\\ImplicitLayers" @@ -192,6 +187,16 @@ static inline void loader_platform_thread_cond_broadcast(loader_platform_thread_ #define RELATIVE_VK_ILAYERS_INFO "" #define PRINTF_SIZE_T_SPECIFIER "%Iu" +#if defined(_WIN32) +// Get the key for the plug n play driver registry +// The string returned by this function should NOT be freed +static inline const char *LoaderPnpDriverRegistry() { + BOOL is_wow; + IsWow64Process(GetCurrentProcess(), &is_wow); + return is_wow ? (API_NAME "DriverNameWow") : (API_NAME "DriverName"); +} +#endif + // File IO static bool loader_platform_file_exists(const char *path) { if ((_access(path, 0)) == -1) |
