#include <ntoskrnl.h>
#define NDEBUG
-#include <internal/debug.h>
+#include <debug.h>
-//#define ENABLE_ACPI
+#define ENABLE_ACPI
/* GLOBALS *******************************************************************/
/* DATA **********************************************************************/
PDRIVER_OBJECT IopRootDriverObject;
+FAST_MUTEX IopBusTypeGuidListLock;
PIO_BUS_TYPE_GUID_LIST IopBusTypeGuidList = NULL;
#if defined (ALLOC_PRAGMA)
{
/* FIXME: What do we do? Unload the driver or just disable the device? */
DPRINT1("An FDO was not attached\n");
+ ObDereferenceObject(Fdo);
IopDeviceNodeSetFlag(DeviceNode, DNF_DISABLED);
return STATUS_UNSUCCESSFUL;
}
PVOID NewList;
/* Acquire the lock */
- ExAcquireFastMutex(&IopBusTypeGuidList->Lock);
+ ExAcquireFastMutex(&IopBusTypeGuidListLock);
/* Loop all entries */
while (i < IopBusTypeGuidList->GuidCount)
/* Allocate the new copy */
NewList = ExAllocatePool(PagedPool, NewSize);
+ if (!NewList) {
+ /* Fail */
+ ExFreePool(IopBusTypeGuidList);
+ goto Quickie;
+ }
+
/* Now copy them, decrease the size too */
NewSize -= sizeof(GUID);
RtlCopyMemory(NewList, IopBusTypeGuidList, NewSize);
IopBusTypeGuidList->GuidCount++;
Quickie:
- ExReleaseFastMutex(&IopBusTypeGuidList->Lock);
+ ExReleaseFastMutex(&IopBusTypeGuidListLock);
return FoundIndex;
}
((PEXTENDED_DEVOBJ_EXTENSION)PhysicalDeviceObject->DeviceObjectExtension)->DeviceNode = Node;
- if (ParentNode)
- {
- KeAcquireSpinLock(&IopDeviceTreeLock, &OldIrql);
- Node->Parent = ParentNode;
- Node->NextSibling = ParentNode->Child;
- if (ParentNode->Child != NULL)
- {
- ParentNode->Child->PrevSibling = Node;
- }
- ParentNode->Child = Node;
- KeReleaseSpinLock(&IopDeviceTreeLock, OldIrql);
- Node->Level = ParentNode->Level + 1;
- }
+ if (ParentNode)
+ {
+ KeAcquireSpinLock(&IopDeviceTreeLock, &OldIrql);
+ Node->Parent = ParentNode;
+ Node->Sibling = ParentNode->Child;
+ ParentNode->Child = Node;
+ if (ParentNode->LastChild == NULL)
+ ParentNode->LastChild = Node;
+ KeReleaseSpinLock(&IopDeviceTreeLock, OldIrql);
+ Node->Level = ParentNode->Level + 1;
+ }
+
+ PhysicalDeviceObject->Flags &= ~DO_DEVICE_INITIALIZING;
*DeviceNode = Node;
IopFreeDeviceNode(PDEVICE_NODE DeviceNode)
{
KIRQL OldIrql;
+ PDEVICE_NODE PrevSibling = NULL;
/* All children must be deleted before a parent is deleted */
ASSERT(!DeviceNode->Child);
ObDereferenceObject(DeviceNode->PhysicalDeviceObject);
- /* Unlink from parent if it exists */
-
- if ((DeviceNode->Parent) && (DeviceNode->Parent->Child == DeviceNode))
- {
- DeviceNode->Parent->Child = DeviceNode->NextSibling;
- }
-
- /* Unlink from sibling list */
+ /* Get previous sibling */
+ if (DeviceNode->Parent && DeviceNode->Parent->Child != DeviceNode)
+ {
+ PrevSibling = DeviceNode->Parent->Child;
+ while (PrevSibling->Sibling != DeviceNode)
+ PrevSibling = PrevSibling->Sibling;
+ }
- if (DeviceNode->PrevSibling)
- {
- DeviceNode->PrevSibling->NextSibling = DeviceNode->NextSibling;
- }
+ /* Unlink from parent if it exists */
+ if (DeviceNode->Parent)
+ {
+ if (DeviceNode->Parent->LastChild == DeviceNode)
+ {
+ DeviceNode->Parent->LastChild = PrevSibling;
+ if (PrevSibling)
+ PrevSibling->Sibling = NULL;
+ }
+ if (DeviceNode->Parent->Child == DeviceNode)
+ DeviceNode->Parent->Child = DeviceNode->Sibling;
+ }
- if (DeviceNode->NextSibling)
- {
- DeviceNode->NextSibling->PrevSibling = DeviceNode->PrevSibling;
- }
+ /* Unlink from sibling list */
+ if (PrevSibling)
+ PrevSibling->Sibling = DeviceNode->Sibling;
KeReleaseSpinLock(&IopDeviceTreeLock, OldIrql);
Irp->IoStatus.Status = STATUS_NOT_SUPPORTED;
Irp->IoStatus.Information = 0;
+ if (MinorFunction == IRP_MN_FILTER_RESOURCE_REQUIREMENTS)
+ {
+ Irp->IoStatus.Information = (ULONG_PTR)Stack->Parameters.FilterResourceRequirements.IoResourceRequirementList;
+ }
+
IrpSp = IoGetNextIrpStackLocation(Irp);
IrpSp->MinorFunction = (UCHAR)MinorFunction;
/* Traversal of all children nodes */
for (ChildDeviceNode = ParentDeviceNode->Child;
ChildDeviceNode != NULL;
- ChildDeviceNode = ChildDeviceNode->NextSibling)
+ ChildDeviceNode = ChildDeviceNode->Sibling)
{
/* Pass the current device node to the action routine */
Context->DeviceNode = ChildDeviceNode;
&KeyName,
0,
REG_RESOURCE_LIST,
- &DeviceNode->BootResources,
+ DeviceNode->BootResources,
ListSize);
}
}
0x3c /* PCI_INTERRUPT_LINE */,
sizeof(UCHAR));
if (ret == 0 || ret == 2)
- KEBUGCHECK(0);
+ ASSERT(FALSE);
}
}
}
{
case CmResourceTypePort:
{
- ULONG AddressSpace = 0; /* IO space */
+ ULONG AddressSpace = 1; /* IO space */
if (!HalTranslateBusAddress(
DeviceNode->ResourceList->List[i].InterfaceType,
DeviceNode->ResourceList->List[i].BusNumber,
}
case CmResourceTypeMemory:
{
- ULONG AddressSpace = 1; /* Memory space */
+ ULONG AddressSpace = 0; /* Memory space */
if (!HalTranslateBusAddress(
DeviceNode->ResourceList->List[i].InterfaceType,
DeviceNode->ResourceList->List[i].BusNumber,
LCID LocaleId;
HANDLE InstanceKey = NULL;
UNICODE_STRING ValueName;
- UNICODE_STRING ParentIdPrefix = { 0 };
+ UNICODE_STRING ParentIdPrefix = { 0, 0, NULL };
DEVICE_CAPABILITIES DeviceCapabilities;
DPRINT("IopActionInterrogateDeviceStack(%p, %p)\n", DeviceNode, Context);
sizeof(ULONG));
/* Set 'UINumber' value */
- if (DeviceCapabilities.UINumber != (ULONG)-1)
+ if (DeviceCapabilities.UINumber != MAXULONG)
{
RtlInitUnicodeString(&ValueName, L"UINumber");
Status = ZwSetValueKey(InstanceKey,
if (!IopDeviceNodeHasFlag(DeviceNode, DNF_LEGACY_DRIVER))
{
/* Report the device to the user-mode pnp manager */
- IopQueueTargetDeviceEvent(&GUID_DEVICE_ARRIVAL,
+ IopQueueTargetDeviceEvent(&GUID_DEVICE_ENUMERATED,
&DeviceNode->InstancePath);
}
PDEVICE_NODE DeviceNode = IopGetDeviceNode(DeviceObject);
DEVICETREE_TRAVERSE_CONTEXT Context;
PDEVICE_RELATIONS DeviceRelations;
+ PDEVICE_OBJECT ChildDeviceObject;
IO_STATUS_BLOCK IoStatusBlock;
PDEVICE_NODE ChildDeviceNode;
IO_STACK_LOCATION Stack;
DPRINT("DeviceObject 0x%p\n", DeviceObject);
+ DPRINT("Sending GUID_DEVICE_ARRIVAL\n");
+
+ /* Report the device to the user-mode pnp manager */
+ IopQueueTargetDeviceEvent(&GUID_DEVICE_ARRIVAL,
+ &DeviceNode->InstancePath);
+
DPRINT("Sending IRP_MN_QUERY_DEVICE_RELATIONS to device stack\n");
Stack.Parameters.QueryDeviceRelations.Type = BusRelations;
*/
for (i = 0; i < DeviceRelations->Count; i++)
{
- if (IopGetDeviceNode(DeviceRelations->Objects[i]) != NULL)
+ ChildDeviceObject = DeviceRelations->Objects[i];
+ ASSERT((ChildDeviceObject->Flags & DO_DEVICE_INITIALIZING) == 0);
+
+ ChildDeviceNode = IopGetDeviceNode(ChildDeviceObject);
+ if (!ChildDeviceNode)
{
- ObDereferenceObject(DeviceRelations->Objects[i]);
- continue;
+ /* One doesn't exist, create it */
+ Status = IopCreateDeviceNode(
+ DeviceNode,
+ ChildDeviceObject,
+ NULL,
+ &ChildDeviceNode);
+ if (NT_SUCCESS(Status))
+ {
+ /* Mark the node as enumerated */
+ ChildDeviceNode->Flags |= DNF_ENUMERATED;
+
+ /* Mark the DO as bus enumerated */
+ ChildDeviceObject->Flags |= DO_BUS_ENUMERATED_DEVICE;
+ }
+ else
+ {
+ /* Ignore this DO */
+ DPRINT1("IopCreateDeviceNode() failed with status 0x%08x. Skipping PDO %u\n", Status, i);
+ ObDereferenceObject(ChildDeviceNode);
+ }
}
- Status = IopCreateDeviceNode(
- DeviceNode,
- DeviceRelations->Objects[i],
- NULL,
- &ChildDeviceNode);
- DeviceNode->Flags |= DNF_ENUMERATED;
- if (!NT_SUCCESS(Status))
+ else
{
- DPRINT("No resources\n");
- for (i = 0; i < DeviceRelations->Count; i++)
- ObDereferenceObject(DeviceRelations->Objects[i]);
- ExFreePool(DeviceRelations);
- return Status;
+ /* Mark it as enumerated */
+ ChildDeviceNode->Flags |= DNF_ENUMERATED;
+ ObDereferenceObject(ChildDeviceObject);
}
}
ExFreePool(DeviceRelations);
PUNICODE_STRING Service;
UNICODE_STRING ClassGUID;
NTSTATUS Status;
+ DEVICE_CAPABILITIES DeviceCaps;
DPRINT("IopActionConfigureChildServices(%p, %p)\n", DeviceNode, Context);
RtlInitUnicodeString(&ClassGUID, NULL);
QueryTable[0].Name = L"Service";
- QueryTable[0].Flags = RTL_QUERY_REGISTRY_DIRECT | RTL_QUERY_REGISTRY_REQUIRED;
+ QueryTable[0].Flags = RTL_QUERY_REGISTRY_DIRECT;
QueryTable[0].EntryContext = Service;
QueryTable[1].Name = L"ClassGUID";
if (Service->Buffer == NULL)
{
- IopDeviceNodeSetFlag(DeviceNode, DNF_DISABLED);
+ if (NT_SUCCESS(IopQueryDeviceCapabilities(DeviceNode, &DeviceCaps)) &&
+ DeviceCaps.RawDeviceOK)
+ {
+ DPRINT1("%wZ is using parent bus driver (%wZ)\n", &DeviceNode->InstancePath, &ParentDeviceNode->ServiceName);
+
+ DeviceNode->ServiceName.Length = 0;
+ DeviceNode->ServiceName.MaximumLength = ParentDeviceNode->ServiceName.MaximumLength;
+ DeviceNode->ServiceName.Buffer = ExAllocatePool(PagedPool, DeviceNode->ServiceName.MaximumLength);
+ if (!DeviceNode->ServiceName.Buffer)
+ return STATUS_SUCCESS;
+
+ RtlCopyUnicodeString(&DeviceNode->ServiceName, &ParentDeviceNode->ServiceName);
- if (ClassGUID.Length != 0)
+ IopDeviceNodeSetFlag(DeviceNode, DNF_LEGACY_DRIVER);
+ }
+ else if (ClassGUID.Length != 0)
{
/* Device has a ClassGUID value, but no Service value.
* Suppose it is using the NULL driver, so state the
DPRINT1("%wZ is using NULL driver\n", &DeviceNode->InstancePath);
IopDeviceNodeSetFlag(DeviceNode, DNF_STARTED);
}
+ else
+ {
+ IopDeviceNodeSetFlag(DeviceNode, DNF_DISABLED);
+ }
return STATUS_SUCCESS;
}
IopDeviceNodeSetFlag(DeviceNode, DNF_DISABLED);
IopDeviceNodeSetFlag(DeviceNode, DNF_START_FAILED);
/* FIXME: Log the error (possibly in IopInitializeDeviceNodeService) */
- CPRINT("Initialization of service %S failed (Status %x)\n",
+ DPRINT1("Initialization of service %S failed (Status %x)\n",
DeviceNode->ServiceName.Buffer, Status);
}
}
const UNICODE_STRING IdentifierMouse = RTL_CONSTANT_STRING(L"PointerController");
UNICODE_STRING HardwareIdMouse = RTL_CONSTANT_STRING(L"*PNP0F13\0");
static ULONG DeviceIndexMouse = 0;
+ const UNICODE_STRING IdentifierParallel = RTL_CONSTANT_STRING(L"PARALLEL");
+ UNICODE_STRING HardwareIdParallel = RTL_CONSTANT_STRING(L"*PNP0400\0");
+ static ULONG DeviceIndexParallel = 0;
+ const UNICODE_STRING IdentifierFloppy = RTL_CONSTANT_STRING(L"FLOPPY");
+ UNICODE_STRING HardwareIdFloppy = RTL_CONSTANT_STRING(L"*PNP0700\0");
+ static ULONG DeviceIndexFloppy = 0;
+ const UNICODE_STRING IdentifierIsa = RTL_CONSTANT_STRING(L"ISA");
+ UNICODE_STRING HardwareIdIsa = RTL_CONSTANT_STRING(L"*PNP0A00\0");
+ static ULONG DeviceIndexIsa = 0;
UNICODE_STRING HardwareIdKey;
PUNICODE_STRING pHardwareId;
ULONG DeviceIndex = 0;
Status = ZwEnumerateKey(hDevicesKey, IndexDevice, KeyBasicInformation, pDeviceInformation, DeviceInfoLength, &RequiredSize);
if (Status == STATUS_NO_MORE_ENTRIES)
break;
- else if (Status == STATUS_BUFFER_OVERFLOW)
+ else if (Status == STATUS_BUFFER_OVERFLOW || Status == STATUS_BUFFER_TOO_SMALL)
{
ExFreePool(pDeviceInformation);
DeviceInfoLength = RequiredSize;
/* Read boot resources, and add then to parent ones */
Status = ZwQueryValueKey(hDeviceKey, &ConfigurationDataU, KeyValuePartialInformation, pValueInformation, ValueInfoLength, &RequiredSize);
- if (Status == STATUS_BUFFER_OVERFLOW)
+ if (Status == STATUS_BUFFER_OVERFLOW || Status == STATUS_BUFFER_TOO_SMALL)
{
ExFreePool(pValueInformation);
ValueInfoLength = RequiredSize;
Status = ZwEnumerateKey(hDeviceKey, IndexSubKey, KeyBasicInformation, pDeviceInformation, DeviceInfoLength, &RequiredSize);
if (Status == STATUS_NO_MORE_ENTRIES)
break;
- else if (Status == STATUS_BUFFER_OVERFLOW)
+ else if (Status == STATUS_BUFFER_OVERFLOW || Status == STATUS_BUFFER_TOO_SMALL)
{
ExFreePool(pDeviceInformation);
DeviceInfoLength = RequiredSize;
/* Read identifier */
Status = ZwQueryValueKey(hDeviceKey, &IdentifierU, KeyValuePartialInformation, pValueInformation, ValueInfoLength, &RequiredSize);
- if (Status == STATUS_BUFFER_OVERFLOW)
+ if (Status == STATUS_BUFFER_OVERFLOW || Status == STATUS_BUFFER_TOO_SMALL)
{
ExFreePool(pValueInformation);
ValueInfoLength = RequiredSize;
pHardwareId = &HardwareIdPci;
DeviceIndex = DeviceIndexPci++;
}
+ else if (RtlCompareUnicodeString(&ValueName, &IdentifierIsa, FALSE) == 0)
+ {
+ pHardwareId = &HardwareIdIsa;
+ DeviceIndex = DeviceIndexIsa++;
+ }
#ifdef ENABLE_ACPI
else if (RtlCompareUnicodeString(&ValueName, &IdentifierAcpi, FALSE) == 0)
{
DeviceIndex = DeviceIndexAcpi++;
}
#endif
- else
+ else /* Now let's detect devices with a device number at the end */
{
- /* Unknown device */
- DPRINT("Unknown device '%wZ'\n", &ValueName);
- goto nextdevice;
+ /* First, we remove the number */
+ ValueName.Length -= sizeof(WCHAR);
+
+ /* Let's see if it is a floppy device */
+ if (RtlCompareUnicodeString(&ValueName, &IdentifierFloppy, FALSE) == 0)
+ {
+ pHardwareId = &HardwareIdFloppy;
+ DeviceIndex = DeviceIndexFloppy++;
+ }
+ /* Nope, is it a parallel port? */
+ else if (RtlCompareUnicodeString(&ValueName, &IdentifierParallel, FALSE) == 0)
+ {
+ pHardwareId = &HardwareIdParallel;
+ DeviceIndex = DeviceIndexParallel++;
+ }
+ /* Nope, out of ideas so let's skip this one */
+ else
+ {
+ ValueName.Length += sizeof(WCHAR);
+ DPRINT("Unknown device '%wZ'\n", &ValueName);
+ goto nextdevice;
+ }
+
+ /* Add the number back */
+ ValueName.Length += sizeof(WCHAR);
}
}
else
Status = ZwEnumerateKey(hDevicesKey, IndexDevice, KeyBasicInformation, pDeviceInformation, DeviceInfoLength, &RequiredSize);
if (Status == STATUS_NO_MORE_ENTRIES)
break;
- else if (Status == STATUS_BUFFER_OVERFLOW)
+ else if (Status == STATUS_BUFFER_OVERFLOW || Status == STATUS_BUFFER_TOO_SMALL)
{
ExFreePool(pDeviceInformation);
DeviceInfoLength = RequiredSize;
/* Read identifier */
Status = ZwQueryValueKey(hDeviceKey, &IdentifierU, KeyValuePartialInformation, pValueInformation, ValueInfoLength, &RequiredSize);
- if (Status == STATUS_BUFFER_OVERFLOW)
+ if (Status == STATUS_BUFFER_OVERFLOW || Status == STATUS_BUFFER_TOO_SMALL)
{
ExFreePool(pValueInformation);
ValueInfoLength = RequiredSize;
return Status;
}
+NTSTATUS
+NTAPI
+IopGetRegistryValue(IN HANDLE Handle,
+ IN PWSTR ValueName,
+ OUT PKEY_VALUE_FULL_INFORMATION *Information)
+{
+ UNICODE_STRING ValueString;
+ NTSTATUS Status;
+ PKEY_VALUE_FULL_INFORMATION FullInformation;
+ ULONG Size;
+ PAGED_CODE();
+
+ RtlInitUnicodeString(&ValueString, ValueName);
+
+ Status = ZwQueryValueKey(Handle,
+ &ValueString,
+ KeyValueFullInformation,
+ NULL,
+ 0,
+ &Size);
+ if ((Status != STATUS_BUFFER_OVERFLOW) &&
+ (Status != STATUS_BUFFER_TOO_SMALL))
+ {
+ return Status;
+ }
+
+ FullInformation = ExAllocatePool(NonPagedPool, Size);
+ if (!FullInformation) return STATUS_INSUFFICIENT_RESOURCES;
+
+ Status = ZwQueryValueKey(Handle,
+ &ValueString,
+ KeyValueFullInformation,
+ FullInformation,
+ Size,
+ &Size);
+ if (!NT_SUCCESS(Status))
+ {
+ ExFreePool(FullInformation);
+ return Status;
+ }
+
+ *Information = FullInformation;
+ return STATUS_SUCCESS;
+}
+
static NTSTATUS INIT_FUNCTION
NTAPI
PnpDriverInitializeEmpty(IN struct _DRIVER_OBJECT *DriverObject, IN PUNICODE_STRING RegistryPath)
DPRINT("PnpInit()\n");
KeInitializeSpinLock(&IopDeviceTreeLock);
-
+ ExInitializeFastMutex(&IopBusTypeGuidListLock);
+
/* Initialize the Bus Type GUID List */
- IopBusTypeGuidList = ExAllocatePool(PagedPool, sizeof(IO_BUS_TYPE_GUID_LIST));
+ IopBusTypeGuidList = ExAllocatePool(NonPagedPool, sizeof(IO_BUS_TYPE_GUID_LIST));
+ if (!IopBusTypeGuidList) {
+ DPRINT1("ExAllocatePool() failed\n");
+ KeBugCheckEx(PHASE1_INITIALIZATION_FAILED, STATUS_NO_MEMORY, 0, 0, 0);
+ }
+
RtlZeroMemory(IopBusTypeGuidList, sizeof(IO_BUS_TYPE_GUID_LIST));
ExInitializeFastMutex(&IopBusTypeGuidList->Lock);
Status = IopInitPlugPlayEvents();
if (!NT_SUCCESS(Status))
{
- CPRINT("IopInitPlugPlayEvents() failed\n");
- KEBUGCHECKEX(PHASE1_INITIALIZATION_FAILED, Status, 0, 0, 0);
+ DPRINT1("IopInitPlugPlayEvents() failed\n");
+ KeBugCheckEx(PHASE1_INITIALIZATION_FAILED, Status, 0, 0, 0);
}
/*
Status = IopCreateDriver(NULL, PnpDriverInitializeEmpty, NULL, 0, 0, &IopRootDriverObject);
if (!NT_SUCCESS(Status))
{
- CPRINT("IoCreateDriverObject() failed\n");
- KEBUGCHECKEX(PHASE1_INITIALIZATION_FAILED, Status, 0, 0, 0);
+ DPRINT1("IoCreateDriverObject() failed\n");
+ KeBugCheckEx(PHASE1_INITIALIZATION_FAILED, Status, 0, 0, 0);
}
Status = IoCreateDevice(IopRootDriverObject, 0, NULL, FILE_DEVICE_CONTROLLER,
0, FALSE, &Pdo);
if (!NT_SUCCESS(Status))
{
- CPRINT("IoCreateDevice() failed\n");
- KEBUGCHECKEX(PHASE1_INITIALIZATION_FAILED, Status, 0, 0, 0);
+ DPRINT1("IoCreateDevice() failed\n");
+ KeBugCheckEx(PHASE1_INITIALIZATION_FAILED, Status, 0, 0, 0);
}
Status = IopCreateDeviceNode(NULL, Pdo, NULL, &IopRootDeviceNode);
if (!NT_SUCCESS(Status))
{
- CPRINT("Insufficient resources\n");
- KEBUGCHECKEX(PHASE1_INITIALIZATION_FAILED, Status, 0, 0, 0);
+ DPRINT1("Insufficient resources\n");
+ KeBugCheckEx(PHASE1_INITIALIZATION_FAILED, Status, 0, 0, 0);
}
if (!RtlCreateUnicodeString(&IopRootDeviceNode->InstancePath,
L"HTREE\\ROOT\\0"))
{
- CPRINT("Failed to create the instance path!\n");
- KEBUGCHECKEX(PHASE1_INITIALIZATION_FAILED, STATUS_NO_MEMORY, 0, 0, 0);
+ DPRINT1("Failed to create the instance path!\n");
+ KeBugCheckEx(PHASE1_INITIALIZATION_FAILED, STATUS_NO_MEMORY, 0, 0, 0);
}
/* Report the device to the user-mode pnp manager */
Status = IopUpdateRootKey();
if (!NT_SUCCESS(Status))
{
- CPRINT("IopUpdateRootKey() failed\n");
- KEBUGCHECKEX(PHASE1_INITIALIZATION_FAILED, Status, 0, 0, 0);
+ DPRINT1("IopUpdateRootKey() failed\n");
+ KeBugCheckEx(PHASE1_INITIALIZATION_FAILED, Status, 0, 0, 0);
}
}
IN PVOID SecondStruct)
{
/* FIXME: TODO */
- KEBUGCHECK(0);
+ ASSERT(FALSE);
return 0;
}
IN CLONG ByteSize)
{
/* FIXME: TODO */
- KEBUGCHECK(0);
+ ASSERT(FALSE);
return NULL;
}
IN PVOID Buffer)
{
/* FIXME: TODO */
- KEBUGCHECK(0);
+ ASSERT(FALSE);
}
VOID
case DevicePropertyAddress:
/* Query the device caps */
Status = IopQueryDeviceCapabilities(DeviceNode, &DeviceCaps);
- if (NT_SUCCESS(Status) && (DeviceCaps.Address != (ULONG)-1))
+ if (NT_SUCCESS(Status) && (DeviceCaps.Address != MAXULONG))
{
/* Return length */
*ResultLength = sizeof(ULONG);
{
Length = CM_RESOURCE_LIST_SIZE(DeviceNode->BootResources);
}
- Data = &DeviceNode->BootResources;
+ Data = DeviceNode->BootResources;
break;
/* FIXME: use a translated boot configuration instead */
{
Length = CM_RESOURCE_LIST_SIZE(DeviceNode->BootResources);
}
- Data = &DeviceNode->BootResources;
+ Data = DeviceNode->BootResources;
break;
case DevicePropertyEnumeratorName:
* always contains the enumerator name followed by \\ */
Ptr = wcschr(DeviceNode->InstancePath.Buffer, L'\\');
ASSERT(Ptr);
- Length = (Ptr - DeviceNode->InstancePath.Buffer + 1) * sizeof(WCHAR);
+ Length = (Ptr - DeviceNode->InstancePath.Buffer) * sizeof(WCHAR);
Data = DeviceNode->InstancePath.Buffer;
break;
return STATUS_NOT_SUPPORTED;
}
}
+
+/*
+ * @unimplemented
+ */
+BOOLEAN
+NTAPI
+IoTranslateBusAddress(IN INTERFACE_TYPE InterfaceType,
+ IN ULONG BusNumber,
+ IN PHYSICAL_ADDRESS BusAddress,
+ IN OUT PULONG AddressSpace,
+ OUT PPHYSICAL_ADDRESS TranslatedAddress)
+{
+ UNIMPLEMENTED;
+ return FALSE;
+}