ReactOS 0.4.15-dev-7897-g78dc504
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#ifdef _MSC_VER
31#pragma warning(push,3)
32#endif
33#include <ntddk.h>
34#include <ntdddisk.h>
35#include <ntverp.h>
36#ifdef _MSC_VER
37#pragma warning(pop)
38#endif
39
40#ifdef _MSC_VER
41// disable unwanted (and trivial) warnings :
42// 4054 - type cast from a function pointer to a data pointer
43// 4201 - anonymous structure
44// 4514 - unreferenced inline function
45#pragma warning(disable: 4054 4201 4514)
46#endif
47
48#if (VER_PRODUCTBUILD >= 2195)
49#include <mountdev.h>
50#else // (VER_PRODUCTBUILD < 2195)
51//
52// Imports from Windows 2000 DDK <ntddk.h>
53//
54typedef enum _MM_PAGE_PRIORITY {
59
60#define FILE_ATTRIBUTE_ENCRYPTED 0x00004000
61
62#define FILE_DEVICE_MASS_STORAGE 0x0000002d
63
64//
65// Imports from Windows 2000 DDK <ntddstor.h>
66//
67#define IOCTL_STORAGE_CHECK_VERIFY2 CTL_CODE( \
68 IOCTL_STORAGE_BASE, \
69 0x0200, \
70 METHOD_BUFFERED, \
71 FILE_ANY_ACCESS)
72
73//
74// Imports from Windows 2000 DDK <mountmgr.h>, <mountdev.h>
75//
76#define MOUNTMGR_DEVICE_NAME L"\\Device\\MountPointManager"
77#define MOUNTMGRCONTROLTYPE ((ULONG) 'm')
78#define MOUNTDEVCONTROLTYPE ((ULONG) 'M')
79
80#define IOCTL_MOUNTDEV_QUERY_UNIQUE_ID CTL_CODE( \
81 MOUNTDEVCONTROLTYPE,\
82 0, \
83 METHOD_BUFFERED, \
84 FILE_ANY_ACCESS)
85
86#define IOCTL_MOUNTDEV_UNIQUE_ID_CHANGE_NOTIFY \
87 CTL_CODE( \
88 MOUNTDEVCONTROLTYPE,\
89 1, \
90 METHOD_BUFFERED, \
91 FILE_ANY_ACCESS)
92
93#define IOCTL_MOUNTDEV_QUERY_DEVICE_NAME CTL_CODE( \
94 MOUNTDEVCONTROLTYPE,\
95 2, \
96 METHOD_BUFFERED, \
97 FILE_ANY_ACCESS)
98
99#define IOCTL_MOUNTDEV_QUERY_SUGGESTED_LINK_NAME \
100 CTL_CODE( \
101 MOUNTDEVCONTROLTYPE,\
102 3, \
103 METHOD_BUFFERED, \
104 FILE_ANY_ACCESS)
105
106#define IOCTL_MOUNTDEV_LINK_CREATED CTL_CODE( \
107 MOUNTDEVCONTROLTYPE,\
108 4, \
109 METHOD_BUFFERED, \
110 FILE_ANY_ACCESS)
111
112#define IOCTL_MOUNTDEV_LINK_DELETED CTL_CODE( \
113 MOUNTDEVCONTROLTYPE,\
114 5, \
115 METHOD_BUFFERED, \
116 FILE_ANY_ACCESS)
117
118#define IOCTL_MOUNTMGR_CREATE_POINT CTL_CODE( \
119 MOUNTMGRCONTROLTYPE,\
120 0, \
121 METHOD_BUFFERED, \
122 FILE_READ_ACCESS | FILE_WRITE_ACCESS)
123
124#define IOCTL_MOUNTMGR_DELETE_POINTS CTL_CODE( \
125 MOUNTMGRCONTROLTYPE,\
126 1, \
127 METHOD_BUFFERED, \
128 FILE_READ_ACCESS | FILE_WRITE_ACCESS)
129
130#define IOCTL_MOUNTMGR_VOLUME_ARRIVAL_NOTIFICATION \
131 CTL_CODE( \
132 MOUNTMGRCONTROLTYPE,\
133 11, \
134 METHOD_BUFFERED, \
135 FILE_READ_ACCESS)
136
137typedef struct _MOUNTDEV_UNIQUE_ID {
141
142typedef struct _MOUNTDEV_NAME {
146
152
153typedef struct _MOUNTMGR_TARGET_NAME {
157
164
165typedef struct _MOUNTMGR_MOUNT_POINT {
173
179
180#endif // (VER_PRODUCTBUILD < 2195)
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
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: gl.h:1546
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:54
@ NormalPagePriority
Definition: imports.h:56
@ LowPagePriority
Definition: imports.h:55
@ HighPagePriority
Definition: imports.h:57
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:143
USHORT UniqueIdLength
Definition: imports.h:138
UCHAR UniqueId[1]
Definition: imports.h:139
MOUNTMGR_MOUNT_POINT MountPoints[1]
Definition: imports.h:177
USHORT DeviceNameLength
Definition: imports.h:171
USHORT SymbolicLinkNameLength
Definition: imports.h:167
ULONG SymbolicLinkNameOffset
Definition: imports.h:166
USHORT DeviceNameLength
Definition: imports.h:154
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
#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