windows/kernel32

Windows Kernel32 declarations for synchronization, file and overlapped I/O, processes, threads, fibers, modules, timing, waits, completion ports, and UTF conversion.


Constants

Constant example

"windows/kernel32" use
"control" use

{} () {} [
  CREATE_ALWAYS printStack _:;
  WAIT_TIMEOUT printStack _:;
  CP_UTF8 printStack _:;
  CONDITION_VARIABLE_LOCKMODE_SHARED printStack _:;
] "main" exportFunction

Expected Output During Compilation

2
258n32
65001n32
1n32

Declared schemas

Schema example

"windows/kernel32" use
"control" use

{} () {} [
  PROCESS_INFORMATION fieldCount printStack _:;
  SYSTEM_INFO 6 fieldName printStack _:;
] "main" exportFunction

Expected Output During Compilation

4
"dwNumberOfProcessors"

Overlapped completion model


Arguments and result conventions


Handle ownership


Imported functions


Signature examples

Printing imported names during compilation shows the exact imported signatures.

"windows/kernel32" use
"control" use

{} Int32 {} [
  @CreateFileW printStack _:;
  @CreateProcessW printStack _:;
  @QueryPerformanceCounter printStack _:;
  0
] "main" exportFunction

Expected Output During Compilation

{lpFileName: Natx; dwDesiredAccess: Nat32; dwShareMode: Nat32; lpSecurityAttributes: {nLength: Nat32; lpSecurityDescriptor: Natx; bInheritHandle: Int32;} Ref; dwCreationDisposition: Nat32; dwFlagsAndAttributes: Nat32; hTemplateFile: Natx;} Natx {convention: "";} codeRef
{lpApplicationName: Natx; lpCommandLine: Natx; lpProcessAttributes: {nLength: Nat32; lpSecurityDescriptor: Natx; bInheritHandle: Int32;} Ref; lpThreadAttributes: {nLength: Nat32; lpSecurityDescriptor: Natx; bInheritHandle: Int32;} Ref; bInheritHandles: Int32; dwCreationFlags: Nat32; lpEnvironment: Natx; lpCurrentDirectory: Natx; lpStartupInfo: {cb: Nat32; lpReserved: Natx; lpDesktop: Natx; lpTitle: Natx; dwX: Nat32; dwY: Nat32; dwXSize: Nat32; dwYSize: Nat32; dwXCountChars: Nat32; dwYCountChars: Nat32; dwFillAttribute: Nat32; dwFlags: Nat32; wShowWindow: Nat16; cbReserved2: Nat16; lpReserved2: Natx; hStdInput: Natx; hStdOutput: Natx; hStdError: Natx;} Ref; lpProcessInformation: {hProcess: Natx; hThread: Natx; dwProcessId: Nat32; dwThreadId: Nat32;} Ref;} Int32 {convention: "";} codeRef
{lpPerformanceCount: Int64 Ref;} Int32 {convention: "";} codeRef

See also