Skip to content

Commit e889c44

Browse files
authored
Merge pull request #91 from AzureAD/memcpy_argtypes
Specify memcpy argtypes
2 parents cda417f + 5e55ed0 commit e889c44

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

msal_extensions/windows.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
_LOCAL_FREE = ctypes.windll.kernel32.LocalFree
66
_GET_LAST_ERROR = ctypes.windll.kernel32.GetLastError
77
_MEMCPY = ctypes.cdll.msvcrt.memcpy
8+
_MEMCPY.argtypes = [ctypes.c_void_p, ctypes.c_void_p, ctypes.c_size_t] # Note:
9+
# Suggested by https://github.com/AzureAD/microsoft-authentication-extensions-for-python/issues/85 # pylint: disable=line-too-long
10+
# Matching https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/memcpy-wmemcpy?view=msvc-160 # pylint: disable=line-too-long
811
_CRYPT_PROTECT_DATA = ctypes.windll.crypt32.CryptProtectData
912
_CRYPT_UNPROTECT_DATA = ctypes.windll.crypt32.CryptUnprotectData
1013
_CRYPTPROTECT_UI_FORBIDDEN = 0x01

0 commit comments

Comments
 (0)