From 10ec96277b441ea55078a3dd87402c726a805f86 Mon Sep 17 00:00:00 2001 From: Ian Elliott Date: Thu, 9 Apr 2015 18:07:15 -0600 Subject: [PATCH] Win: Fix typo and incorrect strlen for finding/loading ICDs. --- libs/xcb_nvidia/xcb_nvidia.cpp | 4 ++-- loader/loader.c | 2 +- loader/loader_platform.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/libs/xcb_nvidia/xcb_nvidia.cpp b/libs/xcb_nvidia/xcb_nvidia.cpp index 90269f6..e65ea95 100644 --- a/libs/xcb_nvidia/xcb_nvidia.cpp +++ b/libs/xcb_nvidia/xcb_nvidia.cpp @@ -98,9 +98,9 @@ xcb_connection_t * xcb_connect(const char *displayname, int *screenp) size_t rtn_len; registry_str = loader_get_registry_string(HKEY_LOCAL_MACHINE, - "Software\\VK", + "Software\\Vulkan", "VK_DRIVERS_PATH"); - registry_len = strlen(registry_str); + registry_len = (registry_str) ? strlen(registry_str) : 0; rtn_len = registry_len + 16; rtn_str = (char *) malloc(rtn_len); _snprintf(rtn_str, rtn_len, "%s\\%s", registry_str, "vk_nvidia.dll"); diff --git a/loader/loader.c b/loader/loader.c index 377de81..af88c41 100644 --- a/loader/loader.c +++ b/loader/loader.c @@ -166,7 +166,7 @@ static char *loader_get_registry_and_env(const char *env_var, size_t rtn_len; registry_str = loader_get_registry_string(HKEY_LOCAL_MACHINE, - "Software\\VK", + "Software\\Vulkan", registry_value); registry_len = (registry_str) ? strlen(registry_str) : 0; diff --git a/loader/loader_platform.h b/loader/loader_platform.h index 230ee5d..08ce208 100644 --- a/loader/loader_platform.h +++ b/loader/loader_platform.h @@ -159,7 +159,7 @@ using namespace std; #define DEFAULT_VK_DRIVERS_PATH "C:\\Windows\\System32" // TODO/TBD: Is this an appropriate prefix for Windows? #define VK_DRIVER_LIBRARY_PREFIX "VK_" -#define VK_DRIVER_LIBRARY_PREFIX_LEN 4 +#define VK_DRIVER_LIBRARY_PREFIX_LEN 3 // TODO/TBD: Is this an appropriate suffix for Windows? #define VK_LAYER_LIBRARY_PREFIX "VKLayer" #define VK_LAYER_LIBRARY_PREFIX_LEN 8 -- 2.7.4