VirtualBox

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

Last change on this file since 73097 was 71950, checked in by vboxsync, 7 years ago

socket.cpp: Windows polling fixes for problem where we got stuck returning RTPOLL_EVT_READ.

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