458{
474 ULONG i = 0,
j,
Size, NeededLength, ActualLength, LinkedValue;
477
479
481 {
482
484
485
487 {
490 }
491
492
493 if (DeviceObjectExtension->
DeviceNode->InstancePath.Length == 0)
494 {
497 }
498
499 InstanceDevicePath = &DeviceObjectExtension->
DeviceNode->InstancePath;
500 }
501
502
505 {
506 DPRINT(
"IopOpenInterfaceKey() failed with status 0x%08lx\n",
Status);
508 }
509
510
512 {
514 InterfaceKey,
518 0,
521 {
522 break;
523 }
525 {
526 DPRINT(
"ZwEnumerateKey() failed with status 0x%08lx\n",
Status);
528 }
529
531 if (!DeviceBi)
532 {
533 DPRINT(
"ExAllocatePool() failed\n");
536 }
538 InterfaceKey,
541 DeviceBi,
545 {
546 DPRINT(
"ZwEnumerateKey() failed with status 0x%08lx\n",
Status);
548 }
549
550
557 InterfaceKey,
560 &DeviceKey,
564 {
565 DPRINT(
"ZwOpenKey() failed with status 0x%08lx\n",
Status);
567 }
568
570 {
571
572
573
577 {
578 ActualLength = NeededLength;
580 if (!PartialInfo)
581 {
584 }
585
588 {
592 }
594 {
596 {
597
598 FoundRightPDO =
TRUE;
599 }
600 }
603 if (!FoundRightPDO)
604 {
605
606 continue;
607 }
608 }
609 else
610 {
611
612 break;
613 }
614 }
615
616
619 {
621 DeviceKey,
625 0,
628 {
629 break;
630 }
632 {
633 DPRINT(
"ZwEnumerateKey() failed with status 0x%08lx\n",
Status);
635 }
636
638 if (!ReferenceBi)
639 {
640 DPRINT(
"ExAllocatePool() failed\n");
643 }
645 DeviceKey,
648 ReferenceBi,
652 {
653 DPRINT(
"ZwEnumerateKey() failed with status 0x%08lx\n",
Status);
655 }
656
660 {
661
662 goto NextReferenceString;
663 }
664
665
670 DeviceKey,
673 &ReferenceKey,
677 {
678 DPRINT(
"ZwOpenKey() failed with status 0x%08lx\n",
Status);
680 }
681
683 {
684
685
686
691 ReferenceKey,
694 &ControlKey,
698 {
699
700
701
702 goto NextReferenceString;
703 }
705 {
708 }
709
711 Status = ZwQueryValueKey(ControlKey,
715 0,
716 &NeededLength);
718 {
719 ActualLength = NeededLength;
721 if (!PartialInfo)
722 {
725 }
726
727 Status = ZwQueryValueKey(ControlKey,
730 PartialInfo,
731 ActualLength,
732 &NeededLength);
734 {
738 }
739
741 {
742 DPRINT1(
"Bad registry read\n");
745 }
746
750
752 if (LinkedValue == 0)
753 {
754
755 goto NextReferenceString;
756 }
757 }
758 else
759 {
762 }
763 }
764
765
767 ReferenceKey,
771 0,
774 {
775 DPRINT(
"ZwQueryValueKey() failed with status 0x%08lx\n",
Status);
777 }
779 if (!bip)
780 {
781 DPRINT(
"ExAllocatePool() failed\n");
784 }
786 ReferenceKey,
789 bip,
793 {
794 DPRINT(
"ZwQueryValueKey() failed with status 0x%08lx\n",
Status);
796 }
798 {
799 DPRINT(
"Unexpected registry type 0x%lx (expected 0x%lx)\n", bip->
Type,
REG_SZ);
802 }
804 {
805 DPRINT(
"Registry string too short (length %lu, expected %lu at least)\n", bip->
DataLength, 5 *
sizeof(
WCHAR));
808 }
811
812
814
815
817 {
824 if (!NewBuffer)
825 {
826 DPRINT(
"ExAllocatePool() failed\n");
829 }
831 {
834 }
835 ReturnBuffer.
Buffer = NewBuffer;
836 }
840 {
841 DPRINT(
"RtlAppendUnicodeStringToString() failed with status 0x%08lx\n",
Status);
843 }
844
845
846
847
849
850NextReferenceString:
853 if (bip)
856 if (ReferenceKey !=
NULL)
857 {
860 }
861 if (ControlKey !=
NULL)
862 {
865 }
866 }
867 if (FoundRightPDO)
868 {
869
870 break;
871 }
872
877 }
878
879
882 {
886 if (!NewBuffer)
887 {
888 DPRINT(
"ExAllocatePool() failed\n");
891 }
893 {
896 }
897 ReturnBuffer.
Buffer = NewBuffer;
898 }
902
906 if (InterfaceKey !=
NULL)
908 if (DeviceKey !=
NULL)
910 if (ReferenceKey !=
NULL)
912 if (ControlKey !=
NULL)
914 if (DeviceBi)
916 if (ReferenceBi)
918 if (bip)
921}
PDEVICE_OBJECT PhysicalDeviceObject
IN PUNICODE_STRING IN POBJECT_ATTRIBUTES ObjectAttributes
#define NT_SUCCESS(StatCode)
static void cleanup(void)
static const WCHAR SymbolicLink[]
#define RtlCompareMemory(s1, s2, l)
#define ExAllocatePool(type, size)
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
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 GLint GLint j
#define OBJ_KERNEL_HANDLE
#define OBJ_CASE_INSENSITIVE
#define InitializeObjectAttributes(p, n, a, r, s)
struct _EXTENDED_DEVOBJ_EXTENSION * PEXTENDED_DEVOBJ_EXTENSION
NTSYSAPI NTSTATUS NTAPI ZwClose(_In_ HANDLE Handle)
@ KeyValuePartialInformation
NTSYSAPI NTSTATUS NTAPI RtlAppendUnicodeStringToString(PUNICODE_STRING Destination, PUNICODE_STRING Source)
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
NTSYSAPI BOOLEAN NTAPI RtlEqualUnicodeString(PUNICODE_STRING String1, PUNICODE_STRING String2, BOOLEAN CaseInSensitive)
#define KEY_ENUMERATE_SUB_KEYS
static NTSTATUS IopOpenInterfaceKey(IN CONST GUID *InterfaceClassGuid, IN ACCESS_MASK DesiredAccess, OUT HANDLE *pInterfaceKey)
#define STATUS_NO_MORE_ENTRIES
#define STATUS_BUFFER_TOO_SMALL
struct _DEVICE_NODE * DeviceNode
#define RTL_CONSTANT_STRING(s)
#define RtlCopyMemory(Destination, Source, Length)
#define STATUS_INVALID_DEVICE_REQUEST
#define STATUS_UNSUCCESSFUL
#define STATUS_INSUFFICIENT_RESOURCES
#define STATUS_OBJECT_NAME_NOT_FOUND
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
_Must_inspect_result_ _In_ WDFDEVICE _In_ PCUNICODE_STRING KeyName
_In_ WDF_WMI_PROVIDER_CONTROL Control
_Must_inspect_result_ _In_ ULONG Flags
_In_opt_ PDEVICE_OBJECT _In_ ULONG _Outptr_result_nullonfailure_ _At_ * SymbolicLinkList(return==0, __drv_allocatesMem(Mem))) PZZWSTR *SymbolicLinkList
_In_ CONST GUID * InterfaceClassGuid
#define DEVICE_INTERFACE_INCLUDE_NONACTIVE