aboutsummaryrefslogtreecommitdiff
path: root/base/runtime/procs_windows_i386.odin
blob: 10422cf07ff2c9bdd6842c776cc0c46e1fd6bcd7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
//+private
//+no-instrumentation
package runtime

@require foreign import "system:int64.lib"

foreign import kernel32 "system:Kernel32.lib"

windows_trap_array_bounds :: proc "contextless" () -> ! {
	DWORD :: u32
	ULONG_PTR :: uint

	EXCEPTION_ARRAY_BOUNDS_EXCEEDED :: 0xC000008C

	foreign kernel32 {
		RaiseException :: proc "system" (dwExceptionCode, dwExceptionFlags, nNumberOfArguments: DWORD, lpArguments: ^ULONG_PTR) -> ! ---
	}

	RaiseException(EXCEPTION_ARRAY_BOUNDS_EXCEEDED, 0, 0, nil)
}

windows_trap_type_assertion :: proc "contextless" () -> ! {
	windows_trap_array_bounds()
}

@(private, export, link_name="_fltused") _fltused: i32 = 0x9875

@(private, export, link_name="_tls_index") _tls_index: u32
@(private, export, link_name="_tls_array") _tls_array: u32