
disk.nostrip.sys:     file format pei-i386

Disassembly of section .text:

00011000 <_DriverEntry@8>:

NTSTATUS STDCALL
DriverEntry(IN PDRIVER_OBJECT DriverObject,
	    IN PUNICODE_STRING RegistryPath)
{
   11000:	55                   	push   %ebp
   11001:	89 e5                	mov    %esp,%ebp
   11003:	53                   	push   %ebx
   11004:	83 ec 3c             	sub    $0x3c,%esp
  CLASS_INIT_DATA InitData;

  DPRINT("Disk Class Driver %s\n",
	 VERSION);
  DPRINT("RegistryPath '%wZ'\n",
	 RegistryPath);

  RtlZeroMemory(&InitData,
   11007:	8d 5d c8             	lea    0xffffffc8(%ebp),%ebx
   1100a:	6a 30                	push   $0x30
   1100c:	53                   	push   %ebx
   1100d:	e8 8e 1e 00 00       	call   12ea0 <_RtlZeroMemory@8>
		sizeof(CLASS_INIT_DATA));

  InitData.InitializationDataSize = sizeof(CLASS_INIT_DATA);
  InitData.DeviceExtensionSize = sizeof(DEVICE_EXTENSION) + sizeof(DISK_DATA);
  InitData.DeviceType = FILE_DEVICE_DISK;
  InitData.DeviceCharacteristics = 0;

  InitData.ClassError = NULL;	// DiskClassProcessError;
  InitData.ClassReadWriteVerification = DiskClassCheckReadWrite;
  InitData.ClassFindDeviceCallBack = DiskClassCheckDevice;
  InitData.ClassFindDevices = DiskClassFindDevices;
  InitData.ClassDeviceControl = DiskClassDeviceControl;
  InitData.ClassShutdownFlush = DiskClassShutdownFlush;
  InitData.ClassCreateClose = NULL;
  InitData.ClassStartIo = NULL;

  return(ScsiClassInitialize(DriverObject,
   11012:	8b 55 0c             	mov    0xc(%ebp),%edx
   11015:	8b 45 08             	mov    0x8(%ebp),%eax
   11018:	c7 45 c8 30 00 00 00 	movl   $0x30,0xffffffc8(%ebp)
   1101f:	89 1c 24             	mov    %ebx,(%esp)
   11022:	c7 45 cc f4 00 00 00 	movl   $0xf4,0xffffffcc(%ebp)
   11029:	c7 45 d0 07 00 00 00 	movl   $0x7,0xffffffd0(%ebp)
   11030:	c7 45 d4 00 00 00 00 	movl   $0x0,0xffffffd4(%ebp)
   11037:	c7 45 d8 00 00 00 00 	movl   $0x0,0xffffffd8(%ebp)
   1103e:	c7 45 dc b0 10 01 00 	movl   $0x110b0,0xffffffdc(%ebp)
   11045:	c7 45 e0 80 10 01 00 	movl   $0x11080,0xffffffe0(%ebp)
   1104c:	c7 45 e4 60 1d 01 00 	movl   $0x11d60,0xffffffe4(%ebp)
   11053:	c7 45 e8 60 12 01 00 	movl   $0x11260,0xffffffe8(%ebp)
   1105a:	c7 45 ec 60 11 01 00 	movl   $0x11160,0xffffffec(%ebp)
   11061:	c7 45 f0 00 00 00 00 	movl   $0x0,0xfffffff0(%ebp)
   11068:	c7 45 f4 00 00 00 00 	movl   $0x0,0xfffffff4(%ebp)
   1106f:	52                   	push   %edx
   11070:	50                   	push   %eax
   11071:	e8 5a 1d 00 00       	call   12dd0 <_ScsiClassInitialize@12>
			     RegistryPath,
			     &InitData));
}
   11076:	8b 5d fc             	mov    0xfffffffc(%ebp),%ebx
   11079:	c9                   	leave  
   1107a:	c2 08 00             	ret    $0x8
   1107d:	8d 76 00             	lea    0x0(%esi),%esi

00011080 <_DiskClassCheckDevice@4>:


/**********************************************************************
 * NAME							EXPORTED
 *	DiskClassFindDevices
 *
 * DESCRIPTION
 *	This function searches for device that are attached to the
 *	given scsi port.
 *
 * RUN LEVEL
 *	PASSIVE_LEVEL
 *
 * ARGUMENTS
 *	DriverObject
 *		System allocated Driver Object for this driver
 *
 *	RegistryPath
 *		Name of registry driver service key
 *
 *	InitializationData
 *		Pointer to the main initialization data
 *
 *	PortDeviceObject
 *		Pointer to the port Device Object
 *
 *	PortNumber
 *		Port number
 *
 * RETURN VALUE
 *	TRUE: At least one disk drive was found
 *	FALSE: No disk drive found
 */

BOOLEAN STDCALL
DiskClassFindDevices(PDRIVER_OBJECT DriverObject,
		     PUNICODE_STRING RegistryPath,
		     PCLASS_INIT_DATA InitializationData,
		     PDEVICE_OBJECT PortDeviceObject,
		     ULONG PortNumber)
{
  PCONFIGURATION_INFORMATION ConfigInfo;
  PIO_SCSI_CAPABILITIES PortCapabilities;
  PSCSI_ADAPTER_BUS_INFO AdapterBusInfo;
  PSCSI_INQUIRY_DATA UnitInfo;
  PINQUIRYDATA InquiryData;
  PCHAR Buffer;
  ULONG Bus;
  ULONG DeviceCount;
  BOOLEAN FoundDevice = FALSE;
  NTSTATUS Status;

  DPRINT("DiskClassFindDevices() called.\n");

  /* Get port capabilities */
  Status = ScsiClassGetCapabilities(PortDeviceObject,
				    &PortCapabilities);
  if (!NT_SUCCESS(Status))
    {
      DPRINT("ScsiClassGetCapabilities() failed! (Status 0x%lX)\n", Status);
      return(FALSE);
    }

  DPRINT("PortCapabilities: %p\n", PortCapabilities);
  DPRINT("MaximumTransferLength: %lu\n", PortCapabilities->MaximumTransferLength);
  DPRINT("MaximumPhysicalPages: %lu\n", PortCapabilities->MaximumPhysicalPages);

  /* Get inquiry data */
  Status = ScsiClassGetInquiryData(PortDeviceObject,
				   (PSCSI_ADAPTER_BUS_INFO *)&Buffer);
  if (!NT_SUCCESS(Status))
    {
      DPRINT("ScsiClassGetInquiryData() failed! (Status %x)\n", Status);
      return(FALSE);
    }

  /* Check whether there are unclaimed devices */
  AdapterBusInfo = (PSCSI_ADAPTER_BUS_INFO)Buffer;
  DeviceCount = ScsiClassFindUnclaimedDevices(InitializationData,
					      AdapterBusInfo);
  if (DeviceCount == 0)
    {
      DPRINT("No unclaimed devices!\n");
      return(FALSE);
    }

  DPRINT("Found %lu unclaimed devices!\n", DeviceCount);

  ConfigInfo = IoGetConfigurationInformation();

  /* Search each bus of this adapter */
  for (Bus = 0; Bus < (ULONG)AdapterBusInfo->NumberOfBuses; Bus++)
    {
      DPRINT("Searching bus %lu\n", Bus);

      UnitInfo = (PSCSI_INQUIRY_DATA)(Buffer + AdapterBusInfo->BusData[Bus].InquiryDataOffset);

      while (AdapterBusInfo->BusData[Bus].InquiryDataOffset)
	{
	  InquiryData = (PINQUIRYDATA)UnitInfo->InquiryData;

	  DPRINT("Device type %u\n", InquiryData->DeviceType);

	  if (((InquiryData->DeviceType == DIRECT_ACCESS_DEVICE) ||
	       (InquiryData->DeviceType == OPTICAL_DEVICE)) &&
	      (InquiryData->DeviceTypeQualifier == 0) &&
	      (UnitInfo->DeviceClaimed == FALSE))
	    {
	      DPRINT("Vendor: '%.24s'\n",
		     InquiryData->VendorId);

	      /* Create device objects for disk */
	      Status = DiskClassCreateDeviceObject(DriverObject,
						   RegistryPath,
						   PortDeviceObject,
						   PortNumber,
						   ConfigInfo->DiskCount,
						   PortCapabilities,
						   UnitInfo,
						   InitializationData);
	      if (NT_SUCCESS(Status))
		{
		  ConfigInfo->DiskCount++;
		  FoundDevice = TRUE;
		}
	    }

	  if (UnitInfo->NextInquiryDataOffset == 0)
	    break;

	  UnitInfo = (PSCSI_INQUIRY_DATA)(Buffer + UnitInfo->NextInquiryDataOffset);
	}
    }

  ExFreePool(Buffer);

  DPRINT("DiskClassFindDevices() done\n");

  return(FoundDevice);
}


static VOID
DiskClassCreateMediaChangeEvent(IN PDEVICE_EXTENSION DeviceExtension,
				 IN ULONG DeviceNumber)
{
  WCHAR NameBuffer[MAX_PATH];
  UNICODE_STRING Name;

  swprintf (NameBuffer,
	    L"\\Device\\MediaChangeEvent%lu",
	    DeviceNumber);
  RtlInitUnicodeString (&Name,
			NameBuffer);

  DeviceExtension->MediaChangeEvent =
    IoCreateSynchronizationEvent (&Name,
				  &DeviceExtension->MediaChangeEventHandle);

  KeClearEvent (DeviceExtension->MediaChangeEvent);
}



/**********************************************************************
 * NAME							EXPORTED
 *	DiskClassCheckDevice
 *
 * DESCRIPTION
 *	This function checks the InquiryData for the correct device
 *	type and qualifier.
 *
 * RUN LEVEL
 *	PASSIVE_LEVEL
 *
 * ARGUMENTS
 *	InquiryData
 *		Pointer to the inquiry data for the device in question.
 *
 * RETURN VALUE
 *	TRUE: A disk device was found.
 *	FALSE: Otherwise.
 */

BOOLEAN STDCALL
DiskClassCheckDevice(IN PINQUIRYDATA InquiryData)
{
   11080:	55                   	push   %ebp
   11081:	89 e5                	mov    %esp,%ebp
   11083:	53                   	push   %ebx
  return((InquiryData->DeviceType == DIRECT_ACCESS_DEVICE ||
   11084:	31 db                	xor    %ebx,%ebx
   11086:	8b 45 08             	mov    0x8(%ebp),%eax
   11089:	8a 08                	mov    (%eax),%cl
   1108b:	88 c8                	mov    %cl,%al
   1108d:	83 e0 1f             	and    $0x1f,%eax
   11090:	0f 94 c2             	sete   %dl
   11093:	3c 07                	cmp    $0x7,%al
   11095:	0f 94 c0             	sete   %al
   11098:	09 d0                	or     %edx,%eax
   1109a:	a8 01                	test   $0x1,%al
   1109c:	74 07                	je     110a5 <_DiskClassCheckDevice@4+0x25>
   1109e:	80 e1 e0             	and    $0xe0,%cl
   110a1:	75 02                	jne    110a5 <_DiskClassCheckDevice@4+0x25>
   110a3:	b3 01                	mov    $0x1,%bl
	  InquiryData->DeviceType == OPTICAL_DEVICE) &&
	 InquiryData->DeviceTypeQualifier == 0);
}
   110a5:	89 d8                	mov    %ebx,%eax
   110a7:	5b                   	pop    %ebx
   110a8:	5d                   	pop    %ebp
   110a9:	c2 04 00             	ret    $0x4
   110ac:	8d 74 26 00          	lea    0x0(%esi),%esi

000110b0 <_DiskClassCheckReadWrite@8>:


/**********************************************************************
 * NAME							EXPORTED
 *	DiskClassCheckReadWrite
 *
 * DESCRIPTION
 *	This function checks the given IRP for correct data.
 *
 * RUN LEVEL
 *	PASSIVE_LEVEL
 *
 * ARGUMENTS
 *	DeviceObject
 *		Pointer to the device.
 *
 *	Irp
 *		Irp to check.
 *
 * RETURN VALUE
 *	STATUS_SUCCESS: The IRP matches the requirements of the given device.
 *	Others: Failure.
 */

NTSTATUS STDCALL
DiskClassCheckReadWrite(IN PDEVICE_OBJECT DeviceObject,
			IN PIRP Irp)
{
   110b0:	55                   	push   %ebp
   110b1:	89 e5                	mov    %esp,%ebp
   110b3:	57                   	push   %edi
   110b4:	56                   	push   %esi
   110b5:	53                   	push   %ebx
   110b6:	83 ec 0c             	sub    $0xc,%esp
   110b9:	8b 4d 08             	mov    0x8(%ebp),%ecx
   110bc:	8b 7d 0c             	mov    0xc(%ebp),%edi
  PDEVICE_EXTENSION DeviceExtension;
  PDISK_DATA DiskData;
  PIO_STACK_LOCATION IrpStack;
  ULARGE_INTEGER EndingOffset;

  DPRINT("DiskClassCheckReadWrite() called\n");

  DeviceExtension = DeviceObject->DeviceExtension;
   110bf:	8b 51 28             	mov    0x28(%ecx),%edx
  DiskData = (PDISK_DATA)(DeviceExtension + 1);

  if (DiskData->DriveNotReady == TRUE)
   110c2:	80 ba f2 00 00 00 01 	cmpb   $0x1,0xf2(%edx)
   110c9:	74 79                	je     11144 <_DiskClassCheckReadWrite@8+0x94>
    {
      Irp->IoStatus.Status = STATUS_DEVICE_NOT_READY;
      IoSetHardErrorOrVerifyDevice(Irp,
				   DeviceObject);
      return(STATUS_INVALID_PARAMETER);
    }



  IrpStack = IoGetCurrentIrpStackLocation(Irp);  
   110cb:	8b 47 60             	mov    0x60(%edi),%eax
  EndingOffset.QuadPart = IrpStack->Parameters.Read.ByteOffset.QuadPart +
   110ce:	31 f6                	xor    %esi,%esi
   110d0:	8b 58 04             	mov    0x4(%eax),%ebx
   110d3:	03 58 0c             	add    0xc(%eax),%ebx
   110d6:	13 70 10             	adc    0x10(%eax),%esi
                          IrpStack->Parameters.Read.Length;


  DPRINT("Ending %I64d, and RealEnding %I64d! PartSize %I64d\n",EndingOffset.QuadPart,
          DeviceExtension->PartitionLength.QuadPart,
	  DeviceExtension->PartitionLength.QuadPart /
          DeviceExtension->DiskGeometry->BytesPerSector);

  if ((DeviceObject->Characteristics & FILE_REMOVABLE_MEDIA) &&
   110d9:	f6 41 20 01          	testb  $0x1,0x20(%ecx)
   110dd:	75 31                	jne    11110 <_DiskClassCheckReadWrite@8+0x60>
   110df:	8b 4a 0c             	mov    0xc(%edx),%ecx
   110e2:	8b 52 08             	mov    0x8(%edx),%edx
      (DeviceExtension->DiskGeometry->MediaType == RemovableMedia))
    {
/* Assume if removable media and if Partition length is 0, Partition not built yet! */
	if (DeviceExtension->PartitionLength.QuadPart == 0)
            return(STATUS_SUCCESS);
    }

  if (EndingOffset.QuadPart > DeviceExtension->PartitionLength.QuadPart)
   110e5:	39 ce                	cmp    %ecx,%esi
   110e7:	72 47                	jb     11130 <_DiskClassCheckReadWrite@8+0x80>
   110e9:	77 04                	ja     110ef <_DiskClassCheckReadWrite@8+0x3f>
   110eb:	39 d3                	cmp    %edx,%ebx
   110ed:	76 41                	jbe    11130 <_DiskClassCheckReadWrite@8+0x80>
    {
      Irp->IoStatus.Status = STATUS_INVALID_PARAMETER;
   110ef:	c7 47 18 0d 00 00 c0 	movl   $0xc000000d,0x18(%edi)
      return(STATUS_INVALID_PARAMETER);
   110f6:	c7 45 f0 0d 00 00 c0 	movl   $0xc000000d,0xfffffff0(%ebp)
    }

  return(STATUS_SUCCESS);
}
   110fd:	8b 45 f0             	mov    0xfffffff0(%ebp),%eax
   11100:	8d 65 f4             	lea    0xfffffff4(%ebp),%esp
   11103:	5b                   	pop    %ebx
   11104:	5e                   	pop    %esi
   11105:	5f                   	pop    %edi
   11106:	5d                   	pop    %ebp
   11107:	c2 08 00             	ret    $0x8
   1110a:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi
   11110:	8b 42 44             	mov    0x44(%edx),%eax
   11113:	83 78 08 0b          	cmpl   $0xb,0x8(%eax)
   11117:	75 c6                	jne    110df <_DiskClassCheckReadWrite@8+0x2f>
   11119:	8b 4a 0c             	mov    0xc(%edx),%ecx
   1111c:	8b 52 08             	mov    0x8(%edx),%edx
   1111f:	89 c8                	mov    %ecx,%eax
   11121:	c7 45 f0 00 00 00 00 	movl   $0x0,0xfffffff0(%ebp)
   11128:	09 d0                	or     %edx,%eax
   1112a:	74 d1                	je     110fd <_DiskClassCheckReadWrite@8+0x4d>
   1112c:	eb b7                	jmp    110e5 <_DiskClassCheckReadWrite@8+0x35>
   1112e:	89 f6                	mov    %esi,%esi
   11130:	c7 45 f0 00 00 00 00 	movl   $0x0,0xfffffff0(%ebp)
   11137:	8b 45 f0             	mov    0xfffffff0(%ebp),%eax
   1113a:	8d 65 f4             	lea    0xfffffff4(%ebp),%esp
   1113d:	5b                   	pop    %ebx
   1113e:	5e                   	pop    %esi
   1113f:	5f                   	pop    %edi
   11140:	5d                   	pop    %ebp
   11141:	c2 08 00             	ret    $0x8
   11144:	c7 47 18 a3 00 00 c0 	movl   $0xc00000a3,0x18(%edi)
   1114b:	53                   	push   %ebx
   1114c:	53                   	push   %ebx
   1114d:	51                   	push   %ecx
   1114e:	57                   	push   %edi
   1114f:	e8 5c 1d 00 00       	call   12eb0 <_IoSetHardErrorOrVerifyDevice@8>
   11154:	eb a0                	jmp    110f6 <_DiskClassCheckReadWrite@8+0x46>
   11156:	8d 76 00             	lea    0x0(%esi),%esi
   11159:	8d bc 27 00 00 00 00 	lea    0x0(%edi),%edi

00011160 <_DiskClassShutdownFlush@8>:


/**********************************************************************
 * NAME							INTERNAL
 *	DiskClassCreateDeviceObject
 *
 * DESCRIPTION
 *	Create the raw device and any partition devices on this drive
 *
 * RUN LEVEL
 *	PASSIVE_LEVEL
 *
 * ARGUMENTS
 *	DriverObject
 *		The system created driver object
 *	RegistryPath
 *	PortDeviceObject
 *	PortNumber
 *	DiskNumber
 *	Capabilities
 *	InquiryData
 *	InitialzationData
 *
 * RETURN VALUE
 *	STATUS_SUCCESS: Device objects for disk and partitions were created.
 *	Others: Failure.
 */

static NTSTATUS
DiskClassCreateDeviceObject(IN PDRIVER_OBJECT DriverObject,
			    IN PUNICODE_STRING RegistryPath,
			    IN PDEVICE_OBJECT PortDeviceObject,
			    IN ULONG PortNumber,
			    IN ULONG DiskNumber,
			    IN PIO_SCSI_CAPABILITIES Capabilities,
			    IN PSCSI_INQUIRY_DATA InquiryData,
			    IN PCLASS_INIT_DATA InitializationData)
{
  OBJECT_ATTRIBUTES ObjectAttributes;
  UNICODE_STRING UnicodeDeviceDirName;
  WCHAR NameBuffer[80];
  CHAR NameBuffer2[80];
  PDEVICE_OBJECT DiskDeviceObject;
  PDEVICE_OBJECT PartitionDeviceObject;
  PDEVICE_EXTENSION DiskDeviceExtension; /* defined in class2.h */
  PDEVICE_EXTENSION PartitionDeviceExtension; /* defined in class2.h */
  PDRIVE_LAYOUT_INFORMATION PartitionList = NULL;
  HANDLE Handle;
  PPARTITION_INFORMATION PartitionEntry;
  PDISK_DATA DiskData;
  ULONG PartitionNumber;
  PVOID MbrBuffer;
  NTSTATUS Status;

  DPRINT("DiskClassCreateDeviceObject() called\n");

  /* Create the harddisk device directory */
  swprintf(NameBuffer,
	   L"\\Device\\Harddisk%lu",
	   DiskNumber);
  RtlInitUnicodeString(&UnicodeDeviceDirName,
		       NameBuffer);
  InitializeObjectAttributes(&ObjectAttributes,
			     &UnicodeDeviceDirName,
			     0,
			     NULL,
			     NULL);
  Status = ZwCreateDirectoryObject(&Handle,
				   0,
				   &ObjectAttributes);
  if (!NT_SUCCESS(Status))
    {
      DbgPrint("Could not create device dir object\n");
      return(Status);
    }

  /* Claim the disk device */
  Status = ScsiClassClaimDevice(PortDeviceObject,
				InquiryData,
				FALSE,
				&PortDeviceObject);
  if (!NT_SUCCESS(Status))
    {
      DbgPrint("Could not claim disk device\n");

      ZwMakeTemporaryObject(Handle);
      ZwClose(Handle);

      return(Status);
    }

  /* Create disk device (Partition 0) */
  sprintf(NameBuffer2,
	  "\\Device\\Harddisk%lu\\Partition0",
	  DiskNumber);

  Status = ScsiClassCreateDeviceObject(DriverObject,
				       NameBuffer2,
				       NULL,
				       &DiskDeviceObject,
				       InitializationData);
  if (!NT_SUCCESS(Status))
    {
      DPRINT("ScsiClassCreateDeviceObject() failed (Status %x)\n", Status);

      /* Release (unclaim) the disk */
      ScsiClassClaimDevice(PortDeviceObject,
			   InquiryData,
			   TRUE,
			   NULL);

      /* Delete the harddisk device directory */
      ZwMakeTemporaryObject(Handle);
      ZwClose(Handle);

      return(Status);
    }

  DiskDeviceObject->Flags |= DO_DIRECT_IO;
  if (((PINQUIRYDATA)InquiryData->InquiryData)->RemovableMedia)
    {
      DiskDeviceObject->Characteristics |= FILE_REMOVABLE_MEDIA;
    }
  DiskDeviceObject->StackSize = (CCHAR)PortDeviceObject->StackSize + 1;

  if (PortDeviceObject->AlignmentRequirement > DiskDeviceObject->AlignmentRequirement)
    {
      DiskDeviceObject->AlignmentRequirement = PortDeviceObject->AlignmentRequirement;
    }

  DiskDeviceExtension = DiskDeviceObject->DeviceExtension;
  DiskDeviceExtension->LockCount = 0;
  DiskDeviceExtension->DeviceNumber = DiskNumber;
  DiskDeviceExtension->DeviceObject = DiskDeviceObject;
  DiskDeviceExtension->PortDeviceObject = PortDeviceObject;
  DiskDeviceExtension->PhysicalDevice = DiskDeviceObject;
  DiskDeviceExtension->PortCapabilities = Capabilities;
  DiskDeviceExtension->StartingOffset.QuadPart = 0;
  DiskDeviceExtension->PortNumber = (UCHAR)PortNumber;
  DiskDeviceExtension->PathId = InquiryData->PathId;
  DiskDeviceExtension->TargetId = InquiryData->TargetId;
  DiskDeviceExtension->Lun = InquiryData->Lun;
  DiskDeviceExtension->SrbFlags = 0;

  /* Enable the command queueing, if it possible */
  if (Capabilities->TaggedQueuing &&
      ((PINQUIRYDATA)InquiryData->InquiryData)->CommandQueue)
    {
      DiskDeviceExtension->SrbFlags |= SRB_FLAGS_QUEUE_ACTION_ENABLE;
    }

  /* Get timeout value */
  DiskDeviceExtension->TimeOutValue =
    ScsiClassQueryTimeOutRegistryValue(RegistryPath);
  if (DiskDeviceExtension->TimeOutValue == 0)
    DiskDeviceExtension->TimeOutValue = SCSI_DISK_TIMEOUT;

  /* Initialize the lookaside list for SRBs */
  ScsiClassInitializeSrbLookasideList(DiskDeviceExtension,
				      4);

  /* zero-out disk data */
  DiskData = (PDISK_DATA)(DiskDeviceExtension + 1);
  RtlZeroMemory(DiskData,
		sizeof(DISK_DATA));

  /* Get disk geometry */
  DiskDeviceExtension->DiskGeometry = ExAllocatePool(NonPagedPool,
						     sizeof(DISK_GEOMETRY));
  if (DiskDeviceExtension->DiskGeometry == NULL)
    {
      DPRINT("Failed to allocate geometry buffer!\n");

      ExDeleteNPagedLookasideList(&DiskDeviceExtension->SrbLookasideListHead);

      IoDeleteDevice(DiskDeviceObject);

      /* Release (unclaim) the disk */
      ScsiClassClaimDevice(PortDeviceObject,
			   InquiryData,
			   TRUE,
			   NULL);

      /* Delete the harddisk device directory */
      ZwMakeTemporaryObject(Handle);
      ZwClose(Handle);

      return(STATUS_INSUFFICIENT_RESOURCES);
    }

  /* Allocate sense data buffer */
  DiskDeviceExtension->SenseData = ExAllocatePool(NonPagedPoolCacheAligned,
						  SENSE_BUFFER_SIZE);
  if (DiskDeviceExtension->SenseData == NULL)
    {
      DPRINT("Failed to allocate sense data buffer!\n");

      ExFreePool (DiskDeviceExtension->DiskGeometry);

      ExDeleteNPagedLookasideList(&DiskDeviceExtension->SrbLookasideListHead);

      IoDeleteDevice(DiskDeviceObject);

      /* Release (unclaim) the disk */
      ScsiClassClaimDevice(PortDeviceObject,
			   InquiryData,
			   TRUE,
			   NULL);

      /* Delete the harddisk device directory */
      ZwMakeTemporaryObject(Handle);
      ZwClose(Handle);

      return(STATUS_INSUFFICIENT_RESOURCES);
    }

  /* Read the drive's capacity */
  Status = ScsiClassReadDriveCapacity(DiskDeviceObject);
  if (!NT_SUCCESS(Status) &&
      (DiskDeviceObject->Characteristics & FILE_REMOVABLE_MEDIA) == 0)
    {
      DPRINT("Failed to retrieve drive capacity!\n");
      return(STATUS_SUCCESS);
    }
  else
    {
      /* Clear the verify flag for removable media drives. */
      DiskDeviceObject->Flags &= ~DO_VERIFY_VOLUME;
    }

  DPRINT("SectorSize: %lu\n", DiskDeviceExtension->DiskGeometry->BytesPerSector);

  if ((DiskDeviceObject->Characteristics & FILE_REMOVABLE_MEDIA) &&
      (DiskDeviceExtension->DiskGeometry->MediaType == RemovableMedia))
    {
      DiskClassCreateMediaChangeEvent(DiskDeviceExtension,DiskNumber); 
      if (DiskDeviceExtension->MediaChangeEvent != NULL)
	{
	  DPRINT("Allocated media change event!\n");
	}
    }

  /* Check disk for presence of a disk manager */
  HalExamineMBR(DiskDeviceObject,
		DiskDeviceExtension->DiskGeometry->BytesPerSector,
		0x54,
		&MbrBuffer);
  if (MbrBuffer != NULL)
    {
      /* Start disk at sector 63 if the Ontrack Disk Manager was found */
      DPRINT("Found 'Ontrack Disk Manager'!\n");

      DiskDeviceExtension->DMSkew = 63;
      DiskDeviceExtension->DMByteSkew =
	63 * DiskDeviceExtension->DiskGeometry->BytesPerSector;
      DiskDeviceExtension->DMActive = TRUE;

      ExFreePool(MbrBuffer);
      MbrBuffer = NULL;
    }

  if ((DiskDeviceObject->Characteristics & FILE_REMOVABLE_MEDIA) &&
      (DiskDeviceExtension->DiskGeometry->MediaType == RemovableMedia))
    {
      /* Allocate a partition list for a single entry. */
      PartitionList = ExAllocatePool(NonPagedPool,
				     sizeof(DRIVE_LAYOUT_INFORMATION));
      if (PartitionList != NULL)
	{
	  RtlZeroMemory(PartitionList,
			sizeof(DRIVE_LAYOUT_INFORMATION));
	  PartitionList->PartitionCount = 1;

	  DiskData->DriveNotReady = TRUE;
	  Status = STATUS_SUCCESS;
	}
    }
  else
    {
      /* Read partition table */
      Status = IoReadPartitionTable(DiskDeviceObject,
				    DiskDeviceExtension->DiskGeometry->BytesPerSector,
				    TRUE,
				    &PartitionList);

      DPRINT("IoReadPartitionTable(): Status: %lx\n", Status);

      if ((!NT_SUCCESS(Status) || PartitionList->PartitionCount == 0) &&
	  DiskDeviceObject->Characteristics & FILE_REMOVABLE_MEDIA)
	{
	  if (!NT_SUCCESS(Status))
	    {
	      /* Drive is not ready. */
	      DPRINT("Drive not ready\n");
	      DiskData->DriveNotReady = TRUE;
	    }
	  else
	    {
	      ExFreePool(PartitionList);
	    }

	  /* Allocate a partition list for a single entry. */
	  PartitionList = ExAllocatePool(NonPagedPool,
					 sizeof(DRIVE_LAYOUT_INFORMATION));
	  if (PartitionList != NULL)
	    {
	      RtlZeroMemory(PartitionList,
			    sizeof(DRIVE_LAYOUT_INFORMATION));
	      PartitionList->PartitionCount = 1;

	      Status = STATUS_SUCCESS;
	    }
	}
    }

  if (NT_SUCCESS(Status))
    {
      DPRINT("Read partition table!\n");
      DPRINT("  Number of partitions: %u\n", PartitionList->PartitionCount);

      /* Set disk signature */
      DiskData->Signature = PartitionList->Signature;

      /* Calculate MBR checksum if disk got no signature */
      if (DiskData->Signature == 0)
	{
	  if (!ScsiDiskCalcMbrCheckSum(DiskDeviceExtension,
				       &DiskData->MbrCheckSum))
	    {
	      DPRINT("MBR checksum calculation failed for disk %lu\n",
		     DiskDeviceExtension->DeviceNumber);
	    }
	  else
	    {
	      DPRINT("MBR checksum for disk %lu is %lx\n",
		     DiskDeviceExtension->DeviceNumber,
		     DiskData->MbrCheckSum);
	    }
	}
      else
	{
	  DPRINT("Signature on disk %lu is %lx\n",
		 DiskDeviceExtension->DeviceNumber,
		 DiskData->Signature);
	}

      /* Update disk geometry if disk is visible to the BIOS */
      ScsiDiskUpdateFixedDiskGeometry(DiskDeviceExtension);

      for (PartitionNumber = 0; PartitionNumber < PartitionList->PartitionCount; PartitionNumber++)
	{
	  PartitionEntry = &PartitionList->PartitionEntry[PartitionNumber];

	  DPRINT("Partition %02ld: nr: %d boot: %1x type: %x offset: %I64d size: %I64d\n",
		 PartitionNumber,
		 PartitionEntry->PartitionNumber,
		 PartitionEntry->BootIndicator,
		 PartitionEntry->PartitionType,
		 PartitionEntry->StartingOffset.QuadPart /
		   DiskDeviceExtension->DiskGeometry->BytesPerSector,
		 PartitionEntry->PartitionLength.QuadPart /
		   DiskDeviceExtension->DiskGeometry->BytesPerSector);

	  /* Create partition device object */
	  sprintf(NameBuffer2,
		  "\\Device\\Harddisk%lu\\Partition%lu",
		  DiskNumber,
		  PartitionNumber + 1);

	  Status = ScsiClassCreateDeviceObject(DriverObject,
					       NameBuffer2,
					       DiskDeviceObject,
					       &PartitionDeviceObject ,
					       InitializationData);
	  DPRINT("ScsiClassCreateDeviceObject(): Status %x\n", Status);
	  if (NT_SUCCESS(Status))
	    {
	      PartitionDeviceObject->Flags = DiskDeviceObject->Flags;
	      PartitionDeviceObject->Characteristics = DiskDeviceObject->Characteristics;
	      PartitionDeviceObject->StackSize = DiskDeviceObject->StackSize;
	      PartitionDeviceObject->AlignmentRequirement = DiskDeviceObject->AlignmentRequirement;

	      PartitionDeviceExtension = PartitionDeviceObject->DeviceExtension;
	      PartitionDeviceExtension->SenseData = DiskDeviceExtension->SenseData;
	      PartitionDeviceExtension->LockCount = 0;
	      PartitionDeviceExtension->DeviceNumber = DiskNumber;
	      PartitionDeviceExtension->DeviceObject = PartitionDeviceObject;
	      PartitionDeviceExtension->PortDeviceObject = PortDeviceObject;
	      PartitionDeviceExtension->DiskGeometry = DiskDeviceExtension->DiskGeometry;
	      PartitionDeviceExtension->PhysicalDevice = DiskDeviceExtension->PhysicalDevice;
	      PartitionDeviceExtension->PortCapabilities = Capabilities;
	      PartitionDeviceExtension->StartingOffset.QuadPart =
		PartitionEntry->StartingOffset.QuadPart;
	      PartitionDeviceExtension->PartitionLength.QuadPart =
		PartitionEntry->PartitionLength.QuadPart;
	      PartitionDeviceExtension->DMSkew = DiskDeviceExtension->DMSkew;
	      PartitionDeviceExtension->DMByteSkew = DiskDeviceExtension->DMByteSkew;
	      PartitionDeviceExtension->DMActive = DiskDeviceExtension->DMActive;
	      PartitionDeviceExtension->PortNumber = (UCHAR)PortNumber;
	      PartitionDeviceExtension->PathId = InquiryData->PathId;
	      PartitionDeviceExtension->TargetId = InquiryData->TargetId;
	      PartitionDeviceExtension->Lun = InquiryData->Lun;
	      PartitionDeviceExtension->SectorShift = DiskDeviceExtension->SectorShift;
	      PartitionDeviceExtension->TimeOutValue = SCSI_DISK_TIMEOUT;

	      /* Initialize lookaside list for SRBs */
	      ScsiClassInitializeSrbLookasideList(PartitionDeviceExtension,
						  8);

	      /* Link current partition device extension to previous disk data */
	      DiskData->NextPartition = PartitionDeviceExtension;

	      /* Initialize current disk data */
	      DiskData = (PDISK_DATA)(PartitionDeviceExtension + 1);
	      DiskData->NextPartition = NULL;
	      DiskData->PartitionType = PartitionEntry->PartitionType;
	      DiskData->PartitionNumber = PartitionNumber + 1;
	      DiskData->PartitionOrdinal = PartitionNumber + 1;
	      DiskData->HiddenSectors = PartitionEntry->HiddenSectors;
	      DiskData->BootIndicator = PartitionEntry->BootIndicator;
	      DiskData->DriveNotReady = FALSE;
	    }
	  else
	    {
	      DPRINT("ScsiClassCreateDeviceObject() failed to create partition device object (Status %x)\n", Status);

	      break;
	    }
	}
    }

  if (PartitionList != NULL)
    ExFreePool(PartitionList);

  DPRINT("DiskClassCreateDeviceObjects() done\n");

  return(STATUS_SUCCESS);
}


static NTSTATUS
DiskBuildPartitionTable(IN PDEVICE_OBJECT DiskDeviceObject,
                        IN PIRP Irp)
{
  PDRIVE_LAYOUT_INFORMATION PartitionList = NULL;
  PDEVICE_EXTENSION DiskDeviceExtension, DDE;
  PDISK_DATA DiskData, DD;
  PPARTITION_INFORMATION PartitionEntry;
  ULONG PartitionNumber;
  NTSTATUS Status;

  DPRINT("DiskBuildPartitionTable() start\n");

  DiskDeviceExtension = (PDEVICE_EXTENSION)DiskDeviceObject->DeviceExtension;
  DiskData = (PDISK_DATA)(DiskDeviceExtension + 1);

  DDE = (PDEVICE_EXTENSION) DiskDeviceExtension->PhysicalDevice->DeviceExtension;
  DD = (PDISK_DATA)(DDE +1);

  /* Clear flag for Partition0, just incase it was set. */
  DD->DriveNotReady = FALSE;

  Status = ScsiClassReadDriveCapacity(DiskDeviceObject);
  if (!NT_SUCCESS(Status))
    {
      /* Drive is not ready. */
      DPRINT("Drive not ready\n");
      DiskData->DriveNotReady = TRUE;
      return Status;
    }

  /* Read partition table */
  Status = IoReadPartitionTable(DiskDeviceExtension->PhysicalDevice,
				DiskDeviceExtension->DiskGeometry->BytesPerSector,
				TRUE,
				&PartitionList);

  DPRINT("IoReadPartitionTable(): Status: %lx\n", Status);

  if (!NT_SUCCESS(Status))
    {
      /* Drive is not ready. */
      DPRINT("Drive not ready\n");
      DiskData->DriveNotReady = TRUE;
      if (PartitionList != NULL)
	ExFreePool(PartitionList);
      return Status;
    }

  if (NT_SUCCESS(Status))
    {
      DPRINT("Read partition table!\n");
      DPRINT("  Number of partitions: %u\n", PartitionList->PartitionCount);

      /* Set disk signature */
      DiskData->Signature = PartitionList->Signature;

      DiskData->NextPartition = NULL;

      if (PartitionList->PartitionCount)
        {
	  for (PartitionNumber = 0; PartitionNumber < PartitionList->PartitionCount; PartitionNumber++)
	    {
	      PartitionEntry = &PartitionList->PartitionEntry[PartitionNumber];

	      DiskData->PartitionType = PartitionEntry->PartitionType;
	      DiskData->PartitionNumber = PartitionNumber + 1;
	      DiskData->PartitionOrdinal = PartitionNumber + 1;
	      DiskData->HiddenSectors = PartitionEntry->HiddenSectors;
	      DiskData->BootIndicator = PartitionEntry->BootIndicator;
	      DiskData->DriveNotReady = FALSE;
	      DiskDeviceExtension->StartingOffset = PartitionEntry->StartingOffset;
	      DiskDeviceExtension->PartitionLength = PartitionEntry->PartitionLength;

	      DPRINT1("Partition %02ld: nr: %d boot: %1x type: %x offset: %I64d size: %I64d\n",
		      PartitionNumber,
		      DiskData->PartitionNumber,
		      DiskData->BootIndicator,
		      DiskData->PartitionType,
		      DiskDeviceExtension->StartingOffset.QuadPart /
			DiskDeviceExtension->DiskGeometry->BytesPerSector,
		      DiskDeviceExtension->PartitionLength.QuadPart /
			DiskDeviceExtension->DiskGeometry->BytesPerSector);
	    }
	}
      else
	{
	  DiskData->PartitionType = 0;
	  DiskData->PartitionNumber = 1;
	  DiskData->PartitionOrdinal = 0;
	  DiskData->HiddenSectors = 0;
	  DiskData->BootIndicator = 0;
	  DiskData->DriveNotReady = FALSE;
	  DiskDeviceExtension->StartingOffset.QuadPart = 0;
	  DiskDeviceExtension->PartitionLength.QuadPart += DiskDeviceExtension->StartingOffset.QuadPart;
	}
    }

  DPRINT("DiskBuildPartitionTable() done\n");
  if (PartitionList != NULL)
       ExFreePool(PartitionList);
  return(STATUS_SUCCESS);
}


/**********************************************************************
 * NAME							EXPORTED
 *	DiskClassDeviceControl
 *
 * DESCRIPTION
 *	Answer requests for device control calls
 *
 * RUN LEVEL
 *	PASSIVE_LEVEL
 *
 * ARGUMENTS
 *	Standard dispatch arguments
 *
 * RETURNS
 *	Status
 */

NTSTATUS STDCALL
DiskClassDeviceControl(IN PDEVICE_OBJECT DeviceObject,
		       IN PIRP Irp)
{ 
  PDEVICE_EXTENSION DeviceExtension;
  PIO_STACK_LOCATION IrpStack;
  ULONG ControlCode, InputLength, OutputLength;
  PDISK_DATA DiskData;
  ULONG Information;
  NTSTATUS Status;

  DPRINT("DiskClassDeviceControl() called!\n");

  Status = STATUS_INVALID_DEVICE_REQUEST;
  Information = 0;
  IrpStack = IoGetCurrentIrpStackLocation(Irp);
  ControlCode = IrpStack->Parameters.DeviceIoControl.IoControlCode;
  InputLength = IrpStack->Parameters.DeviceIoControl.InputBufferLength;
  OutputLength = IrpStack->Parameters.DeviceIoControl.OutputBufferLength;
  DeviceExtension = (PDEVICE_EXTENSION)DeviceObject->DeviceExtension;
  DiskData = (PDISK_DATA)(DeviceExtension + 1);

  switch (ControlCode)
    {
      case IOCTL_DISK_GET_DRIVE_GEOMETRY:
	DPRINT("IOCTL_DISK_GET_DRIVE_GEOMETRY\n");
	if (IrpStack->Parameters.DeviceIoControl.OutputBufferLength < sizeof(DISK_GEOMETRY))
	  {
	    Status = STATUS_INVALID_PARAMETER;
	    break;
	  }

	if (DeviceExtension->DiskGeometry == NULL)
	  {
	    DPRINT("No disk geometry available!\n");
	    DeviceExtension->DiskGeometry = ExAllocatePool(NonPagedPool,
							   sizeof(DISK_GEOMETRY));
	  }

	if (DeviceObject->Characteristics & FILE_REMOVABLE_MEDIA)
	  {
	    Status = ScsiClassReadDriveCapacity(DeviceObject);
	    DPRINT("ScsiClassReadDriveCapacity() returned (Status %lx)\n", Status);
	    if (!NT_SUCCESS(Status))
	      {
		/* Drive is not ready */
		DiskData->DriveNotReady = TRUE;
		break;
	      }

	    /* Drive is ready */
	    DiskData->DriveNotReady = FALSE;
	  }

	RtlMoveMemory(Irp->AssociatedIrp.SystemBuffer,
		      DeviceExtension->DiskGeometry,
		      sizeof(DISK_GEOMETRY));

	Status = STATUS_SUCCESS;
	Information = sizeof(DISK_GEOMETRY);
	break;

      case IOCTL_DISK_GET_PARTITION_INFO:
	DPRINT("IOCTL_DISK_GET_PARTITION_INFO\n");

	if ((DeviceObject->Characteristics & FILE_REMOVABLE_MEDIA) &&
	(DeviceExtension->DiskGeometry->MediaType == RemovableMedia))
	{
		/* Update a partition list for a single entry. */
		Status = DiskBuildPartitionTable(DeviceObject,Irp);
	}
	
	if (IrpStack->Parameters.DeviceIoControl.OutputBufferLength <
	    sizeof(PARTITION_INFORMATION))
	  {
	    Status = STATUS_INFO_LENGTH_MISMATCH;
	  }
	else if (DiskData->PartitionNumber == 0)
	  {
	    Status = STATUS_INVALID_DEVICE_REQUEST;
	  }
	else
	{
	    PPARTITION_INFORMATION PartitionInfo;

	    PartitionInfo = (PPARTITION_INFORMATION)Irp->AssociatedIrp.SystemBuffer;

	    PartitionInfo->PartitionType = DiskData->PartitionType;
	    PartitionInfo->StartingOffset = DeviceExtension->StartingOffset;
	    PartitionInfo->PartitionLength = DeviceExtension->PartitionLength;
	    PartitionInfo->HiddenSectors = DiskData->HiddenSectors;
	    PartitionInfo->PartitionNumber = DiskData->PartitionNumber;
	    PartitionInfo->BootIndicator = DiskData->BootIndicator;
	    PartitionInfo->RewritePartition = FALSE;
	    PartitionInfo->RecognizedPartition =
	      IsRecognizedPartition(DiskData->PartitionType);

	    Status = STATUS_SUCCESS;
	    Information = sizeof(PARTITION_INFORMATION);
	  }
	break;

      case IOCTL_DISK_SET_PARTITION_INFO:
	if (IrpStack->Parameters.DeviceIoControl.InputBufferLength <
	    sizeof(SET_PARTITION_INFORMATION))
	  {
	    Status = STATUS_INFO_LENGTH_MISMATCH;
	  }
	else if (DiskData->PartitionNumber == 0)
	  {
	    Status = STATUS_INVALID_DEVICE_REQUEST;
	  }
	else
	  {
	    PSET_PARTITION_INFORMATION PartitionInfo;

	    PartitionInfo = (PSET_PARTITION_INFORMATION)Irp->AssociatedIrp.SystemBuffer;

	    Status = IoSetPartitionInformation(DeviceExtension->PhysicalDevice,
					       DeviceExtension->DiskGeometry->BytesPerSector,
					       DiskData->PartitionOrdinal,
					       PartitionInfo->PartitionType);
	    if (NT_SUCCESS(Status))
	      {
		DiskData->PartitionType = PartitionInfo->PartitionType;
	      }
	  }
	break;

      case IOCTL_DISK_GET_DRIVE_LAYOUT:
	if (IrpStack->Parameters.DeviceIoControl.OutputBufferLength <
	    sizeof(DRIVE_LAYOUT_INFORMATION))
	  {
	    Status = STATUS_BUFFER_TOO_SMALL;
	  }
	else
	  {
	    PDRIVE_LAYOUT_INFORMATION PartitionList;

	    Status = IoReadPartitionTable(DeviceExtension->PhysicalDevice,
					  DeviceExtension->DiskGeometry->BytesPerSector,
					  FALSE,
					  &PartitionList);
	    if (NT_SUCCESS(Status))
	      {
		ULONG BufferSize;

		BufferSize = FIELD_OFFSET(DRIVE_LAYOUT_INFORMATION,
					  PartitionEntry[0]);
		BufferSize += PartitionList->PartitionCount * sizeof(PARTITION_INFORMATION);

		if (BufferSize > IrpStack->Parameters.DeviceIoControl.OutputBufferLength)
		  {
		    Status = STATUS_BUFFER_TOO_SMALL;
		  }
		else
		  {
		    RtlMoveMemory(Irp->AssociatedIrp.SystemBuffer,
				  PartitionList,
				  BufferSize);
		    Status = STATUS_SUCCESS;
		    Information = BufferSize;
		  }
		ExFreePool(PartitionList);
	      }
	  }
	break;

      case IOCTL_DISK_SET_DRIVE_LAYOUT:
	if (IrpStack->Parameters.DeviceIoControl.InputBufferLength <
	    sizeof(DRIVE_LAYOUT_INFORMATION))
	  {
	    Status = STATUS_INFO_LENGTH_MISMATCH;
	  }
	else if (DeviceExtension->PhysicalDevice->DeviceExtension != DeviceExtension)
	  {
	    Status = STATUS_INVALID_PARAMETER;
	  }
	else
	  {
	    PDRIVE_LAYOUT_INFORMATION PartitionList;
	    ULONG TableSize;

	    PartitionList = Irp->AssociatedIrp.SystemBuffer;
	    TableSize = sizeof(DRIVE_LAYOUT_INFORMATION) +
			((PartitionList->PartitionCount - 1) * sizeof(PARTITION_INFORMATION));

	    if (IrpStack->Parameters.DeviceIoControl.InputBufferLength < TableSize)
	      {
		Status = STATUS_BUFFER_TOO_SMALL;
	      }
	    else
	      {
		/* Update partition device objects */
		DiskClassUpdatePartitionDeviceObjects (DeviceObject,
						       Irp);

		/* Write partition table */
		Status = IoWritePartitionTable(DeviceExtension->PhysicalDevice,
					       DeviceExtension->DiskGeometry->BytesPerSector,
					       DeviceExtension->DiskGeometry->SectorsPerTrack,
					       DeviceExtension->DiskGeometry->TracksPerCylinder,
					       PartitionList);
	      }
	  }
	break;

      case IOCTL_DISK_IS_WRITABLE:
	{
	  PMODE_PARAMETER_HEADER ModeData;
	  ULONG Length;

	  ModeData = ExAllocatePool (NonPagedPool,
				     MODE_DATA_SIZE);
	  if (ModeData == NULL)
	    {
	      Status = STATUS_INSUFFICIENT_RESOURCES;
	      break;
	    }
	  RtlZeroMemory (ModeData,
			 MODE_DATA_SIZE);

	  Length = ScsiClassModeSense (DeviceObject,
				       (PVOID)ModeData,
				       MODE_DATA_SIZE,
				       MODE_SENSE_RETURN_ALL);
	  if (Length < sizeof(MODE_PARAMETER_HEADER))
	    {
	      /* FIXME: Retry */
	      Status = STATUS_IO_DEVICE_ERROR;
	      ExFreePool (ModeData);
	      break;
	    }

	  if (ModeData->DeviceSpecificParameter & MODE_DSP_WRITE_PROTECT)
	    {
	      Status = STATUS_MEDIA_WRITE_PROTECTED;
	    }
	  else
	    {
	      Status = STATUS_SUCCESS;
	    }
	  ExFreePool (ModeData);
	}
	break;

      case IOCTL_DISK_VERIFY:
      case IOCTL_DISK_FORMAT_TRACKS:
      case IOCTL_DISK_PERFORMANCE:
      case IOCTL_DISK_LOGGING:
      case IOCTL_DISK_FORMAT_TRACKS_EX:
      case IOCTL_DISK_HISTOGRAM_STRUCTURE:
      case IOCTL_DISK_HISTOGRAM_DATA:
      case IOCTL_DISK_HISTOGRAM_RESET:
      case IOCTL_DISK_REQUEST_STRUCTURE:
      case IOCTL_DISK_REQUEST_DATA:
	/* If we get here, something went wrong. Inform the requestor */
	DPRINT("Unhandled control code: %lx\n", ControlCode);
	Status = STATUS_INVALID_DEVICE_REQUEST;
	Information = 0;
	break;

      default:
	/* Call the common device control function */
	return(ScsiClassDeviceControl(DeviceObject, Irp));
    }

  /* Verify the device if the user caused the error */
  if (!NT_SUCCESS(Status) && IoIsErrorUserInduced(Status))
    {
      IoSetHardErrorOrVerifyDevice(Irp, DeviceObject);
    }

  Irp->IoStatus.Status = Status;
  Irp->IoStatus.Information = Information;
  IoCompleteRequest(Irp,
		    IO_NO_INCREMENT);

  return(Status);
}


/**********************************************************************
 * NAME							EXPORTED
 *	DiskClassShutdownFlush
 *
 * DESCRIPTION
 *	Answer requests for shutdown and flush calls.
 *
 * RUN LEVEL
 *	PASSIVE_LEVEL
 *
 * ARGUMENTS
 *	DeviceObject
 *		Pointer to the device.
 *
 *	Irp
 *		Pointer to the IRP
 *
 * RETURN VALUE
 *	Status
 */

NTSTATUS STDCALL
DiskClassShutdownFlush(IN PDEVICE_OBJECT DeviceObject,
		       IN PIRP Irp)
{
   11160:	55                   	push   %ebp
   11161:	89 e5                	mov    %esp,%ebp
   11163:	57                   	push   %edi
   11164:	56                   	push   %esi
   11165:	53                   	push   %ebx
   11166:	83 ec 14             	sub    $0x14,%esp
   11169:	8b 45 08             	mov    0x8(%ebp),%eax
   1116c:	8b 75 0c             	mov    0xc(%ebp),%esi
   1116f:	89 45 f0             	mov    %eax,0xfffffff0(%ebp)
  PDEVICE_EXTENSION DeviceExtension;
  PIO_STACK_LOCATION IrpStack;
  PSCSI_REQUEST_BLOCK Srb;

  DPRINT("DiskClassShutdownFlush() called!\n");

  DeviceExtension = DeviceObject->DeviceExtension;
   11172:	8b 78 28             	mov    0x28(%eax),%edi

  /* Allocate SRB */
  Srb = ExAllocatePool(NonPagedPool,
   11175:	6a 40                	push   $0x40
   11177:	6a 00                	push   $0x0
   11179:	e8 42 1d 00 00       	call   12ec0 <_ExAllocatePool@8>
   1117e:	89 c3                	mov    %eax,%ebx
		       sizeof(SCSI_REQUEST_BLOCK));
  if (Srb == NULL)
   11180:	58                   	pop    %eax
   11181:	85 db                	test   %ebx,%ebx
   11183:	5a                   	pop    %edx
   11184:	0f 84 aa 00 00 00    	je     11234 <_DiskClassShutdownFlush@8+0xd4>
    {
      Irp->IoStatus.Status = STATUS_INSUFFICIENT_RESOURCES;
      Irp->IoStatus.Information = 0;
      IoCompleteRequest(Irp, IO_NO_INCREMENT);

      return(STATUS_INSUFFICIENT_RESOURCES);
    }

  /* Initialize SRB */
  RtlZeroMemory(Srb, sizeof(SCSI_REQUEST_BLOCK));
   1118a:	50                   	push   %eax
   1118b:	50                   	push   %eax
   1118c:	6a 40                	push   $0x40
   1118e:	53                   	push   %ebx
   1118f:	e8 0c 1d 00 00       	call   12ea0 <_RtlZeroMemory@8>
  Srb->Length = sizeof(SCSI_REQUEST_BLOCK);
   11194:	66 c7 03 40 00       	movw   $0x40,(%ebx)

  /* Set device IDs */
  Srb->PathId = DeviceExtension->PathId;
   11199:	8a 87 bd 00 00 00    	mov    0xbd(%edi),%al
   1119f:	88 43 05             	mov    %al,0x5(%ebx)
  Srb->TargetId = DeviceExtension->TargetId;
   111a2:	8a 87 be 00 00 00    	mov    0xbe(%edi),%al
   111a8:	88 43 06             	mov    %al,0x6(%ebx)
  Srb->Lun = DeviceExtension->Lun;
   111ab:	8a 87 bf 00 00 00    	mov    0xbf(%edi),%al
   111b1:	88 43 07             	mov    %al,0x7(%ebx)

  /* Set timeout */
  Srb->TimeOutValue = DeviceExtension->TimeOutValue * 4;
   111b4:	8b 47 50             	mov    0x50(%edi),%eax

  /* Flush write cache */
  Srb->Function = SRB_FUNCTION_EXECUTE_SCSI;
   111b7:	c6 43 02 00          	movb   $0x0,0x2(%ebx)
   111bb:	c1 e0 02             	shl    $0x2,%eax
  Srb->SrbFlags = SRB_FLAGS_NO_DATA_TRANSFER;
  Srb->CdbLength = 10;
   111be:	c6 43 0a 0a          	movb   $0xa,0xa(%ebx)
   111c2:	89 43 14             	mov    %eax,0x14(%ebx)
  Srb->Cdb[0] = SCSIOP_SYNCHRONIZE_CACHE;
   111c5:	c6 43 30 35          	movb   $0x35,0x30(%ebx)
   111c9:	c7 43 0c 00 00 00 00 	movl   $0x0,0xc(%ebx)
  ScsiClassSendSrbSynchronous(DeviceObject,
   111d0:	50                   	push   %eax
   111d1:	6a 01                	push   $0x1
   111d3:	6a 00                	push   $0x0
   111d5:	6a 00                	push   $0x0
   111d7:	53                   	push   %ebx
   111d8:	8b 45 f0             	mov    0xfffffff0(%ebp),%eax
   111db:	50                   	push   %eax
   111dc:	e8 ff 1b 00 00       	call   12de0 <_ScsiClassSendSrbSynchronous@20>
			      Srb,
			      NULL,
			      0,
			      TRUE);

  /* Get current stack location */
  IrpStack = IoGetCurrentIrpStackLocation(Irp);
   111e1:	8b 46 60             	mov    0x60(%esi),%eax

  /* FIXME: Unlock removable media upon shutdown */


  /* No retry */
  IrpStack->Parameters.Others.Argument4 = (PVOID)0;

  /* Send shutdown or flush request to the port driver */
  Srb->CdbLength = 0;
  if (IrpStack->MajorFunction == IRP_MJ_SHUTDOWN)
   111e4:	83 c4 0c             	add    $0xc,%esp
   111e7:	c7 40 10 00 00 00 00 	movl   $0x0,0x10(%eax)
   111ee:	c6 43 0a 00          	movb   $0x0,0xa(%ebx)
    Srb->Function = SRB_FUNCTION_SHUTDOWN;
   111f2:	80 38 10             	cmpb   $0x10,(%eax)
   111f5:	0f 95 c0             	setne  %al
   111f8:	83 c0 07             	add    $0x7,%eax
   111fb:	88 43 02             	mov    %al,0x2(%ebx)
  else
    Srb->Function = SRB_FUNCTION_FLUSH;

  /* Init completion routine */
  IoSetCompletionRoutine(Irp,
   111fe:	8b 46 60             	mov    0x60(%esi),%eax
   11201:	83 e8 24             	sub    $0x24,%eax
   11204:	c6 40 03 e0          	movb   $0xe0,0x3(%eax)
   11208:	89 58 20             	mov    %ebx,0x20(%eax)
   1120b:	c7 40 1c f0 2d 01 00 	movl   $0x12df0,0x1c(%eax)
			 ScsiClassIoComplete,
			 Srb,
			 TRUE,
			 TRUE,
			 TRUE);

  /* Prepare next stack location for a call to the port driver */
  IrpStack = IoGetNextIrpStackLocation(Irp);
   11212:	8b 46 60             	mov    0x60(%esi),%eax
  IrpStack->MajorFunction = IRP_MJ_SCSI;
   11215:	c6 40 dc 0f          	movb   $0xf,0xffffffdc(%eax)
  IrpStack->Parameters.Scsi.Srb = Srb;
   11219:	89 58 e0             	mov    %ebx,0xffffffe0(%eax)
  Srb->OriginalRequest = Irp;

  /* Call port driver */
  return(IoCallDriver(DeviceExtension->PortDeviceObject, Irp));
   1121c:	8b 47 04             	mov    0x4(%edi),%eax
   1121f:	89 73 24             	mov    %esi,0x24(%ebx)
   11222:	89 75 0c             	mov    %esi,0xc(%ebp)
   11225:	89 45 08             	mov    %eax,0x8(%ebp)
}
   11228:	8d 65 f4             	lea    0xfffffff4(%ebp),%esp
   1122b:	5b                   	pop    %ebx
   1122c:	5e                   	pop    %esi
   1122d:	5f                   	pop    %edi
   1122e:	5d                   	pop    %ebp
   1122f:	e9 9c 1c 00 00       	jmp    12ed0 <_IoCallDriver@8>
   11234:	c7 46 18 9a 00 00 c0 	movl   $0xc000009a,0x18(%esi)
   1123b:	c7 46 1c 00 00 00 00 	movl   $0x0,0x1c(%esi)
   11242:	57                   	push   %edi
   11243:	57                   	push   %edi
   11244:	6a 00                	push   $0x0
   11246:	56                   	push   %esi
   11247:	e8 94 1c 00 00       	call   12ee0 <_IoCompleteRequest@8>
   1124c:	8d 65 f4             	lea    0xfffffff4(%ebp),%esp
   1124f:	b8 9a 00 00 c0       	mov    $0xc000009a,%eax
   11254:	5b                   	pop    %ebx
   11255:	5e                   	pop    %esi
   11256:	5f                   	pop    %edi
   11257:	5d                   	pop    %ebp
   11258:	c2 08 00             	ret    $0x8
   1125b:	90                   	nop    
   1125c:	8d 74 26 00          	lea    0x0(%esi),%esi

00011260 <_DiskClassDeviceControl@8>:
   11260:	55                   	push   %ebp
   11261:	89 e5                	mov    %esp,%ebp
   11263:	57                   	push   %edi
   11264:	56                   	push   %esi
   11265:	53                   	push   %ebx
   11266:	81 ec 8c 02 00 00    	sub    $0x28c,%esp
   1126c:	c7 85 bc fd ff ff 00 	movl   $0x0,0xfffffdbc(%ebp)
   11273:	00 00 00 
   11276:	8b 45 0c             	mov    0xc(%ebp),%eax
   11279:	8b 55 08             	mov    0x8(%ebp),%edx
   1127c:	bb 10 00 00 c0       	mov    $0xc0000010,%ebx
   11281:	8b 70 60             	mov    0x60(%eax),%esi
   11284:	8b 7a 28             	mov    0x28(%edx),%edi
   11287:	8b 46 0c             	mov    0xc(%esi),%eax
   1128a:	8d 8f d8 00 00 00    	lea    0xd8(%edi),%ecx
   11290:	89 8d c0 fd ff ff    	mov    %ecx,0xfffffdc0(%ebp)
   11296:	3d 38 00 07 00       	cmp    $0x70038,%eax
   1129b:	0f 84 51 01 00 00    	je     113f2 <_DiskClassDeviceControl@8+0x192>
   112a1:	77 4d                	ja     112f0 <_DiskClassDeviceControl@8+0x90>
   112a3:	3d 24 00 07 00       	cmp    $0x70024,%eax
   112a8:	0f 84 12 03 00 00    	je     115c0 <_DiskClassDeviceControl@8+0x360>
   112ae:	0f 86 d2 01 00 00    	jbe    11486 <_DiskClassDeviceControl@8+0x226>
   112b4:	3d 30 00 07 00       	cmp    $0x70030,%eax
   112b9:	0f 84 33 01 00 00    	je     113f2 <_DiskClassDeviceControl@8+0x192>
   112bf:	0f 87 f1 02 00 00    	ja     115b6 <_DiskClassDeviceControl@8+0x356>
   112c5:	3d 28 00 07 00       	cmp    $0x70028,%eax
   112ca:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi
   112d0:	0f 84 1c 01 00 00    	je     113f2 <_DiskClassDeviceControl@8+0x192>
   112d6:	50                   	push   %eax
   112d7:	50                   	push   %eax
   112d8:	8b 45 0c             	mov    0xc(%ebp),%eax
   112db:	50                   	push   %eax
   112dc:	8b 45 08             	mov    0x8(%ebp),%eax
   112df:	50                   	push   %eax
   112e0:	e8 1b 1b 00 00       	call   12e00 <_ScsiClassDeviceControl@8>
   112e5:	8d 65 f4             	lea    0xfffffff4(%ebp),%esp
   112e8:	5b                   	pop    %ebx
   112e9:	5e                   	pop    %esi
   112ea:	5f                   	pop    %edi
   112eb:	5d                   	pop    %ebp
   112ec:	c2 08 00             	ret    $0x8
   112ef:	90                   	nop    
   112f0:	3d 0c 40 07 00       	cmp    $0x7400c,%eax
   112f5:	0f 84 56 02 00 00    	je     11551 <_DiskClassDeviceControl@8+0x2f1>
   112fb:	0f 87 0f 02 00 00    	ja     11510 <_DiskClassDeviceControl@8+0x2b0>
   11301:	3d 40 00 07 00       	cmp    $0x70040,%eax
   11306:	0f 84 e6 00 00 00    	je     113f2 <_DiskClassDeviceControl@8+0x192>
   1130c:	0f 86 31 03 00 00    	jbe    11643 <_DiskClassDeviceControl@8+0x3e3>
   11312:	3d 04 40 07 00       	cmp    $0x74004,%eax
   11317:	75 bd                	jne    112d6 <_DiskClassDeviceControl@8+0x76>
   11319:	8b 4d 08             	mov    0x8(%ebp),%ecx
   1131c:	f6 41 20 01          	testb  $0x1,0x20(%ecx)
   11320:	74 0d                	je     1132f <_DiskClassDeviceControl@8+0xcf>
   11322:	8b 47 44             	mov    0x44(%edi),%eax
   11325:	83 78 08 0b          	cmpl   $0xb,0x8(%eax)
   11329:	0f 84 23 08 00 00    	je     11b52 <_DiskClassDeviceControl@8+0x8f2>
   1132f:	bb 04 00 00 c0       	mov    $0xc0000004,%ebx
   11334:	83 7e 04 1f          	cmpl   $0x1f,0x4(%esi)
   11338:	0f 86 c3 00 00 00    	jbe    11401 <_DiskClassDeviceControl@8+0x1a1>
   1133e:	8b b5 c0 fd ff ff    	mov    0xfffffdc0(%ebp),%esi
   11344:	b3 10                	mov    $0x10,%bl
   11346:	8b 46 10             	mov    0x10(%esi),%eax
   11349:	85 c0                	test   %eax,%eax
   1134b:	0f 84 b0 00 00 00    	je     11401 <_DiskClassDeviceControl@8+0x1a1>
   11351:	8b 45 0c             	mov    0xc(%ebp),%eax
   11354:	8b 58 0c             	mov    0xc(%eax),%ebx
   11357:	8a 46 18             	mov    0x18(%esi),%al
   1135a:	88 43 18             	mov    %al,0x18(%ebx)
   1135d:	8b 47 10             	mov    0x10(%edi),%eax
   11360:	8b 57 14             	mov    0x14(%edi),%edx
   11363:	89 53 04             	mov    %edx,0x4(%ebx)
   11366:	89 03                	mov    %eax,(%ebx)
   11368:	8b 47 08             	mov    0x8(%edi),%eax
   1136b:	8b 57 0c             	mov    0xc(%edi),%edx
   1136e:	89 53 0c             	mov    %edx,0xc(%ebx)
   11371:	89 43 08             	mov    %eax,0x8(%ebx)
   11374:	8b 46 0c             	mov    0xc(%esi),%eax
   11377:	89 43 10             	mov    %eax,0x10(%ebx)
   1137a:	8b 46 10             	mov    0x10(%esi),%eax
   1137d:	89 43 14             	mov    %eax,0x14(%ebx)
   11380:	8a 46 19             	mov    0x19(%esi),%al
   11383:	c6 43 1b 00          	movb   $0x0,0x1b(%ebx)
   11387:	88 43 19             	mov    %al,0x19(%ebx)
   1138a:	31 f6                	xor    %esi,%esi
   1138c:	8b 95 c0 fd ff ff    	mov    0xfffffdc0(%ebp),%edx
   11392:	8a 4a 18             	mov    0x18(%edx),%cl
   11395:	80 f9 01             	cmp    $0x1,%cl
   11398:	0f 94 c2             	sete   %dl
   1139b:	80 f9 04             	cmp    $0x4,%cl
   1139e:	0f 94 c0             	sete   %al
   113a1:	08 c2                	or     %al,%dl
   113a3:	0f 85 47 05 00 00    	jne    118f0 <_DiskClassDeviceControl@8+0x690>
   113a9:	80 f9 06             	cmp    $0x6,%cl
   113ac:	0f 84 3e 05 00 00    	je     118f0 <_DiskClassDeviceControl@8+0x690>
   113b2:	80 f9 07             	cmp    $0x7,%cl
   113b5:	0f 84 35 05 00 00    	je     118f0 <_DiskClassDeviceControl@8+0x690>
   113bb:	80 f9 0b             	cmp    $0xb,%cl
   113be:	0f 84 2c 05 00 00    	je     118f0 <_DiskClassDeviceControl@8+0x690>
   113c4:	80 f9 0c             	cmp    $0xc,%cl
   113c7:	0f 84 23 05 00 00    	je     118f0 <_DiskClassDeviceControl@8+0x690>
   113cd:	80 f9 0e             	cmp    $0xe,%cl
   113d0:	0f 84 1a 05 00 00    	je     118f0 <_DiskClassDeviceControl@8+0x690>
   113d6:	80 f9 83             	cmp    $0x83,%cl
   113d9:	0f 84 11 05 00 00    	je     118f0 <_DiskClassDeviceControl@8+0x690>
   113df:	89 f1                	mov    %esi,%ecx
   113e1:	88 4b 1a             	mov    %cl,0x1a(%ebx)
   113e4:	31 db                	xor    %ebx,%ebx
   113e6:	c7 85 bc fd ff ff 20 	movl   $0x20,0xfffffdbc(%ebp)
   113ed:	00 00 00 
   113f0:	eb 6f                	jmp    11461 <_DiskClassDeviceControl@8+0x201>
   113f2:	bb 10 00 00 c0       	mov    $0xc0000010,%ebx
   113f7:	c7 85 bc fd ff ff 00 	movl   $0x0,0xfffffdbc(%ebp)
   113fe:	00 00 00 
   11401:	81 fb a3 00 00 c0    	cmp    $0xc00000a3,%ebx
   11407:	0f 94 c2             	sete   %dl
   1140a:	81 fb b5 00 00 c0    	cmp    $0xc00000b5,%ebx
   11410:	0f 94 c0             	sete   %al
   11413:	09 d0                	or     %edx,%eax
   11415:	a8 01                	test   $0x1,%al
   11417:	75 37                	jne    11450 <_DiskClassDeviceControl@8+0x1f0>
   11419:	81 fb a2 00 00 c0    	cmp    $0xc00000a2,%ebx
   1141f:	0f 94 c2             	sete   %dl
   11422:	81 fb 06 00 00 c1    	cmp    $0xc1000006,%ebx
   11428:	0f 94 c0             	sete   %al
   1142b:	09 d0                	or     %edx,%eax
   1142d:	a8 01                	test   $0x1,%al
   1142f:	75 1f                	jne    11450 <_DiskClassDeviceControl@8+0x1f0>
   11431:	81 fb 16 00 00 80    	cmp    $0x80000016,%ebx
   11437:	0f 94 c2             	sete   %dl
   1143a:	81 fb 14 00 00 c0    	cmp    $0xc0000014,%ebx
   11440:	0f 94 c0             	sete   %al
   11443:	09 d0                	or     %edx,%eax
   11445:	a8 01                	test   $0x1,%al
   11447:	0f 84 f3 00 00 00    	je     11540 <_DiskClassDeviceControl@8+0x2e0>
   1144d:	8d 76 00             	lea    0x0(%esi),%esi
   11450:	50                   	push   %eax
   11451:	50                   	push   %eax
   11452:	8b 45 08             	mov    0x8(%ebp),%eax
   11455:	50                   	push   %eax
   11456:	8b 45 0c             	mov    0xc(%ebp),%eax
   11459:	50                   	push   %eax
   1145a:	e8 51 1a 00 00       	call   12eb0 <_IoSetHardErrorOrVerifyDevice@8>
   1145f:	5e                   	pop    %esi
   11460:	5f                   	pop    %edi
   11461:	8b 55 0c             	mov    0xc(%ebp),%edx
   11464:	8b 8d bc fd ff ff    	mov    0xfffffdbc(%ebp),%ecx
   1146a:	89 5a 18             	mov    %ebx,0x18(%edx)
   1146d:	89 4a 1c             	mov    %ecx,0x1c(%edx)
   11470:	51                   	push   %ecx
   11471:	51                   	push   %ecx
   11472:	6a 00                	push   $0x0
   11474:	52                   	push   %edx
   11475:	e8 66 1a 00 00       	call   12ee0 <_IoCompleteRequest@8>
   1147a:	8d 65 f4             	lea    0xfffffff4(%ebp),%esp
   1147d:	89 d8                	mov    %ebx,%eax
   1147f:	5b                   	pop    %ebx
   11480:	5e                   	pop    %esi
   11481:	5f                   	pop    %edi
   11482:	5d                   	pop    %ebp
   11483:	c2 08 00             	ret    $0x8
   11486:	3d 14 00 07 00       	cmp    $0x70014,%eax
   1148b:	0f 84 61 ff ff ff    	je     113f2 <_DiskClassDeviceControl@8+0x192>
   11491:	0f 87 15 01 00 00    	ja     115ac <_DiskClassDeviceControl@8+0x34c>
   11497:	3d 00 00 07 00       	cmp    $0x70000,%eax
   1149c:	0f 85 34 fe ff ff    	jne    112d6 <_DiskClassDeviceControl@8+0x76>
   114a2:	bb 0d 00 00 c0       	mov    $0xc000000d,%ebx
   114a7:	83 7e 04 17          	cmpl   $0x17,0x4(%esi)
   114ab:	0f 86 50 ff ff ff    	jbe    11401 <_DiskClassDeviceControl@8+0x1a1>
   114b1:	8b 5f 44             	mov    0x44(%edi),%ebx
   114b4:	85 db                	test   %ebx,%ebx
   114b6:	0f 84 81 06 00 00    	je     11b3d <_DiskClassDeviceControl@8+0x8dd>
   114bc:	8b 5d 08             	mov    0x8(%ebp),%ebx
   114bf:	f6 43 20 01          	testb  $0x1,0x20(%ebx)
   114c3:	74 20                	je     114e5 <_DiskClassDeviceControl@8+0x285>
   114c5:	83 ec 0c             	sub    $0xc,%esp
   114c8:	53                   	push   %ebx
   114c9:	e8 42 19 00 00       	call   12e10 <_ScsiClassReadDriveCapacity@4>
   114ce:	83 c4 0c             	add    $0xc,%esp
   114d1:	89 c3                	mov    %eax,%ebx
   114d3:	85 c0                	test   %eax,%eax
   114d5:	0f 88 05 08 00 00    	js     11ce0 <_DiskClassDeviceControl@8+0xa80>
   114db:	8b 85 c0 fd ff ff    	mov    0xfffffdc0(%ebp),%eax
   114e1:	c6 40 1a 00          	movb   $0x0,0x1a(%eax)
   114e5:	50                   	push   %eax
   114e6:	6a 18                	push   $0x18
   114e8:	31 db                	xor    %ebx,%ebx
   114ea:	8b 47 44             	mov    0x44(%edi),%eax
   114ed:	50                   	push   %eax
   114ee:	8b 55 0c             	mov    0xc(%ebp),%edx
   114f1:	8b 7a 0c             	mov    0xc(%edx),%edi
   114f4:	57                   	push   %edi
   114f5:	e8 f6 19 00 00       	call   12ef0 <_RtlMoveMemory@12>
   114fa:	c7 85 bc fd ff ff 18 	movl   $0x18,0xfffffdbc(%ebp)
   11501:	00 00 00 
   11504:	5e                   	pop    %esi
   11505:	e9 57 ff ff ff       	jmp    11461 <_DiskClassDeviceControl@8+0x201>
   1150a:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi
   11510:	3d 10 c0 07 00       	cmp    $0x7c010,%eax
   11515:	0f 84 32 01 00 00    	je     1164d <_DiskClassDeviceControl@8+0x3ed>
   1151b:	0f 87 0d 01 00 00    	ja     1162e <_DiskClassDeviceControl@8+0x3ce>
   11521:	3d 08 c0 07 00       	cmp    $0x7c008,%eax
   11526:	0f 85 aa fd ff ff    	jne    112d6 <_DiskClassDeviceControl@8+0x76>
   1152c:	83 7e 08 03          	cmpl   $0x3,0x8(%esi)
   11530:	0f 87 6a 03 00 00    	ja     118a0 <_DiskClassDeviceControl@8+0x640>
   11536:	bb 04 00 00 c0       	mov    $0xc0000004,%ebx
   1153b:	e9 c1 fe ff ff       	jmp    11401 <_DiskClassDeviceControl@8+0x1a1>
   11540:	81 fb 12 00 00 c0    	cmp    $0xc0000012,%ebx
   11546:	0f 85 15 ff ff ff    	jne    11461 <_DiskClassDeviceControl@8+0x201>
   1154c:	e9 ff fe ff ff       	jmp    11450 <_DiskClassDeviceControl@8+0x1f0>
   11551:	bb 23 00 00 c0       	mov    $0xc0000023,%ebx
   11556:	83 7e 04 27          	cmpl   $0x27,0x4(%esi)
   1155a:	0f 86 a1 fe ff ff    	jbe    11401 <_DiskClassDeviceControl@8+0x1a1>
   11560:	51                   	push   %ecx
   11561:	51                   	push   %ecx
   11562:	8b 47 44             	mov    0x44(%edi),%eax
   11565:	8b 4f 48             	mov    0x48(%edi),%ecx
   11568:	8b 50 14             	mov    0x14(%eax),%edx
   1156b:	8d 85 d0 fd ff ff    	lea    0xfffffdd0(%ebp),%eax
   11571:	50                   	push   %eax
   11572:	6a 00                	push   $0x0
   11574:	e8 87 19 00 00       	call   12f00 <@IoReadPartitionTable@16>
   11579:	89 c3                	mov    %eax,%ebx
   1157b:	58                   	pop    %eax
   1157c:	85 db                	test   %ebx,%ebx
   1157e:	5a                   	pop    %edx
   1157f:	0f 88 7c fe ff ff    	js     11401 <_DiskClassDeviceControl@8+0x1a1>
   11585:	8b 95 d0 fd ff ff    	mov    0xfffffdd0(%ebp),%edx
   1158b:	bb 23 00 00 c0       	mov    $0xc0000023,%ebx
   11590:	8b 02                	mov    (%edx),%eax
   11592:	c1 e0 05             	shl    $0x5,%eax
   11595:	8d 78 08             	lea    0x8(%eax),%edi
   11598:	39 7e 04             	cmp    %edi,0x4(%esi)
   1159b:	0f 83 e2 02 00 00    	jae    11883 <_DiskClassDeviceControl@8+0x623>
   115a1:	83 ec 0c             	sub    $0xc,%esp
   115a4:	8b b5 d0 fd ff ff    	mov    0xfffffdd0(%ebp),%esi
   115aa:	eb 6c                	jmp    11618 <_DiskClassDeviceControl@8+0x3b8>
   115ac:	3d 20 00 07 00       	cmp    $0x70020,%eax
   115b1:	e9 1a fd ff ff       	jmp    112d0 <_DiskClassDeviceControl@8+0x70>
   115b6:	3d 34 00 07 00       	cmp    $0x70034,%eax
   115bb:	e9 10 fd ff ff       	jmp    112d0 <_DiskClassDeviceControl@8+0x70>
   115c0:	51                   	push   %ecx
   115c1:	51                   	push   %ecx
   115c2:	68 c0 00 00 00       	push   $0xc0
   115c7:	6a 00                	push   $0x0
   115c9:	e8 f2 18 00 00       	call   12ec0 <_ExAllocatePool@8>
   115ce:	89 c6                	mov    %eax,%esi
   115d0:	bb 9a 00 00 c0       	mov    $0xc000009a,%ebx
   115d5:	58                   	pop    %eax
   115d6:	85 f6                	test   %esi,%esi
   115d8:	5a                   	pop    %edx
   115d9:	0f 84 22 fe ff ff    	je     11401 <_DiskClassDeviceControl@8+0x1a1>
   115df:	50                   	push   %eax
   115e0:	50                   	push   %eax
   115e1:	68 c0 00 00 00       	push   $0xc0
   115e6:	56                   	push   %esi
   115e7:	e8 b4 18 00 00       	call   12ea0 <_RtlZeroMemory@8>
   115ec:	59                   	pop    %ecx
   115ed:	5f                   	pop    %edi
   115ee:	6a 3f                	push   $0x3f
   115f0:	68 c0 00 00 00       	push   $0xc0
   115f5:	56                   	push   %esi
   115f6:	8b 55 08             	mov    0x8(%ebp),%edx
   115f9:	52                   	push   %edx
   115fa:	e8 21 18 00 00       	call   12e20 <_ScsiClassModeSense@16>
   115ff:	83 f8 03             	cmp    $0x3,%eax
   11602:	0f 86 4d 02 00 00    	jbe    11855 <_DiskClassDeviceControl@8+0x5f5>
   11608:	0f be 5e 02          	movsbl 0x2(%esi),%ebx
   1160c:	c1 fb 1f             	sar    $0x1f,%ebx
   1160f:	83 ec 0c             	sub    $0xc,%esp
   11612:	81 e3 a2 00 00 c0    	and    $0xc00000a2,%ebx
   11618:	56                   	push   %esi
   11619:	e8 f2 18 00 00       	call   12f10 <_ExFreePool@4>
   1161e:	83 c4 0c             	add    $0xc,%esp
   11621:	85 db                	test   %ebx,%ebx
   11623:	0f 89 38 fe ff ff    	jns    11461 <_DiskClassDeviceControl@8+0x201>
   11629:	e9 d3 fd ff ff       	jmp    11401 <_DiskClassDeviceControl@8+0x1a1>
   1162e:	3d 18 c0 07 00       	cmp    $0x7c018,%eax
   11633:	0f 84 b9 fd ff ff    	je     113f2 <_DiskClassDeviceControl@8+0x192>
   11639:	3d 2c c0 07 00       	cmp    $0x7c02c,%eax
   1163e:	e9 8d fc ff ff       	jmp    112d0 <_DiskClassDeviceControl@8+0x70>
   11643:	3d 3c 00 07 00       	cmp    $0x7003c,%eax
   11648:	e9 83 fc ff ff       	jmp    112d0 <_DiskClassDeviceControl@8+0x70>
   1164d:	8b 56 08             	mov    0x8(%esi),%edx
   11650:	bb 04 00 00 c0       	mov    $0xc0000004,%ebx
   11655:	83 fa 27             	cmp    $0x27,%edx
   11658:	0f 86 a3 fd ff ff    	jbe    11401 <_DiskClassDeviceControl@8+0x1a1>
   1165e:	8b 47 48             	mov    0x48(%edi),%eax
   11661:	b3 0d                	mov    $0xd,%bl
   11663:	39 78 28             	cmp    %edi,0x28(%eax)
   11666:	0f 85 95 fd ff ff    	jne    11401 <_DiskClassDeviceControl@8+0x1a1>
   1166c:	8b 4d 0c             	mov    0xc(%ebp),%ecx
   1166f:	bb 23 00 00 c0       	mov    $0xc0000023,%ebx
   11674:	8b 49 0c             	mov    0xc(%ecx),%ecx
   11677:	89 8d b4 fd ff ff    	mov    %ecx,0xfffffdb4(%ebp)
   1167d:	8b 09                	mov    (%ecx),%ecx
   1167f:	89 c8                	mov    %ecx,%eax
   11681:	c1 e0 05             	shl    $0x5,%eax
   11684:	83 c0 08             	add    $0x8,%eax
   11687:	39 c2                	cmp    %eax,%edx
   11689:	0f 82 72 fd ff ff    	jb     11401 <_DiskClassDeviceControl@8+0x1a1>


/**********************************************************************
 * NAME							INTERNAL
 *	DiskClassUpdatePartitionDeviceObjects
 *
 * DESCRIPTION
 *	Deletes, modifies or creates partition device objects.
 *
 * RUN LEVEL
 *	PASSIVE_LEVEL
 *
 * ARGUMENTS
 *	DeviceObject
 *		Pointer to the device.
 *
 *	Irp
 *		Pointer to the IRP
 *
 * RETURN VALUE
 *	None
 */

static VOID
DiskClassUpdatePartitionDeviceObjects(IN PDEVICE_OBJECT DiskDeviceObject,
				      IN PIRP Irp)
{
  PDRIVE_LAYOUT_INFORMATION PartitionList;
  PPARTITION_INFORMATION PartitionEntry;
  PDEVICE_EXTENSION DeviceExtension;
  PDEVICE_EXTENSION DiskDeviceExtension;
  PDISK_DATA DiskData;
  ULONG PartitionCount;
  ULONG PartitionOrdinal;
  ULONG PartitionNumber;
  ULONG LastPartitionNumber;
  ULONG i;
  BOOLEAN Found;
  WCHAR NameBuffer[MAX_PATH];
  UNICODE_STRING DeviceName;
  PDEVICE_OBJECT DeviceObject;
  NTSTATUS Status;

  DPRINT("ScsiDiskUpdatePartitionDeviceObjects() called\n");

  /* Get partition list */
  PartitionList = Irp->AssociatedIrp.SystemBuffer;

  /* Round partition count up by 4 */
  PartitionCount = ((PartitionList->PartitionCount + 3) / 4) * 4;
   1168f:	83 c1 03             	add    $0x3,%ecx
   11692:	83 e1 fc             	and    $0xfffffffc,%ecx
   11695:	89 8d 94 fd ff ff    	mov    %ecx,0xfffffd94(%ebp)

  /* Remove the partition numbers from the partition list */
  for (i = 0; i < PartitionCount; i++)
   1169b:	39 8d bc fd ff ff    	cmp    %ecx,0xfffffdbc(%ebp)
   116a1:	73 20                	jae    116c3 <_DiskClassDeviceControl@8+0x463>
   116a3:	8b 85 b4 fd ff ff    	mov    0xfffffdb4(%ebp),%eax
   116a9:	89 8d 98 fd ff ff    	mov    %ecx,0xfffffd98(%ebp)
   116af:	83 c0 1c             	add    $0x1c,%eax
    {
      PartitionList->PartitionEntry[i].PartitionNumber = 0;
   116b2:	c7 00 00 00 00 00    	movl   $0x0,(%eax)
   116b8:	83 c0 20             	add    $0x20,%eax
   116bb:	ff 8d 98 fd ff ff    	decl   0xfffffd98(%ebp)
   116c1:	75 ef                	jne    116b2 <_DiskClassDeviceControl@8+0x452>
    }

  DiskDeviceExtension = DiskDeviceObject->DeviceExtension;

  /* Traverse on-disk partition list */
  LastPartitionNumber = 0;
  DeviceExtension = DiskDeviceExtension;
  DiskData = (PDISK_DATA)(DeviceExtension + 1);
   116c3:	8d b7 d8 00 00 00    	lea    0xd8(%edi),%esi
   116c9:	c7 85 9c fd ff ff 00 	movl   $0x0,0xfffffd9c(%ebp)
   116d0:	00 00 00 
   116d3:	89 b5 8c fd ff ff    	mov    %esi,0xfffffd8c(%ebp)
   116d9:	89 b5 a8 fd ff ff    	mov    %esi,0xfffffda8(%ebp)
  while (TRUE)
    {
      DeviceExtension = DiskData->NextPartition;
   116df:	8b 85 a8 fd ff ff    	mov    0xfffffda8(%ebp),%eax
   116e5:	8b 00                	mov    (%eax),%eax
   116e7:	89 85 ac fd ff ff    	mov    %eax,0xfffffdac(%ebp)
      if (DeviceExtension == NULL)
   116ed:	85 c0                	test   %eax,%eax
   116ef:	0f 84 05 02 00 00    	je     118fa <_DiskClassDeviceControl@8+0x69a>
	break;

      /* Get disk data */
      DiskData = (PDISK_DATA)(DeviceExtension + 1);
   116f5:	05 d8 00 00 00       	add    $0xd8,%eax

      /* Update last partition number */
      if (DiskData->PartitionNumber > LastPartitionNumber)
   116fa:	8b 8d 9c fd ff ff    	mov    0xfffffd9c(%ebp),%ecx
   11700:	89 85 90 fd ff ff    	mov    %eax,0xfffffd90(%ebp)
   11706:	89 85 a8 fd ff ff    	mov    %eax,0xfffffda8(%ebp)
   1170c:	8b 50 10             	mov    0x10(%eax),%edx
   1170f:	89 95 7c fd ff ff    	mov    %edx,0xfffffd7c(%ebp)
   11715:	39 ca                	cmp    %ecx,%edx
   11717:	76 06                	jbe    1171f <_DiskClassDeviceControl@8+0x4bf>
	LastPartitionNumber = DiskData->PartitionNumber;
   11719:	89 95 9c fd ff ff    	mov    %edx,0xfffffd9c(%ebp)

      /* Ignore unused on-disk partitions */
      if (DeviceExtension->PartitionLength.QuadPart == 0ULL)
   1171f:	8b b5 ac fd ff ff    	mov    0xfffffdac(%ebp),%esi
   11725:	8b 5e 08             	mov    0x8(%esi),%ebx
   11728:	8b 76 0c             	mov    0xc(%esi),%esi
   1172b:	89 b5 84 fd ff ff    	mov    %esi,0xfffffd84(%ebp)
   11731:	89 9d 80 fd ff ff    	mov    %ebx,0xfffffd80(%ebp)
   11737:	09 de                	or     %ebx,%esi
   11739:	74 a4                	je     116df <_DiskClassDeviceControl@8+0x47f>
	continue;

      Found = FALSE;
      PartitionOrdinal = 0;
      for (i = 0; i < PartitionCount; i++)
   1173b:	c7 85 98 fd ff ff 00 	movl   $0x0,0xfffffd98(%ebp)
   11742:	00 00 00 
   11745:	8b 85 94 fd ff ff    	mov    0xfffffd94(%ebp),%eax
   1174b:	c7 85 a4 fd ff ff 00 	movl   $0x0,0xfffffda4(%ebp)
   11752:	00 00 00 
   11755:	39 85 98 fd ff ff    	cmp    %eax,0xfffffd98(%ebp)
   1175b:	0f 83 09 01 00 00    	jae    1186a <_DiskClassDeviceControl@8+0x60a>
   11761:	8b 95 b4 fd ff ff    	mov    0xfffffdb4(%ebp),%edx
   11767:	89 95 78 fd ff ff    	mov    %edx,0xfffffd78(%ebp)
   1176d:	eb 2e                	jmp    1179d <_DiskClassDeviceControl@8+0x53d>
   1176f:	8b 85 98 fd ff ff    	mov    0xfffffd98(%ebp),%eax
   11775:	8b 9d 94 fd ff ff    	mov    0xfffffd94(%ebp),%ebx
   1177b:	40                   	inc    %eax
   1177c:	89 85 98 fd ff ff    	mov    %eax,0xfffffd98(%ebp)
   11782:	8b 85 78 fd ff ff    	mov    0xfffffd78(%ebp),%eax
   11788:	83 c0 20             	add    $0x20,%eax
   1178b:	39 9d 98 fd ff ff    	cmp    %ebx,0xfffffd98(%ebp)
   11791:	89 85 78 fd ff ff    	mov    %eax,0xfffffd78(%ebp)
   11797:	0f 83 cd 00 00 00    	jae    1186a <_DiskClassDeviceControl@8+0x60a>
	{
	  /* Get current partition entry */
	  PartitionEntry = &PartitionList->PartitionEntry[i];
   1179d:	8b 8d 78 fd ff ff    	mov    0xfffffd78(%ebp),%ecx

	  /* Ignore empty (aka unused) or extended partitions */
	  if (PartitionEntry->PartitionType == PARTITION_ENTRY_UNUSED ||
   117a3:	8b 9d 78 fd ff ff    	mov    0xfffffd78(%ebp),%ebx
   117a9:	83 c1 08             	add    $0x8,%ecx
   117ac:	89 8d b0 fd ff ff    	mov    %ecx,0xfffffdb0(%ebp)
   117b2:	8a 43 20             	mov    0x20(%ebx),%al
   117b5:	84 c0                	test   %al,%al
   117b7:	74 b6                	je     1176f <_DiskClassDeviceControl@8+0x50f>
   117b9:	3c 05                	cmp    $0x5,%al
   117bb:	0f 94 c2             	sete   %dl
   117be:	3c 0f                	cmp    $0xf,%al
   117c0:	0f 94 c0             	sete   %al
   117c3:	09 d0                	or     %edx,%eax
   117c5:	a8 01                	test   $0x1,%al
   117c7:	75 a6                	jne    1176f <_DiskClassDeviceControl@8+0x50f>
	      IsContainerPartition (PartitionEntry->PartitionType))
	    continue;

	  PartitionOrdinal++;
   117c9:	8b 8d a4 fd ff ff    	mov    0xfffffda4(%ebp),%ecx

	  /* Check for matching partition start offset and length */
	  if ((PartitionEntry->StartingOffset.QuadPart !=
   117cf:	8b b5 ac fd ff ff    	mov    0xfffffdac(%ebp),%esi
   117d5:	41                   	inc    %ecx
   117d6:	89 8d a4 fd ff ff    	mov    %ecx,0xfffffda4(%ebp)
   117dc:	8b 4b 08             	mov    0x8(%ebx),%ecx
   117df:	8b 5b 0c             	mov    0xc(%ebx),%ebx
   117e2:	8b 46 10             	mov    0x10(%esi),%eax
   117e5:	8b 56 14             	mov    0x14(%esi),%edx
   117e8:	89 de                	mov    %ebx,%esi
   117ea:	31 c8                	xor    %ecx,%eax
   117ec:	31 d6                	xor    %edx,%esi
   117ee:	09 c6                	or     %eax,%esi
   117f0:	0f 85 79 ff ff ff    	jne    1176f <_DiskClassDeviceControl@8+0x50f>
   117f6:	8b 8d 78 fd ff ff    	mov    0xfffffd78(%ebp),%ecx
   117fc:	8b 51 14             	mov    0x14(%ecx),%edx
   117ff:	8b 41 10             	mov    0x10(%ecx),%eax
   11802:	8b 8d 84 fd ff ff    	mov    0xfffffd84(%ebp),%ecx
   11808:	31 d1                	xor    %edx,%ecx
   1180a:	8b 95 80 fd ff ff    	mov    0xfffffd80(%ebp),%edx
   11810:	31 d0                	xor    %edx,%eax
   11812:	09 c1                	or     %eax,%ecx
   11814:	0f 85 55 ff ff ff    	jne    1176f <_DiskClassDeviceControl@8+0x50f>
	       DeviceExtension->StartingOffset.QuadPart) ||
	      (PartitionEntry->PartitionLength.QuadPart !=
	       DeviceExtension->PartitionLength.QuadPart))
	    continue;

	  DPRINT("Found matching partition entry for partition %lu\n",
		  DiskData->PartitionNumber);

	  /* Found matching partition */
	  Found = TRUE;

	  /* Update partition number in partition list */
	  PartitionEntry->PartitionNumber = DiskData->PartitionNumber;
   1181a:	8b b5 b0 fd ff ff    	mov    0xfffffdb0(%ebp),%esi
	  break;
	}

      if (Found == TRUE)
	{
	  /* Get disk data for current partition */
	  DiskData = (PDISK_DATA)(DeviceExtension + 1);
   11820:	8b 95 90 fd ff ff    	mov    0xfffffd90(%ebp),%edx
   11826:	8b 85 7c fd ff ff    	mov    0xfffffd7c(%ebp),%eax
   1182c:	89 95 a8 fd ff ff    	mov    %edx,0xfffffda8(%ebp)
   11832:	89 46 14             	mov    %eax,0x14(%esi)

	  /* Update partition type if partiton will be rewritten */
	  if (PartitionEntry->RewritePartition == TRUE)
   11835:	80 7e 1b 01          	cmpb   $0x1,0x1b(%esi)
   11839:	75 06                	jne    11841 <_DiskClassDeviceControl@8+0x5e1>
	    DiskData->PartitionType = PartitionEntry->PartitionType;
   1183b:	8a 46 18             	mov    0x18(%esi),%al
   1183e:	88 42 18             	mov    %al,0x18(%edx)

	  /* Assign new partiton ordinal */
	  DiskData->PartitionOrdinal = PartitionOrdinal;
   11841:	8b 8d a8 fd ff ff    	mov    0xfffffda8(%ebp),%ecx
   11847:	8b 9d a4 fd ff ff    	mov    0xfffffda4(%ebp),%ebx
   1184d:	89 59 14             	mov    %ebx,0x14(%ecx)
   11850:	e9 8a fe ff ff       	jmp    116df <_DiskClassDeviceControl@8+0x47f>
   11855:	83 ec 0c             	sub    $0xc,%esp
   11858:	66 bb 85 01          	mov    $0x185,%bx
   1185c:	56                   	push   %esi
   1185d:	e8 ae 16 00 00       	call   12f10 <_ExFreePool@4>
   11862:	83 c4 0c             	add    $0xc,%esp
   11865:	e9 97 fb ff ff       	jmp    11401 <_DiskClassDeviceControl@8+0x1a1>

	  DPRINT("Partition ordinal %lu was assigned to partition %lu\n",
		 DiskData->PartitionOrdinal,
		 DiskData->PartitionNumber);
	}
      else
	{
	  /* Delete this partition */
	  DeviceExtension->PartitionLength.QuadPart = 0ULL;
   1186a:	8b b5 ac fd ff ff    	mov    0xfffffdac(%ebp),%esi
   11870:	c7 46 08 00 00 00 00 	movl   $0x0,0x8(%esi)
   11877:	c7 46 0c 00 00 00 00 	movl   $0x0,0xc(%esi)
   1187e:	e9 5c fe ff ff       	jmp    116df <_DiskClassDeviceControl@8+0x47f>
   11883:	50                   	push   %eax
   11884:	57                   	push   %edi
   11885:	52                   	push   %edx
   11886:	8b 45 0c             	mov    0xc(%ebp),%eax
   11889:	31 db                	xor    %ebx,%ebx
   1188b:	8b 40 0c             	mov    0xc(%eax),%eax
   1188e:	50                   	push   %eax
   1188f:	e8 5c 16 00 00       	call   12ef0 <_RtlMoveMemory@12>
   11894:	89 bd bc fd ff ff    	mov    %edi,0xfffffdbc(%ebp)
   1189a:	5f                   	pop    %edi
   1189b:	e9 01 fd ff ff       	jmp    115a1 <_DiskClassDeviceControl@8+0x341>
   118a0:	8b b5 c0 fd ff ff    	mov    0xfffffdc0(%ebp),%esi
   118a6:	8b 46 10             	mov    0x10(%esi),%eax
   118a9:	85 c0                	test   %eax,%eax
   118ab:	0f 84 50 fb ff ff    	je     11401 <_DiskClassDeviceControl@8+0x1a1>
   118b1:	8b 45 0c             	mov    0xc(%ebp),%eax
   118b4:	8b 70 0c             	mov    0xc(%eax),%esi
   118b7:	50                   	push   %eax
   118b8:	50                   	push   %eax
   118b9:	8b 47 44             	mov    0x44(%edi),%eax
   118bc:	8b 4f 48             	mov    0x48(%edi),%ecx
   118bf:	8b 50 14             	mov    0x14(%eax),%edx
   118c2:	8b 06                	mov    (%esi),%eax
   118c4:	50                   	push   %eax
   118c5:	8b 9d c0 fd ff ff    	mov    0xfffffdc0(%ebp),%ebx
   118cb:	8b 43 14             	mov    0x14(%ebx),%eax
   118ce:	50                   	push   %eax
   118cf:	e8 4c 16 00 00       	call   12f20 <@IoSetPartitionInformation@16>
   118d4:	89 c3                	mov    %eax,%ebx
   118d6:	5f                   	pop    %edi
   118d7:	85 db                	test   %ebx,%ebx
   118d9:	58                   	pop    %eax
   118da:	0f 88 21 fb ff ff    	js     11401 <_DiskClassDeviceControl@8+0x1a1>
   118e0:	8b 06                	mov    (%esi),%eax
   118e2:	8b b5 c0 fd ff ff    	mov    0xfffffdc0(%ebp),%esi
   118e8:	88 46 18             	mov    %al,0x18(%esi)
   118eb:	e9 31 fd ff ff       	jmp    11621 <_DiskClassDeviceControl@8+0x3c1>
   118f0:	be 01 00 00 00       	mov    $0x1,%esi
   118f5:	e9 e5 fa ff ff       	jmp    113df <_DiskClassDeviceControl@8+0x17f>

	  DPRINT("Deleting partition %lu\n",
		 DiskData->PartitionNumber);
	}
    }

  /* Traverse partiton list and create new partiton devices */
  PartitionOrdinal = 0;
  for (i = 0; i < PartitionCount; i++)
   118fa:	c7 85 98 fd ff ff 00 	movl   $0x0,0xfffffd98(%ebp)
   11901:	00 00 00 
   11904:	8b 85 94 fd ff ff    	mov    0xfffffd94(%ebp),%eax
   1190a:	c7 85 a4 fd ff ff 00 	movl   $0x0,0xfffffda4(%ebp)
   11911:	00 00 00 
   11914:	39 85 98 fd ff ff    	cmp    %eax,0xfffffd98(%ebp)
   1191a:	0f 83 f1 01 00 00    	jae    11b11 <_DiskClassDeviceControl@8+0x8b1>
   11920:	8b b5 b4 fd ff ff    	mov    0xfffffdb4(%ebp),%esi
   11926:	83 c6 08             	add    $0x8,%esi
   11929:	eb 22                	jmp    1194d <_DiskClassDeviceControl@8+0x6ed>
   1192b:	8b 85 98 fd ff ff    	mov    0xfffffd98(%ebp),%eax
   11931:	83 c6 20             	add    $0x20,%esi
   11934:	40                   	inc    %eax
   11935:	89 85 98 fd ff ff    	mov    %eax,0xfffffd98(%ebp)
   1193b:	8b 85 94 fd ff ff    	mov    0xfffffd94(%ebp),%eax
   11941:	39 85 98 fd ff ff    	cmp    %eax,0xfffffd98(%ebp)
   11947:	0f 83 c4 01 00 00    	jae    11b11 <_DiskClassDeviceControl@8+0x8b1>
    {
      /* Get current partition entry */
      PartitionEntry = &PartitionList->PartitionEntry[i];

      /* Ignore empty (aka unused) or extended partitions */
      if (PartitionEntry->PartitionType == PARTITION_ENTRY_UNUSED ||
   1194d:	8a 46 18             	mov    0x18(%esi),%al
   11950:	84 c0                	test   %al,%al
   11952:	74 d7                	je     1192b <_DiskClassDeviceControl@8+0x6cb>
   11954:	3c 05                	cmp    $0x5,%al
   11956:	0f 94 c2             	sete   %dl
   11959:	3c 0f                	cmp    $0xf,%al
   1195b:	0f 94 c0             	sete   %al
   1195e:	09 d0                	or     %edx,%eax
   11960:	a8 01                	test   $0x1,%al
   11962:	75 c7                	jne    1192b <_DiskClassDeviceControl@8+0x6cb>
	  IsContainerPartition (PartitionEntry->PartitionType))
	continue;

      PartitionOrdinal++;
   11964:	8b 85 a4 fd ff ff    	mov    0xfffffda4(%ebp),%eax
   1196a:	40                   	inc    %eax
   1196b:	89 85 a4 fd ff ff    	mov    %eax,0xfffffda4(%ebp)

      /* Ignore unchanged partition entries */
      if (PartitionEntry->RewritePartition == FALSE)
   11971:	80 7e 1b 00          	cmpb   $0x0,0x1b(%esi)
   11975:	74 b4                	je     1192b <_DiskClassDeviceControl@8+0x6cb>
	continue;

      /* Check for an unused device object */
      PartitionNumber = 0;
      DeviceExtension = DiskDeviceExtension;
      DiskData = (PDISK_DATA)(DeviceExtension + 1);
   11977:	8b 95 8c fd ff ff    	mov    0xfffffd8c(%ebp),%edx
   1197d:	89 95 a8 fd ff ff    	mov    %edx,0xfffffda8(%ebp)
      while (TRUE)
	{
	  DeviceExtension = DiskData->NextPartition;
   11983:	8b 8d a8 fd ff ff    	mov    0xfffffda8(%ebp),%ecx
   11989:	8b 09                	mov    (%ecx),%ecx
   1198b:	89 8d ac fd ff ff    	mov    %ecx,0xfffffdac(%ebp)
	  if (DeviceExtension == NULL)
   11991:	85 c9                	test   %ecx,%ecx
   11993:	74 35                	je     119ca <_DiskClassDeviceControl@8+0x76a>
	    break;

	  /* Get partition disk data */
	  DiskData = (PDISK_DATA)(DeviceExtension + 1);
   11995:	81 c1 d8 00 00 00    	add    $0xd8,%ecx

	  /* Found a free (unused) partition (device object) */
	  if (DeviceExtension->PartitionLength.QuadPart == 0ULL)
   1199b:	8b 9d ac fd ff ff    	mov    0xfffffdac(%ebp),%ebx
   119a1:	89 8d a8 fd ff ff    	mov    %ecx,0xfffffda8(%ebp)
   119a7:	8b 53 0c             	mov    0xc(%ebx),%edx
   119aa:	8b 43 08             	mov    0x8(%ebx),%eax
   119ad:	89 d1                	mov    %edx,%ecx
   119af:	09 c1                	or     %eax,%ecx
   119b1:	75 d0                	jne    11983 <_DiskClassDeviceControl@8+0x723>
	    {
	      PartitionNumber = DiskData->PartitionNumber;
   119b3:	8b 9d a8 fd ff ff    	mov    0xfffffda8(%ebp),%ebx
   119b9:	8b 5b 10             	mov    0x10(%ebx),%ebx
   119bc:	89 9d a0 fd ff ff    	mov    %ebx,0xfffffda0(%ebp)
	      break;
	    }
	}

      if (PartitionNumber == 0)
   119c2:	85 db                	test   %ebx,%ebx
   119c4:	0f 85 f2 00 00 00    	jne    11abc <_DiskClassDeviceControl@8+0x85c>
	{
	  /* Create a new partition device object */
	  DPRINT("Create new partition device object\n");

	  /* Get new partiton number */
	  LastPartitionNumber++;
   119ca:	8b 9d 9c fd ff ff    	mov    0xfffffd9c(%ebp),%ebx
   119d0:	43                   	inc    %ebx
   119d1:	89 9d 9c fd ff ff    	mov    %ebx,0xfffffd9c(%ebp)
	  PartitionNumber = LastPartitionNumber;

	  /* Create partition device object */
	  swprintf(NameBuffer,
   119d7:	8d 9d d8 fd ff ff    	lea    0xfffffdd8(%ebp),%ebx
   119dd:	8b 85 9c fd ff ff    	mov    0xfffffd9c(%ebp),%eax
   119e3:	89 85 a0 fd ff ff    	mov    %eax,0xfffffda0(%ebp)
   119e9:	50                   	push   %eax
   119ea:	8b 4f 54             	mov    0x54(%edi),%ecx
   119ed:	51                   	push   %ecx
   119ee:	68 00 40 01 00       	push   $0x14000
   119f3:	53                   	push   %ebx
   119f4:	e8 77 16 00 00       	call   13070 <_swprintf>
   119f9:	58                   	pop    %eax
   119fa:	5a                   	pop    %edx
		   L"\\Device\\Harddisk%lu\\Partition%lu",
		   DiskDeviceExtension->DeviceNumber,
		   PartitionNumber);
	  RtlInitUnicodeString(&DeviceName,
   119fb:	8d 95 c8 fd ff ff    	lea    0xfffffdc8(%ebp),%edx
   11a01:	53                   	push   %ebx
   11a02:	52                   	push   %edx
   11a03:	e8 28 15 00 00       	call   12f30 <_RtlInitUnicodeString@8>
			       NameBuffer);

	  Status = IoCreateDevice(DiskDeviceObject->DriverObject,
   11a08:	8d 8d c8 fd ff ff    	lea    0xfffffdc8(%ebp),%ecx
   11a0e:	8d 85 c4 fd ff ff    	lea    0xfffffdc4(%ebp),%eax
   11a14:	89 04 24             	mov    %eax,(%esp)
   11a17:	6a 00                	push   $0x0
   11a19:	6a 00                	push   $0x0
   11a1b:	6a 07                	push   $0x7
   11a1d:	51                   	push   %ecx
   11a1e:	68 f4 00 00 00       	push   $0xf4
   11a23:	8b 5d 08             	mov    0x8(%ebp),%ebx
   11a26:	8b 43 08             	mov    0x8(%ebx),%eax
   11a29:	50                   	push   %eax
   11a2a:	e8 11 15 00 00       	call   12f40 <_IoCreateDevice@28>
   11a2f:	59                   	pop    %ecx
				  sizeof(DEVICE_EXTENSION) + sizeof(DISK_DATA),
				  &DeviceName,
				  FILE_DEVICE_DISK,
				  0,
				  FALSE,
				  &DeviceObject);
	  if (!NT_SUCCESS(Status))
   11a30:	85 c0                	test   %eax,%eax
   11a32:	0f 88 f3 fe ff ff    	js     1192b <_DiskClassDeviceControl@8+0x6cb>
	    {
	      DPRINT("IoCreateDevice() failed (Status %lx)\n", Status);
	      continue;
	    }

	  DeviceObject->Flags |= DO_DIRECT_IO;
   11a38:	8b 85 c4 fd ff ff    	mov    0xfffffdc4(%ebp),%eax
   11a3e:	8b 50 1c             	mov    0x1c(%eax),%edx
   11a41:	83 ca 10             	or     $0x10,%edx
   11a44:	89 50 1c             	mov    %edx,0x1c(%eax)
	  DeviceObject->StackSize = DiskDeviceObject->StackSize;
   11a47:	8a 53 30             	mov    0x30(%ebx),%dl
   11a4a:	88 50 30             	mov    %dl,0x30(%eax)
	  DeviceObject->Characteristics = DiskDeviceObject->Characteristics;
   11a4d:	8b 43 20             	mov    0x20(%ebx),%eax
   11a50:	8b 95 c4 fd ff ff    	mov    0xfffffdc4(%ebp),%edx
   11a56:	89 42 20             	mov    %eax,0x20(%edx)
	  DeviceObject->AlignmentRequirement = DiskDeviceObject->AlignmentRequirement;
   11a59:	8b 43 5c             	mov    0x5c(%ebx),%eax
   11a5c:	89 42 5c             	mov    %eax,0x5c(%edx)

	  /* Initialize device extension */
	  DeviceExtension = DeviceObject->DeviceExtension;
   11a5f:	8b 52 28             	mov    0x28(%edx),%edx
   11a62:	89 95 ac fd ff ff    	mov    %edx,0xfffffdac(%ebp)
	  RtlCopyMemory(DeviceExtension,
   11a68:	50                   	push   %eax
   11a69:	68 d8 00 00 00       	push   $0xd8
   11a6e:	8b 43 28             	mov    0x28(%ebx),%eax
   11a71:	50                   	push   %eax
   11a72:	52                   	push   %edx
   11a73:	e8 b8 15 00 00       	call   13030 <_memcpy>
			DiskDeviceObject->DeviceExtension,
			sizeof(DEVICE_EXTENSION));
	  DeviceExtension->DeviceObject = DeviceObject;
   11a78:	8b 95 ac fd ff ff    	mov    0xfffffdac(%ebp),%edx
   11a7e:	8b 85 c4 fd ff ff    	mov    0xfffffdc4(%ebp),%eax
   11a84:	59                   	pop    %ecx
   11a85:	5b                   	pop    %ebx
   11a86:	89 02                	mov    %eax,(%edx)

	  /* Initialize lookaside list for SRBs */
	  ScsiClassInitializeSrbLookasideList(DeviceExtension,
   11a88:	6a 08                	push   $0x8
   11a8a:	52                   	push   %edx
   11a8b:	e8 a0 13 00 00       	call   12e30 <_ScsiClassInitializeSrbLookasideList@8>
					      8);

	  /* Link current partition device extension to previous disk data */
	  DiskData->NextPartition = DeviceExtension;
   11a90:	8b 8d a8 fd ff ff    	mov    0xfffffda8(%ebp),%ecx
   11a96:	58                   	pop    %eax
   11a97:	8b 9d ac fd ff ff    	mov    0xfffffdac(%ebp),%ebx
	  DiskData = (PDISK_DATA)(DeviceExtension + 1);
	  DiskData->NextPartition = NULL;
   11a9d:	8b 85 ac fd ff ff    	mov    0xfffffdac(%ebp),%eax
   11aa3:	5a                   	pop    %edx
   11aa4:	89 19                	mov    %ebx,(%ecx)
   11aa6:	81 c3 d8 00 00 00    	add    $0xd8,%ebx
   11aac:	89 9d a8 fd ff ff    	mov    %ebx,0xfffffda8(%ebp)
   11ab2:	c7 80 d8 00 00 00 00 	movl   $0x0,0xd8(%eax)
   11ab9:	00 00 00 
	}
      else
	{
	  /* Reuse an existing partition device object */
	  DPRINT("Reuse an exisiting partition device object\n");
	  DiskData = (PDISK_DATA)(DeviceExtension + 1);
	}

      /* Update partition data and device extension */
      DiskData->PartitionNumber = PartitionNumber;
   11abc:	8b 95 a8 fd ff ff    	mov    0xfffffda8(%ebp),%edx
   11ac2:	8b 8d a0 fd ff ff    	mov    0xfffffda0(%ebp),%ecx
      DiskData->PartitionOrdinal = PartitionOrdinal;
   11ac8:	8b 9d a4 fd ff ff    	mov    0xfffffda4(%ebp),%ebx
   11ace:	89 4a 10             	mov    %ecx,0x10(%edx)
   11ad1:	89 5a 14             	mov    %ebx,0x14(%edx)
      DiskData->PartitionType = PartitionEntry->PartitionType;
   11ad4:	8a 46 18             	mov    0x18(%esi),%al
   11ad7:	88 42 18             	mov    %al,0x18(%edx)
      DiskData->BootIndicator = PartitionEntry->BootIndicator;
   11ada:	8a 46 19             	mov    0x19(%esi),%al
   11add:	88 42 19             	mov    %al,0x19(%edx)
      DiskData->HiddenSectors = PartitionEntry->HiddenSectors;
   11ae0:	8b 46 10             	mov    0x10(%esi),%eax
      DeviceExtension->StartingOffset = PartitionEntry->StartingOffset;
   11ae3:	8b 8d ac fd ff ff    	mov    0xfffffdac(%ebp),%ecx
   11ae9:	89 42 0c             	mov    %eax,0xc(%edx)
      DeviceExtension->PartitionLength = PartitionEntry->PartitionLength;

      /* Update partition number in the partition list */
      PartitionEntry->PartitionNumber = PartitionNumber;
   11aec:	8b 9d a0 fd ff ff    	mov    0xfffffda0(%ebp),%ebx
   11af2:	8b 06                	mov    (%esi),%eax
   11af4:	8b 56 04             	mov    0x4(%esi),%edx
   11af7:	89 51 14             	mov    %edx,0x14(%ecx)
   11afa:	89 41 10             	mov    %eax,0x10(%ecx)
   11afd:	8b 46 08             	mov    0x8(%esi),%eax
   11b00:	8b 56 0c             	mov    0xc(%esi),%edx
   11b03:	89 51 0c             	mov    %edx,0xc(%ecx)
   11b06:	89 41 08             	mov    %eax,0x8(%ecx)
   11b09:	89 5e 14             	mov    %ebx,0x14(%esi)
   11b0c:	e9 1a fe ff ff       	jmp    1192b <_DiskClassDeviceControl@8+0x6cb>
   11b11:	50                   	push   %eax
   11b12:	8b 47 44             	mov    0x44(%edi),%eax
   11b15:	8b 4f 48             	mov    0x48(%edi),%ecx
   11b18:	8b 50 14             	mov    0x14(%eax),%edx
   11b1b:	8b 85 b4 fd ff ff    	mov    0xfffffdb4(%ebp),%eax
   11b21:	50                   	push   %eax
   11b22:	8b 47 44             	mov    0x44(%edi),%eax
   11b25:	8b 40 0c             	mov    0xc(%eax),%eax
   11b28:	50                   	push   %eax
   11b29:	8b 47 44             	mov    0x44(%edi),%eax
   11b2c:	8b 78 10             	mov    0x10(%eax),%edi
   11b2f:	57                   	push   %edi
   11b30:	e8 1b 14 00 00       	call   12f50 <@IoWritePartitionTable@20>
   11b35:	89 c3                	mov    %eax,%ebx
   11b37:	5e                   	pop    %esi
   11b38:	e9 e4 fa ff ff       	jmp    11621 <_DiskClassDeviceControl@8+0x3c1>
   11b3d:	51                   	push   %ecx
   11b3e:	51                   	push   %ecx
   11b3f:	6a 18                	push   $0x18
   11b41:	6a 00                	push   $0x0
   11b43:	e8 78 13 00 00       	call   12ec0 <_ExAllocatePool@8>
   11b48:	89 47 44             	mov    %eax,0x44(%edi)
   11b4b:	58                   	pop    %eax
   11b4c:	5a                   	pop    %edx
   11b4d:	e9 6a f9 ff ff       	jmp    114bc <_DiskClassDeviceControl@8+0x25c>
   11b52:	8b 47 48             	mov    0x48(%edi),%eax
   11b55:	83 ec 0c             	sub    $0xc,%esp
   11b58:	c7 85 d4 fd ff ff 00 	movl   $0x0,0xfffffdd4(%ebp)
   11b5f:	00 00 00 
   11b62:	8b 40 28             	mov    0x28(%eax),%eax
   11b65:	05 d8 00 00 00       	add    $0xd8,%eax
   11b6a:	c6 40 1a 00          	movb   $0x0,0x1a(%eax)
   11b6e:	51                   	push   %ecx
   11b6f:	e8 9c 12 00 00       	call   12e10 <_ScsiClassReadDriveCapacity@4>
   11b74:	83 c4 0c             	add    $0xc,%esp
   11b77:	85 c0                	test   %eax,%eax
   11b79:	0f 88 70 01 00 00    	js     11cef <_DiskClassDeviceControl@8+0xa8f>
   11b7f:	53                   	push   %ebx
   11b80:	53                   	push   %ebx
   11b81:	8b 47 44             	mov    0x44(%edi),%eax
   11b84:	8b 4f 48             	mov    0x48(%edi),%ecx
   11b87:	8b 50 14             	mov    0x14(%eax),%edx
   11b8a:	8d 85 d4 fd ff ff    	lea    0xfffffdd4(%ebp),%eax
   11b90:	50                   	push   %eax
   11b91:	6a 01                	push   $0x1
   11b93:	e8 68 13 00 00       	call   12f00 <@IoReadPartitionTable@16>
   11b98:	5a                   	pop    %edx
   11b99:	85 c0                	test   %eax,%eax
   11b9b:	59                   	pop    %ecx
   11b9c:	0f 88 99 01 00 00    	js     11d3b <_DiskClassDeviceControl@8+0xadb>
   11ba2:	8b 8d d4 fd ff ff    	mov    0xfffffdd4(%ebp),%ecx
   11ba8:	8b 95 c0 fd ff ff    	mov    0xfffffdc0(%ebp),%edx
   11bae:	c7 87 d8 00 00 00 00 	movl   $0x0,0xd8(%edi)
   11bb5:	00 00 00 
   11bb8:	8b 41 04             	mov    0x4(%ecx),%eax
   11bbb:	89 42 04             	mov    %eax,0x4(%edx)
   11bbe:	83 39 00             	cmpl   $0x0,(%ecx)
   11bc1:	0f 84 37 01 00 00    	je     11cfe <_DiskClassDeviceControl@8+0xa9e>
   11bc7:	c7 85 b8 fd ff ff 00 	movl   $0x0,0xfffffdb8(%ebp)
   11bce:	00 00 00 
   11bd1:	e9 eb 00 00 00       	jmp    11cc1 <_DiskClassDeviceControl@8+0xa61>
   11bd6:	8b 95 b8 fd ff ff    	mov    0xfffffdb8(%ebp),%edx
   11bdc:	8b 9d c0 fd ff ff    	mov    0xfffffdc0(%ebp),%ebx
   11be2:	c1 e2 05             	shl    $0x5,%edx
   11be5:	01 ca                	add    %ecx,%edx
   11be7:	89 d1                	mov    %edx,%ecx
   11be9:	89 95 74 fd ff ff    	mov    %edx,0xfffffd74(%ebp)
   11bef:	83 c1 08             	add    $0x8,%ecx
   11bf2:	8a 41 18             	mov    0x18(%ecx),%al
   11bf5:	88 43 18             	mov    %al,0x18(%ebx)
   11bf8:	8b 85 c0 fd ff ff    	mov    0xfffffdc0(%ebp),%eax
   11bfe:	8b 9d b8 fd ff ff    	mov    0xfffffdb8(%ebp),%ebx
   11c04:	43                   	inc    %ebx
   11c05:	89 58 10             	mov    %ebx,0x10(%eax)
   11c08:	89 58 14             	mov    %ebx,0x14(%eax)
   11c0b:	8b 51 10             	mov    0x10(%ecx),%edx
   11c0e:	89 50 0c             	mov    %edx,0xc(%eax)
   11c11:	8a 51 19             	mov    0x19(%ecx),%dl
   11c14:	c6 40 1a 00          	movb   $0x0,0x1a(%eax)
   11c18:	88 50 19             	mov    %dl,0x19(%eax)
   11c1b:	8b 95 74 fd ff ff    	mov    0xfffffd74(%ebp),%edx
   11c21:	8b 42 08             	mov    0x8(%edx),%eax
   11c24:	8b 52 0c             	mov    0xc(%edx),%edx
   11c27:	89 57 14             	mov    %edx,0x14(%edi)
   11c2a:	89 47 10             	mov    %eax,0x10(%edi)
   11c2d:	8b 41 08             	mov    0x8(%ecx),%eax
   11c30:	8b 51 0c             	mov    0xc(%ecx),%edx
   11c33:	89 57 0c             	mov    %edx,0xc(%edi)
   11c36:	89 47 08             	mov    %eax,0x8(%edi)
   11c39:	50                   	push   %eax
   11c3a:	68 b7 03 00 00       	push   $0x3b7
   11c3f:	68 42 40 01 00       	push   $0x14042
   11c44:	68 49 40 01 00       	push   $0x14049
   11c49:	e8 12 14 00 00       	call   13060 <_DbgPrint>
   11c4e:	8b 47 44             	mov    0x44(%edi),%eax
   11c51:	31 d2                	xor    %edx,%edx
   11c53:	8b 40 14             	mov    0x14(%eax),%eax
   11c56:	52                   	push   %edx
   11c57:	50                   	push   %eax
   11c58:	8b 47 0c             	mov    0xc(%edi),%eax
   11c5b:	50                   	push   %eax
   11c5c:	8b 47 08             	mov    0x8(%edi),%eax
   11c5f:	50                   	push   %eax
   11c60:	e8 1b 14 00 00       	call   13080 <___divdi3>
   11c65:	83 c4 14             	add    $0x14,%esp
   11c68:	52                   	push   %edx
   11c69:	50                   	push   %eax
   11c6a:	8b 47 44             	mov    0x44(%edi),%eax
   11c6d:	83 ec 0c             	sub    $0xc,%esp
   11c70:	31 d2                	xor    %edx,%edx
   11c72:	8b 40 14             	mov    0x14(%eax),%eax
   11c75:	52                   	push   %edx
   11c76:	50                   	push   %eax
   11c77:	8b 47 14             	mov    0x14(%edi),%eax
   11c7a:	50                   	push   %eax
   11c7b:	8b 47 10             	mov    0x10(%edi),%eax
   11c7e:	50                   	push   %eax
   11c7f:	e8 fc 13 00 00       	call   13080 <___divdi3>
   11c84:	83 c4 1c             	add    $0x1c,%esp
   11c87:	52                   	push   %edx
   11c88:	50                   	push   %eax
   11c89:	8b 8d c0 fd ff ff    	mov    0xfffffdc0(%ebp),%ecx
   11c8f:	31 c0                	xor    %eax,%eax
   11c91:	8a 41 18             	mov    0x18(%ecx),%al
   11c94:	50                   	push   %eax
   11c95:	31 c0                	xor    %eax,%eax
   11c97:	8a 41 19             	mov    0x19(%ecx),%al
   11c9a:	50                   	push   %eax
   11c9b:	8b 49 10             	mov    0x10(%ecx),%ecx
   11c9e:	51                   	push   %ecx
   11c9f:	8b 95 b8 fd ff ff    	mov    0xfffffdb8(%ebp),%edx
   11ca5:	52                   	push   %edx
   11ca6:	68 54 40 01 00       	push   $0x14054
   11cab:	e8 b0 13 00 00       	call   13060 <_DbgPrint>
   11cb0:	8b 8d d4 fd ff ff    	mov    0xfffffdd4(%ebp),%ecx
   11cb6:	83 c4 30             	add    $0x30,%esp
   11cb9:	39 19                	cmp    %ebx,(%ecx)
   11cbb:	89 9d b8 fd ff ff    	mov    %ebx,0xfffffdb8(%ebp)
   11cc1:	0f 87 0f ff ff ff    	ja     11bd6 <_DiskClassDeviceControl@8+0x976>
   11cc7:	85 c9                	test   %ecx,%ecx
   11cc9:	0f 84 60 f6 ff ff    	je     1132f <_DiskClassDeviceControl@8+0xcf>
   11ccf:	83 ec 0c             	sub    $0xc,%esp
   11cd2:	51                   	push   %ecx
   11cd3:	e8 38 12 00 00       	call   12f10 <_ExFreePool@4>
   11cd8:	83 c4 0c             	add    $0xc,%esp
   11cdb:	e9 4f f6 ff ff       	jmp    1132f <_DiskClassDeviceControl@8+0xcf>
   11ce0:	8b b5 c0 fd ff ff    	mov    0xfffffdc0(%ebp),%esi
   11ce6:	c6 46 1a 01          	movb   $0x1,0x1a(%esi)
   11cea:	e9 32 f9 ff ff       	jmp    11621 <_DiskClassDeviceControl@8+0x3c1>
   11cef:	8b 9d c0 fd ff ff    	mov    0xfffffdc0(%ebp),%ebx
   11cf5:	c6 43 1a 01          	movb   $0x1,0x1a(%ebx)
   11cf9:	e9 31 f6 ff ff       	jmp    1132f <_DiskClassDeviceControl@8+0xcf>
   11cfe:	8b 9d c0 fd ff ff    	mov    0xfffffdc0(%ebp),%ebx
   11d04:	c6 43 18 00          	movb   $0x0,0x18(%ebx)
   11d08:	c6 43 19 00          	movb   $0x0,0x19(%ebx)
   11d0c:	c6 43 1a 00          	movb   $0x0,0x1a(%ebx)
   11d10:	c7 43 10 01 00 00 00 	movl   $0x1,0x10(%ebx)
   11d17:	8b 8d d4 fd ff ff    	mov    0xfffffdd4(%ebp),%ecx
   11d1d:	c7 43 14 00 00 00 00 	movl   $0x0,0x14(%ebx)
   11d24:	c7 43 0c 00 00 00 00 	movl   $0x0,0xc(%ebx)
   11d2b:	c7 47 10 00 00 00 00 	movl   $0x0,0x10(%edi)
   11d32:	c7 47 14 00 00 00 00 	movl   $0x0,0x14(%edi)
   11d39:	eb 8c                	jmp    11cc7 <_DiskClassDeviceControl@8+0xa67>
   11d3b:	8b 85 c0 fd ff ff    	mov    0xfffffdc0(%ebp),%eax
   11d41:	c6 40 1a 01          	movb   $0x1,0x1a(%eax)
   11d45:	8b 85 d4 fd ff ff    	mov    0xfffffdd4(%ebp),%eax
   11d4b:	85 c0                	test   %eax,%eax
   11d4d:	0f 84 dc f5 ff ff    	je     1132f <_DiskClassDeviceControl@8+0xcf>
   11d53:	83 ec 0c             	sub    $0xc,%esp
   11d56:	50                   	push   %eax
   11d57:	e9 77 ff ff ff       	jmp    11cd3 <_DiskClassDeviceControl@8+0xa73>
   11d5c:	8d 74 26 00          	lea    0x0(%esi),%esi

00011d60 <_DiskClassFindDevices@20>:
   11d60:	55                   	push   %ebp
   11d61:	89 e5                	mov    %esp,%ebp
   11d63:	57                   	push   %edi
   11d64:	56                   	push   %esi
   11d65:	53                   	push   %ebx
   11d66:	81 ec a4 04 00 00    	sub    $0x4a4,%esp
   11d6c:	8d 85 34 fc ff ff    	lea    0xfffffc34(%ebp),%eax
   11d72:	c7 85 78 fb ff ff 00 	movl   $0x0,0xfffffb78(%ebp)
   11d79:	00 00 00 
   11d7c:	c7 85 7c fb ff ff 00 	movl   $0x0,0xfffffb7c(%ebp)
   11d83:	00 00 00 
   11d86:	c6 85 9f fb ff ff 00 	movb   $0x0,0xfffffb9f(%ebp)
   11d8d:	50                   	push   %eax
   11d8e:	8b 45 14             	mov    0x14(%ebp),%eax
   11d91:	50                   	push   %eax
   11d92:	e8 a9 10 00 00       	call   12e40 <_ScsiClassGetCapabilities@8>
   11d97:	31 d2                	xor    %edx,%edx
   11d99:	5e                   	pop    %esi
   11d9a:	85 c0                	test   %eax,%eax
   11d9c:	5f                   	pop    %edi
   11d9d:	78 41                	js     11de0 <_DiskClassFindDevices@20+0x80>
   11d9f:	8d 85 30 fc ff ff    	lea    0xfffffc30(%ebp),%eax
   11da5:	53                   	push   %ebx
   11da6:	53                   	push   %ebx
   11da7:	50                   	push   %eax
   11da8:	8b 4d 14             	mov    0x14(%ebp),%ecx
   11dab:	51                   	push   %ecx
   11dac:	e8 9f 10 00 00       	call   12e50 <_ScsiClassGetInquiryData@8>
   11db1:	5f                   	pop    %edi
   11db2:	5a                   	pop    %edx
   11db3:	31 d2                	xor    %edx,%edx
   11db5:	85 c0                	test   %eax,%eax
   11db7:	78 27                	js     11de0 <_DiskClassFindDevices@20+0x80>
   11db9:	8b 85 30 fc ff ff    	mov    0xfffffc30(%ebp),%eax
   11dbf:	89 85 a8 fb ff ff    	mov    %eax,0xfffffba8(%ebp)
   11dc5:	56                   	push   %esi
   11dc6:	56                   	push   %esi
   11dc7:	50                   	push   %eax
   11dc8:	8b 5d 10             	mov    0x10(%ebp),%ebx
   11dcb:	53                   	push   %ebx
   11dcc:	e8 8f 10 00 00       	call   12e60 <_ScsiClassFindUnclaimedDevices@8>
   11dd1:	5a                   	pop    %edx
   11dd2:	31 d2                	xor    %edx,%edx
   11dd4:	59                   	pop    %ecx
   11dd5:	85 c0                	test   %eax,%eax
   11dd7:	75 13                	jne    11dec <_DiskClassFindDevices@20+0x8c>
   11dd9:	8d b4 26 00 00 00 00 	lea    0x0(%esi),%esi
   11de0:	8d 65 f4             	lea    0xfffffff4(%ebp),%esp
   11de3:	89 d0                	mov    %edx,%eax
   11de5:	5b                   	pop    %ebx
   11de6:	5e                   	pop    %esi
   11de7:	5f                   	pop    %edi
   11de8:	5d                   	pop    %ebp
   11de9:	c2 14 00             	ret    $0x14
   11dec:	e8 6f 11 00 00       	call   12f60 <_IoGetConfigurationInformation@0>
   11df1:	8b 8d a8 fb ff ff    	mov    0xfffffba8(%ebp),%ecx
   11df7:	c7 85 a0 fb ff ff 00 	movl   $0x0,0xfffffba0(%ebp)
   11dfe:	00 00 00 
   11e01:	89 85 ac fb ff ff    	mov    %eax,0xfffffbac(%ebp)
   11e07:	8a 11                	mov    (%ecx),%dl
   11e09:	84 d2                	test   %dl,%dl
   11e0b:	0f 84 a1 00 00 00    	je     11eb2 <_DiskClassFindDevices@20+0x152>
   11e11:	8b 9d a0 fb ff ff    	mov    0xfffffba0(%ebp),%ebx
   11e17:	8b bd a8 fb ff ff    	mov    0xfffffba8(%ebp),%edi
   11e1d:	8b 8d 30 fc ff ff    	mov    0xfffffc30(%ebp),%ecx
   11e23:	8b 44 df 08          	mov    0x8(%edi,%ebx,8),%eax
   11e27:	01 c1                	add    %eax,%ecx
   11e29:	85 c0                	test   %eax,%eax
   11e2b:	89 8d a4 fb ff ff    	mov    %ecx,0xfffffba4(%ebp)
   11e31:	74 62                	je     11e95 <_DiskClassFindDevices@20+0x135>
   11e33:	8b 9d a4 fb ff ff    	mov    0xfffffba4(%ebp),%ebx
   11e39:	8a 4b 0c             	mov    0xc(%ebx),%cl
   11e3c:	88 c8                	mov    %cl,%al
   11e3e:	83 e0 1f             	and    $0x1f,%eax
   11e41:	0f 94 c2             	sete   %dl
   11e44:	3c 07                	cmp    $0x7,%al
   11e46:	0f 94 c0             	sete   %al
   11e49:	09 d0                	or     %edx,%eax
   11e4b:	a8 01                	test   $0x1,%al
   11e4d:	74 11                	je     11e60 <_DiskClassFindDevices@20+0x100>
   11e4f:	80 e1 e0             	and    $0xe0,%cl
   11e52:	75 0c                	jne    11e60 <_DiskClassFindDevices@20+0x100>
   11e54:	80 7b 03 00          	cmpb   $0x0,0x3(%ebx)
   11e58:	74 7b                	je     11ed5 <_DiskClassFindDevices@20+0x175>
   11e5a:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi
   11e60:	8b bd a4 fb ff ff    	mov    0xfffffba4(%ebp),%edi
   11e66:	8b 47 08             	mov    0x8(%edi),%eax
   11e69:	85 c0                	test   %eax,%eax
   11e6b:	0f 84 23 03 00 00    	je     12194 <_DiskClassFindDevices@20+0x434>
   11e71:	8b 95 30 fc ff ff    	mov    0xfffffc30(%ebp),%edx
   11e77:	01 d0                	add    %edx,%eax
   11e79:	8b 95 a8 fb ff ff    	mov    0xfffffba8(%ebp),%edx
   11e7f:	89 85 a4 fb ff ff    	mov    %eax,0xfffffba4(%ebp)
   11e85:	8b 85 a0 fb ff ff    	mov    0xfffffba0(%ebp),%eax
   11e8b:	8b 44 c2 08          	mov    0x8(%edx,%eax,8),%eax
   11e8f:	85 c0                	test   %eax,%eax
   11e91:	75 a0                	jne    11e33 <_DiskClassFindDevices@20+0xd3>
   11e93:	8a 12                	mov    (%edx),%dl
   11e95:	8b bd a0 fb ff ff    	mov    0xfffffba0(%ebp),%edi
   11e9b:	31 c0                	xor    %eax,%eax
   11e9d:	47                   	inc    %edi
   11e9e:	88 d0                	mov    %dl,%al
   11ea0:	89 bd a0 fb ff ff    	mov    %edi,0xfffffba0(%ebp)
   11ea6:	3b 85 a0 fb ff ff    	cmp    0xfffffba0(%ebp),%eax
   11eac:	0f 87 5f ff ff ff    	ja     11e11 <_DiskClassFindDevices@20+0xb1>
   11eb2:	83 ec 0c             	sub    $0xc,%esp
   11eb5:	8b b5 30 fc ff ff    	mov    0xfffffc30(%ebp),%esi
   11ebb:	56                   	push   %esi
   11ebc:	e8 4f 10 00 00       	call   12f10 <_ExFreePool@4>
   11ec1:	31 d2                	xor    %edx,%edx
   11ec3:	8a 95 9f fb ff ff    	mov    0xfffffb9f(%ebp),%dl
   11ec9:	8d 65 f4             	lea    0xfffffff4(%ebp),%esp
   11ecc:	89 d0                	mov    %edx,%eax
   11ece:	5b                   	pop    %ebx
   11ecf:	5e                   	pop    %esi
   11ed0:	5f                   	pop    %edi
   11ed1:	5d                   	pop    %ebp
   11ed2:	c2 14 00             	ret    $0x14
   11ed5:	8b 85 ac fb ff ff    	mov    0xfffffbac(%ebp),%eax
   11edb:	8b 95 34 fc ff ff    	mov    0xfffffc34(%ebp),%edx
   11ee1:	8b 7d 14             	mov    0x14(%ebp),%edi
   11ee4:	89 95 94 fb ff ff    	mov    %edx,0xfffffb94(%ebp)
   11eea:	8b 00                	mov    (%eax),%eax
   11eec:	89 bd 20 fc ff ff    	mov    %edi,0xfffffc20(%ebp)
   11ef2:	89 85 98 fb ff ff    	mov    %eax,0xfffffb98(%ebp)
   11ef8:	c7 85 08 fc ff ff 00 	movl   $0x0,0xfffffc08(%ebp)
   11eff:	00 00 00 
   11f02:	8d 9d 28 ff ff ff    	lea    0xffffff28(%ebp),%ebx
   11f08:	57                   	push   %edi
   11f09:	50                   	push   %eax
   11f0a:	68 9c 40 01 00       	push   $0x1409c
   11f0f:	53                   	push   %ebx
   11f10:	e8 5b 11 00 00       	call   13070 <_swprintf>
   11f15:	59                   	pop    %ecx
   11f16:	5e                   	pop    %esi
   11f17:	53                   	push   %ebx
   11f18:	8d 9d 28 fc ff ff    	lea    0xfffffc28(%ebp),%ebx
   11f1e:	53                   	push   %ebx
   11f1f:	e8 0c 10 00 00       	call   12f30 <_RtlInitUnicodeString@8>
   11f24:	8d 45 c8             	lea    0xffffffc8(%ebp),%eax
   11f27:	c7 45 c8 18 00 00 00 	movl   $0x18,0xffffffc8(%ebp)
   11f2e:	89 5d d0             	mov    %ebx,0xffffffd0(%ebp)
   11f31:	c7 45 d4 00 00 00 00 	movl   $0x0,0xffffffd4(%ebp)
   11f38:	c7 45 cc 00 00 00 00 	movl   $0x0,0xffffffcc(%ebp)
   11f3f:	c7 45 d8 00 00 00 00 	movl   $0x0,0xffffffd8(%ebp)
   11f46:	c7 45 dc 00 00 00 00 	movl   $0x0,0xffffffdc(%ebp)
   11f4d:	89 04 24             	mov    %eax,(%esp)
   11f50:	8d 85 24 fc ff ff    	lea    0xfffffc24(%ebp),%eax
   11f56:	6a 00                	push   $0x0
   11f58:	50                   	push   %eax
   11f59:	e8 12 10 00 00       	call   12f70 <_ZwCreateDirectoryObject@12>
   11f5e:	5a                   	pop    %edx
   11f5f:	89 c6                	mov    %eax,%esi
   11f61:	85 c0                	test   %eax,%eax
   11f63:	0f 88 e3 08 00 00    	js     1284c <_DiskClassFindDevices@20+0xaec>
   11f69:	8d 85 20 fc ff ff    	lea    0xfffffc20(%ebp),%eax
   11f6f:	50                   	push   %eax
   11f70:	6a 00                	push   $0x0
   11f72:	8b 85 a4 fb ff ff    	mov    0xfffffba4(%ebp),%eax
   11f78:	50                   	push   %eax
   11f79:	8b bd 20 fc ff ff    	mov    0xfffffc20(%ebp),%edi
   11f7f:	57                   	push   %edi
   11f80:	e8 eb 0e 00 00       	call   12e70 <_ScsiClassClaimDevice@16>
   11f85:	89 c6                	mov    %eax,%esi
   11f87:	85 c0                	test   %eax,%eax
   11f89:	0f 88 d4 08 00 00    	js     12863 <_DiskClassFindDevices@20+0xb03>
   11f8f:	56                   	push   %esi
   11f90:	8b 9d 98 fb ff ff    	mov    0xfffffb98(%ebp),%ebx
   11f96:	8d 8d d8 fe ff ff    	lea    0xfffffed8(%ebp),%ecx
   11f9c:	53                   	push   %ebx
   11f9d:	8d 9d d8 fe ff ff    	lea    0xfffffed8(%ebp),%ebx
   11fa3:	68 c4 40 01 00       	push   $0x140c4
   11fa8:	51                   	push   %ecx
   11fa9:	e8 a2 10 00 00       	call   13050 <_sprintf>
   11fae:	59                   	pop    %ecx
   11faf:	8b 55 10             	mov    0x10(%ebp),%edx
   11fb2:	8d 85 1c fc ff ff    	lea    0xfffffc1c(%ebp),%eax
   11fb8:	52                   	push   %edx
   11fb9:	50                   	push   %eax
   11fba:	6a 00                	push   $0x0
   11fbc:	53                   	push   %ebx
   11fbd:	8b 45 08             	mov    0x8(%ebp),%eax
   11fc0:	50                   	push   %eax
   11fc1:	e8 ba 0e 00 00       	call   12e80 <_ScsiClassCreateDeviceObject@20>
   11fc6:	83 c4 0c             	add    $0xc,%esp
   11fc9:	89 c6                	mov    %eax,%esi
   11fcb:	85 c0                	test   %eax,%eax
   11fcd:	0f 88 ca 0a 00 00    	js     12a9d <_DiskClassFindDevices@20+0xd3d>
   11fd3:	8b 8d 1c fc ff ff    	mov    0xfffffc1c(%ebp),%ecx
   11fd9:	8b bd a4 fb ff ff    	mov    0xfffffba4(%ebp),%edi
   11fdf:	8b 41 1c             	mov    0x1c(%ecx),%eax
   11fe2:	83 c8 10             	or     $0x10,%eax
   11fe5:	89 41 1c             	mov    %eax,0x1c(%ecx)
   11fe8:	80 7f 0d 00          	cmpb   $0x0,0xd(%edi)
   11fec:	79 09                	jns    11ff7 <_DiskClassFindDevices@20+0x297>
   11fee:	8b 79 20             	mov    0x20(%ecx),%edi
   11ff1:	83 cf 01             	or     $0x1,%edi
   11ff4:	89 79 20             	mov    %edi,0x20(%ecx)
   11ff7:	8b 85 20 fc ff ff    	mov    0xfffffc20(%ebp),%eax
   11ffd:	8a 40 30             	mov    0x30(%eax),%al
   12000:	40                   	inc    %eax
   12001:	88 41 30             	mov    %al,0x30(%ecx)
   12004:	8b 85 20 fc ff ff    	mov    0xfffffc20(%ebp),%eax
   1200a:	8b 8d 1c fc ff ff    	mov    0xfffffc1c(%ebp),%ecx
   12010:	8b 40 5c             	mov    0x5c(%eax),%eax
   12013:	3b 41 5c             	cmp    0x5c(%ecx),%eax
   12016:	76 03                	jbe    1201b <_DiskClassFindDevices@20+0x2bb>
   12018:	89 41 5c             	mov    %eax,0x5c(%ecx)
   1201b:	8b 41 28             	mov    0x28(%ecx),%eax
   1201e:	8b 95 98 fb ff ff    	mov    0xfffffb98(%ebp),%edx
   12024:	89 85 90 fb ff ff    	mov    %eax,0xfffffb90(%ebp)
   1202a:	8b bd 94 fb ff ff    	mov    0xfffffb94(%ebp),%edi
   12030:	8b 9d 90 fb ff ff    	mov    0xfffffb90(%ebp),%ebx
   12036:	89 50 54             	mov    %edx,0x54(%eax)
   12039:	c7 80 b8 00 00 00 00 	movl   $0x0,0xb8(%eax)
   12040:	00 00 00 
   12043:	89 08                	mov    %ecx,(%eax)
   12045:	8b 85 20 fc ff ff    	mov    0xfffffc20(%ebp),%eax
   1204b:	c7 43 10 00 00 00 00 	movl   $0x0,0x10(%ebx)
   12052:	89 43 04             	mov    %eax,0x4(%ebx)
   12055:	8a 45 18             	mov    0x18(%ebp),%al
   12058:	c7 43 14 00 00 00 00 	movl   $0x0,0x14(%ebx)
   1205f:	88 83 bc 00 00 00    	mov    %al,0xbc(%ebx)
   12065:	8b 95 a4 fb ff ff    	mov    0xfffffba4(%ebp),%edx
   1206b:	89 4b 48             	mov    %ecx,0x48(%ebx)
   1206e:	89 7b 40             	mov    %edi,0x40(%ebx)
   12071:	8a 02                	mov    (%edx),%al
   12073:	88 83 bd 00 00 00    	mov    %al,0xbd(%ebx)
   12079:	8a 42 01             	mov    0x1(%edx),%al
   1207c:	88 83 be 00 00 00    	mov    %al,0xbe(%ebx)
   12082:	8a 42 02             	mov    0x2(%edx),%al
   12085:	c7 43 58 00 00 00 00 	movl   $0x0,0x58(%ebx)
   1208c:	88 83 bf 00 00 00    	mov    %al,0xbf(%ebx)
   12092:	80 7f 14 00          	cmpb   $0x0,0x14(%edi)
   12096:	74 0a                	je     120a2 <_DiskClassFindDevices@20+0x342>
   12098:	f6 42 13 02          	testb  $0x2,0x13(%edx)
   1209c:	0f 85 11 07 00 00    	jne    127b3 <_DiskClassFindDevices@20+0xa53>
   120a2:	83 ec 0c             	sub    $0xc,%esp
   120a5:	8b 75 0c             	mov    0xc(%ebp),%esi
   120a8:	56                   	push   %esi
   120a9:	e8 e2 0d 00 00       	call   12e90 <_ScsiClassQueryTimeOutRegistryValue@4>
   120ae:	83 c4 0c             	add    $0xc,%esp
   120b1:	85 c0                	test   %eax,%eax
   120b3:	0f 85 e8 00 00 00    	jne    121a1 <_DiskClassFindDevices@20+0x441>
   120b9:	8b 8d 90 fb ff ff    	mov    0xfffffb90(%ebp),%ecx
   120bf:	c7 41 50 0a 00 00 00 	movl   $0xa,0x50(%ecx)
   120c6:	53                   	push   %ebx
   120c7:	53                   	push   %ebx
   120c8:	6a 04                	push   $0x4
   120ca:	8b 8d 90 fb ff ff    	mov    0xfffffb90(%ebp),%ecx
   120d0:	51                   	push   %ecx
   120d1:	e8 5a 0d 00 00       	call   12e30 <_ScsiClassInitializeSrbLookasideList@8>
   120d6:	8b bd 90 fb ff ff    	mov    0xfffffb90(%ebp),%edi
   120dc:	81 c7 d8 00 00 00    	add    $0xd8,%edi
   120e2:	89 bd 5c fb ff ff    	mov    %edi,0xfffffb5c(%ebp)
   120e8:	89 bd 8c fb ff ff    	mov    %edi,0xfffffb8c(%ebp)
   120ee:	6a 1c                	push   $0x1c
   120f0:	57                   	push   %edi
   120f1:	e8 aa 0d 00 00       	call   12ea0 <_RtlZeroMemory@8>
   120f6:	6a 18                	push   $0x18
   120f8:	6a 00                	push   $0x0
   120fa:	e8 c1 0d 00 00       	call   12ec0 <_ExAllocatePool@8>
   120ff:	5f                   	pop    %edi
   12100:	5a                   	pop    %edx
   12101:	8b 95 90 fb ff ff    	mov    0xfffffb90(%ebp),%edx
   12107:	85 c0                	test   %eax,%eax
   12109:	89 42 44             	mov    %eax,0x44(%edx)
   1210c:	0f 85 9d 00 00 00    	jne    121af <_DiskClassFindDevices@20+0x44f>
   12112:	83 ec 0c             	sub    $0xc,%esp
   12115:	89 d0                	mov    %edx,%eax
   12117:	83 c0 68             	add    $0x68,%eax
   1211a:	50                   	push   %eax
   1211b:	e8 60 0e 00 00       	call   12f80 <_ExDeleteNPagedLookasideList@4>
   12120:	8b 85 1c fc ff ff    	mov    0xfffffc1c(%ebp),%eax
   12126:	50                   	push   %eax
   12127:	e8 64 0e 00 00       	call   12f90 <_IoDeleteDevice@4>
   1212c:	83 c4 0c             	add    $0xc,%esp
   1212f:	6a 00                	push   $0x0
   12131:	6a 01                	push   $0x1
   12133:	8b 85 a4 fb ff ff    	mov    0xfffffba4(%ebp),%eax
   12139:	50                   	push   %eax
   1213a:	8b 85 20 fc ff ff    	mov    0xfffffc20(%ebp),%eax
   12140:	50                   	push   %eax
   12141:	e8 2a 0d 00 00       	call   12e70 <_ScsiClassClaimDevice@16>
   12146:	83 ec 0c             	sub    $0xc,%esp
   12149:	8b 85 24 fc ff ff    	mov    0xfffffc24(%ebp),%eax
   1214f:	50                   	push   %eax
   12150:	e8 4b 0e 00 00       	call   12fa0 <_ZwMakeTemporaryObject@4>
   12155:	8b 85 24 fc ff ff    	mov    0xfffffc24(%ebp),%eax
   1215b:	50                   	push   %eax
   1215c:	e8 4f 0e 00 00       	call   12fb0 <_ZwClose@4>
   12161:	b8 9a 00 00 c0       	mov    $0xc000009a,%eax
   12166:	83 c4 0c             	add    $0xc,%esp
   12169:	85 c0                	test   %eax,%eax
   1216b:	0f 88 ef fc ff ff    	js     11e60 <_DiskClassFindDevices@20+0x100>
   12171:	8b 9d ac fb ff ff    	mov    0xfffffbac(%ebp),%ebx
   12177:	8b bd a4 fb ff ff    	mov    0xfffffba4(%ebp),%edi
   1217d:	c6 85 9f fb ff ff 01 	movb   $0x1,0xfffffb9f(%ebp)
   12184:	8b 0b                	mov    (%ebx),%ecx
   12186:	41                   	inc    %ecx
   12187:	89 0b                	mov    %ecx,(%ebx)
   12189:	8b 47 08             	mov    0x8(%edi),%eax
   1218c:	85 c0                	test   %eax,%eax
   1218e:	0f 85 dd fc ff ff    	jne    11e71 <_DiskClassFindDevices@20+0x111>
   12194:	8b 9d a8 fb ff ff    	mov    0xfffffba8(%ebp),%ebx
   1219a:	8a 13                	mov    (%ebx),%dl
   1219c:	e9 f4 fc ff ff       	jmp    11e95 <_DiskClassFindDevices@20+0x135>
   121a1:	8b 9d 90 fb ff ff    	mov    0xfffffb90(%ebp),%ebx
   121a7:	89 43 50             	mov    %eax,0x50(%ebx)
   121aa:	e9 17 ff ff ff       	jmp    120c6 <_DiskClassFindDevices@20+0x366>
   121af:	56                   	push   %esi
   121b0:	56                   	push   %esi
   121b1:	6a 12                	push   $0x12
   121b3:	6a 04                	push   $0x4
   121b5:	e8 06 0d 00 00       	call   12ec0 <_ExAllocatePool@8>
   121ba:	59                   	pop    %ecx
   121bb:	8b 8d 90 fb ff ff    	mov    0xfffffb90(%ebp),%ecx
   121c1:	5b                   	pop    %ebx
   121c2:	85 c0                	test   %eax,%eax
   121c4:	89 41 4c             	mov    %eax,0x4c(%ecx)
   121c7:	0f 84 cf 05 00 00    	je     1279c <_DiskClassFindDevices@20+0xa3c>
   121cd:	83 ec 0c             	sub    $0xc,%esp
   121d0:	8b 85 1c fc ff ff    	mov    0xfffffc1c(%ebp),%eax
   121d6:	50                   	push   %eax
   121d7:	e8 34 0c 00 00       	call   12e10 <_ScsiClassReadDriveCapacity@4>
   121dc:	83 c4 0c             	add    $0xc,%esp
   121df:	89 c6                	mov    %eax,%esi
   121e1:	85 c0                	test   %eax,%eax
   121e3:	0f 88 d2 0a 00 00    	js     12cbb <_DiskClassFindDevices@20+0xf5b>
   121e9:	8b 8d 1c fc ff ff    	mov    0xfffffc1c(%ebp),%ecx
   121ef:	8b 79 1c             	mov    0x1c(%ecx),%edi
   121f2:	83 e7 fd             	and    $0xfffffffd,%edi
   121f5:	f6 41 20 01          	testb  $0x1,0x20(%ecx)
   121f9:	89 79 1c             	mov    %edi,0x1c(%ecx)
   121fc:	0f 84 c5 08 00 00    	je     12ac7 <_DiskClassFindDevices@20+0xd67>
   12202:	8b 9d 90 fb ff ff    	mov    0xfffffb90(%ebp),%ebx
   12208:	8b 43 44             	mov    0x44(%ebx),%eax
   1220b:	83 78 08 0b          	cmpl   $0xb,0x8(%eax)
   1220f:	0f 84 cc 0a 00 00    	je     12ce1 <_DiskClassFindDevices@20+0xf81>
   12215:	53                   	push   %ebx
   12216:	53                   	push   %ebx
   12217:	8b 50 14             	mov    0x14(%eax),%edx
   1221a:	8d 85 0c fc ff ff    	lea    0xfffffc0c(%ebp),%eax
   12220:	50                   	push   %eax
   12221:	6a 54                	push   $0x54
   12223:	a1 58 51 01 00       	mov    0x15158,%eax
   12228:	ff 50 14             	call   *0x14(%eax)
   1222b:	58                   	pop    %eax
   1222c:	8b 85 0c fc ff ff    	mov    0xfffffc0c(%ebp),%eax
   12232:	5a                   	pop    %edx
   12233:	85 c0                	test   %eax,%eax
   12235:	0f 85 66 09 00 00    	jne    12ba1 <_DiskClassFindDevices@20+0xe41>
   1223b:	8b 8d 1c fc ff ff    	mov    0xfffffc1c(%ebp),%ecx
   12241:	f6 41 20 01          	testb  $0x1,0x20(%ecx)
   12245:	0f 84 6e 08 00 00    	je     12ab9 <_DiskClassFindDevices@20+0xd59>
   1224b:	8b 9d 90 fb ff ff    	mov    0xfffffb90(%ebp),%ebx
   12251:	8b 43 44             	mov    0x44(%ebx),%eax
   12254:	83 78 08 0b          	cmpl   $0xb,0x8(%eax)
   12258:	0f 84 e1 0a 00 00    	je     12d3f <_DiskClassFindDevices@20+0xfdf>
   1225e:	53                   	push   %ebx
   1225f:	53                   	push   %ebx
   12260:	8b 50 14             	mov    0x14(%eax),%edx
   12263:	8d 85 08 fc ff ff    	lea    0xfffffc08(%ebp),%eax
   12269:	50                   	push   %eax
   1226a:	6a 01                	push   $0x1
   1226c:	e8 8f 0c 00 00       	call   12f00 <@IoReadPartitionTable@16>
   12271:	5a                   	pop    %edx
   12272:	89 c6                	mov    %eax,%esi
   12274:	59                   	pop    %ecx
   12275:	85 c0                	test   %eax,%eax
   12277:	78 0c                	js     12285 <_DiskClassFindDevices@20+0x525>
   12279:	8b 95 08 fc ff ff    	mov    0xfffffc08(%ebp),%edx
   1227f:	8b 02                	mov    (%edx),%eax
   12281:	85 c0                	test   %eax,%eax
   12283:	75 47                	jne    122cc <_DiskClassFindDevices@20+0x56c>
   12285:	8b 85 1c fc ff ff    	mov    0xfffffc1c(%ebp),%eax
   1228b:	f6 40 20 01          	testb  $0x1,0x20(%eax)
   1228f:	0f 84 4e 09 00 00    	je     12be3 <_DiskClassFindDevices@20+0xe83>
   12295:	85 f6                	test   %esi,%esi
   12297:	0f 88 35 0a 00 00    	js     12cd2 <_DiskClassFindDevices@20+0xf72>
   1229d:	83 ec 0c             	sub    $0xc,%esp
   122a0:	8b 85 08 fc ff ff    	mov    0xfffffc08(%ebp),%eax
   122a6:	50                   	push   %eax
   122a7:	e8 64 0c 00 00       	call   12f10 <_ExFreePool@4>
   122ac:	83 c4 0c             	add    $0xc,%esp
   122af:	50                   	push   %eax
   122b0:	50                   	push   %eax
   122b1:	6a 28                	push   $0x28
   122b3:	6a 00                	push   $0x0
   122b5:	e8 06 0c 00 00       	call   12ec0 <_ExAllocatePool@8>
   122ba:	5b                   	pop    %ebx
   122bb:	89 c2                	mov    %eax,%edx
   122bd:	5f                   	pop    %edi
   122be:	85 c0                	test   %eax,%eax
   122c0:	89 85 08 fc ff ff    	mov    %eax,0xfffffc08(%ebp)
   122c6:	0f 85 bd 0a 00 00    	jne    12d89 <_DiskClassFindDevices@20+0x1029>
   122cc:	85 f6                	test   %esi,%esi
   122ce:	0f 88 ca 05 00 00    	js     1289e <_DiskClassFindDevices@20+0xb3e>
   122d4:	8b 9d 5c fb ff ff    	mov    0xfffffb5c(%ebp),%ebx
   122da:	8b 42 04             	mov    0x4(%edx),%eax
   122dd:	85 c0                	test   %eax,%eax
   122df:	89 43 04             	mov    %eax,0x4(%ebx)
   122e2:	0f 84 06 09 00 00    	je     12bee <_DiskClassFindDevices@20+0xe8e>

      DPRINT("Partition ordinal %lu was assigned to partition %lu\n",
	     DiskData->PartitionOrdinal,
	     DiskData->PartitionNumber);
    }

  DPRINT("ScsiDiskUpdatePartitionDeviceObjects() done\n");
}


/**********************************************************************
 * NAME							INTERNAL
 *	ScsiDiskSearchForDisk
 *
 * DESCRIPTION
 *	Searches the hardware tree for the given disk.
 *
 * RUN LEVEL
 *	PASSIVE_LEVEL
 *
 * ARGUMENTS
 *	DeviceExtension
 *		Disk device extension.
 *
 *	BusKey
 *		Handle to the hardware bus key.
 *
 *	DetectedDiskNumber
 *		Returned disk number.
 *
 * RETURN VALUE
 *	TRUE: Disk was found.
 *	FALSE: Search failed.
 */

static BOOLEAN
ScsiDiskSearchForDisk(IN PDEVICE_EXTENSION DeviceExtension,
		      IN HANDLE BusKey,
		      OUT PULONG DetectedDiskNumber)
{
  PKEY_VALUE_FULL_INFORMATION ValueData;
  OBJECT_ATTRIBUTES ObjectAttributes;
  PDISK_DATA DiskData;
  UNICODE_STRING IdentifierString;
  UNICODE_STRING NameString;
  HANDLE BusInstanceKey;
  HANDLE ControllerKey;
  HANDLE DiskKey;
  HANDLE DiskInstanceKey;
  ULONG BusNumber;
  ULONG ControllerNumber;
  ULONG DiskNumber;
  ULONG Length;
  WCHAR Buffer[32];
  BOOLEAN DiskFound;
  NTSTATUS Status;

  DPRINT("ScsiDiskSearchForDiskData() called\n");

  DiskFound = FALSE;

  /* Enumerate buses */
  for (BusNumber = 0; ; BusNumber++)
    {
      /* Open bus instance subkey */
      swprintf(Buffer,
	       L"%lu",
	       BusNumber);

      RtlInitUnicodeString(&NameString,
			   Buffer);

      InitializeObjectAttributes(&ObjectAttributes,
				 &NameString,
				 OBJ_CASE_INSENSITIVE,
				 BusKey,
				 NULL);

      Status = ZwOpenKey(&BusInstanceKey,
			 KEY_READ,
			 &ObjectAttributes);
      if (!NT_SUCCESS(Status))
	{
	  break;
	}

      /* Open 'DiskController' subkey */
      RtlInitUnicodeString(&NameString,
			   L"DiskController");

      InitializeObjectAttributes(&ObjectAttributes,
				 &NameString,
				 OBJ_CASE_INSENSITIVE,
				 BusInstanceKey,
				 NULL);

      Status = ZwOpenKey(&ControllerKey,
			 KEY_READ,
			 &ObjectAttributes);
      if (!NT_SUCCESS(Status))
	{
	  ZwClose(BusInstanceKey);
	  continue;
	}

      /* Enumerate controllers */
      for (ControllerNumber = 0; ; ControllerNumber++)
	{
	  /* Open 'DiskPeripheral' subkey */
	  swprintf(Buffer,
		   L"%lu\\DiskPeripheral",
		   ControllerNumber);

	  RtlInitUnicodeString(&NameString,
			       Buffer);

	  InitializeObjectAttributes(&ObjectAttributes,
				     &NameString,
				     OBJ_CASE_INSENSITIVE,
				     ControllerKey,
				     NULL);

	  Status = ZwOpenKey(&DiskKey,
			     KEY_READ,
			     &ObjectAttributes);
	  if (!NT_SUCCESS(Status))
	    {
	      break;
	    }

	  /* Enumerate disks */
	  for (DiskNumber = 0; ; DiskNumber++)
	    {
	      /* Open disk instance subkey */
	      swprintf(Buffer,
		       L"%lu",
		       DiskNumber);

	      RtlInitUnicodeString(&NameString,
				   Buffer);

	      InitializeObjectAttributes(&ObjectAttributes,
					 &NameString,
					 OBJ_CASE_INSENSITIVE,
					 DiskKey,
					 NULL);

	      Status = ZwOpenKey(&DiskInstanceKey,
				 KEY_READ,
				 &ObjectAttributes);
	      if (!NT_SUCCESS(Status))
		{
		  break;
		}

	      DPRINT("Found disk key: bus %lu  controller %lu  disk %lu\n",
		     BusNumber,
		     ControllerNumber,
		     DiskNumber);

	      /* Allocate data buffer */
	      ValueData = ExAllocatePool(PagedPool,
					 2048);
	      if (ValueData == NULL)
		{
		  ZwClose(DiskInstanceKey);
		  continue;
		}

	      /* Get the 'Identifier' value */
	      RtlInitUnicodeString(&NameString,
				   L"Identifier");
	      Status = ZwQueryValueKey(DiskInstanceKey,
				       &NameString,
				       KeyValueFullInformation,
				       ValueData,
				       2048,
				       &Length);

	      ZwClose(DiskInstanceKey);
	      if (!NT_SUCCESS(Status))
		{
		  ExFreePool(ValueData);
		  continue;
		}

	      IdentifierString.Buffer =
		(PWSTR)((PUCHAR)ValueData + ValueData->DataOffset);
	      IdentifierString.Length = (USHORT)ValueData->DataLength - 2;
	      IdentifierString.MaximumLength = (USHORT)ValueData->DataLength;

	      DPRINT("DiskIdentifier: %wZ\n",
		     &IdentifierString);

	      DiskData = (PDISK_DATA)(DeviceExtension + 1);
	      if (DiskData->Signature != 0)
		{
		  /* Comapre disk signature */
		  swprintf(Buffer,
			   L"%08lx",
			   DiskData->Signature);
		  if (!_wcsnicmp(Buffer, &IdentifierString.Buffer[9], 8))
		    {
		      DPRINT("Found disk %lu\n", DiskNumber);
		      DiskFound = TRUE;
		      *DetectedDiskNumber = DiskNumber;
		    }
		}
	      else
		{
		  /* Comapre mbr checksum */
		  swprintf(Buffer,
			   L"%08lx",
			   DiskData->MbrCheckSum);
		  if (!_wcsnicmp(Buffer, &IdentifierString.Buffer[0], 8))
		    {
		      DPRINT("Found disk %lu\n", DiskNumber);
		      DiskFound = TRUE;
		      *DetectedDiskNumber = DiskNumber;
		    }
		}

	      ExFreePool(ValueData);

	      ZwClose(DiskInstanceKey);

	      if (DiskFound == TRUE)
		break;
	    }

	  ZwClose(DiskKey);
	}

      ZwClose(ControllerKey);
      ZwClose(BusInstanceKey);
    }

  DPRINT("ScsiDiskSearchForDisk() done\n");

  return DiskFound;
}


/**********************************************************************
 * NAME							INTERNAL
 *	DiskClassUpdateFixedDiskGeometry
 *
 * DESCRIPTION
 *	Updated the geometry of a disk if the disk can be accessed
 *	by the BIOS.
 *
 * RUN LEVEL
 *	PASSIVE_LEVEL
 *
 * ARGUMENTS
 *	DeviceExtension
 *		Disk device extension.
 *
 * RETURN VALUE
 *	None
 */

static VOID
ScsiDiskUpdateFixedDiskGeometry(IN PDEVICE_EXTENSION DeviceExtension)
{
  PCM_FULL_RESOURCE_DESCRIPTOR ResourceDescriptor;
  PCM_INT13_DRIVE_PARAMETER DriveParameters;
  PKEY_VALUE_FULL_INFORMATION ValueBuffer;
  OBJECT_ATTRIBUTES ObjectAttributes;
  UNICODE_STRING KeyName;
  UNICODE_STRING ValueName;
  HANDLE SystemKey;
  HANDLE BusKey;
  ULONG DiskNumber;
  ULONG Length;
#if 0
  ULONG i;
#endif
  ULONG Cylinders;
  ULONG Sectors;
  ULONG SectorsPerTrack;
  ULONG TracksPerCylinder;
  NTSTATUS Status;

  DPRINT("ScsiDiskUpdateFixedDiskGeometry() called\n");

  RtlInitUnicodeString(&KeyName,
   122e8:	8d b5 f0 fb ff ff    	lea    0xfffffbf0(%ebp),%esi
   122ee:	50                   	push   %eax
   122ef:	50                   	push   %eax
   122f0:	68 e4 40 01 00       	push   $0x140e4
   122f5:	56                   	push   %esi
   122f6:	e8 35 0c 00 00       	call   12f30 <_RtlInitUnicodeString@8>
		       L"\\Registry\\Machine\\Hardware\\Description\\System");

  InitializeObjectAttributes(&ObjectAttributes,
			     &KeyName,
			     OBJ_CASE_INSENSITIVE,
			     NULL,
			     NULL);

  /* Open the adapter key */
  Status = ZwOpenKey(&SystemKey,
   122fb:	8d 9d 98 fc ff ff    	lea    0xfffffc98(%ebp),%ebx
   12301:	c7 85 98 fc ff ff 18 	movl   $0x18,0xfffffc98(%ebp)
   12308:	00 00 00 
   1230b:	89 b5 a0 fc ff ff    	mov    %esi,0xfffffca0(%ebp)
   12311:	c7 85 a4 fc ff ff 40 	movl   $0x40,0xfffffca4(%ebp)
   12318:	00 00 00 
   1231b:	c7 85 9c fc ff ff 00 	movl   $0x0,0xfffffc9c(%ebp)
   12322:	00 00 00 
   12325:	c7 85 a8 fc ff ff 00 	movl   $0x0,0xfffffca8(%ebp)
   1232c:	00 00 00 
   1232f:	c7 85 ac fc ff ff 00 	movl   $0x0,0xfffffcac(%ebp)
   12336:	00 00 00 
   12339:	8d 85 ec fb ff ff    	lea    0xfffffbec(%ebp),%eax
   1233f:	89 1c 24             	mov    %ebx,(%esp)
   12342:	68 19 00 02 00       	push   $0x20019
   12347:	50                   	push   %eax
   12348:	e8 73 0c 00 00       	call   12fc0 <_ZwOpenKey@12>
   1234d:	5f                   	pop    %edi
		     KEY_READ,
		     &ObjectAttributes);
  if (!NT_SUCCESS(Status))
   1234e:	85 c0                	test   %eax,%eax
   12350:	0f 88 8a 05 00 00    	js     128e0 <_DiskClassFindDevices@20+0xb80>
    {
      DPRINT("ZwOpenKey() failed (Status %lx)\n", Status);
      return;
    }

  /* Allocate value buffer */
  ValueBuffer = ExAllocatePool(PagedPool,
   12356:	53                   	push   %ebx
   12357:	53                   	push   %ebx
   12358:	68 00 04 00 00       	push   $0x400
   1235d:	6a 01                	push   $0x1
   1235f:	e8 5c 0b 00 00       	call   12ec0 <_ExAllocatePool@8>
   12364:	5a                   	pop    %edx
			       1024);
  if (ValueBuffer == NULL)
   12365:	85 c0                	test   %eax,%eax
   12367:	59                   	pop    %ecx
   12368:	89 85 88 fb ff ff    	mov    %eax,0xfffffb88(%ebp)
   1236e:	0f 84 5a 05 00 00    	je     128ce <_DiskClassFindDevices@20+0xb6e>
    {
      DPRINT("Failed to allocate value buffer\n");
      ZwClose(SystemKey);
      return;
    }

  RtlInitUnicodeString(&ValueName,
   12374:	8d 9d e0 fb ff ff    	lea    0xfffffbe0(%ebp),%ebx
   1237a:	50                   	push   %eax
   1237b:	50                   	push   %eax
   1237c:	68 40 41 01 00       	push   $0x14140
   12381:	53                   	push   %ebx
   12382:	e8 a9 0b 00 00       	call   12f30 <_RtlInitUnicodeString@8>
		       L"Configuration Data");

  /* Query 'Configuration Data' value */
  Status = ZwQueryValueKey(SystemKey,
   12387:	8d 85 dc fb ff ff    	lea    0xfffffbdc(%ebp),%eax
   1238d:	50                   	push   %eax
   1238e:	68 00 04 00 00       	push   $0x400
   12393:	8b bd 88 fb ff ff    	mov    0xfffffb88(%ebp),%edi
   12399:	57                   	push   %edi
   1239a:	6a 01                	push   $0x1
   1239c:	53                   	push   %ebx
   1239d:	8b 8d ec fb ff ff    	mov    0xfffffbec(%ebp),%ecx
   123a3:	51                   	push   %ecx
   123a4:	e8 27 0c 00 00       	call   12fd0 <_ZwQueryValueKey@24>
   123a9:	5f                   	pop    %edi
			   &ValueName,
			   KeyValueFullInformation,
			   ValueBuffer,
			   1024,
			   &Length);
  if (!NT_SUCCESS(Status))
   123aa:	85 c0                	test   %eax,%eax
   123ac:	5a                   	pop    %edx
   123ad:	0f 88 09 05 00 00    	js     128bc <_DiskClassFindDevices@20+0xb5c>
    {
      DPRINT("ZwQueryValueKey() failed (Status %lx)\n", Status);
      ExFreePool(ValueBuffer);
      ZwClose(SystemKey);
      return;
    }

  /* Open the 'MultifunctionAdapter' subkey */
  RtlInitUnicodeString(&KeyName,
   123b3:	51                   	push   %ecx
   123b4:	51                   	push   %ecx
   123b5:	68 68 41 01 00       	push   $0x14168
   123ba:	56                   	push   %esi
   123bb:	e8 70 0b 00 00       	call   12f30 <_RtlInitUnicodeString@8>
		       L"MultifunctionAdapter");

  InitializeObjectAttributes(&ObjectAttributes,
			     &KeyName,
			     OBJ_CASE_INSENSITIVE,
			     SystemKey,
			     NULL);

  Status = ZwOpenKey(&BusKey,
   123c0:	8d bd 98 fc ff ff    	lea    0xfffffc98(%ebp),%edi
   123c6:	8b 85 ec fb ff ff    	mov    0xfffffbec(%ebp),%eax
   123cc:	89 85 9c fc ff ff    	mov    %eax,0xfffffc9c(%ebp)
   123d2:	c7 85 98 fc ff ff 18 	movl   $0x18,0xfffffc98(%ebp)
   123d9:	00 00 00 
   123dc:	89 b5 a0 fc ff ff    	mov    %esi,0xfffffca0(%ebp)
   123e2:	c7 85 a4 fc ff ff 40 	movl   $0x40,0xfffffca4(%ebp)
   123e9:	00 00 00 
   123ec:	c7 85 a8 fc ff ff 00 	movl   $0x0,0xfffffca8(%ebp)
   123f3:	00 00 00 
   123f6:	c7 85 ac fc ff ff 00 	movl   $0x0,0xfffffcac(%ebp)
   123fd:	00 00 00 
   12400:	8d 85 d8 fb ff ff    	lea    0xfffffbd8(%ebp),%eax
   12406:	89 3c 24             	mov    %edi,(%esp)
   12409:	68 19 00 02 00       	push   $0x20019
   1240e:	50                   	push   %eax
   1240f:	e8 ac 0b 00 00       	call   12fc0 <_ZwOpenKey@12>
   12414:	89 c3                	mov    %eax,%ebx
   12416:	52                   	push   %edx
   12417:	52                   	push   %edx
		     KEY_READ,
		     &ObjectAttributes);
  ZwClose(SystemKey);
   12418:	8b 85 ec fb ff ff    	mov    0xfffffbec(%ebp),%eax
   1241e:	50                   	push   %eax
   1241f:	e8 8c 0b 00 00       	call   12fb0 <_ZwClose@4>
   12424:	83 c4 0c             	add    $0xc,%esp
  if (!NT_SUCCESS(Status))
   12427:	85 db                	test   %ebx,%ebx
   12429:	0f 88 3a 07 00 00    	js     12b69 <_DiskClassFindDevices@20+0xe09>
   1242f:	8b 85 d8 fb ff ff    	mov    0xfffffbd8(%ebp),%eax
   12435:	c6 85 6f fb ff ff 00 	movb   $0x0,0xfffffb6f(%ebp)
   1243c:	89 85 84 fb ff ff    	mov    %eax,0xfffffb84(%ebp)
   12442:	c7 85 74 fb ff ff 00 	movl   $0x0,0xfffffb74(%ebp)
   12449:	00 00 00 
   1244c:	50                   	push   %eax
   1244d:	8b 85 74 fb ff ff    	mov    0xfffffb74(%ebp),%eax
   12453:	8d 95 38 fc ff ff    	lea    0xfffffc38(%ebp),%edx
   12459:	50                   	push   %eax
   1245a:	8d 9d c8 fb ff ff    	lea    0xfffffbc8(%ebp),%ebx
   12460:	68 92 41 01 00       	push   $0x14192
   12465:	52                   	push   %edx
   12466:	e8 05 0c 00 00       	call   13070 <_swprintf>
   1246b:	8d 8d 38 fc ff ff    	lea    0xfffffc38(%ebp),%ecx
   12471:	5e                   	pop    %esi
   12472:	5f                   	pop    %edi
   12473:	51                   	push   %ecx
   12474:	53                   	push   %ebx
   12475:	e8 b6 0a 00 00       	call   12f30 <_RtlInitUnicodeString@8>
   1247a:	8b 85 84 fb ff ff    	mov    0xfffffb84(%ebp),%eax
   12480:	8d 95 78 fc ff ff    	lea    0xfffffc78(%ebp),%edx
   12486:	89 9d 80 fc ff ff    	mov    %ebx,0xfffffc80(%ebp)
   1248c:	c7 85 78 fc ff ff 18 	movl   $0x18,0xfffffc78(%ebp)
   12493:	00 00 00 
   12496:	c7 85 84 fc ff ff 40 	movl   $0x40,0xfffffc84(%ebp)
   1249d:	00 00 00 
   124a0:	89 85 7c fc ff ff    	mov    %eax,0xfffffc7c(%ebp)
   124a6:	c7 85 88 fc ff ff 00 	movl   $0x0,0xfffffc88(%ebp)
   124ad:	00 00 00 
   124b0:	c7 85 8c fc ff ff 00 	movl   $0x0,0xfffffc8c(%ebp)
   124b7:	00 00 00 
   124ba:	8d 8d c4 fb ff ff    	lea    0xfffffbc4(%ebp),%ecx
   124c0:	89 14 24             	mov    %edx,(%esp)
   124c3:	68 19 00 02 00       	push   $0x20019
   124c8:	51                   	push   %ecx
   124c9:	e8 f2 0a 00 00       	call   12fc0 <_ZwOpenKey@12>
   124ce:	89 df                	mov    %ebx,%edi
   124d0:	85 c0                	test   %eax,%eax
   124d2:	5b                   	pop    %ebx
   124d3:	0f 88 a7 06 00 00    	js     12b80 <_DiskClassFindDevices@20+0xe20>
   124d9:	51                   	push   %ecx
   124da:	51                   	push   %ecx
   124db:	68 9a 41 01 00       	push   $0x1419a
   124e0:	57                   	push   %edi
   124e1:	e8 4a 0a 00 00       	call   12f30 <_RtlInitUnicodeString@8>
   124e6:	8b 85 c4 fb ff ff    	mov    0xfffffbc4(%ebp),%eax
   124ec:	c7 85 78 fc ff ff 18 	movl   $0x18,0xfffffc78(%ebp)
   124f3:	00 00 00 
   124f6:	89 85 7c fc ff ff    	mov    %eax,0xfffffc7c(%ebp)
   124fc:	8d 85 78 fc ff ff    	lea    0xfffffc78(%ebp),%eax
   12502:	89 bd 80 fc ff ff    	mov    %edi,0xfffffc80(%ebp)
   12508:	c7 85 84 fc ff ff 40 	movl   $0x40,0xfffffc84(%ebp)
   1250f:	00 00 00 
   12512:	c7 85 88 fc ff ff 00 	movl   $0x0,0xfffffc88(%ebp)
   12519:	00 00 00 
   1251c:	c7 85 8c fc ff ff 00 	movl   $0x0,0xfffffc8c(%ebp)
   12523:	00 00 00 
   12526:	89 04 24             	mov    %eax,(%esp)
   12529:	8d 85 c0 fb ff ff    	lea    0xfffffbc0(%ebp),%eax
   1252f:	68 19 00 02 00       	push   $0x20019
   12534:	50                   	push   %eax
   12535:	e8 86 0a 00 00       	call   12fc0 <_ZwOpenKey@12>
   1253a:	5a                   	pop    %edx
   1253b:	85 c0                	test   %eax,%eax
   1253d:	c7 85 70 fb ff ff 00 	movl   $0x0,0xfffffb70(%ebp)
   12544:	00 00 00 
   12547:	0f 88 db 02 00 00    	js     12828 <_DiskClassFindDevices@20+0xac8>
   1254d:	50                   	push   %eax
   1254e:	8b 85 70 fb ff ff    	mov    0xfffffb70(%ebp),%eax
   12554:	8d 95 38 fc ff ff    	lea    0xfffffc38(%ebp),%edx
   1255a:	50                   	push   %eax
   1255b:	8d 9d c8 fb ff ff    	lea    0xfffffbc8(%ebp),%ebx
   12561:	68 b8 41 01 00       	push   $0x141b8
   12566:	52                   	push   %edx
   12567:	e8 04 0b 00 00       	call   13070 <_swprintf>
   1256c:	8d 8d 38 fc ff ff    	lea    0xfffffc38(%ebp),%ecx
   12572:	5e                   	pop    %esi
   12573:	5f                   	pop    %edi
   12574:	51                   	push   %ecx
   12575:	53                   	push   %ebx
   12576:	e8 b5 09 00 00       	call   12f30 <_RtlInitUnicodeString@8>
   1257b:	8b 85 c0 fb ff ff    	mov    0xfffffbc0(%ebp),%eax
   12581:	89 85 7c fc ff ff    	mov    %eax,0xfffffc7c(%ebp)
   12587:	8d 85 78 fc ff ff    	lea    0xfffffc78(%ebp),%eax
   1258d:	89 9d 80 fc ff ff    	mov    %ebx,0xfffffc80(%ebp)
   12593:	c7 85 78 fc ff ff 18 	movl   $0x18,0xfffffc78(%ebp)
   1259a:	00 00 00 
   1259d:	c7 85 84 fc ff ff 40 	movl   $0x40,0xfffffc84(%ebp)
   125a4:	00 00 00 
   125a7:	c7 85 88 fc ff ff 00 	movl   $0x0,0xfffffc88(%ebp)
   125ae:	00 00 00 
   125b1:	c7 85 8c fc ff ff 00 	movl   $0x0,0xfffffc8c(%ebp)
   125b8:	00 00 00 
   125bb:	8d 95 bc fb ff ff    	lea    0xfffffbbc(%ebp),%edx
   125c1:	89 04 24             	mov    %eax,(%esp)
   125c4:	68 19 00 02 00       	push   $0x20019
   125c9:	52                   	push   %edx
   125ca:	e8 f1 09 00 00       	call   12fc0 <_ZwOpenKey@12>
   125cf:	5b                   	pop    %ebx
   125d0:	85 c0                	test   %eax,%eax
   125d2:	0f 88 3e 02 00 00    	js     12816 <_DiskClassFindDevices@20+0xab6>
   125d8:	31 ff                	xor    %edi,%edi
   125da:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi
   125e0:	51                   	push   %ecx
   125e1:	8d 8d 38 fc ff ff    	lea    0xfffffc38(%ebp),%ecx
   125e7:	57                   	push   %edi
   125e8:	8d 9d 38 fc ff ff    	lea    0xfffffc38(%ebp),%ebx
   125ee:	68 92 41 01 00       	push   $0x14192
   125f3:	51                   	push   %ecx
   125f4:	e8 77 0a 00 00       	call   13070 <_swprintf>
   125f9:	58                   	pop    %eax
   125fa:	8d 85 c8 fb ff ff    	lea    0xfffffbc8(%ebp),%eax
   12600:	5a                   	pop    %edx
   12601:	53                   	push   %ebx
   12602:	50                   	push   %eax
   12603:	e8 28 09 00 00       	call   12f30 <_RtlInitUnicodeString@8>
   12608:	8b 85 bc fb ff ff    	mov    0xfffffbbc(%ebp),%eax
   1260e:	8d 95 c8 fb ff ff    	lea    0xfffffbc8(%ebp),%edx
   12614:	8d 8d 78 fc ff ff    	lea    0xfffffc78(%ebp),%ecx
   1261a:	c7 85 78 fc ff ff 18 	movl   $0x18,0xfffffc78(%ebp)
   12621:	00 00 00 
   12624:	89 95 80 fc ff ff    	mov    %edx,0xfffffc80(%ebp)
   1262a:	c7 85 84 fc ff ff 40 	movl   $0x40,0xfffffc84(%ebp)
   12631:	00 00 00 
   12634:	89 85 7c fc ff ff    	mov    %eax,0xfffffc7c(%ebp)
   1263a:	c7 85 88 fc ff ff 00 	movl   $0x0,0xfffffc88(%ebp)
   12641:	00 00 00 
   12644:	c7 85 8c fc ff ff 00 	movl   $0x0,0xfffffc8c(%ebp)
   1264b:	00 00 00 
   1264e:	8d 9d b8 fb ff ff    	lea    0xfffffbb8(%ebp),%ebx
   12654:	89 0c 24             	mov    %ecx,(%esp)
   12657:	68 19 00 02 00       	push   $0x20019
   1265c:	53                   	push   %ebx
   1265d:	e8 5e 09 00 00       	call   12fc0 <_ZwOpenKey@12>
   12662:	5e                   	pop    %esi
   12663:	85 c0                	test   %eax,%eax
   12665:	0f 88 0d 01 00 00    	js     12778 <_DiskClassFindDevices@20+0xa18>
   1266b:	53                   	push   %ebx
   1266c:	53                   	push   %ebx
   1266d:	68 00 08 00 00       	push   $0x800
   12672:	6a 01                	push   $0x1
   12674:	e8 47 08 00 00       	call   12ec0 <_ExAllocatePool@8>
   12679:	5a                   	pop    %edx
   1267a:	89 c6                	mov    %eax,%esi
   1267c:	59                   	pop    %ecx
   1267d:	85 c0                	test   %eax,%eax
   1267f:	0f 84 6b 01 00 00    	je     127f0 <_DiskClassFindDevices@20+0xa90>
   12685:	50                   	push   %eax
   12686:	50                   	push   %eax
   12687:	8d 85 c8 fb ff ff    	lea    0xfffffbc8(%ebp),%eax
   1268d:	68 de 41 01 00       	push   $0x141de
   12692:	50                   	push   %eax
   12693:	e8 98 08 00 00       	call   12f30 <_RtlInitUnicodeString@8>
   12698:	8d 95 c8 fb ff ff    	lea    0xfffffbc8(%ebp),%edx
   1269e:	8d 85 b4 fb ff ff    	lea    0xfffffbb4(%ebp),%eax
   126a4:	50                   	push   %eax
   126a5:	68 00 08 00 00       	push   $0x800
   126aa:	56                   	push   %esi
   126ab:	6a 01                	push   $0x1
   126ad:	52                   	push   %edx
   126ae:	8b 85 b8 fb ff ff    	mov    0xfffffbb8(%ebp),%eax
   126b4:	50                   	push   %eax
   126b5:	e8 16 09 00 00       	call   12fd0 <_ZwQueryValueKey@24>
   126ba:	53                   	push   %ebx
   126bb:	89 c3                	mov    %eax,%ebx
   126bd:	8b 8d b8 fb ff ff    	mov    0xfffffbb8(%ebp),%ecx
   126c3:	51                   	push   %ecx
   126c4:	e8 e7 08 00 00       	call   12fb0 <_ZwClose@4>
   126c9:	83 c4 0c             	add    $0xc,%esp
   126cc:	85 db                	test   %ebx,%ebx
   126ce:	0f 88 34 01 00 00    	js     12808 <_DiskClassFindDevices@20+0xaa8>
   126d4:	8b 46 0c             	mov    0xc(%esi),%eax
   126d7:	8b 9d 5c fb ff ff    	mov    0xfffffb5c(%ebp),%ebx
   126dd:	8b 4e 08             	mov    0x8(%esi),%ecx
   126e0:	8d 50 fe             	lea    0xfffffffe(%eax),%edx
   126e3:	01 f1                	add    %esi,%ecx
   126e5:	66 89 95 78 fb ff ff 	mov    %dx,0xfffffb78(%ebp)
   126ec:	89 8d 7c fb ff ff    	mov    %ecx,0xfffffb7c(%ebp)
   126f2:	0f b7 95 78 fb ff ff 	movzwl 0xfffffb78(%ebp),%edx
   126f9:	c1 e0 10             	shl    $0x10,%eax
   126fc:	09 c2                	or     %eax,%edx
   126fe:	8b 43 04             	mov    0x4(%ebx),%eax
   12701:	89 95 78 fb ff ff    	mov    %edx,0xfffffb78(%ebp)
   12707:	85 c0                	test   %eax,%eax
   12709:	0f 84 b1 00 00 00    	je     127c0 <_DiskClassFindDevices@20+0xa60>
   1270f:	52                   	push   %edx
   12710:	50                   	push   %eax
   12711:	8d 85 38 fc ff ff    	lea    0xfffffc38(%ebp),%eax
   12717:	68 f4 41 01 00       	push   $0x141f4
   1271c:	50                   	push   %eax
   1271d:	e8 4e 09 00 00       	call   13070 <_swprintf>
   12722:	83 c4 0c             	add    $0xc,%esp
   12725:	6a 08                	push   $0x8
   12727:	8d 95 38 fc ff ff    	lea    0xfffffc38(%ebp),%edx
   1272d:	8b 85 7c fb ff ff    	mov    0xfffffb7c(%ebp),%eax
   12733:	83 c0 12             	add    $0x12,%eax
   12736:	50                   	push   %eax
   12737:	52                   	push   %edx
   12738:	e8 03 09 00 00       	call   13040 <__wcsnicmp>
   1273d:	83 c4 10             	add    $0x10,%esp
   12740:	85 c0                	test   %eax,%eax
   12742:	75 0d                	jne    12751 <_DiskClassFindDevices@20+0x9f1>
   12744:	c6 85 6f fb ff ff 01 	movb   $0x1,0xfffffb6f(%ebp)
   1274b:	89 bd d4 fb ff ff    	mov    %edi,0xfffffbd4(%ebp)
   12751:	83 ec 0c             	sub    $0xc,%esp
   12754:	56                   	push   %esi
   12755:	e8 b6 07 00 00       	call   12f10 <_ExFreePool@4>
   1275a:	8b 8d b8 fb ff ff    	mov    0xfffffbb8(%ebp),%ecx
   12760:	51                   	push   %ecx
   12761:	e8 4a 08 00 00       	call   12fb0 <_ZwClose@4>
   12766:	83 c4 0c             	add    $0xc,%esp
   12769:	80 bd 6f fb ff ff 01 	cmpb   $0x1,0xfffffb6f(%ebp)
   12770:	74 06                	je     12778 <_DiskClassFindDevices@20+0xa18>
   12772:	47                   	inc    %edi
   12773:	e9 68 fe ff ff       	jmp    125e0 <_DiskClassFindDevices@20+0x880>
   12778:	83 ec 0c             	sub    $0xc,%esp
   1277b:	8b 95 bc fb ff ff    	mov    0xfffffbbc(%ebp),%edx
   12781:	52                   	push   %edx
   12782:	e8 29 08 00 00       	call   12fb0 <_ZwClose@4>
   12787:	8b 85 70 fb ff ff    	mov    0xfffffb70(%ebp),%eax
   1278d:	83 c4 0c             	add    $0xc,%esp
   12790:	40                   	inc    %eax
   12791:	89 85 70 fb ff ff    	mov    %eax,0xfffffb70(%ebp)
   12797:	e9 b1 fd ff ff       	jmp    1254d <_DiskClassFindDevices@20+0x7ed>
   1279c:	83 ec 0c             	sub    $0xc,%esp
   1279f:	8b 51 44             	mov    0x44(%ecx),%edx
   127a2:	52                   	push   %edx
   127a3:	e8 68 07 00 00       	call   12f10 <_ExFreePool@4>
   127a8:	8b 85 90 fb ff ff    	mov    0xfffffb90(%ebp),%eax
   127ae:	e9 64 f9 ff ff       	jmp    12117 <_DiskClassFindDevices@20+0x3b7>
   127b3:	c7 43 58 02 00 00 00 	movl   $0x2,0x58(%ebx)
   127ba:	e9 e3 f8 ff ff       	jmp    120a2 <_DiskClassFindDevices@20+0x342>
   127bf:	90                   	nop    
   127c0:	50                   	push   %eax
   127c1:	8b 8d 5c fb ff ff    	mov    0xfffffb5c(%ebp),%ecx
   127c7:	8d 9d 38 fc ff ff    	lea    0xfffffc38(%ebp),%ebx
   127cd:	8b 41 08             	mov    0x8(%ecx),%eax
   127d0:	50                   	push   %eax
   127d1:	68 f4 41 01 00       	push   $0x141f4
   127d6:	53                   	push   %ebx
   127d7:	e8 94 08 00 00       	call   13070 <_swprintf>
   127dc:	83 c4 0c             	add    $0xc,%esp
   127df:	6a 08                	push   $0x8
   127e1:	8b 85 7c fb ff ff    	mov    0xfffffb7c(%ebp),%eax
   127e7:	50                   	push   %eax
   127e8:	53                   	push   %ebx
   127e9:	e9 4a ff ff ff       	jmp    12738 <_DiskClassFindDevices@20+0x9d8>
   127ee:	89 f6                	mov    %esi,%esi
   127f0:	83 ec 0c             	sub    $0xc,%esp
   127f3:	8b 85 b8 fb ff ff    	mov    0xfffffbb8(%ebp),%eax
   127f9:	50                   	push   %eax
   127fa:	e8 b1 07 00 00       	call   12fb0 <_ZwClose@4>
   127ff:	83 c4 0c             	add    $0xc,%esp
   12802:	47                   	inc    %edi
   12803:	e9 d8 fd ff ff       	jmp    125e0 <_DiskClassFindDevices@20+0x880>
   12808:	83 ec 0c             	sub    $0xc,%esp
   1280b:	56                   	push   %esi
   1280c:	e8 ff 06 00 00       	call   12f10 <_ExFreePool@4>
   12811:	83 c4 0c             	add    $0xc,%esp
   12814:	eb ec                	jmp    12802 <_DiskClassFindDevices@20+0xaa2>
   12816:	83 ec 0c             	sub    $0xc,%esp
   12819:	8b 85 c0 fb ff ff    	mov    0xfffffbc0(%ebp),%eax
   1281f:	50                   	push   %eax
   12820:	e8 8b 07 00 00       	call   12fb0 <_ZwClose@4>
   12825:	83 c4 0c             	add    $0xc,%esp
   12828:	83 ec 0c             	sub    $0xc,%esp
   1282b:	8b 85 c4 fb ff ff    	mov    0xfffffbc4(%ebp),%eax
   12831:	50                   	push   %eax
   12832:	e8 79 07 00 00       	call   12fb0 <_ZwClose@4>
   12837:	8b 85 74 fb ff ff    	mov    0xfffffb74(%ebp),%eax
   1283d:	83 c4 0c             	add    $0xc,%esp
   12840:	40                   	inc    %eax
   12841:	89 85 74 fb ff ff    	mov    %eax,0xfffffb74(%ebp)
   12847:	e9 00 fc ff ff       	jmp    1244c <_DiskClassFindDevices@20+0x6ec>
   1284c:	83 ec 0c             	sub    $0xc,%esp
   1284f:	68 00 42 01 00       	push   $0x14200
   12854:	e8 07 08 00 00       	call   13060 <_DbgPrint>
   12859:	83 c4 10             	add    $0x10,%esp
   1285c:	89 f0                	mov    %esi,%eax
   1285e:	e9 06 f9 ff ff       	jmp    12169 <_DiskClassFindDevices@20+0x409>
   12863:	83 ec 0c             	sub    $0xc,%esp
   12866:	68 24 42 01 00       	push   $0x14224
   1286b:	e8 f0 07 00 00       	call   13060 <_DbgPrint>
   12870:	83 c4 10             	add    $0x10,%esp
   12873:	83 ec 0c             	sub    $0xc,%esp
   12876:	8b 85 24 fc ff ff    	mov    0xfffffc24(%ebp),%eax
   1287c:	50                   	push   %eax
   1287d:	e8 1e 07 00 00       	call   12fa0 <_ZwMakeTemporaryObject@4>
   12882:	8b 85 24 fc ff ff    	mov    0xfffffc24(%ebp),%eax
   12888:	50                   	push   %eax
   12889:	e8 22 07 00 00       	call   12fb0 <_ZwClose@4>
   1288e:	89 f0                	mov    %esi,%eax
   12890:	83 c4 0c             	add    $0xc,%esp
   12893:	e9 d1 f8 ff ff       	jmp    12169 <_DiskClassFindDevices@20+0x409>
   12898:	8b 95 08 fc ff ff    	mov    0xfffffc08(%ebp),%edx
   1289e:	85 d2                	test   %edx,%edx
   128a0:	75 07                	jne    128a9 <_DiskClassFindDevices@20+0xb49>
   128a2:	31 c0                	xor    %eax,%eax
   128a4:	e9 c0 f8 ff ff       	jmp    12169 <_DiskClassFindDevices@20+0x409>
   128a9:	83 ec 0c             	sub    $0xc,%esp
   128ac:	52                   	push   %edx
   128ad:	e8 5e 06 00 00       	call   12f10 <_ExFreePool@4>
   128b2:	31 c0                	xor    %eax,%eax
   128b4:	83 c4 0c             	add    $0xc,%esp
   128b7:	e9 ad f8 ff ff       	jmp    12169 <_DiskClassFindDevices@20+0x409>
   128bc:	83 ec 0c             	sub    $0xc,%esp
   128bf:	8b b5 88 fb ff ff    	mov    0xfffffb88(%ebp),%esi
   128c5:	56                   	push   %esi
   128c6:	e8 45 06 00 00       	call   12f10 <_ExFreePool@4>
   128cb:	83 c4 0c             	add    $0xc,%esp
   128ce:	83 ec 0c             	sub    $0xc,%esp
   128d1:	8b 9d ec fb ff ff    	mov    0xfffffbec(%ebp),%ebx
   128d7:	53                   	push   %ebx
   128d8:	e8 d3 06 00 00       	call   12fb0 <_ZwClose@4>
    {
      DPRINT("ZwQueryValueKey() failed (Status %lx)\n", Status);
      ExFreePool(ValueBuffer);
      return;
    }

  if (!ScsiDiskSearchForDisk(DeviceExtension, BusKey, &DiskNumber))
    {
      DPRINT("ScsiDiskSearchForDisk() failed\n");
      ZwClose(BusKey);
      ExFreePool(ValueBuffer);
      return;
    }

  ZwClose(BusKey);

  ResourceDescriptor = (PCM_FULL_RESOURCE_DESCRIPTOR)
    ((PUCHAR)ValueBuffer + ValueBuffer->DataOffset);

  DriveParameters = (PCM_INT13_DRIVE_PARAMETER)
    ((PUCHAR)ResourceDescriptor + sizeof(CM_FULL_RESOURCE_DESCRIPTOR));

#if 0
  for (i = 0; i< DriveParameters[0].NumberDrives; i++)
    {
      DPRINT("Drive %lu: %lu Cylinders  %hu Heads  %hu Sectors\n",
	      i,
	      DriveParameters[i].MaxCylinders,
	      DriveParameters[i].MaxHeads,
	      DriveParameters[i].SectorsPerTrack);
    }
#endif

  Cylinders = DriveParameters[DiskNumber].MaxCylinders + 1;
  TracksPerCylinder = DriveParameters[DiskNumber].MaxHeads +1;
  SectorsPerTrack = DriveParameters[DiskNumber].SectorsPerTrack;

  DPRINT("BIOS geometry: %lu Cylinders  %hu Heads  %hu Sectors\n",
	 Cylinders,
	 TracksPerCylinder,
	 SectorsPerTrack);

  Sectors = (ULONG)
    (DeviceExtension->PartitionLength.QuadPart >> DeviceExtension->SectorShift);

  DPRINT("Physical sectors: %lu\n",
	 Sectors);

  Length = TracksPerCylinder * SectorsPerTrack;
  if (Length == 0)
    {
      DPRINT("Invalid track length 0\n");
      ExFreePool(ValueBuffer);
      return;
    }

  Cylinders = Sectors / Length;

  DPRINT("Logical geometry: %lu Cylinders  %hu Heads  %hu Sectors\n",
	 Cylinders,
	 TracksPerCylinder,
	 SectorsPerTrack);

  /* Update the disk geometry */
  DeviceExtension->DiskGeometry->SectorsPerTrack = SectorsPerTrack;
  DeviceExtension->DiskGeometry->TracksPerCylinder = TracksPerCylinder;
  DeviceExtension->DiskGeometry->Cylinders.QuadPart = (ULONGLONG)Cylinders;

  if (DeviceExtension->DMActive)
    {
      DPRINT("FIXME: Update geometry with respect to the installed disk manager!\n");

      /* FIXME: Update geometry for disk managers */

    }

  ExFreePool(ValueBuffer);
   128dd:	83 c4 0c             	add    $0xc,%esp
   128e0:	8b 95 08 fc ff ff    	mov    0xfffffc08(%ebp),%edx
   128e6:	31 c9                	xor    %ecx,%ecx
   128e8:	8b 1a                	mov    (%edx),%ebx
   128ea:	85 db                	test   %ebx,%ebx
   128ec:	74 b0                	je     1289e <_DiskClassFindDevices@20+0xb3e>
   128ee:	89 c8                	mov    %ecx,%eax
   128f0:	41                   	inc    %ecx
   128f1:	c1 e0 05             	shl    $0x5,%eax
   128f4:	89 8d 60 fb ff ff    	mov    %ecx,0xfffffb60(%ebp)
   128fa:	01 d0                	add    %edx,%eax
   128fc:	89 85 64 fb ff ff    	mov    %eax,0xfffffb64(%ebp)
   12902:	51                   	push   %ecx
   12903:	8b 95 98 fb ff ff    	mov    0xfffffb98(%ebp),%edx
   12909:	89 c7                	mov    %eax,%edi
   1290b:	8d 85 d8 fe ff ff    	lea    0xfffffed8(%ebp),%eax
   12911:	52                   	push   %edx
   12912:	68 44 42 01 00       	push   $0x14244
   12917:	50                   	push   %eax
   12918:	e8 33 07 00 00       	call   13050 <_sprintf>
   1291d:	58                   	pop    %eax
   1291e:	8d 95 b0 fb ff ff    	lea    0xfffffbb0(%ebp),%edx
   12924:	8b 45 10             	mov    0x10(%ebp),%eax
   12927:	50                   	push   %eax
   12928:	52                   	push   %edx
   12929:	8b 85 1c fc ff ff    	mov    0xfffffc1c(%ebp),%eax
   1292f:	8d 8d d8 fe ff ff    	lea    0xfffffed8(%ebp),%ecx
   12935:	50                   	push   %eax
   12936:	51                   	push   %ecx
   12937:	8b 45 08             	mov    0x8(%ebp),%eax
   1293a:	83 c7 08             	add    $0x8,%edi
   1293d:	50                   	push   %eax
   1293e:	e8 3d 05 00 00       	call   12e80 <_ScsiClassCreateDeviceObject@20>
   12943:	83 c4 0c             	add    $0xc,%esp
   12946:	85 c0                	test   %eax,%eax
   12948:	0f 88 4a ff ff ff    	js     12898 <_DiskClassFindDevices@20+0xb38>
   1294e:	8b 95 1c fc ff ff    	mov    0xfffffc1c(%ebp),%edx
   12954:	8b 8d b0 fb ff ff    	mov    0xfffffbb0(%ebp),%ecx
   1295a:	8b 42 1c             	mov    0x1c(%edx),%eax
   1295d:	89 41 1c             	mov    %eax,0x1c(%ecx)
   12960:	8b 42 20             	mov    0x20(%edx),%eax
   12963:	89 41 20             	mov    %eax,0x20(%ecx)
   12966:	8a 42 30             	mov    0x30(%edx),%al
   12969:	88 41 30             	mov    %al,0x30(%ecx)
   1296c:	8b 95 b0 fb ff ff    	mov    0xfffffbb0(%ebp),%edx
   12972:	8b 85 1c fc ff ff    	mov    0xfffffc1c(%ebp),%eax
   12978:	8b 8d 90 fb ff ff    	mov    0xfffffb90(%ebp),%ecx
   1297e:	8b 5a 28             	mov    0x28(%edx),%ebx
   12981:	8b 40 5c             	mov    0x5c(%eax),%eax
   12984:	89 42 5c             	mov    %eax,0x5c(%edx)
   12987:	8b 41 4c             	mov    0x4c(%ecx),%eax
   1298a:	89 43 4c             	mov    %eax,0x4c(%ebx)
   1298d:	8b 85 98 fb ff ff    	mov    0xfffffb98(%ebp),%eax
   12993:	89 43 54             	mov    %eax,0x54(%ebx)
   12996:	8b 85 20 fc ff ff    	mov    0xfffffc20(%ebp),%eax
   1299c:	89 43 04             	mov    %eax,0x4(%ebx)
   1299f:	8b 41 44             	mov    0x44(%ecx),%eax
   129a2:	89 13                	mov    %edx,(%ebx)
   129a4:	89 43 44             	mov    %eax,0x44(%ebx)
   129a7:	8b 95 94 fb ff ff    	mov    0xfffffb94(%ebp),%edx
   129ad:	8b 41 48             	mov    0x48(%ecx),%eax
   129b0:	8b 8d 64 fb ff ff    	mov    0xfffffb64(%ebp),%ecx
   129b6:	c7 83 b8 00 00 00 00 	movl   $0x0,0xb8(%ebx)
   129bd:	00 00 00 
   129c0:	89 43 48             	mov    %eax,0x48(%ebx)
   129c3:	89 53 40             	mov    %edx,0x40(%ebx)
   129c6:	8b 41 08             	mov    0x8(%ecx),%eax
   129c9:	8b 51 0c             	mov    0xc(%ecx),%edx
   129cc:	89 53 14             	mov    %edx,0x14(%ebx)
   129cf:	89 43 10             	mov    %eax,0x10(%ebx)
   129d2:	8b 57 0c             	mov    0xc(%edi),%edx
   129d5:	8b 47 08             	mov    0x8(%edi),%eax
   129d8:	89 43 08             	mov    %eax,0x8(%ebx)
   129db:	89 53 0c             	mov    %edx,0xc(%ebx)
   129de:	8b 95 90 fb ff ff    	mov    0xfffffb90(%ebp),%edx
   129e4:	8b 42 1c             	mov    0x1c(%edx),%eax
   129e7:	89 43 1c             	mov    %eax,0x1c(%ebx)
   129ea:	8b 42 18             	mov    0x18(%edx),%eax
   129ed:	89 43 18             	mov    %eax,0x18(%ebx)
   129f0:	8a 42 20             	mov    0x20(%edx),%al
   129f3:	88 43 20             	mov    %al,0x20(%ebx)
   129f6:	8a 4d 18             	mov    0x18(%ebp),%cl
   129f9:	88 8b bc 00 00 00    	mov    %cl,0xbc(%ebx)
   129ff:	8b 95 a4 fb ff ff    	mov    0xfffffba4(%ebp),%edx
   12a05:	8a 02                	mov    (%edx),%al
   12a07:	88 83 bd 00 00 00    	mov    %al,0xbd(%ebx)
   12a0d:	8a 42 01             	mov    0x1(%edx),%al
   12a10:	88 83 be 00 00 00    	mov    %al,0xbe(%ebx)
   12a16:	8a 42 02             	mov    0x2(%edx),%al
   12a19:	c7 43 50 0a 00 00 00 	movl   $0xa,0x50(%ebx)
   12a20:	88 83 bf 00 00 00    	mov    %al,0xbf(%ebx)
   12a26:	8b 8d 90 fb ff ff    	mov    0xfffffb90(%ebp),%ecx
   12a2c:	8a 81 c0 00 00 00    	mov    0xc0(%ecx),%al
   12a32:	88 83 c0 00 00 00    	mov    %al,0xc0(%ebx)
   12a38:	50                   	push   %eax
   12a39:	50                   	push   %eax
   12a3a:	6a 08                	push   $0x8
   12a3c:	53                   	push   %ebx
   12a3d:	e8 ee 03 00 00       	call   12e30 <_ScsiClassInitializeSrbLookasideList@8>
   12a42:	8d 93 d8 00 00 00    	lea    0xd8(%ebx),%edx
   12a48:	5e                   	pop    %esi
   12a49:	58                   	pop    %eax
   12a4a:	8b 85 8c fb ff ff    	mov    0xfffffb8c(%ebp),%eax
   12a50:	89 95 8c fb ff ff    	mov    %edx,0xfffffb8c(%ebp)
   12a56:	89 18                	mov    %ebx,(%eax)
   12a58:	c7 83 d8 00 00 00 00 	movl   $0x0,0xd8(%ebx)
   12a5f:	00 00 00 
   12a62:	8a 47 18             	mov    0x18(%edi),%al
   12a65:	88 42 18             	mov    %al,0x18(%edx)
   12a68:	8b 8d 60 fb ff ff    	mov    0xfffffb60(%ebp),%ecx
   12a6e:	89 4a 10             	mov    %ecx,0x10(%edx)
   12a71:	89 4a 14             	mov    %ecx,0x14(%edx)
   12a74:	8b 47 10             	mov    0x10(%edi),%eax
   12a77:	89 42 0c             	mov    %eax,0xc(%edx)
   12a7a:	8a 47 19             	mov    0x19(%edi),%al
   12a7d:	c6 42 1a 00          	movb   $0x0,0x1a(%edx)
   12a81:	88 42 19             	mov    %al,0x19(%edx)
   12a84:	8b 95 08 fc ff ff    	mov    0xfffffc08(%ebp),%edx
   12a8a:	8b 8d 60 fb ff ff    	mov    0xfffffb60(%ebp),%ecx
   12a90:	39 0a                	cmp    %ecx,(%edx)
   12a92:	0f 87 56 fe ff ff    	ja     128ee <_DiskClassFindDevices@20+0xb8e>
   12a98:	e9 01 fe ff ff       	jmp    1289e <_DiskClassFindDevices@20+0xb3e>
   12a9d:	6a 00                	push   $0x0
   12a9f:	6a 01                	push   $0x1
   12aa1:	8b 85 a4 fb ff ff    	mov    0xfffffba4(%ebp),%eax
   12aa7:	50                   	push   %eax
   12aa8:	8b 85 20 fc ff ff    	mov    0xfffffc20(%ebp),%eax
   12aae:	50                   	push   %eax
   12aaf:	e8 bc 03 00 00       	call   12e70 <_ScsiClassClaimDevice@16>
   12ab4:	e9 ba fd ff ff       	jmp    12873 <_DiskClassFindDevices@20+0xb13>
   12ab9:	8b 95 90 fb ff ff    	mov    0xfffffb90(%ebp),%edx
   12abf:	8b 42 44             	mov    0x44(%edx),%eax
   12ac2:	e9 97 f7 ff ff       	jmp    1225e <_DiskClassFindDevices@20+0x4fe>
   12ac7:	8b 95 90 fb ff ff    	mov    0xfffffb90(%ebp),%edx
   12acd:	8b 42 44             	mov    0x44(%edx),%eax
   12ad0:	e9 40 f7 ff ff       	jmp    12215 <_DiskClassFindDevices@20+0x4b5>
   12ad5:	83 ec 0c             	sub    $0xc,%esp
   12ad8:	8b 85 d8 fb ff ff    	mov    0xfffffbd8(%ebp),%eax
   12ade:	50                   	push   %eax
   12adf:	e8 cc 04 00 00       	call   12fb0 <_ZwClose@4>
   12ae4:	8b 8d 88 fb ff ff    	mov    0xfffffb88(%ebp),%ecx
   12aea:	8b 85 d4 fb ff ff    	mov    0xfffffbd4(%ebp),%eax
   12af0:	83 c4 0c             	add    $0xc,%esp
   12af3:	8b 79 08             	mov    0x8(%ecx),%edi
   12af6:	8d 04 40             	lea    (%eax,%eax,2),%eax
   12af9:	c1 e0 02             	shl    $0x2,%eax
   12afc:	01 f9                	add    %edi,%ecx
   12afe:	83 c1 20             	add    $0x20,%ecx
   12b01:	66 8b 54 08 08       	mov    0x8(%eax,%ecx,1),%dx
   12b06:	66 8b 44 08 06       	mov    0x6(%eax,%ecx,1),%ax
   12b0b:	81 e2 ff ff 00 00    	and    $0xffff,%edx
   12b11:	31 c9                	xor    %ecx,%ecx
   12b13:	89 c3                	mov    %eax,%ebx
   12b15:	8d 72 01             	lea    0x1(%edx),%esi
   12b18:	8b 95 90 fb ff ff    	mov    0xfffffb90(%ebp),%edx
   12b1e:	81 e3 ff ff 00 00    	and    $0xffff,%ebx
   12b24:	8a 8a c0 00 00 00    	mov    0xc0(%edx),%cl
   12b2a:	8b 42 08             	mov    0x8(%edx),%eax
   12b2d:	8b 52 0c             	mov    0xc(%edx),%edx
   12b30:	0f ad d0             	shrd   %cl,%edx,%eax
   12b33:	d3 fa                	sar    %cl,%edx
   12b35:	83 e1 20             	and    $0x20,%ecx
   12b38:	74 02                	je     12b3c <_DiskClassFindDevices@20+0xddc>
   12b3a:	89 d0                	mov    %edx,%eax
   12b3c:	89 f7                	mov    %esi,%edi
   12b3e:	0f af fb             	imul   %ebx,%edi
   12b41:	89 bd dc fb ff ff    	mov    %edi,0xfffffbdc(%ebp)
   12b47:	85 ff                	test   %edi,%edi
   12b49:	74 1e                	je     12b69 <_DiskClassFindDevices@20+0xe09>
   12b4b:	31 d2                	xor    %edx,%edx
   12b4d:	f7 f7                	div    %edi
   12b4f:	8b bd 90 fb ff ff    	mov    0xfffffb90(%ebp),%edi
   12b55:	89 c1                	mov    %eax,%ecx
   12b57:	8b 47 44             	mov    0x44(%edi),%eax
   12b5a:	89 58 10             	mov    %ebx,0x10(%eax)
   12b5d:	89 70 0c             	mov    %esi,0xc(%eax)
   12b60:	89 08                	mov    %ecx,(%eax)
   12b62:	c7 40 04 00 00 00 00 	movl   $0x0,0x4(%eax)
   12b69:	83 ec 0c             	sub    $0xc,%esp
   12b6c:	8b b5 88 fb ff ff    	mov    0xfffffb88(%ebp),%esi
   12b72:	56                   	push   %esi
   12b73:	e8 98 03 00 00       	call   12f10 <_ExFreePool@4>
   12b78:	83 c4 0c             	add    $0xc,%esp
   12b7b:	e9 60 fd ff ff       	jmp    128e0 <_DiskClassFindDevices@20+0xb80>
   12b80:	80 bd 6f fb ff ff 00 	cmpb   $0x0,0xfffffb6f(%ebp)
   12b87:	0f 85 48 ff ff ff    	jne    12ad5 <_DiskClassFindDevices@20+0xd75>
   12b8d:	83 ec 0c             	sub    $0xc,%esp
   12b90:	8b 85 d8 fb ff ff    	mov    0xfffffbd8(%ebp),%eax
   12b96:	50                   	push   %eax
   12b97:	e8 14 04 00 00       	call   12fb0 <_ZwClose@4>
   12b9c:	83 c4 0c             	add    $0xc,%esp
   12b9f:	eb c8                	jmp    12b69 <_DiskClassFindDevices@20+0xe09>
   12ba1:	8b 8d 90 fb ff ff    	mov    0xfffffb90(%ebp),%ecx
   12ba7:	83 ec 0c             	sub    $0xc,%esp
   12baa:	8b 41 44             	mov    0x44(%ecx),%eax
   12bad:	c7 41 1c 3f 00 00 00 	movl   $0x3f,0x1c(%ecx)
   12bb4:	8b 50 14             	mov    0x14(%eax),%edx
   12bb7:	c6 41 20 01          	movb   $0x1,0x20(%ecx)
   12bbb:	89 d0                	mov    %edx,%eax
   12bbd:	8b bd 0c fc ff ff    	mov    0xfffffc0c(%ebp),%edi
   12bc3:	c1 e0 06             	shl    $0x6,%eax
   12bc6:	29 d0                	sub    %edx,%eax
   12bc8:	89 41 18             	mov    %eax,0x18(%ecx)
   12bcb:	57                   	push   %edi
   12bcc:	e8 3f 03 00 00       	call   12f10 <_ExFreePool@4>
   12bd1:	c7 85 0c fc ff ff 00 	movl   $0x0,0xfffffc0c(%ebp)
   12bd8:	00 00 00 
   12bdb:	83 c4 0c             	add    $0xc,%esp
   12bde:	e9 58 f6 ff ff       	jmp    1223b <_DiskClassFindDevices@20+0x4db>
   12be3:	8b 95 08 fc ff ff    	mov    0xfffffc08(%ebp),%edx
   12be9:	e9 de f6 ff ff       	jmp    122cc <_DiskClassFindDevices@20+0x56c>

  DPRINT("ScsiDiskUpdateFixedDiskGeometry() done\n");
}


/**********************************************************************
 * NAME							INTERNAL
 *	ScsiDiskCalcMbrCheckSum
 *
 * DESCRIPTION
 *	Calculates the Checksum from drives MBR.
 *
 * RUN LEVEL
 *	PASSIVE_LEVEL
 *
 * ARGUMENTS
 *	DeviceExtension
 *		Disk device extension.
 *
 *	Checksum
 *		Pointer to the caller supplied cecksum variable.
 *
 * RETURN VALUE
 *	TRUE: Checksum was calculated.
 *	FALSE: Calculation failed.
 */

static BOOLEAN
ScsiDiskCalcMbrCheckSum(IN PDEVICE_EXTENSION DeviceExtension,
			OUT PULONG Checksum)
{
  IO_STATUS_BLOCK IoStatusBlock;
  LARGE_INTEGER SectorOffset;
  ULONG SectorSize;
  PULONG MbrBuffer;
  KEVENT Event;
  PIRP Irp;
  ULONG i;
  ULONG Sum;
  NTSTATUS Status;

  KeInitializeEvent(&Event,
   12bee:	50                   	push   %eax
   12bef:	8d 85 b8 fc ff ff    	lea    0xfffffcb8(%ebp),%eax
   12bf5:	6a 00                	push   $0x0
   12bf7:	6a 00                	push   $0x0
   12bf9:	50                   	push   %eax
   12bfa:	e8 e1 03 00 00       	call   12fe0 <_KeInitializeEvent@12>
		    NotificationEvent,
		    FALSE);

  /* Get the disk sector size */
  SectorSize = DeviceExtension->DiskGeometry->BytesPerSector;
   12bff:	8b 95 90 fb ff ff    	mov    0xfffffb90(%ebp),%edx
   12c05:	8b 42 44             	mov    0x44(%edx),%eax
   12c08:	89 df                	mov    %ebx,%edi
   12c0a:	5e                   	pop    %esi
   12c0b:	83 c7 08             	add    $0x8,%edi
   12c0e:	8b 70 14             	mov    0x14(%eax),%esi
  if (SectorSize < 512)
   12c11:	81 fe ff 01 00 00    	cmp    $0x1ff,%esi
   12c17:	77 05                	ja     12c1e <_DiskClassFindDevices@20+0xebe>
    {
      SectorSize = 512;
   12c19:	be 00 02 00 00       	mov    $0x200,%esi
    }

  /* Allocate MBR buffer */
  MbrBuffer = ExAllocatePool(NonPagedPool,
   12c1e:	53                   	push   %ebx
   12c1f:	53                   	push   %ebx
   12c20:	56                   	push   %esi
   12c21:	6a 00                	push   $0x0
   12c23:	e8 98 02 00 00       	call   12ec0 <_ExAllocatePool@8>
   12c28:	5a                   	pop    %edx
   12c29:	89 c3                	mov    %eax,%ebx
   12c2b:	59                   	pop    %ecx
			     SectorSize);
  if (MbrBuffer == NULL)
   12c2c:	85 c0                	test   %eax,%eax
   12c2e:	0f 84 b4 f6 ff ff    	je     122e8 <_DiskClassFindDevices@20+0x588>
    {
      return FALSE;
    }

  /* Allocate an IRP */
  SectorOffset.QuadPart = 0ULL;
   12c34:	c7 85 f8 fb ff ff 00 	movl   $0x0,0xfffffbf8(%ebp)
   12c3b:	00 00 00 
   12c3e:	c7 85 fc fb ff ff 00 	movl   $0x0,0xfffffbfc(%ebp)
   12c45:	00 00 00 
  Irp = IoBuildSynchronousFsdRequest(IRP_MJ_READ,
   12c48:	50                   	push   %eax
   12c49:	8d 85 00 fc ff ff    	lea    0xfffffc00(%ebp),%eax
   12c4f:	8d 8d b8 fc ff ff    	lea    0xfffffcb8(%ebp),%ecx
   12c55:	50                   	push   %eax
   12c56:	8d 85 f8 fb ff ff    	lea    0xfffffbf8(%ebp),%eax
   12c5c:	51                   	push   %ecx
   12c5d:	50                   	push   %eax
   12c5e:	56                   	push   %esi
   12c5f:	53                   	push   %ebx
   12c60:	8b 85 90 fb ff ff    	mov    0xfffffb90(%ebp),%eax
   12c66:	8b 30                	mov    (%eax),%esi
   12c68:	56                   	push   %esi
   12c69:	6a 03                	push   $0x3
   12c6b:	e8 80 03 00 00       	call   12ff0 <_IoBuildSynchronousFsdRequest@28>
   12c70:	59                   	pop    %ecx
				     DeviceExtension->DeviceObject,
				     MbrBuffer,
				     SectorSize,
				     &SectorOffset,
				     &Event,
				     &IoStatusBlock);
  if (Irp == NULL)
   12c71:	85 c0                	test   %eax,%eax
   12c73:	74 35                	je     12caa <_DiskClassFindDevices@20+0xf4a>
    {
      ExFreePool(MbrBuffer);
      return FALSE;
    }

  /* Call the miniport driver */
  Status = IoCallDriver(DeviceExtension->DeviceObject,
   12c75:	52                   	push   %edx
   12c76:	52                   	push   %edx
   12c77:	50                   	push   %eax
   12c78:	8b 95 90 fb ff ff    	mov    0xfffffb90(%ebp),%edx
   12c7e:	8b 32                	mov    (%edx),%esi
   12c80:	56                   	push   %esi
   12c81:	e8 4a 02 00 00       	call   12ed0 <_IoCallDriver@8>
   12c86:	5a                   	pop    %edx
			Irp);
  if (Status == STATUS_PENDING)
   12c87:	3d 03 01 00 00       	cmp    $0x103,%eax
   12c8c:	59                   	pop    %ecx
   12c8d:	0f 84 13 01 00 00    	je     12da6 <_DiskClassFindDevices@20+0x1046>
    {
      KeWaitForSingleObject(&Event,
			    Suspended,
			    KernelMode,
			    FALSE,
			    NULL);
      Status = IoStatusBlock.Status;
    }

  if (!NT_SUCCESS(Status))
    {
      ExFreePool(MbrBuffer);
      return FALSE;
    }

  /* Calculate MBR checksum */
  Sum = 0;
   12c93:	31 c9                	xor    %ecx,%ecx
  for (i = 0; i < 128; i++)
   12c95:	31 d2                	xor    %edx,%edx
   12c97:	85 c0                	test   %eax,%eax
   12c99:	78 0f                	js     12caa <_DiskClassFindDevices@20+0xf4a>
    {
      Sum += MbrBuffer[i];
   12c9b:	8b 04 93             	mov    (%ebx,%edx,4),%eax
   12c9e:	42                   	inc    %edx
   12c9f:	01 c1                	add    %eax,%ecx
   12ca1:	83 fa 7f             	cmp    $0x7f,%edx
   12ca4:	76 f5                	jbe    12c9b <_DiskClassFindDevices@20+0xf3b>
    }
  *Checksum = ~Sum + 1;
   12ca6:	f7 d9                	neg    %ecx
   12ca8:	89 0f                	mov    %ecx,(%edi)

  ExFreePool(MbrBuffer);
   12caa:	83 ec 0c             	sub    $0xc,%esp
   12cad:	53                   	push   %ebx
   12cae:	e8 5d 02 00 00       	call   12f10 <_ExFreePool@4>
   12cb3:	83 c4 0c             	add    $0xc,%esp
   12cb6:	e9 2d f6 ff ff       	jmp    122e8 <_DiskClassFindDevices@20+0x588>
   12cbb:	8b 8d 1c fc ff ff    	mov    0xfffffc1c(%ebp),%ecx
   12cc1:	31 c0                	xor    %eax,%eax
   12cc3:	f6 41 20 01          	testb  $0x1,0x20(%ecx)
   12cc7:	0f 84 9c f4 ff ff    	je     12169 <_DiskClassFindDevices@20+0x409>
   12ccd:	e9 1d f5 ff ff       	jmp    121ef <_DiskClassFindDevices@20+0x48f>
   12cd2:	8b 8d 5c fb ff ff    	mov    0xfffffb5c(%ebp),%ecx
   12cd8:	c6 41 1a 01          	movb   $0x1,0x1a(%ecx)
   12cdc:	e9 ce f5 ff ff       	jmp    122af <_DiskClassFindDevices@20+0x54f>
   12ce1:	53                   	push   %ebx
   12ce2:	8b 8d 98 fb ff ff    	mov    0xfffffb98(%ebp),%ecx
   12ce8:	8d 9d c8 fc ff ff    	lea    0xfffffcc8(%ebp),%ebx
   12cee:	51                   	push   %ecx
   12cef:	68 68 42 01 00       	push   $0x14268
   12cf4:	53                   	push   %ebx
   12cf5:	e8 76 03 00 00       	call   13070 <_swprintf>
   12cfa:	58                   	pop    %eax
   12cfb:	5a                   	pop    %edx
   12cfc:	53                   	push   %ebx
   12cfd:	8d 9d 10 fc ff ff    	lea    0xfffffc10(%ebp),%ebx
   12d03:	53                   	push   %ebx
   12d04:	e8 27 02 00 00       	call   12f30 <_RtlInitUnicodeString@8>
   12d09:	8b 85 90 fb ff ff    	mov    0xfffffb90(%ebp),%eax
   12d0f:	05 c8 00 00 00       	add    $0xc8,%eax
   12d14:	50                   	push   %eax
   12d15:	53                   	push   %ebx
   12d16:	e8 e5 02 00 00       	call   13000 <_IoCreateSynchronizationEvent@8>
   12d1b:	57                   	push   %edi
   12d1c:	8b bd 90 fb ff ff    	mov    0xfffffb90(%ebp),%edi
   12d22:	89 87 c4 00 00 00    	mov    %eax,0xc4(%edi)
   12d28:	50                   	push   %eax
   12d29:	e8 e2 02 00 00       	call   13010 <_KeClearEvent@4>
   12d2e:	8b 8d 1c fc ff ff    	mov    0xfffffc1c(%ebp),%ecx
   12d34:	83 c4 0c             	add    $0xc,%esp
   12d37:	8b 47 44             	mov    0x44(%edi),%eax
   12d3a:	e9 d6 f4 ff ff       	jmp    12215 <_DiskClassFindDevices@20+0x4b5>
   12d3f:	53                   	push   %ebx
   12d40:	53                   	push   %ebx
   12d41:	6a 28                	push   $0x28
   12d43:	6a 00                	push   $0x0
   12d45:	e8 76 01 00 00       	call   12ec0 <_ExAllocatePool@8>
   12d4a:	5a                   	pop    %edx
   12d4b:	85 c0                	test   %eax,%eax
   12d4d:	59                   	pop    %ecx
   12d4e:	89 c2                	mov    %eax,%edx
   12d50:	89 85 08 fc ff ff    	mov    %eax,0xfffffc08(%ebp)
   12d56:	0f 84 70 f5 ff ff    	je     122cc <_DiskClassFindDevices@20+0x56c>
   12d5c:	50                   	push   %eax
   12d5d:	50                   	push   %eax
   12d5e:	6a 28                	push   $0x28
   12d60:	52                   	push   %edx
   12d61:	e8 3a 01 00 00       	call   12ea0 <_RtlZeroMemory@8>
   12d66:	8b 85 08 fc ff ff    	mov    0xfffffc08(%ebp),%eax
   12d6c:	5e                   	pop    %esi
   12d6d:	5f                   	pop    %edi
   12d6e:	8b bd 5c fb ff ff    	mov    0xfffffb5c(%ebp),%edi
   12d74:	c7 00 01 00 00 00    	movl   $0x1,(%eax)
   12d7a:	c6 47 1a 01          	movb   $0x1,0x1a(%edi)
   12d7e:	8b 95 08 fc ff ff    	mov    0xfffffc08(%ebp),%edx
   12d84:	e9 4b f5 ff ff       	jmp    122d4 <_DiskClassFindDevices@20+0x574>
   12d89:	51                   	push   %ecx
   12d8a:	51                   	push   %ecx
   12d8b:	6a 28                	push   $0x28
   12d8d:	50                   	push   %eax
   12d8e:	e8 0d 01 00 00       	call   12ea0 <_RtlZeroMemory@8>
   12d93:	58                   	pop    %eax
   12d94:	5a                   	pop    %edx
   12d95:	8b 95 08 fc ff ff    	mov    0xfffffc08(%ebp),%edx
   12d9b:	c7 02 01 00 00 00    	movl   $0x1,(%edx)
   12da1:	e9 2e f5 ff ff       	jmp    122d4 <_DiskClassFindDevices@20+0x574>
   12da6:	83 ec 0c             	sub    $0xc,%esp
   12da9:	8d 8d b8 fc ff ff    	lea    0xfffffcb8(%ebp),%ecx
   12daf:	6a 00                	push   $0x0
   12db1:	6a 00                	push   $0x0
   12db3:	6a 00                	push   $0x0
   12db5:	6a 05                	push   $0x5
   12db7:	51                   	push   %ecx
   12db8:	e8 63 02 00 00       	call   13020 <_KeWaitForSingleObject@20>
   12dbd:	8b 85 00 fc ff ff    	mov    0xfffffc00(%ebp),%eax
   12dc3:	83 c4 0c             	add    $0xc,%esp
   12dc6:	e9 c8 fe ff ff       	jmp    12c93 <_DiskClassFindDevices@20+0xf33>
   12dcb:	90                   	nop    
   12dcc:	90                   	nop    
   12dcd:	90                   	nop    
   12dce:	90                   	nop    
   12dcf:	90                   	nop    

00012dd0 <_ScsiClassInitialize@12>:
   12dd0:	ff 25 18 51 01 00    	jmp    *0x15118
   12dd6:	90                   	nop    
   12dd7:	90                   	nop    
	...

00012de0 <_ScsiClassSendSrbSynchronous@20>:
   12de0:	ff 25 30 51 01 00    	jmp    *0x15130
   12de6:	90                   	nop    
   12de7:	90                   	nop    
	...

00012df0 <_ScsiClassIoComplete@12>:
   12df0:	ff 25 20 51 01 00    	jmp    *0x15120
   12df6:	90                   	nop    
   12df7:	90                   	nop    
	...

00012e00 <_ScsiClassDeviceControl@8>:
   12e00:	ff 25 08 51 01 00    	jmp    *0x15108
   12e06:	90                   	nop    
   12e07:	90                   	nop    
	...

00012e10 <_ScsiClassReadDriveCapacity@4>:
   12e10:	ff 25 2c 51 01 00    	jmp    *0x1512c
   12e16:	90                   	nop    
   12e17:	90                   	nop    
	...

00012e20 <_ScsiClassModeSense@16>:
   12e20:	ff 25 24 51 01 00    	jmp    *0x15124
   12e26:	90                   	nop    
   12e27:	90                   	nop    
	...

00012e30 <_ScsiClassInitializeSrbLookasideList@8>:
   12e30:	ff 25 1c 51 01 00    	jmp    *0x1511c
   12e36:	90                   	nop    
   12e37:	90                   	nop    
	...

00012e40 <_ScsiClassGetCapabilities@8>:
   12e40:	ff 25 10 51 01 00    	jmp    *0x15110
   12e46:	90                   	nop    
   12e47:	90                   	nop    
	...

00012e50 <_ScsiClassGetInquiryData@8>:
   12e50:	ff 25 14 51 01 00    	jmp    *0x15114
   12e56:	90                   	nop    
   12e57:	90                   	nop    
	...

00012e60 <_ScsiClassFindUnclaimedDevices@8>:
   12e60:	ff 25 0c 51 01 00    	jmp    *0x1510c
   12e66:	90                   	nop    
   12e67:	90                   	nop    
	...

00012e70 <_ScsiClassClaimDevice@16>:
   12e70:	ff 25 00 51 01 00    	jmp    *0x15100
   12e76:	90                   	nop    
   12e77:	90                   	nop    
	...

00012e80 <_ScsiClassCreateDeviceObject@20>:
   12e80:	ff 25 04 51 01 00    	jmp    *0x15104
   12e86:	90                   	nop    
   12e87:	90                   	nop    
	...

00012e90 <_ScsiClassQueryTimeOutRegistryValue@4>:
   12e90:	ff 25 28 51 01 00    	jmp    *0x15128
   12e96:	90                   	nop    
   12e97:	90                   	nop    
	...

00012ea0 <_RtlZeroMemory@8>:
   12ea0:	ff 25 90 51 01 00    	jmp    *0x15190
   12ea6:	90                   	nop    
   12ea7:	90                   	nop    
	...

00012eb0 <_IoSetHardErrorOrVerifyDevice@8>:
   12eb0:	ff 25 78 51 01 00    	jmp    *0x15178
   12eb6:	90                   	nop    
   12eb7:	90                   	nop    
	...

00012ec0 <_ExAllocatePool@8>:
   12ec0:	ff 25 4c 51 01 00    	jmp    *0x1514c
   12ec6:	90                   	nop    
   12ec7:	90                   	nop    
	...

00012ed0 <_IoCallDriver@8>:
   12ed0:	ff 25 60 51 01 00    	jmp    *0x15160
   12ed6:	90                   	nop    
   12ed7:	90                   	nop    
	...

00012ee0 <_IoCompleteRequest@8>:
   12ee0:	ff 25 64 51 01 00    	jmp    *0x15164
   12ee6:	90                   	nop    
   12ee7:	90                   	nop    
	...

00012ef0 <_RtlMoveMemory@12>:
   12ef0:	ff 25 8c 51 01 00    	jmp    *0x1518c
   12ef6:	90                   	nop    
   12ef7:	90                   	nop    
	...

00012f00 <@IoReadPartitionTable@16>:
   12f00:	ff 25 3c 51 01 00    	jmp    *0x1513c
   12f06:	90                   	nop    
   12f07:	90                   	nop    
	...

00012f10 <_ExFreePool@4>:
   12f10:	ff 25 54 51 01 00    	jmp    *0x15154
   12f16:	90                   	nop    
   12f17:	90                   	nop    
	...

00012f20 <@IoSetPartitionInformation@16>:
   12f20:	ff 25 40 51 01 00    	jmp    *0x15140
   12f26:	90                   	nop    
   12f27:	90                   	nop    
	...

00012f30 <_RtlInitUnicodeString@8>:
   12f30:	ff 25 88 51 01 00    	jmp    *0x15188
   12f36:	90                   	nop    
   12f37:	90                   	nop    
	...

00012f40 <_IoCreateDevice@28>:
   12f40:	ff 25 68 51 01 00    	jmp    *0x15168
   12f46:	90                   	nop    
   12f47:	90                   	nop    
	...

00012f50 <@IoWritePartitionTable@20>:
   12f50:	ff 25 44 51 01 00    	jmp    *0x15144
   12f56:	90                   	nop    
   12f57:	90                   	nop    
	...

00012f60 <_IoGetConfigurationInformation@0>:
   12f60:	ff 25 74 51 01 00    	jmp    *0x15174
   12f66:	90                   	nop    
   12f67:	90                   	nop    
	...

00012f70 <_ZwCreateDirectoryObject@12>:
   12f70:	ff 25 98 51 01 00    	jmp    *0x15198
   12f76:	90                   	nop    
   12f77:	90                   	nop    
	...

00012f80 <_ExDeleteNPagedLookasideList@4>:
   12f80:	ff 25 50 51 01 00    	jmp    *0x15150
   12f86:	90                   	nop    
   12f87:	90                   	nop    
	...

00012f90 <_IoDeleteDevice@4>:
   12f90:	ff 25 70 51 01 00    	jmp    *0x15170
   12f96:	90                   	nop    
   12f97:	90                   	nop    
	...

00012fa0 <_ZwMakeTemporaryObject@4>:
   12fa0:	ff 25 9c 51 01 00    	jmp    *0x1519c
   12fa6:	90                   	nop    
   12fa7:	90                   	nop    
	...

00012fb0 <_ZwClose@4>:
   12fb0:	ff 25 94 51 01 00    	jmp    *0x15194
   12fb6:	90                   	nop    
   12fb7:	90                   	nop    
	...

00012fc0 <_ZwOpenKey@12>:
   12fc0:	ff 25 a0 51 01 00    	jmp    *0x151a0
   12fc6:	90                   	nop    
   12fc7:	90                   	nop    
	...

00012fd0 <_ZwQueryValueKey@24>:
   12fd0:	ff 25 a4 51 01 00    	jmp    *0x151a4
   12fd6:	90                   	nop    
   12fd7:	90                   	nop    
	...

00012fe0 <_KeInitializeEvent@12>:
   12fe0:	ff 25 80 51 01 00    	jmp    *0x15180
   12fe6:	90                   	nop    
   12fe7:	90                   	nop    
	...

00012ff0 <_IoBuildSynchronousFsdRequest@28>:
   12ff0:	ff 25 5c 51 01 00    	jmp    *0x1515c
   12ff6:	90                   	nop    
   12ff7:	90                   	nop    
	...

00013000 <_IoCreateSynchronizationEvent@8>:
   13000:	ff 25 6c 51 01 00    	jmp    *0x1516c
   13006:	90                   	nop    
   13007:	90                   	nop    
	...

00013010 <_KeClearEvent@4>:
   13010:	ff 25 7c 51 01 00    	jmp    *0x1517c
   13016:	90                   	nop    
   13017:	90                   	nop    
	...

00013020 <_KeWaitForSingleObject@20>:
   13020:	ff 25 84 51 01 00    	jmp    *0x15184
   13026:	90                   	nop    
   13027:	90                   	nop    
	...

00013030 <_memcpy>:
   13030:	ff 25 ac 51 01 00    	jmp    *0x151ac
   13036:	90                   	nop    
   13037:	90                   	nop    
	...

00013040 <__wcsnicmp>:
   13040:	ff 25 a8 51 01 00    	jmp    *0x151a8
   13046:	90                   	nop    
   13047:	90                   	nop    
	...

00013050 <_sprintf>:
   13050:	ff 25 b0 51 01 00    	jmp    *0x151b0
   13056:	90                   	nop    
   13057:	90                   	nop    
	...

00013060 <_DbgPrint>:
   13060:	ff 25 48 51 01 00    	jmp    *0x15148
   13066:	90                   	nop    
   13067:	90                   	nop    
	...

00013070 <_swprintf>:
   13070:	ff 25 b4 51 01 00    	jmp    *0x151b4
   13076:	90                   	nop    
   13077:	90                   	nop    
	...

00013080 <___divdi3>:
   13080:	55                   	push   %ebp
   13081:	89 e5                	mov    %esp,%ebp
   13083:	83 ec 20             	sub    $0x20,%esp
   13086:	89 5d f4             	mov    %ebx,0xfffffff4(%ebp)
   13089:	8b 5d 0c             	mov    0xc(%ebp),%ebx
   1308c:	8b 4d 08             	mov    0x8(%ebp),%ecx
   1308f:	89 75 f8             	mov    %esi,0xfffffff8(%ebp)
   13092:	8b 45 10             	mov    0x10(%ebp),%eax
   13095:	85 db                	test   %ebx,%ebx
   13097:	89 7d fc             	mov    %edi,0xfffffffc(%ebp)
   1309a:	8b 55 14             	mov    0x14(%ebp),%edx
   1309d:	c7 45 f0 00 00 00 00 	movl   $0x0,0xfffffff0(%ebp)
   130a4:	0f 88 aa 00 00 00    	js     13154 <___divdi3+0xd4>
   130aa:	85 d2                	test   %edx,%edx
   130ac:	0f 88 93 00 00 00    	js     13145 <___divdi3+0xc5>
   130b2:	89 4d ec             	mov    %ecx,0xffffffec(%ebp)
   130b5:	85 d2                	test   %edx,%edx
   130b7:	89 c6                	mov    %eax,%esi
   130b9:	75 35                	jne    130f0 <___divdi3+0x70>
   130bb:	39 d8                	cmp    %ebx,%eax
   130bd:	76 63                	jbe    13122 <___divdi3+0xa2>
   130bf:	89 c8                	mov    %ecx,%eax
   130c1:	89 da                	mov    %ebx,%edx
   130c3:	f7 f6                	div    %esi
   130c5:	89 c1                	mov    %eax,%ecx
   130c7:	c7 45 e8 00 00 00 00 	movl   $0x0,0xffffffe8(%ebp)
   130ce:	89 c8                	mov    %ecx,%eax
   130d0:	8b 4d f0             	mov    0xfffffff0(%ebp),%ecx
   130d3:	8b 55 e8             	mov    0xffffffe8(%ebp),%edx
   130d6:	85 c9                	test   %ecx,%ecx
   130d8:	74 07                	je     130e1 <___divdi3+0x61>
   130da:	f7 d8                	neg    %eax
   130dc:	83 d2 00             	adc    $0x0,%edx
   130df:	f7 da                	neg    %edx
   130e1:	8b 5d f4             	mov    0xfffffff4(%ebp),%ebx
   130e4:	8b 75 f8             	mov    0xfffffff8(%ebp),%esi
   130e7:	8b 7d fc             	mov    0xfffffffc(%ebp),%edi
   130ea:	89 ec                	mov    %ebp,%esp
   130ec:	5d                   	pop    %ebp
   130ed:	c3                   	ret    
   130ee:	89 f6                	mov    %esi,%esi
   130f0:	c7 45 e8 00 00 00 00 	movl   $0x0,0xffffffe8(%ebp)
   130f7:	31 c9                	xor    %ecx,%ecx
   130f9:	39 da                	cmp    %ebx,%edx
   130fb:	77 d1                	ja     130ce <___divdi3+0x4e>
   130fd:	0f bd c2             	bsr    %edx,%eax
   13100:	83 f0 1f             	xor    $0x1f,%eax
   13103:	89 45 e4             	mov    %eax,0xffffffe4(%ebp)
   13106:	75 5f                	jne    13167 <___divdi3+0xe7>
   13108:	39 d3                	cmp    %edx,%ebx
   1310a:	b9 01 00 00 00       	mov    $0x1,%ecx
   1310f:	0f 97 c0             	seta   %al
   13112:	39 75 ec             	cmp    %esi,0xffffffec(%ebp)
   13115:	0f 93 c2             	setae  %dl
   13118:	09 d0                	or     %edx,%eax
   1311a:	a8 01                	test   $0x1,%al
   1311c:	75 a9                	jne    130c7 <___divdi3+0x47>
   1311e:	31 c9                	xor    %ecx,%ecx
   13120:	eb a5                	jmp    130c7 <___divdi3+0x47>
   13122:	85 c0                	test   %eax,%eax
   13124:	75 0d                	jne    13133 <___divdi3+0xb3>
   13126:	b8 01 00 00 00       	mov    $0x1,%eax
   1312b:	31 c9                	xor    %ecx,%ecx
   1312d:	31 d2                	xor    %edx,%edx
   1312f:	f7 f1                	div    %ecx
   13131:	89 c6                	mov    %eax,%esi
   13133:	89 d8                	mov    %ebx,%eax
   13135:	31 d2                	xor    %edx,%edx
   13137:	f7 f6                	div    %esi
   13139:	89 45 e8             	mov    %eax,0xffffffe8(%ebp)
   1313c:	8b 45 ec             	mov    0xffffffec(%ebp),%eax
   1313f:	f7 f6                	div    %esi
   13141:	89 c1                	mov    %eax,%ecx
   13143:	eb 89                	jmp    130ce <___divdi3+0x4e>
   13145:	f7 55 f0             	notl   0xfffffff0(%ebp)
   13148:	f7 d8                	neg    %eax
   1314a:	83 d2 00             	adc    $0x0,%edx
   1314d:	f7 da                	neg    %edx
   1314f:	e9 5e ff ff ff       	jmp    130b2 <___divdi3+0x32>
   13154:	c7 45 f0 ff ff ff ff 	movl   $0xffffffff,0xfffffff0(%ebp)
   1315b:	f7 d9                	neg    %ecx
   1315d:	83 d3 00             	adc    $0x0,%ebx
   13160:	f7 db                	neg    %ebx
   13162:	e9 43 ff ff ff       	jmp    130aa <___divdi3+0x2a>
   13167:	8b 45 e4             	mov    0xffffffe4(%ebp),%eax
   1316a:	b9 20 00 00 00       	mov    $0x20,%ecx
   1316f:	29 c1                	sub    %eax,%ecx
   13171:	89 4d e0             	mov    %ecx,0xffffffe0(%ebp)
   13174:	0f b6 4d e4          	movzbl 0xffffffe4(%ebp),%ecx
   13178:	89 f0                	mov    %esi,%eax
   1317a:	d3 e2                	shl    %cl,%edx
   1317c:	0f b6 4d e0          	movzbl 0xffffffe0(%ebp),%ecx
   13180:	89 d7                	mov    %edx,%edi
   13182:	89 da                	mov    %ebx,%edx
   13184:	d3 e8                	shr    %cl,%eax
   13186:	09 c7                	or     %eax,%edi
   13188:	8b 45 ec             	mov    0xffffffec(%ebp),%eax
   1318b:	0f b6 4d e4          	movzbl 0xffffffe4(%ebp),%ecx
   1318f:	d3 e6                	shl    %cl,%esi
   13191:	0f b6 4d e0          	movzbl 0xffffffe0(%ebp),%ecx
   13195:	d3 ea                	shr    %cl,%edx
   13197:	0f b6 4d e4          	movzbl 0xffffffe4(%ebp),%ecx
   1319b:	d3 e3                	shl    %cl,%ebx
   1319d:	0f b6 4d e0          	movzbl 0xffffffe0(%ebp),%ecx
   131a1:	d3 e8                	shr    %cl,%eax
   131a3:	09 c3                	or     %eax,%ebx
   131a5:	0f b6 4d e4          	movzbl 0xffffffe4(%ebp),%ecx
   131a9:	89 d8                	mov    %ebx,%eax
   131ab:	f7 f7                	div    %edi
   131ad:	89 d3                	mov    %edx,%ebx
   131af:	d3 65 ec             	shll   %cl,0xffffffec(%ebp)
   131b2:	89 c1                	mov    %eax,%ecx
   131b4:	f7 e6                	mul    %esi
   131b6:	39 da                	cmp    %ebx,%edx
   131b8:	89 c6                	mov    %eax,%esi
   131ba:	77 13                	ja     131cf <___divdi3+0x14f>
   131bc:	0f 94 c0             	sete   %al
   131bf:	31 d2                	xor    %edx,%edx
   131c1:	3b 75 ec             	cmp    0xffffffec(%ebp),%esi
   131c4:	0f 97 c2             	seta   %dl
   131c7:	85 d0                	test   %edx,%eax
   131c9:	0f 84 f8 fe ff ff    	je     130c7 <___divdi3+0x47>
   131cf:	49                   	dec    %ecx
   131d0:	e9 f2 fe ff ff       	jmp    130c7 <___divdi3+0x47>
   131d5:	90                   	nop    
   131d6:	90                   	nop    
   131d7:	90                   	nop    
   131d8:	90                   	nop    
   131d9:	90                   	nop    
   131da:	90                   	nop    
   131db:	90                   	nop    
   131dc:	90                   	nop    
   131dd:	90                   	nop    
   131de:	90                   	nop    
   131df:	90                   	nop    

000131e0 <__CTOR_LIST__>:
   131e0:	ff                   	(bad)  
   131e1:	ff                   	(bad)  
   131e2:	ff                   	(bad)  
   131e3:	ff 00                	incl   (%eax)
   131e5:	00 00                	add    %al,(%eax)
	...

000131e8 <__DTOR_LIST__>:
   131e8:	ff                   	(bad)  
   131e9:	ff                   	(bad)  
   131ea:	ff                   	(bad)  
   131eb:	ff 00                	incl   (%eax)
   131ed:	00 00                	add    %al,(%eax)
	...
