mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 20:03:12 +00:00
Allocate a sense data buffer for each disk device.
svn path=/trunk/; revision=4959
This commit is contained in:
parent
39825a170b
commit
b209c5a96e
1 changed files with 30 additions and 1 deletions
|
@ -16,7 +16,7 @@
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
*/
|
||||||
/* $Id: disk.c,v 1.30 2003/05/01 17:50:35 ekohl Exp $
|
/* $Id: disk.c,v 1.31 2003/06/24 12:38:00 ekohl Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
|
@ -262,6 +262,8 @@ DiskClassFindDevices(PDRIVER_OBJECT DriverObject,
|
||||||
{
|
{
|
||||||
InquiryData = (PINQUIRYDATA)UnitInfo->InquiryData;
|
InquiryData = (PINQUIRYDATA)UnitInfo->InquiryData;
|
||||||
|
|
||||||
|
DPRINT("Device type %u\n", InquiryData->DeviceType);
|
||||||
|
|
||||||
if (((InquiryData->DeviceType == DIRECT_ACCESS_DEVICE) ||
|
if (((InquiryData->DeviceType == DIRECT_ACCESS_DEVICE) ||
|
||||||
(InquiryData->DeviceType == OPTICAL_DEVICE)) &&
|
(InquiryData->DeviceType == OPTICAL_DEVICE)) &&
|
||||||
(InquiryData->DeviceTypeQualifier == 0) &&
|
(InquiryData->DeviceTypeQualifier == 0) &&
|
||||||
|
@ -556,6 +558,32 @@ DiskClassCreateDeviceObject(IN PDRIVER_OBJECT DriverObject,
|
||||||
return(STATUS_INSUFFICIENT_RESOURCES);
|
return(STATUS_INSUFFICIENT_RESOURCES);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Allocate sense data buffer */
|
||||||
|
DiskDeviceExtension->SenseData = ExAllocatePool(NonPagedPool,
|
||||||
|
sizeof(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 */
|
/* Read the drive's capacity */
|
||||||
Status = ScsiClassReadDriveCapacity(DiskDeviceObject);
|
Status = ScsiClassReadDriveCapacity(DiskDeviceObject);
|
||||||
if (!NT_SUCCESS(Status) &&
|
if (!NT_SUCCESS(Status) &&
|
||||||
|
@ -711,6 +739,7 @@ DiskClassCreateDeviceObject(IN PDRIVER_OBJECT DriverObject,
|
||||||
PartitionDeviceObject->AlignmentRequirement = DiskDeviceObject->AlignmentRequirement;
|
PartitionDeviceObject->AlignmentRequirement = DiskDeviceObject->AlignmentRequirement;
|
||||||
|
|
||||||
PartitionDeviceExtension = PartitionDeviceObject->DeviceExtension;
|
PartitionDeviceExtension = PartitionDeviceObject->DeviceExtension;
|
||||||
|
PartitionDeviceExtension->SenseData = DiskDeviceExtension->SenseData;
|
||||||
PartitionDeviceExtension->LockCount = 0;
|
PartitionDeviceExtension->LockCount = 0;
|
||||||
PartitionDeviceExtension->DeviceNumber = DiskNumber;
|
PartitionDeviceExtension->DeviceNumber = DiskNumber;
|
||||||
PartitionDeviceExtension->DeviceObject = PartitionDeviceObject;
|
PartitionDeviceExtension->DeviceObject = PartitionDeviceObject;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue