]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-35890: Use RegQueryInfoKeyW and CryptAcquireContextW explicitly (GH-19974)
authorSteve Dower <steve.dower@python.org>
Mon, 18 May 2020 22:24:41 +0000 (23:24 +0100)
committerGitHub <noreply@github.com>
Mon, 18 May 2020 22:24:41 +0000 (23:24 +0100)
Co-authored-by: Minmin Gong <gongminmin@msn.com>
PC/getpathp.c
PC/winreg.c
Python/bootstrap_hash.c

index e3cd3ae1e9a6050635f3276bad7fd96ec3de6245..dc4e43fe7d3b6190de26fa9f6fcddb82cfad8b77 100644 (file)
@@ -398,7 +398,7 @@ getpythonregpath(HKEY keyBase, int skipcore)
         goto done;
     }
     /* Find out how big our core buffer is, and how many subkeys we have */
-    rc = RegQueryInfoKey(newKey, NULL, NULL, NULL, &numKeys, NULL, NULL,
+    rc = RegQueryInfoKeyW(newKey, NULL, NULL, NULL, &numKeys, NULL, NULL,
                     NULL, NULL, &dataSize, NULL, NULL);
     if (rc!=ERROR_SUCCESS) {
         goto done;
index 16a10c7232a17da9f157a452aec1fa09e9560dfa..639052d20dd0825594e0596a4c7b771f76f1d51c 100644 (file)
@@ -1382,8 +1382,8 @@ winreg_QueryInfoKey_impl(PyObject *module, HKEY key)
   PyObject *l;
   PyObject *ret;
 
-  if ((rc = RegQueryInfoKey(key, NULL, NULL, 0, &nSubKeys, NULL, NULL,
-                            &nValues,  NULL,  NULL, NULL, &ft))
+  if ((rc = RegQueryInfoKeyW(key, NULL, NULL, 0, &nSubKeys, NULL, NULL,
+                             &nValues,  NULL,  NULL, NULL, &ft))
       != ERROR_SUCCESS)
     return PyErr_SetFromWindowsErrWithFunction(rc, "RegQueryInfoKey");
   li.LowPart = ft.dwLowDateTime;
index 58b0802f4668878269245742fef02a29bece3fb5..7b560e66e30717d245487688e2132e44578e74ad 100644 (file)
@@ -37,8 +37,8 @@ static int
 win32_urandom_init(int raise)
 {
     /* Acquire context */
-    if (!CryptAcquireContext(&hCryptProv, NULL, NULL,
-                             PROV_RSA_FULL, CRYPT_VERIFYCONTEXT))
+    if (!CryptAcquireContextW(&hCryptProv, NULL, NULL,
+                              PROV_RSA_FULL, CRYPT_VERIFYCONTEXT))
         goto error;
 
     return 0;