1 | /* $Id: internal-r3-win.h 76585 2019-01-01 06:31:29Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * IPRT - some Windows OS type constants.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2013-2019 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, server */
|
---|
78 | kRTWinOSType_NT_UNKNOWN = 199,
|
---|
79 | kRTWinOSType_NT_LAST = kRTWinOSType_UNKNOWN
|
---|
80 | } RTWINOSTYPE;
|
---|
81 |
|
---|
82 | /**
|
---|
83 | * Windows loader protection level.
|
---|
84 | */
|
---|
85 | typedef enum RTR3WINLDRPROT
|
---|
86 | {
|
---|
87 | RTR3WINLDRPROT_INVALID = 0,
|
---|
88 | RTR3WINLDRPROT_NONE,
|
---|
89 | RTR3WINLDRPROT_NO_CWD,
|
---|
90 | RTR3WINLDRPROT_SAFE,
|
---|
91 | RTR3WINLDRPROT_SAFER
|
---|
92 | } RTR3WINLDRPROT;
|
---|
93 |
|
---|
94 |
|
---|
95 | /*******************************************************************************
|
---|
96 | * Global Variables *
|
---|
97 | *******************************************************************************/
|
---|
98 | extern DECLHIDDEN(RTR3WINLDRPROT) g_enmWinLdrProt;
|
---|
99 | extern DECLHIDDEN(RTWINOSTYPE) g_enmWinVer;
|
---|
100 | #ifdef _WINDEF_
|
---|
101 | extern DECLHIDDEN(OSVERSIONINFOEXW) g_WinOsInfoEx;
|
---|
102 |
|
---|
103 | extern DECLHIDDEN(HMODULE) g_hModKernel32;
|
---|
104 | typedef UINT (WINAPI *PFNGETWINSYSDIR)(LPWSTR,UINT);
|
---|
105 | extern DECLHIDDEN(PFNGETWINSYSDIR) g_pfnGetSystemWindowsDirectoryW;
|
---|
106 | extern decltype(SystemTimeToTzSpecificLocalTime) *g_pfnSystemTimeToTzSpecificLocalTime;
|
---|
107 |
|
---|
108 | extern DECLHIDDEN(HMODULE) g_hModNtDll;
|
---|
109 | typedef NTSTATUS (NTAPI *PFNNTQUERYFULLATTRIBUTESFILE)(struct _OBJECT_ATTRIBUTES *, struct _FILE_NETWORK_OPEN_INFORMATION *);
|
---|
110 | extern DECLHIDDEN(PFNNTQUERYFULLATTRIBUTESFILE) g_pfnNtQueryFullAttributesFile;
|
---|
111 | typedef NTSTATUS (NTAPI *PFNNTDUPLICATETOKEN)(HANDLE, ACCESS_MASK, struct _OBJECT_ATTRIBUTES *, BOOLEAN, TOKEN_TYPE, PHANDLE);
|
---|
112 | extern DECLHIDDEN(PFNNTDUPLICATETOKEN) g_pfnNtDuplicateToken;
|
---|
113 | #ifdef IPRT_INCLUDED_nt_nt_h
|
---|
114 | extern decltype(NtAlertThread) *g_pfnNtAlertThread;
|
---|
115 | #endif
|
---|
116 |
|
---|
117 | extern DECLHIDDEN(HMODULE) g_hModWinSock;
|
---|
118 |
|
---|
119 | /** WSAStartup */
|
---|
120 | typedef int (WINAPI *PFNWSASTARTUP)(WORD, struct WSAData *);
|
---|
121 | /** WSACleanup */
|
---|
122 | typedef int (WINAPI *PFNWSACLEANUP)(void);
|
---|
123 | /** WSAGetLastError */
|
---|
124 | typedef int (WINAPI *PFNWSAGETLASTERROR)(void);
|
---|
125 | /** WSASetLastError */
|
---|
126 | typedef int (WINAPI *PFNWSASETLASTERROR)(int);
|
---|
127 | /** WSACreateEvent */
|
---|
128 | typedef HANDLE (WINAPI *PFNWSACREATEEVENT)(void);
|
---|
129 | /** WSASetEvent */
|
---|
130 | typedef BOOL (WINAPI *PFNWSASETEVENT)(HANDLE);
|
---|
131 | /** WSACloseEvent */
|
---|
132 | typedef BOOL (WINAPI *PFNWSACLOSEEVENT)(HANDLE);
|
---|
133 | /** WSAEventSelect */
|
---|
134 | typedef BOOL (WINAPI *PFNWSAEVENTSELECT)(UINT_PTR, HANDLE, LONG);
|
---|
135 | /** WSAEnumNetworkEvents */
|
---|
136 | typedef int (WINAPI *PFNWSAENUMNETWORKEVENTS)(UINT_PTR, HANDLE, struct _WSANETWORKEVENTS *);
|
---|
137 | /** WSASend */
|
---|
138 | typedef int (WINAPI *PFNWSASend)(UINT_PTR, struct _WSABUF *, DWORD, LPDWORD, DWORD dwFlags, struct _OVERLAPPED *, PFNRT /*LPWSAOVERLAPPED_COMPLETION_ROUTINE*/);
|
---|
139 |
|
---|
140 | /** socket */
|
---|
141 | typedef UINT_PTR (WINAPI *PFNWINSOCKSOCKET)(int, int, int);
|
---|
142 | /** closesocket */
|
---|
143 | typedef int (WINAPI *PFNWINSOCKCLOSESOCKET)(UINT_PTR);
|
---|
144 | /** recv */
|
---|
145 | typedef int (WINAPI *PFNWINSOCKRECV)(UINT_PTR, char *, int, int);
|
---|
146 | /** send */
|
---|
147 | typedef int (WINAPI *PFNWINSOCKSEND)(UINT_PTR, const char *, int, int);
|
---|
148 | /** recvfrom */
|
---|
149 | typedef int (WINAPI *PFNWINSOCKRECVFROM)(UINT_PTR, char *, int, int, struct sockaddr *, int *);
|
---|
150 | /** sendto */
|
---|
151 | typedef int (WINAPI *PFNWINSOCKSENDTO)(UINT_PTR, const char *, int, int, const struct sockaddr *, int);
|
---|
152 | /** bind */
|
---|
153 | typedef int (WINAPI *PFNWINSOCKBIND)(UINT_PTR, const struct sockaddr *, int);
|
---|
154 | /** listen */
|
---|
155 | typedef int (WINAPI *PFNWINSOCKLISTEN)(UINT_PTR, int);
|
---|
156 | /** accept */
|
---|
157 | typedef UINT_PTR (WINAPI *PFNWINSOCKACCEPT)(UINT_PTR, struct sockaddr *, int *);
|
---|
158 | /** connect */
|
---|
159 | typedef int (WINAPI *PFNWINSOCKCONNECT)(UINT_PTR, const struct sockaddr *, int);
|
---|
160 | /** shutdown */
|
---|
161 | typedef int (WINAPI *PFNWINSOCKSHUTDOWN)(UINT_PTR, int);
|
---|
162 | /** getsockopt */
|
---|
163 | typedef int (WINAPI *PFNWINSOCKGETSOCKOPT)(UINT_PTR, int, int, char *, int *);
|
---|
164 | /** setsockopt */
|
---|
165 | typedef int (WINAPI *PFNWINSOCKSETSOCKOPT)(UINT_PTR, int, int, const char *, int);
|
---|
166 | /** ioctlsocket */
|
---|
167 | typedef int (WINAPI *PFNWINSOCKIOCTLSOCKET)(UINT_PTR, long, unsigned long *);
|
---|
168 | /** getpeername */
|
---|
169 | typedef int (WINAPI *PFNWINSOCKGETPEERNAME)(UINT_PTR, struct sockaddr *, int *);
|
---|
170 | /** getsockname */
|
---|
171 | typedef int (WINAPI *PFNWINSOCKGETSOCKNAME)(UINT_PTR, struct sockaddr *, int *);
|
---|
172 | /** __WSAFDIsSet */
|
---|
173 | typedef int (WINAPI *PFNWINSOCK__WSAFDISSET)(UINT_PTR, struct fd_set *);
|
---|
174 | /** select */
|
---|
175 | typedef int (WINAPI *PFNWINSOCKSELECT)(int, struct fd_set *, struct fd_set *, struct fd_set *, const struct timeval *);
|
---|
176 | /** gethostbyname */
|
---|
177 | typedef struct hostent *(WINAPI *PFNWINSOCKGETHOSTBYNAME)(const char *);
|
---|
178 |
|
---|
179 | extern DECLHIDDEN(PFNWSASTARTUP) g_pfnWSAStartup;
|
---|
180 | extern DECLHIDDEN(PFNWSACLEANUP) g_pfnWSACleanup;
|
---|
181 | extern PFNWSAGETLASTERROR g_pfnWSAGetLastError;
|
---|
182 | extern PFNWSASETLASTERROR g_pfnWSASetLastError;
|
---|
183 | extern DECLHIDDEN(PFNWSACREATEEVENT) g_pfnWSACreateEvent;
|
---|
184 | extern DECLHIDDEN(PFNWSACLOSEEVENT) g_pfnWSACloseEvent;
|
---|
185 | extern DECLHIDDEN(PFNWSASETEVENT) g_pfnWSASetEvent;
|
---|
186 | extern DECLHIDDEN(PFNWSAEVENTSELECT) g_pfnWSAEventSelect;
|
---|
187 | extern DECLHIDDEN(PFNWSAENUMNETWORKEVENTS) g_pfnWSAEnumNetworkEvents;
|
---|
188 | extern DECLHIDDEN(PFNWSASend) g_pfnWSASend;
|
---|
189 | extern DECLHIDDEN(PFNWINSOCKSOCKET) g_pfnsocket;
|
---|
190 | extern DECLHIDDEN(PFNWINSOCKCLOSESOCKET) g_pfnclosesocket;
|
---|
191 | extern DECLHIDDEN(PFNWINSOCKRECV) g_pfnrecv;
|
---|
192 | extern DECLHIDDEN(PFNWINSOCKSEND) g_pfnsend;
|
---|
193 | extern DECLHIDDEN(PFNWINSOCKRECVFROM) g_pfnrecvfrom;
|
---|
194 | extern DECLHIDDEN(PFNWINSOCKSENDTO) g_pfnsendto;
|
---|
195 | extern DECLHIDDEN(PFNWINSOCKBIND) g_pfnbind;
|
---|
196 | extern DECLHIDDEN(PFNWINSOCKLISTEN) g_pfnlisten;
|
---|
197 | extern DECLHIDDEN(PFNWINSOCKACCEPT) g_pfnaccept;
|
---|
198 | extern DECLHIDDEN(PFNWINSOCKCONNECT) g_pfnconnect;
|
---|
199 | extern DECLHIDDEN(PFNWINSOCKSHUTDOWN) g_pfnshutdown;
|
---|
200 | extern DECLHIDDEN(PFNWINSOCKGETSOCKOPT) g_pfngetsockopt;
|
---|
201 | extern DECLHIDDEN(PFNWINSOCKSETSOCKOPT) g_pfnsetsockopt;
|
---|
202 | extern DECLHIDDEN(PFNWINSOCKIOCTLSOCKET) g_pfnioctlsocket;
|
---|
203 | extern DECLHIDDEN(PFNWINSOCKGETPEERNAME) g_pfngetpeername;
|
---|
204 | extern DECLHIDDEN(PFNWINSOCKGETSOCKNAME) g_pfngetsockname;
|
---|
205 | extern DECLHIDDEN(PFNWINSOCK__WSAFDISSET) g_pfn__WSAFDIsSet;
|
---|
206 | extern DECLHIDDEN(PFNWINSOCKSELECT) g_pfnselect;
|
---|
207 | extern DECLHIDDEN(PFNWINSOCKGETHOSTBYNAME) g_pfngethostbyname;
|
---|
208 | #endif
|
---|
209 |
|
---|
210 |
|
---|
211 | #endif /* !IPRT_INCLUDED_SRC_r3_win_internal_r3_win_h */
|
---|
212 |
|
---|