Skip to content

Commit 98e42d1

Browse files
authored
bpo-35890: Use RegQueryInfoKeyW and CryptAcquireContextW explicitly (GH-19974)
1 parent f660567 commit 98e42d1

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

PC/getpathp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ getpythonregpath(HKEY keyBase, int skipcore)
358358
goto done;
359359
}
360360
/* Find out how big our core buffer is, and how many subkeys we have */
361-
rc = RegQueryInfoKey(newKey, NULL, NULL, NULL, &numKeys, NULL, NULL,
361+
rc = RegQueryInfoKeyW(newKey, NULL, NULL, NULL, &numKeys, NULL, NULL,
362362
NULL, NULL, &dataSize, NULL, NULL);
363363
if (rc!=ERROR_SUCCESS) {
364364
goto done;

PC/winreg.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1451,9 +1451,9 @@ winreg_QueryInfoKey_impl(PyObject *module, HKEY key)
14511451
if (PySys_Audit("winreg.QueryInfoKey", "n", (Py_ssize_t)key) < 0) {
14521452
return NULL;
14531453
}
1454-
if ((rc = RegQueryInfoKey(key, NULL, NULL, 0, &nSubKeys, NULL, NULL,
1455-
&nValues, NULL, NULL, NULL, &ft))
1456-
!= ERROR_SUCCESS) {
1454+
if ((rc = RegQueryInfoKeyW(key, NULL, NULL, 0, &nSubKeys, NULL, NULL,
1455+
&nValues, NULL, NULL, NULL, &ft))
1456+
!= ERROR_SUCCESS) {
14571457
return PyErr_SetFromWindowsErrWithFunction(rc, "RegQueryInfoKey");
14581458
}
14591459
li.LowPart = ft.dwLowDateTime;

Python/bootstrap_hash.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ static int
3838
win32_urandom_init(int raise)
3939
{
4040
/* Acquire context */
41-
if (!CryptAcquireContext(&hCryptProv, NULL, NULL,
42-
PROV_RSA_FULL, CRYPT_VERIFYCONTEXT))
41+
if (!CryptAcquireContextW(&hCryptProv, NULL, NULL,
42+
PROV_RSA_FULL, CRYPT_VERIFYCONTEXT))
4343
goto error;
4444

4545
return 0;

0 commit comments

Comments
 (0)