doc.go 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /*
  2. mkwinsyscall generates windows system call bodies
  3. It parses all files specified on command line containing function
  4. prototypes (like syscall_windows.go) and prints system call bodies
  5. to standard output.
  6. The prototypes are marked by lines beginning with "//sys" and read
  7. like func declarations if //sys is replaced by func, but:
  8. - The parameter lists must give a name for each argument. This
  9. includes return parameters.
  10. - The parameter lists must give a type for each argument:
  11. the (x, y, z int) shorthand is not allowed.
  12. - If the return parameter is an error number, it must be named err.
  13. - If go func name needs to be different from its winapi dll name,
  14. the winapi name could be specified at the end, after "=" sign, like
  15. //sys LoadLibrary(libname string) (handle uint32, err error) = LoadLibraryA
  16. - Each function that returns err needs to supply a condition, that
  17. return value of winapi will be tested against to detect failure.
  18. This would set err to windows "last-error", otherwise it will be nil.
  19. The value can be provided at end of //sys declaration, like
  20. //sys LoadLibrary(libname string) (handle uint32, err error) [failretval==-1] = LoadLibraryA
  21. and is [failretval==0] by default.
  22. - If the function name ends in a "?", then the function not existing is non-
  23. fatal, and an error will be returned instead of panicking.
  24. Usage:
  25. mkwinsyscall [flags] [path ...]
  26. Flags
  27. -output string
  28. Output file name (standard output if omitted).
  29. -sort
  30. Sort DLL and function declarations (default true).
  31. Intended to help transition from older versions of mkwinsyscall by making diffs
  32. easier to read and understand.
  33. -systemdll
  34. Whether all DLLs should be loaded from the Windows system directory (default true).
  35. -trace
  36. Generate print statement after every syscall.
  37. -utf16
  38. Encode string arguments as UTF-16 for syscalls not ending in 'A' or 'W' (default true).
  39. -winio
  40. Import this package ("github.com/Microsoft/go-winio").
  41. */
  42. package main