2 * Copyright 2008 Francois Gouget for CodeWeavers
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
22 /* Note: We will probably have to duplicate everything ultimately :-( */
26 /* FIXME: #include <ntdef.h> */
28 /* FIXME: #include <bugcodes.h> */
29 /* FIXME: #include <ntiologc.h> */
32 typedef enum _BUS_DATA_TYPE
34 ConfigurationSpaceUndefined
= -1,
47 } BUS_DATA_TYPE
, *PBUS_DATA_TYPE
;
49 typedef struct _CONFIGURATION_INFORMATION
58 BOOLEAN AtDiskPrimaryAddressClaimed
;
59 BOOLEAN AtDiskSecondaryAddressClaimed
;
61 ULONG MediumChangerCount
;
62 } CONFIGURATION_INFORMATION
, *PCONFIGURATION_INFORMATION
;
64 typedef enum _CONFIGURATION_TYPE
68 FloatingPointProcessor
,
105 RealModeIrqRoutingTable
,
106 RealModePCIEnumeration
,
108 } CONFIGURATION_TYPE
, *PCONFIGURATION_TYPE
;
110 #define IMAGE_ADDRESSING_MODE_32BIT 3
112 typedef struct _IMAGE_INFO
119 ULONG ImageAddressingMode
: 8;
120 ULONG SystemModeImage
: 1;
121 ULONG ImageMappedToAllPids
: 1;
122 ULONG ExtendedInfoPresent
: 1;
123 ULONG MachineTypeMismatch
: 1;
124 ULONG ImageSignatureLevel
: 4;
125 ULONG ImageSignatureType
: 3;
126 ULONG ImagePartialMap
: 1;
133 ULONG ImageSectionNumber
;
134 } IMAGE_INFO
, *PIMAGE_INFO
;
136 typedef enum _IO_NOTIFICATION_EVENT_CATEGORY
138 EventCategoryReserved
,
139 EventCategoryHardwareProfileChange
,
140 EventCategoryDeviceInterfaceChange
,
141 EventCategoryTargetDeviceChange
142 } IO_NOTIFICATION_EVENT_CATEGORY
;
144 typedef struct _FILE_VALID_DATA_LENGTH_INFORMATION
146 LARGE_INTEGER ValidDataLength
;
147 } FILE_VALID_DATA_LENGTH_INFORMATION
, *PFILE_VALID_DATA_LENGTH_INFORMATION
;
149 typedef enum _RTL_GENERIC_COMPARE_RESULTS
154 } RTL_GENERIC_COMPARE_RESULTS
;
156 typedef struct _RTL_SPLAY_LINKS
158 struct _RTL_SPLAY_LINKS
*Parent
;
159 struct _RTL_SPLAY_LINKS
*LeftChild
;
160 struct _RTL_SPLAY_LINKS
*RightChild
;
161 } RTL_SPLAY_LINKS
, *PRTL_SPLAY_LINKS
;
163 struct _RTL_GENERIC_TABLE
;
165 typedef RTL_GENERIC_COMPARE_RESULTS (WINAPI
*PRTL_GENERIC_COMPARE_ROUTINE
)(struct _RTL_GENERIC_TABLE
*, void *, void *);
166 typedef void * (WINAPI
*PRTL_GENERIC_ALLOCATE_ROUTINE
)(struct _RTL_GENERIC_TABLE
*, LONG
);
167 typedef void (WINAPI
*PRTL_GENERIC_FREE_ROUTINE
)(struct _RTL_GENERIC_TABLE
*Table
, void *);
169 typedef struct _RTL_GENERIC_TABLE
171 PRTL_SPLAY_LINKS TableRoot
;
172 LIST_ENTRY InsertOrderList
;
173 LIST_ENTRY
*OrderedPointer
;
174 ULONG WhichOrderedElement
;
175 ULONG NumberGenericTableElements
;
176 PRTL_GENERIC_COMPARE_ROUTINE CompareRoutine
;
177 PRTL_GENERIC_ALLOCATE_ROUTINE AllocateRoutine
;
178 PRTL_GENERIC_FREE_ROUTINE FreeRoutine
;
181 typedef RTL_GENERIC_TABLE
*PRTL_GENERIC_TABLE
;
183 typedef struct _RTL_BALANCED_LINKS
{
184 struct _RTL_BALANCED_LINKS
*Parent
;
185 struct _RTL_BALANCED_LINKS
*LeftChild
;
186 struct _RTL_BALANCED_LINKS
*RightChild
;
189 } RTL_BALANCED_LINKS
;
190 typedef RTL_BALANCED_LINKS
*PRTL_BALANCED_LINKS
;
192 struct _RTL_AVL_TABLE
;
194 typedef RTL_GENERIC_COMPARE_RESULTS (WINAPI
*PRTL_AVL_COMPARE_ROUTINE
)(struct _RTL_AVL_TABLE
*, void *, void *);
196 typedef void * (WINAPI
*PRTL_AVL_ALLOCATE_ROUTINE
)(struct _RTL_AVL_TABLE
*, LONG
);
198 typedef void (WINAPI
*PRTL_AVL_FREE_ROUTINE
)(struct _RTL_AVL_TABLE
*, void *buffer
);
200 typedef struct _RTL_AVL_TABLE
{
201 RTL_BALANCED_LINKS BalancedRoot
;
202 void *OrderedPointer
;
203 ULONG WhichOrderedElement
;
204 ULONG NumberGenericTableElements
;
206 PRTL_BALANCED_LINKS RestartKey
;
208 PRTL_AVL_COMPARE_ROUTINE CompareRoutine
;
209 PRTL_AVL_ALLOCATE_ROUTINE AllocateRoutine
;
210 PRTL_AVL_FREE_ROUTINE FreeRoutine
;
212 } RTL_AVL_TABLE
, *PRTL_AVL_TABLE
;
214 typedef struct _PS_CREATE_NOTIFY_INFO
{
219 ULONG FileOpenNameAvailable
:1;
220 ULONG IsSubsystemProcess
:1;
224 HANDLE ParentProcessId
;
225 CLIENT_ID CreatingThreadId
;
226 struct _FILE_OBJECT
*FileObject
;
227 PCUNICODE_STRING ImageFileName
;
228 PCUNICODE_STRING CommandLine
;
229 NTSTATUS CreationStatus
;
230 } PS_CREATE_NOTIFY_INFO
, *PPS_CREATE_NOTIFY_INFO
;
232 typedef void (WINAPI
*PCREATE_PROCESS_NOTIFY_ROUTINE
)(HANDLE
,HANDLE
,BOOLEAN
);
233 typedef void (WINAPI
*PCREATE_PROCESS_NOTIFY_ROUTINE_EX
)(PEPROCESS
,HANDLE
,PS_CREATE_NOTIFY_INFO
*);
234 typedef void (WINAPI
*PCREATE_THREAD_NOTIFY_ROUTINE
)(HANDLE
,HANDLE
,BOOLEAN
);
235 typedef VOID (WINAPI
*PDRIVER_NOTIFICATION_CALLBACK_ROUTINE
)(PVOID
,PVOID
);
236 typedef VOID (WINAPI
*PDRIVER_REINITIALIZE
)(PDRIVER_OBJECT
,PVOID
,ULONG
);
237 typedef VOID (WINAPI
*PLOAD_IMAGE_NOTIFY_ROUTINE
)(PUNICODE_STRING
,HANDLE
,PIMAGE_INFO
);
238 typedef NTSTATUS (WINAPI
*PIO_QUERY_DEVICE_ROUTINE
)(PVOID
,PUNICODE_STRING
,INTERFACE_TYPE
,ULONG
,
239 PKEY_VALUE_FULL_INFORMATION
*,CONFIGURATION_TYPE
,ULONG
,PKEY_VALUE_FULL_INFORMATION
*);
240 typedef void (NTAPI EXPAND_STACK_CALLOUT
)(void*);
241 typedef EXPAND_STACK_CALLOUT
*PEXPAND_STACK_CALLOUT
;
248 NTSTATUS WINAPI
ExUuidCreate(UUID
*);
249 NTSTATUS WINAPI
IoQueryDeviceDescription(PINTERFACE_TYPE
,PULONG
,PCONFIGURATION_TYPE
,PULONG
,
250 PCONFIGURATION_TYPE
,PULONG
,PIO_QUERY_DEVICE_ROUTINE
,PVOID
);
251 void WINAPI
IoRegisterBootDriverReinitialization(DRIVER_OBJECT
*,PDRIVER_REINITIALIZE
,void*);
252 void WINAPI
IoRegisterDriverReinitialization(PDRIVER_OBJECT
,PDRIVER_REINITIALIZE
,PVOID
);
253 NTSTATUS WINAPI
IoRegisterShutdownNotification(PDEVICE_OBJECT
);
254 BOOLEAN WINAPI
KeAreApcsDisabled(void);
255 void WINAPI DECLSPEC_NORETURN
KeBugCheck(ULONG
);
256 NTSTATUS WINAPI
KeExpandKernelStackAndCallout(PEXPAND_STACK_CALLOUT
,void*,SIZE_T
);
257 void WINAPI
KeSetTargetProcessorDpc(PRKDPC
,CCHAR
);
258 BOOLEAN WINAPI
MmIsAddressValid(void *);
259 HANDLE WINAPI
PsGetProcessId(PEPROCESS
);
260 void * WINAPI
PsGetProcessSectionBaseAddress(PEPROCESS
);
261 HANDLE WINAPI
PsGetThreadId(PETHREAD
);
262 HANDLE WINAPI
PsGetThreadProcessId(PETHREAD
);
263 NTSTATUS WINAPI
PsRemoveLoadImageNotifyRoutine(PLOAD_IMAGE_NOTIFY_ROUTINE
);
264 NTSTATUS WINAPI
PsSetCreateProcessNotifyRoutine(PCREATE_PROCESS_NOTIFY_ROUTINE
,BOOLEAN
);
265 NTSTATUS WINAPI
PsSetCreateProcessNotifyRoutineEx(PCREATE_PROCESS_NOTIFY_ROUTINE_EX
,BOOLEAN
);
266 NTSTATUS WINAPI
PsSetCreateThreadNotifyRoutine(PCREATE_THREAD_NOTIFY_ROUTINE
);
267 NTSTATUS WINAPI
PsSetLoadImageNotifyRoutine(PLOAD_IMAGE_NOTIFY_ROUTINE
);
268 void WINAPI
RtlInitializeGenericTableAvl(PRTL_AVL_TABLE
,PRTL_AVL_COMPARE_ROUTINE
,PRTL_AVL_ALLOCATE_ROUTINE
, PRTL_AVL_FREE_ROUTINE
,void *);
269 void WINAPI
RtlInsertElementGenericTableAvl(PRTL_AVL_TABLE
,void *,ULONG
,BOOL
*);