Irp->IoStatus.Information = IoStatusBlock.Information = 0;
/* Special case for IRP_MN_FILTER_RESOURCE_REQUIREMENTS */
- if (IoStackLocation->MinorFunction == IRP_MN_FILTER_RESOURCE_REQUIREMENTS)
+ if ((IoStackLocation->MajorFunction == IRP_MJ_PNP) &&
+ (IoStackLocation->MinorFunction == IRP_MN_FILTER_RESOURCE_REQUIREMENTS))
{
/* Copy the resource requirements list into the IOSB */
Irp->IoStatus.Information =
}
/* 1. Try to retrieve ParentIdPrefix from registry */
- KeyNameBufferLength = FIELD_OFFSET(KEY_VALUE_PARTIAL_INFORMATION, Data[0]) + MAX_PATH * sizeof(WCHAR);
+ KeyNameBufferLength = FIELD_OFFSET(KEY_VALUE_PARTIAL_INFORMATION, Data) + sizeof(L"12345678&12345678");
ParentIdPrefixInformation = ExAllocatePoolWithTag(PagedPool,
KeyNameBufferLength + sizeof(UNICODE_NULL),
TAG_IO);
if (!(DeviceNode->Flags & (DNF_DISABLED | DNF_STARTED | DNF_ADDED)))
{
- WCHAR RegKeyBuffer[MAX_PATH];
UNICODE_STRING RegKey;
/* Install the service for this if it's in the CDDB */
IopInstallCriticalDevice(DeviceNode);
- RegKey.Length = 0;
- RegKey.MaximumLength = sizeof(RegKeyBuffer);
- RegKey.Buffer = RegKeyBuffer;
-
/*
* Retrieve configuration from Enum key
*/
QueryTable[1].DefaultData = L"";
QueryTable[1].DefaultLength = 0;
- RtlAppendUnicodeToString(&RegKey, L"\\Registry\\Machine\\System\\CurrentControlSet\\Enum\\");
+ RegKey.Length = 0;
+ RegKey.MaximumLength = sizeof(ENUM_ROOT) + sizeof(WCHAR) + DeviceNode->InstancePath.Length;
+ RegKey.Buffer = ExAllocatePoolWithTag(PagedPool,
+ RegKey.MaximumLength,
+ TAG_IO);
+ if (RegKey.Buffer == NULL)
+ {
+ IopDeviceNodeSetFlag(DeviceNode, DNF_DISABLED);
+ return STATUS_INSUFFICIENT_RESOURCES;
+ }
+
+ RtlAppendUnicodeToString(&RegKey, ENUM_ROOT);
+ RtlAppendUnicodeToString(&RegKey, L"\\");
RtlAppendUnicodeStringToString(&RegKey, &DeviceNode->InstancePath);
Status = RtlQueryRegistryValues(RTL_REGISTRY_ABSOLUTE,
RegKey.Buffer, QueryTable, NULL, NULL);
+ ExFreePoolWithTag(RegKey.Buffer, TAG_IO);
if (!NT_SUCCESS(Status))
{
return IopTraverseDeviceTree(&Context);
}
-static NTSTATUS INIT_FUNCTION
+static
+INIT_FUNCTION
+NTSTATUS
IopEnumerateDetectedDevices(
IN HANDLE hBaseKey,
IN PUNICODE_STRING RelativePath OPTIONAL,
return Status;
}
-static BOOLEAN INIT_FUNCTION
+static
+INIT_FUNCTION
+BOOLEAN
IopIsFirmwareMapperDisabled(VOID)
{
UNICODE_STRING KeyPathU = RTL_CONSTANT_STRING(L"\\Registry\\Machine\\SYSTEM\\CURRENTCONTROLSET\\Control\\Pnp");
return (KeyValue != 0) ? TRUE : FALSE;
}
+INIT_FUNCTION
NTSTATUS
NTAPI
-INIT_FUNCTION
IopUpdateRootKey(VOID)
{
UNICODE_STRING EnumU = RTL_CONSTANT_STRING(L"\\Registry\\Machine\\SYSTEM\\CurrentControlSet\\Enum");