1 | /* $Id: internal-r3-win.h 93115 2022-01-01 11:31:46Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * IPRT - some Windows OS type constants.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2013-2022 Oracle Corporation
|
---|
8 | *
|
---|
9 | * This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
10 | * available from http://www.virtualbox.org. This file is free software;
|
---|
11 | * you can redistribute it and/or modify it under the terms of the GNU
|
---|
12 | * General Public License (GPL) as published by the Free Software
|
---|
13 | * Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
14 | * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
15 | * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
16 | *
|
---|
17 | * The contents of this file may alternatively be used under the terms
|
---|
18 | * of the Common Development and Distribution License Version 1.0
|
---|
19 | * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
|
---|
20 | * VirtualBox OSE distribution, in which case the provisions of the
|
---|
21 | * CDDL are applicable instead of those of the GPL.
|
---|
22 | *
|
---|
23 | * You may elect to license modified versions of this file under the
|
---|
24 | * terms and conditions of either the GPL or the CDDL or both.
|
---|
25 | */
|
---|
26 |
|
---|
27 | #ifndef IPRT_INCLUDED_SRC_r3_win_internal_r3_win_h
|
---|
28 | #define IPRT_INCLUDED_SRC_r3_win_internal_r3_win_h
|
---|
29 | #ifndef RT_WITHOUT_PRAGMA_ONCE
|
---|
30 | # pragma once
|
---|
31 | #endif
|
---|
32 |
|
---|
33 | #include "internal/iprt.h"
|
---|
34 | #include <iprt/types.h>
|
---|
35 |
|
---|
36 |
|
---|
37 | /*******************************************************************************
|
---|
38 | * Structures and Typedefs *
|
---|
39 | *******************************************************************************/
|
---|
40 | /**
|
---|
41 | * Windows OS type as determined by rtSystemWinOSType().
|
---|
42 | *
|
---|
43 | * @note ASSUMPTIONS are made regarding ordering. Win 9x should come first, then
|
---|
44 | * NT. The Win9x and NT versions should internally be ordered in ascending
|
---|
45 | * version/code-base order.
|
---|
46 | */
|
---|
47 | typedef enum RTWINOSTYPE
|
---|
48 | {
|
---|
49 | kRTWinOSType_UNKNOWN = 0,
|
---|
50 | kRTWinOSType_9XFIRST = 1,
|
---|
51 | kRTWinOSType_95 = kRTWinOSType_9XFIRST,
|
---|
52 | kRTWinOSType_95SP1,
|
---|
53 | kRTWinOSType_95OSR2,
|
---|
54 | kRTWinOSType_98,
|
---|
55 | kRTWinOSType_98SP1,
|
---|
56 | kRTWinOSType_98SE,
|
---|
57 | kRTWinOSType_ME,
|
---|
58 | kRTWinOSType_9XLAST = 99,
|
---|
59 | kRTWinOSType_NTFIRST = 100,
|
---|
60 | kRTWinOSType_NT310 = kRTWinOSType_NTFIRST,
|
---|
61 | kRTWinOSType_NT350,
|
---|
62 | kRTWinOSType_NT351,
|
---|
63 | kRTWinOSType_NT4,
|
---|
64 | kRTWinOSType_2K, /* 5.0 */
|
---|
65 | kRTWinOSType_XP, /* 5.1 */
|
---|
66 | kRTWinOSType_XP64, /* 5.2, workstation */
|
---|
67 | kRTWinOSType_2003, /* 5.2 */
|
---|
68 | kRTWinOSType_VISTA, /* 6.0, workstation */
|
---|
69 | kRTWinOSType_2008, /* 6.0, server */
|
---|
70 | kRTWinOSType_7, /* 6.1, workstation */
|
---|
71 | kRTWinOSType_2008R2, /* 6.1, server */
|
---|
72 | kRTWinOSType_8, /* 6.2, workstation */
|
---|
73 | kRTWinOSType_2012, /* 6.2, server */
|
---|
74 | kRTWinOSType_81, /* 6.3, workstation */
|
---|
75 | kRTWinOSType_2012R2, /* 6.3, server */
|
---|
76 | kRTWinOSType_10, /* 10.0, workstation */
|
---|
77 | kRTWinOSType_2016, /* 10.0 1607, server */
|
---|
78 | kRTWinOSType_2019, /* 10.0 1809, server */
|
---|
79 | kRTWinOSType_2022, /* 10.0 21H2, server */
|
---|
80 | kRTWinOSType_11, /* 11.0, workstation */
|
---|
81 | kRTWinOSType_NT_UNKNOWN = 199,
|
---|
82 | kRTWinOSType_NT_LAST = kRTWinOSType_UNKNOWN
|
---|
83 | } RTWINOSTYPE;
|
---|
84 |
|
---|
85 | /**
|
---|
86 | * Windows loader protection level.
|
---|
87 | */
|
---|
88 | typedef enum RTR3WINLDRPROT
|
---|
89 | {
|
---|
90 | RTR3WINLDRPROT_INVALID = 0,
|
---|
91 | RTR3WINLDRPROT_NONE,
|
---|
92 | RTR3WINLDRPROT_NO_CWD,
|
---|
93 | RTR3WINLDRPROT_SAFE,
|
---|
94 | RTR3WINLDRPROT_SAFER
|
---|
95 | } RTR3WINLDRPROT;
|
---|
96 |
|
---|
97 |
|
---|
98 | /*********************************************************************************************************************************
|
---|
99 | * Global Variables *
|
---|
100 | *********************************************************************************************************************************/
|
---|
101 | extern DECL_HIDDEN_DATA(RTR3WINLDRPROT) g_enmWinLdrProt;
|
---|
102 | extern DECL_HIDDEN_DATA(RTWINOSTYPE) g_enmWinVer;
|
---|
103 | #ifdef _WINDEF_
|
---|
104 | extern DECL_HIDDEN_DATA(OSVERSIONINFOEXW) g_WinOsInfoEx;
|
---|
105 |
|
---|
106 | extern DECL_HIDDEN_DATA(HMODULE) g_hModKernel32;
|
---|
107 | typedef UINT (WINAPI *PFNGETWINSYSDIR)(LPWSTR,UINT);
|
---|
108 | extern DECL_HIDDEN_DATA(PFNGETWINSYSDIR) g_pfnGetSystemWindowsDirectoryW;
|
---|
109 | extern DECL_HIDDEN_DATA(decltype(SystemTimeToTzSpecificLocalTime) *) g_pfnSystemTimeToTzSpecificLocalTime;
|
---|
110 | typedef HANDLE (WINAPI *PFNCREATEWAITABLETIMEREX)(LPSECURITY_ATTRIBUTES, LPCWSTR, DWORD, DWORD);
|
---|
111 | extern DECL_HIDDEN_DATA(PFNCREATEWAITABLETIMEREX) g_pfnCreateWaitableTimerExW;
|
---|
112 |
|
---|
113 | extern DECL_HIDDEN_DATA(HMODULE) g_hModNtDll;
|
---|
114 | typedef NTSTATUS (NTAPI *PFNNTQUERYFULLATTRIBUTESFILE)(struct _OBJECT_ATTRIBUTES *, struct _FILE_NETWORK_OPEN_INFORMATION *);
|
---|
115 | extern DECL_HIDDEN_DATA(PFNNTQUERYFULLATTRIBUTESFILE) g_pfnNtQueryFullAttributesFile;
|
---|
116 | typedef NTSTATUS (NTAPI *PFNNTDUPLICATETOKEN)(HANDLE, ACCESS_MASK, struct _OBJECT_ATTRIBUTES *, BOOLEAN, TOKEN_TYPE, PHANDLE);
|
---|
117 | extern DECL_HIDDEN_DATA(PFNNTDUPLICATETOKEN) g_pfnNtDuplicateToken;
|
---|
118 | #ifdef IPRT_INCLUDED_nt_nt_h
|
---|
119 | extern DECL_HIDDEN_DATA(decltype(NtAlertThread) *) g_pfnNtAlertThread;
|
---|
120 | #endif
|
---|
121 |
|
---|
122 | extern DECL_HIDDEN_DATA(HMODULE) g_hModWinSock;
|
---|
123 |
|
---|
124 | /** WSAStartup */
|
---|
125 | typedef int (WINAPI *PFNWSASTARTUP)(WORD, struct WSAData *);
|
---|
126 | /** WSACleanup */
|
---|
127 | typedef int (WINAPI *PFNWSACLEANUP)(void);
|
---|
128 | /** WSAGetLastError */
|
---|
129 | typedef int (WINAPI *PFNWSAGETLASTERROR)(void);
|
---|
130 | /** WSASetLastError */
|
---|
131 | typedef int (WINAPI *PFNWSASETLASTERROR)(int);
|
---|
132 | /** WSACreateEvent */
|
---|
133 | typedef HANDLE (WINAPI *PFNWSACREATEEVENT)(void);
|
---|
134 | /** WSASetEvent */
|
---|
135 | typedef BOOL (WINAPI *PFNWSASETEVENT)(HANDLE);
|
---|
136 | /** WSACloseEvent */
|
---|
137 | typedef BOOL (WINAPI *PFNWSACLOSEEVENT)(HANDLE);
|
---|
138 | /** WSAEventSelect */
|
---|
139 | typedef BOOL (WINAPI *PFNWSAEVENTSELECT)(UINT_PTR, HANDLE, LONG);
|
---|
140 | /** WSAEnumNetworkEvents */
|
---|
141 | typedef int (WINAPI *PFNWSAENUMNETWORKEVENTS)(UINT_PTR, HANDLE, struct _WSANETWORKEVENTS *);
|
---|
142 | /** WSASend */
|
---|
143 | typedef int (WINAPI *PFNWSASend)(UINT_PTR, struct _WSABUF *, DWORD, LPDWORD, DWORD dwFlags, struct _OVERLAPPED *, uintptr_t /*LPWSAOVERLAPPED_COMPLETION_ROUTINE*/);
|
---|
144 |
|
---|
145 | /** socket */
|
---|
146 | typedef UINT_PTR (WINAPI *PFNWINSOCKSOCKET)(int, int, int);
|
---|
147 | /** closesocket */
|
---|
148 | typedef int (WINAPI *PFNWINSOCKCLOSESOCKET)(UINT_PTR);
|
---|
149 | /** recv */
|
---|
150 | typedef int (WINAPI *PFNWINSOCKRECV)(UINT_PTR, char *, int, int);
|
---|
151 | /** send */
|
---|
152 | typedef int (WINAPI *PFNWINSOCKSEND)(UINT_PTR, const char *, int, int);
|
---|
153 | /** recvfrom */
|
---|
154 | typedef int (WINAPI *PFNWINSOCKRECVFROM)(UINT_PTR, char *, int, int, struct sockaddr *, int *);
|
---|
155 | /** sendto */
|
---|
156 | typedef int (WINAPI *PFNWINSOCKSENDTO)(UINT_PTR, const char *, int, int, const struct sockaddr *, int);
|
---|
157 | /** bind */
|
---|
158 | typedef int (WINAPI *PFNWINSOCKBIND)(UINT_PTR, const struct sockaddr *, int);
|
---|
159 | /** listen */
|
---|
160 | typedef int (WINAPI *PFNWINSOCKLISTEN)(UINT_PTR, int);
|
---|
161 | /** accept */
|
---|
162 | typedef UINT_PTR (WINAPI *PFNWINSOCKACCEPT)(UINT_PTR, struct sockaddr *, int *);
|
---|
163 | /** connect */
|
---|
164 | typedef int (WINAPI *PFNWINSOCKCONNECT)(UINT_PTR, const struct sockaddr *, int);
|
---|
165 | /** shutdown */
|
---|
166 | typedef int (WINAPI *PFNWINSOCKSHUTDOWN)(UINT_PTR, int);
|
---|
167 | /** getsockopt */
|
---|
168 | typedef int (WINAPI *PFNWINSOCKGETSOCKOPT)(UINT_PTR, int, int, char *, int *);
|
---|
169 | /** setsockopt */
|
---|
170 | typedef int (WINAPI *PFNWINSOCKSETSOCKOPT)(UINT_PTR, int, int, const char *, int);
|
---|
171 | /** ioctlsocket */
|
---|
172 | typedef int (WINAPI *PFNWINSOCKIOCTLSOCKET)(UINT_PTR, long, unsigned long *);
|
---|
173 | /** getpeername */
|
---|
174 | typedef int (WINAPI *PFNWINSOCKGETPEERNAME)(UINT_PTR, struct sockaddr *, int *);
|
---|
175 | /** getsockname */
|
---|
176 | typedef int (WINAPI *PFNWINSOCKGETSOCKNAME)(UINT_PTR, struct sockaddr *, int *);
|
---|
177 | /** __WSAFDIsSet */
|
---|
178 | typedef int (WINAPI *PFNWINSOCK__WSAFDISSET)(UINT_PTR, struct fd_set *);
|
---|
179 | /** select */
|
---|
180 | typedef int (WINAPI *PFNWINSOCKSELECT)(int, struct fd_set *, struct fd_set *, struct fd_set *, const struct timeval *);
|
---|
181 | /** gethostbyname */
|
---|
182 | typedef struct hostent *(WINAPI *PFNWINSOCKGETHOSTBYNAME)(const char *);
|
---|
183 |
|
---|
184 | extern DECL_HIDDEN_DATA(PFNWSASTARTUP) g_pfnWSAStartup;
|
---|
185 | extern DECL_HIDDEN_DATA(PFNWSACLEANUP) g_pfnWSACleanup;
|
---|
186 | extern DECL_HIDDEN_DATA(PFNWSAGETLASTERROR) g_pfnWSAGetLastError;
|
---|
187 | extern DECL_HIDDEN_DATA(PFNWSASETLASTERROR) g_pfnWSASetLastError;
|
---|
188 | extern DECL_HIDDEN_DATA(PFNWSACREATEEVENT) g_pfnWSACreateEvent;
|
---|
189 | extern DECL_HIDDEN_DATA(PFNWSACLOSEEVENT) g_pfnWSACloseEvent;
|
---|
190 | extern DECL_HIDDEN_DATA(PFNWSASETEVENT) g_pfnWSASetEvent;
|
---|
191 | extern DECL_HIDDEN_DATA(PFNWSAEVENTSELECT) g_pfnWSAEventSelect;
|
---|
192 | extern DECL_HIDDEN_DATA(PFNWSAENUMNETWORKEVENTS) g_pfnWSAEnumNetworkEvents;
|
---|
193 | extern DECL_HIDDEN_DATA(PFNWSASend) g_pfnWSASend;
|
---|
194 | extern DECL_HIDDEN_DATA(PFNWINSOCKSOCKET) g_pfnsocket;
|
---|
195 | extern DECL_HIDDEN_DATA(PFNWINSOCKCLOSESOCKET) g_pfnclosesocket;
|
---|
196 | extern DECL_HIDDEN_DATA(PFNWINSOCKRECV) g_pfnrecv;
|
---|
197 | extern DECL_HIDDEN_DATA(PFNWINSOCKSEND) g_pfnsend;
|
---|
198 | extern DECL_HIDDEN_DATA(PFNWINSOCKRECVFROM) g_pfnrecvfrom;
|
---|
199 | extern DECL_HIDDEN_DATA(PFNWINSOCKSENDTO) g_pfnsendto;
|
---|
200 | extern DECL_HIDDEN_DATA(PFNWINSOCKBIND) g_pfnbind;
|
---|
201 | extern DECL_HIDDEN_DATA(PFNWINSOCKLISTEN) g_pfnlisten;
|
---|
202 | extern DECL_HIDDEN_DATA(PFNWINSOCKACCEPT) g_pfnaccept;
|
---|
203 | extern DECL_HIDDEN_DATA(PFNWINSOCKCONNECT) g_pfnconnect;
|
---|
204 | extern DECL_HIDDEN_DATA(PFNWINSOCKSHUTDOWN) g_pfnshutdown;
|
---|
205 | extern DECL_HIDDEN_DATA(PFNWINSOCKGETSOCKOPT) g_pfngetsockopt;
|
---|
206 | extern DECL_HIDDEN_DATA(PFNWINSOCKSETSOCKOPT) g_pfnsetsockopt;
|
---|
207 | extern DECL_HIDDEN_DATA(PFNWINSOCKIOCTLSOCKET) g_pfnioctlsocket;
|
---|
208 | extern DECL_HIDDEN_DATA(PFNWINSOCKGETPEERNAME) g_pfngetpeername;
|
---|
209 | extern DECL_HIDDEN_DATA(PFNWINSOCKGETSOCKNAME) g_pfngetsockname;
|
---|
210 | extern DECL_HIDDEN_DATA(PFNWINSOCK__WSAFDISSET) g_pfn__WSAFDIsSet;
|
---|
211 | extern DECL_HIDDEN_DATA(PFNWINSOCKSELECT) g_pfnselect;
|
---|
212 | extern DECL_HIDDEN_DATA(PFNWINSOCKGETHOSTBYNAME) g_pfngethostbyname;
|
---|
213 | #endif
|
---|
214 |
|
---|
215 |
|
---|
216 | #endif /* !IPRT_INCLUDED_SRC_r3_win_internal_r3_win_h */
|
---|
217 |
|
---|