Home | Info | Community | Development | myReactOS | Contact Us
ReactOS Development > Doxygenpdo.c
Go to the documentation of this file.
00001 /* 00002 * COPYRIGHT: See COPYING in the top level directory 00003 * PROJECT: PCI IDE bus driver extension 00004 * FILE: drivers/storage/pciidex/pdo.c 00005 * PURPOSE: IRP_MJ_PNP operations for PDOs 00006 * PROGRAMMERS: Hervé Poussineau (hpoussin@reactos.org) 00007 */ 00008 00009 #include "pciidex.h" 00010 00011 #define NDEBUG 00012 #include <debug.h> 00013 00014 static NTSTATUS 00015 PciIdeXPdoQueryId( 00016 IN PDEVICE_OBJECT DeviceObject, 00017 IN PIRP Irp, 00018 OUT ULONG_PTR* Information) 00019 { 00020 PPDO_DEVICE_EXTENSION DeviceExtension; 00021 PFDO_DEVICE_EXTENSION FdoDeviceExtension; 00022 WCHAR Buffer[256]; 00023 ULONG Index = 0; 00024 ULONG IdType; 00025 UNICODE_STRING SourceString; 00026 UNICODE_STRING String; 00027 NTSTATUS Status; 00028 00029 IdType = IoGetCurrentIrpStackLocation(Irp)->Parameters.QueryId.IdType; 00030 DeviceExtension = (PPDO_DEVICE_EXTENSION)DeviceObject->DeviceExtension; 00031 FdoDeviceExtension = (PFDO_DEVICE_EXTENSION)DeviceExtension->ControllerFdo->DeviceExtension; 00032 00033 switch (IdType) 00034 { 00035 case BusQueryDeviceID: 00036 { 00037 DPRINT("IRP_MJ_PNP / IRP_MN_QUERY_ID / BusQueryDeviceID\n"); 00038 RtlInitUnicodeString(&SourceString, L"PCIIDE\\IDEChannel"); 00039 break; 00040 } 00041 case BusQueryHardwareIDs: 00042 { 00043 DPRINT("IRP_MJ_PNP / IRP_MN_QUERY_ID / BusQueryHardwareIDs\n"); 00044 00045 switch (FdoDeviceExtension->VendorId) 00046 { 00047 case 0x0e11: 00048 Index += swprintf(&Buffer[Index], L"Compaq-%04x", FdoDeviceExtension->DeviceId) + 1; 00049 break; 00050 case 0x1039: 00051 Index += swprintf(&Buffer[Index], L"SiS-%04x", FdoDeviceExtension->DeviceId) + 1; 00052 break; 00053 case 0x1050: 00054 Index += swprintf(&Buffer[Index], L"WinBond-%04x", FdoDeviceExtension->DeviceId) + 1; 00055 break; 00056 case 0x1095: 00057 Index += swprintf(&Buffer[Index], L"CMD-%04x", FdoDeviceExtension->DeviceId) + 1; 00058 break; 00059 case 0x8086: 00060 { 00061 switch (FdoDeviceExtension->DeviceId) 00062 { 00063 case 0x1230: 00064 Index += swprintf(&Buffer[Index], L"Intel-PIIX") + 1; 00065 break; 00066 case 0x7010: 00067 Index += swprintf(&Buffer[Index], L"Intel-PIIX3") + 1; 00068 break; 00069 case 0x7111: 00070 Index += swprintf(&Buffer[Index], L"Intel-PIIX4") + 1; 00071 break; 00072 default: 00073 Index += swprintf(&Buffer[Index], L"Intel-%04x", FdoDeviceExtension->DeviceId) + 1; 00074 break; 00075 } 00076 break; 00077 } 00078 default: 00079 break; 00080 } 00081 if (DeviceExtension->Channel == 0) 00082 Index += swprintf(&Buffer[Index], L"Primary_IDE_Channel") + 1; 00083 else 00084 Index += swprintf(&Buffer[Index], L"Secondary_IDE_Channel") + 1; 00085 Index += swprintf(&Buffer[Index], L"*PNP0600") + 1; 00086 Buffer[Index] = UNICODE_NULL; 00087 SourceString.Length = SourceString.MaximumLength = Index * sizeof(WCHAR); 00088 SourceString.Buffer = Buffer; 00089 break; 00090 } 00091 case BusQueryCompatibleIDs: 00092 { 00093 DPRINT("IRP_MJ_PNP / IRP_MN_QUERY_ID / BusQueryCompatibleIDs\n"); 00094 00095 Index += swprintf(&Buffer[Index], L"*PNP0600") + 1; 00096 Buffer[Index] = UNICODE_NULL; 00097 SourceString.Length = SourceString.MaximumLength = Index * sizeof(WCHAR); 00098 SourceString.Buffer = Buffer; 00099 break; 00100 } 00101 case BusQueryInstanceID: 00102 { 00103 DPRINT("IRP_MJ_PNP / IRP_MN_QUERY_ID / BusQueryInstanceID\n"); 00104 swprintf(Buffer, L"%lu", DeviceExtension->Channel); 00105 RtlInitUnicodeString(&SourceString, Buffer); 00106 break; 00107 } 00108 default: 00109 DPRINT1("IRP_MJ_PNP / IRP_MN_QUERY_ID / unknown query id type 0x%lx\n", IdType); 00110 ASSERT(FALSE); 00111 return STATUS_NOT_SUPPORTED; 00112 } 00113 00114 Status = DuplicateUnicodeString( 00115 RTL_DUPLICATE_UNICODE_STRING_NULL_TERMINATE, 00116 &SourceString, 00117 &String); 00118 *Information = (ULONG_PTR)String.Buffer; 00119 return Status; 00120 } 00121 00122 static NTSTATUS 00123 GetCurrentResources( 00124 IN PDEVICE_OBJECT DeviceObject, 00125 OUT PULONG CommandPortBase, 00126 OUT PULONG ControlPortBase, 00127 OUT PULONG BusMasterPortBase, 00128 OUT PULONG InterruptVector) 00129 { 00130 PPDO_DEVICE_EXTENSION DeviceExtension; 00131 PFDO_DEVICE_EXTENSION FdoDeviceExtension; 00132 ULONG BaseIndex; 00133 ULONG BytesRead; 00134 PCI_COMMON_CONFIG PciConfig; 00135 NTSTATUS ret = STATUS_UNSUCCESSFUL; 00136 00137 DeviceExtension = (PPDO_DEVICE_EXTENSION)DeviceObject->DeviceExtension; 00138 FdoDeviceExtension = (PFDO_DEVICE_EXTENSION)DeviceExtension->ControllerFdo->DeviceExtension; 00139 BaseIndex = DeviceExtension->Channel * 2; 00140 00141 BytesRead = (*FdoDeviceExtension->BusInterface->GetBusData)( 00142 FdoDeviceExtension->BusInterface->Context, 00143 PCI_WHICHSPACE_CONFIG, 00144 &PciConfig, 00145 0, 00146 PCI_COMMON_HDR_LENGTH); 00147 if (BytesRead != PCI_COMMON_HDR_LENGTH) 00148 return STATUS_IO_DEVICE_ERROR; 00149 00150 /* We have found a known native pci ide controller */ 00151 if ((PciConfig.ProgIf & 0x80) && (PciConfig.u.type0.BaseAddresses[4] & PCI_ADDRESS_IO_SPACE)) 00152 { 00153 DPRINT("Found IDE Bus Master controller!\n"); 00154 *BusMasterPortBase = PciConfig.u.type0.BaseAddresses[4] & PCI_ADDRESS_IO_ADDRESS_MASK; 00155 DPRINT(" IDE Bus Master Registers at IO %lx\n", *BusMasterPortBase); 00156 } 00157 else 00158 { 00159 *BusMasterPortBase = 0; 00160 } 00161 00162 if ((PciConfig.ProgIf >> BaseIndex) & 0x1) 00163 { 00164 /* Native mode */ 00165 if ((PciConfig.u.type0.BaseAddresses[BaseIndex + 0] & PCI_ADDRESS_IO_SPACE) && 00166 (PciConfig.u.type0.BaseAddresses[BaseIndex + 1] & PCI_ADDRESS_IO_SPACE)) 00167 { 00168 /* Channel is enabled */ 00169 *CommandPortBase = PciConfig.u.type0.BaseAddresses[BaseIndex + 0] & PCI_ADDRESS_IO_ADDRESS_MASK; 00170 *ControlPortBase = PciConfig.u.type0.BaseAddresses[BaseIndex + 1] & PCI_ADDRESS_IO_ADDRESS_MASK; 00171 *InterruptVector = PciConfig.u.type0.InterruptLine; 00172 ret = STATUS_SUCCESS; 00173 } 00174 } 00175 else 00176 { 00177 /* Compatibility mode */ 00178 switch (DeviceExtension->Channel) 00179 { 00180 case 0: 00181 if (IoGetConfigurationInformation()->AtDiskPrimaryAddressClaimed) 00182 ret = STATUS_INSUFFICIENT_RESOURCES; 00183 else 00184 { 00185 *CommandPortBase = 0x1F0; 00186 *ControlPortBase = 0x3F6; 00187 *InterruptVector = 14; 00188 ret = STATUS_SUCCESS; 00189 } 00190 break; 00191 case 1: 00192 if (IoGetConfigurationInformation()->AtDiskSecondaryAddressClaimed) 00193 ret = STATUS_INSUFFICIENT_RESOURCES; 00194 else 00195 { 00196 *CommandPortBase = 0x170; 00197 *ControlPortBase = 0x376; 00198 *InterruptVector = 15; 00199 ret = STATUS_SUCCESS; 00200 } 00201 break; 00202 } 00203 } 00204 00205 return ret; 00206 } 00207 00208 static NTSTATUS 00209 PciIdeXPdoQueryResourceRequirements( 00210 IN PDEVICE_OBJECT DeviceObject, 00211 IN PIRP Irp, 00212 OUT ULONG_PTR* Information) 00213 { 00214 ULONG CommandPortBase; 00215 ULONG ControlPortBase; 00216 ULONG BusMasterPortBase; 00217 ULONG InterruptVector; 00218 ULONG ListSize; 00219 PIO_RESOURCE_REQUIREMENTS_LIST RequirementsList; 00220 PIO_RESOURCE_DESCRIPTOR Descriptor; 00221 NTSTATUS Status; 00222 00223 Status = GetCurrentResources(DeviceObject, &CommandPortBase, 00224 &ControlPortBase, &BusMasterPortBase, &InterruptVector); 00225 if (!NT_SUCCESS(Status)) 00226 return Status; 00227 00228 DPRINT("IDE Channel %lu: IO %x and %x, BM %lx, Irq %lu\n", 00229 ((PPDO_DEVICE_EXTENSION)DeviceObject->DeviceExtension)->Channel, 00230 CommandPortBase, ControlPortBase, 00231 BusMasterPortBase, InterruptVector); 00232 00233 /* FIXME: what to do with BusMasterPortBase? */ 00234 00235 ListSize = sizeof(IO_RESOURCE_REQUIREMENTS_LIST) 00236 + 2 * sizeof(IO_RESOURCE_DESCRIPTOR); 00237 RequirementsList = ExAllocatePool(PagedPool, ListSize); 00238 if (!RequirementsList) 00239 return STATUS_INSUFFICIENT_RESOURCES; 00240 00241 RtlZeroMemory(RequirementsList, ListSize); 00242 RequirementsList->ListSize = ListSize; 00243 RequirementsList->AlternativeLists = 1; 00244 00245 RequirementsList->List[0].Version = 1; 00246 RequirementsList->List[0].Revision = 1; 00247 RequirementsList->List[0].Count = 3; 00248 00249 Descriptor = &RequirementsList->List[0].Descriptors[0]; 00250 00251 /* Command port base */ 00252 Descriptor->Option = 0; /* Required */ 00253 Descriptor->Type = CmResourceTypePort; 00254 Descriptor->ShareDisposition = CmResourceShareDeviceExclusive; 00255 Descriptor->Flags = CM_RESOURCE_PORT_IO | 00256 CM_RESOURCE_PORT_16_BIT_DECODE | 00257 CM_RESOURCE_PORT_POSITIVE_DECODE; 00258 Descriptor->u.Port.Length = 7; 00259 Descriptor->u.Port.Alignment = 1; 00260 Descriptor->u.Port.MinimumAddress.QuadPart = (ULONGLONG)CommandPortBase; 00261 Descriptor->u.Port.MaximumAddress.QuadPart = (ULONGLONG)(CommandPortBase + 7 - 1); 00262 Descriptor++; 00263 00264 /* Control port base */ 00265 Descriptor->Option = 0; /* Required */ 00266 Descriptor->Type = CmResourceTypePort; 00267 Descriptor->ShareDisposition = CmResourceShareDeviceExclusive; 00268 Descriptor->Flags = CM_RESOURCE_PORT_IO | 00269 CM_RESOURCE_PORT_16_BIT_DECODE | 00270 CM_RESOURCE_PORT_POSITIVE_DECODE; 00271 Descriptor->u.Port.Length = 1; 00272 Descriptor->u.Port.Alignment = 1; 00273 Descriptor->u.Port.MinimumAddress.QuadPart = (ULONGLONG)ControlPortBase; 00274 Descriptor->u.Port.MaximumAddress.QuadPart = (ULONGLONG)(ControlPortBase + 1 - 1); 00275 Descriptor++; 00276 00277 /* Interrupt */ 00278 Descriptor->Option = 0; /* Required */ 00279 Descriptor->Type = CmResourceTypeInterrupt; 00280 Descriptor->ShareDisposition = CmResourceShareShared; 00281 Descriptor->Flags = CM_RESOURCE_INTERRUPT_LEVEL_SENSITIVE; 00282 Descriptor->u.Interrupt.MinimumVector = InterruptVector; 00283 Descriptor->u.Interrupt.MaximumVector = InterruptVector; 00284 00285 *Information = (ULONG_PTR)RequirementsList; 00286 return STATUS_SUCCESS; 00287 } 00288 00289 static NTSTATUS 00290 PciIdeXPdoQueryDeviceText( 00291 IN PDEVICE_OBJECT DeviceObject, 00292 IN PIRP Irp, 00293 OUT ULONG_PTR* Information) 00294 { 00295 PPDO_DEVICE_EXTENSION DeviceExtension; 00296 ULONG DeviceTextType; 00297 PCWSTR SourceString; 00298 UNICODE_STRING String; 00299 00300 DeviceTextType = IoGetCurrentIrpStackLocation(Irp)->Parameters.QueryDeviceText.DeviceTextType; 00301 DeviceExtension = (PPDO_DEVICE_EXTENSION)DeviceObject->DeviceExtension; 00302 00303 switch (DeviceTextType) 00304 { 00305 case DeviceTextDescription: 00306 case DeviceTextLocationInformation: 00307 { 00308 DPRINT("IRP_MJ_PNP / IRP_MN_QUERY_DEVICE_TEXT / %S\n", 00309 DeviceTextType == DeviceTextDescription ? L"DeviceTextDescription" : L"DeviceTextLocationInformation"); 00310 if (DeviceExtension->Channel == 0) 00311 SourceString = L"Primary channel"; 00312 else 00313 SourceString = L"Secondary channel"; 00314 break; 00315 } 00316 default: 00317 DPRINT1("IRP_MJ_PNP / IRP_MN_QUERY_DEVICE_TEXT / unknown type 0x%lx\n", DeviceTextType); 00318 ASSERT(FALSE); 00319 return STATUS_NOT_SUPPORTED; 00320 } 00321 00322 if (RtlCreateUnicodeString(&String, SourceString)) 00323 { 00324 *Information = (ULONG_PTR)String.Buffer; 00325 return STATUS_SUCCESS; 00326 } 00327 else 00328 return STATUS_INSUFFICIENT_RESOURCES; 00329 } 00330 00331 static NTSTATUS 00332 PciIdeXPdoQueryDeviceRelations( 00333 IN PDEVICE_OBJECT DeviceObject, 00334 OUT PDEVICE_RELATIONS* pDeviceRelations) 00335 { 00336 PFDO_DEVICE_EXTENSION DeviceExtension; 00337 PDEVICE_RELATIONS DeviceRelations; 00338 00339 DeviceExtension = (PFDO_DEVICE_EXTENSION)DeviceObject->DeviceExtension; 00340 ASSERT(DeviceExtension->Common.IsFDO); 00341 00342 DeviceRelations = (PDEVICE_RELATIONS)ExAllocatePool( 00343 PagedPool, 00344 sizeof(DEVICE_RELATIONS)); 00345 if (!DeviceRelations) 00346 return STATUS_INSUFFICIENT_RESOURCES; 00347 00348 ObReferenceObject(DeviceObject); 00349 DeviceRelations->Count = 1; 00350 DeviceRelations->Objects[0] = DeviceObject; 00351 00352 *pDeviceRelations = DeviceRelations; 00353 return STATUS_SUCCESS; 00354 } 00355 00356 NTSTATUS NTAPI 00357 PciIdeXPdoPnpDispatch( 00358 IN PDEVICE_OBJECT DeviceObject, 00359 IN PIRP Irp) 00360 { 00361 ULONG MinorFunction; 00362 PIO_STACK_LOCATION Stack; 00363 ULONG_PTR Information = Irp->IoStatus.Information; 00364 NTSTATUS Status; 00365 00366 Stack = IoGetCurrentIrpStackLocation(Irp); 00367 MinorFunction = Stack->MinorFunction; 00368 00369 switch (MinorFunction) 00370 { 00371 /* FIXME: 00372 * Those are required: 00373 * IRP_MN_START_DEVICE (done) 00374 * IRP_MN_QUERY_STOP_DEVICE 00375 * IRP_MN_STOP_DEVICE 00376 * IRP_MN_CANCEL_STOP_DEVICE 00377 * IRP_MN_QUERY_REMOVE_DEVICE 00378 * IRP_MN_REMOVE_DEVICE 00379 * IRP_MN_CANCEL_REMOVE_DEVICE 00380 * IRP_MN_SURPRISE_REMOVAL 00381 * IRP_MN_QUERY_CAPABILITIES (done) 00382 * IRP_MN_QUERY_DEVICE_RELATIONS / TargetDeviceRelations (done) 00383 * IRP_MN_QUERY_ID / BusQueryDeviceID (done) 00384 * Those may be required/optional: 00385 * IRP_MN_DEVICE_USAGE_NOTIFICATION 00386 * IRP_MN_QUERY_RESOURCES 00387 * IRP_MN_QUERY_RESOURCE_REQUIREMENTS (done) 00388 * IRP_MN_QUERY_DEVICE_TEXT 00389 * IRP_MN_QUERY_BUS_INFORMATION 00390 * IRP_MN_QUERY_INTERFACE 00391 * IRP_MN_READ_CONFIG 00392 * IRP_MN_WRITE_CONFIG 00393 * IRP_MN_EJECT 00394 * IRP_MN_SET_LOCK 00395 * Those are optional: 00396 * IRP_MN_QUERY_DEVICE_RELATIONS / EjectionRelations 00397 * IRP_MN_QUERY_ID / BusQueryHardwareIDs (done) 00398 * IRP_MN_QUERY_ID / BusQueryCompatibleIDs (done) 00399 * IRP_MN_QUERY_ID / BusQueryInstanceID (done) 00400 */ 00401 case IRP_MN_START_DEVICE: /* 0x00 */ 00402 { 00403 DPRINT("IRP_MJ_PNP / IRP_MN_START_DEVICE\n"); 00404 Status = STATUS_SUCCESS; 00405 break; 00406 } 00407 case IRP_MN_QUERY_REMOVE_DEVICE: /* 0x01 */ 00408 { 00409 DPRINT("IRP_MJ_PNP / IRP_MN_QUERY_REMOVE_DEVICE\n"); 00410 Status = STATUS_UNSUCCESSFUL; 00411 break; 00412 } 00413 case IRP_MN_QUERY_DEVICE_RELATIONS: /* 0x07 */ 00414 { 00415 switch (Stack->Parameters.QueryDeviceRelations.Type) 00416 { 00417 case TargetDeviceRelation: 00418 { 00419 PDEVICE_RELATIONS DeviceRelations = NULL; 00420 DPRINT("IRP_MJ_PNP / IRP_MN_QUERY_DEVICE_RELATIONS / TargetDeviceRelation\n"); 00421 Status = PciIdeXPdoQueryDeviceRelations(DeviceObject, &DeviceRelations); 00422 Information = (ULONG_PTR)DeviceRelations; 00423 break; 00424 } 00425 default: 00426 { 00427 DPRINT1("IRP_MJ_PNP / IRP_MN_QUERY_DEVICE_RELATIONS / Unknown type 0x%lx\n", 00428 Stack->Parameters.QueryDeviceRelations.Type); 00429 ASSERT(FALSE); 00430 Status = STATUS_NOT_SUPPORTED; 00431 break; 00432 } 00433 } 00434 break; 00435 } 00436 case IRP_MN_QUERY_CAPABILITIES: /* 0x09 */ 00437 { 00438 PDEVICE_CAPABILITIES DeviceCapabilities; 00439 ULONG i; 00440 DPRINT("IRP_MJ_PNP / IRP_MN_QUERY_CAPABILITIES\n"); 00441 00442 DeviceCapabilities = (PDEVICE_CAPABILITIES)Stack->Parameters.DeviceCapabilities.Capabilities; 00443 /* FIXME: capabilities can change with connected device */ 00444 DeviceCapabilities->LockSupported = FALSE; 00445 DeviceCapabilities->EjectSupported = FALSE; 00446 DeviceCapabilities->Removable = TRUE; 00447 DeviceCapabilities->DockDevice = FALSE; 00448 DeviceCapabilities->UniqueID = FALSE; 00449 DeviceCapabilities->SilentInstall = FALSE; 00450 DeviceCapabilities->RawDeviceOK = FALSE; 00451 DeviceCapabilities->SurpriseRemovalOK = TRUE; 00452 DeviceCapabilities->HardwareDisabled = FALSE; /* FIXME */ 00453 //DeviceCapabilities->NoDisplayInUI = FALSE; /* FIXME */ 00454 DeviceCapabilities->DeviceState[0] = PowerDeviceD0; /* FIXME */ 00455 for (i = 0; i < PowerSystemMaximum; i++) 00456 DeviceCapabilities->DeviceState[i] = PowerDeviceD3; /* FIXME */ 00457 //DeviceCapabilities->DeviceWake = PowerDeviceUndefined; /* FIXME */ 00458 DeviceCapabilities->D1Latency = 0; /* FIXME */ 00459 DeviceCapabilities->D2Latency = 0; /* FIXME */ 00460 DeviceCapabilities->D3Latency = 0; /* FIXME */ 00461 Status = STATUS_SUCCESS; 00462 break; 00463 } 00464 case IRP_MN_QUERY_RESOURCES: /* 0x0a */ 00465 { 00466 /* This IRP is optional; do nothing */ 00467 Information = Irp->IoStatus.Information; 00468 Status = Irp->IoStatus.Status; 00469 break; 00470 } 00471 case IRP_MN_QUERY_RESOURCE_REQUIREMENTS: /* 0x0b */ 00472 { 00473 DPRINT("IRP_MJ_PNP / IRP_MN_QUERY_RESOURCE_REQUIREMENTS\n"); 00474 Status = PciIdeXPdoQueryResourceRequirements(DeviceObject, Irp, &Information); 00475 break; 00476 } 00477 case IRP_MN_QUERY_DEVICE_TEXT: /* 0x0c */ 00478 { 00479 Status = PciIdeXPdoQueryDeviceText(DeviceObject, Irp, &Information); 00480 break; 00481 } 00482 case IRP_MN_FILTER_RESOURCE_REQUIREMENTS: /* 0x0d */ 00483 { 00484 DPRINT("IRP_MJ_PNP / IRP_MN_FILTER_RESOURCE_REQUIREMENTS\n"); 00485 Information = Irp->IoStatus.Information; 00486 Status = Irp->IoStatus.Status; 00487 break; 00488 } 00489 case IRP_MN_QUERY_ID: /* 0x13 */ 00490 { 00491 Status = PciIdeXPdoQueryId(DeviceObject, Irp, &Information); 00492 break; 00493 } 00494 case IRP_MN_QUERY_PNP_DEVICE_STATE: /* 0x14 */ 00495 { 00496 DPRINT("IRP_MJ_PNP / IRP_MN_QUERY_PNP_DEVICE_STATE\n"); 00497 Information |= PNP_DEVICE_NOT_DISABLEABLE; 00498 Status = STATUS_SUCCESS; 00499 break; 00500 } 00501 case IRP_MN_QUERY_BUS_INFORMATION: /* 0x15 */ 00502 { 00503 PPNP_BUS_INFORMATION BusInfo; 00504 DPRINT("IRP_MJ_PNP / IRP_MN_QUERY_BUS_INFORMATION\n"); 00505 00506 BusInfo = (PPNP_BUS_INFORMATION)ExAllocatePool(PagedPool, sizeof(PNP_BUS_INFORMATION)); 00507 if (!BusInfo) 00508 Status = STATUS_INSUFFICIENT_RESOURCES; 00509 else 00510 { 00511 /*RtlCopyMemory( 00512 &BusInfo->BusTypeGuid, 00513 &GUID_DEVINTERFACE_XXX, 00514 sizeof(GUID));*/ 00515 BusInfo->LegacyBusType = PNPBus; 00516 BusInfo->BusNumber = 0; /* FIXME */ 00517 Information = (ULONG_PTR)BusInfo; 00518 Status = STATUS_SUCCESS; 00519 } 00520 break; 00521 } 00522 default: 00523 { 00524 /* We can't forward request to the lower driver, because 00525 * we are a Pdo, so we don't have lower driver... */ 00526 DPRINT1("IRP_MJ_PNP / Unknown minor function 0x%lx\n", MinorFunction); 00527 ASSERT(FALSE); 00528 Information = Irp->IoStatus.Information; 00529 Status = Irp->IoStatus.Status; 00530 } 00531 } 00532 00533 Irp->IoStatus.Information = Information; 00534 Irp->IoStatus.Status = Status; 00535 IoCompleteRequest(Irp, IO_NO_INCREMENT); 00536 return Status; 00537 } Generated on Sat May 26 2012 04:26:02 for ReactOS by
1.7.6.1
|