Get Cosmopolitan into releasable state

A new rollup tool now exists for flattening out the headers in a way
that works better for our purposes than cpp. A lot of the API clutter
has been removed. APIs that aren't a sure thing in terms of general
recommendation are now marked internal.

There's now a smoke test for the amalgamation archive and gigantic
header file. So we can now guarantee you can use this project on the
easiest difficulty setting without the gigantic repository.

A website is being created, which is currently a work in progress:
https://justine.storage.googleapis.com/cosmopolitan/index.html
This commit is contained in:
Justine Tunney 2020-11-25 08:19:00 -08:00
parent dba7552c1e
commit ea0b5d9d1c
775 changed files with 6864 additions and 3963 deletions

View file

@ -1,9 +1,11 @@
#ifndef COSMOPOLITAN_LIBC_NT_ACCOUNTING_H_
#define COSMOPOLITAN_LIBC_NT_ACCOUNTING_H_
#include "libc/nt/struct/filetime.h"
#include "libc/nt/struct/iocounters.h"
#include "libc/nt/struct/memorystatusex.h"
#include "libc/nt/thunk/msabi.h"
#if !(__ASSEMBLER__ + __LINKER__ + 0)
COSMOPOLITAN_C_START_
#if 0
/* ░░░░
@ -28,11 +30,6 @@ COSMOPOLITAN_C_START_
cosmopolitan § new technology » accounting
*/
#endif
struct NtFileTime;
struct NtIoCounters;
struct NtMemoryStatusEx;
int GetUserName(char16_t (*buf)[257], uint32_t *in_out_size);
bool32 GlobalMemoryStatusEx(struct NtMemoryStatusEx *lpBuffer);

View file

@ -2,7 +2,6 @@
#define COSMOPOLITAN_LIBC_NT_AUTOMATION_H_
#include "libc/nt/typedef/hookproc.h"
#include "libc/nt/typedef/wndenumproc.h"
#if 0
/* ░░░░
@ -27,7 +26,6 @@
cosmopolitan § new technology » aol hacking
*/
#endif
#if !(__ASSEMBLER__ + __LINKER__ + 0)
COSMOPOLITAN_C_START_

View file

@ -1,5 +1,5 @@
#ifndef COSMOPOLITAN_LIBC_NT_CODEGEN_H_
#define COSMOPOLITAN_LIBC_NT_CODEGEN_H_
#include "ape/idata.h"
#include "ape/idata.internal.h"
#include "ape/macros.h"
#endif /* COSMOPOLITAN_LIBC_NT_CODEGEN_H_ */

37
libc/nt/comdlg.h Normal file
View file

@ -0,0 +1,37 @@
#ifndef COSMOPOLITAN_LIBC_NT_COMDLG_H_
#define COSMOPOLITAN_LIBC_NT_COMDLG_H_
#include "libc/nt/struct/openfilename.h"
/* ░░░░
cosmopolitan § new technology » common dialogs
*/
#if !(__ASSEMBLER__ + __LINKER__ + 0)
COSMOPOLITAN_C_START_
bool32 GetOpenFileName(struct NtOpenFilename *arg);
bool32 GetSaveFileName(struct NtOpenFilename *arg);
COSMOPOLITAN_C_END_
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
#endif /* COSMOPOLITAN_LIBC_NT_COMDLG_H_ */

View file

@ -1,2 +1,15 @@
.include "o/libc/nt/codegen.inc"
.imp comdlg32,__imp_ChooseColorA,ChooseColorA,102
.text.windows
ChooseColorA:
push %rbp
mov %rsp,%rbp
.profilable
mov %rdi,%rcx
sub $32,%rsp
call *__imp_ChooseColorA(%rip)
leave
ret
.endfn ChooseColorA,globl
.previous

View file

@ -1,2 +1,15 @@
.include "o/libc/nt/codegen.inc"
.imp comdlg32,__imp_ChooseColorW,ChooseColorW,103
.text.windows
ChooseColor:
push %rbp
mov %rsp,%rbp
.profilable
mov %rdi,%rcx
sub $32,%rsp
call *__imp_ChooseColorW(%rip)
leave
ret
.endfn ChooseColor,globl
.previous

View file

@ -1,2 +1,15 @@
.include "o/libc/nt/codegen.inc"
.imp comdlg32,__imp_ChooseFontA,ChooseFontA,104
.text.windows
ChooseFontA:
push %rbp
mov %rsp,%rbp
.profilable
mov %rdi,%rcx
sub $32,%rsp
call *__imp_ChooseFontA(%rip)
leave
ret
.endfn ChooseFontA,globl
.previous

View file

@ -1,2 +1,15 @@
.include "o/libc/nt/codegen.inc"
.imp comdlg32,__imp_ChooseFontW,ChooseFontW,105
.text.windows
ChooseFont:
push %rbp
mov %rsp,%rbp
.profilable
mov %rdi,%rcx
sub $32,%rsp
call *__imp_ChooseFontW(%rip)
leave
ret
.endfn ChooseFont,globl
.previous

View file

@ -1,2 +1,12 @@
.include "o/libc/nt/codegen.inc"
.imp comdlg32,__imp_GetFileTitleA,GetFileTitleA,111
.text.windows
GetFileTitleA:
push %rbp
mov %rsp,%rbp
.profilable
mov __imp_GetFileTitleA(%rip),%rax
jmp __sysv2nt
.endfn GetFileTitleA,globl
.previous

View file

@ -1,2 +1,12 @@
.include "o/libc/nt/codegen.inc"
.imp comdlg32,__imp_GetFileTitleW,GetFileTitleW,112
.text.windows
GetFileTitle:
push %rbp
mov %rsp,%rbp
.profilable
mov __imp_GetFileTitleW(%rip),%rax
jmp __sysv2nt
.endfn GetFileTitle,globl
.previous

View file

@ -1,2 +1,15 @@
.include "o/libc/nt/codegen.inc"
.imp comdlg32,__imp_GetOpenFileNameA,GetOpenFileNameA,113
.text.windows
GetOpenFileNameA:
push %rbp
mov %rsp,%rbp
.profilable
mov %rdi,%rcx
sub $32,%rsp
call *__imp_GetOpenFileNameA(%rip)
leave
ret
.endfn GetOpenFileNameA,globl
.previous

View file

@ -1,2 +1,15 @@
.include "o/libc/nt/codegen.inc"
.imp comdlg32,__imp_GetOpenFileNameW,GetOpenFileNameW,114
.text.windows
GetOpenFileName:
push %rbp
mov %rsp,%rbp
.profilable
mov %rdi,%rcx
sub $32,%rsp
call *__imp_GetOpenFileNameW(%rip)
leave
ret
.endfn GetOpenFileName,globl
.previous

View file

@ -1,2 +1,15 @@
.include "o/libc/nt/codegen.inc"
.imp comdlg32,__imp_GetSaveFileNameA,GetSaveFileNameA,115
.text.windows
GetSaveFileNameA:
push %rbp
mov %rsp,%rbp
.profilable
mov %rdi,%rcx
sub $32,%rsp
call *__imp_GetSaveFileNameA(%rip)
leave
ret
.endfn GetSaveFileNameA,globl
.previous

View file

@ -1,2 +1,15 @@
.include "o/libc/nt/codegen.inc"
.imp comdlg32,__imp_GetSaveFileNameW,GetSaveFileNameW,116
.text.windows
GetSaveFileName:
push %rbp
mov %rsp,%rbp
.profilable
mov %rdi,%rcx
sub $32,%rsp
call *__imp_GetSaveFileNameW(%rip)
leave
ret
.endfn GetSaveFileName,globl
.previous

View file

@ -1,2 +1,15 @@
.include "o/libc/nt/codegen.inc"
.imp comdlg32,__imp_PrintDlgA,PrintDlgA,120
.text.windows
PrintDlgA:
push %rbp
mov %rsp,%rbp
.profilable
mov %rdi,%rcx
sub $32,%rsp
call *__imp_PrintDlgA(%rip)
leave
ret
.endfn PrintDlgA,globl
.previous

View file

@ -1,2 +1,15 @@
.include "o/libc/nt/codegen.inc"
.imp comdlg32,__imp_PrintDlgW,PrintDlgW,123
.text.windows
PrintDlg:
push %rbp
mov %rsp,%rbp
.profilable
mov %rdi,%rcx
sub $32,%rsp
call *__imp_PrintDlgW(%rip)
leave
ret
.endfn PrintDlg,globl
.previous

View file

@ -1,2 +1,15 @@
.include "o/libc/nt/codegen.inc"
.imp comdlg32,__imp_ReplaceTextA,ReplaceTextA,124
.text.windows
ReplaceTextA:
push %rbp
mov %rsp,%rbp
.profilable
mov %rdi,%rcx
sub $32,%rsp
call *__imp_ReplaceTextA(%rip)
leave
ret
.endfn ReplaceTextA,globl
.previous

View file

@ -1,2 +1,15 @@
.include "o/libc/nt/codegen.inc"
.imp comdlg32,__imp_ReplaceTextW,ReplaceTextW,125
.text.windows
ReplaceText:
push %rbp
mov %rsp,%rbp
.profilable
mov %rdi,%rcx
sub $32,%rsp
call *__imp_ReplaceTextW(%rip)
leave
ret
.endfn ReplaceText,globl
.previous

View file

@ -1,10 +1,15 @@
#ifndef COSMOPOLITAN_LIBC_NT_CONSOLE_H_
#define COSMOPOLITAN_LIBC_NT_CONSOLE_H_
#include "libc/nt/enum/consolemodeflags.h"
#include "libc/nt/struct/charinfo.h"
#include "libc/nt/struct/consolecursorinfo.h"
#include "libc/nt/struct/consolescreenbufferinfo.h"
#include "libc/nt/struct/consolescreenbufferinfoex.h"
#include "libc/nt/struct/consoleselectioninfo.h"
#include "libc/nt/struct/coord.h"
#include "libc/nt/struct/inputrecord.h"
#include "libc/nt/struct/smallrect.h"
#include "libc/nt/thunk/msabi.h"
#include "libc/nt/typedef/handlerroutine.h"
#if 0
/* ░░░░
@ -29,21 +34,12 @@
cosmopolitan § new technology » console
*/
#endif
#define kNtAttachParentProcess -1u
#if !(__ASSEMBLER__ + __LINKER__ + 0)
COSMOPOLITAN_C_START_
struct NtCharInfo;
struct NtConsoleCursorInfo;
struct NtConsoleScreenBufferInfo;
struct NtConsoleScreenBufferInfoEx;
struct NtConsoleSelectionInfo;
struct NtInputRecord;
struct NtSmallRect;
bool32 WriteConsoleOutput(int64_t hConsoleOutput,
const struct NtCharInfo *lpBuffer,
struct NtCoord dwBufferSize,

View file

@ -1,14 +1,9 @@
#ifndef COSMOPOLITAN_LIBC_NT_CREATEFILE_H_
#define COSMOPOLITAN_LIBC_NT_CREATEFILE_H_
#include "libc/nt/enum/accessmask.h"
#include "libc/nt/enum/creationdisposition.h"
#include "libc/nt/enum/fileflagandattributes.h"
#include "libc/nt/enum/filesharemode.h"
#include "libc/nt/struct/securityattributes.h"
#if !(__ASSEMBLER__ + __LINKER__ + 0)
COSMOPOLITAN_C_START_
struct NtSecurityAttributes;
int64_t CreateFile(
const char16_t *lpFileName, uint32_t dwDesiredAccess, uint32_t dwShareMode,
struct NtSecurityAttributes *opt_lpSecurityAttributes,

View file

@ -2,7 +2,6 @@
#define COSMOPOLITAN_LIBC_NT_DEBUG_H_
#if !(__ASSEMBLER__ + __LINKER__ + 0)
COSMOPOLITAN_C_START_
#if 0
/* ░░░░
@ -27,7 +26,6 @@ COSMOPOLITAN_C_START_
cosmopolitan § new technology » debugging
*/
#endif
/* Some of these APIs were moved to system.h and libc.h */
int32_t DebugBreakProcess(void *Process);

View file

@ -2,7 +2,6 @@
#define COSMOPOLITAN_LIBC_NT_DLL_H_
#if !(__ASSEMBLER__ + __LINKER__ + 0)
COSMOPOLITAN_C_START_
#if 0
/* ░░░░
@ -27,7 +26,6 @@ COSMOPOLITAN_C_START_
cosmopolitan § new technology » dynamic link libraries
*/
#endif
int64_t LoadLibrary(const char16_t *lpLibFileName);
int64_t LoadLibraryEx(const char16_t *lpLibFileName, int64_t hFile,

20
libc/nt/enum/bitblt.h Normal file
View file

@ -0,0 +1,20 @@
#ifndef COSMOPOLITAN_LIBC_NT_ENUM_BITBLT_H_
#define COSMOPOLITAN_LIBC_NT_ENUM_BITBLT_H_
#define kNtSrccopy 0x00CC0020u /* src */
#define kNtSrcpaint 0x00EE0086u /* src | dst */
#define kNtSrcand 0x008800C6u /* src & dst */
#define kNtSrcinvert 0x00660046u /* src ^ dst */
#define kNtSrcerase 0x00440328u /* src & ~dst */
#define kNtNotsrccopy 0x00330008u /* ~src */
#define kNtNotsrcerase 0x001100A6u /* ~src & ~dst */
#define kNtMergecopy 0x00C000CAu /* (src & pattern) */
#define kNtMergepaint 0x00BB0226u /* ~src | dst */
#define kNtPatcopy 0x00F00021u /* pat */
#define kNtPatpaint 0x00FB0A09u /* wut */
#define kNtPatinvert 0x005A0049u /* pat ^ dst */
#define kNtDstinvert 0x00550009u /* ~dst */
#define kNtBlackness 0x00000042u /* black */
#define kNtWhiteness 0x00FF0062u /* white */
#endif /* COSMOPOLITAN_LIBC_NT_ENUM_BITBLT_H_ */

7
libc/nt/enum/callback.h Normal file
View file

@ -0,0 +1,7 @@
#ifndef COSMOPOLITAN_LIBC_NT_ENUM_CALLBACK_H_
#define COSMOPOLITAN_LIBC_NT_ENUM_CALLBACK_H_
#define kNtCallbackChunkFinished 0
#define kNtCallbackStreamSwitch 1
#endif /* COSMOPOLITAN_LIBC_NT_ENUM_CALLBACK_H_ */

17
libc/nt/enum/copyfile.h Normal file
View file

@ -0,0 +1,17 @@
#ifndef COSMOPOLITAN_LIBC_NT_ENUM_COPYFILE_H_
#define COSMOPOLITAN_LIBC_NT_ENUM_COPYFILE_H_
#define kNtCopyFileFailIfExists 0x00000001
#define kNtCopyFileRestartable 0x00000002
#define kNtCopyFileOpenSourceForWrite 0x00000004
#define kNtCopyFileAllowDecryptedDestination 0x00000008
#define kNtCopyFileCopySymlink 0x00000800
#define kNtCopyFileNoBuffering 0x00001000
#define kNtCopyFileRequestSecurityPrivileges 0x00002000 /* Win8+ */
#define kNtCopyFileResumeFromPause 0x00004000 /* Win8+ */
#define kNtCopyFileRequestSecurityPrivileges 0x00002000 /* Win8+ */
#define kNtCopyFileNoOffload 0x00040000 /* Win8+ */
#define kNtCopyFileIgnoreEdpBlock 0x00400000 /* Win10+ */
#define kNtCopyFileIgnoreSourceEncryption 0x00800000 /* Win10+ */
#endif /* COSMOPOLITAN_LIBC_NT_ENUM_COPYFILE_H_ */

18
libc/nt/enum/cs.h Normal file
View file

@ -0,0 +1,18 @@
#ifndef COSMOPOLITAN_LIBC_NT_ENUM_CS_H_
#define COSMOPOLITAN_LIBC_NT_ENUM_CS_H_
#define kNtCsVredraw 0x00000001
#define kNtCsHredraw 0x00000002
#define kNtCsDblclks 0x00000008
#define kNtCsOwndc 0x00000020
#define kNtCsClassdc 0x00000040
#define kNtCsParentdc 0x00000080
#define kNtCsNoclose 0x00000200
#define kNtCsSavebits 0x00000800
#define kNtCsBytealignclient 0x00001000
#define kNtCsBytealignwindow 0x00002000
#define kNtCsGlobalclass 0x00004000
#define kNtCsIme 0x00010000
#define kNtCsDropshadow 0x00020000
#endif /* COSMOPOLITAN_LIBC_NT_ENUM_CS_H_ */

View file

@ -1,20 +1,16 @@
#ifndef COSMOPOLITAN_LIBC_NT_ENUM_DIALOGRESULT_H_
#define COSMOPOLITAN_LIBC_NT_ENUM_DIALOGRESULT_H_
#if !(__ASSEMBLER__ + __LINKER__ + 0)
enum DialogResult {
kNtIdok = 1,
kNtIdcancel = 2,
kNtIdabort = 3,
kNtIdretry = 4,
kNtIdignore = 5,
kNtIdyes = 6,
kNtIdno = 7,
kNtIdclose = 8,
kNtIdhelp = 9,
kNtIdtryagain = 10,
kNtIdcontinue = 11
};
#define kNtIdok 1
#define kNtIdcancel 2
#define kNtIdabort 3
#define kNtIdretry 4
#define kNtIdignore 5
#define kNtIdyes 6
#define kNtIdno 7
#define kNtIdclose 8
#define kNtIdhelp 9
#define kNtIdtryagain 10
#define kNtIdcontinue 11
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
#endif /* COSMOPOLITAN_LIBC_NT_ENUM_DIALOGRESULT_H_ */

View file

@ -1,15 +1,9 @@
#ifndef COSMOPOLITAN_LIBC_NT_ENUM_ERRORMODEFLAGS_H_
#define COSMOPOLITAN_LIBC_NT_ENUM_ERRORMODEFLAGS_H_
#if !(__ASSEMBLER__ + __LINKER__ + 0)
COSMOPOLITAN_C_START_
enum NtErrorModeFlags {
kNtErrorModeDefault = 0x0,
kNtSemFailcriticalerrors = 0x1,
kNtSemNogpfaulterrorbox = 0x2,
kNtSemNoopenfileerrorbox = 0x8000
};
#define kNtErrorModeDefault 0x0
#define kNtSemFailcriticalerrors 0x1
#define kNtSemNogpfaulterrorbox 0x2
#define kNtSemNoopenfileerrorbox 0x8000
COSMOPOLITAN_C_END_
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
#endif /* COSMOPOLITAN_LIBC_NT_ENUM_ERRORMODEFLAGS_H_ */

56
libc/nt/enum/event.h Normal file
View file

@ -0,0 +1,56 @@
#ifndef COSMOPOLITAN_LIBC_NT_ENUM_EVENT_H_
#define COSMOPOLITAN_LIBC_NT_ENUM_EVENT_H_
#define kNtEventSystemSound 0x0001
#define kNtEventSystemAlert 0x0002
#define kNtEventSystemForeground 0x0003
#define kNtEventSystemMenustart 0x0004
#define kNtEventSystemMenuend 0x0005
#define kNtEventSystemMenupopupstart 0x0006
#define kNtEventSystemMenupopupend 0x0007
#define kNtEventSystemCapturestart 0x0008
#define kNtEventSystemCaptureend 0x0009
#define kNtEventSystemMovesizestart 0x000A
#define kNtEventSystemMovesizeend 0x000B
#define kNtEventSystemContexthelpstart 0x000C
#define kNtEventSystemContexthelpend 0x000D
#define kNtEventSystemDragdropstart 0x000E
#define kNtEventSystemDragdropend 0x000F
#define kNtEventSystemDialogstart 0x0010
#define kNtEventSystemDialogend 0x0011
#define kNtEventSystemScrollingstart 0x0012
#define kNtEventSystemScrollingend 0x0013
#define kNtEventSystemSwitchstart 0x0014
#define kNtEventSystemSwitchend 0x0015
#define kNtEventSystemMinimizestart 0x0016
#define kNtEventSystemMinimizeend 0x0017
#define kNtEventConsoleCaret 0x4001
#define kNtEventConsoleUpdateRegion 0x4002
#define kNtEventConsoleUpdateSimple 0x4003
#define kNtEventConsoleUpdateScroll 0x4004
#define kNtEventConsoleLayout 0x4005
#define kNtEventConsoleStartApplication 0x4006
#define kNtEventConsoleEndApplication 0x4007
#define kNtEventObjectCreate 0x8000
#define kNtEventObjectDestroy 0x8001
#define kNtEventObjectShow 0x8002
#define kNtEventObjectHide 0x8003
#define kNtEventObjectReorder 0x8004
#define kNtEventObjectFocus 0x8005
#define kNtEventObjectSelection 0x8006
#define kNtEventObjectSelectionadd 0x8007
#define kNtEventObjectSelectionremove 0x8008
#define kNtEventObjectSelectionwithin 0x8009
#define kNtEventObjectStatechange 0x800A
#define kNtEventObjectLocationchange 0x800B
#define kNtEventObjectNamechange 0x800C
#define kNtEventObjectDescriptionchange 0x800D
#define kNtEventObjectValuechange 0x800E
#define kNtEventObjectParentchange 0x800F
#define kNtEventObjectHelpchange 0x8010
#define kNtEventObjectDefactionchange 0x8011
#define kNtEventObjectAcceleratorchange 0x8012
#endif /* COSMOPOLITAN_LIBC_NT_ENUM_EVENT_H_ */

View file

@ -1,8 +1,7 @@
#ifndef COSMOPOLITAN_LIBC_NT_ENUM_EVENTTYPE_H_
#define COSMOPOLITAN_LIBC_NT_ENUM_EVENTTYPE_H_
#if !(__ASSEMBLER__ + __LINKER__ + 0)
enum NtEventType { kNtNotificationEvent, kNtSynchronizationEvent };
#define kNtNotificationEvent 0
#define kNtSynchronizationEvent 1
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
#endif /* COSMOPOLITAN_LIBC_NT_ENUM_EVENTTYPE_H_ */

View file

@ -1,11 +1,7 @@
#ifndef COSMOPOLITAN_LIBC_NT_ENUM_FILELOCKFLAGS_H_
#define COSMOPOLITAN_LIBC_NT_ENUM_FILELOCKFLAGS_H_
#if !(__ASSEMBLER__ + __LINKER__ + 0)
enum NtFileLockFlags {
kNtLockfileFailImmediately = 1,
kNtLockfileExclusiveLock = 2,
};
#define kNtLockfileFailImmediately 1
#define kNtLockfileExclusiveLock 2
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
#endif /* COSMOPOLITAN_LIBC_NT_ENUM_FILELOCKFLAGS_H_ */

View file

@ -1,8 +1,8 @@
#ifndef COSMOPOLITAN_LIBC_NT_ENUM_FILEMOVEMETHOD_H_
#define COSMOPOLITAN_LIBC_NT_ENUM_FILEMOVEMETHOD_H_
#if !(__ASSEMBLER__ + __LINKER__ + 0)
enum NtFileMoveMethod { kNtFileBegin, kNtFileCurrent, kNtFileEnd };
#define kNtFileBegin 0
#define kNtFileCurrent 1
#define kNtFileEnd 2
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
#endif /* COSMOPOLITAN_LIBC_NT_ENUM_FILEMOVEMETHOD_H_ */

View file

@ -1,20 +1,10 @@
#ifndef COSMOPOLITAN_LIBC_NT_ENUM_FILETYPE_H_
#define COSMOPOLITAN_LIBC_NT_ENUM_FILETYPE_H_
#if !(__ASSEMBLER__ + __LINKER__ + 0)
/**
* NT Device File Types.
*
* @see GetFileType()
* @see libc/sysv/consts.sh
*/
enum NtFileType {
kNtFileTypeUnknown = 0x0000,
kNtFileTypeDisk = 0x0001, /* @see S_ISBLK() */
kNtFileTypeChar = 0x0002, /* @see S_ISCHR() */
kNtFileTypePipe = 0x0003, /* @see S_ISFIFO() */
kNtFileTypeRemote = 0x8000 /* unused -MSDN */
};
#define kNtFileTypeUnknown 0x0000
#define kNtFileTypeDisk 0x0001 /* @see S_ISBLK() */
#define kNtFileTypeChar 0x0002 /* @see S_ISCHR() */
#define kNtFileTypePipe 0x0003 /* @see S_ISFIFO() */
#define kNtFileTypeRemote 0x8000 /* unused -MSDN */
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
#endif /* COSMOPOLITAN_LIBC_NT_ENUM_FILETYPE_H_ */

View file

@ -1,12 +1,8 @@
#ifndef COSMOPOLITAN_LIBC_NT_ENUM_FINDEXINFOLEVELS_H_
#define COSMOPOLITAN_LIBC_NT_ENUM_FINDEXINFOLEVELS_H_
#if !(__ASSEMBLER__ + __LINKER__ + 0)
enum NtFindexInfoLevels {
kNtFindExInfoStandard,
kNtFindExInfoBasic,
kNtFindExInfoMaxInfoLevel
};
#define kNtFindExInfoStandard 0
#define kNtFindExInfoBasic 1
#define kNtFindExInfoMaxInfoLevel 2
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
#endif /* COSMOPOLITAN_LIBC_NT_ENUM_FINDEXINFOLEVELS_H_ */

View file

@ -1,13 +1,9 @@
#ifndef COSMOPOLITAN_LIBC_NT_ENUM_FINDEXSEARCHOPS_H_
#define COSMOPOLITAN_LIBC_NT_ENUM_FINDEXSEARCHOPS_H_
#if !(__ASSEMBLER__ + __LINKER__ + 0)
enum NtFindexSearchOps {
kNtFindExSearchNameMatch,
kNtFindExSearchLimitToDirectories,
kNtFindExSearchLimitToDevices,
kNtFindExSearchMaxSearchOp
};
#define kNtFindExSearchNameMatch 0
#define kNtFindExSearchLimitToDirectories 1
#define kNtFindExSearchLimitToDevices 2
#define kNtFindExSearchMaxSearchOp 3
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
#endif /* COSMOPOLITAN_LIBC_NT_ENUM_FINDEXSEARCHOPS_H_ */

View file

@ -1,16 +1,12 @@
#ifndef COSMOPOLITAN_LIBC_NT_ENUM_FORMATMESSAGEFLAGS_H_
#define COSMOPOLITAN_LIBC_NT_ENUM_FORMATMESSAGEFLAGS_H_
#if !(__ASSEMBLER__ + __LINKER__ + 0)
enum NtFormatMessageFlags {
kNtFormatMessageAllocateBuffer = 0x100,
kNtFormatMessageIgnoreInserts = 0x200,
kNtFormatMessageFromString = 0x400,
kNtFormatMessageFromHmodule = 0x800,
kNtFormatMessageFromSystem = 0x1000,
kNtFormatMessageArgumentArray = 0x2000,
kNtFormatMessageMaxWidthMask = 0xff
};
#define kNtFormatMessageAllocateBuffer 0x100
#define kNtFormatMessageIgnoreInserts 0x200
#define kNtFormatMessageFromString 0x400
#define kNtFormatMessageFromHmodule 0x800
#define kNtFormatMessageFromSystem 0x1000
#define kNtFormatMessageArgumentArray 0x2000
#define kNtFormatMessageMaxWidthMask 0xff
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
#endif /* COSMOPOLITAN_LIBC_NT_ENUM_FORMATMESSAGEFLAGS_H_ */

View file

@ -1,8 +1,6 @@
#ifndef COSMOPOLITAN_LIBC_NT_ENUM_GETFILEEXINFOLEVELS_H_
#define COSMOPOLITAN_LIBC_NT_ENUM_GETFILEEXINFOLEVELS_H_
#if !(__ASSEMBLER__ + __LINKER__ + 0)
enum NtGetFileexInfoLevels { kNtGetFileExInfoStandard, kNtGetFile_MAX };
#define kNtGetFileExInfoStandard 0
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
#endif /* COSMOPOLITAN_LIBC_NT_ENUM_GETFILEEXINFOLEVELS_H_ */

34
libc/nt/enum/ht.h Normal file
View file

@ -0,0 +1,34 @@
#ifndef COSMOPOLITAN_LIBC_NT_ENUM_HT_H_
#define COSMOPOLITAN_LIBC_NT_ENUM_HT_H_
#define kNtHterror -2
#define kNtHttransparent -1
#define kNtHtnowhere 0
#define kNtHtclient 1
#define kNtHtcaption 2
#define kNtHtsysmenu 3
#define kNtHtgrowbox 4
#define kNtHtsize kNtHtgrowbox
#define kNtHtmenu 5
#define kNtHthscroll 6
#define kNtHtvscroll 7
#define kNtHtminbutton 8
#define kNtHtmaxbutton 9
#define kNtHtleft 10
#define kNtHtright 11
#define kNtHttop 12
#define kNtHttopleft 13
#define kNtHttopright 14
#define kNtHtbottom 15
#define kNtHtbottomleft 16
#define kNtHtbottomright 17
#define kNtHtborder 18
#define kNtHtreduce kNtHtminbutton
#define kNtHtzoom kNtHtmaxbutton
#define kNtHtsizefirst kNtHtleft
#define kNtHtsizelast kNtHtbottomright
#define kNtHtobject 19
#define kNtHtclose 20
#define kNtHthelp 21
#endif /* COSMOPOLITAN_LIBC_NT_ENUM_HT_H_ */

View file

@ -1,8 +1,6 @@
#ifndef COSMOPOLITAN_LIBC_NT_ENUM_IMAGEAUXSYMBOLTYPE_H_
#define COSMOPOLITAN_LIBC_NT_ENUM_IMAGEAUXSYMBOLTYPE_H_
#if !(__ASSEMBLER__ + __LINKER__ + 0)
enum NtImageAuxSymbolType { IMAGE_AUX_SYMBOL_TYPE_TOKEN_DEF = 1 };
#define kNtImageAuxSymbolTypeTokenDef 1
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
#endif /* COSMOPOLITAN_LIBC_NT_ENUM_IMAGEAUXSYMBOLTYPE_H_ */

View file

@ -1,20 +1,15 @@
#ifndef COSMOPOLITAN_LIBC_NT_ENUM_JOBOBJECTINFOCLASS_H_
#define COSMOPOLITAN_LIBC_NT_ENUM_JOBOBJECTINFOCLASS_H_
#if !(__ASSEMBLER__ + __LINKER__ + 0)
enum NtJobObjectInfoClass {
kNtJobObjectBasicAccountingInformation = 1,
kNtJobObjectBasicLimitInformation,
kNtJobObjectBasicProcessIdList,
kNtJobObjectBasicUIRestrictions,
kNtJobObjectSecurityLimitInformation,
kNtJobObjectEndOfJobTimeInformation,
kNtJobObjectAssociateCompletionPortInformation,
kNtJobObjectBasicAndIoAccountingInformation,
kNtJobObjectExtendedLimitInformation,
kNtJobObjectJobSetInformation,
kNtJobObjectInfoClass_MAX
};
#define kNtJobObjectBasicAccountingInformation 1
#define kNtJobObjectBasicLimitInformation 2
#define kNtJobObjectBasicProcessIdList 3
#define kNtJobObjectBasicUIRestrictions 4
#define kNtJobObjectSecurityLimitInformation 5
#define kNtJobObjectEndOfJobTimeInformation 6
#define kNtJobObjectAssociateCompletionPortInformation 7
#define kNtJobObjectBasicAndIoAccountingInformation 8
#define kNtJobObjectExtendedLimitInformation 9
#define kNtJobObjectJobSetInformation 10
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
#endif /* COSMOPOLITAN_LIBC_NT_ENUM_JOBOBJECTINFOCLASS_H_ */

View file

@ -1,13 +1,9 @@
#ifndef COSMOPOLITAN_LIBC_NT_ENUM_KEYACCESS_H_
#define COSMOPOLITAN_LIBC_NT_ENUM_KEYACCESS_H_
#if !(__ASSEMBLER__ + __LINKER__ + 0)
enum NtKeyAccess {
kNtKeyRead = 0x00020019,
kNtKeyWrite = 0x00020006,
kNtKeyExecute = 0x00020019,
kNtKeyAllAccess = 0x000f003f
};
#define kNtKeyRead 0x00020019
#define kNtKeyWrite 0x00020006
#define kNtKeyExecute 0x00020019
#define kNtKeyAllAccess 0x000f003f
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
#endif /* COSMOPOLITAN_LIBC_NT_ENUM_KEYACCESS_H_ */

View file

@ -1,13 +1,9 @@
#ifndef COSMOPOLITAN_LIBC_NT_ENUM_KEYINFORMATIONCLASS_H_
#define COSMOPOLITAN_LIBC_NT_ENUM_KEYINFORMATIONCLASS_H_
#if !(__ASSEMBLER__ + __LINKER__ + 0)
enum NtKeyInformationClass {
kNtKeyBasicInformation,
kNtKeyNodeInformation,
kNtKeyFullInformation,
kNtKeyNameInformation
};
#define kNtKeyBasicInformation 0
#define kNtKeyNodeInformation 1
#define kNtKeyFullInformation 2
#define kNtKeyNameInformation 3
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
#endif /* COSMOPOLITAN_LIBC_NT_ENUM_KEYINFORMATIONCLASS_H_ */

44
libc/nt/enum/mb.h Normal file
View file

@ -0,0 +1,44 @@
#ifndef COSMOPOLITAN_LIBC_NT_ENUM_MB_H_
#define COSMOPOLITAN_LIBC_NT_ENUM_MB_H_
#if !(__ASSEMBLER__ + __LINKER__ + 0)
#define kNtMbOk 0x00000000
#define kNtMbOkcancel 0x00000001
#define kNtMbAbortretryignore 0x00000002
#define kNtMbYesnocancel 0x00000003
#define kNtMbYesno 0x00000004
#define kNtMbRetrycancel 0x00000005
#define kNtMbCanceltrycontinue 0x00000006
#define kNtMbIconhand 0x00000010
#define kNtMbIconquestion 0x00000020
#define kNtMbIconexclamation 0x00000030
#define kNtMbIconasterisk 0x00000040
#define kNtMbUsericon 0x00000080
#define kNtMbIconwarning kNtMbIconexclamation
#define kNtMbIconerror kNtMbIconhand
#define kNtMbIconinformation kNtMbIconasterisk
#define kNtMbIconstop kNtMbIconhand
#define kNtMbDefbutton1 0x00000000
#define kNtMbDefbutton2 0x00000100
#define kNtMbDefbutton3 0x00000200
#define kNtMbDefbutton4 0x00000300
#define kNtMbApplmodal 0x00000000
#define kNtMbSystemmodal 0x00001000
#define kNtMbTaskmodal 0x00002000
#define kNtMbHelp 0x00004000
#define kNtMbNofocus 0x00008000
#define kNtMbSetforeground 0x00010000
#define kNtMbDefaultDesktopOnly 0x00020000
#define kNtMbTopmost 0x00040000
#define kNtMbRight 0x00080000
#define kNtMbRtlreading 0x00100000
#define kNtMbServiceNotification 0x00200000
#define kNtMbServiceNotificationNt3x 0x00040000
#define kNtMbTypemask 0x0000000F
#define kNtMbIconmask 0x000000F0
#define kNtMbDefmask 0x00000F00
#define kNtMbModemask 0x00003000
#define kNtMbMiscmask 0x0000C000
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
#endif /* COSMOPOLITAN_LIBC_NT_ENUM_MB_H_ */

View file

@ -1,13 +1,9 @@
#ifndef COSMOPOLITAN_LIBC_NT_ENUM_MEMORYINFORMATIONCLASS_H_
#define COSMOPOLITAN_LIBC_NT_ENUM_MEMORYINFORMATIONCLASS_H_
#if !(__ASSEMBLER__ + __LINKER__ + 0)
enum NtMemoryInformationClass {
kNtMemoryBasicInformation,
kNtMemoryWorkingSetList,
kNtMemorySectionName,
kNtMemoryBasicVlmInformation
};
#define kNtMemoryBasicInformation 0
#define kNtMemoryWorkingSetList 1
#define kNtMemorySectionName 2
#define kNtMemoryBasicVlmInformation 3
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
#endif /* COSMOPOLITAN_LIBC_NT_ENUM_MEMORYINFORMATIONCLASS_H_ */

View file

@ -1,46 +0,0 @@
#ifndef COSMOPOLITAN_LIBC_NT_ENUM_MESSAGEBOXTYPE_H_
#define COSMOPOLITAN_LIBC_NT_ENUM_MESSAGEBOXTYPE_H_
#if !(__ASSEMBLER__ + __LINKER__ + 0)
enum MessageBoxType {
kNtMbOk = 0x00000000,
kNtMbOkcancel = 0x00000001,
kNtMbAbortretryignore = 0x00000002,
kNtMbYesnocancel = 0x00000003,
kNtMbYesno = 0x00000004,
kNtMbRetrycancel = 0x00000005,
kNtMbCanceltrycontinue = 0x00000006,
kNtMbIconhand = 0x00000010,
kNtMbIconquestion = 0x00000020,
kNtMbIconexclamation = 0x00000030,
kNtMbIconasterisk = 0x00000040,
kNtMbUsericon = 0x00000080,
kNtMbIconwarning = kNtMbIconexclamation,
kNtMbIconerror = kNtMbIconhand,
kNtMbIconinformation = kNtMbIconasterisk,
kNtMbIconstop = kNtMbIconhand,
kNtMbDefbutton1 = 0x00000000,
kNtMbDefbutton2 = 0x00000100,
kNtMbDefbutton3 = 0x00000200,
kNtMbDefbutton4 = 0x00000300,
kNtMbApplmodal = 0x00000000,
kNtMbSystemmodal = 0x00001000,
kNtMbTaskmodal = 0x00002000,
kNtMbHelp = 0x00004000,
kNtMbNofocus = 0x00008000,
kNtMbSetforeground = 0x00010000,
kNtMbDefaultDesktopOnly = 0x00020000,
kNtMbTopmost = 0x00040000,
kNtMbRight = 0x00080000,
kNtMbRtlreading = 0x00100000,
kNtMbServiceNotification = 0x00200000,
kNtMbServiceNotificationNt3x = 0x00040000,
kNtMbTypemask = 0x0000000F,
kNtMbIconmask = 0x000000F0,
kNtMbDefmask = 0x00000F00,
kNtMbModemask = 0x00003000,
kNtMbMiscmask = 0x0000C000
};
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
#endif /* COSMOPOLITAN_LIBC_NT_ENUM_MESSAGEBOXTYPE_H_ */

32
libc/nt/enum/mf.h Normal file
View file

@ -0,0 +1,32 @@
#ifndef COSMOPOLITAN_LIBC_NT_ENUM_MF_H_
#define COSMOPOLITAN_LIBC_NT_ENUM_MF_H_
#define kNtMfInsert 0x00000000
#define kNtMfChange 0x00000080
#define kNtMfAppend 0x00000100
#define kNtMfDelete 0x00000200
#define kNtMfRemove 0x00001000
#define kNtMfBycommand 0x00000000
#define kNtMfByposition 0x00000400
#define kNtMfSeparator 0x00000800
#define kNtMfEnabled 0x00000000
#define kNtMfGrayed 0x00000001
#define kNtMfDisabled 0x00000002
#define kNtMfUnchecked 0x00000000
#define kNtMfChecked 0x00000008
#define kNtMfUsecheckbitmaps 0x00000200
#define kNtMfString 0x00000000
#define kNtMfBitmap 0x00000004
#define kNtMfOwnerdraw 0x00000100
#define kNtMfPopup 0x00000010
#define kNtMfMenubarbreak 0x00000020
#define kNtMfMenubreak 0x00000040
#define kNtMfUnhilite 0x00000000
#define kNtMfHilite 0x00000080
#define kNtMfDefault 0x00001000
#define kNtMfSysmenu 0x00002000
#define kNtMfHelp 0x00004000
#define kNtMfRightjustify 0x00004000
#define kNtMfMouseselect 0x00008000
#endif /* COSMOPOLITAN_LIBC_NT_ENUM_MF_H_ */

12
libc/nt/enum/mk.h Normal file
View file

@ -0,0 +1,12 @@
#ifndef COSMOPOLITAN_LIBC_NT_ENUM_MK_H_
#define COSMOPOLITAN_LIBC_NT_ENUM_MK_H_
#define kNtMkLbutton 0x0001
#define kNtMkRbutton 0x0002
#define kNtMkShift 0x0004
#define kNtMkControl 0x0008
#define kNtMkMbutton 0x0010
#define kNtMkXbutton1 0x0020
#define kNtMkXbutton2 0x0040
#endif /* COSMOPOLITAN_LIBC_NT_ENUM_MK_H_ */

View file

@ -1,15 +1,11 @@
#ifndef COSMOPOLITAN_LIBC_NT_ENUM_MOVEFILEEXFLAGS_H_
#define COSMOPOLITAN_LIBC_NT_ENUM_MOVEFILEEXFLAGS_H_
#if !(__ASSEMBLER__ + __LINKER__ + 0)
enum NtMoveFileExFlags {
kNtMovefileReplaceExisting = 1,
kNtMovefileCopyAllowed = 2,
kNtMovefileDelayUntilReboot = 4,
kNtMovefileCreateHardlink = 16,
kNtMovefileFailIfNotTrackable = 32,
kNtMovefileWriteThrough = 8
};
#define kNtMovefileReplaceExisting 1
#define kNtMovefileCopyAllowed 2
#define kNtMovefileDelayUntilReboot 4
#define kNtMovefileCreateHardlink 16
#define kNtMovefileFailIfNotTrackable 32
#define kNtMovefileWriteThrough 8
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
#endif /* COSMOPOLITAN_LIBC_NT_ENUM_MOVEFILEEXFLAGS_H_ */

View file

@ -1,14 +1,10 @@
#ifndef COSMOPOLITAN_LIBC_NT_ENUM_OBJECTINFORMATIONCLASS_H_
#define COSMOPOLITAN_LIBC_NT_ENUM_OBJECTINFORMATIONCLASS_H_
#if !(__ASSEMBLER__ + __LINKER__ + 0)
enum NtObjectInformationClass {
kNtObjectBasicInformation, /*→ struct NtObjectBasicInformation */
kNtObjectNameInformation, /*→ etc. */
kNtObjectTypeInformation,
kNtObjectAllInformation,
kNtObjectDataInformation
};
#define kNtObjectBasicInformation 0 /*→ struct NtObjectBasicInformation */
#define kNtObjectNameInformation 1 /*→ etc. */
#define kNtObjectTypeInformation 2
#define kNtObjectAllInformation 3
#define kNtObjectDataInformation 4
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
#endif /* COSMOPOLITAN_LIBC_NT_ENUM_OBJECTINFORMATIONCLASS_H_ */

View file

@ -1,14 +1,10 @@
#ifndef COSMOPOLITAN_LIBC_NT_ENUM_OFFERPRIORITY_H_
#define COSMOPOLITAN_LIBC_NT_ENUM_OFFERPRIORITY_H_
#if !(__ASSEMBLER__ + __LINKER__ + 0)
enum NtOfferPriority {
/* TODO(jart): Are these values correct? */
kNtVmOfferPriorityVeryLow = 1, /* 0x00001000? */
kNtVmOfferPriorityLow, /* 0x00002000? */
kNtVmOfferPriorityBelowNormal, /* 0x00002000? */
kNtVmOfferPriorityNormal /* 0x00002000? */
};
/* TODO(jart): Are these values correct? */
#define kNtVmOfferPriorityVeryLow 1 /* 0x00001000? */
#define kNtVmOfferPriorityLow 2 /* 0x00002000? */
#define kNtVmOfferPriorityBelowNormal 3 /* 0x00002000? */
#define kNtVmOfferPriorityNormal 4 /* 0x00002000? */
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
#endif /* COSMOPOLITAN_LIBC_NT_ENUM_OFFERPRIORITY_H_ */

31
libc/nt/enum/ofn.h Normal file
View file

@ -0,0 +1,31 @@
#ifndef COSMOPOLITAN_LIBC_NT_ENUM_OFN_H_
#define COSMOPOLITAN_LIBC_NT_ENUM_OFN_H_
#define kNtOfnReadonly 0x00000001
#define kNtOfnOverwriteprompt 0x00000002
#define kNtOfnHidereadonly 0x00000004
#define kNtOfnNochangedir 0x00000008
#define kNtOfnShowhelp 0x00000010
#define kNtOfnEnablehook 0x00000020
#define kNtOfnEnabletemplate 0x00000040
#define kNtOfnEnabletemplatehandle 0x00000080
#define kNtOfnNovalidate 0x00000100
#define kNtOfnAllowmultiselect 0x00000200
#define kNtOfnExtensiondifferent 0x00000400
#define kNtOfnPathmustexist 0x00000800
#define kNtOfnFilemustexist 0x00001000
#define kNtOfnCreateprompt 0x00002000
#define kNtOfnShareaware 0x00004000
#define kNtOfnNoreadonlyreturn 0x00008000
#define kNtOfnNotestfilecreate 0x00010000
#define kNtOfnNonetworkbutton 0x00020000
#define kNtOfnNolongnames 0x00040000
#define kNtOfnExplorer 0x00080000
#define kNtOfnNodereferencelinks 0x00100000
#define kNtOfnLongnames 0x00200000
#define kNtOfnEnableincludenotify 0x00400000
#define kNtOfnEnablesizing 0x00800000
#define kNtOfnDontaddtorecent 0x02000000
#define kNtOfnForceshowhidden 0x10000000
#endif /* COSMOPOLITAN_LIBC_NT_ENUM_OFN_H_ */

View file

@ -1,21 +1,17 @@
#ifndef COSMOPOLITAN_LIBC_NT_ENUM_PROCESSINFOCLASS_H_
#define COSMOPOLITAN_LIBC_NT_ENUM_PROCESSINFOCLASS_H_
#if !(__ASSEMBLER__ + __LINKER__ + 0)
enum NtProcessInfoClass {
kNtProcessBasicInformation = 0,
kNtProcessQuotaLimits = 1,
kNtProcessIoCounters = 2,
kNtProcessVmCounters = 3,
kNtProcessTimes = 4,
kNtProcessBasePriority = 5,
kNtProcessRaisePriority = 6,
kNtProcessDebugPort = 7,
kNtProcessExceptionPort = 8,
kNtProcessAccessToken = 9,
kNtProcessWow64Information = 26,
kNtProcessImageFileName = 27
};
#define kNtProcessBasicInformation 0
#define kNtProcessQuotaLimits 1
#define kNtProcessIoCounters 2
#define kNtProcessVmCounters 3
#define kNtProcessTimes 4
#define kNtProcessBasePriority 5
#define kNtProcessRaisePriority 6
#define kNtProcessDebugPort 7
#define kNtProcessExceptionPort 8
#define kNtProcessAccessToken 9
#define kNtProcessWow64Information 26
#define kNtProcessImageFileName 27
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
#endif /* COSMOPOLITAN_LIBC_NT_ENUM_PROCESSINFOCLASS_H_ */

9
libc/nt/enum/progress.h Normal file
View file

@ -0,0 +1,9 @@
#ifndef COSMOPOLITAN_LIBC_NT_ENUM_PROGRESS_H_
#define COSMOPOLITAN_LIBC_NT_ENUM_PROGRESS_H_
#define kNtProgressContinue 0
#define kNtProgressCancel 1
#define kNtProgressStop 2
#define kNtProgressQuiet 3
#endif /* COSMOPOLITAN_LIBC_NT_ENUM_PROGRESS_H_ */

17
libc/nt/enum/rdw.h Normal file
View file

@ -0,0 +1,17 @@
#ifndef COSMOPOLITAN_LIBC_NT_ENUM_RDW_H_
#define COSMOPOLITAN_LIBC_NT_ENUM_RDW_H_
#define kNtRdwInvalidate 0x0001
#define kNtRdwInternalpaint 0x0002
#define kNtRdwErase 0x0004
#define kNtRdwValidate 0x0008
#define kNtRdwNointernalpaint 0x0010
#define kNtRdwNoerase 0x0020
#define kNtRdwNochildren 0x0040
#define kNtRdwAllchildren 0x0080
#define kNtRdwUpdatenow 0x0100
#define kNtRdwErasenow 0x0200
#define kNtRdwFrame 0x0400
#define kNtRdwNoframe 0x0800
#endif /* COSMOPOLITAN_LIBC_NT_ENUM_RDW_H_ */

View file

@ -1,24 +1,20 @@
#ifndef COSMOPOLITAN_LIBC_NT_ENUM_REGGETVALUEFLAGS_H_
#define COSMOPOLITAN_LIBC_NT_ENUM_REGGETVALUEFLAGS_H_
#if !(__ASSEMBLER__ + __LINKER__ + 0)
enum NtRegGetValueFlags {
kNtRrfRtRegNone = 0x00000001,
kNtRrfRtRegSz = 0x00000002,
kNtRrfRtRegExpandSz = 0x00000004,
kNtRrfRtRegBinary = 0x00000008,
kNtRrfRtRegDword = 0x00000010,
kNtRrfRtRegMultiSz = 0x00000020,
kNtRrfRtRegQword = 0x00000040,
kNtRrfRtDword = kNtRrfRtRegBinary | kNtRrfRtRegDword,
kNtRrfRtQword = kNtRrfRtRegBinary | kNtRrfRtRegQword,
kNtRrfRtAny = 0x0000ffff,
kNtRrfSubkeyWow6464key = 0x00010000,
kNtRrfSubkeyWow6432key = 0x00020000,
kNtRrfWow64Mask = 0x00030000,
kNtRrfNoexpand = 0x10000000,
kNtRrfZeroonfailure = 0x20000000
};
#define kNtRrfRtRegNone 0x00000001
#define kNtRrfRtRegSz 0x00000002
#define kNtRrfRtRegExpandSz 0x00000004
#define kNtRrfRtRegBinary 0x00000008
#define kNtRrfRtRegDword 0x00000010
#define kNtRrfRtRegMultiSz 0x00000020
#define kNtRrfRtRegQword 0x00000040
#define kNtRrfRtDword (kNtRrfRtRegBinary | kNtRrfRtRegDword)
#define kNtRrfRtQword (kNtRrfRtRegBinary | kNtRrfRtRegQword)
#define kNtRrfRtAny 0x0000ffff
#define kNtRrfSubkeyWow6464key 0x00010000
#define kNtRrfSubkeyWow6432key 0x00020000
#define kNtRrfWow64Mask 0x00030000
#define kNtRrfNoexpand 0x10000000
#define kNtRrfZeroonfailure 0x20000000
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
#endif /* COSMOPOLITAN_LIBC_NT_ENUM_REGGETVALUEFLAGS_H_ */

View file

@ -1,21 +1,17 @@
#ifndef COSMOPOLITAN_LIBC_NT_ENUM_REGTYPE_H_
#define COSMOPOLITAN_LIBC_NT_ENUM_REGTYPE_H_
#if !(__ASSEMBLER__ + __LINKER__ + 0)
enum NtRegType {
kNtRegNone = 0,
kNtRegSz = 1, /* UTF-16 NUL-terminated string */
kNtRegExpandSz = 2, /* UTF-16 NUL-terminated string w/ env vars refs */
kNtRegBinary = 3,
kNtRegDword = 4,
kNtRegDwordBigEndian = 5,
kNtRegLink = 6,
kNtRegMultiSz = 7, /* UTF-16 double-NUL-terminated string list */
kNtRegResourceList = 8,
kNtRegFullResourceDescriptor = 9,
kNtRegResourceRequirementsList = 10,
kNtRegQword = 11,
};
#define kNtRegNone 0
#define kNtRegSz 1 /* UTF-16 string */
#define kNtRegExpandSz 2 /* UTF-16 string w/ env vars refs */
#define kNtRegBinary 3
#define kNtRegDword 4
#define kNtRegDwordBigEndian 5
#define kNtRegLink 6
#define kNtRegMultiSz 7 /* UTF-16 double-nul-terminated */
#define kNtRegResourceList 8
#define kNtRegFullResourceDescriptor 9
#define kNtRegResourceRequirementsList 10
#define kNtRegQword 11
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
#endif /* COSMOPOLITAN_LIBC_NT_ENUM_REGTYPE_H_ */

View file

@ -0,0 +1,8 @@
#ifndef COSMOPOLITAN_LIBC_NT_ENUM_REPLACEFILE_H_
#define COSMOPOLITAN_LIBC_NT_ENUM_REPLACEFILE_H_
#define kNtReplacefileWriteThrough 1
#define kNtReplacefileIgnoreMergeErrors 2
#define kNtReplacefileIgnoreAclErrors 4
#endif /* COSMOPOLITAN_LIBC_NT_ENUM_REPLACEFILE_H_ */

25
libc/nt/enum/sc.h Normal file
View file

@ -0,0 +1,25 @@
#ifndef COSMOPOLITAN_LIBC_NT_ENUM_SC_H_
#define COSMOPOLITAN_LIBC_NT_ENUM_SC_H_
#define kNtScSize 0xF000
#define kNtScMove 0xF010
#define kNtScMinimize 0xF020
#define kNtScMaximize 0xF030
#define kNtScNextwindow 0xF040
#define kNtScPrevwindow 0xF050
#define kNtScClose 0xF060
#define kNtScVscroll 0xF070
#define kNtScHscroll 0xF080
#define kNtScMousemenu 0xF090
#define kNtScKeymenu 0xF100
#define kNtScArrange 0xF110
#define kNtScRestore 0xF120
#define kNtScTasklist 0xF130
#define kNtScScreensave 0xF140
#define kNtScHotkey 0xF150
#define kNtScDefault 0xF160
#define kNtScMonitorpower 0xF170
#define kNtScContexthelp 0xF180
#define kNtScSeparator 0xF00F
#endif /* COSMOPOLITAN_LIBC_NT_ENUM_SC_H_ */

View file

@ -1,11 +1,7 @@
#ifndef COSMOPOLITAN_LIBC_NT_ENUM_SECTIONINFORMATIONCLASS_H_
#define COSMOPOLITAN_LIBC_NT_ENUM_SECTIONINFORMATIONCLASS_H_
#if !(__ASSEMBLER__ + __LINKER__ + 0)
enum NtSectionInformationClass {
kNtSectionBasicInformation,
kNtSectionImageInformation
};
#define kNtSectionBasicInformation 0
#define kNtSectionImageInformation 1
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
#endif /* COSMOPOLITAN_LIBC_NT_ENUM_SECTIONINFORMATIONCLASS_H_ */

View file

@ -1,15 +1,11 @@
#ifndef COSMOPOLITAN_LIBC_NT_ENUM_SECTIONMAPFLAGS_H_
#define COSMOPOLITAN_LIBC_NT_ENUM_SECTIONMAPFLAGS_H_
#if !(__ASSEMBLER__ + __LINKER__ + 0)
enum NtSectionMapFlags {
kNtSectionQuery = 0x0001,
kNtSectionMapWrite = 0x0002,
kNtSectionMapRead = 0x0004,
kNtSectionMapExecute = 0x0008,
kNtSectionExtendSize = 0x0010,
kNtSectionMapExecuteExplicit = 0x0020
};
#define kNtSectionQuery 0x0001
#define kNtSectionMapWrite 0x0002
#define kNtSectionMapRead 0x0004
#define kNtSectionMapExecute 0x0008
#define kNtSectionExtendSize 0x0010
#define kNtSectionMapExecuteExplicit 0x0020
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
#endif /* COSMOPOLITAN_LIBC_NT_ENUM_SECTIONMAPFLAGS_H_ */

View file

@ -1,13 +1,9 @@
#ifndef COSMOPOLITAN_LIBC_NT_ENUM_SECURITYIMPERSONATIONLEVEL_H_
#define COSMOPOLITAN_LIBC_NT_ENUM_SECURITYIMPERSONATIONLEVEL_H_
#if !(__ASSEMBLER__ + __LINKER__ + 0)
enum NtSecurityImpersonationLevel {
kNtSecurityAnonymous,
kNtSecurityIdentification,
kNtSecurityImpersonation,
kNtSecurityDelegation
};
#define kNtSecurityAnonymous 0
#define kNtSecurityIdentification 1
#define kNtSecurityImpersonation 2
#define kNtSecurityDelegation 3
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
#endif /* COSMOPOLITAN_LIBC_NT_ENUM_SECURITYIMPERSONATIONLEVEL_H_ */

29
libc/nt/enum/signal.h Normal file
View file

@ -0,0 +1,29 @@
#ifndef COSMOPOLITAN_LIBC_NT_ENUM_SIGNAL_H_
#define COSMOPOLITAN_LIBC_NT_ENUM_SIGNAL_H_
#define kNtSignalBreakpoint 0x80000003u
#define kNtSignalIllegalInstruction 0xC000001Du
#define kNtSignalPrivInstruction 0xC0000096u
#define kNtSignalGuardPage 0x80000001u
#define kNtSignalAccessViolation 0xC0000005u
#define kNtSignalInPageError 0xC0000006u
#define kNtSignalInvalidHandle 0xC0000008u
#define kNtSignalInvalidParameter 0xC000000du
#define kNtSignalFltDenormalOperand 0xC000008Du
#define kNtSignalFltDivideByZero 0xC000008Eu
#define kNtSignalFltInexactResult 0xC000008Fu
#define kNtSignalFltInvalidOperation 0xC0000090u
#define kNtSignalFltOverflow 0xC0000091u
#define kNtSignalFltStackCheck 0xC0000092u
#define kNtSignalFltUnderflow 0xC0000093u
#define kNtSignalIntegerDivideByZero 0xC0000094u
#define kNtSignalDllNotFound 0xC0000135u
#define kNtSignalOrdinalNotFound 0xC0000138u
#define kNtSignalEntrypointNotFound 0xC0000139u
#define kNtSignalControlCExit 0xC000013Au
#define kNtSignalDllInitFailed 0xC0000142u
#define kNtSignalFloatMultipleFaults 0xC00002B4u
#define kNtSignalFloatMultipleTraps 0xC00002B5u
#define kNtSignalAssertionFailure 0xC0000420u
#endif /* COSMOPOLITAN_LIBC_NT_ENUM_SIGNAL_H_ */

10
libc/nt/enum/size.h Normal file
View file

@ -0,0 +1,10 @@
#ifndef COSMOPOLITAN_LIBC_NT_ENUM_SIZE_H_
#define COSMOPOLITAN_LIBC_NT_ENUM_SIZE_H_
#define kNtSizeRestored 0
#define kNtSizeMinimized 1
#define kNtSizeMaximized 2
#define kNtSizeMaxshow 3
#define kNtSizeMaxhide 4
#endif /* COSMOPOLITAN_LIBC_NT_ENUM_SIZE_H_ */

View file

@ -1,19 +1,13 @@
#ifndef COSMOPOLITAN_LIBC_NT_ENUM_THREADSTATE_H_
#define COSMOPOLITAN_LIBC_NT_ENUM_THREADSTATE_H_
#if !(__ASSEMBLER__ + __LINKER__ + 0)
COSMOPOLITAN_C_START_
enum NtThreadState {
kNtStateInitialized = 0,
kNtStateReady,
kNtStateRunning,
kNtStateStandby,
kNtStateTerminated,
kNtStateWait,
kNtStateTransition,
kNtStateUnknown
};
#define kNtStateInitialized 0
#define kNtStateReady 1
#define kNtStateRunning 2
#define kNtStateStandby 3
#define kNtStateTerminated 4
#define kNtStateWait 5
#define kNtStateTransition 6
#define kNtStateUnknown 7
COSMOPOLITAN_C_END_
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
#endif /* COSMOPOLITAN_LIBC_NT_ENUM_THREADSTATE_H_ */

View file

@ -1,8 +1,7 @@
#ifndef COSMOPOLITAN_LIBC_NT_ENUM_TOKENTYPE_H_
#define COSMOPOLITAN_LIBC_NT_ENUM_TOKENTYPE_H_
#if !(__ASSEMBLER__ + __LINKER__ + 0)
enum NtTokenType { kNtTokenPrimary = 1, kNtTokenImpersonation };
#define kNtTokenPrimary 1
#define kNtTokenImpersonation 2
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
#endif /* COSMOPOLITAN_LIBC_NT_ENUM_TOKENTYPE_H_ */

25
libc/nt/enum/tpm.h Normal file
View file

@ -0,0 +1,25 @@
#ifndef COSMOPOLITAN_LIBC_NT_ENUM_TPM_H_
#define COSMOPOLITAN_LIBC_NT_ENUM_TPM_H_
#define kNtTpmLeftbutton 0x00000
#define kNtTpmRightbutton 0x00002
#define kNtTpmLeftalign 0x00000
#define kNtTpmCenteralign 0x00004
#define kNtTpmRightalign 0x00008
#define kNtTpmTopalign 0x00000
#define kNtTpmVcenteralign 0x00010
#define kNtTpmBottomalign 0x00020
#define kNtTpmHorizontal 0x00000
#define kNtTpmVertical 0x00040
#define kNtTpmNonotify 0x00080
#define kNtTpmReturncmd 0x00100
#define kNtTpmRecurse 0x00001
#define kNtTpmHorposanimation 0x00400
#define kNtTpmHorneganimation 0x00800
#define kNtTpmVerposanimation 0x01000
#define kNtTpmVerneganimation 0x02000
#define kNtTpmNoanimation 0x04000
#define kNtTpmLayoutrtl 0x08000
#define kNtTpmWorkarea 0x10000
#endif /* COSMOPOLITAN_LIBC_NT_ENUM_TPM_H_ */

View file

@ -1,14 +1,10 @@
#ifndef COSMOPOLITAN_LIBC_NT_ENUM_VALUEINFORMATIONCLASS_H_
#define COSMOPOLITAN_LIBC_NT_ENUM_VALUEINFORMATIONCLASS_H_
#if !(__ASSEMBLER__ + __LINKER__ + 0)
enum NtKeyValueInformationClass {
kNtKeyValueBasicInformation,
kNtKeyValueFullInformation,
kNtKeyValuePartialInformation,
kNtKeyValueFullInformationAlign64,
kNtKeyValuePartialInformationAlign64
};
#define kNtKeyValueBasicInformation 0
#define kNtKeyValueFullInformation 1
#define kNtKeyValuePartialInformation 2
#define kNtKeyValueFullInformationAlign64 3
#define kNtKeyValuePartialInformationAlign64 4
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
#endif /* COSMOPOLITAN_LIBC_NT_ENUM_VALUEINFORMATIONCLASS_H_ */

182
libc/nt/enum/vk.h Normal file
View file

@ -0,0 +1,182 @@
#ifndef COSMOPOLITAN_LIBC_NT_ENUM_VK_H_
#define COSMOPOLITAN_LIBC_NT_ENUM_VK_H_
#define kNtVkLbutton 0x01
#define kNtVkRbutton 0x02
#define kNtVkCancel 0x03
#define kNtVkMbutton 0x04
#define kNtVkXbutton1 0x05
#define kNtVkXbutton2 0x06
#define kNtVkBack 0x08
#define kNtVkTab 0x09
#define kNtVkClear 0x0C
#define kNtVkReturn 0x0D
#define kNtVkShift 0x10
#define kNtVkControl 0x11
#define kNtVkMenu 0x12 /* alt? */
#define kNtVkPause 0x13
#define kNtVkCapital 0x14
#define kNtVkKana 0x15
#define kNtVkHangul 0x15
#define kNtVkJunja 0x17
#define kNtVkFinal 0x18
#define kNtVkHanja 0x19
#define kNtVkKanji 0x19
#define kNtVkEscape 0x1B
#define kNtVkConvert 0x1C
#define kNtVkNonconvert 0x1D
#define kNtVkAccept 0x1E
#define kNtVkModechange 0x1F
#define kNtVkSpace 0x20
#define kNtVkPrior 0x21
#define kNtVkNext 0x22
#define kNtVkEnd 0x23
#define kNtVkHome 0x24
#define kNtVkLeft 0x25
#define kNtVkUp 0x26
#define kNtVkRight 0x27
#define kNtVkDown 0x28
#define kNtVkSelect 0x29
#define kNtVkPrint 0x2A
#define kNtVkExecute 0x2B
#define kNtVkSnapshot 0x2C
#define kNtVkInsert 0x2D
#define kNtVkDelete 0x2E
#define kNtVkHelp 0x2F
#define kNtVkLwin 0x5B
#define kNtVkRwin 0x5C
#define kNtVkApps 0x5D
#define kNtVkSleep 0x5F
#define kNtVkNumpad0 0x60
#define kNtVkNumpad1 0x61
#define kNtVkNumpad2 0x62
#define kNtVkNumpad3 0x63
#define kNtVkNumpad4 0x64
#define kNtVkNumpad5 0x65
#define kNtVkNumpad6 0x66
#define kNtVkNumpad7 0x67
#define kNtVkNumpad8 0x68
#define kNtVkNumpad9 0x69
#define kNtVkMultiply 0x6A
#define kNtVkAdd 0x6B
#define kNtVkSeparator 0x6C
#define kNtVkSubtract 0x6D
#define kNtVkDecimal 0x6E
#define kNtVkDivide 0x6F
#define kNtVkF1 0x70
#define kNtVkF2 0x71
#define kNtVkF3 0x72
#define kNtVkF4 0x73
#define kNtVkF5 0x74
#define kNtVkF6 0x75
#define kNtVkF7 0x76
#define kNtVkF8 0x77
#define kNtVkF9 0x78
#define kNtVkF10 0x79
#define kNtVkF11 0x7A
#define kNtVkF12 0x7B
#define kNtVkF13 0x7C
#define kNtVkF14 0x7D
#define kNtVkF15 0x7E
#define kNtVkF16 0x7F
#define kNtVkF17 0x80
#define kNtVkF18 0x81
#define kNtVkF19 0x82
#define kNtVkF20 0x83
#define kNtVkF21 0x84
#define kNtVkF22 0x85
#define kNtVkF23 0x86
#define kNtVkF24 0x87
#define kNtVkNumlock 0x90
#define kNtVkScroll 0x91
#define kNtVkLshift 0xA0
#define kNtVkRshift 0xA1
#define kNtVkLcontrol 0xA2
#define kNtVkRcontrol 0xA3
#define kNtVkLmenu 0xA4
#define kNtVkRmenu 0xA5
#define kNtVkBrowserBack 0xA6
#define kNtVkBrowserForward 0xA7
#define kNtVkBrowserRefresh 0xA8
#define kNtVkBrowserStop 0xA9
#define kNtVkBrowserSearch 0xAA
#define kNtVkBrowserFavorites 0xAB
#define kNtVkBrowserHome 0xAC
#define kNtVkVolumeMute 0xAD
#define kNtVkVolumeDown 0xAE
#define kNtVkVolumeUp 0xAF
#define kNtVkMediaNextTrack 0xB0
#define kNtVkMediaPrevTrack 0xB1
#define kNtVkMediaStop 0xB2
#define kNtVkMediaPlayPause 0xB3
#define kNtVkLaunchMail 0xB4
#define kNtVkLaunchMediaSelect 0xB5
#define kNtVkLaunchApp1 0xB6
#define kNtVkLaunchApp2 0xB7
#define kNtVkOem_1 0xBA
#define kNtVkOemPlus 0xBB
#define kNtVkOemComma 0xBC
#define kNtVkOemMinus 0xBD
#define kNtVkOemPeriod 0xBE
#define kNtVkOem_2 0xBF
#define kNtVkOem_3 0xC0
#define kNtVkGamepadA 0xC3
#define kNtVkGamepadB 0xC4
#define kNtVkGamepadX 0xC5
#define kNtVkGamepadY 0xC6
#define kNtVkGamepadRightShoulder 0xC7
#define kNtVkGamepadLeftShoulder 0xC8
#define kNtVkGamepadLeftTrigger 0xC9
#define kNtVkGamepadRightTrigger 0xCA
#define kNtVkGamepadDpadUp 0xCB
#define kNtVkGamepadDpadDown 0xCC
#define kNtVkGamepadDpadLeft 0xCD
#define kNtVkGamepadDpadRight 0xCE
#define kNtVkGamepadMenu 0xCF
#define kNtVkGamepadView 0xD0
#define kNtVkGamepadLeftThumbstickButton 0xD1
#define kNtVkGamepadRightThumbstickButton 0xD2
#define kNtVkGamepadLeftThumbstickUp 0xD3
#define kNtVkGamepadLeftThumbstickDown 0xD4
#define kNtVkGamepadLeftThumbstickRight 0xD5
#define kNtVkGamepadLeftThumbstickLeft 0xD6
#define kNtVkGamepadRightThumbstickUp 0xD7
#define kNtVkGamepadRightThumbstickDown 0xD8
#define kNtVkGamepadRightThumbstickRight 0xD9
#define kNtVkGamepadRightThumbstickLeft 0xDA
#define kNtVkOem_4 0xDB
#define kNtVkOem_5 0xDC
#define kNtVkOem_6 0xDD
#define kNtVkOem_7 0xDE
#define kNtVkOem_8 0xDF
#define kNtVkOemAx 0xE1
#define kNtVkOem_102 0xE2
#define kNtVkIcoHelp 0xE3
#define kNtVkIco_00 0xE4
#define kNtVkProcesskey 0xE5
#define kNtVkIcoClear 0xE6
#define kNtVkPacket 0xE7
#define kNtVkOemReset 0xE9
#define kNtVkOemJump 0xEA
#define kNtVkOemPa1 0xEB
#define kNtVkOemPa2 0xEC
#define kNtVkOemPa3 0xED
#define kNtVkOemWsctrl 0xEE
#define kNtVkOemCusel 0xEF
#define kNtVkOemAttn 0xF0
#define kNtVkOemFinish 0xF1
#define kNtVkOemCopy 0xF2
#define kNtVkOemAuto 0xF3
#define kNtVkOemEnlw 0xF4
#define kNtVkOemBacktab 0xF5
#define kNtVkAttn 0xF6
#define kNtVkCrsel 0xF7
#define kNtVkExsel 0xF8
#define kNtVkEreof 0xF9
#define kNtVkPlay 0xFA
#define kNtVkZoom 0xFB
#define kNtVkNoname 0xFC
#define kNtVkPa1 0xFD
#define kNtVkOemClear 0xFE
#endif /* COSMOPOLITAN_LIBC_NT_ENUM_VK_H_ */

View file

@ -2,7 +2,6 @@
#define COSMOPOLITAN_LIBC_NT_EVENTS_H_
#include "libc/nt/struct/msg.h"
#include "libc/nt/struct/point.h"
#if 0
/* ░░░░
@ -27,59 +26,6 @@
cosmopolitan § new technology » events
*/
#endif
#define NT_EVENT_SYSTEM_SOUND 0x0001
#define NT_EVENT_SYSTEM_ALERT 0x0002
#define NT_EVENT_SYSTEM_FOREGROUND 0x0003
#define NT_EVENT_SYSTEM_MENUSTART 0x0004
#define NT_EVENT_SYSTEM_MENUEND 0x0005
#define NT_EVENT_SYSTEM_MENUPOPUPSTART 0x0006
#define NT_EVENT_SYSTEM_MENUPOPUPEND 0x0007
#define NT_EVENT_SYSTEM_CAPTURESTART 0x0008
#define NT_EVENT_SYSTEM_CAPTUREEND 0x0009
#define NT_EVENT_SYSTEM_MOVESIZESTART 0x000A
#define NT_EVENT_SYSTEM_MOVESIZEEND 0x000B
#define NT_EVENT_SYSTEM_CONTEXTHELPSTART 0x000C
#define NT_EVENT_SYSTEM_CONTEXTHELPEND 0x000D
#define NT_EVENT_SYSTEM_DRAGDROPSTART 0x000E
#define NT_EVENT_SYSTEM_DRAGDROPEND 0x000F
#define NT_EVENT_SYSTEM_DIALOGSTART 0x0010
#define NT_EVENT_SYSTEM_DIALOGEND 0x0011
#define NT_EVENT_SYSTEM_SCROLLINGSTART 0x0012
#define NT_EVENT_SYSTEM_SCROLLINGEND 0x0013
#define NT_EVENT_SYSTEM_SWITCHSTART 0x0014
#define NT_EVENT_SYSTEM_SWITCHEND 0x0015
#define NT_EVENT_SYSTEM_MINIMIZESTART 0x0016
#define NT_EVENT_SYSTEM_MINIMIZEEND 0x0017
#define NT_EVENT_CONSOLE_CARET 0x4001
#define NT_EVENT_CONSOLE_UPDATE_REGION 0x4002
#define NT_EVENT_CONSOLE_UPDATE_SIMPLE 0x4003
#define NT_EVENT_CONSOLE_UPDATE_SCROLL 0x4004
#define NT_EVENT_CONSOLE_LAYOUT 0x4005
#define NT_EVENT_CONSOLE_START_APPLICATION 0x4006
#define NT_EVENT_CONSOLE_END_APPLICATION 0x4007
#define NT_EVENT_OBJECT_CREATE 0x8000
#define NT_EVENT_OBJECT_DESTROY 0x8001
#define NT_EVENT_OBJECT_SHOW 0x8002
#define NT_EVENT_OBJECT_HIDE 0x8003
#define NT_EVENT_OBJECT_REORDER 0x8004
#define NT_EVENT_OBJECT_FOCUS 0x8005
#define NT_EVENT_OBJECT_SELECTION 0x8006
#define NT_EVENT_OBJECT_SELECTIONADD 0x8007
#define NT_EVENT_OBJECT_SELECTIONREMOVE 0x8008
#define NT_EVENT_OBJECT_SELECTIONWITHIN 0x8009
#define NT_EVENT_OBJECT_STATECHANGE 0x800A
#define NT_EVENT_OBJECT_LOCATIONCHANGE 0x800B
#define NT_EVENT_OBJECT_NAMECHANGE 0x800C
#define NT_EVENT_OBJECT_DESCRIPTIONCHANGE 0x800D
#define NT_EVENT_OBJECT_VALUECHANGE 0x800E
#define NT_EVENT_OBJECT_PARENTCHANGE 0x800F
#define NT_EVENT_OBJECT_HELPCHANGE 0x8010
#define NT_EVENT_OBJECT_DEFACTIONCHANGE 0x8011
#define NT_EVENT_OBJECT_ACCELERATORCHANGE 0x8012
#if !(__ASSEMBLER__ + __LINKER__ + 0)
COSMOPOLITAN_C_START_
@ -90,6 +36,8 @@ int32_t TranslateMessage(const struct NtMsg *lpMsg);
intptr_t DispatchMessage(const struct NtMsg *lpMsg);
void PostQuitMessage(int nExitCode);
bool32 GetCursorPos(struct NtPoint *lpPoint);
int64_t SendMessage(int64_t hWnd, uint32_t Msg, uint64_t wParam,
int64_t lParam);
COSMOPOLITAN_C_END_
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */

View file

@ -1,20 +1,15 @@
#ifndef COSMOPOLITAN_LIBC_NT_FILES_H_
#define COSMOPOLITAN_LIBC_NT_FILES_H_
#include "libc/nt/enum/accessmask.h"
#include "libc/nt/enum/fileinfobyhandleclass.h"
#include "libc/nt/enum/filemovemethod.h"
#include "libc/nt/enum/filesharemode.h"
#include "libc/nt/enum/findexinfolevels.h"
#include "libc/nt/enum/findexsearchops.h"
#include "libc/nt/enum/getfileexinfolevels.h"
#include "libc/nt/enum/movefileexflags.h"
#include "libc/nt/enum/securityimpersonationlevel.h"
#include "libc/nt/enum/securityinformation.h"
#include "libc/nt/enum/tokentype.h"
#include "libc/nt/struct/byhandlefileinformation.h"
#include "libc/nt/struct/filesegmentelement.h"
#include "libc/nt/struct/filetime.h"
#include "libc/nt/struct/genericmapping.h"
#include "libc/nt/struct/objectattributes.h"
#include "libc/nt/struct/overlapped.h"
#include "libc/nt/struct/privilegeset.h"
#include "libc/nt/struct/securityattributes.h"
#include "libc/nt/struct/win32finddata.h"
#include "libc/nt/thunk/msabi.h"
#if 0
/* ░░░░
@ -39,61 +34,21 @@
cosmopolitan § new technology » files
*/
#endif
/* CopyFileEx */
#define NT_PROGRESS_CONTINUE 0
#define NT_PROGRESS_CANCEL 1
#define NT_PROGRESS_STOP 2
#define NT_PROGRESS_QUIET 3
#define NT_CALLBACK_CHUNK_FINISHED 0x00000000
#define NT_CALLBACK_STREAM_SWITCH 0x00000001
#define NT_COPY_FILE_FAIL_IF_EXISTS 0x00000001
#define NT_COPY_FILE_RESTARTABLE 0x00000002
#define NT_COPY_FILE_OPEN_SOURCE_FOR_WRITE 0x00000004
#define NT_COPY_FILE_ALLOW_DECRYPTED_DESTINATION 0x00000008
#define NT_COPY_FILE_COPY_SYMLINK 0x00000800
#define NT_COPY_FILE_NO_BUFFERING 0x00001000
#define NT_COPY_FILE_REQUEST_SECURITY_PRIVILEGES 0x00002000 /* Win8+ */
#define NT_COPY_FILE_RESUME_FROM_PAUSE 0x00004000 /* Win8+ */
#define NT_COPY_FILE_REQUEST_SECURITY_PRIVILEGES 0x00002000 /* Win8+ */
#define NT_COPY_FILE_NO_OFFLOAD 0x00040000 /* Win8+ */
#define NT_COPY_FILE_IGNORE_EDP_BLOCK 0x00400000 /* Win10+ */
#define NT_COPY_FILE_IGNORE_SOURCE_ENCRYPTION 0x00800000 /* Win10+ */
#define kNtHandleFlagInherit 1 /* SetHandleInformation */
#define kNtHandleFlagProtectFromClose 2
/* ReplaceFile */
#define NT_REPLACEFILE_WRITE_THROUGH 0x00000001
#define NT_REPLACEFILE_IGNORE_MERGE_ERRORS 0x00000002
#define NT_REPLACEFILE_IGNORE_ACL_ERRORS 0x00000004
#define NT_REPLACEFILE_WRITE_THROUGH 0x00000001
#define NT_REPLACEFILE_IGNORE_MERGE_ERRORS 0x00000002
#define NT_REPLACEFILE_IGNORE_ACL_ERRORS 0x00000004
#define kNtFindFirstExCaseSensitive 1
#define kNtFindFirstExLargeFetch 2
/* SetHandleInformation */
#define kNtHandleFlagInherit 0x00000001
#define kNtHandleFlagProtectFromClose 0x00000002
#define kNtFindFirstExCaseSensitive 0x00000001
#define kNtFindFirstExLargeFetch 0x00000002
#define kNtDuplicateCloseSource 0x00000001
#define kNtDuplicateSameAccess 0x00000002
#define kNtDuplicateCloseSource 1
#define kNtDuplicateSameAccess 2
#define kNtSymbolicLinkFlagDirectory 1
#if !(__ASSEMBLER__ + __LINKER__ + 0)
COSMOPOLITAN_C_START_
struct NtByHandleFileInformation;
struct NtFileTime;
struct NtGenericMapping;
struct NtOverlapped;
struct NtPrivilegeSet;
struct NtSecurityAttributes;
struct NtSecurityDescriptor;
struct NtWin32FindData;
struct NtWin32FindData;
intptr_t LoadResource(int64_t hModule, int64_t hResInfo);
uint32_t SetHandleCount(uint32_t uNumber);
uint32_t GetLogicalDrives(void);
@ -111,8 +66,7 @@ bool32 CopyFile(const char16_t *lpExistingFileName,
bool32 MoveFile(const char16_t *lpExistingFileName,
const char16_t *lpNewFileName) paramsnonnull();
bool32 MoveFileEx(const char16_t *lpExistingFileName,
const char16_t *lpNewFileName, enum NtMoveFileExFlags dwFlags)
paramsnonnull();
const char16_t *lpNewFileName, int dwFlags) paramsnonnull();
bool32 SetCurrentDirectory(const char16_t *lpPathName);
uint32_t GetCurrentDirectory(uint32_t nBufferLength, char16_t *out_lpBuffer);
@ -128,7 +82,7 @@ bool32 DuplicateHandle(int64_t hSourceProcessHandle, int64_t hSourceHandle,
bool32 GetHandleInformation(int64_t hObject, uint32_t *out_lpdwFlags);
bool32 SetHandleInformation(int64_t hObject, uint32_t dwMask, uint32_t dwFlags);
enum NtFileType GetFileType(int64_t hFile);
int GetFileType(int64_t hFile);
bool32 GetFileInformationByHandleEx(int64_t hFile,
uint32_t FileInformationClass,
@ -140,8 +94,7 @@ bool32 GetFileInformationByHandle(
uint32_t GetFileAttributes(const char16_t *lpFileName);
bool32 GetFileAttributesEx(
const char16_t *lpFileName,
enum NtGetFileexInfoLevels fInfoLevelId /* kNtGetFileExInfoStandard */,
const char16_t *lpFileName, int fInfoLevelId /* kNtGetFileExInfoStandard */,
void *out_lpFileInformation /* → struct NtWin32FileAttributeData * */)
paramsnonnull();
@ -187,10 +140,9 @@ bool32 CreateSymbolicLink(const char16_t *lpSymlinkFileName,
uint32_t SetFilePointer(int64_t hFile, int32_t lDistanceToMove,
int32_t *optional_lpDistanceToMoveHigh,
enum NtFileMoveMethod dwMoveMethod);
int dwMoveMethod);
bool32 SetFilePointerEx(int64_t hFile, int64_t liDistanceToMove,
int64_t *optional_lpNewFilePointer,
enum NtFileMoveMethod dwMoveMethod);
int64_t *optional_lpNewFilePointer, int dwMoveMethod);
bool32 SetEndOfFile(int64_t hFile);
bool32 SetFileValidData(int64_t hFile, int64_t ValidDataLength);
@ -202,13 +154,12 @@ bool32 GetFileSecurity(const char16_t *lpFileName,
bool32 OpenProcessToken(int64_t hProcessHandle, uint32_t dwDesiredAccess,
int64_t *out_hTokenHandle);
bool32 DuplicateToken(int64_t hExistingTokenHandle,
enum NtSecurityImpersonationLevel dwImpersonationLevel,
bool32 DuplicateToken(int64_t hExistingTokenHandle, int dwImpersonationLevel,
int64_t *out_hDuplicateTokenHandle);
bool32 DuplicateTokenEx(int64_t hExistingToken, unsigned int dwDesiredAccess,
struct NtSecurityAttributes *lpTokenAttributes,
enum NtSecurityImpersonationLevel ImpersonationLevel,
enum NtTokenType TokenType, int64_t *out_phNewToken);
int ImpersonationLevel, int TokenType,
int64_t *out_phNewToken);
bool32 AccessCheck(struct NtSecurityDescriptor *pSecurityDescriptor,
int64_t ClientToken, unsigned int DesiredAccess,
@ -222,10 +173,8 @@ void MapGenericMask(uint32_t *AccessMask,
int64_t FindFirstFile(const char16_t *lpFileName,
struct NtWin32FindData *out_lpFindFileData);
int64_t FindFirstFileEx(const char16_t *lpFileName,
enum NtFindexInfoLevels fInfoLevelId,
void *out_lpFindFileData,
enum NtFindexSearchOps fSearchOp,
int64_t FindFirstFileEx(const char16_t *lpFileName, int fInfoLevelId,
void *out_lpFindFileData, int fSearchOp,
void *reserved_lpSearchFilter,
uint32_t dwAdditionalFlags);
bool32 FindNextFile(int64_t hFindFile,

View file

@ -1,2 +1,12 @@
.include "o/libc/nt/codegen.inc"
.imp gdi32,__imp_CreateCompatibleBitmap,CreateCompatibleBitmap,1063
.text.windows
CreateCompatibleBitmap:
push %rbp
mov %rsp,%rbp
.profilable
mov __imp_CreateCompatibleBitmap(%rip),%rax
jmp __sysv2nt
.endfn CreateCompatibleBitmap,globl
.previous

View file

@ -1,2 +1,15 @@
.include "o/libc/nt/codegen.inc"
.imp gdi32,__imp_CreateCompatibleDC,CreateCompatibleDC,1064
.text.windows
CreateCompatibleDC:
push %rbp
mov %rsp,%rbp
.profilable
mov %rdi,%rcx
sub $32,%rsp
call *__imp_CreateCompatibleDC(%rip)
leave
ret
.endfn CreateCompatibleDC,globl
.previous

View file

@ -1,2 +1,15 @@
.include "o/libc/nt/codegen.inc"
.imp gdi32,__imp_DeleteDC,DeleteDC,1384
.text.windows
DeleteDC:
push %rbp
mov %rsp,%rbp
.profilable
mov %rdi,%rcx
sub $32,%rsp
call *__imp_DeleteDC(%rip)
leave
ret
.endfn DeleteDC,globl
.previous

View file

@ -1,2 +1,15 @@
.include "o/libc/nt/codegen.inc"
.imp gdi32,__imp_DeleteObject,DeleteObject,1387
.text.windows
DeleteObject:
push %rbp
mov %rsp,%rbp
.profilable
mov %rdi,%rcx
sub $32,%rsp
call *__imp_DeleteObject(%rip)
leave
ret
.endfn DeleteObject,globl
.previous

View file

@ -1,2 +1,12 @@
.include "o/libc/nt/codegen.inc"
.imp gdi32,__imp_GetPixel,GetPixel,1691
.text.windows
GetPixel:
push %rbp
mov %rsp,%rbp
.profilable
mov __imp_GetPixel(%rip),%rax
jmp __sysv2nt
.endfn GetPixel,globl
.previous

View file

@ -1,2 +1,12 @@
.include "o/libc/nt/codegen.inc"
.imp gdi32,__imp_RestoreDC,RestoreDC,1808
.text.windows
RestoreDC:
push %rbp
mov %rsp,%rbp
.profilable
mov __imp_RestoreDC(%rip),%rax
jmp __sysv2nt
.endfn RestoreDC,globl
.previous

View file

@ -1,2 +1,15 @@
.include "o/libc/nt/codegen.inc"
.imp gdi32,__imp_SaveDC,SaveDC,1815
.text.windows
SaveDC:
push %rbp
mov %rsp,%rbp
.profilable
mov %rdi,%rcx
sub $32,%rsp
call *__imp_SaveDC(%rip)
leave
ret
.endfn SaveDC,globl
.previous

View file

@ -1,2 +1,12 @@
.include "o/libc/nt/codegen.inc"
.imp gdi32,__imp_SelectObject,SelectObject,1864
.text.windows
SelectObject:
push %rbp
mov %rsp,%rbp
.profilable
mov __imp_SelectObject(%rip),%rax
jmp __sysv2nt
.endfn SelectObject,globl
.previous

View file

@ -1,2 +1,12 @@
.include "o/libc/nt/codegen.inc"
.imp gdi32,__imp_SetPixel,SetPixel,1901
.text.windows
SetPixel:
push %rbp
mov %rsp,%rbp
.profilable
mov __imp_SetPixel(%rip),%rax
jmp __sysv2nt
.endfn SetPixel,globl
.previous

View file

@ -2,7 +2,6 @@
#define COSMOPOLITAN_LIBC_NT_IOCP_H_
#include "libc/nt/struct/overlapped.h"
#include "libc/nt/struct/overlappedentry.h"
#if 0
/* ░░░░
@ -27,7 +26,6 @@
cosmopolitan § new technology » i/o completion ports
*/
#endif
#define kNtFileSkipCompletionPortOnSuccess 1
#define kNtFileSkipSetEventOnHandle 2

View file

@ -1,6 +1,7 @@
#ifndef COSMOPOLITAN_LIBC_NT_IPC_H_
#define COSMOPOLITAN_LIBC_NT_IPC_H_
#if 0
#include "libc/nt/struct/overlapped.h"
#include "libc/nt/struct/securityattributes.h"
/* ░░░░
@ -25,7 +26,6 @@
cosmopolitan § new technology » ipc
*/
#endif
/* CreateNamedPipe:dwOpenMode */
#define kNtPipeAccessInbound 0x00000001
@ -52,9 +52,6 @@
#if !(__ASSEMBLER__ + __LINKER__ + 0)
COSMOPOLITAN_C_START_
struct NtOverlapped;
struct NtSecurityAttributes;
bool32 CreatePipe(int64_t *out_hReadPipe, int64_t *out_hWritePipe,
const struct NtSecurityAttributes *opt_lpPipeAttributes,
uint32_t nSize) paramsnonnull((1, 2));

View file

@ -151,8 +151,8 @@ imp 'AppXPostSuccessExtension' AppXPostSuccessExtension KernelBase 65
imp 'AppXPreCreationExtension' AppXPreCreationExtension KernelBase 66
imp 'AppXReleaseAppXContext' AppXReleaseAppXContext KernelBase 67
imp 'AppXUpdatePackageCapabilities' AppXUpdatePackageCapabilities KernelBase 68
imp 'AppendMenuA' AppendMenuA user32 1515
imp 'AppendMenu' AppendMenuW user32 1516
imp 'AppendMenuA' AppendMenuA user32 1515 4
imp 'AppendMenu' AppendMenuW user32 1516 4
imp 'ApplicationRecoveryFinished' ApplicationRecoveryFinished kernel32 34
imp 'ApplicationRecoveryInProgress' ApplicationRecoveryInProgress kernel32 35
imp 'ApplicationUserModelIdFromProductId' ApplicationUserModelIdFromProductId KernelBase 69
@ -409,10 +409,10 @@ imp 'CheckTokenMembershipEx' CheckTokenMembershipEx KernelBase 128
imp 'CheckWindowThreadDesktop' CheckWindowThreadDesktop user32 1580
imp 'ChildWindowFromPoint' ChildWindowFromPoint user32 1581
imp 'ChildWindowFromPointEx' ChildWindowFromPointEx user32 1582
imp 'ChooseColorA' ChooseColorA comdlg32 102
imp 'ChooseColor' ChooseColorW comdlg32 103
imp 'ChooseFontA' ChooseFontA comdlg32 104
imp 'ChooseFont' ChooseFontW comdlg32 105
imp 'ChooseColorA' ChooseColorA comdlg32 102 1
imp 'ChooseColor' ChooseColorW comdlg32 103 1
imp 'ChooseFontA' ChooseFontA comdlg32 104 1
imp 'ChooseFont' ChooseFontW comdlg32 105 1
imp 'ChoosePixelFormat' ChoosePixelFormat gdi32 1040
imp 'Chord' Chord gdi32 1041
imp 'ChrCmpIA' ChrCmpIA KernelBase 129
@ -557,8 +557,8 @@ imp 'CreateCaret' CreateCaret user32 1603
imp 'CreateCodeAuthzLevel' CreateCodeAuthzLevel advapi32 1136
imp 'CreateColorSpaceA' CreateColorSpaceA gdi32 1061
imp 'CreateColorSpace' CreateColorSpaceW gdi32 1062
imp 'CreateCompatibleBitmap' CreateCompatibleBitmap gdi32 1063
imp 'CreateCompatibleDC' CreateCompatibleDC gdi32 1064
imp 'CreateCompatibleBitmap' CreateCompatibleBitmap gdi32 1063 3
imp 'CreateCompatibleDC' CreateCompatibleDC gdi32 1064 1
imp 'CreateConsoleScreenBuffer' CreateConsoleScreenBuffer KernelBase 176
imp 'CreateCursor' CreateCursor user32 1604
imp 'CreateDCA' CreateDCA gdi32 1065
@ -634,7 +634,7 @@ imp 'CreateMDIWindow' CreateMDIWindowW user32 1620
imp 'CreateMailslotA' CreateMailslotA kernel32 212
imp 'CreateMailslot' CreateMailslotW kernel32 213
imp 'CreateMemoryResourceNotification' CreateMemoryResourceNotification KernelBase 196
imp 'CreateMenu' CreateMenu user32 1621
imp 'CreateMenu' CreateMenu user32 1621 0
imp 'CreateMetaFileA' CreateMetaFileA gdi32 1087
imp 'CreateMetaFile' CreateMetaFileW gdi32 1088
imp 'CreateMutex' CreateMutexW KernelBase 200
@ -653,7 +653,7 @@ imp 'CreatePenIndirect' CreatePenIndirect gdi32 1094
imp 'CreatePipe' CreatePipe KernelBase 202 4
imp 'CreatePolyPolygonRgn' CreatePolyPolygonRgn gdi32 1095
imp 'CreatePolygonRgn' CreatePolygonRgn gdi32 1096
imp 'CreatePopupMenu' CreatePopupMenu user32 1622
imp 'CreatePopupMenu' CreatePopupMenu user32 1622 0
imp 'CreatePrivateNamespaceA' CreatePrivateNamespaceA kernel32 222
imp 'CreatePrivateNamespace' CreatePrivateNamespaceW KernelBase 203
imp 'CreatePrivateObjectSecurity' CreatePrivateObjectSecurity KernelBase 204
@ -1193,7 +1193,7 @@ imp 'DeleteAce' DeleteAce KernelBase 248
imp 'DeleteAtom' DeleteAtom kernel32 270
imp 'DeleteBoundaryDescriptor' DeleteBoundaryDescriptor KernelBase 249
imp 'DeleteColorSpace' DeleteColorSpace gdi32 1383
imp 'DeleteDC' DeleteDC gdi32 1384
imp 'DeleteDC' DeleteDC gdi32 1384 1
imp 'DeleteEnclave' DeleteEnclave KernelBase 251
imp 'DeleteEnhMetaFile' DeleteEnhMetaFile gdi32 1385
imp 'DeleteFiber' DeleteFiber KernelBase 252
@ -1201,9 +1201,9 @@ imp 'DeleteFile' DeleteFileW KernelBase 254 1
imp 'DeleteFileA' DeleteFileA KernelBase 253 1
imp 'DeleteFileTransactedA' DeleteFileTransactedA kernel32 275
imp 'DeleteFileTransacted' DeleteFileTransactedW kernel32 276
imp 'DeleteMenu' DeleteMenu user32 1681
imp 'DeleteMenu' DeleteMenu user32 1681 3
imp 'DeleteMetaFile' DeleteMetaFile gdi32 1386
imp 'DeleteObject' DeleteObject gdi32 1387
imp 'DeleteObject' DeleteObject gdi32 1387 1
imp 'DeleteProcThreadAttributeList' DeleteProcThreadAttributeList KernelBase 255 1
imp 'DeleteService' DeleteService advapi32 1238
imp 'DeleteStateAtomValue' DeleteStateAtomValue KernelBase 256
@ -1227,7 +1227,7 @@ imp 'DestroyCaret' DestroyCaret user32 1684
imp 'DestroyCursor' DestroyCursor user32 1685
imp 'DestroyDCompositionHwndTarget' DestroyDCompositionHwndTarget user32 1686
imp 'DestroyIcon' DestroyIcon user32 1687
imp 'DestroyMenu' DestroyMenu user32 1688
imp 'DestroyMenu' DestroyMenu user32 1688 1
imp 'DestroyOPMProtectedOutput' DestroyOPMProtectedOutput gdi32 1389
imp 'DestroyPalmRejectionDelayZone' DestroyPalmRejectionDelayZone user32 1504
imp 'DestroyPhysicalMonitorInternal' DestroyPhysicalMonitorInternal gdi32 1390
@ -2055,7 +2055,7 @@ imp 'GetCurrentThread' GetCurrentThread KernelBase 505 0
imp 'GetCurrentThreadId' GetCurrentThreadId KernelBase 506 0
imp 'GetCurrentThreadStackLimits' GetCurrentThreadStackLimits KernelBase 507
imp 'GetCurrentUmsThread' GetCurrentUmsThread kernel32 547
imp 'GetCursor' GetCursor user32 1826
imp 'GetCursor' GetCursor user32 1826 0
imp 'GetCursorFrameInfo' GetCursorFrameInfo user32 1827
imp 'GetCursorInfo' GetCursorInfo user32 1828
imp 'GetCursorPos' GetCursorPos user32 1829 1
@ -2165,8 +2165,8 @@ imp 'GetFileSecurityA' GetFileSecurityA advapi32 1326 5
imp 'GetFileSize' GetFileSize KernelBase 552 m
imp 'GetFileSizeEx' GetFileSizeEx KernelBase 553 m
imp 'GetFileTime' GetFileTime KernelBase 554 4
imp 'GetFileTitleA' GetFileTitleA comdlg32 111
imp 'GetFileTitle' GetFileTitleW comdlg32 112
imp 'GetFileTitleA' GetFileTitleA comdlg32 111 3
imp 'GetFileTitle' GetFileTitleW comdlg32 112 3
imp 'GetFileType' GetFileType KernelBase 555 1
imp 'GetFileVersionInfoA' GetFileVersionInfoA KernelBase 556
imp 'GetFileVersionInfoByHandle' GetFileVersionInfoByHandle KernelBase 557
@ -2240,7 +2240,7 @@ imp 'GetKerningPairsA' GetKerningPairsA gdi32 1666
imp 'GetKerningPairs' GetKerningPairsW gdi32 1667
imp 'GetKeyNameTextA' GetKeyNameTextA user32 1864
imp 'GetKeyNameText' GetKeyNameTextW user32 1865
imp 'GetKeyState' GetKeyState user32 1866
imp 'GetKeyState' GetKeyState user32 1866 1
imp 'GetKeyboardLayout' GetKeyboardLayout user32 1867
imp 'GetKeyboardLayoutList' GetKeyboardLayoutList user32 1868
imp 'GetKeyboardLayoutNameA' GetKeyboardLayoutNameA user32 1869
@ -2287,7 +2287,7 @@ imp 'GetMappedFileName' GetMappedFileNameW KernelBase 595
imp 'GetMaximumProcessorCount' GetMaximumProcessorCount kernel32 627
imp 'GetMaximumProcessorGroupCount' GetMaximumProcessorGroupCount kernel32 628
imp 'GetMemoryErrorHandlingCapabilities' GetMemoryErrorHandlingCapabilities KernelBase 596
imp 'GetMenu' GetMenu user32 1881
imp 'GetMenu' GetMenu user32 1881 1
imp 'GetMenuBarInfo' GetMenuBarInfo user32 1882
imp 'GetMenuCheckMarkDimensions' GetMenuCheckMarkDimensions user32 1883
imp 'GetMenuContextHelpId' GetMenuContextHelpId user32 1884
@ -2381,8 +2381,8 @@ imp 'GetObjectType' GetObjectType gdi32 1683
imp 'GetObject' GetObjectW gdi32 1684
imp 'GetOldestEventLogRecord' GetOldestEventLogRecord advapi32 1347
imp 'GetOpenClipboardWindow' GetOpenClipboardWindow user32 1905
imp 'GetOpenFileNameA' GetOpenFileNameA comdlg32 113
imp 'GetOpenFileName' GetOpenFileNameW comdlg32 114
imp 'GetOpenFileNameA' GetOpenFileNameA comdlg32 113 1
imp 'GetOpenFileName' GetOpenFileNameW comdlg32 114 1
imp 'GetOsManufacturingMode' GetOsManufacturingMode KernelBase 625
imp 'GetOsSafeBootMode' GetOsSafeBootMode KernelBase 626
imp 'GetOutlineTextMetricsA' GetOutlineTextMetricsA gdi32 1685
@ -2431,7 +2431,7 @@ imp 'GetPhysicalCursorPos' GetPhysicalCursorPos user32 1907
imp 'GetPhysicalMonitorDescription' GetPhysicalMonitorDescription gdi32 1689
imp 'GetPhysicalMonitors' GetPhysicalMonitors gdi32 1690
imp 'GetPhysicallyInstalledSystemMemory' GetPhysicallyInstalledSystemMemory KernelBase 663
imp 'GetPixel' GetPixel gdi32 1691
imp 'GetPixel' GetPixel gdi32 1691 3
imp 'GetPixelFormat' GetPixelFormat gdi32 1692
imp 'GetPointerCursorId' GetPointerCursorId user32 1908
imp 'GetPointerDevice' GetPointerDevice user32 1909
@ -2535,8 +2535,8 @@ imp 'GetRegistryValueWithFallback' GetRegistryValueWithFallbackW KernelBas
imp 'GetRelAbs' GetRelAbs gdi32 1699
imp 'GetRgnBox' GetRgnBox gdi32 1700
imp 'GetRoamingLastObservedChangeTime' GetRoamingLastObservedChangeTime KernelBase 699
imp 'GetSaveFileNameA' GetSaveFileNameA comdlg32 115
imp 'GetSaveFileName' GetSaveFileNameW comdlg32 116
imp 'GetSaveFileNameA' GetSaveFileNameA comdlg32 115 1
imp 'GetSaveFileName' GetSaveFileNameW comdlg32 116 1
imp 'GetScrollBarInfo' GetScrollBarInfo user32 1945
imp 'GetScrollInfo' GetScrollInfo user32 1946
imp 'GetScrollPos' GetScrollPos user32 1947
@ -2606,7 +2606,7 @@ imp 'GetSystemDpiForProcess' GetSystemDpiForProcess user32 1954
imp 'GetSystemFileCacheSize' GetSystemFileCacheSize KernelBase 739
imp 'GetSystemFirmwareTable' GetSystemFirmwareTable KernelBase 740
imp 'GetSystemInfo' GetSystemInfo KernelBase 741 1
imp 'GetSystemMenu' GetSystemMenu user32 1955
imp 'GetSystemMenu' GetSystemMenu user32 1955 2
imp 'GetSystemMetadataPath' GetSystemMetadataPath KernelBase 742
imp 'GetSystemMetadataPathForPackage' GetSystemMetadataPathForPackage KernelBase 743
imp 'GetSystemMetadataPathForPackageFamily' GetSystemMetadataPathForPackageFamily KernelBase 744
@ -2764,7 +2764,7 @@ imp 'GetWindowMinimizeRect' GetWindowMinimizeRect user32 1991
imp 'GetWindowModuleFileNameA' GetWindowModuleFileNameA user32 1993
imp 'GetWindowModuleFileName' GetWindowModuleFileNameW user32 1994
imp 'GetWindowOrgEx' GetWindowOrgEx gdi32 1732
imp 'GetWindowPlacement' GetWindowPlacement user32 1995
imp 'GetWindowPlacement' GetWindowPlacement user32 1995 2
imp 'GetWindowProcessHandle' GetWindowProcessHandle user32 1996
imp 'GetWindowRect' GetWindowRect user32 1997 2
imp 'GetWindowRgn' GetWindowRgn user32 1998
@ -2913,10 +2913,10 @@ imp 'InjectKeyboardInput' InjectKeyboardInput user32 2037
imp 'InjectMouseInput' InjectMouseInput user32 2038
imp 'InjectPointerInput' InjectPointerInput user32 2039
imp 'InjectTouchInput' InjectTouchInput user32 2040
imp 'InsertMenuA' InsertMenuA user32 2041
imp 'InsertMenuA' InsertMenuA user32 2041 5
imp 'InsertMenuItemA' InsertMenuItemA user32 2042
imp 'InsertMenuItem' InsertMenuItemW user32 2043
imp 'InsertMenu' InsertMenuW user32 2044
imp 'InsertMenu' InsertMenuW user32 2044 5
imp 'InstallApplication' InstallApplication advapi32 1408
imp 'InstallELAMCertificateInfo' InstallELAMCertificateInfo KernelBase 866
imp 'InternalDeleteDC' InternalDeleteDC gdi32 1736
@ -2985,7 +2985,7 @@ imp 'IsEnclaveTypeSupported' IsEnclaveTypeSupported KernelBase 906
imp 'IsGUIThread' IsGUIThread user32 2065
imp 'IsGlobalizationUserSettingsKeyRedirected' IsGlobalizationUserSettingsKeyRedirected KernelBase 907
imp 'IsHungAppWindow' IsHungAppWindow user32 2066
imp 'IsIconic' IsIconic user32 2067
imp 'IsIconic' IsIconic user32 2067 1
imp 'IsImmersiveProcess' IsImmersiveProcess user32 2068
imp 'IsInDesktopWindowBand' IsInDesktopWindowBand user32 2069
imp 'IsInternetESCEnabled' IsInternetESCEnabled KernelBase 908
@ -4332,10 +4332,10 @@ imp 'PowerSetRequest' PowerSetRequest kernel32 1059
imp 'PrefetchVirtualMemory' PrefetchVirtualMemory KernelBase 1222 4
imp 'PrepareDiscForBurnRunDll' PrepareDiscForBurnRunDllW shell32 135
imp 'PrepareTape' PrepareTape kernel32 1061
imp 'PrintDlgA' PrintDlgA comdlg32 120
imp 'PrintDlgA' PrintDlgA comdlg32 120 1
imp 'PrintDlgExA' PrintDlgExA comdlg32 121
imp 'PrintDlgEx' PrintDlgExW comdlg32 122
imp 'PrintDlg' PrintDlgW comdlg32 123
imp 'PrintDlg' PrintDlgW comdlg32 123 1
imp 'PrintWindow' PrintWindow user32 2209
imp 'PrintersGetCommand_RunDLL' PrintersGetCommand_RunDLL shell32 138
imp 'PrintersGetCommand_RunDLLA' PrintersGetCommand_RunDLLA shell32 139
@ -4541,7 +4541,7 @@ imp 'RecordShutdownReason' RecordShutdownReason user32 2245
imp 'RectInRegion' RectInRegion gdi32 1796
imp 'RectVisible' RectVisible gdi32 1797
imp 'Rectangle' Rectangle gdi32 1798
imp 'RedrawWindow' RedrawWindow user32 2246
imp 'RedrawWindow' RedrawWindow user32 2246 4
imp 'RefreshPackageInfo' RefreshPackageInfo KernelBase 1318
imp 'RefreshPolicyExInternal' RefreshPolicyExInternal KernelBase 1319
imp 'RefreshPolicyInternal' RefreshPolicyInternal KernelBase 1320
@ -4699,7 +4699,7 @@ imp 'RegisterWowBaseHandlers' RegisterWowBaseHandlers kernel32 1194
imp 'RegisterWowExec' RegisterWowExec kernel32 1195
imp 'ReleaseActCtx' ReleaseActCtx KernelBase 1390
imp 'ReleaseActCtxWorker' ReleaseActCtxWorker kernel32 1197
imp 'ReleaseCapture' ReleaseCapture user32 2279
imp 'ReleaseCapture' ReleaseCapture user32 2279 0
imp 'ReleaseDC' ReleaseDC user32 2280
imp 'ReleaseDwmHitTestWaiters' ReleaseDwmHitTestWaiters user32 2281
imp 'ReleaseMutex' ReleaseMutex KernelBase 1391 1
@ -4741,8 +4741,8 @@ imp 'ReplaceFileA' ReplaceFileA kernel32 1215
imp 'ReplaceFileExInternal' ReplaceFileExInternal KernelBase 1408
imp 'ReplaceFile' ReplaceFileW KernelBase 1409
imp 'ReplacePartitionUnit' ReplacePartitionUnit kernel32 1217
imp 'ReplaceTextA' ReplaceTextA comdlg32 124
imp 'ReplaceText' ReplaceTextW comdlg32 125
imp 'ReplaceTextA' ReplaceTextA comdlg32 124 1
imp 'ReplaceText' ReplaceTextW comdlg32 125 1
imp 'ReplyMessage' ReplyMessage user32 2288
imp 'ReportEventA' ReportEventA advapi32 1704
imp 'ReportEvent' ReportEventW advapi32 1705
@ -4761,7 +4761,7 @@ imp 'ResolveDesktopForWOW' ResolveDesktopForWOW user32 2289
imp 'ResolveLocaleName' ResolveLocaleName KernelBase 1415
imp 'RestartDialog' RestartDialog shell32 59
imp 'RestartDialogEx' RestartDialogEx shell32 730
imp 'RestoreDC' RestoreDC gdi32 1808
imp 'RestoreDC' RestoreDC gdi32 1808 2
imp 'ResumeThread' ResumeThread KernelBase 1417
imp 'ReuseDDElParam' ReuseDDElParam user32 2290
imp 'RevertToSelf' RevertToSelf KernelBase 1418
@ -6061,7 +6061,7 @@ imp 'SaferiPopulateDefaultsInRegistry' SaferiPopulateDefaultsInRegistry adva
imp 'SaferiRecordEventLogEntry' SaferiRecordEventLogEntry advapi32 1722
imp 'SaferiSearchMatchingHashRules' SaferiSearchMatchingHashRules advapi32 1723
imp 'SaveAlternatePackageRootPath' SaveAlternatePackageRootPath KernelBase 1451
imp 'SaveDC' SaveDC gdi32 1815
imp 'SaveDC' SaveDC gdi32 1815 1
imp 'SaveStateRootFolderPath' SaveStateRootFolderPath KernelBase 1452
imp 'SbExecuteProcedure' SbExecuteProcedure ntdll 1610
imp 'SbSelectProcedure' SbSelectProcedure ntdll 1611
@ -6082,7 +6082,7 @@ imp 'SelectBrushLocal' SelectBrushLocal gdi32 1860
imp 'SelectClipPath' SelectClipPath gdi32 1861
imp 'SelectClipRgn' SelectClipRgn gdi32 1862
imp 'SelectFontLocal' SelectFontLocal gdi32 1863
imp 'SelectObject' SelectObject gdi32 1864
imp 'SelectObject' SelectObject gdi32 1864 2
imp 'SelectPalette' SelectPalette gdi32 1865
imp 'SendDlgItemMessageA' SendDlgItemMessageA user32 2296
imp 'SendDlgItemMessage' SendDlgItemMessageW user32 2297
@ -6094,7 +6094,7 @@ imp 'SendMessageCallbackA' SendMessageCallbackA user32 2302
imp 'SendMessageCallback' SendMessageCallbackW user32 2303
imp 'SendMessageTimeoutA' SendMessageTimeoutA user32 2304
imp 'SendMessageTimeout' SendMessageTimeoutW user32 2305
imp 'SendMessage' SendMessageW user32 2306
imp 'SendMessage' SendMessageW user32 2306 4
imp 'SendNotifyMessageA' SendNotifyMessageA user32 2307
imp 'SendNotifyMessage' SendNotifyMessageW user32 2308
imp 'SetAbortProc' SetAbortProc gdi32 1866
@ -6114,13 +6114,13 @@ imp 'SetBrushOrgEx' SetBrushOrgEx gdi32 1875
imp 'SetCachedSigningLevel' SetCachedSigningLevel KernelBase 1458
imp 'SetCalendarInfoA' SetCalendarInfoA kernel32 1249
imp 'SetCalendarInfo' SetCalendarInfoW KernelBase 1459
imp 'SetCapture' SetCapture user32 2310
imp 'SetCapture' SetCapture user32 2310 1
imp 'SetCaretBlinkTime' SetCaretBlinkTime user32 2311
imp 'SetCaretPos' SetCaretPos user32 2312
imp 'SetClassLongA' SetClassLongA user32 2313
imp 'SetClassLongA' SetClassLongA user32 2313 3
imp 'SetClassLongPtrA' SetClassLongPtrA user32 2314
imp 'SetClassLongPtr' SetClassLongPtrW user32 2315
imp 'SetClassLong' SetClassLongW user32 2316
imp 'SetClassLong' SetClassLongW user32 2316 3
imp 'SetClassWord' SetClassWord user32 2317
imp 'SetClientDynamicTimeZoneInformation' SetClientDynamicTimeZoneInformation KernelBase 1460
imp 'SetClientTimeZoneInformation' SetClientTimeZoneInformation KernelBase 1461
@ -6176,7 +6176,7 @@ imp 'SetCurrentConsoleFontEx' SetCurrentConsoleFontEx KernelBase 1492
imp 'SetCurrentDirectory' SetCurrentDirectoryW KernelBase 1494 1
imp 'SetCurrentDirectoryA' SetCurrentDirectoryA KernelBase 1493 1
imp 'SetCurrentProcessExplicitAppUserModelID' SetCurrentProcessExplicitAppUserModelID shell32 569
imp 'SetCursor' SetCursor user32 2321
imp 'SetCursor' SetCursor user32 2321 1
imp 'SetCursorContents' SetCursorContents user32 2322
imp 'SetCursorPos' SetCursorPos user32 2323
imp 'SetDCBrushColor' SetDCBrushColor gdi32 1878
@ -6304,7 +6304,7 @@ imp 'SetOPMSigningKeyAndSequenceNumbers' SetOPMSigningKeyAndSequenceNumbers
imp 'SetPaletteEntries' SetPaletteEntries gdi32 1900
imp 'SetParent' SetParent user32 2357 2
imp 'SetPhysicalCursorPos' SetPhysicalCursorPos user32 2358
imp 'SetPixel' SetPixel gdi32 1901
imp 'SetPixel' SetPixel gdi32 1901 4
imp 'SetPixelFormat' SetPixelFormat gdi32 1902
imp 'SetPixelV' SetPixelV gdi32 1903
imp 'SetPolyFillMode' SetPolyFillMode gdi32 1904
@ -6443,7 +6443,7 @@ imp 'SetWindowLongPtrA' SetWindowLongPtrA user32 2396
imp 'SetWindowLongPtr' SetWindowLongPtrW user32 2397
imp 'SetWindowLong' SetWindowLongW user32 2398
imp 'SetWindowOrgEx' SetWindowOrgEx gdi32 1919
imp 'SetWindowPlacement' SetWindowPlacement user32 2399
imp 'SetWindowPlacement' SetWindowPlacement user32 2399 2
imp 'SetWindowPos' SetWindowPos user32 2400 7
imp 'SetWindowRgn' SetWindowRgn user32 2401
imp 'SetWindowRgnEx' SetWindowRgnEx user32 2402
@ -6723,7 +6723,7 @@ imp 'TpWaitForWait' TpWaitForWait ntdll 1676
imp 'TpWaitForWork' TpWaitForWork ntdll 1677
imp 'TraceSetInformation' TraceSetInformation advapi32 1812
imp 'TrackMouseEvent' TrackMouseEvent user32 2442
imp 'TrackPopupMenu' TrackPopupMenu user32 2443
imp 'TrackPopupMenu' TrackPopupMenu user32 2443 7
imp 'TrackPopupMenuEx' TrackPopupMenuEx user32 2444
imp 'TransactNamedPipe' TransactNamedPipe KernelBase 1684 7
imp 'TranslateAcceleratorA' TranslateAcceleratorA user32 2446

View file

@ -1,11 +1,9 @@
#ifndef COSMOPOLITAN_LIBC_NT_MEMORY_H_
#define COSMOPOLITAN_LIBC_NT_MEMORY_H_
#include "libc/nt/enum/filemapflags.h"
#include "libc/nt/enum/memflags.h"
#include "libc/nt/enum/offerpriority.h"
#include "libc/nt/enum/pageflags.h"
#include "libc/nt/struct/memorybasicinformation.h"
#include "libc/nt/struct/memoryrangeentry.h"
#include "libc/nt/struct/securityattributes.h"
#include "libc/nt/thunk/msabi.h"
#if 0
/* ░░░░
@ -30,17 +28,12 @@
cosmopolitan § new technology » memory
*/
#endif
#define kNtNumaNoPreferredNode 0xffffffff
#if !(__ASSEMBLER__ + __LINKER__ + 0)
COSMOPOLITAN_C_START_
struct NtMemoryBasicInformation;
struct NtMemoryRangeEntry;
struct NtSecurityAttributes;
int64_t CreateFileMappingNuma(
int64_t opt_hFile /* -1ul is MAP_ANONYMOUS */,
const struct NtSecurityAttributes *opt_lpFileMappingAttributes,
@ -73,7 +66,7 @@ bool32 PrefetchVirtualMemory(int64_t hProcess, const uint32_t *NumberOfEntries,
struct NtMemoryRangeEntry *VirtualAddresses,
uint32_t reserved_Flags);
bool32 OfferVirtualMemory(void *inout_VirtualAddress, size_t Size,
enum NtOfferPriority Priority);
int Priority);
#if ShouldUseMsabiAttribute()
#include "libc/nt/thunk/memory.inc"

View file

@ -1,16 +1,14 @@
#ifndef COSMOPOLITAN_LIBC_NT_MESSAGEBOX_H_
#define COSMOPOLITAN_LIBC_NT_MESSAGEBOX_H_
#include "libc/nt/enum/dialogresult.h"
#include "libc/nt/enum/messageboxtype.h"
#if !(__ASSEMBLER__ + __LINKER__ + 0)
COSMOPOLITAN_C_START_
enum DialogResult MessageBox(int64_t hWnd, const char16_t *lpText,
const char16_t *lpCaption,
enum MessageBoxType uType);
enum DialogResult MessageBoxEx(int64_t hWnd, const char16_t *lpText,
const char16_t *lpCaption,
enum MessageBoxType uType, uint16_t wLanguageId);
int MessageBox(int64_t hWnd, const char16_t *lpText, const char16_t *lpCaption,
uint32_t mbType);
int MessageBoxEx(int64_t hWnd, const char16_t *lpText,
const char16_t *lpCaption, uint32_t mbType,
uint16_t wLanguageId);
COSMOPOLITAN_C_END_
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */

View file

@ -3,7 +3,6 @@
#include "libc/nt/enum/status.h"
#if !(__ASSEMBLER__ + __LINKER__ + 0)
COSMOPOLITAN_C_START_
#if 0
/* ░░░░
@ -32,7 +31,6 @@ COSMOPOLITAN_C_START_
the operating system and subject to change from one release of
Windows to the next, and possibly even between service packs for
each release. Quoth MSDN */
#endif
struct NtContext;

View file

@ -6,7 +6,6 @@
#include "libc/nt/typedef/ioapcroutine.h"
#if !(__ASSEMBLER__ + __LINKER__ + 0)
COSMOPOLITAN_C_START_
#if 0
/* ░░░░
@ -35,7 +34,6 @@ COSMOPOLITAN_C_START_
the operating system and subject to change from one release of
Windows to the next, and possibly even between service packs for
each release. Quoth MSDN */
#endif
struct NtIoStatusBlock;
struct NtObjectAttributes;

View file

@ -3,7 +3,6 @@
#include "libc/nt/enum/status.h"
#if !(__ASSEMBLER__ + __LINKER__ + 0)
COSMOPOLITAN_C_START_
#if 0
/* ░░░░
@ -32,7 +31,6 @@ COSMOPOLITAN_C_START_
the operating system and subject to change from one release of
Windows to the next, and possibly even between service packs for
each release. Quoth MSDN */
#endif
struct NtIoStatusBlock;
struct NtObjectAttributes;

View file

@ -4,7 +4,6 @@
#include "libc/nt/typedef/wambda.h"
#if !(__ASSEMBLER__ + __LINKER__ + 0)
COSMOPOLITAN_C_START_
#if 0
/* ░░░░
@ -33,7 +32,6 @@ COSMOPOLITAN_C_START_
the operating system and subject to change from one release of
Windows to the next, and possibly even between service packs for
each release. Quoth MSDN */
#endif
struct NtAnsiString;
struct NtLdrDataTableEntry;

View file

@ -4,7 +4,6 @@
#include "libc/nt/enum/status.h"
#if !(__ASSEMBLER__ + __LINKER__ + 0)
COSMOPOLITAN_C_START_
#if 0
/* ░░░░
@ -33,7 +32,6 @@ COSMOPOLITAN_C_START_
the operating system and subject to change from one release of
Windows to the next, and possibly even between service packs for
each release. Quoth MSDN */
#endif
NtStatus NtAllocateVirtualMemory(int64_t ProcessHandle,
void **inout_BaseAddress, uint32_t dwZeroBits,
@ -42,11 +40,11 @@ NtStatus NtAllocateVirtualMemory(int64_t ProcessHandle,
uint32_t dwPageProtect);
NtStatus NtFreeVirtualMemory(int64_t ProcessHandle, void **inout_BaseAddress,
size_t *inout_FreeSize, uint32_t FreeType);
NtStatus NtQueryVirtualMemory(
int64_t ProcessHandle, const void *BaseAddress,
enum NtMemoryInformationClass MemoryInformationClass,
void *out_MemoryInformation, size_t MemoryInformationLength,
size_t *opt_out_ReturnLength);
NtStatus NtQueryVirtualMemory(int64_t ProcessHandle, const void *BaseAddress,
int MemoryInformationClass,
void *out_MemoryInformation,
size_t MemoryInformationLength,
size_t *opt_out_ReturnLength);
NtStatus NtProtectVirtualMemory(int64_t ProcessHandle, void **inout_BaseAddress,
uint32_t *inout_ProtectSize,
uint32_t NewProtect, uint32_t *out_OldProtect);

View file

@ -4,7 +4,6 @@
#include "libc/nt/thunk/msabi.h"
#if !(__ASSEMBLER__ + __LINKER__ + 0)
COSMOPOLITAN_C_START_
#if 0
/* ░░░░
@ -33,7 +32,6 @@ COSMOPOLITAN_C_START_
the operating system and subject to change from one release of
Windows to the next, and possibly even between service packs for
each release. Quoth MSDN */
#endif
struct NtClientId;
struct NtObjectAttributes;

View file

@ -1,13 +1,10 @@
#ifndef COSMOPOLITAN_LIBC_NT_NT_SECTIONS_H_
#define COSMOPOLITAN_LIBC_NT_NT_SECTIONS_H_
#include "libc/nt/enum/sectioninformationclass.h"
#include "libc/nt/enum/sectioninherit.h"
#include "libc/nt/enum/status.h"
#include "libc/nt/struct/objectattributes.h"
#if !(__ASSEMBLER__ + __LINKER__ + 0)
COSMOPOLITAN_C_START_
struct NtObjectAttributes;
NtStatus NtCreateSection(int64_t *out_SectionHandle, uint32_t DesiredAccess,
struct NtObjectAttributes *ObjectAttributes,
int64_t *opt_SectionSize, uint32_t Protect,
@ -17,12 +14,10 @@ NtStatus NtOpenSection(int64_t *out_SectionHandle, uint32_t DesiredAccess,
NtStatus NtMapViewOfSection(int64_t SectionHandle, int64_t ProcessHandle,
void **inout_BaseAddress, uint32_t *ZeroBits,
size_t CommitSize, int64_t *opt_inout_SectionOffset,
size_t *inout_ViewSize,
enum NtSectionInherit InheritDisposition,
size_t *inout_ViewSize, int InheritDisposition,
uint32_t AllocationType, uint32_t Protect);
NtStatus NtUnmapViewOfSection(int64_t ProcessHandle, void *BaseAddress);
NtStatus NtQuerySection(int64_t SectionHandle,
enum NtSectionInformationClass SectionInformationClass,
NtStatus NtQuerySection(int64_t SectionHandle, int SectionInformationClass,
void *out_SectionInformation,
uint32_t SectionInformationLength,
uint32_t *opt_out_ResultLength);

View file

@ -3,7 +3,6 @@
#include "libc/nt/enum/status.h"
#if !(__ASSEMBLER__ + __LINKER__ + 0)
COSMOPOLITAN_C_START_
#if 0
/* ░░░░
@ -32,7 +31,6 @@ COSMOPOLITAN_C_START_
the operating system and subject to change from one release of
Windows to the next, and possibly even between service packs for
each release. Quoth MSDN */
#endif
NtStatus CsrClientCallServer(void *inout_Message, void *unknown,
uint32_t Opcode, uint32_t Size);

View file

@ -4,7 +4,6 @@
#include "libc/nt/enum/threadinfoclass.h"
#if !(__ASSEMBLER__ + __LINKER__ + 0)
COSMOPOLITAN_C_START_
#if 0
/* ░░░░
@ -33,7 +32,6 @@ COSMOPOLITAN_C_START_
the operating system and subject to change from one release of
Windows to the next, and possibly even between service packs for
each release. Quoth MSDN */
#endif
struct NtClientId;
struct NtContext;

View file

@ -4,7 +4,6 @@
#include "libc/nt/thunk/msabi.h"
#if !(__ASSEMBLER__ + __LINKER__ + 0)
COSMOPOLITAN_C_START_
#if 0
/* ░░░░
@ -33,7 +32,6 @@ COSMOPOLITAN_C_START_
the operating system and subject to change from one release of
Windows to the next, and possibly even between service packs for
each release. Quoth MSDN */
#endif
NtStatus NtDelayExecution(bool32 alertable, int64_t *AbsCobolOrNegRelHectoNano);

View file

@ -1,21 +1,17 @@
#ifndef COSMOPOLITAN_LIBC_NT_NTDLL_H_
#define COSMOPOLITAN_LIBC_NT_NTDLL_H_
#include "libc/nt/enum/eventtype.h"
#include "libc/nt/enum/fileinformationclass.h"
#include "libc/nt/enum/fsinformationclass.h"
#include "libc/nt/enum/jobobjectinfoclass.h"
#include "libc/nt/enum/keyinformationclass.h"
#include "libc/nt/enum/objectinformationclass.h"
#include "libc/nt/enum/status.h"
#include "libc/nt/enum/systeminformationclass.h"
#include "libc/nt/enum/tokeninformationclass.h"
#include "libc/nt/enum/valueinformationclass.h"
#include "libc/nt/struct/context.h"
#include "libc/nt/struct/criticalsection.h"
#include "libc/nt/struct/filebasicinformation.h"
#include "libc/nt/struct/filenetworkopeninformation.h"
#include "libc/nt/struct/iostatusblock.h"
#include "libc/nt/struct/ntexceptionrecord.h"
#include "libc/nt/struct/objectattributes.h"
#include "libc/nt/thunk/msabi.h"
#include "libc/nt/typedef/ioapcroutine.h"
#include "libc/nt/typedef/pknormalroutine.h"
#if !(__ASSEMBLER__ + __LINKER__ + 0)
COSMOPOLITAN_C_START_
#if 0
/* ░░░░
@ -44,27 +40,14 @@ COSMOPOLITAN_C_START_
the operating system and subject to change from one release of
Windows to the next, and possibly even between service packs for
each release. Quoth MSDN */
#endif
#define g_nt_system_call_dispatcher (wambda *)0x7ffe0308
extern const struct NtUnicodeString *const RtlNtdllName;
#if 0
/*───────────────────────────────────────────────────────────────────────────│─╗
cosmopolitan § new technology » beyond the pale » eponymous runtime
*/
#endif
struct NtContext;
struct NtCriticalSection;
struct NtExceptionRecord;
struct NtFileBasicInformation;
struct NtFileNetworkOpenInformation;
struct NtIoStatusBlock;
struct NtObjectAttributes;
struct NtSecurityDescriptor;
struct NtUnicodeString;
#define NT_PROCESS_FLAGS_CREATE_SUSPENDED 0x00000001
#define NT_PROCESS_FLAGS_INHERIT_HANDLES 0x00000002
@ -99,8 +82,7 @@ NtStatus NtCreateTimer(void **out_TimerHandle, uint32_t DesiredAccess,
NtStatus NtSetTimer(void *TimerHandle, int64_t *DueTime, void *TimerApcRoutine,
void *TimerContext, int32_t Resume, int32_t Period,
int32_t *out_PreviousState);
NtStatus NtQueryObject(void *ObjectHandle,
enum NtObjectInformationClass ObjectInformationClass,
NtStatus NtQueryObject(void *ObjectHandle, int ObjectInformationClass,
void *out_ObjectInformation,
uint32_t ObjectInformationLength,
uint32_t *opt_out_ReturnLength);
@ -117,17 +99,15 @@ NtStatus NtSetValueKey(void *KeyHandle, struct NtUnicodeString *ValueName,
uint32_t opt_TitleIndex, uint32_t Type, void *Data,
uint32_t DataSize);
NtStatus NtDeleteKey(void *KeyHandle);
NtStatus NtQueryValueKey(
void *KeyHandle, struct NtUnicodeString *ValueName,
enum NtKeyValueInformationClass KeyValueInformationClass,
void *out_KeyValueInformation, uint32_t Length, uint32_t *out_ResultLength);
NtStatus NtQueryValueKey(void *KeyHandle, struct NtUnicodeString *ValueName,
int KeyValueInformationClass,
void *out_KeyValueInformation, uint32_t Length,
uint32_t *out_ResultLength);
NtStatus NtFlushKey(void *KeyHandle);
NtStatus NtEnumerateKey(int64_t hkey, uint32_t index,
enum NtKeyInformationClass info_class,
NtStatus NtEnumerateKey(int64_t hkey, uint32_t index, int info_class,
void *out_key_info, uint32_t key_info_size,
uint32_t *out_bytes_received);
NtStatus NtEnumerateValueKey(int64_t hKey, uint32_t index,
enum NtKeyValueInformationClass info_class,
NtStatus NtEnumerateValueKey(int64_t hKey, uint32_t index, int info_class,
void *out_key_info, uint32_t key_info_size,
uint32_t *out_bytes_received);
NtStatus NtQuerySystemTime(int64_t *SystemTime);
@ -146,7 +126,7 @@ NtStatus NtRaiseException(struct NtExceptionRecord *ExceptionRecord,
struct NtContext *Context, int32_t SearchFrames);
NtStatus NtCreateEvent(void **out_EventHandle, uint32_t DesiredAccess,
struct NtObjectAttributes *ObjectAttributes,
enum NtEventType EventType, int32_t InitialState);
int EventType, int32_t InitialState);
NtStatus NtWaitForSingleObject(void *ObjectHandle, int32_t Alertable,
int64_t *TimeOut);
NtStatus NtSetEvent(void *EventHandle, int32_t *opt_out_PreviousState);
@ -214,16 +194,14 @@ NtStatus NtQueryDirectoryFile(
NtStatus NtFlushVirtualMemory(int64_t ProcessHandle, void **inout_BaseAddress,
uint32_t **inout_FlushSize,
struct NtIoStatusBlock *out_IoStatusBlock);
NtStatus NtQueryInformationJobObject(
void *JobHandle, enum NtJobObjectInfoClass JobInformationClass,
void *out_JobInformation, uint32_t JobInformationLength,
uint32_t *opt_out_ReturnLength);
NtStatus NtQueryInformationJobObject(void *JobHandle, int JobInformationClass,
void *out_JobInformation,
uint32_t JobInformationLength,
uint32_t *opt_out_ReturnLength);
#if 0
/*───────────────────────────────────────────────────────────────────────────│─╗
cosmopolitan § new technology » beyond the pale » runtime library
*/
#endif
NtStatus RtlInitializeCriticalSection(struct NtCriticalSection *out_crit);
NtStatus RtlDeleteCriticalSection(struct NtCriticalSection *crit);

View file

@ -1,22 +1,3 @@
/*-*- mode:unix-assembly; indent-tabs-mode:t; tab-width:8; coding:utf-8 -*-│
vi: set et ft=asm ts=8 tw=8 fenc=utf-8 :vi
Copyright 2020 Justine Alexandra Roberts Tunney
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 USA
*/
#ifndef COSMOPOLITAN_LIBC_NT_NTDLLIMPORT_H_
#define COSMOPOLITAN_LIBC_NT_NTDLLIMPORT_H_
#include "ape/relocations.h"

View file

@ -3,13 +3,12 @@
#include "libc/nt/struct/drawtextparams.h"
#include "libc/nt/struct/paintstruct.h"
#include "libc/nt/struct/rect.h"
#include "libc/nt/thunk/msabi.h"
#if !(__ASSEMBLER__ + __LINKER__ + 0)
COSMOPOLITAN_C_START_
#if 0
/*───────────────────────────────────────────────────────────────────────────│─╗
cosmopolitan § new technology » cpu graphics
*/
#endif
int64_t BeginPaint(int64_t hWnd, struct NtPaintStruct *lpPaint);
int32_t EndPaint(int64_t hWnd, const struct NtPaintStruct *lpPaint);
@ -27,7 +26,21 @@ int32_t DrawTextEx(int64_t hdc, char16_t *lpchText, int cchText,
struct NtRect *lprc, uint32_t format,
struct NtDrawTextParams *lpdtp);
int32_t FillRect(int64_t hDC, const struct NtRect *lpRC, int64_t hBrush);
uint32_t GetPixel(int64_t hdc, int x, int y);
uint32_t SetPixel(int64_t hdc, int x, int y, uint32_t color);
bool32 RedrawWindow(int64_t hWnd, const struct NtRect *opt_lprcUpdate,
int64_t opt_hrgnUpdate, uint32_t rdwFlags);
int64_t CreateCompatibleDC(int64_t hdc);
int64_t CreateCompatibleBitmap(int64_t hdc, int cx, int cy);
int64_t SelectObject(int64_t hdc, int64_t h);
bool32 DeleteObject(int64_t ho);
bool32 DeleteDC(int64_t hdc);
int SaveDC(int64_t hdc);
bool32 RestoreDC(int64_t hdc, int nSavedDC);
#if ShouldUseMsabiAttribute()
#include "libc/nt/thunk/paint.inc"
#endif /* ShouldUseMsabiAttribute() */
COSMOPOLITAN_C_END_
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
#endif /* COSMOPOLITAN_LIBC_NT_PAINT_H_ */

View file

@ -1,7 +1,6 @@
#ifndef COSMOPOLITAN_LIBC_NT_PRIVILEGE_H_
#define COSMOPOLITAN_LIBC_NT_PRIVILEGE_H_
#include "libc/nt/struct/luid.h"
#if 0
/* ░░░░
@ -26,12 +25,11 @@
cosmopolitan § new technology » check your privilege
*/
#endif
#define kNtSePrivilegeEnabledByDefault 0x00000001u
#define kNtSePrivilegeEnabled 0x00000002u
#define kNtSePrivilegeRemoved 0x00000004u
#define kNtSePrivilegeUsedForAccess 0x80000000u
#define kNtSePrivilegeEnabled 0x00000002u
#define kNtSePrivilegeRemoved 0x00000004u
#define kNtSePrivilegeUsedForAccess 0x80000000u
#if !(__ASSEMBLER__ + __LINKER__ + 0)
COSMOPOLITAN_C_START_

View file

@ -1,11 +1,9 @@
#ifndef COSMOPOLITAN_LIBC_NT_PROCESS_H_
#define COSMOPOLITAN_LIBC_NT_PROCESS_H_
#include "libc/nt/enum/accessmask.h"
#include "libc/nt/enum/processaccess.h"
#include "libc/nt/enum/processcreationflags.h"
#include "libc/nt/startupinfo.h"
#include "libc/nt/struct/processinformation.h"
#include "libc/nt/struct/securityattributes.h"
#include "libc/nt/thunk/msabi.h"
#if 0
/* ░░░░
@ -30,15 +28,10 @@
cosmopolitan § new technology » processes
*/
#endif
#if !(__ASSEMBLER__ + __LINKER__ + 0)
COSMOPOLITAN_C_START_
struct NtProcessInformation;
struct NtSecurityAttributes;
struct NtStartupInfo;
bool32 CreateProcess(const char16_t *opt_lpApplicationName,
char16_t *lpCommandLine,
struct NtSecurityAttributes *opt_lpProcessAttributes,

Some files were not shown because too many files have changed in this diff Show more