1 // =================================
 2 // Copyright (c) 2021 Seppo Laakko
 3 // Distributed under the MIT license
 4 // =================================
 5 
 6 public extern cdecl nothrow ulong OsAllocateMemoryPage(ulong pageSize);
 7 public extern cdecl nothrow bool OsFreeMemoryPage(ulong pageAddress);
 8 public extern cdecl nothrow void OsCopyMemoryPage(ulong fromAddressulong toAddressulong pageSize);
 9 public extern cdecl nothrow void OsWriteMemoryByte(ulong addressbyte b);
10 public extern cdecl nothrow byte OsReadMemoryByte(ulong address);
11 public extern cdecl nothrow void* OsGetStdHandle(int stdInOutOrErr);
12 public extern cdecl nothrow bool OsRegisterConsoleCallback(void* consoleInputHandleulong callBackValue);
13 public extern cdecl nothrow bool OsReadConsoleInput(void* consoleInputHandleuchar* c);
14 public extern cdecl nothrow bool OsGetConsoleScreenBufferInfo(void* consoleOutputHandleint* cursorPosXint* cursorPosYint* screenSizeXint* screenSizeYushort* attrs);
15 public extern cdecl nothrow bool OsSetConsoleCursorPosition(void* consoleOutputHandleint cursorPosXint cursorPosY);
16 public extern cdecl nothrow bool OsSetConsoleTextAttribute(ushort attrs);
17 public extern cdecl nothrow void* OsCreateConsoleOutputHandle();
18 public extern cdecl nothrow bool OsWriteConsole(void* consoleOutputHandleconst uchar* chars);
19 public extern cdecl nothrow void* OsCreateHostFile(const char* filePathbool randomAccess);
20 public extern cdecl nothrow void* OsOpenHostFile(const char* filePathbool randomAccess);
21 public extern cdecl nothrow void OsCloseHostFile(void* fileHandle);
22 public extern cdecl nothrow void* OsCreateIoCompletionPort();
23 public extern cdecl nothrow void* OsAssociateFileWithCompletionPort(void* fileHandlevoid* completionPortulong completionKey);
24 public extern cdecl nothrow void OsCloseIoCompletionPort(void* completionPortHandle);
25 public extern cdecl nothrow bool OsGetQueuedCompletionStatus(void* completionPortHandleulong* numberOfBytesulong* completionKeyvoid** overlapped);
26 public extern cdecl nothrow bool OsPostQueuedCompletionStatus(void* completionPortHandleulong numberOfBytesulong completionKey);
27 public extern cdecl nothrow void* OsCreateOverlapped(ulong offset);
28 public extern cdecl nothrow void OsDestroyOverlapped(void* overlapped);
29 public extern cdecl nothrow bool OsReadFile(void* fileHandlevoid* bufferuint numberOfBytesToReadvoid* overlapped);
30 public extern cdecl nothrow bool OsWriteFile(void* fileHandlevoid* bufferuint numberOfBytesToWritevoid* overlapped);
31 public extern cdecl nothrow void* OsCreateEvent();
32 public extern cdecl nothrow void OsSetEvent(void* eventHandle);
33 public extern cdecl nothrow void OsResetEvent(void* eventHandle);
34 public extern cdecl nothrow void OsWaitEvent(void* eventHandle);
35 public extern cdecl nothrow void OsCloseEvent(void* eventHandle);
36 public extern cdecl nothrow int OsWaitForMultipleObjects(uint countvoid** handles);
37 public extern cdecl nothrow void* OsConvertThreadToFiber(void* param);
38 public extern cdecl nothrow void* OsCreateFiber(ulong stackSizevoid* startAddressvoid* param);
39 public extern cdecl nothrow void OsSwitchToFiber(void* fiber);
40 public extern cdecl nothrow void* OsGetFiberData();
41 public extern cdecl nothrow void OsDeleteFiber(void* fiber);
42 public extern cdecl nothrow ulong OsGetLastError();
43 public extern cdecl nothrow void OsFormatMessage(ulong errorCodechar* buffer);
44 public extern cdecl nothrow bool OsGetLogicalDrives(char* bufferint bufSize);
45 public extern cdecl nothrow uint OsGetDriveType(const char* rootPathName);
46 public extern cdecl nothrow long OsGetFileSize(void* fileHandle);
47 public extern cdecl nothrow uint OsGetFileAttributes(const char* filePath);
48 public extern cdecl nothrow void* OsFindFirstFile(const char* pathMaskchar* fileName);
49 public extern cdecl nothrow bool OsFindNextFile(void* findHandlechar* fileName);
50 public extern cdecl nothrow void OsFindClose(void* findHandle);
51 public extern cdecl nothrow bool OsGetFileTimes(const char* filePathbyte* ctimebyte* mtimebyte* atime);
52 public extern cdecl nothrow bool OsGetComputerName(char* bufferint size);
53 public extern cdecl nothrow int OsGetMaxComputerNameLength();