VirtualBox

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

Last change on this file since 76678 was 76585, checked in by vboxsync, 6 years ago

*: scm --fix-header-guard-endif

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