bpo-33895: Relase GIL while calling functions that acquire Windows lo… · python/cpython@4860f01
@@ -984,10 +984,12 @@ winreg_DeleteKeyEx_impl(PyObject *module, HKEY key,
984984985985/* Only available on 64bit platforms, so we must load it
986986 dynamically. */
987+Py_BEGIN_ALLOW_THREADS
987988hMod = GetModuleHandleW(L"advapi32.dll");
988989if (hMod)
989990pfn = (RDKEFunc)GetProcAddress(hMod,
990991"RegDeleteKeyExW");
992+Py_END_ALLOW_THREADS
991993if (!pfn) {
992994PyErr_SetString(PyExc_NotImplementedError,
993995"not implemented on this platform");
@@ -1714,10 +1716,12 @@ winreg_DisableReflectionKey_impl(PyObject *module, HKEY key)
1714171617151717/* Only available on 64bit platforms, so we must load it
17161718 dynamically.*/
1719+Py_BEGIN_ALLOW_THREADS
17171720hMod = GetModuleHandleW(L"advapi32.dll");
17181721if (hMod)
17191722pfn = (RDRKFunc)GetProcAddress(hMod,
17201723"RegDisableReflectionKey");
1724+Py_END_ALLOW_THREADS
17211725if (!pfn) {
17221726PyErr_SetString(PyExc_NotImplementedError,
17231727"not implemented on this platform");
@@ -1757,10 +1761,12 @@ winreg_EnableReflectionKey_impl(PyObject *module, HKEY key)
1757176117581762/* Only available on 64bit platforms, so we must load it
17591763 dynamically.*/
1764+Py_BEGIN_ALLOW_THREADS
17601765hMod = GetModuleHandleW(L"advapi32.dll");
17611766if (hMod)
17621767pfn = (RERKFunc)GetProcAddress(hMod,
17631768"RegEnableReflectionKey");
1769+Py_END_ALLOW_THREADS
17641770if (!pfn) {
17651771PyErr_SetString(PyExc_NotImplementedError,
17661772"not implemented on this platform");
@@ -1799,10 +1805,12 @@ winreg_QueryReflectionKey_impl(PyObject *module, HKEY key)
1799180518001806/* Only available on 64bit platforms, so we must load it
18011807 dynamically.*/
1808+Py_BEGIN_ALLOW_THREADS
18021809hMod = GetModuleHandleW(L"advapi32.dll");
18031810if (hMod)
18041811pfn = (RQRKFunc)GetProcAddress(hMod,
18051812"RegQueryReflectionKey");
1813+Py_END_ALLOW_THREADS
18061814if (!pfn) {
18071815PyErr_SetString(PyExc_NotImplementedError,
18081816"not implemented on this platform");