ReactOS 0.4.16-dev-1133-g947c03e
main.c
Go to the documentation of this file.
1#include "precomp.h"
2
3#include <poclass.h>
4
5#define NDEBUG
6#include <debug.h>
7
8CODE_SEG("INIT")
9DRIVER_INITIALIZE DriverEntry;
10
11CODE_SEG("PAGE")
12DRIVER_ADD_DEVICE Bus_AddDevice;
13
16
20
21
22CODE_SEG("PAGE")
28 )
29
30{
33 PFDO_DEVICE_DATA deviceData = NULL;
34#ifndef NDEBUG
35 PWCHAR deviceName = NULL;
36 ULONG nameLength;
37#endif
38
39 PAGED_CODE ();
40
41 DPRINT("Add Device: 0x%p\n", PhysicalDeviceObject);
42
43 DPRINT("#################### Bus_CreateClose Creating FDO Device ####################\n");
45 sizeof(FDO_DEVICE_DATA),
46 NULL,
49 TRUE,
51 if (!NT_SUCCESS(status))
52 {
53 DPRINT1("IoCreateDevice() failed with status 0x%X\n", status);
54 goto End;
55 }
56
57 deviceData = (PFDO_DEVICE_DATA) deviceObject->DeviceExtension;
58 RtlZeroMemory (deviceData, sizeof (FDO_DEVICE_DATA));
59
60 //
61 // Set the initial state of the FDO
62 //
63
64 INITIALIZE_PNP_STATE(deviceData->Common);
65
66 deviceData->Common.IsFDO = TRUE;
67
68 deviceData->Common.Self = deviceObject;
69
70 ExInitializeFastMutex (&deviceData->Mutex);
71
72 InitializeListHead (&deviceData->ListOfPDOs);
73
74 // Set the PDO for use with PlugPlay functions
75
77
78 //
79 // Set the initial powerstate of the FDO
80 //
81
84
86
87 //
88 // Attach our FDO to the device stack.
89 // The return value of IoAttachDeviceToDeviceStack is the top of the
90 // attachment chain. This is where all the IRPs should be routed.
91 //
92
96
97 if (NULL == deviceData->NextLowerDriver) {
98
100 goto End;
101 }
102
103
104#ifndef NDEBUG
105 //
106 // We will demonstrate here the step to retrieve the name of the PDO
107 //
108
111 0,
112 NULL,
113 &nameLength);
114
116 {
117 DPRINT1("AddDevice:IoGDP failed (0x%x)\n", status);
118 goto End;
119 }
120
121 deviceName = ExAllocatePoolWithTag(NonPagedPool, nameLength, 'MpcA');
122
123 if (NULL == deviceName) {
124 DPRINT1("AddDevice: no memory to alloc for deviceName(0x%x)\n", nameLength);
126 goto End;
127 }
128
131 nameLength,
132 deviceName,
133 &nameLength);
134
135 if (!NT_SUCCESS (status)) {
136
137 DPRINT1("AddDevice:IoGDP(2) failed (0x%x)", status);
138 goto End;
139 }
140
141 DPRINT("AddDevice: %p to %p->%p (%ws) \n",
143 deviceData->NextLowerDriver,
145 deviceName);
146
147#endif
148
149 //
150 // We are done with initializing, so let's indicate that and return.
151 // This should be the final step in the AddDevice process.
152 //
153 deviceObject->Flags &= ~DO_DEVICE_INITIALIZING;
154
155End:
156#ifndef NDEBUG
157 if (deviceName){
158 ExFreePoolWithTag(deviceName, 'MpcA');
159 }
160#endif
162 if (deviceData && deviceData->NextLowerDriver){
163 IoDetachDevice (deviceData->NextLowerDriver);
164 }
166 }
167 return status;
168
169}
170
172NTAPI
175 IN PIRP Irp)
176{
177 Irp->IoStatus.Status = STATUS_SUCCESS;
178 Irp->IoStatus.Information = 0;
179
181
182 return STATUS_SUCCESS;
183}
184
185VOID
186NTAPI
188{
189 PIRP Irp = Context;
190 int result;
191 struct acpi_bus_event event;
192 ULONG ButtonEvent;
193
196
197 if (!ACPI_SUCCESS(result))
198 {
199 Irp->IoStatus.Status = STATUS_UNSUCCESSFUL;
200 }
201 else
202 {
203 if (strstr(event.bus_id, "PWRF"))
204 ButtonEvent = SYS_BUTTON_POWER;
205 else if (strstr(event.bus_id, "SLPF"))
206 ButtonEvent = SYS_BUTTON_SLEEP;
207 else
208 ButtonEvent = 0;
209
210 RtlCopyMemory(Irp->AssociatedIrp.SystemBuffer, &ButtonEvent, sizeof(ButtonEvent));
211 Irp->IoStatus.Status = STATUS_SUCCESS;
212 Irp->IoStatus.Information = sizeof(ULONG);
213 }
214
216}
217
218
220NTAPI
223 IN PIRP Irp)
224{
225 PIO_STACK_LOCATION irpStack;
227 PCOMMON_DEVICE_DATA commonData;
228 ULONG Caps = 0;
229 HANDLE ThreadHandle;
230
233
234 commonData = (PCOMMON_DEVICE_DATA) DeviceObject->DeviceExtension;
235
236 Irp->IoStatus.Information = 0;
237
238 if (!commonData->IsFDO)
239 {
240 switch (irpStack->Parameters.DeviceIoControl.IoControlCode)
241 {
243 {
245
247 break;
248 }
249
251 {
253
255 break;
256 }
257
259 if (irpStack->Parameters.DeviceIoControl.OutputBufferLength < sizeof(ULONG))
260 {
262 break;
263 }
264
265 if (wcsstr(((PPDO_DEVICE_DATA)commonData)->HardwareIDs, L"PNP0C0D"))
266 {
267 DPRINT1("Lid button reported to power manager\n");
268 Caps |= SYS_BUTTON_LID;
269 }
270 else if (((PPDO_DEVICE_DATA)commonData)->AcpiHandle == NULL)
271 {
272 /* We have to return both at the same time because since we
273 * have a NULL handle we are the fixed feature DO and we will
274 * only be called once (not once per device)
275 */
276 if (power_button)
277 {
278 DPRINT("Fixed power button reported to power manager\n");
279 Caps |= SYS_BUTTON_POWER;
280 }
281 if (sleep_button)
282 {
283 DPRINT("Fixed sleep button reported to power manager\n");
284 Caps |= SYS_BUTTON_SLEEP;
285 }
286 }
287 else if (wcsstr(((PPDO_DEVICE_DATA)commonData)->HardwareIDs, L"PNP0C0C"))
288 {
289 DPRINT("Control method power button reported to power manager\n");
290 Caps |= SYS_BUTTON_POWER;
291 }
292 else if (wcsstr(((PPDO_DEVICE_DATA)commonData)->HardwareIDs, L"PNP0C0E"))
293 {
294 DPRINT("Control method sleep reported to power manager\n");
295 Caps |= SYS_BUTTON_SLEEP;
296 }
297 else
298 {
299 DPRINT1("IOCTL_GET_SYS_BUTTON_CAPS sent to a non-button device\n");
301 }
302
303 if (Caps != 0)
304 {
305 RtlCopyMemory(Irp->AssociatedIrp.SystemBuffer, &Caps, sizeof(Caps));
306 Irp->IoStatus.Information = sizeof(Caps);
308 }
309 break;
310
313 ZwClose(ThreadHandle);
314
316 break;
317
319 DPRINT("IOCTL_BATTERY_QUERY_TAG is not supported!\n");
320 break;
321
322 default:
323 DPRINT1("Unsupported IOCTL: %x\n", irpStack->Parameters.DeviceIoControl.IoControlCode);
324 break;
325 }
326 }
327 else
328 DPRINT1("IOCTL sent to the ACPI FDO! Kill the caller!\n");
329
330 if (status != STATUS_PENDING)
331 {
332 Irp->IoStatus.Status = status;
334 }
335 else
337
338 return status;
339}
340
341static
342CODE_SEG("INIT")
344AcpiRegOpenKey(IN HANDLE ParentKeyHandle,
348{
351
353
355 &Name,
357 ParentKeyHandle,
358 NULL);
359
360 return ZwOpenKey(KeyHandle,
363}
364
365static
366CODE_SEG("INIT")
373{
378
380
381 if (DataLength != NULL)
383
384 /* Check if the caller provided a valid buffer */
385 if ((Data != NULL) && (BufferLength != 0))
386 {
388
389 /* Allocate memory for the value */
390 ValueInfo = ExAllocatePoolWithTag(PagedPool, BufferLength, 'MpcA');
391 if (ValueInfo == NULL)
392 return STATUS_NO_MEMORY;
393 }
394 else
395 {
396 /* Caller didn't provide a valid buffer, assume he wants the size only */
397 ValueInfo = NULL;
398 BufferLength = 0;
399 }
400
401 /* Query the value */
402 Status = ZwQueryValueKey(KeyHandle,
403 &Name,
405 ValueInfo,
407 &BufferLength);
408
409 if (DataLength != NULL)
411
412 /* Check if we have the size only */
413 if (ValueInfo == NULL)
414 {
415 /* Check for unexpected status */
418 {
419 return Status;
420 }
421
422 /* All is well */
424 }
425 /* Otherwise the caller wanted data back, check if we got it */
426 else if (NT_SUCCESS(Status))
427 {
428 if (Type != NULL)
429 *Type = ValueInfo->Type;
430
431 /* Copy it */
432 RtlMoveMemory(Data, ValueInfo->Data, ValueInfo->DataLength);
433
434 /* if the type is REG_SZ and data is not 0-terminated
435 * and there is enough space in the buffer NT appends a \0 */
436 if (((ValueInfo->Type == REG_SZ) ||
437 (ValueInfo->Type == REG_EXPAND_SZ) ||
438 (ValueInfo->Type == REG_MULTI_SZ)) &&
439 (ValueInfo->DataLength <= *DataLength - sizeof(WCHAR)))
440 {
441 WCHAR *ptr = (WCHAR *)((ULONG_PTR)Data + ValueInfo->DataLength);
442 if ((ptr > (WCHAR *)Data) && ptr[-1])
443 *ptr = 0;
444 }
445 }
446
447 /* Free the memory and return status */
448 if (ValueInfo != NULL)
449 {
450 ExFreePoolWithTag(ValueInfo, 'MpcA');
451 }
452
453 return Status;
454}
455
456static
457CODE_SEG("INIT")
460{
461 LPWSTR ProcessorIdentifier = NULL;
462 LPWSTR ProcessorVendorIdentifier = NULL;
463 LPWSTR HardwareIdsBuffer = NULL;
464 HANDLE ProcessorHandle = NULL;
465 ULONG Length = 0, Level1Length = 0, Level2Length = 0, Level3Length = 0;
466 SIZE_T HardwareIdsLength = 0;
467 SIZE_T VendorIdentifierLength;
468 ULONG i;
469 PWCHAR Ptr;
471
472 DPRINT("GetProcessorInformation()\n");
473
474 /* Open the key for CPU 0 */
476 L"\\Registry\\Machine\\Hardware\\Description\\System\\CentralProcessor\\0",
477 KEY_READ,
478 &ProcessorHandle);
479 if (!NT_SUCCESS(Status))
480 {
481 DPRINT1("Failed to open CentralProcessor registry key: 0x%lx\n", Status);
482 goto done;
483 }
484
485 /* Query the processor identifier length */
486 Status = AcpiRegQueryValue(ProcessorHandle,
487 L"Identifier",
488 NULL,
489 NULL,
490 &Length);
491 if (!NT_SUCCESS(Status))
492 {
493 DPRINT1("Failed to query Identifier value: 0x%lx\n", Status);
494 goto done;
495 }
496
497 /* Remember the length as fallback for level 1-3 length */
498 Level1Length = Level2Length = Level3Length = Length;
499
500 /* Allocate a buffer large enough to be zero terminated */
501 Length += sizeof(UNICODE_NULL);
502 ProcessorIdentifier = ExAllocatePoolWithTag(PagedPool, Length, 'IpcA');
503 if (ProcessorIdentifier == NULL)
504 {
505 DPRINT1("Failed to allocate 0x%lx bytes\n", Length);
507 goto done;
508 }
509
510 /* Query the processor identifier string */
511 Status = AcpiRegQueryValue(ProcessorHandle,
512 L"Identifier",
513 NULL,
514 ProcessorIdentifier,
515 &Length);
516 if (!NT_SUCCESS(Status))
517 {
518 DPRINT1("Failed to query Identifier value: 0x%lx\n", Status);
519 goto done;
520 }
521
522 /* Query the processor name length */
523 Length = 0;
524 Status = AcpiRegQueryValue(ProcessorHandle,
525 L"ProcessorNameString",
526 NULL,
527 NULL,
528 &Length);
529 if (NT_SUCCESS(Status))
530 {
531 /* Allocate a buffer large enough to be zero terminated */
532 Length += sizeof(UNICODE_NULL);
535 {
536 DPRINT1("Failed to allocate 0x%lx bytes\n", Length);
538 goto done;
539 }
540
541 /* Query the processor name string */
542 Status = AcpiRegQueryValue(ProcessorHandle,
543 L"ProcessorNameString",
544 NULL,
546 &Length);
547 if (!NT_SUCCESS(Status))
548 {
549 DPRINT1("Failed to query ProcessorNameString value: 0x%lx\n", Status);
550 goto done;
551 }
552 }
553
554 /* Query the vendor identifier length */
555 Length = 0;
556 Status = AcpiRegQueryValue(ProcessorHandle,
557 L"VendorIdentifier",
558 NULL,
559 NULL,
560 &Length);
561 if (!NT_SUCCESS(Status) || (Length == 0))
562 {
563 DPRINT1("Failed to query VendorIdentifier value: 0x%lx\n", Status);
564 goto done;
565 }
566
567 /* Allocate a buffer large enough to be zero terminated */
568 Length += sizeof(UNICODE_NULL);
569 ProcessorVendorIdentifier = ExAllocatePoolWithTag(PagedPool, Length, 'IpcA');
570 if (ProcessorVendorIdentifier == NULL)
571 {
572 DPRINT1("Failed to allocate 0x%lx bytes\n", Length);
574 goto done;
575 }
576
577 /* Query the vendor identifier string */
578 Status = AcpiRegQueryValue(ProcessorHandle,
579 L"VendorIdentifier",
580 NULL,
581 ProcessorVendorIdentifier,
582 &Length);
583 if (!NT_SUCCESS(Status))
584 {
585 DPRINT1("Failed to query VendorIdentifier value: 0x%lx\n", Status);
586 goto done;
587 }
588
589 /* Change spaces to underscores */
590 for (i = 0; i < wcslen(ProcessorIdentifier); i++)
591 {
592 if (ProcessorIdentifier[i] == L' ')
593 ProcessorIdentifier[i] = L'_';
594 }
595
596 Ptr = wcsstr(ProcessorIdentifier, L"Stepping");
597 if (Ptr != NULL)
598 {
599 Ptr--;
600 Level1Length = (ULONG)(Ptr - ProcessorIdentifier);
601 }
602
603 Ptr = wcsstr(ProcessorIdentifier, L"Model");
604 if (Ptr != NULL)
605 {
606 Ptr--;
607 Level2Length = (ULONG)(Ptr - ProcessorIdentifier);
608 }
609
610 Ptr = wcsstr(ProcessorIdentifier, L"Family");
611 if (Ptr != NULL)
612 {
613 Ptr--;
614 Level3Length = (ULONG)(Ptr - ProcessorIdentifier);
615 }
616
617 VendorIdentifierLength = (USHORT)wcslen(ProcessorVendorIdentifier);
618
619 /* Calculate the size of the full REG_MULTI_SZ data (see swprintf below) */
620 HardwareIdsLength = (5 + VendorIdentifierLength + 3 + Level1Length + 1 +
621 1 + VendorIdentifierLength + 3 + Level1Length + 1 +
622 5 + VendorIdentifierLength + 3 + Level2Length + 1 +
623 1 + VendorIdentifierLength + 3 + Level2Length + 1 +
624 5 + VendorIdentifierLength + 3 + Level3Length + 1 +
625 1 + VendorIdentifierLength + 3 + Level3Length + 1 +
626 1) * sizeof(WCHAR);
627
628 /* Allocate a buffer to the data */
629 HardwareIdsBuffer = ExAllocatePoolWithTag(PagedPool, HardwareIdsLength, 'IpcA');
630 if (HardwareIdsBuffer == NULL)
631 {
633 goto done;
634 }
635
636 Length = 0;
637 Length += swprintf(&HardwareIdsBuffer[Length], L"ACPI\\%s_-_%.*s", ProcessorVendorIdentifier, Level1Length, ProcessorIdentifier);
638 HardwareIdsBuffer[Length++] = UNICODE_NULL;
639
640 Length += swprintf(&HardwareIdsBuffer[Length], L"*%s_-_%.*s", ProcessorVendorIdentifier, Level1Length, ProcessorIdentifier);
641 HardwareIdsBuffer[Length++] = UNICODE_NULL;
642
643 Length += swprintf(&HardwareIdsBuffer[Length], L"ACPI\\%s_-_%.*s", ProcessorVendorIdentifier, Level2Length, ProcessorIdentifier);
644 HardwareIdsBuffer[Length++] = UNICODE_NULL;
645
646 Length += swprintf(&HardwareIdsBuffer[Length], L"*%s_-_%.*s", ProcessorVendorIdentifier, Level2Length, ProcessorIdentifier);
647 HardwareIdsBuffer[Length++] = UNICODE_NULL;
648
649 Length += swprintf(&HardwareIdsBuffer[Length], L"ACPI\\%s_-_%.*s", ProcessorVendorIdentifier, Level3Length, ProcessorIdentifier);
650 HardwareIdsBuffer[Length++] = UNICODE_NULL;
651
652 Length += swprintf(&HardwareIdsBuffer[Length], L"*%s_-_%.*s", ProcessorVendorIdentifier, Level3Length, ProcessorIdentifier);
653 HardwareIdsBuffer[Length++] = UNICODE_NULL;
654 HardwareIdsBuffer[Length++] = UNICODE_NULL;
655
656 /* Make sure we counted correctly */
657 NT_ASSERT(Length * sizeof(WCHAR) == HardwareIdsLength);
658
659 ProcessorHardwareIds.Length = (SHORT)HardwareIdsLength;
661 ProcessorHardwareIds.Buffer = HardwareIdsBuffer;
662
663 Length = (5 + VendorIdentifierLength + 3 + Level1Length + 1) * sizeof(WCHAR);
665 if (ProcessorIdString != NULL)
666 {
667 Length = swprintf(ProcessorIdString, L"ACPI\\%s_-_%.*s", ProcessorVendorIdentifier, Level1Length, ProcessorIdentifier);
669 DPRINT("ProcessorIdString: %S\n", ProcessorIdString);
670 }
671
672done:
673 if (ProcessorHandle != NULL)
674 ZwClose(ProcessorHandle);
675
676 if (ProcessorIdentifier != NULL)
677 ExFreePoolWithTag(ProcessorIdentifier, 'IpcA');
678
679 if (ProcessorVendorIdentifier != NULL)
680 ExFreePoolWithTag(ProcessorVendorIdentifier, 'IpcA');
681
682 if (!NT_SUCCESS(Status))
683 {
684 if (HardwareIdsBuffer != NULL)
685 ExFreePoolWithTag(HardwareIdsBuffer, 'IpcA');
686 }
687
688 return Status;
689}
690
691CODE_SEG("INIT")
693NTAPI
697 )
698{
700 DPRINT("Driver Entry \n");
701
703 if (!NT_SUCCESS(Status))
704 {
706 return Status;
707 }
708
709 //
710 // Set entry points into the driver
711 //
713 DriverObject->MajorFunction [IRP_MJ_PNP] = Bus_PnP;
714 DriverObject->MajorFunction [IRP_MJ_POWER] = Bus_Power;
717
718 DriverObject->DriverExtension->AddDevice = Bus_AddDevice;
719
720 return STATUS_SUCCESS;
721}
static PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(PIRP Irp)
#define PAGED_CODE()
#define CODE_SEG(...)
Type
Definition: Type.h:7
char * strstr(char *String1, char *String2)
Definition: utclib.c:653
#define ACPI_SUCCESS(a)
Definition: acexcep.h:94
#define ACPI_BUTTON_NOTIFY_STATUS
Definition: acpi_drivers.h:87
#define IOCTL_ACPI_ASYNC_EVAL_METHOD
Definition: acpiioct.h:177
#define IOCTL_ACPI_EVAL_METHOD
Definition: acpiioct.h:178
struct _COMMON_DEVICE_DATA * PCOMMON_DEVICE_DATA
struct _FDO_DEVICE_DATA * PFDO_DEVICE_DATA
NTSTATUS NTAPI Bus_Power(PDEVICE_OBJECT DeviceObject, PIRP Irp)
Definition: power.c:8
NTSTATUS NTAPI Bus_PnP(PDEVICE_OBJECT DeviceObject, PIRP Irp)
Definition: pnp.c:25
LONG NTSTATUS
Definition: precomp.h:26
#define DPRINT1
Definition: precomp.h:8
#define IOCTL_BATTERY_QUERY_TAG
Definition: batclass.h:84
PDEVICE_OBJECT PhysicalDeviceObject
Definition: btrfs_drv.h:1157
_In_ ULONG _In_opt_ WDFREQUEST _In_opt_ PVOID _In_ size_t _In_ PVOID _In_ size_t _Out_ size_t * DataLength
Definition: cdrom.h:1444
#define FILE_DEVICE_SECURE_OPEN
Definition: cdrw_usr.h:46
#define IRP_MJ_PNP
Definition: cdrw_usr.h:52
IN PUNICODE_STRING IN POBJECT_ATTRIBUTES ObjectAttributes
Definition: conport.c:36
_In_ PIRP Irp
Definition: csq.h:116
#define STATUS_PENDING
Definition: d3dkmdt.h:43
#define STATUS_NO_MEMORY
Definition: d3dkmdt.h:51
#define STATUS_NOT_SUPPORTED
Definition: d3dkmdt.h:48
LPWSTR Name
Definition: desk.c:124
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:33
#define swprintf
Definition: precomp.h:40
int acpi_bus_receive_event(struct acpi_bus_event *event)
Definition: bus.c:513
NTSTATUS NTAPI Bus_PDO_EvalMethod(_In_ PPDO_DEVICE_DATA DeviceData, _Inout_ PIRP Irp)
Definition: eval.c:765
struct acpi_device * sleep_button
Definition: button.c:56
struct acpi_device * power_button
Definition: button.c:55
LPWSTR ProcessorIdString
Definition: main.c:18
static NTSTATUS AcpiRegQueryValue(IN HANDLE KeyHandle, IN LPWSTR ValueName, OUT PULONG Type OPTIONAL, OUT PVOID Data OPTIONAL, IN OUT PULONG DataLength OPTIONAL)
Definition: main.c:368
DRIVER_INITIALIZE DriverEntry
Definition: main.c:9
static NTSTATUS GetProcessorInformation(VOID)
Definition: main.c:459
NTSTATUS NTAPI ACPIDispatchDeviceControl(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: main.c:221
DRIVER_ADD_DEVICE Bus_AddDevice
Definition: main.c:12
static NTSTATUS AcpiRegOpenKey(IN HANDLE ParentKeyHandle, IN LPCWSTR KeyName, IN ACCESS_MASK DesiredAccess, OUT HANDLE KeyHandle)
Definition: main.c:344
UNICODE_STRING ProcessorHardwareIds
Definition: main.c:17
LPWSTR ProcessorNameString
Definition: main.c:19
NTSTATUS NTAPI ACPIDispatchCreateClose(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: main.c:173
VOID NTAPI ButtonWaitThread(PVOID Context)
Definition: main.c:187
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
#define KeGetCurrentIrql()
Definition: env_spec_w32.h:706
#define NonPagedPool
Definition: env_spec_w32.h:307
#define InitializeListHead(ListHead)
Definition: env_spec_w32.h:944
#define DISPATCH_LEVEL
Definition: env_spec_w32.h:696
#define PagedPool
Definition: env_spec_w32.h:308
#define INITIALIZE_PNP_STATE(_Data_)
Definition: fbtusb.h:107
_Must_inspect_result_ _In_ PFSRTL_PER_STREAM_CONTEXT Ptr
Definition: fsrtlfuncs.h:898
MxDeviceObject deviceObject
Status
Definition: gdiplustypes.h:25
struct _cl_event * event
Definition: glext.h:7739
GLuint64EXT * result
Definition: glext.h:11304
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
_CONST_RETURN wchar_t *__cdecl wcsstr(_In_z_ const wchar_t *_Str, _In_z_ const wchar_t *_SubStr)
#define OBJ_KERNEL_HANDLE
Definition: winternl.h:231
#define OBJ_CASE_INSENSITIVE
Definition: winternl.h:228
IoMarkIrpPending(Irp)
#define REG_SZ
Definition: layer.c:22
if(dx< 0)
Definition: linetemp.h:194
#define ASSERT(a)
Definition: mode.c:44
#define ExFreePoolWithTag(_P, _T)
Definition: module.h:1109
static PVOID ptr
Definition: dispmode.c:27
#define InitializeObjectAttributes(p, n, a, r, s)
Definition: reg.c:106
_Must_inspect_result_ _Out_ PNDIS_STATUS _In_ NDIS_HANDLE _In_ ULONG _Out_ PNDIS_STRING _Out_ PNDIS_HANDLE KeyHandle
Definition: ndis.h:4715
NTSYSAPI NTSTATUS NTAPI ZwClose(_In_ HANDLE Handle)
#define THREAD_ALL_ACCESS
Definition: nt_native.h:1339
@ KeyValuePartialInformation
Definition: nt_native.h:1182
ULONG ACCESS_MASK
Definition: nt_native.h:40
#define KEY_READ
Definition: nt_native.h:1023
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
#define REG_MULTI_SZ
Definition: nt_native.h:1501
#define REG_EXPAND_SZ
Definition: nt_native.h:1494
#define UNICODE_NULL
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:102
PDEVICE_OBJECT NTAPI IoAttachDeviceToDeviceStack(IN PDEVICE_OBJECT SourceDevice, IN PDEVICE_OBJECT TargetDevice)
Definition: device.c:966
NTSTATUS NTAPI IoCreateDevice(IN PDRIVER_OBJECT DriverObject, IN ULONG DeviceExtensionSize, IN PUNICODE_STRING DeviceName, IN DEVICE_TYPE DeviceType, IN ULONG DeviceCharacteristics, IN BOOLEAN Exclusive, OUT PDEVICE_OBJECT *DeviceObject)
Definition: device.c:1031
VOID NTAPI IoDetachDevice(IN PDEVICE_OBJECT TargetDevice)
Definition: device.c:1296
VOID NTAPI IoDeleteDevice(IN PDEVICE_OBJECT DeviceObject)
Definition: device.c:1251
#define IoCompleteRequest
Definition: irp.c:1240
NTSTATUS NTAPI PsCreateSystemThread(OUT PHANDLE ThreadHandle, IN ACCESS_MASK DesiredAccess, IN POBJECT_ATTRIBUTES ObjectAttributes, IN HANDLE ProcessHandle, IN PCLIENT_ID ClientId, IN PKSTART_ROUTINE StartRoutine, IN PVOID StartContext)
Definition: thread.c:602
@ PowerSystemWorking
Definition: ntpoapi.h:36
@ PowerDeviceUnspecified
Definition: ntpoapi.h:48
#define L(x)
Definition: ntvdm.h:50
short SHORT
Definition: pedump.c:59
unsigned short USHORT
Definition: pedump.c:61
NTSTATUS NTAPI IoGetDeviceProperty(IN PDEVICE_OBJECT DeviceObject, IN DEVICE_REGISTRY_PROPERTY DeviceProperty, IN ULONG BufferLength, OUT PVOID PropertyBuffer, OUT PULONG ResultLength)
Definition: pnpmgr.c:1382
#define SYS_BUTTON_SLEEP
Definition: poclass.h:84
#define SYS_BUTTON_POWER
Definition: poclass.h:83
#define IOCTL_GET_SYS_BUTTON_CAPS
Definition: poclass.h:59
#define IOCTL_GET_SYS_BUTTON_EVENT
Definition: poclass.h:62
#define SYS_BUTTON_LID
Definition: poclass.h:85
#define FILE_DEVICE_ACPI
Definition: winioctl.h:95
#define IRP_MJ_CLOSE
Definition: rdpdr.c:45
#define IRP_MJ_DEVICE_CONTROL
Definition: rdpdr.c:52
#define IRP_MJ_CREATE
Definition: rdpdr.c:44
#define STATUS_SUCCESS
Definition: shellext.h:65
#define STATUS_BUFFER_TOO_SMALL
Definition: shellext.h:69
#define STATUS_BUFFER_OVERFLOW
Definition: shellext.h:66
#define DPRINT
Definition: sndvol32.h:73
PULONG MinorVersion OPTIONAL
Definition: CrossNt.h:68
SYSTEM_POWER_STATE SystemPowerState
Definition: acpisys.h:32
DEVICE_POWER_STATE DevicePowerState
Definition: acpisys.h:33
PDEVICE_OBJECT Self
Definition: acpisys.h:28
COMMON_DEVICE_DATA Common
Definition: acpisys.h:58
FAST_MUTEX Mutex
Definition: acpisys.h:72
PDEVICE_OBJECT NextLowerDriver
Definition: acpisys.h:63
LIST_ENTRY ListOfPDOs
Definition: acpisys.h:66
PDEVICE_OBJECT UnderlyingPDO
Definition: acpisys.h:59
union _IO_STACK_LOCATION::@1619 Parameters
struct _IO_STACK_LOCATION::@1619::@1620 DeviceIoControl
USHORT MaximumLength
Definition: env_spec_w32.h:370
Definition: ps.c:97
uint32_t * PULONG
Definition: typedefs.h:59
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:255
#define NTAPI
Definition: typedefs.h:36
ULONG_PTR SIZE_T
Definition: typedefs.h:80
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
uint32_t ULONG_PTR
Definition: typedefs.h:65
#define IN
Definition: typedefs.h:39
#define RtlMoveMemory(Destination, Source, Length)
Definition: typedefs.h:264
uint16_t * PWCHAR
Definition: typedefs.h:56
uint32_t ULONG
Definition: typedefs.h:59
#define OUT
Definition: typedefs.h:40
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
#define STATUS_NO_SUCH_DEVICE
Definition: udferr_usr.h:136
#define STATUS_UNSUCCESSFUL
Definition: udferr_usr.h:132
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
_In_ PDEVICE_OBJECT DeviceObject
Definition: wdfdevice.h:2055
_Must_inspect_result_ _In_ WDFDEVICE _In_ ULONG _In_ ACCESS_MASK DesiredAccess
Definition: wdfdevice.h:2658
_Must_inspect_result_ _In_ WDFDEVICE _In_ PCUNICODE_STRING KeyName
Definition: wdfdevice.h:2699
_Must_inspect_result_ _In_ WDFDEVICE _In_ DEVICE_REGISTRY_PROPERTY _In_ ULONG BufferLength
Definition: wdfdevice.h:3771
_Must_inspect_result_ _In_ PDRIVER_OBJECT _In_ PCUNICODE_STRING RegistryPath
Definition: wdfdriver.h:215
_Must_inspect_result_ _In_ PDRIVER_OBJECT DriverObject
Definition: wdfdriver.h:213
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING ValueName
Definition: wdfregistry.h:243
FORCEINLINE VOID ExInitializeFastMutex(_Out_ PFAST_MUTEX FastMutex)
Definition: exfuncs.h:274
#define IO_NO_INCREMENT
Definition: iotypes.h:598
@ DevicePropertyPhysicalDeviceObjectName
Definition: iotypes.h:1206
#define DO_POWER_PAGABLE
#define IRP_MJ_POWER
#define NT_ASSERT
Definition: rtlfuncs.h:3327
__wchar_t WCHAR
Definition: xmlstorage.h:180
WCHAR * LPWSTR
Definition: xmlstorage.h:184
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185