ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

static NTSTATUS PciIdeXPdoQueryId ( IN PDEVICE_OBJECT  DeviceObject,
IN PIRP  Irp,
OUT ULONG_PTR Information 
) [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;
}

Generated on Sat May 26 2012 05:22:02 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.