Skip to content

Instantly share code, notes, and snippets.

@Varriount
Created October 12, 2013 03:31
Show Gist options
  • Save Varriount/6945468 to your computer and use it in GitHub Desktop.
Save Varriount/6945468 to your computer and use it in GitHub Desktop.
# Functions for accessing the CryptRandGen functions
proc CryptGenRandom(
hProv:HCRYPTPROV,
dwLen:DWORD,
pbBuffer:ptr BYTE
):WINBOOL {.stdcall,
dynlib: "Advapi32", importc: "CryptGenRandom".}
proc CryptAcquireContext(
phProv:ptr HCRYPTPROV,
pszContainer:LPCTSTR,
pszProvider:LPCTSTR,
dwProvType:DWORD,
dwFlags:DWORD
):WINBOOL {.stdcall,
dynlib: "Advapi32", importc: "CryptAcquireContext".}
proc CryptReleaseContext(
hProv:HCRYPTPROV,
dwFlags:DWORD
):WINBOOL {.stdcall,
dynlib: "Advapi32", importc: "CryptReleaseContext".}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment