From 5cb575f907788c1054cfc559327c2ebb0cda9473 Mon Sep 17 00:00:00 2001 From: Minmin Gong Date: Wed, 6 May 2020 19:36:49 -0700 Subject: [PATCH 1/3] Use RegQueryInfoKeyW and CryptAcquireContextW for consistency --- PC/getpathp.c | 2 +- PC/winreg.c | 6 +++--- Python/bootstrap_hash.c | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/PC/getpathp.c b/PC/getpathp.c index d23d2bbde809f7..fd5cfa7e1a8a3f 100644 --- a/PC/getpathp.c +++ b/PC/getpathp.c @@ -358,7 +358,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; diff --git a/PC/winreg.c b/PC/winreg.c index 3e13e75826f157..1305b7030fadaf 100644 --- a/PC/winreg.c +++ b/PC/winreg.c @@ -1451,9 +1451,9 @@ winreg_QueryInfoKey_impl(PyObject *module, HKEY key) if (PySys_Audit("winreg.QueryInfoKey", "n", (Py_ssize_t)key) < 0) { return NULL; } - if ((rc = RegQueryInfoKey(key, NULL, NULL, 0, &nSubKeys, NULL, NULL, - &nValues, NULL, NULL, NULL, &ft)) - != ERROR_SUCCESS) { + 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; diff --git a/Python/bootstrap_hash.c b/Python/bootstrap_hash.c index aa3a3dfd964edb..b2109275014b23 100644 --- a/Python/bootstrap_hash.c +++ b/Python/bootstrap_hash.c @@ -38,8 +38,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; From a1e79d7cef4bfe5d5fa11b6e163070aab182e723 Mon Sep 17 00:00:00 2001 From: "blurb-it[bot]" <43283697+blurb-it[bot]@users.noreply.github.com> Date: Sat, 16 May 2020 23:19:11 +0000 Subject: [PATCH 2/3] =?UTF-8?q?=F0=9F=93=9C=F0=9F=A4=96=20Added=20by=20blu?= =?UTF-8?q?rb=5Fit.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../NEWS.d/next/Windows/2020-05-16-23-19-07.bpo-35890.oisoPR.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 Misc/NEWS.d/next/Windows/2020-05-16-23-19-07.bpo-35890.oisoPR.rst diff --git a/Misc/NEWS.d/next/Windows/2020-05-16-23-19-07.bpo-35890.oisoPR.rst b/Misc/NEWS.d/next/Windows/2020-05-16-23-19-07.bpo-35890.oisoPR.rst new file mode 100644 index 00000000000000..be75cbe4cebe04 --- /dev/null +++ b/Misc/NEWS.d/next/Windows/2020-05-16-23-19-07.bpo-35890.oisoPR.rst @@ -0,0 +1 @@ +Fix API calling consistency of RegQueryInfoKeyW and CryptAcquireContextW. \ No newline at end of file From 65ec9010e4ba6a58402d98b6db9f33f7fb60cb9d Mon Sep 17 00:00:00 2001 From: Steve Dower Date: Mon, 18 May 2020 17:24:31 +0100 Subject: [PATCH 3/3] Remove unnecessary NEWS entry --- .../NEWS.d/next/Windows/2020-05-16-23-19-07.bpo-35890.oisoPR.rst | 1 - 1 file changed, 1 deletion(-) delete mode 100644 Misc/NEWS.d/next/Windows/2020-05-16-23-19-07.bpo-35890.oisoPR.rst diff --git a/Misc/NEWS.d/next/Windows/2020-05-16-23-19-07.bpo-35890.oisoPR.rst b/Misc/NEWS.d/next/Windows/2020-05-16-23-19-07.bpo-35890.oisoPR.rst deleted file mode 100644 index be75cbe4cebe04..00000000000000 --- a/Misc/NEWS.d/next/Windows/2020-05-16-23-19-07.bpo-35890.oisoPR.rst +++ /dev/null @@ -1 +0,0 @@ -Fix API calling consistency of RegQueryInfoKeyW and CryptAcquireContextW. \ No newline at end of file