]> asedeno.scripts.mit.edu Git - PuTTY.git/blobdiff - windows/wingss.c
first pass
[PuTTY.git] / windows / wingss.c
index 6aaa20cf2c45ccb6956864a2131a3a3fc056fc72..6b4d0f15e0850f522282ae092b9107f6f95c15ab 100644 (file)
@@ -83,18 +83,22 @@ struct ssh_gss_liblist *ssh_gss_setup(Conf *conf)
        == ERROR_SUCCESS) {
        DWORD type, size;
        LONG ret;
-       char *buffer;
-
-       /* Find out the string length */
-        ret = RegQueryValueEx(regkey, "InstallDir", NULL, &type, NULL, &size);
+       wchar_t *buffer;
 
+       /* Find out the string length, in bytes, for a wchar_t */
+        ret = RegQueryValueExW(regkey, L"InstallDir", NULL, &type, NULL, &size);
        if (ret == ERROR_SUCCESS && type == REG_SZ) {
            buffer = snewn(size + 20, char);
-           ret = RegQueryValueEx(regkey, "InstallDir", NULL,
-                                 &type, (LPBYTE)buffer, &size);
+           ret = RegQueryValueExW(regkey, L"InstallDir", NULL,
+                                  &type, (LPBYTE)buffer, &size);
            if (ret == ERROR_SUCCESS && type == REG_SZ) {
-               strcat(buffer, "\\bin\\gssapi32.dll");
-               module = LoadLibrary(buffer);
+               wcscat(buffer, L"\\bin\\");
+               dll_hijacking_protection_add_path(buffer);
+               /* If 32-bit */
+               module = LoadLibrary("gssapi32.dll");
+               /* elif 64-bit */
+               /* module = LoadLibrary("gssapi64.dll"); */
+
            }
            sfree(buffer);
        }