VirtualBox

source: vbox/trunk/src/VBox/Runtime/r3/win/internal-r3-win.h@ 95765

Last change on this file since 95765 was 93115, checked in by vboxsync, 3 years ago

scm --update-copyright-year

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 10.4 KB
Line 
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 */
47typedef 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 */
88typedef 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*********************************************************************************************************************************/
101extern DECL_HIDDEN_DATA(RTR3WINLDRPROT) g_enmWinLdrProt;
102extern DECL_HIDDEN_DATA(RTWINOSTYPE) g_enmWinVer;
103#ifdef _WINDEF_
104extern DECL_HIDDEN_DATA(OSVERSIONINFOEXW) g_WinOsInfoEx;
105
106extern DECL_HIDDEN_DATA(HMODULE) g_hModKernel32;
107typedef UINT (WINAPI *PFNGETWINSYSDIR)(LPWSTR,UINT);
108extern DECL_HIDDEN_DATA(PFNGETWINSYSDIR) g_pfnGetSystemWindowsDirectoryW;
109extern DECL_HIDDEN_DATA(decltype(SystemTimeToTzSpecificLocalTime) *) g_pfnSystemTimeToTzSpecificLocalTime;
110typedef HANDLE (WINAPI *PFNCREATEWAITABLETIMEREX)(LPSECURITY_ATTRIBUTES, LPCWSTR, DWORD, DWORD);
111extern DECL_HIDDEN_DATA(PFNCREATEWAITABLETIMEREX) g_pfnCreateWaitableTimerExW;
112
113extern DECL_HIDDEN_DATA(HMODULE) g_hModNtDll;
114typedef NTSTATUS (NTAPI *PFNNTQUERYFULLATTRIBUTESFILE)(struct _OBJECT_ATTRIBUTES *, struct _FILE_NETWORK_OPEN_INFORMATION *);
115extern DECL_HIDDEN_DATA(PFNNTQUERYFULLATTRIBUTESFILE) g_pfnNtQueryFullAttributesFile;
116typedef NTSTATUS (NTAPI *PFNNTDUPLICATETOKEN)(HANDLE, ACCESS_MASK, struct _OBJECT_ATTRIBUTES *, BOOLEAN, TOKEN_TYPE, PHANDLE);
117extern DECL_HIDDEN_DATA(PFNNTDUPLICATETOKEN) g_pfnNtDuplicateToken;
118#ifdef IPRT_INCLUDED_nt_nt_h
119extern DECL_HIDDEN_DATA(decltype(NtAlertThread) *) g_pfnNtAlertThread;
120#endif
121
122extern DECL_HIDDEN_DATA(HMODULE) g_hModWinSock;
123
124/** WSAStartup */
125typedef int (WINAPI *PFNWSASTARTUP)(WORD, struct WSAData *);
126/** WSACleanup */
127typedef int (WINAPI *PFNWSACLEANUP)(void);
128/** WSAGetLastError */
129typedef int (WINAPI *PFNWSAGETLASTERROR)(void);
130/** WSASetLastError */
131typedef int (WINAPI *PFNWSASETLASTERROR)(int);
132/** WSACreateEvent */
133typedef HANDLE (WINAPI *PFNWSACREATEEVENT)(void);
134/** WSASetEvent */
135typedef BOOL (WINAPI *PFNWSASETEVENT)(HANDLE);
136/** WSACloseEvent */
137typedef BOOL (WINAPI *PFNWSACLOSEEVENT)(HANDLE);
138/** WSAEventSelect */
139typedef BOOL (WINAPI *PFNWSAEVENTSELECT)(UINT_PTR, HANDLE, LONG);
140/** WSAEnumNetworkEvents */
141typedef int (WINAPI *PFNWSAENUMNETWORKEVENTS)(UINT_PTR, HANDLE, struct _WSANETWORKEVENTS *);
142/** WSASend */
143typedef int (WINAPI *PFNWSASend)(UINT_PTR, struct _WSABUF *, DWORD, LPDWORD, DWORD dwFlags, struct _OVERLAPPED *, uintptr_t /*LPWSAOVERLAPPED_COMPLETION_ROUTINE*/);
144
145/** socket */
146typedef UINT_PTR (WINAPI *PFNWINSOCKSOCKET)(int, int, int);
147/** closesocket */
148typedef int (WINAPI *PFNWINSOCKCLOSESOCKET)(UINT_PTR);
149/** recv */
150typedef int (WINAPI *PFNWINSOCKRECV)(UINT_PTR, char *, int, int);
151/** send */
152typedef int (WINAPI *PFNWINSOCKSEND)(UINT_PTR, const char *, int, int);
153/** recvfrom */
154typedef int (WINAPI *PFNWINSOCKRECVFROM)(UINT_PTR, char *, int, int, struct sockaddr *, int *);
155/** sendto */
156typedef int (WINAPI *PFNWINSOCKSENDTO)(UINT_PTR, const char *, int, int, const struct sockaddr *, int);
157/** bind */
158typedef int (WINAPI *PFNWINSOCKBIND)(UINT_PTR, const struct sockaddr *, int);
159/** listen */
160typedef int (WINAPI *PFNWINSOCKLISTEN)(UINT_PTR, int);
161/** accept */
162typedef UINT_PTR (WINAPI *PFNWINSOCKACCEPT)(UINT_PTR, struct sockaddr *, int *);
163/** connect */
164typedef int (WINAPI *PFNWINSOCKCONNECT)(UINT_PTR, const struct sockaddr *, int);
165/** shutdown */
166typedef int (WINAPI *PFNWINSOCKSHUTDOWN)(UINT_PTR, int);
167/** getsockopt */
168typedef int (WINAPI *PFNWINSOCKGETSOCKOPT)(UINT_PTR, int, int, char *, int *);
169/** setsockopt */
170typedef int (WINAPI *PFNWINSOCKSETSOCKOPT)(UINT_PTR, int, int, const char *, int);
171/** ioctlsocket */
172typedef int (WINAPI *PFNWINSOCKIOCTLSOCKET)(UINT_PTR, long, unsigned long *);
173/** getpeername */
174typedef int (WINAPI *PFNWINSOCKGETPEERNAME)(UINT_PTR, struct sockaddr *, int *);
175/** getsockname */
176typedef int (WINAPI *PFNWINSOCKGETSOCKNAME)(UINT_PTR, struct sockaddr *, int *);
177/** __WSAFDIsSet */
178typedef int (WINAPI *PFNWINSOCK__WSAFDISSET)(UINT_PTR, struct fd_set *);
179/** select */
180typedef int (WINAPI *PFNWINSOCKSELECT)(int, struct fd_set *, struct fd_set *, struct fd_set *, const struct timeval *);
181/** gethostbyname */
182typedef struct hostent *(WINAPI *PFNWINSOCKGETHOSTBYNAME)(const char *);
183
184extern DECL_HIDDEN_DATA(PFNWSASTARTUP) g_pfnWSAStartup;
185extern DECL_HIDDEN_DATA(PFNWSACLEANUP) g_pfnWSACleanup;
186extern DECL_HIDDEN_DATA(PFNWSAGETLASTERROR) g_pfnWSAGetLastError;
187extern DECL_HIDDEN_DATA(PFNWSASETLASTERROR) g_pfnWSASetLastError;
188extern DECL_HIDDEN_DATA(PFNWSACREATEEVENT) g_pfnWSACreateEvent;
189extern DECL_HIDDEN_DATA(PFNWSACLOSEEVENT) g_pfnWSACloseEvent;
190extern DECL_HIDDEN_DATA(PFNWSASETEVENT) g_pfnWSASetEvent;
191extern DECL_HIDDEN_DATA(PFNWSAEVENTSELECT) g_pfnWSAEventSelect;
192extern DECL_HIDDEN_DATA(PFNWSAENUMNETWORKEVENTS) g_pfnWSAEnumNetworkEvents;
193extern DECL_HIDDEN_DATA(PFNWSASend) g_pfnWSASend;
194extern DECL_HIDDEN_DATA(PFNWINSOCKSOCKET) g_pfnsocket;
195extern DECL_HIDDEN_DATA(PFNWINSOCKCLOSESOCKET) g_pfnclosesocket;
196extern DECL_HIDDEN_DATA(PFNWINSOCKRECV) g_pfnrecv;
197extern DECL_HIDDEN_DATA(PFNWINSOCKSEND) g_pfnsend;
198extern DECL_HIDDEN_DATA(PFNWINSOCKRECVFROM) g_pfnrecvfrom;
199extern DECL_HIDDEN_DATA(PFNWINSOCKSENDTO) g_pfnsendto;
200extern DECL_HIDDEN_DATA(PFNWINSOCKBIND) g_pfnbind;
201extern DECL_HIDDEN_DATA(PFNWINSOCKLISTEN) g_pfnlisten;
202extern DECL_HIDDEN_DATA(PFNWINSOCKACCEPT) g_pfnaccept;
203extern DECL_HIDDEN_DATA(PFNWINSOCKCONNECT) g_pfnconnect;
204extern DECL_HIDDEN_DATA(PFNWINSOCKSHUTDOWN) g_pfnshutdown;
205extern DECL_HIDDEN_DATA(PFNWINSOCKGETSOCKOPT) g_pfngetsockopt;
206extern DECL_HIDDEN_DATA(PFNWINSOCKSETSOCKOPT) g_pfnsetsockopt;
207extern DECL_HIDDEN_DATA(PFNWINSOCKIOCTLSOCKET) g_pfnioctlsocket;
208extern DECL_HIDDEN_DATA(PFNWINSOCKGETPEERNAME) g_pfngetpeername;
209extern DECL_HIDDEN_DATA(PFNWINSOCKGETSOCKNAME) g_pfngetsockname;
210extern DECL_HIDDEN_DATA(PFNWINSOCK__WSAFDISSET) g_pfn__WSAFDIsSet;
211extern DECL_HIDDEN_DATA(PFNWINSOCKSELECT) g_pfnselect;
212extern DECL_HIDDEN_DATA(PFNWINSOCKGETHOSTBYNAME) g_pfngethostbyname;
213#endif
214
215
216#endif /* !IPRT_INCLUDED_SRC_r3_win_internal_r3_win_h */
217
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette