winsdk: Fix RT not reading versions from registry
authorLenny Komow <lenny@lunarg.com>
Mon, 16 Jan 2017 17:10:47 +0000 (10:10 -0700)
committerLenny Komow <lenny@lunarg.com>
Mon, 16 Jan 2017 17:12:42 +0000 (10:12 -0700)
Change-Id: I44bb8c167492739467448925375ae1b99fb8a2db

windowsRuntimeInstaller/configure_runtime.c

index f952897..d594bd3 100644 (file)
@@ -205,7 +205,8 @@ int main(int argc, char** argv)
     fprintf(log, "API Name: %s\n", api_name);\r
     \r
     // This makes System32 and SysWOW64 not do any redirection (well, until 128-bit is a thing)\r
-    Wow64DisableWow64FsRedirection(NULL);\r
+    PVOID useless;\r
+    Wow64DisableWow64FsRedirection(&useless);\r
     \r
     // Update System32 (on all systems) and SysWOW64 on 64-bit system\r
     struct SDKVersion latest_runtime_version;\r
@@ -357,14 +358,14 @@ int find_installations(const char* api_name, char*** install_paths, struct SDKVe
         for(int j = 0; j < valueCount; ++j) {\r
 \r
             TCHAR name[COPY_BUFFER_SIZE], value[COPY_BUFFER_SIZE];\r
-            DWORD type, buffSize = COPY_BUFFER_SIZE;\r
-            RegEnumValue(subKey, j, name, &buffSize, NULL, &type, value, &buffSize);\r
+            DWORD type, nameSize = COPY_BUFFER_SIZE, valSize = COPY_BUFFER_SIZE;\r
+            LSTATUS ret = RegEnumValue(subKey, j, name, &nameSize, NULL, &type, value, &valSize);\r
             if(type == REG_SZ && !strcmp("InstallDir", name)) {\r
                 *install_paths = realloc(*install_paths, sizeof(char*) * ((*count) + 1));\r
                 (*install_paths)[*count] = malloc(sizeof(char) * COPY_BUFFER_SIZE);\r
                 strcpy((*install_paths)[*count], value);\r
                 found_installation = true;\r
-            } else if(type == REG_SZ && !strncmp("DisplayVersion", name, 8)) {\r
+            } else if(type == REG_SZ && !strcmp("DisplayVersion", name)) {\r
                 *install_versions = realloc(*install_versions, sizeof(struct SDKVersion) * ((*count) + 1));\r
                 CHECK_ERROR(read_version(value, (*install_versions) + *count));\r
                 found_version = true;\r