Skip to content

Commit

Permalink
Merge pull request #4652 from VladPavliuk/extend_win32_api_types
Browse files Browse the repository at this point in the history
Extend win32 api types
  • Loading branch information
gingerBill authored Jan 4, 2025
2 parents fdd3b46 + 1733a50 commit 872e6d0
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 2 deletions.
4 changes: 4 additions & 0 deletions core/sys/windows/kernel32.odin
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,10 @@ foreign kernel32 {
hThread: HANDLE,
lpContext: LPCONTEXT,
) -> BOOL ---
SetThreadContext :: proc(
hThread: HANDLE,
lpContext: LPCONTEXT,
) -> BOOL ---
CreateProcessW :: proc(
lpApplicationName: LPCWSTR,
lpCommandLine: LPWSTR,
Expand Down
28 changes: 26 additions & 2 deletions core/sys/windows/types.odin
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ LPWSAPROTOCOL_INFO :: ^WSAPROTOCOL_INFO
LPSTR :: ^CHAR
LPWSTR :: ^WCHAR
OLECHAR :: WCHAR
BSTR :: ^OLECHAR
LPOLESTR :: ^OLECHAR
LPCOLESTR :: LPCSTR
LPFILETIME :: ^FILETIME
Expand Down Expand Up @@ -2694,11 +2695,23 @@ EXCEPTION_MAXIMUM_PARAMETERS :: 15

EXCEPTION_DATATYPE_MISALIGNMENT :: 0x80000002
EXCEPTION_BREAKPOINT :: 0x80000003
EXCEPTION_SINGLE_STEP :: 0x80000004
EXCEPTION_ACCESS_VIOLATION :: 0xC0000005
EXCEPTION_IN_PAGE_ERROR :: 0xC0000006
EXCEPTION_ILLEGAL_INSTRUCTION :: 0xC000001D
EXCEPTION_NONCONTINUABLE_EXCEPTION :: 0xC0000025
EXCEPTION_INVALID_DISPOSITION :: 0xC0000026
EXCEPTION_ARRAY_BOUNDS_EXCEEDED :: 0xC000008C
EXCEPTION_FLT_DENORMAL_OPERAND :: 0xC000008D
EXCEPTION_FLT_DIVIDE_BY_ZERO :: 0xC000008E
EXCEPTION_FLT_INEXACT_RESULT :: 0xC000008F
EXCEPTION_FLT_INVALID_OPERATION :: 0xC0000090
EXCEPTION_FLT_OVERFLOW :: 0xC0000091
EXCEPTION_FLT_STACK_CHECK :: 0xC0000092
EXCEPTION_FLT_UNDERFLOW :: 0xC0000093
EXCEPTION_INT_DIVIDE_BY_ZERO :: 0xC0000094
EXCEPTION_INT_OVERFLOW :: 0xC0000095
EXCEPTION_PRIV_INSTRUCTION :: 0xC0000096
EXCEPTION_STACK_OVERFLOW :: 0xC00000FD
STATUS_PRIVILEGED_INSTRUCTION :: 0xC0000096

Expand Down Expand Up @@ -3415,8 +3428,6 @@ TIME_ZONE_INFORMATION :: struct {
DaylightBias: LONG,
}


@(private="file")
IMAGE_DOS_HEADER :: struct {
e_magic: WORD,
e_cblp: WORD,
Expand Down Expand Up @@ -3534,6 +3545,19 @@ IMAGE_EXPORT_DIRECTORY :: struct {
AddressOfNameOrdinals: DWORD, // RVA from base of image
}

IMAGE_DEBUG_DIRECTORY :: struct {
Characteristics: DWORD,
TimeDateStamp: DWORD,
MajorVersion: WORD,
MinorVersion: WORD,
Type: DWORD,
SizeOfData: DWORD,
AddressOfRawData: DWORD,
PointerToRawData: DWORD,
}

IMAGE_DEBUG_TYPE_CODEVIEW :: 2

SICHINTF :: DWORD
SHCONTF :: DWORD
SFGAOF :: ULONG
Expand Down

0 comments on commit 872e6d0

Please sign in to comment.