kernel32: Reimplement GetMaximumProcessorGroupCount on top of GetLogicalProcessorInfo...
[wine.git] / include / ddk / ntddk.h
blob41ad3d721bd8a86bc8ee5cd50237346284b99cc7
1 /*
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
19 #ifndef _NTDDK_
20 #define _NTDDK_
22 /* Note: We will probably have to duplicate everything ultimately :-( */
23 #include <ddk/wdm.h>
25 #include <excpt.h>
26 /* FIXME: #include <ntdef.h> */
27 #include <ntstatus.h>
28 /* FIXME: #include <bugcodes.h> */
29 /* FIXME: #include <ntiologc.h> */
32 typedef enum _BUS_DATA_TYPE
34 ConfigurationSpaceUndefined = -1,
35 Cmos,
36 EisaConfiguration,
37 Pos,
38 CbusConfiguration,
39 PCIConfiguration,
40 VMEConfiguration,
41 NuBusConfiguration,
42 PCMCIAConfiguration,
43 MPIConfiguration,
44 MPSAConfiguration,
45 PNPISAConfiguration,
46 MaximumBusDataType
47 } BUS_DATA_TYPE, *PBUS_DATA_TYPE;
49 typedef struct _CONFIGURATION_INFORMATION
51 ULONG DiskCount;
52 ULONG FloppyCount;
53 ULONG CdRomCount;
54 ULONG TapeCount;
55 ULONG ScsiPortCount;
56 ULONG SerialCount;
57 ULONG ParallelCount;
58 BOOLEAN AtDiskPrimaryAddressClaimed;
59 BOOLEAN AtDiskSecondaryAddressClaimed;
60 ULONG Version;
61 ULONG MediumChangerCount;
62 } CONFIGURATION_INFORMATION, *PCONFIGURATION_INFORMATION;
64 typedef enum _CONFIGURATION_TYPE
66 ArcSystem = 0,
67 CentralProcessor,
68 FloatingPointProcessor,
69 PrimaryIcache,
70 PrimaryDcache,
71 SecondaryIcache,
72 SecondaryDcache,
73 SecondaryCache,
74 EisaAdapter,
75 TcAdapter,
76 ScsiAdapter,
77 DtiAdapter,
78 MultiFunctionAdapter,
79 DiskController,
80 TapeController,
81 CdromController,
82 WormController,
83 SerialController,
84 NetworkController,
85 DisplayController,
86 ParallelController,
87 PointerController,
88 KeyboardController,
89 AudioController,
90 OtherController,
91 DiskPeripheral,
92 FloppyDiskPeripheral,
93 TapePeripheral,
94 ModemPeripheral,
95 MonitorPeripheral,
96 PrinterPeripheral,
97 PointerPeripheral,
98 KeyboardPeripheral,
99 TerminalPeripheral,
100 OtherPeripheral,
101 LinePeripheral,
102 NetworkPeripheral,
103 SystemMemory,
104 DockingInformation,
105 RealModeIrqRoutingTable,
106 RealModePCIEnumeration,
107 MaximumType
108 } CONFIGURATION_TYPE, *PCONFIGURATION_TYPE;
110 #define IMAGE_ADDRESSING_MODE_32BIT 3
112 typedef struct _IMAGE_INFO
114 union
116 ULONG Properties;
117 struct
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;
127 ULONG Reserved : 12;
128 } DUMMYSTRUCTNAME;
129 } DUMMYUNIONNAME;
130 PVOID ImageBase;
131 ULONG ImageSelector;
132 SIZE_T ImageSize;
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
151 GenericLessThan,
152 GenericGreaterThan,
153 GenericEqual
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;
179 void *TableContext;
180 } RTL_GENERIC_TABLE;
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;
187 CHAR Balance;
188 UCHAR Reserved[3];
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;
205 ULONG DepthOfTree;
206 PRTL_BALANCED_LINKS RestartKey;
207 ULONG DeleteCount;
208 PRTL_AVL_COMPARE_ROUTINE CompareRoutine;
209 PRTL_AVL_ALLOCATE_ROUTINE AllocateRoutine;
210 PRTL_AVL_FREE_ROUTINE FreeRoutine;
211 void *TableContext;
212 } RTL_AVL_TABLE, *PRTL_AVL_TABLE;
214 typedef struct _PS_CREATE_NOTIFY_INFO {
215 SIZE_T Size;
216 union {
217 ULONG Flags;
218 struct {
219 ULONG FileOpenNameAvailable :1;
220 ULONG IsSubsystemProcess :1;
221 ULONG Reserved :30;
222 } DUMMYSTRUCTNAME;
223 } DUMMYUNIONNAME;
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;
243 #ifndef UUID_DEFINED
244 #define UUID_DEFINED
245 typedef GUID UUID;
246 #endif
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*);
271 #endif