ReactOS 0.4.16-dev-197-g92996da
imports.h
Go to the documentation of this file.
1/*
2 imports.h
3
4 Virtual Floppy Drive for Windows NT platform
5 Kernel mode driver: imported elements from various sources
6
7 Copyright (C) 2003-2005 Ken Kato
8
9 This file contains:
10
11 a) #include directive for system headers
12
13 b) Stuff imported from newer DDKs so that the driver built with older
14 DDKs can run on newer Windows.
15
16 c) Stuff imported from ntifs.h (http://www.acc.umu.se/~bosse/) so that
17 the driver can be compiled without it.
18
19 d) Prototypes of standard functions which are exported from ntoskrnl.exe
20 but not declared in regular DDK header files.
21*/
22
23#ifndef _IMPORTS_H_
24#define _IMPORTS_H_
25
26#ifdef __cplusplus
27extern "C" {
28#endif // __cplusplus
29
30#if !defined(__REACTOS__) || defined(_MSC_VER)
31#pragma warning(push,3)
32#endif
33#include <ntddk.h>
34#include <ntdddisk.h>
35#include <ntverp.h>
36#if !defined(__REACTOS__) || defined(_MSC_VER)
37#pragma warning(pop)
38
39// disable unwanted (and trivial) warnings :
40// 4054 - type cast from a function pointer to a data pointer
41// 4201 - anonymous structure
42// 4514 - unreferenced inline function
43#pragma warning(disable: 4054 4201 4514)
44#endif
45
46#if (VER_PRODUCTBUILD >= 2195)
47#include <mountdev.h>
48#else // (VER_PRODUCTBUILD < 2195)
49//
50// Imports from Windows 2000 DDK <ntddk.h>
51//
52typedef enum _MM_PAGE_PRIORITY {
57
58#define FILE_ATTRIBUTE_ENCRYPTED 0x00004000
59
60#define FILE_DEVICE_MASS_STORAGE 0x0000002d
61
62//
63// Imports from Windows 2000 DDK <ntddstor.h>
64//
65#define IOCTL_STORAGE_CHECK_VERIFY2 CTL_CODE( \
66 IOCTL_STORAGE_BASE, \
67 0x0200, \
68 METHOD_BUFFERED, \
69 FILE_ANY_ACCESS)
70
71//
72// Imports from Windows 2000 DDK <mountmgr.h>, <mountdev.h>
73//
74#define MOUNTMGR_DEVICE_NAME L"\\Device\\MountPointManager"
75#define MOUNTMGRCONTROLTYPE ((ULONG) 'm')
76#define MOUNTDEVCONTROLTYPE ((ULONG) 'M')
77
78#define IOCTL_MOUNTDEV_QUERY_UNIQUE_ID CTL_CODE( \
79 MOUNTDEVCONTROLTYPE,\
80 0, \
81 METHOD_BUFFERED, \
82 FILE_ANY_ACCESS)
83
84#define IOCTL_MOUNTDEV_UNIQUE_ID_CHANGE_NOTIFY \
85 CTL_CODE( \
86 MOUNTDEVCONTROLTYPE,\
87 1, \
88 METHOD_BUFFERED, \
89 FILE_ANY_ACCESS)
90
91#define IOCTL_MOUNTDEV_QUERY_DEVICE_NAME CTL_CODE( \
92 MOUNTDEVCONTROLTYPE,\
93 2, \
94 METHOD_BUFFERED, \
95 FILE_ANY_ACCESS)
96
97#define IOCTL_MOUNTDEV_QUERY_SUGGESTED_LINK_NAME \
98 CTL_CODE( \
99 MOUNTDEVCONTROLTYPE,\
100 3, \
101 METHOD_BUFFERED, \
102 FILE_ANY_ACCESS)
103
104#define IOCTL_MOUNTDEV_LINK_CREATED CTL_CODE( \
105 MOUNTDEVCONTROLTYPE,\
106 4, \
107 METHOD_BUFFERED, \
108 FILE_ANY_ACCESS)
109
110#define IOCTL_MOUNTDEV_LINK_DELETED CTL_CODE( \
111 MOUNTDEVCONTROLTYPE,\
112 5, \
113 METHOD_BUFFERED, \
114 FILE_ANY_ACCESS)
115
116#define IOCTL_MOUNTMGR_CREATE_POINT CTL_CODE( \
117 MOUNTMGRCONTROLTYPE,\
118 0, \
119 METHOD_BUFFERED, \
120 FILE_READ_ACCESS | FILE_WRITE_ACCESS)
121
122#define IOCTL_MOUNTMGR_DELETE_POINTS CTL_CODE( \
123 MOUNTMGRCONTROLTYPE,\
124 1, \
125 METHOD_BUFFERED, \
126 FILE_READ_ACCESS | FILE_WRITE_ACCESS)
127
128#define IOCTL_MOUNTMGR_VOLUME_ARRIVAL_NOTIFICATION \
129 CTL_CODE( \
130 MOUNTMGRCONTROLTYPE,\
131 11, \
132 METHOD_BUFFERED, \
133 FILE_READ_ACCESS)
134
135typedef struct _MOUNTDEV_UNIQUE_ID {
139
140typedef struct _MOUNTDEV_NAME {
144
150
151typedef struct _MOUNTMGR_TARGET_NAME {
155
162
163typedef struct _MOUNTMGR_MOUNT_POINT {
171
177
178#endif // (VER_PRODUCTBUILD < 2195)
179
180// __REACTOS__: NTAPI added on some functions in this file, vfddrv.h and some *.c.
181
182#if (VER_PRODUCTBUILD < 2600)
183//
184// Imports from Windows XP DDK <ntdddisk.h>
185//
186#define IOCTL_DISK_GET_PARTITION_INFO_EX CTL_CODE( \
187 IOCTL_DISK_BASE, \
188 0x0012, \
189 METHOD_BUFFERED, \
190 FILE_ANY_ACCESS)
191
192#define IOCTL_DISK_GET_LENGTH_INFO CTL_CODE( \
193 IOCTL_DISK_BASE, \
194 0x0017, \
195 METHOD_BUFFERED, \
196 FILE_READ_ACCESS)
197
198typedef unsigned __int64 ULONG64, *PULONG64;
199
200typedef enum _PARTITION_STYLE {
204
211
218
225 union {
228 };
230
234
235//
236// Imports from Windows XP DDK <ntddstor.h>
237//
238#define IOCTL_STORAGE_GET_HOTPLUG_INFO CTL_CODE( \
239 IOCTL_STORAGE_BASE, \
240 0x0305, \
241 METHOD_BUFFERED, \
242 FILE_ANY_ACCESS)
243
244typedef struct _STORAGE_HOTPLUG_INFO {
251
252//
253// Imports from Windows XP DDK <mountdev.h>
254//
255#define IOCTL_MOUNTDEV_QUERY_STABLE_GUID CTL_CODE( \
256 MOUNTDEVCONTROLTYPE,\
257 6, \
258 METHOD_BUFFERED, \
259 FILE_ANY_ACCESS)
260
261typedef struct _MOUNTDEV_STABLE_GUID {
264
265#endif // (VER_PRODUCTBUILD < 2600)
266
267//
268// Imports from ntifs.h
269//
270#define TOKEN_SOURCE_LENGTH 8
271
272typedef enum _TOKEN_TYPE {
276
277typedef struct _TOKEN_SOURCE {
281
282typedef struct _TOKEN_CONTROL {
288
297
298#define PsDereferenceImpersonationToken(T) \
299 if (ARGUMENT_PRESENT(T)) (ObDereferenceObject((T)))
300
301#define PsDereferencePrimaryToken(T) (ObDereferenceObject((T)))
302
304VOID
305NTAPI
307 VOID
308);
309
312NTAPI
315 IN PSECURITY_QUALITY_OF_SERVICE QualityOfService,
316 IN BOOLEAN RemoteClient,
318);
319
320#define SeDeleteClientSecurity(C) \
321{ \
322 if (SeTokenType((C)->ClientToken) == TokenPrimary) { \
323 PsDereferencePrimaryToken((C)->ClientToken); \
324 } \
325 else { \
326 PsDereferenceImpersonationToken((C)->ClientToken); \
327 } \
328}
329
331VOID
332NTAPI
336);
337
340NTAPI
343);
344
345//
346// Functions exported by ntoskrnl.exe, but not declared in DDK headers
347//
348int _snprintf(char *buffer, size_t count, const char *format, ...);
349int _snwprintf(wchar_t *buffer, size_t count, const wchar_t *format, ...);
350int sprintf(char *buffer, const char *format, ...);
351int _swprintf(wchar_t *buffer, const wchar_t *format, ...);
352
353#ifdef __cplusplus
354}
355#endif // __cplusplus
356
357#endif // _IMPORTS_H_
UINT CALLBACK ServerThread(_Inout_ PVOID Parameter)
unsigned char BOOLEAN
TOKEN_TYPE
Definition: asmpp.cpp:29
LONG NTSTATUS
Definition: precomp.h:26
#define __int64
Definition: basetyps.h:16
_In_opt_ PFILE_OBJECT _In_opt_ PETHREAD Thread
Definition: fltkernel.h:2653
GLuint GLuint GLsizei count
Definition: gl.h:1545
GLuint buffer
Definition: glext.h:5915
struct _PARTITION_INFORMATION_MBR * PPARTITION_INFORMATION_MBR
struct _MOUNTDEV_NAME MOUNTDEV_NAME
struct _GET_LENGTH_INFORMATION * PGET_LENGTH_INFORMATION
struct _MOUNTMGR_MOUNT_POINT * PMOUNTMGR_MOUNT_POINT
struct _SECURITY_CLIENT_CONTEXT SECURITY_CLIENT_CONTEXT
struct _TOKEN_SOURCE * PTOKEN_SOURCE
struct _MOUNTDEV_UNIQUE_ID MOUNTDEV_UNIQUE_ID
struct _STORAGE_HOTPLUG_INFO STORAGE_HOTPLUG_INFO
_TOKEN_TYPE
Definition: imports.h:272
@ TokenImpersonation
Definition: imports.h:274
@ TokenPrimary
Definition: imports.h:273
struct _TOKEN_CONTROL TOKEN_CONTROL
struct _GET_LENGTH_INFORMATION GET_LENGTH_INFORMATION
struct _TOKEN_SOURCE TOKEN_SOURCE
NTKERNELAPI TOKEN_TYPE NTAPI SeTokenType(IN PACCESS_TOKEN Token)
struct _MOUNTMGR_MOUNT_POINTS * PMOUNTMGR_MOUNT_POINTS
NTKERNELAPI VOID NTAPI PsRevertToSelf(VOID)
Definition: security.c:556
struct _MOUNTDEV_STABLE_GUID * PMOUNTDEV_STABLE_GUID
struct _PARTITION_INFORMATION_EX PARTITION_INFORMATION_EX
struct _MOUNTMGR_CREATE_POINT_INPUT MOUNTMGR_CREATE_POINT_INPUT
struct _SECURITY_CLIENT_CONTEXT * PSECURITY_CLIENT_CONTEXT
unsigned __int64 * PULONG64
Definition: imports.h:198
struct _TOKEN_CONTROL * PTOKEN_CONTROL
struct _MOUNTDEV_NAME * PMOUNTDEV_NAME
NTKERNELAPI VOID NTAPI SeImpersonateClient(IN PSECURITY_CLIENT_CONTEXT ClientContext, IN PETHREAD ServerThread OPTIONAL)
int _swprintf(wchar_t *buffer, const wchar_t *format,...)
NTKERNELAPI NTSTATUS NTAPI SeCreateClientSecurity(IN PETHREAD Thread, IN PSECURITY_QUALITY_OF_SERVICE QualityOfService, IN BOOLEAN RemoteClient, OUT PSECURITY_CLIENT_CONTEXT ClientContext)
enum _PARTITION_STYLE PARTITION_STYLE
int _snwprintf(wchar_t *buffer, size_t count, const wchar_t *format,...)
struct _MOUNTMGR_TARGET_NAME * PMOUNTMGR_TARGET_NAME
struct _PARTITION_INFORMATION_EX * PPARTITION_INFORMATION_EX
unsigned __int64 ULONG64
Definition: imports.h:198
struct _MOUNTMGR_TARGET_NAME MOUNTMGR_TARGET_NAME
_MM_PAGE_PRIORITY
Definition: imports.h:52
@ NormalPagePriority
Definition: imports.h:54
@ LowPagePriority
Definition: imports.h:53
@ HighPagePriority
Definition: imports.h:55
struct _MOUNTMGR_MOUNT_POINT MOUNTMGR_MOUNT_POINT
struct _PARTITION_INFORMATION_MBR PARTITION_INFORMATION_MBR
struct _STORAGE_HOTPLUG_INFO * PSTORAGE_HOTPLUG_INFO
struct _MOUNTMGR_MOUNT_POINTS MOUNTMGR_MOUNT_POINTS
struct _MOUNTMGR_CREATE_POINT_INPUT * PMOUNTMGR_CREATE_POINT_INPUT
struct _MOUNTDEV_SUGGESTED_LINK_NAME * PMOUNTDEV_SUGGESTED_LINK_NAME
enum _MM_PAGE_PRIORITY MM_PAGE_PRIORITY
_PARTITION_STYLE
Definition: imports.h:200
@ PARTITION_STYLE_GPT
Definition: imports.h:202
@ PARTITION_STYLE_MBR
Definition: imports.h:201
struct _PARTITION_INFORMATION_GPT * PPARTITION_INFORMATION_GPT
struct _PARTITION_INFORMATION_GPT PARTITION_INFORMATION_GPT
struct _MOUNTDEV_SUGGESTED_LINK_NAME MOUNTDEV_SUGGESTED_LINK_NAME
struct _MOUNTDEV_UNIQUE_ID * PMOUNTDEV_UNIQUE_ID
struct _MOUNTDEV_STABLE_GUID MOUNTDEV_STABLE_GUID
enum _TOKEN_TYPE TOKEN_TYPE
#define sprintf(buf, format,...)
Definition: sprintf.c:55
_In_ PVOID ClientContext
Definition: netioddk.h:55
unsigned short USHORT
Definition: pedump.c:61
PULONG MinorVersion OPTIONAL
Definition: CrossNt.h:68
LARGE_INTEGER Length
Definition: imports.h:232
USHORT NameLength
Definition: imports.h:141
USHORT UniqueIdLength
Definition: imports.h:136
UCHAR UniqueId[1]
Definition: imports.h:137
MOUNTMGR_MOUNT_POINT MountPoints[1]
Definition: imports.h:175
USHORT DeviceNameLength
Definition: imports.h:169
USHORT SymbolicLinkNameLength
Definition: imports.h:165
ULONG SymbolicLinkNameOffset
Definition: imports.h:164
USHORT DeviceNameLength
Definition: imports.h:152
LARGE_INTEGER StartingOffset
Definition: imports.h:221
PARTITION_STYLE PartitionStyle
Definition: imports.h:220
PARTITION_INFORMATION_MBR Mbr
Definition: imports.h:226
PARTITION_INFORMATION_GPT Gpt
Definition: imports.h:227
LARGE_INTEGER PartitionLength
Definition: imports.h:222
TOKEN_CONTROL ClientTokenControl
Definition: imports.h:295
PACCESS_TOKEN ClientToken
Definition: imports.h:291
SECURITY_QUALITY_OF_SERVICE SecurityQos
Definition: imports.h:290
BOOLEAN DirectlyAccessClientToken
Definition: imports.h:292
BOOLEAN DirectAccessEffectiveOnly
Definition: imports.h:293
BOOLEAN WriteCacheEnableOverride
Definition: imports.h:249
BOOLEAN MediaRemovable
Definition: imports.h:246
BOOLEAN DeviceHotplug
Definition: imports.h:248
BOOLEAN MediaHotplug
Definition: imports.h:247
LUID TokenId
Definition: imports.h:283
LUID AuthenticationId
Definition: imports.h:284
LUID ModifiedId
Definition: imports.h:285
TOKEN_SOURCE TokenSource
Definition: imports.h:286
CCHAR SourceName[TOKEN_SOURCE_LENGTH]
Definition: imports.h:278
LUID SourceIdentifier
Definition: imports.h:279
Definition: format.c:58
#define NTAPI
Definition: typedefs.h:36
#define IN
Definition: typedefs.h:39
uint32_t ULONG
Definition: typedefs.h:59
#define OUT
Definition: typedefs.h:40
char CCHAR
Definition: typedefs.h:51
_Must_inspect_result_ _In_ PWDFDEVICE_INIT _In_opt_ PCUNICODE_STRING DeviceName
Definition: wdfdevice.h:3275
#define NTKERNELAPI
#define TOKEN_SOURCE_LENGTH
Definition: setypes.h:1077
unsigned char UCHAR
Definition: xmlstorage.h:181
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define _snprintf
Definition: xmlstorage.h:200