Home | Info | Community | Development | myReactOS | Contact Us
[static]
Definition at line 15 of file pdo.c.
Referenced by PciIdeXPdoPnpDispatch().
{ PPDO_DEVICE_EXTENSION DeviceExtension; PFDO_DEVICE_EXTENSION FdoDeviceExtension; WCHAR Buffer[256]; ULONG Index = 0; ULONG IdType; UNICODE_STRING SourceString; UNICODE_STRING String; NTSTATUS Status; IdType = IoGetCurrentIrpStackLocation(Irp)->Parameters.QueryId.IdType; DeviceExtension = (PPDO_DEVICE_EXTENSION)DeviceObject->DeviceExtension; FdoDeviceExtension = (PFDO_DEVICE_EXTENSION)DeviceExtension->ControllerFdo->DeviceExtension; switch (IdType) { case BusQueryDeviceID: { DPRINT("IRP_MJ_PNP / IRP_MN_QUERY_ID / BusQueryDeviceID\n"); RtlInitUnicodeString(&SourceString, L"PCIIDE\\IDEChannel"); break; } case BusQueryHardwareIDs: { DPRINT("IRP_MJ_PNP / IRP_MN_QUERY_ID / BusQueryHardwareIDs\n"); switch (FdoDeviceExtension->VendorId) { case 0x0e11: Index += swprintf(&Buffer[Index], L"Compaq-%04x", FdoDeviceExtension->DeviceId) + 1; break; case 0x1039: Index += swprintf(&Buffer[Index], L"SiS-%04x", FdoDeviceExtension->DeviceId) + 1; break; case 0x1050: Index += swprintf(&Buffer[Index], L"WinBond-%04x", FdoDeviceExtension->DeviceId) + 1; break; case 0x1095: Index += swprintf(&Buffer[Index], L"CMD-%04x", FdoDeviceExtension->DeviceId) + 1; break; case 0x8086: { switch (FdoDeviceExtension->DeviceId) { case 0x1230: Index += swprintf(&Buffer[Index], L"Intel-PIIX") + 1; break; case 0x7010: Index += swprintf(&Buffer[Index], L"Intel-PIIX3") + 1; break; case 0x7111: Index += swprintf(&Buffer[Index], L"Intel-PIIX4") + 1; break; default: Index += swprintf(&Buffer[Index], L"Intel-%04x", FdoDeviceExtension->DeviceId) + 1; break; } break; } default: break; } if (DeviceExtension->Channel == 0) Index += swprintf(&Buffer[Index], L"Primary_IDE_Channel") + 1; else Index += swprintf(&Buffer[Index], L"Secondary_IDE_Channel") + 1; Index += swprintf(&Buffer[Index], L"*PNP0600") + 1; Buffer[Index] = UNICODE_NULL; SourceString.Length = SourceString.MaximumLength = Index * sizeof(WCHAR); SourceString.Buffer = Buffer; break; } case BusQueryCompatibleIDs: { DPRINT("IRP_MJ_PNP / IRP_MN_QUERY_ID / BusQueryCompatibleIDs\n"); Index += swprintf(&Buffer[Index], L"*PNP0600") + 1; Buffer[Index] = UNICODE_NULL; SourceString.Length = SourceString.MaximumLength = Index * sizeof(WCHAR); SourceString.Buffer = Buffer; break; } case BusQueryInstanceID: { DPRINT("IRP_MJ_PNP / IRP_MN_QUERY_ID / BusQueryInstanceID\n"); swprintf(Buffer, L"%lu", DeviceExtension->Channel); RtlInitUnicodeString(&SourceString, Buffer); break; } default: DPRINT1("IRP_MJ_PNP / IRP_MN_QUERY_ID / unknown query id type 0x%lx\n", IdType); ASSERT(FALSE); return STATUS_NOT_SUPPORTED; } Status = DuplicateUnicodeString( RTL_DUPLICATE_UNICODE_STRING_NULL_TERMINATE, &SourceString, &String); *Information = (ULONG_PTR)String.Buffer; return Status; }