1 | /* $Id: internal-r3-win.h 71950 2018-04-20 21:31:06Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * IPRT - some Windows OS type constants.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2013-2017 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 |
|
---|
28 | #ifndef ___internal_r3_win_h
|
---|
29 | #define ___internal_r3_win_h
|
---|
30 |
|
---|
31 | #include "internal/iprt.h"
|
---|
32 | #include <iprt/types.h>
|
---|
33 |
|
---|
34 |
|
---|
35 | /*******************************************************************************
|
---|
36 | * Structures and Typedefs *
|
---|
37 | *******************************************************************************/
|
---|
38 | /**
|
---|
39 | * Windows OS type as determined by rtSystemWinOSType().
|
---|
40 | *
|
---|
41 | * @note ASSUMPTIONS are made regarding ordering. Win 9x should come first, then
|
---|
42 | * NT. The Win9x and NT versions should internally be ordered in ascending
|
---|
43 | * version/code-base order.
|
---|
44 | */
|
---|
45 | typedef enum RTWINOSTYPE
|
---|
46 | {
|
---|
47 | kRTWinOSType_UNKNOWN = 0,
|
---|
48 | kRTWinOSType_9XFIRST = 1,
|
---|
49 | kRTWinOSType_95 = kRTWinOSType_9XFIRST,
|
---|
50 | kRTWinOSType_95SP1,
|
---|
51 | kRTWinOSType_95OSR2,
|
---|
52 | kRTWinOSType_98,
|
---|
53 | kRTWinOSType_98SP1,
|
---|
54 | kRTWinOSType_98SE,
|
---|
55 | kRTWinOSType_ME,
|
---|
56 | kRTWinOSType_9XLAST = 99,
|
---|
57 | kRTWinOSType_NTFIRST = 100,
|
---|
58 | kRTWinOSType_NT310 = kRTWinOSType_NTFIRST,
|
---|
59 | kRTWinOSType_NT350,
|
---|
60 | kRTWinOSType_NT351,
|
---|
61 | kRTWinOSType_NT4,
|
---|
62 | kRTWinOSType_2K, /* 5.0 */
|
---|
63 | kRTWinOSType_XP, /* 5.1 */
|
---|
64 | kRTWinOSType_XP64, /* 5.2, workstation */
|
---|
65 | kRTWinOSType_2003, /* 5.2 */
|
---|
66 | kRTWinOSType_VISTA, /* 6.0, workstation */
|
---|
67 | kRTWinOSType_2008, /* 6.0, server */
|
---|
68 | kRTWinOSType_7, /* 6.1, workstation */
|
---|
69 | kRTWinOSType_2008R2, /* 6.1, server */
|
---|
70 | kRTWinOSType_8, /* 6.2, workstation */
|
---|
71 | kRTWinOSType_2012, /* 6.2, server */
|
---|
72 | kRTWinOSType_81, /* 6.3, workstation */
|
---|
73 | kRTWinOSType_2012R2, /* 6.3, server */
|
---|
74 | kRTWinOSType_10, /* 10.0, workstation */
|
---|
75 | kRTWinOSType_2016, /* 10.0, server */
|
---|
76 | kRTWinOSType_NT_UNKNOWN = 199,
|
---|
77 | kRTWinOSType_NT_LAST = kRTWinOSType_UNKNOWN
|
---|
78 | } RTWINOSTYPE;
|
---|
79 |
|
---|
80 | /**
|
---|
81 | * Windows loader protection level.
|
---|
82 | */
|
---|
83 | typedef enum RTR3WINLDRPROT
|
---|
84 | {
|
---|
85 | RTR3WINLDRPROT_INVALID = 0,
|
---|
86 | RTR3WINLDRPROT_NONE,
|
---|
87 | RTR3WINLDRPROT_NO_CWD,
|
---|
88 | RTR3WINLDRPROT_SAFE,
|
---|
89 | RTR3WINLDRPROT_SAFER
|
---|
90 | } RTR3WINLDRPROT;
|
---|
91 |
|
---|
92 |
|
---|
93 | /*******************************************************************************
|
---|
94 | * Global Variables *
|
---|
95 | *******************************************************************************/
|
---|
96 | extern DECLHIDDEN(RTR3WINLDRPROT) g_enmWinLdrProt;
|
---|
97 | extern DECLHIDDEN(RTWINOSTYPE) g_enmWinVer;
|
---|
98 | #ifdef _WINDEF_
|
---|
99 | extern DECLHIDDEN(OSVERSIONINFOEXW) g_WinOsInfoEx;
|
---|
100 |
|
---|
101 | extern DECLHIDDEN(HMODULE) g_hModKernel32;
|
---|
102 | typedef UINT (WINAPI *PFNGETWINSYSDIR)(LPWSTR,UINT);
|
---|
103 | extern DECLHIDDEN(PFNGETWINSYSDIR) g_pfnGetSystemWindowsDirectoryW;
|
---|
104 | extern decltype(SystemTimeToTzSpecificLocalTime) *g_pfnSystemTimeToTzSpecificLocalTime;
|
---|
105 |
|
---|
106 | extern DECLHIDDEN(HMODULE) g_hModNtDll;
|
---|
107 | typedef NTSTATUS (NTAPI *PFNNTQUERYFULLATTRIBUTESFILE)(struct _OBJECT_ATTRIBUTES *, struct _FILE_NETWORK_OPEN_INFORMATION *);
|
---|
108 | extern DECLHIDDEN(PFNNTQUERYFULLATTRIBUTESFILE) g_pfnNtQueryFullAttributesFile;
|
---|
109 | typedef NTSTATUS (NTAPI *PFNNTDUPLICATETOKEN)(HANDLE, ACCESS_MASK, struct _OBJECT_ATTRIBUTES *, BOOLEAN, TOKEN_TYPE, PHANDLE);
|
---|
110 | extern DECLHIDDEN(PFNNTDUPLICATETOKEN) g_pfnNtDuplicateToken;
|
---|
111 | #ifdef ___iprt_nt_nt_h___
|
---|
112 | extern decltype(NtAlertThread) *g_pfnNtAlertThread;
|
---|
113 | #endif
|
---|
114 |
|
---|
115 | extern DECLHIDDEN(HMODULE) g_hModWinSock;
|
---|
116 |
|
---|
117 | /** WSAStartup */
|
---|
118 | typedef int (WINAPI *PFNWSASTARTUP)(WORD, struct WSAData *);
|
---|
119 | /** WSACleanup */
|
---|
120 | typedef int (WINAPI *PFNWSACLEANUP)(void);
|
---|
121 | /** WSAGetLastError */
|
---|
122 | typedef int (WINAPI *PFNWSAGETLASTERROR)(void);
|
---|
123 | /** WSASetLastError */
|
---|
124 | typedef int (WINAPI *PFNWSASETLASTERROR)(int);
|
---|
125 | /** WSACreateEvent */
|
---|
126 | typedef HANDLE (WINAPI *PFNWSACREATEEVENT)(void);
|
---|
127 | /** WSASetEvent */
|
---|
128 | typedef BOOL (WINAPI *PFNWSASETEVENT)(HANDLE);
|
---|
129 | /** WSACloseEvent */
|
---|
130 | typedef BOOL (WINAPI *PFNWSACLOSEEVENT)(HANDLE);
|
---|
131 | /** WSAEventSelect */
|
---|
132 | typedef BOOL (WINAPI *PFNWSAEVENTSELECT)(UINT_PTR, HANDLE, LONG);
|
---|
133 | /** WSAEnumNetworkEvents */
|
---|
134 | typedef int (WINAPI *PFNWSAENUMNETWORKEVENTS)(UINT_PTR, HANDLE, struct _WSANETWORKEVENTS *);
|
---|
135 | /** WSASend */
|
---|
136 | typedef int (WINAPI *PFNWSASend)(UINT_PTR, struct _WSABUF *, DWORD, LPDWORD, DWORD dwFlags, struct _OVERLAPPED *, PFNRT /*LPWSAOVERLAPPED_COMPLETION_ROUTINE*/);
|
---|
137 |
|
---|
138 | /** socket */
|
---|
139 | typedef UINT_PTR (WINAPI *PFNWINSOCKSOCKET)(int, int, int);
|
---|
140 | /** closesocket */
|
---|
141 | typedef int (WINAPI *PFNWINSOCKCLOSESOCKET)(UINT_PTR);
|
---|
142 | /** recv */
|
---|
143 | typedef int (WINAPI *PFNWINSOCKRECV)(UINT_PTR, char *, int, int);
|
---|
144 | /** send */
|
---|
145 | typedef int (WINAPI *PFNWINSOCKSEND)(UINT_PTR, const char *, int, int);
|
---|
146 | /** recvfrom */
|
---|
147 | typedef int (WINAPI *PFNWINSOCKRECVFROM)(UINT_PTR, char *, int, int, struct sockaddr *, int *);
|
---|
148 | /** sendto */
|
---|
149 | typedef int (WINAPI *PFNWINSOCKSENDTO)(UINT_PTR, const char *, int, int, const struct sockaddr *, int);
|
---|
150 | /** bind */
|
---|
151 | typedef int (WINAPI *PFNWINSOCKBIND)(UINT_PTR, const struct sockaddr *, int);
|
---|
152 | /** listen */
|
---|
153 | typedef int (WINAPI *PFNWINSOCKLISTEN)(UINT_PTR, int);
|
---|
154 | /** accept */
|
---|
155 | typedef UINT_PTR (WINAPI *PFNWINSOCKACCEPT)(UINT_PTR, struct sockaddr *, int *);
|
---|
156 | /** connect */
|
---|
157 | typedef int (WINAPI *PFNWINSOCKCONNECT)(UINT_PTR, const struct sockaddr *, int);
|
---|
158 | /** shutdown */
|
---|
159 | typedef int (WINAPI *PFNWINSOCKSHUTDOWN)(UINT_PTR, int);
|
---|
160 | /** getsockopt */
|
---|
161 | typedef int (WINAPI *PFNWINSOCKGETSOCKOPT)(UINT_PTR, int, int, char *, int *);
|
---|
162 | /** setsockopt */
|
---|
163 | typedef int (WINAPI *PFNWINSOCKSETSOCKOPT)(UINT_PTR, int, int, const char *, int);
|
---|
164 | /** ioctlsocket */
|
---|
165 | typedef int (WINAPI *PFNWINSOCKIOCTLSOCKET)(UINT_PTR, long, unsigned long *);
|
---|
166 | /** getpeername */
|
---|
167 | typedef int (WINAPI *PFNWINSOCKGETPEERNAME)(UINT_PTR, struct sockaddr *, int *);
|
---|
168 | /** getsockname */
|
---|
169 | typedef int (WINAPI *PFNWINSOCKGETSOCKNAME)(UINT_PTR, struct sockaddr *, int *);
|
---|
170 | /** __WSAFDIsSet */
|
---|
171 | typedef int (WINAPI *PFNWINSOCK__WSAFDISSET)(UINT_PTR, struct fd_set *);
|
---|
172 | /** select */
|
---|
173 | typedef int (WINAPI *PFNWINSOCKSELECT)(int, struct fd_set *, struct fd_set *, struct fd_set *, const struct timeval *);
|
---|
174 | /** gethostbyname */
|
---|
175 | typedef struct hostent *(WINAPI *PFNWINSOCKGETHOSTBYNAME)(const char *);
|
---|
176 |
|
---|
177 | extern DECLHIDDEN(PFNWSASTARTUP) g_pfnWSAStartup;
|
---|
178 | extern DECLHIDDEN(PFNWSACLEANUP) g_pfnWSACleanup;
|
---|
179 | extern PFNWSAGETLASTERROR g_pfnWSAGetLastError;
|
---|
180 | extern PFNWSASETLASTERROR g_pfnWSASetLastError;
|
---|
181 | extern DECLHIDDEN(PFNWSACREATEEVENT) g_pfnWSACreateEvent;
|
---|
182 | extern DECLHIDDEN(PFNWSACLOSEEVENT) g_pfnWSACloseEvent;
|
---|
183 | extern DECLHIDDEN(PFNWSASETEVENT) g_pfnWSASetEvent;
|
---|
184 | extern DECLHIDDEN(PFNWSAEVENTSELECT) g_pfnWSAEventSelect;
|
---|
185 | extern DECLHIDDEN(PFNWSAENUMNETWORKEVENTS) g_pfnWSAEnumNetworkEvents;
|
---|
186 | extern DECLHIDDEN(PFNWSASend) g_pfnWSASend;
|
---|
187 | extern DECLHIDDEN(PFNWINSOCKSOCKET) g_pfnsocket;
|
---|
188 | extern DECLHIDDEN(PFNWINSOCKCLOSESOCKET) g_pfnclosesocket;
|
---|
189 | extern DECLHIDDEN(PFNWINSOCKRECV) g_pfnrecv;
|
---|
190 | extern DECLHIDDEN(PFNWINSOCKSEND) g_pfnsend;
|
---|
191 | extern DECLHIDDEN(PFNWINSOCKRECVFROM) g_pfnrecvfrom;
|
---|
192 | extern DECLHIDDEN(PFNWINSOCKSENDTO) g_pfnsendto;
|
---|
193 | extern DECLHIDDEN(PFNWINSOCKBIND) g_pfnbind;
|
---|
194 | extern DECLHIDDEN(PFNWINSOCKLISTEN) g_pfnlisten;
|
---|
195 | extern DECLHIDDEN(PFNWINSOCKACCEPT) g_pfnaccept;
|
---|
196 | extern DECLHIDDEN(PFNWINSOCKCONNECT) g_pfnconnect;
|
---|
197 | extern DECLHIDDEN(PFNWINSOCKSHUTDOWN) g_pfnshutdown;
|
---|
198 | extern DECLHIDDEN(PFNWINSOCKGETSOCKOPT) g_pfngetsockopt;
|
---|
199 | extern DECLHIDDEN(PFNWINSOCKSETSOCKOPT) g_pfnsetsockopt;
|
---|
200 | extern DECLHIDDEN(PFNWINSOCKIOCTLSOCKET) g_pfnioctlsocket;
|
---|
201 | extern DECLHIDDEN(PFNWINSOCKGETPEERNAME) g_pfngetpeername;
|
---|
202 | extern DECLHIDDEN(PFNWINSOCKGETSOCKNAME) g_pfngetsockname;
|
---|
203 | extern DECLHIDDEN(PFNWINSOCK__WSAFDISSET) g_pfn__WSAFDIsSet;
|
---|
204 | extern DECLHIDDEN(PFNWINSOCKSELECT) g_pfnselect;
|
---|
205 | extern DECLHIDDEN(PFNWINSOCKGETHOSTBYNAME) g_pfngethostbyname;
|
---|
206 | #endif
|
---|
207 |
|
---|
208 |
|
---|
209 | #endif
|
---|
210 |
|
---|