mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-02-12 01:08:00 +00:00
Resurrect <windows.h> as <windowsesque.h>
This commit is contained in:
parent
68b9479f0c
commit
3eb405e0e2
6 changed files with 4340 additions and 0 deletions
4296
libc/isystem/windowsesque.h
Normal file
4296
libc/isystem/windowsesque.h
Normal file
File diff suppressed because it is too large
Load diff
|
@ -27,6 +27,7 @@ COSMOPOLITAN_C_START_
|
||||||
╚────────────────────────────────────────────────────────────────────────────│*/
|
╚────────────────────────────────────────────────────────────────────────────│*/
|
||||||
|
|
||||||
int64_t LoadLibrary(const char16_t *lpLibFileName);
|
int64_t LoadLibrary(const char16_t *lpLibFileName);
|
||||||
|
int64_t LoadLibraryA(const char *lpLibFileName);
|
||||||
int64_t LoadLibraryEx(const char16_t *lpLibFileName, int64_t hFile,
|
int64_t LoadLibraryEx(const char16_t *lpLibFileName, int64_t hFile,
|
||||||
uint32_t dwFlags);
|
uint32_t dwFlags);
|
||||||
uint32_t GetModuleFileNameA(int64_t hModule, char *lpFilename, uint32_t nSize);
|
uint32_t GetModuleFileNameA(int64_t hModule, char *lpFilename, uint32_t nSize);
|
||||||
|
|
|
@ -57,6 +57,9 @@ int32_t DeregisterEventSource(uint64_t handle);
|
||||||
int64_t CreateEvent(const struct NtSecurityAttributes *opt_lpEventAttributes,
|
int64_t CreateEvent(const struct NtSecurityAttributes *opt_lpEventAttributes,
|
||||||
bool32 bManualReset, bool32 bInitialState,
|
bool32 bManualReset, bool32 bInitialState,
|
||||||
const char16_t *opt_lpName);
|
const char16_t *opt_lpName);
|
||||||
|
int64_t CreateEventA(const struct NtSecurityAttributes *opt_lpEventAttributes,
|
||||||
|
bool32 bManualReset, bool32 bInitialState,
|
||||||
|
const char *opt_lpName);
|
||||||
int64_t CreateEventEx(const struct NtSecurityAttributes *lpEventAttributes,
|
int64_t CreateEventEx(const struct NtSecurityAttributes *lpEventAttributes,
|
||||||
const char16_t *lpName, uint32_t dwFlags,
|
const char16_t *lpName, uint32_t dwFlags,
|
||||||
uint32_t dwDesiredAccess);
|
uint32_t dwDesiredAccess);
|
||||||
|
|
18
libc/nt/kernel32/CreateEventA.S
Normal file
18
libc/nt/kernel32/CreateEventA.S
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
#include "libc/nt/codegen.h"
|
||||||
|
.imp kernel32,__imp_CreateEventA,CreateEventA
|
||||||
|
|
||||||
|
.text.windows
|
||||||
|
.ftrace1
|
||||||
|
CreateEventA:
|
||||||
|
.ftrace2
|
||||||
|
#ifdef __x86_64__
|
||||||
|
push %rbp
|
||||||
|
mov %rsp,%rbp
|
||||||
|
mov __imp_CreateEventA(%rip),%rax
|
||||||
|
jmp __sysv2nt
|
||||||
|
#elif defined(__aarch64__)
|
||||||
|
mov x0,#0
|
||||||
|
ret
|
||||||
|
#endif
|
||||||
|
.endfn CreateEventA,globl
|
||||||
|
.previous
|
20
libc/nt/kernel32/LoadLibraryA.S
Normal file
20
libc/nt/kernel32/LoadLibraryA.S
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
#include "libc/nt/codegen.h"
|
||||||
|
.imp kernel32,__imp_LoadLibraryA,LoadLibraryA
|
||||||
|
|
||||||
|
.text.windows
|
||||||
|
.ftrace1
|
||||||
|
LoadLibraryA:
|
||||||
|
.ftrace2
|
||||||
|
#ifdef __x86_64__
|
||||||
|
push %rbp
|
||||||
|
mov %rsp,%rbp
|
||||||
|
mov %rdi,%rcx
|
||||||
|
sub $32,%rsp
|
||||||
|
call *__imp_LoadLibraryA(%rip)
|
||||||
|
leave
|
||||||
|
#elif defined(__aarch64__)
|
||||||
|
mov x0,#0
|
||||||
|
#endif
|
||||||
|
ret
|
||||||
|
.endfn LoadLibraryA,globl
|
||||||
|
.previous
|
|
@ -63,6 +63,7 @@ imp 'ConnectNamedPipe' ConnectNamedPipe kernel32 2
|
||||||
imp 'ContinueDebugEvent' ContinueDebugEvent kernel32 3
|
imp 'ContinueDebugEvent' ContinueDebugEvent kernel32 3
|
||||||
imp 'CopyFile' CopyFileW kernel32 3
|
imp 'CopyFile' CopyFileW kernel32 3
|
||||||
imp 'CreateEvent' CreateEventW kernel32 4
|
imp 'CreateEvent' CreateEventW kernel32 4
|
||||||
|
imp 'CreateEventA' CreateEventA kernel32 4
|
||||||
imp 'CreateEventEx' CreateEventExW kernel32 4
|
imp 'CreateEventEx' CreateEventExW kernel32 4
|
||||||
imp 'CreateHardLink' CreateHardLinkW kernel32 3
|
imp 'CreateHardLink' CreateHardLinkW kernel32 3
|
||||||
imp 'CreateIoCompletionPort' CreateIoCompletionPort kernel32 4
|
imp 'CreateIoCompletionPort' CreateIoCompletionPort kernel32 4
|
||||||
|
@ -195,6 +196,7 @@ imp 'InitializeProcThreadAttributeList' InitializeProcThreadAttributeList ke
|
||||||
imp 'InitializeSRWLock' InitializeSRWLock kernel32 1
|
imp 'InitializeSRWLock' InitializeSRWLock kernel32 1
|
||||||
imp 'LeaveCriticalSection' LeaveCriticalSection kernel32 1
|
imp 'LeaveCriticalSection' LeaveCriticalSection kernel32 1
|
||||||
imp 'LoadLibrary' LoadLibraryW kernel32 1
|
imp 'LoadLibrary' LoadLibraryW kernel32 1
|
||||||
|
imp 'LoadLibraryA' LoadLibraryA kernel32 1
|
||||||
imp 'LoadLibraryEx' LoadLibraryExW kernel32 3
|
imp 'LoadLibraryEx' LoadLibraryExW kernel32 3
|
||||||
imp 'LoadResource' LoadResource kernel32 2
|
imp 'LoadResource' LoadResource kernel32 2
|
||||||
imp 'LocalFree' LocalFree kernel32 1
|
imp 'LocalFree' LocalFree kernel32 1
|
||||||
|
|
Loading…
Reference in a new issue