1 // Copyright 2009 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
4 
5 // Windows architecture-independent definitions.
6 
7 package runtime
8 
9 const (
10 	_PROT_NONE  = 0
11 	_PROT_READ  = 1
12 	_PROT_WRITE = 2
13 	_PROT_EXEC  = 4
14 
15 	_MAP_ANON    = 1
16 	_MAP_PRIVATE = 2
17 
18 	_DUPLICATE_SAME_ACCESS   = 0x2
19 	_THREAD_PRIORITY_HIGHEST = 0x2
20 
21 	_SIGINT              = 0x2
22 	_SIGTERM             = 0xF
23 	_CTRL_C_EVENT        = 0x0
24 	_CTRL_BREAK_EVENT    = 0x1
25 	_CTRL_CLOSE_EVENT    = 0x2
26 	_CTRL_LOGOFF_EVENT   = 0x5
27 	_CTRL_SHUTDOWN_EVENT = 0x6
28 
29 	_EXCEPTION_ACCESS_VIOLATION     = 0xc0000005
30 	_EXCEPTION_IN_PAGE_ERROR        = 0xc0000006
31 	_EXCEPTION_BREAKPOINT           = 0x80000003
32 	_EXCEPTION_ILLEGAL_INSTRUCTION  = 0xc000001d
33 	_EXCEPTION_FLT_DENORMAL_OPERAND = 0xc000008d
34 	_EXCEPTION_FLT_DIVIDE_BY_ZERO   = 0xc000008e
35 	_EXCEPTION_FLT_INEXACT_RESULT   = 0xc000008f
36 	_EXCEPTION_FLT_OVERFLOW         = 0xc0000091
37 	_EXCEPTION_FLT_UNDERFLOW        = 0xc0000093
38 	_EXCEPTION_INT_DIVIDE_BY_ZERO   = 0xc0000094
39 	_EXCEPTION_INT_OVERFLOW         = 0xc0000095
40 
41 	_INFINITE     = 0xffffffff
42 	_WAIT_TIMEOUT = 0x102
43 
44 	_EXCEPTION_CONTINUE_EXECUTION  = -0x1
45 	_EXCEPTION_CONTINUE_SEARCH     = 0x0
46 	_EXCEPTION_CONTINUE_SEARCH_SEH = 0x1
47 )
48 
49 type systeminfo struct {
50 	anon0                       [4]byte
51 	dwpagesize                  uint32
52 	lpminimumapplicationaddress *byte
53 	lpmaximumapplicationaddress *byte
54 	dwactiveprocessormask       uintptr
55 	dwnumberofprocessors        uint32
56 	dwprocessortype             uint32
57 	dwallocationgranularity     uint32
58 	wprocessorlevel             uint16
59 	wprocessorrevision          uint16
60 }
61 
62 type exceptionpointers struct {
63 	record  *exceptionrecord
64 	context *context
65 }
66 
67 type exceptionrecord struct {
68 	exceptioncode        uint32
69 	exceptionflags       uint32
70 	exceptionrecord      *exceptionrecord
71 	exceptionaddress     uintptr
72 	numberparameters     uint32
73 	exceptioninformation [15]uintptr
74 }
75 
76 type overlapped struct {
77 	internal     uintptr
78 	internalhigh uintptr
79 	anon0        [8]byte
80 	hevent       *byte
81 }
82 
83 type memoryBasicInformation struct {
84 	baseAddress       uintptr
85 	allocationBase    uintptr
86 	allocationProtect uint32
87 	regionSize        uintptr
88 	state             uint32
89 	protect           uint32
90 	type_             uint32
91 }
92 
93 // https://learn.microsoft.com/en-us/windows-hardware/drivers/ddi/wdm/ns-wdm-_osversioninfow
94 type _OSVERSIONINFOW struct {
95 	osVersionInfoSize uint32
96 	majorVersion      uint32
97 	minorVersion      uint32
98 	buildNumber       uint32
99 	platformId        uint32
100 	csdVersion        [128]uint16
101 }
102