* Returns a list of device interfaces of a particular device interface class.
*
* Parameters
- * InterfaceClassGuid
+ * InterfaceClassGuid
* Points to a class GUID specifying the device interface class.
*
- * PhysicalDeviceObject
+ * PhysicalDeviceObject
* Points to an optional PDO that narrows the search to only the
- * device interfaces of the device represented by the PDO.
+ * device interfaces of the device represented by the PDO.
*
- * Flags
+ * Flags
* Specifies flags that modify the search for device interfaces. The
* DEVICE_INTERFACE_INCLUDE_NONACTIVE flag specifies that the list of
* returned symbolic links should contain also disabled device
- * interfaces in addition to the enabled ones.
+ * interfaces in addition to the enabled ones.
*
- * SymbolicLinkList
+ * SymbolicLinkList
* Points to a character pointer that is filled in on successful return
* with a list of unicode strings identifying the device interfaces
* that match the search criteria. The newly allocated buffer contains
* a list of symbolic link names. Each unicode string in the list is
* null-terminated; the end of the whole list is marked by an additional
* NULL. The caller is responsible for freeing the buffer (ExFreePool)
- * when it is no longer needed.
+ * when it is no longer needed.
* If no device interfaces match the search criteria, this routine
* returns STATUS_SUCCESS and the string contains a single NULL
- * character.
+ * character.
*
* Status
* @unimplemented
ULONG i = 0;
ULONG j = 0;
OBJECT_ATTRIBUTES ObjectAttributes;
-
+
Status = RtlStringFromGUID(InterfaceClassGuid, &GuidString);
if (!NT_SUCCESS(Status))
{
}
DPRINT("IoGetDeviceInterfaces() called with PDO, not implemented.\n");
- return STATUS_NOT_IMPLEMENTED;
+ return STATUS_NOT_IMPLEMENTED;
}
else
- {
+ {
InitializeObjectAttributes(
&ObjectAttributes,
&BaseKeyName,
OBJ_CASE_INSENSITIVE,
NULL,
NULL);
-
+
Status = ZwOpenKey(
&InterfaceKey,
KEY_READ,
fip,
Size,
&Size);
-
+
if (!NT_SUCCESS(Status))
{
DPRINT("ZwQueryKey() Failed. (0x%X)\n", Status);
bip = (PKEY_BASIC_INFORMATION)ExAllocatePool(NonPagedPool, Size);
ASSERT(bip != NULL);
-
+
Status = ZwEnumerateKey(
InterfaceKey,
i,
bip,
Size,
&Size);
-
+
if (!NT_SUCCESS(Status))
{
DPRINT("ZwEnumerateKey() Failed.(0x%X)\n", Status);
ZwClose(InterfaceKey);
return Status;
}
-
+
SubKeyName.Length = 0;
SubKeyName.MaximumLength = BaseKeyName.Length + bip->NameLength + sizeof(WCHAR);
SubKeyName.Buffer = ExAllocatePool(NonPagedPool, SubKeyName.MaximumLength);
bfip,
Size,
&Size);
-
+
if (!NT_SUCCESS(Status))
{
DPRINT("ZwQueryKey() Failed. (0x%X)\n", Status);
ZwClose(InterfaceKey);
return Status;
}
-
+
for(j = 0; j < bfip->SubKeys; j++)
{
Status = ZwEnumerateKey(
ZwClose(InterfaceKey);
return Status;
}
-
+
if (!wcsncmp(bip->Name, L"Control", bip->NameLength))
{
continue;
}
-
+
SymbolicLinkKeyName.Length = 0;
SymbolicLinkKeyName.MaximumLength = SubKeyName.Length + bip->NameLength + sizeof(WCHAR);
SymbolicLinkKeyName.Buffer = ExAllocatePool(NonPagedPool, SymbolicLinkKeyName.MaximumLength);
ASSERT(ControlKeyName.Buffer != NULL);
RtlCopyUnicodeString(&ControlKeyName, &SymbolicLinkKeyName);
RtlAppendUnicodeStringToString(&ControlKeyName, &Control);
-
+
ExFreePool(bip);
InitializeObjectAttributes(
}
Status = ZwQueryValueKey(
- SymbolicLinkKey,
- &SymbolicLink,
+ SymbolicLinkKey,
+ &SymbolicLink,
KeyValuePartialInformation,
NULL,
0,
&Size);
-
+
if (Status == STATUS_OBJECT_NAME_NOT_FOUND)
continue;
-
+
if (Status != STATUS_BUFFER_TOO_SMALL)
{
DPRINT("ZwQueryValueKey() Failed.(0x%X)\n", Status);
Status = RtlCheckRegistryKey(RTL_REGISTRY_ABSOLUTE, ControlKeyName.Buffer);
if (NT_SUCCESS(Status))
- {
+ {
/* Put the name in the string here */
if (SymLinkList == NULL)
{
RtlCopyMemory(SymLinkListPtr, vpip->Data, vpip->DataLength);
SymLinkListPtr[vpip->DataLength / sizeof(WCHAR)] = 0;
SymLinkListPtr[1] = '?';
- }
+ }
}
RtlFreeUnicodeString(&SymbolicLinkKeyName);
}
*SymbolicLinkList = SymLinkList;
-
+
RtlFreeUnicodeString(&BaseKeyName);
ZwClose(InterfaceKey);
ExFreePool(bfip);