IN LPWSTR ReferenceString,
IN LPWSTR InterfaceString)
{
- GUID DeviceGuid;
+ GUID InterfaceGUID;
NTSTATUS Status;
PLIST_ENTRY Entry;
PBUS_INSTANCE_ENTRY CurEntry;
RtlInitUnicodeString(&DeviceName, InterfaceString);
/* first convert device name to guid */
- RtlGUIDFromString(&DeviceName, &DeviceGuid);
+ RtlGUIDFromString(&DeviceName, &InterfaceGUID);
/* check if the device is already present */
Entry = DeviceEntry->DeviceInterfaceList.Flink;
/* get offset */
CurEntry = (PBUS_INSTANCE_ENTRY)CONTAINING_RECORD(Entry, BUS_INSTANCE_ENTRY, Entry);
- if (IsEqualGUIDAligned(&CurEntry->InterfaceGuid, &DeviceGuid))
+ if (IsEqualGUIDAligned(&CurEntry->InterfaceGuid, &InterfaceGUID))
{
/* entry already exists */
return STATUS_SUCCESS;
}
/* store guid */
- RtlMoveMemory(&CurEntry->InterfaceGuid, &DeviceGuid, sizeof(GUID));
+ RtlMoveMemory(&CurEntry->InterfaceGuid, &InterfaceGUID, sizeof(GUID));
/* now register the association */
Status = KspRegisterDeviceAssociation(BusDeviceExtension, DeviceEntry, CurEntry);
InitializeListHead(&DeviceEntry->IrpPendingList);
/* copy device guid */
- RtlInitUnicodeString(&String, ReferenceString);
+ RtlInitUnicodeString(&String, DeviceCategory);
RtlGUIDFromString(&String, &DeviceEntry->DeviceGuid);
/* copy device names */
return;
}
+ /* now scan the bus */
+ KspScanBus(Context->BusDeviceExtension);
+
/* acquire device entry lock */
KeAcquireSpinLock(&Context->BusDeviceExtension->Lock, &OldLevel);
/* now iterate all device entries */
+ ASSERT(!IsListEmpty(&Context->BusDeviceExtension->Common.Entry));
Entry = Context->BusDeviceExtension->Common.Entry.Flink;
while(Entry != &Context->BusDeviceExtension->Common.Entry)
{
/* get device extension */
DeviceExtension = (PDEV_EXTENSION)BusDeviceObject->DeviceExtension;
- DPRINT1("DeviceExtension %p BusDeviceExtension %p\n", DeviceExtension, DeviceExtension->Ext);
-
/* store bus device extension */
DeviceExtension->Ext = (PCOMMON_DEVICE_EXTENSION)BusDeviceExtension;
/* check for success */
if (!NT_SUCCESS(Status))
{
-
+ DPRINT1("IoRegisterDeviceInterface failed Status %lx\n", Status);
FreeItem(BusDeviceExtension->ServicePath.Buffer);
FreeItem(BusDeviceExtension);
return Status;
if (!NT_SUCCESS(Status))
{
+ DPRINT1("IoSetDeviceInterfaceState failed Status %lx\n", Status);
FreeItem(BusDeviceExtension->ServicePath.Buffer);
FreeItem(BusDeviceExtension);
return Status;
if (!BusDeviceExtension->PnpDeviceObject)
{
/* failed to attach device */
+ DPRINT1("IoAttachDeviceToDeviceStack failed with %x\n", Status);
if (BusDeviceExtension->DeviceInterfaceLink.Buffer)
{
IoSetDeviceInterfaceState(&BusDeviceExtension->DeviceInterfaceLink, FALSE);
/* perform access check */
if (!SeSinglePrivilegeCheck(luid, Mode))
{
- /* insufficient privileges */
- return STATUS_PRIVILEGE_NOT_HELD;
+ /* FIXME insufficient privileges */
+ //return STATUS_PRIVILEGE_NOT_HELD;
}
/* get device extension */
/* sanity checks */
ASSERT(IoStack->FileObject);
+ if (IoStack->FileObject->FileName.Buffer == NULL)
+ {
+ DPRINT1("KsServiceBusEnumCreateRequest PNP Hack\n");
+ Irp->IoStatus.Status = STATUS_SUCCESS;
+ return STATUS_SUCCESS;
+ }
+
ASSERT(IoStack->FileObject->FileName.Buffer);
DPRINT1("KsServiceBusEnumCreateRequest IRP %p Name %wZ\n", Irp, &IoStack->FileObject->FileName);
const GUID KSMEDIUMSETID_Standard = {0x4747B320L, 0x62CE, 0x11CF, {0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00}};
-
NTSTATUS
NTAPI
SwDispatchPower(
/* check if the device object is a child device */
Status = KsIsBusEnumChildDevice(DeviceObject, &ChildDevice);
- DPRINT("SwDispatchCreate %x\n", Status);
+ DPRINT1("SwDispatchCreate %x\n", Status);
/* check for success */
if (NT_SUCCESS(Status))
}
/* perform the create request */
Status = KsServiceBusEnumCreateRequest(DeviceObject, Irp);
- DPRINT("SwDispatchCreate %x\n", Status);
+ DPRINT1("SwDispatchCreate %x\n", Status);
}
/* check the irp is pending */
DriverObject->MajorFunction[IRP_MJ_DEVICE_CONTROL] = SwDispatchDeviceControl;
DriverObject->MajorFunction[IRP_MJ_SYSTEM_CONTROL] = SwDispatchSystemControl;
- DPRINT("SWENUM loaded\n");
+ DPRINT1("SWENUM loaded\n");
return STATUS_SUCCESS;
}