Quellcode durchsuchen

Merge pull request #4652 from VladPavliuk/extend_win32_api_types

Extend win32 api types
gingerBill vor 7 Monaten
Ursprung
Commit
872e6d0189
2 geänderte Dateien mit 30 neuen und 2 gelöschten Zeilen
  1. 4 0
      core/sys/windows/kernel32.odin
  2. 26 2
      core/sys/windows/types.odin

+ 4 - 0
core/sys/windows/kernel32.odin

@@ -239,6 +239,10 @@ foreign kernel32 {
 		hThread: HANDLE,
 		lpContext: LPCONTEXT,
 	) -> BOOL ---
+	SetThreadContext :: proc(
+		hThread: HANDLE,
+		lpContext: LPCONTEXT,
+	) -> BOOL ---
 	CreateProcessW :: proc(
 		lpApplicationName: LPCWSTR,
 		lpCommandLine: LPWSTR,

+ 26 - 2
core/sys/windows/types.odin

@@ -143,6 +143,7 @@ LPWSAPROTOCOL_INFO :: ^WSAPROTOCOL_INFO
 LPSTR :: ^CHAR
 LPWSTR :: ^WCHAR
 OLECHAR :: WCHAR
+BSTR :: ^OLECHAR
 LPOLESTR :: ^OLECHAR
 LPCOLESTR :: LPCSTR
 LPFILETIME :: ^FILETIME
@@ -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
 
@@ -3415,8 +3428,6 @@ TIME_ZONE_INFORMATION :: struct {
 	DaylightBias: LONG,
 }
 
-
-@(private="file")
 IMAGE_DOS_HEADER :: struct {
 	e_magic:    WORD,
 	e_cblp:     WORD,
@@ -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