Commits

Jason R. Coombs  committed 0f5c9e8

Adding cred module

  • Participants
  • Parent commits f7624e8
  • Tags 2.5

Comments (0)

Files changed (2)

 ~~~
 
 * Moved timers module from jaraco.util.
+* Added jaraco.windows.cred with initial support for Windows Credential
+  Manager.
 
 2.4
 ~~~

File jaraco/windows/cred.py

+import ctypes.wintypes
+
+from . import error
+
+_CredDeleteW = ctypes.windll.advapi32.CredDeleteW
+_CredDeleteW.argtypes = (
+	ctypes.wintypes.LPCWSTR, # TargetName
+	ctypes.wintypes.DWORD, # Type
+	ctypes.wintypes.DWORD, # Flags
+)
+_CredDeleteW.restype = ctypes.wintypes.BOOL
+
+CRED_TYPE_GENERIC=1
+
+def CredDelete(TargetName, Type, Flags=0):
+	error.handle_nonzero_success(_CredDeleteW(TargetName, Type, Flags))