Skip to content

Instantly share code, notes, and snippets.

@FGFW
Created May 20, 2018 07:05
Show Gist options
  • Save FGFW/9463de49a9fd6025bb7bd5ee0c72545a to your computer and use it in GitHub Desktop.
Save FGFW/9463de49a9fd6025bb7bd5ee0c72545a to your computer and use it in GitHub Desktop.
nim GetSystemDirectory
proc GetSystemDirectory(lptstr:WideCString, usize:int):int32 {.stdcall,
dynlib: "kernel32", importc: "GetSystemDirectoryW".}
proc GetSystemDirectory():string =
var sysdir = newWideCString("",128)
echo GetSystemDirectory(sysdir,128)
result = $sysdir
echo result
discard GetSystemDirectory()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment