380{
389 WCHAR DeviceNameBuffer[80];
393 ULONG MissingCount = 0;
394 ULONG AddedCount = 0;
399
400 DPRINT(
"FdcFdoQueryBusRelations() called\n");
401
403 *DeviceRelations = ExistingRelations;
404
406 {
408
411 &ControllerType,
413 &PeripheralType,
416 FdoDeviceExtension);
419
421 }
422
423 ExistingCount = (ExistingRelations !=
NULL) ? ExistingRelations->Count : 0;
424
426 {
430 {
431 MissingCount++;
432 }
433 }
434
435 if (MissingCount == 0 && ExistingRelations !=
NULL)
436 {
439 }
440
441 if (MissingCount == 0)
442 {
446 if (Relations ==
NULL)
448
449 Relations->
Count = 0;
450 *DeviceRelations = Relations;
452 }
453
454 if (ExistingCount >
MAXULONG - MissingCount)
456
457 TotalCount = ExistingCount + MissingCount;
460 {
462 }
463
467 if (Relations ==
NULL)
468 {
470 }
471
472 if (ExistingCount != 0)
473 {
475 ExistingRelations->Objects,
477 }
478
480 {
482
484 {
486
487 do
488 {
491 DPRINT(
"Device name: %S\n", DeviceNameBuffer);
492
493
501 }
503
505 {
507 goto done;
508 }
509
510 DPRINT(
"PDO created: %S\n", DeviceNameBuffer);
511
514
517
519 PdoDeviceExtension->
DriveInfo = DriveInfo;
520
521
523 L"FDC\\GENERIC_FLOPPY_DRIVE"))
524 {
526 goto free_pdo;
527 }
529
530
533 {
534 goto free_pdo;
535 }
536
537
540 {
541 goto free_pdo;
542 }
543
544
548 {
549 goto free_pdo;
550 }
551
552#if 0
553
556 {
557
558
559 break;
560 }
561
562
565 {
566
567
568 break;
569 }
570#endif
571
574 Pdo->Flags &= ~DO_DEVICE_INITIALIZING;
575
577 }
578
580 continue;
581
584 AddedCount++;
585 }
586
587 ASSERT(AddedCount == MissingCount);
588 Relations->
Count = ExistingCount + AddedCount;
589
590
592
593 if (ExistingRelations !=
NULL)
595
596 *DeviceRelations = Relations;
598
599free_pdo:
605
606done:
607 while (AddedCount != 0)
608 {
609 AddedCount--;
611 }
612
614
616}
#define STATUS_INTEGER_OVERFLOW
#define FILE_DEVICE_SECURE_OPEN
_In_ PCHAR _In_ ULONG DeviceNumber
NTSYSAPI BOOLEAN NTAPI RtlCreateUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
struct _PDO_DEVICE_EXTENSION * PPDO_DEVICE_EXTENSION
#define ExAllocatePoolWithTag(hernya, size, tag)
_Must_inspect_result_ _In_ PUCXHUB_DEVICE_CREATE_INFO _Out_ UCXUSBDEVICE * Device
NTSTATUS NTAPI IoQueryDeviceDescription(_In_opt_ PINTERFACE_TYPE BusType, _In_opt_ PULONG BusNumber, _In_opt_ PCONFIGURATION_TYPE ControllerType, _In_opt_ PULONG ControllerNumber, _In_opt_ PCONFIGURATION_TYPE PeripheralType, _In_opt_ PULONG PeripheralNumber, _In_ PIO_QUERY_DEVICE_ROUTINE CalloutRoutine, _In_opt_ PVOID Context)
Reads and returns Hardware information from the appropriate hardware registry key.
#define FILE_DEVICE_MASS_STORAGE
#define _swprintf(buf, format,...)
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
NTSYSAPI VOID NTAPI RtlFreeUnicodeString(PUNICODE_STRING UnicodeString)
NTSTATUS NTAPI IoCreateDevice(IN PDRIVER_OBJECT DriverObject, IN ULONG DeviceExtensionSize, IN PUNICODE_STRING DeviceName, IN DEVICE_TYPE DeviceType, IN ULONG DeviceCharacteristics, IN BOOLEAN Exclusive, OUT PDEVICE_OBJECT *DeviceObject)
#define STATUS_NO_MORE_ENTRIES
NTSTATUS PciCreateInstanceIDString(PUNICODE_STRING InstanceID, PPCI_DEVICE Device)
NTSTATUS PciCreateDeviceDescriptionString(PUNICODE_STRING DeviceDescription, PPCI_DEVICE Device)
NTSTATUS PciCreateCompatibleIDsString(PUNICODE_STRING CompatibleIDs, PPCI_DEVICE Device)
NTSTATUS PciCreateHardwareIDsString(PUNICODE_STRING HardwareIDs, PPCI_DEVICE Device)
NTSTATUS PciCreateDeviceLocationString(PUNICODE_STRING DeviceLocation, PPCI_DEVICE Device)
for(i=0;i< sizeof(testsuite)/sizeof(testsuite[0]);++i) ok(call_test(testsuite[i].func)
enum _INTERFACE_TYPE INTERFACE_TYPE
enum _CONFIGURATION_TYPE CONFIGURATION_TYPE
static VOID FdcMarkPdosPresent(IN PFDO_DEVICE_EXTENSION FdoDeviceExtension)
static BOOLEAN FdcRelationsContainDeviceObject(IN PDEVICE_RELATIONS Relations, IN PDEVICE_OBJECT DeviceObject)
static NTSTATUS NTAPI FdcFdoConfigCallback(PVOID Context, PUNICODE_STRING PathName, INTERFACE_TYPE BusType, ULONG BusNumber, PKEY_VALUE_FULL_INFORMATION *BusInformation, CONFIGURATION_TYPE ControllerType, ULONG ControllerNumber, PKEY_VALUE_FULL_INFORMATION *ControllerInformation, CONFIGURATION_TYPE PeripheralType, ULONG PeripheralNumber, PKEY_VALUE_FULL_INFORMATION *PeripheralInformation)
PDEVICE_OBJECT DeviceObject
PDEVICE_OBJECT Objects[1]
PDEVICE_OBJECT DeviceObject
COMMON_DEVICE_EXTENSION Common
UNICODE_STRING InstanceId
UNICODE_STRING DeviceDescription
UNICODE_STRING HardwareIds
UNICODE_STRING DeviceLocation
COMMON_DEVICE_EXTENSION Common
UNICODE_STRING CompatibleIds
#define FIELD_OFFSET(t, f)
#define RtlCopyMemory(Destination, Source, Length)
#define RtlZeroMemory(Destination, Length)
#define STATUS_OBJECT_NAME_COLLISION
#define STATUS_INSUFFICIENT_RESOURCES
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
_Must_inspect_result_ _In_ PWDFDEVICE_INIT _In_opt_ PCUNICODE_STRING DeviceName
_Must_inspect_result_ _In_ WDFDEVICE _In_ LPCGUID InterfaceType
#define ObDereferenceObject
#define ObReferenceObject