ReactOS 0.4.17-dev-470-gf9e3448
pnpmap.c
Go to the documentation of this file.
1/*
2 * PROJECT: ReactOS Kernel
3 * LICENSE: GPL-2.0-or-later (https://spdx.org/licenses/GPL-2.0-or-later)
4 * PURPOSE: PnP manager Firmware Mapper functions
5 * COPYRIGHT: Copyright 2006-2007 Hervé Poussineau <hpoussin@reactos.org>
6 * Copyright 2008-2011 Cameron Gutman <cameron.gutman@reactos.org>
7 */
8
9/* INCLUDES ******************************************************************/
10
11#include <ntoskrnl.h>
12#define NDEBUG
13#include <debug.h>
14
15/* TYPES *********************************************************************/
16
18{
22
24{
30
31/* DATA **********************************************************************/
32
38
39/* FIXME: Trailing \0 in structures below are hacks, should be removed.
40 * Hardware identifiers also can be mapped using "LegacyXlate" sections
41 * of driver INF files. */
42
43DATA_SEG("INITDATA")
44static
46{
47 { L"XT_83KEY", L"*PNP0300\0" },
48 { L"PCAT_86KEY", L"*PNP0301\0" },
49 { L"PCXT_84KEY", L"*PNP0302\0" },
50 { L"XT_84KEY", L"*PNP0302\0" },
51 { L"101-KEY", L"*PNP0303\0" },
52 { L"OLI_83KEY", L"*PNP0304\0" },
53 { L"ATT_301", L"*PNP0304\0" },
54 { L"OLI_102KEY", L"*PNP0305\0" },
55 { L"OLI_86KEY", L"*PNP0306\0" },
56 { L"OLI_A101_102KEY", L"*PNP0309\0" },
57 { L"ATT_302", L"*PNP030a\0" },
58 { L"PCAT_ENHANCED", L"*PNP030b\0" },
59#ifdef _M_IX86
60 { L"PC98_106KEY", L"*nEC1300\0" },
61 { L"PC98_LaptopKEY", L"*nEC1300\0" },
62 { L"PC98_N106KEY", L"*PNP0303\0" },
63#endif
64 { NULL, NULL }
65};
66
67DATA_SEG("INITDATA")
68static
70{
71 { L"PS2 MOUSE", L"*PNP0F0E\0" },
72 { L"SERIAL MOUSE", L"*PNP0F0C\0" },
73 { L"MICROSOFT PS2 MOUSE", L"*PNP0F03\0" },
74 { L"LOGITECH PS2 MOUSE", L"*PNP0F12\0" },
75 { L"MICROSOFT INPORT MOUSE", L"*PNP0F02\0" },
76 { L"MICROSOFT SERIAL MOUSE", L"*PNP0F01\0" },
77 { L"MICROSOFT BALLPOINT SERIAL MOUSE", L"*PNP0F09\0" },
78 { L"LOGITECH SERIAL MOUSE", L"*PNP0F08\0" },
79 { L"MICROSOFT BUS MOUSE", L"*PNP0F00\0" },
80#ifdef _M_IX86
81 { L"NEC PC-9800 BUS MOUSE", L"*nEC1F00\0" },
82#endif
83 { NULL, NULL }
84};
85
86DATA_SEG("INITDATA")
87static
89{
90 { L"SerialController", L"*PNP0501\0", NULL, 0 },
91 //{ L"KeyboardController", L"*PNP0303\0", NULL, 0 },
92 //{ L"PointerController", L"*PNP0F13\0", NULL, 0 },
93 { L"KeyboardPeripheral", NULL, KeyboardMap, 0 },
94 { L"PointerPeripheral", NULL, PointerMap, 0 },
95 { L"ParallelController", L"*PNP0400\0", NULL, 0 },
96 { L"FloppyDiskPeripheral", L"*PNP0700\0", NULL, 0 },
97 { NULL, NULL, NULL, 0 }
98};
99
100/* FUNCTIONS *****************************************************************/
101
102static
103CODE_SEG("INIT")
104PWSTR
108{
109 ULONG i;
110 UNICODE_STRING CmpId;
111
112 for (i = 0; DeviceList[i].TypeName; i++)
113 {
114 RtlInitUnicodeString(&CmpId, DeviceList[i].TypeName);
115
116 if (RtlCompareUnicodeString(Value, &CmpId, FALSE) == 0)
117 break;
118 }
119
120 return DeviceList[i].PnPId;
121}
122
123static
124CODE_SEG("INIT")
125PWSTR
127 _In_ PUNICODE_STRING DetectId,
129 _Out_ PULONG DeviceIndex)
130{
131 ULONG i;
132 UNICODE_STRING CmpId;
133
134 if (!DetectId)
135 return NULL;
136
137 for (i = 0; PnPMap[i].DetectId; i++)
138 {
139 RtlInitUnicodeString(&CmpId, PnPMap[i].DetectId);
140
141 if (RtlCompareUnicodeString(DetectId, &CmpId, FALSE) == 0)
142 {
143 *DeviceIndex = PnPMap[i].Counter++;
144
145 if (PnPMap[i].PeripheralMap)
146 return IopMapPeripheralId(Value, PnPMap[i].PeripheralMap);
147 break;
148 }
149 }
150
151 return PnPMap[i].PnPId;
152}
153
154static
155CODE_SEG("INIT")
158 _In_ HANDLE hBaseKey,
159 _In_opt_ PUNICODE_STRING RelativePath,
160 _In_ HANDLE hRootKey,
161 _In_ BOOLEAN EnumerateSubKeys,
163 _In_opt_ ULONG BootResourcesLength,
164 _In_ PCM_FULL_RESOURCE_DESCRIPTOR ParentBootResources,
165 _In_ ULONG ParentBootResourcesLength)
166{
167 HANDLE hDevicesKey = NULL;
168 ULONG KeyIndex = 0;
169 PKEY_BASIC_INFORMATION pDeviceInformation = NULL;
170 ULONG DeviceInfoLength = sizeof(KEY_BASIC_INFORMATION) + 50 * sizeof(WCHAR);
172
173 if (!BootResources && RelativePath)
174 {
175 Status = IopOpenRegistryKeyEx(&hDevicesKey, hBaseKey, RelativePath, KEY_ENUMERATE_SUB_KEYS);
176
177 if (!NT_SUCCESS(Status))
178 {
179 DPRINT("ZwOpenKey() failed with status 0x%08lx\n", Status);
180 goto cleanup;
181 }
182 }
183 else
184 hDevicesKey = hBaseKey;
185
186 pDeviceInformation = ExAllocatePool(PagedPool, DeviceInfoLength);
187 if (!pDeviceInformation)
188 {
189 DPRINT("ExAllocatePool() failed\n");
191 goto cleanup;
192 }
193
194 while (TRUE)
195 {
197 HANDLE hDeviceKey = NULL;
198 HANDLE hLevel1Key, hLevel2Key = NULL, hLogConf;
199 UNICODE_STRING Level2NameU;
200 WCHAR Level2Name[5];
201 PKEY_VALUE_PARTIAL_INFORMATION pValueInformation = NULL;
202 ULONG ValueInfoLength = sizeof(KEY_VALUE_PARTIAL_INFORMATION) + 50 * sizeof(WCHAR);
205
206 UNICODE_STRING HardwareIdKey;
207 PWSTR pHardwareId;
208 ULONG DeviceIndex = 0;
209
210 Status = ZwEnumerateKey(hDevicesKey,
211 KeyIndex,
213 pDeviceInformation,
214 DeviceInfoLength,
215 &RequiredSize);
216
218 break;
220 {
221 ExFreePool(pDeviceInformation);
222 DeviceInfoLength = RequiredSize;
223 pDeviceInformation = ExAllocatePool(PagedPool, DeviceInfoLength);
224
225 if (!pDeviceInformation)
226 {
227 DPRINT("ExAllocatePool() failed\n");
229 goto cleanup;
230 }
231
232 Status = ZwEnumerateKey(hDevicesKey,
233 KeyIndex,
235 pDeviceInformation,
236 DeviceInfoLength,
237 &RequiredSize);
238 }
239
240 if (!NT_SUCCESS(Status))
241 {
242 DPRINT("ZwEnumerateKey() failed with status 0x%08lx\n", Status);
243 goto cleanup;
244 }
245 KeyIndex++;
246
247 /* Open device key */
248 DeviceName.Length = DeviceName.MaximumLength = (USHORT)pDeviceInformation->NameLength;
249 DeviceName.Buffer = pDeviceInformation->Name;
250
251 if (BootResources)
252 {
254 hDevicesKey,
255 &DeviceName,
256 hRootKey,
257 TRUE,
258 NULL,
259 0,
260 BootResources,
261 BootResourcesLength);
262
263 if (!NT_SUCCESS(Status))
264 goto cleanup;
265
266 continue;
267 }
268
269 pValueInformation = ExAllocatePool(PagedPool, ValueInfoLength);
270 if (!pValueInformation)
271 {
272 DPRINT("ExAllocatePool() failed\n");
274 goto cleanup;
275 }
276
277 Status = IopOpenRegistryKeyEx(&hDeviceKey, hDevicesKey, &DeviceName,
278 KEY_QUERY_VALUE + (EnumerateSubKeys ? KEY_ENUMERATE_SUB_KEYS : 0));
279
280 if (!NT_SUCCESS(Status))
281 {
282 DPRINT("ZwOpenKey() failed with status 0x%08lx\n", Status);
283 goto cleanup;
284 }
285
286 /* Read boot resources, and add then to parent ones */
287 Status = ZwQueryValueKey(hDeviceKey,
290 pValueInformation,
291 ValueInfoLength,
292 &RequiredSize);
293
295 {
296 ExFreePool(pValueInformation);
297 ValueInfoLength = RequiredSize;
298 pValueInformation = ExAllocatePool(PagedPool, ValueInfoLength);
299
300 if (!pValueInformation)
301 {
302 DPRINT("ExAllocatePool() failed\n");
303 ZwDeleteKey(hLevel2Key);
305 goto cleanup;
306 }
307
308 Status = ZwQueryValueKey(hDeviceKey,
311 pValueInformation,
312 ValueInfoLength,
313 &RequiredSize);
314 }
315
317 {
318 BootResources = ParentBootResources;
319 BootResourcesLength = ParentBootResourcesLength;
320 }
321 else if (!NT_SUCCESS(Status))
322 {
323 DPRINT("ZwQueryValueKey() failed with status 0x%08lx\n", Status);
324 goto nextdevice;
325 }
326 else if (pValueInformation->Type != REG_FULL_RESOURCE_DESCRIPTOR)
327 {
328 DPRINT("Wrong registry type: got 0x%lx, expected 0x%lx\n", pValueInformation->Type, REG_FULL_RESOURCE_DESCRIPTOR);
329 goto nextdevice;
330 }
331 else
332 {
333 static const ULONG Header = FIELD_OFFSET(CM_FULL_RESOURCE_DESCRIPTOR, PartialResourceList.PartialDescriptors);
334
335 /* Concatenate current resources and parent ones */
336 if (ParentBootResourcesLength == 0)
337 BootResourcesLength = pValueInformation->DataLength;
338 else
339 BootResourcesLength = ParentBootResourcesLength
340 + pValueInformation->DataLength
341 - Header;
342
343 BootResources = ExAllocatePool(PagedPool, BootResourcesLength);
344 if (!BootResources)
345 {
346 DPRINT("ExAllocatePool() failed\n");
347 goto nextdevice;
348 }
349
350 if (ParentBootResourcesLength < sizeof(CM_FULL_RESOURCE_DESCRIPTOR))
351 {
352 RtlCopyMemory(BootResources, pValueInformation->Data, pValueInformation->DataLength);
353 }
354 else if (ParentBootResources->PartialResourceList.PartialDescriptors[ParentBootResources->PartialResourceList.Count - 1].Type == CmResourceTypeDeviceSpecific)
355 {
356 RtlCopyMemory(BootResources, pValueInformation->Data, pValueInformation->DataLength);
358 (PVOID)((ULONG_PTR)BootResources + pValueInformation->DataLength),
359 (PVOID)((ULONG_PTR)ParentBootResources + Header),
360 ParentBootResourcesLength - Header);
361 BootResources->PartialResourceList.Count += ParentBootResources->PartialResourceList.Count;
362 }
363 else
364 {
365 RtlCopyMemory(BootResources, pValueInformation->Data, Header);
367 (PVOID)((ULONG_PTR)BootResources + Header),
368 (PVOID)((ULONG_PTR)ParentBootResources + Header),
369 ParentBootResourcesLength - Header);
371 (PVOID)((ULONG_PTR)BootResources + ParentBootResourcesLength),
372 pValueInformation->Data + Header,
373 pValueInformation->DataLength - Header);
374 BootResources->PartialResourceList.Count += ParentBootResources->PartialResourceList.Count;
375 }
376 }
377
378 if (EnumerateSubKeys)
379 {
381 hDeviceKey,
382 RelativePath,
383 hRootKey,
384 TRUE,
385 BootResources,
386 BootResourcesLength,
387 ParentBootResources,
388 ParentBootResourcesLength);
389
390 if (!NT_SUCCESS(Status))
391 goto cleanup;
392 }
393
394 /* Read identifier */
395 Status = ZwQueryValueKey(hDeviceKey,
398 pValueInformation,
399 ValueInfoLength,
400 &RequiredSize);
401
403 {
404 ExFreePool(pValueInformation);
405 ValueInfoLength = RequiredSize;
406 pValueInformation = ExAllocatePool(PagedPool, ValueInfoLength);
407
408 if (!pValueInformation)
409 {
410 DPRINT("ExAllocatePool() failed\n");
412 goto cleanup;
413 }
414
415 Status = ZwQueryValueKey(hDeviceKey,
418 pValueInformation,
419 ValueInfoLength,
420 &RequiredSize);
421 }
422
423 if (!NT_SUCCESS(Status))
424 {
426 {
427 DPRINT("ZwQueryValueKey() failed with status 0x%08lx\n", Status);
428 goto nextdevice;
429 }
430 ValueName.Length = ValueName.MaximumLength = 0;
431 }
432 else if (pValueInformation->Type != REG_SZ)
433 {
434 DPRINT("Wrong registry type: got 0x%lx, expected 0x%lx\n", pValueInformation->Type, REG_SZ);
435 goto nextdevice;
436 }
437 else
438 {
439 /* Assign hardware id to this device */
440 ValueName.Length = ValueName.MaximumLength = (USHORT)pValueInformation->DataLength;
441 ValueName.Buffer = (PWCHAR)pValueInformation->Data;
442 if (ValueName.Length >= sizeof(WCHAR) && ValueName.Buffer[ValueName.Length / sizeof(WCHAR) - 1] == UNICODE_NULL)
443 ValueName.Length -= sizeof(WCHAR);
444 }
445
446 pHardwareId = IopMapDetectedDeviceId(RelativePath, &ValueName, &DeviceIndex);
447 if (!pHardwareId)
448 {
449 /* Unknown key path */
450 DPRINT("Unknown key path '%wZ' value '%wZ'\n", RelativePath, &ValueName);
451 goto nextdevice;
452 }
453
454 /* Prepare hardware id key (hardware id value without final \0) */
455 HardwareIdKey.Length = (USHORT)wcslen(pHardwareId) * sizeof(WCHAR);
456 HardwareIdKey.MaximumLength = HardwareIdKey.Length + sizeof(UNICODE_NULL) * 2;
457 HardwareIdKey.Buffer = pHardwareId;
458
459 /* Add the detected device to Root key */
461
462 Status = ZwCreateKey(
463 &hLevel1Key,
466 0,
467 NULL,
469 NULL);
470
471 if (!NT_SUCCESS(Status))
472 {
473 DPRINT("ZwCreateKey() failed with status 0x%08lx\n", Status);
474 goto nextdevice;
475 }
476
477 _swprintf(Level2Name, L"%04lu", DeviceIndex);
478 RtlInitUnicodeString(&Level2NameU, Level2Name);
480
481 Status = ZwCreateKey(
482 &hLevel2Key,
485 0,
486 NULL,
488 NULL);
489
490 ZwClose(hLevel1Key);
491 if (!NT_SUCCESS(Status))
492 {
493 DPRINT("ZwCreateKey() failed with status 0x%08lx\n", Status);
494 goto nextdevice;
495 }
496
497 DPRINT("Found %wZ #%lu (%wZ)\n", &ValueName, DeviceIndex, &HardwareIdKey);
498 Status = ZwSetValueKey(hLevel2Key, &HardwareIDU, 0, REG_MULTI_SZ, HardwareIdKey.Buffer, HardwareIdKey.MaximumLength);
499
500 if (!NT_SUCCESS(Status))
501 {
502 DPRINT("ZwSetValueKey() failed with status 0x%08lx\n", Status);
503 ZwDeleteKey(hLevel2Key);
504 goto nextdevice;
505 }
506
507 /* Create 'LogConf' subkey */
509
510 Status = ZwCreateKey(
511 &hLogConf,
514 0,
515 NULL,
517 NULL);
518
519 if (!NT_SUCCESS(Status))
520 {
521 DPRINT("ZwCreateKey() failed with status 0x%08lx\n", Status);
522 ZwDeleteKey(hLevel2Key);
523 goto nextdevice;
524 }
525
526 if (BootResourcesLength >= sizeof(CM_FULL_RESOURCE_DESCRIPTOR))
527 {
528 PUCHAR CmResourceList;
529 ULONG ListCount;
530
531 CmResourceList = ExAllocatePool(PagedPool, BootResourcesLength + sizeof(ULONG));
532 if (!CmResourceList)
533 {
534 ZwClose(hLogConf);
535 ZwDeleteKey(hLevel2Key);
536 goto nextdevice;
537 }
538
539 /* Add the list count (1st member of CM_RESOURCE_LIST) */
540 ListCount = 1;
541 RtlCopyMemory(CmResourceList,
542 &ListCount,
543 sizeof(ULONG));
544
545 /* Now add the actual list (2nd member of CM_RESOURCE_LIST) */
546 RtlCopyMemory(CmResourceList + sizeof(ULONG),
547 BootResources,
548 BootResourcesLength);
549
550 /* Save boot resources to 'LogConf\BootConfig' */
551 Status = ZwSetValueKey(hLogConf,
553 0,
555 CmResourceList,
556 BootResourcesLength + sizeof(ULONG));
557
558 ExFreePool(CmResourceList);
559
560 if (!NT_SUCCESS(Status))
561 {
562 DPRINT("ZwSetValueKey() failed with status 0x%08lx\n", Status);
563 ZwClose(hLogConf);
564 ZwDeleteKey(hLevel2Key);
565 goto nextdevice;
566 }
567 }
568 ZwClose(hLogConf);
569
570nextdevice:
571 if (BootResources && BootResources != ParentBootResources)
572 {
573 ExFreePool(BootResources);
574 BootResources = NULL;
575 }
576 if (hLevel2Key)
577 {
578 ZwClose(hLevel2Key);
579 hLevel2Key = NULL;
580 }
581 if (hDeviceKey)
582 {
583 ZwClose(hDeviceKey);
584 hDeviceKey = NULL;
585 }
586 if (pValueInformation)
587 ExFreePool(pValueInformation);
588 }
589
591
592cleanup:
593 if (hDevicesKey && hDevicesKey != hBaseKey)
594 ZwClose(hDevicesKey);
595 if (pDeviceInformation)
596 ExFreePool(pDeviceInformation);
597
598 return Status;
599}
600
601static
602CODE_SEG("INIT")
605{
606 UNICODE_STRING KeyPathU = RTL_CONSTANT_STRING(L"\\Registry\\Machine\\SYSTEM\\CURRENTCONTROLSET\\Control\\Pnp");
607 UNICODE_STRING KeyNameU = RTL_CONSTANT_STRING(L"DisableFirmwareMapper");
609 HANDLE hPnpKey;
610 PKEY_VALUE_PARTIAL_INFORMATION KeyInformation;
611 ULONG DesiredLength, Length;
612 ULONG KeyValue = 0;
614
616 Status = ZwOpenKey(&hPnpKey, KEY_QUERY_VALUE, &ObjectAttributes);
617 if (NT_SUCCESS(Status))
618 {
619 Status = ZwQueryValueKey(hPnpKey,
620 &KeyNameU,
622 NULL,
623 0,
624 &DesiredLength);
627 {
628 Length = DesiredLength;
629 KeyInformation = ExAllocatePool(PagedPool, Length);
630 if (KeyInformation)
631 {
632 Status = ZwQueryValueKey(hPnpKey,
633 &KeyNameU,
635 KeyInformation,
636 Length,
637 &DesiredLength);
638 if (NT_SUCCESS(Status) && KeyInformation->DataLength == sizeof(ULONG))
639 {
640 KeyValue = (ULONG)(*KeyInformation->Data);
641 }
642 else
643 {
644 DPRINT1("ZwQueryValueKey(%wZ%wZ) failed\n", &KeyPathU, &KeyNameU);
645 }
646
647 ExFreePool(KeyInformation);
648 }
649 else
650 {
651 DPRINT1("Failed to allocate memory for registry query\n");
652 }
653 }
654 else
655 {
656 DPRINT1("ZwQueryValueKey(%wZ%wZ) failed with status 0x%08lx\n", &KeyPathU, &KeyNameU, Status);
657 }
658
659 ZwClose(hPnpKey);
660 }
661 else
662 {
663 DPRINT1("ZwOpenKey(%wZ) failed with status 0x%08lx\n", &KeyPathU, Status);
664 }
665
666 DPRINT("Firmware mapper is %s\n", KeyValue != 0 ? "disabled" : "enabled");
667
668 return (KeyValue != 0) ? TRUE : FALSE;
669}
670
671CODE_SEG("INIT")
673NTAPI
675{
676 UNICODE_STRING EnumU = RTL_CONSTANT_STRING(L"\\Registry\\Machine\\SYSTEM\\CurrentControlSet\\Enum");
677 UNICODE_STRING RootPathU = RTL_CONSTANT_STRING(L"Root");
678 UNICODE_STRING MultiKeyPathU = RTL_CONSTANT_STRING(L"\\Registry\\Machine\\HARDWARE\\DESCRIPTION\\System\\MultifunctionAdapter");
680 HANDLE hEnum, hRoot;
682
685 if (!NT_SUCCESS(Status))
686 {
687 DPRINT1("ZwCreateKey() failed with status 0x%08lx\n", Status);
688 return Status;
689 }
690
693 ZwClose(hEnum);
694 if (!NT_SUCCESS(Status))
695 {
696 DPRINT1("ZwOpenKey() failed with status 0x%08lx\n", Status);
697 return Status;
698 }
699
701 {
702 Status = IopOpenRegistryKeyEx(&hEnum, NULL, &MultiKeyPathU, KEY_ENUMERATE_SUB_KEYS);
703 if (!NT_SUCCESS(Status))
704 {
705 /* Nothing to do, don't return with an error status */
706 DPRINT("ZwOpenKey() failed with status 0x%08lx\n", Status);
707 ZwClose(hRoot);
708 return STATUS_SUCCESS;
709 }
711 hEnum,
712 NULL,
713 hRoot,
714 TRUE,
715 NULL,
716 0,
717 NULL,
718 0);
719 ZwClose(hEnum);
720 }
721 else
722 {
723 /* Enumeration is disabled */
725 }
726
727 ZwClose(hRoot);
728
729 return Status;
730}
#define CODE_SEG(...)
unsigned char BOOLEAN
Definition: actypes.h:127
LONG NTSTATUS
Definition: precomp.h:26
#define DPRINT1
Definition: precomp.h:8
Definition: Header.h:9
DATA_SEG("INITDATA")
Definition: cmdata.c:73
IN PUNICODE_STRING IN POBJECT_ATTRIBUTES ObjectAttributes
Definition: conport.c:36
#define STATUS_NO_MEMORY
Definition: d3dkmdt.h:51
#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 RTL_CONSTANT_STRING(s)
Definition: combase.c:35
static void cleanup(void)
Definition: main.c:1335
PDEVICE_LIST DeviceList
Definition: utils.c:27
_ACRTIMP size_t __cdecl wcslen(const wchar_t *)
Definition: wcs.c:2988
#define L(x)
Definition: resources.c:13
ULONG RtlCompareUnicodeString(PUNICODE_STRING s1, PUNICODE_STRING s2, BOOLEAN UpCase)
Definition: string_lib.cpp:31
#define ExFreePool(addr)
Definition: env_spec_w32.h:352
#define PagedPool
Definition: env_spec_w32.h:308
#define ExAllocatePool(type, size)
Definition: fbtusb.h:44
Status
Definition: gdiplustypes.h:24
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
#define REG_SZ
Definition: layer.c:22
if(dx< 0)
Definition: linetemp.h:194
#define _swprintf(buf, format,...)
Definition: sprintf.c:56
static HTREEITEM hRoot
Definition: treeview.c:383
#define InitializeObjectAttributes(p, n, a, r, s)
Definition: reg.c:115
NTSYSAPI NTSTATUS NTAPI ZwClose(_In_ HANDLE Handle)
#define _Out_
Definition: no_sal2.h:160
#define _In_
Definition: no_sal2.h:158
#define _In_opt_
Definition: no_sal2.h:212
@ KeyBasicInformation
Definition: nt_native.h:1134
@ KeyValuePartialInformation
Definition: nt_native.h:1185
struct _KEY_BASIC_INFORMATION KEY_BASIC_INFORMATION
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
#define KEY_CREATE_SUB_KEY
Definition: nt_native.h:1021
#define REG_OPTION_NON_VOLATILE
Definition: nt_native.h:1060
#define REG_RESOURCE_LIST
Definition: nt_native.h:1505
#define KEY_QUERY_VALUE
Definition: nt_native.h:1019
struct _KEY_VALUE_PARTIAL_INFORMATION KEY_VALUE_PARTIAL_INFORMATION
#define REG_MULTI_SZ
Definition: nt_native.h:1504
#define KEY_ENUMERATE_SUB_KEYS
Definition: nt_native.h:1022
#define REG_OPTION_VOLATILE
Definition: nt_native.h:1063
#define KEY_SET_VALUE
Definition: nt_native.h:1020
#define REG_FULL_RESOURCE_DESCRIPTOR
Definition: nt_native.h:1506
#define UNICODE_NULL
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:102
NTSTATUS NTAPI IopOpenRegistryKeyEx(PHANDLE KeyHandle, HANDLE ParentKey, PUNICODE_STRING Name, ACCESS_MASK DesiredAccess)
Definition: pnpmgr.c:885
#define STATUS_NO_MORE_ENTRIES
Definition: ntstatus.h:285
short WCHAR
Definition: pedump.c:58
unsigned short USHORT
Definition: pedump.c:61
struct _PNP_DETECT_IDENTIFIER_MAP PNP_DETECT_IDENTIFIER_MAP
static UNICODE_STRING ConfigurationDataU
Definition: pnpmap.c:35
static NTSTATUS IopEnumerateDetectedDevices(_In_ HANDLE hBaseKey, _In_opt_ PUNICODE_STRING RelativePath, _In_ HANDLE hRootKey, _In_ BOOLEAN EnumerateSubKeys, _In_opt_ PCM_FULL_RESOURCE_DESCRIPTOR BootResources, _In_opt_ ULONG BootResourcesLength, _In_ PCM_FULL_RESOURCE_DESCRIPTOR ParentBootResources, _In_ ULONG ParentBootResourcesLength)
Definition: pnpmap.c:157
static UNICODE_STRING LogConfU
Definition: pnpmap.c:37
static UNICODE_STRING BootConfigU
Definition: pnpmap.c:36
static PNP_DETECT_IDENTIFIER_MAP PnPMap[]
Definition: pnpmap.c:88
static PNP_MAPPER_DEVICE_ID KeyboardMap[]
Definition: pnpmap.c:45
static PNP_MAPPER_DEVICE_ID PointerMap[]
Definition: pnpmap.c:69
static UNICODE_STRING IdentifierU
Definition: pnpmap.c:33
static PWSTR IopMapDetectedDeviceId(_In_ PUNICODE_STRING DetectId, _In_ PUNICODE_STRING Value, _Out_ PULONG DeviceIndex)
Definition: pnpmap.c:126
NTSTATUS NTAPI IopUpdateRootKey(VOID)
Definition: pnpmap.c:674
static BOOLEAN IopIsFirmwareMapperDisabled(VOID)
Definition: pnpmap.c:604
struct _PNP_MAPPER_DEVICE_ID * PPNP_MAPPER_DEVICE_ID
struct _PNP_MAPPER_DEVICE_ID PNP_MAPPER_DEVICE_ID
static PWSTR IopMapPeripheralId(_In_ PCUNICODE_STRING Value, _In_ PPNP_MAPPER_DEVICE_ID DeviceList)
Definition: pnpmap.c:105
static UNICODE_STRING HardwareIDU
Definition: pnpmap.c:34
#define OBJ_KERNEL_HANDLE
Definition: winternl.h:231
#define OBJ_CASE_INSENSITIVE
Definition: winternl.h:228
#define CmResourceTypeDeviceSpecific
Definition: restypes.h:108
#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
PPNP_MAPPER_DEVICE_ID PeripheralMap
Definition: pnpmap.c:27
USHORT MaximumLength
Definition: env_spec_w32.h:370
uint16_t * PWSTR
Definition: typedefs.h:56
uint32_t * PULONG
Definition: typedefs.h:59
const uint16_t * PCWSTR
Definition: typedefs.h:57
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:255
#define NTAPI
Definition: typedefs.h:36
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263
uint32_t ULONG_PTR
Definition: typedefs.h:65
uint16_t * PWCHAR
Definition: typedefs.h:56
unsigned char * PUCHAR
Definition: typedefs.h:53
uint32_t ULONG
Definition: typedefs.h:59
#define STATUS_OBJECT_NAME_NOT_FOUND
Definition: udferr_usr.h:149
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ ULONG _Out_ PVOID _Out_ PULONG RequiredSize
Definition: wdfdevice.h:4445
_Must_inspect_result_ _In_ PWDFDEVICE_INIT _In_opt_ PCUNICODE_STRING DeviceName
Definition: wdfdevice.h:3281
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING ValueName
Definition: wdfregistry.h:243
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING _Out_opt_ PUSHORT _Inout_opt_ PUNICODE_STRING Value
Definition: wdfregistry.h:413