VirtualBox

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

最後變更 在這個檔案從71949是 71150,由 vboxsync 提交於 7 年 前

IPRT: Added a RTThreadPoke implementation for windows that uses NtAlertThread.

  • 屬性 svn:eol-style 設為 native
  • 屬性 svn:keywords 設為 Author Date Id Revision
檔案大小: 9.3 KB
 
1/* $Id: internal-r3-win.h 71150 2018-02-28 10:44:38Z 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.alldomusa.eu.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/** WSACloseEvent */
128typedef BOOL (WINAPI *PFNWSACLOSEEVENT)(HANDLE);
129/** WSAEventSelect */
130typedef BOOL (WINAPI *PFNWSAEVENTSELECT)(UINT_PTR, HANDLE, LONG);
131/** WSAEnumNetworkEvents */
132typedef int (WINAPI *PFNWSAENUMNETWORKEVENTS)(UINT_PTR, HANDLE, struct _WSANETWORKEVENTS *);
133/** WSASend */
134typedef int (WINAPI *PFNWSASend)(UINT_PTR, struct _WSABUF *, DWORD, LPDWORD, DWORD dwFlags, struct _OVERLAPPED *, PFNRT /*LPWSAOVERLAPPED_COMPLETION_ROUTINE*/);
135
136/** socket */
137typedef UINT_PTR (WINAPI *PFNWINSOCKSOCKET)(int, int, int);
138/** closesocket */
139typedef int (WINAPI *PFNWINSOCKCLOSESOCKET)(UINT_PTR);
140/** recv */
141typedef int (WINAPI *PFNWINSOCKRECV)(UINT_PTR, char *, int, int);
142/** send */
143typedef int (WINAPI *PFNWINSOCKSEND)(UINT_PTR, const char *, int, int);
144/** recvfrom */
145typedef int (WINAPI *PFNWINSOCKRECVFROM)(UINT_PTR, char *, int, int, struct sockaddr *, int *);
146/** sendto */
147typedef int (WINAPI *PFNWINSOCKSENDTO)(UINT_PTR, const char *, int, int, const struct sockaddr *, int);
148/** bind */
149typedef int (WINAPI *PFNWINSOCKBIND)(UINT_PTR, const struct sockaddr *, int);
150/** listen */
151typedef int (WINAPI *PFNWINSOCKLISTEN)(UINT_PTR, int);
152/** accept */
153typedef UINT_PTR (WINAPI *PFNWINSOCKACCEPT)(UINT_PTR, struct sockaddr *, int *);
154/** connect */
155typedef int (WINAPI *PFNWINSOCKCONNECT)(UINT_PTR, const struct sockaddr *, int);
156/** shutdown */
157typedef int (WINAPI *PFNWINSOCKSHUTDOWN)(UINT_PTR, int);
158/** getsockopt */
159typedef int (WINAPI *PFNWINSOCKGETSOCKOPT)(UINT_PTR, int, int, char *, int *);
160/** setsockopt */
161typedef int (WINAPI *PFNWINSOCKSETSOCKOPT)(UINT_PTR, int, int, const char *, int);
162/** ioctlsocket */
163typedef int (WINAPI *PFNWINSOCKIOCTLSOCKET)(UINT_PTR, long, unsigned long *);
164/** getpeername */
165typedef int (WINAPI *PFNWINSOCKGETPEERNAME)(UINT_PTR, struct sockaddr *, int *);
166/** getsockname */
167typedef int (WINAPI *PFNWINSOCKGETSOCKNAME)(UINT_PTR, struct sockaddr *, int *);
168/** __WSAFDIsSet */
169typedef int (WINAPI *PFNWINSOCK__WSAFDISSET)(UINT_PTR, struct fd_set *);
170/** select */
171typedef int (WINAPI *PFNWINSOCKSELECT)(int, struct fd_set *, struct fd_set *, struct fd_set *, const struct timeval *);
172/** gethostbyname */
173typedef struct hostent *(WINAPI *PFNWINSOCKGETHOSTBYNAME)(const char *);
174
175extern DECLHIDDEN(PFNWSASTARTUP) g_pfnWSAStartup;
176extern DECLHIDDEN(PFNWSACLEANUP) g_pfnWSACleanup;
177extern PFNWSAGETLASTERROR g_pfnWSAGetLastError;
178extern PFNWSASETLASTERROR g_pfnWSASetLastError;
179extern DECLHIDDEN(PFNWSACREATEEVENT) g_pfnWSACreateEvent;
180extern DECLHIDDEN(PFNWSACLOSEEVENT) g_pfnWSACloseEvent;
181extern DECLHIDDEN(PFNWSAEVENTSELECT) g_pfnWSAEventSelect;
182extern DECLHIDDEN(PFNWSAENUMNETWORKEVENTS) g_pfnWSAEnumNetworkEvents;
183extern DECLHIDDEN(PFNWSASend) g_pfnWSASend;
184extern DECLHIDDEN(PFNWINSOCKSOCKET) g_pfnsocket;
185extern DECLHIDDEN(PFNWINSOCKCLOSESOCKET) g_pfnclosesocket;
186extern DECLHIDDEN(PFNWINSOCKRECV) g_pfnrecv;
187extern DECLHIDDEN(PFNWINSOCKSEND) g_pfnsend;
188extern DECLHIDDEN(PFNWINSOCKRECVFROM) g_pfnrecvfrom;
189extern DECLHIDDEN(PFNWINSOCKSENDTO) g_pfnsendto;
190extern DECLHIDDEN(PFNWINSOCKBIND) g_pfnbind;
191extern DECLHIDDEN(PFNWINSOCKLISTEN) g_pfnlisten;
192extern DECLHIDDEN(PFNWINSOCKACCEPT) g_pfnaccept;
193extern DECLHIDDEN(PFNWINSOCKCONNECT) g_pfnconnect;
194extern DECLHIDDEN(PFNWINSOCKSHUTDOWN) g_pfnshutdown;
195extern DECLHIDDEN(PFNWINSOCKGETSOCKOPT) g_pfngetsockopt;
196extern DECLHIDDEN(PFNWINSOCKSETSOCKOPT) g_pfnsetsockopt;
197extern DECLHIDDEN(PFNWINSOCKIOCTLSOCKET) g_pfnioctlsocket;
198extern DECLHIDDEN(PFNWINSOCKGETPEERNAME) g_pfngetpeername;
199extern DECLHIDDEN(PFNWINSOCKGETSOCKNAME) g_pfngetsockname;
200extern DECLHIDDEN(PFNWINSOCK__WSAFDISSET) g_pfn__WSAFDIsSet;
201extern DECLHIDDEN(PFNWINSOCKSELECT) g_pfnselect;
202extern DECLHIDDEN(PFNWINSOCKGETHOSTBYNAME) g_pfngethostbyname;
203#endif
204
205
206#endif
207
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

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