diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2012-10-21 14:33:33 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2012-10-21 14:33:33 (GMT) |
commit | 06eecead03a7698ca7a1d15548e6bf35fab2dbfb (patch) | |
tree | c077c774aafca6b4683d5c9e21a1e541dadc5304 /Modules | |
parent | d3a3e640b60484aa1450ca4a605d0e817f9e108f (diff) | |
download | cpython-06eecead03a7698ca7a1d15548e6bf35fab2dbfb.zip cpython-06eecead03a7698ca7a1d15548e6bf35fab2dbfb.tar.gz cpython-06eecead03a7698ca7a1d15548e6bf35fab2dbfb.tar.bz2 |
Issue #12034: Fix bogus caching of result in check_GetFinalPathNameByHandle.
Patch by Atsuo Ishimoto.
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/posixmodule.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index 1089ae3..0fe3963 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -1390,7 +1390,7 @@ attributes_from_dir_w(LPCWSTR pszFile, BY_HANDLE_FILE_INFORMATION *info, ULONG * } /* Grab GetFinalPathNameByHandle dynamically from kernel32 */ -static int has_GetFinalPathNameByHandle = 0; +static int has_GetFinalPathNameByHandle = -1; static DWORD (CALLBACK *Py_GetFinalPathNameByHandleW)(HANDLE, LPWSTR, DWORD, DWORD); static int @@ -1401,7 +1401,7 @@ check_GetFinalPathNameByHandle() DWORD); /* only recheck */ - if (!has_GetFinalPathNameByHandle) + if (-1 == has_GetFinalPathNameByHandle) { hKernel32 = GetModuleHandleW(L"KERNEL32"); *(FARPROC*)&Py_GetFinalPathNameByHandleA = GetProcAddress(hKernel32, |