mirror of
https://github.com/reactos/reactos.git
synced 2025-05-25 04:03:56 +00:00
[DISK_NEW]
- Fix compilation of new disk driver - Patch by Alex Ionescu svn path=/branches/usb-bringup-trunk/; revision=55447
This commit is contained in:
parent
ba68ad2102
commit
2f6346e3cf
7 changed files with 47 additions and 27 deletions
|
@ -1,13 +1,14 @@
|
||||||
remove_definitions(-D_WIN32_WINNT=0x502)
|
|
||||||
add_definitions(-D_WIN32_WINNT=0x600)
|
|
||||||
|
|
||||||
include_directories(..)
|
include_directories(..)
|
||||||
|
|
||||||
add_library(disk SHARED data.c disk.c diskwmi.c enum.c geometry.c part.c pnp.c disk.rc)
|
add_library(disk SHARED data.c disk.c diskwmi.c enum.c geometry.c part.c pnp.c disk.rc)
|
||||||
|
|
||||||
|
if(ARCH MATCHES i386)
|
||||||
|
add_target_compile_flags(disk "-mrtd -fno-builtin -Wno-unused-variable -Wno-pointer-sign")
|
||||||
|
endif()
|
||||||
|
|
||||||
set_module_type(disk kernelmodedriver)
|
set_module_type(disk kernelmodedriver)
|
||||||
add_importlibs(disk
|
add_importlibs(disk
|
||||||
class2
|
classpnp
|
||||||
scsiport
|
scsiport
|
||||||
ntoskrnl
|
ntoskrnl
|
||||||
hal)
|
hal)
|
||||||
|
|
|
@ -60,15 +60,20 @@ CLASSPNP_SCAN_FOR_SPECIAL_INFO DiskBadControllers[] = {
|
||||||
{ NULL , NULL , NULL, 0x0 }
|
{ NULL , NULL , NULL, 0x0 }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//
|
||||||
|
// ======== ROS DIFF ========
|
||||||
|
// Added MediaTypes in their own brace nesting level
|
||||||
|
// ======== ROS DIFF ========
|
||||||
|
//
|
||||||
DISK_MEDIA_TYPES_LIST const DiskMediaTypes[] = {
|
DISK_MEDIA_TYPES_LIST const DiskMediaTypes[] = {
|
||||||
{ "COMPAQ" , "PD-1 LF-1094" , NULL, 1, 1, PC_5_RW , 0 , 0 , 0 },
|
{ "COMPAQ" , "PD-1 LF-1094" , NULL, 1, 1, {PC_5_RW , 0 , 0 , 0 }},
|
||||||
{ "HP" , NULL , NULL, 2, 2, MO_5_WO , MO_5_RW, 0 , 0 },
|
{ "HP" , NULL , NULL, 2, 2, {MO_5_WO , MO_5_RW, 0 , 0 }},
|
||||||
{ "iomega" , "jaz" , NULL, 1, 1, IOMEGA_JAZ , 0 , 0 , 0 },
|
{ "iomega" , "jaz" , NULL, 1, 1, {IOMEGA_JAZ , 0 , 0 , 0 }},
|
||||||
{ "IOMEGA" , "ZIP" , NULL, 1, 1, IOMEGA_ZIP , 0 , 0 , 0 },
|
{ "IOMEGA" , "ZIP" , NULL, 1, 1, {IOMEGA_ZIP , 0 , 0 , 0 }},
|
||||||
{ "PINNACLE", "Apex 4.6GB" , NULL, 3, 2, PINNACLE_APEX_5_RW, MO_5_RW, MO_5_WO, 0 },
|
{ "PINNACLE", "Apex 4.6GB" , NULL, 3, 2, {PINNACLE_APEX_5_RW, MO_5_RW, MO_5_WO, 0 }},
|
||||||
{ "SONY" , "SMO-F541" , NULL, 2, 2, MO_5_WO , MO_5_RW, 0 , 0 },
|
{ "SONY" , "SMO-F541" , NULL, 2, 2, {MO_5_WO , MO_5_RW, 0 , 0 }},
|
||||||
{ "SONY" , "SMO-F551" , NULL, 2, 2, MO_5_WO , MO_5_RW, 0 , 0 },
|
{ "SONY" , "SMO-F551" , NULL, 2, 2, {MO_5_WO , MO_5_RW, 0 , 0 }},
|
||||||
{ NULL , NULL , NULL, 0, 0, 0 , 0 , 0 , 0 }
|
{ NULL , NULL , NULL, 0, 0, {0 , 0 , 0 , 0 }}
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifdef ALLOC_DATA_PRAGMA
|
#ifdef ALLOC_DATA_PRAGMA
|
||||||
|
|
|
@ -173,6 +173,7 @@ const GUID GUID_NULL = { 0 };
|
||||||
|
|
||||||
|
|
||||||
NTSTATUS
|
NTSTATUS
|
||||||
|
NTAPI
|
||||||
DriverEntry(
|
DriverEntry(
|
||||||
IN PDRIVER_OBJECT DriverObject,
|
IN PDRIVER_OBJECT DriverObject,
|
||||||
IN PUNICODE_STRING RegistryPath
|
IN PUNICODE_STRING RegistryPath
|
||||||
|
@ -1304,7 +1305,7 @@ Return Value:
|
||||||
//
|
//
|
||||||
|
|
||||||
buffer = (PUCHAR)srbControl;
|
buffer = (PUCHAR)srbControl;
|
||||||
(ULONG_PTR)buffer += srbControl->HeaderLength;
|
buffer += srbControl->HeaderLength;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Ensure correct target is set in the cmd parameters.
|
// Ensure correct target is set in the cmd parameters.
|
||||||
|
@ -1341,7 +1342,7 @@ Return Value:
|
||||||
if (NT_SUCCESS(status)) {
|
if (NT_SUCCESS(status)) {
|
||||||
|
|
||||||
buffer = (PUCHAR)srbControl;
|
buffer = (PUCHAR)srbControl;
|
||||||
(ULONG_PTR)buffer += srbControl->HeaderLength;
|
buffer += srbControl->HeaderLength;
|
||||||
|
|
||||||
RtlMoveMemory (Irp->AssociatedIrp.SystemBuffer, buffer,
|
RtlMoveMemory (Irp->AssociatedIrp.SystemBuffer, buffer,
|
||||||
sizeof(GETVERSIONINPARAMS));
|
sizeof(GETVERSIONINPARAMS));
|
||||||
|
@ -1444,7 +1445,7 @@ Return Value:
|
||||||
//
|
//
|
||||||
|
|
||||||
buffer = (PUCHAR)srbControl;
|
buffer = (PUCHAR)srbControl;
|
||||||
(ULONG_PTR)buffer += srbControl->HeaderLength;
|
buffer += srbControl->HeaderLength;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Ensure correct target is set in the cmd parameters.
|
// Ensure correct target is set in the cmd parameters.
|
||||||
|
@ -1494,7 +1495,7 @@ Return Value:
|
||||||
//
|
//
|
||||||
|
|
||||||
buffer = (PUCHAR)srbControl;
|
buffer = (PUCHAR)srbControl;
|
||||||
(ULONG_PTR)buffer += srbControl->HeaderLength;
|
buffer += srbControl->HeaderLength;
|
||||||
|
|
||||||
if (NT_SUCCESS(status)) {
|
if (NT_SUCCESS(status)) {
|
||||||
|
|
||||||
|
@ -1640,7 +1641,7 @@ Return Value:
|
||||||
//
|
//
|
||||||
|
|
||||||
buffer = (PUCHAR)srbControl;
|
buffer = (PUCHAR)srbControl;
|
||||||
(ULONG_PTR)buffer += srbControl->HeaderLength;
|
buffer += srbControl->HeaderLength;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Ensure correct target is set in the cmd parameters.
|
// Ensure correct target is set in the cmd parameters.
|
||||||
|
@ -1690,7 +1691,7 @@ Return Value:
|
||||||
//
|
//
|
||||||
|
|
||||||
buffer = (PUCHAR)srbControl;
|
buffer = (PUCHAR)srbControl;
|
||||||
(ULONG_PTR)buffer += srbControl->HeaderLength;
|
buffer += srbControl->HeaderLength;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Update the return buffer size based on the sub-command.
|
// Update the return buffer size based on the sub-command.
|
||||||
|
@ -1828,7 +1829,7 @@ Retry:
|
||||||
//
|
//
|
||||||
|
|
||||||
blockDescriptor = (PMODE_PARAMETER_BLOCK)modeData;
|
blockDescriptor = (PMODE_PARAMETER_BLOCK)modeData;
|
||||||
(ULONG_PTR)blockDescriptor += sizeof(MODE_PARAMETER_HEADER);
|
blockDescriptor = (PMODE_PARAMETER_BLOCK)((ULONG_PTR)blockDescriptor + sizeof(MODE_PARAMETER_HEADER));
|
||||||
|
|
||||||
//
|
//
|
||||||
// Do some validation.
|
// Do some validation.
|
||||||
|
@ -2165,7 +2166,7 @@ Retry:
|
||||||
IoMarkIrpPending(Irp);
|
IoMarkIrpPending(Irp);
|
||||||
|
|
||||||
IoQueueWorkItem(Context->WorkItem,
|
IoQueueWorkItem(Context->WorkItem,
|
||||||
DiskIoctlVerify,
|
(PIO_WORKITEM_ROUTINE)DiskIoctlVerify,
|
||||||
DelayedWorkQueue,
|
DelayedWorkQueue,
|
||||||
Context);
|
Context);
|
||||||
|
|
||||||
|
@ -3521,7 +3522,7 @@ Return Value:
|
||||||
|
|
||||||
((PMODE_PARAMETER_HEADER)buffer)->BlockDescriptorLength = sizeof(MODE_PARAMETER_BLOCK);
|
((PMODE_PARAMETER_HEADER)buffer)->BlockDescriptorLength = sizeof(MODE_PARAMETER_BLOCK);
|
||||||
|
|
||||||
(PULONG)blockDescriptor = (buffer + 1);
|
blockDescriptor = (PMODE_PARAMETER_BLOCK)(buffer + 1);
|
||||||
|
|
||||||
//
|
//
|
||||||
// Set size
|
// Set size
|
||||||
|
@ -3888,7 +3889,7 @@ Return Value:
|
||||||
if (workItem) {
|
if (workItem) {
|
||||||
|
|
||||||
IoQueueWorkItem(workItem,
|
IoQueueWorkItem(workItem,
|
||||||
DisableWriteCache,
|
(PIO_WORKITEM_ROUTINE)DisableWriteCache,
|
||||||
CriticalWorkQueue,
|
CriticalWorkQueue,
|
||||||
workItem);
|
workItem);
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,6 +19,9 @@ Notes:
|
||||||
Revision History:
|
Revision History:
|
||||||
|
|
||||||
--*/
|
--*/
|
||||||
|
#undef _WIN32_WINNT
|
||||||
|
#define _WIN32_WINNT 0x0501
|
||||||
|
#define NTDDI_VERSION NTDDI_WINXP
|
||||||
|
|
||||||
#include "ntddk.h"
|
#include "ntddk.h"
|
||||||
#include "scsi.h"
|
#include "scsi.h"
|
||||||
|
|
|
@ -546,7 +546,7 @@ Return Value:
|
||||||
//
|
//
|
||||||
|
|
||||||
buffer = (PUCHAR)SrbControl;
|
buffer = (PUCHAR)SrbControl;
|
||||||
(ULONG_PTR)buffer += sizeof(SRB_IO_CONTROL);
|
buffer += sizeof(SRB_IO_CONTROL);
|
||||||
|
|
||||||
cmdInParameters = (PSENDCMDINPARAMS)buffer;
|
cmdInParameters = (PSENDCMDINPARAMS)buffer;
|
||||||
cmdOutParameters = (PSENDCMDOUTPARAMS)buffer;
|
cmdOutParameters = (PSENDCMDOUTPARAMS)buffer;
|
||||||
|
@ -641,11 +641,16 @@ Return Value:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
default:
|
||||||
|
controlCode = 0;
|
||||||
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
} else if (Command == ID_CMD) {
|
} else if (Command == ID_CMD) {
|
||||||
controlCode = IOCTL_SCSI_MINIPORT_IDENTIFY;
|
controlCode = IOCTL_SCSI_MINIPORT_IDENTIFY;
|
||||||
lengthNeeded = IDENTIFY_BUFFER_SIZE + sizeof(SENDCMDOUTPARAMS) -1;
|
lengthNeeded = IDENTIFY_BUFFER_SIZE + sizeof(SENDCMDOUTPARAMS) -1;
|
||||||
} else {
|
} else {
|
||||||
|
controlCode = 0;
|
||||||
ASSERT(FALSE);
|
ASSERT(FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1393,8 +1398,10 @@ NTSTATUS DiskInfoExceptionComplete(
|
||||||
retry = TRUE;
|
retry = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (retry && ((ULONG)(ULONG_PTR)irpStack->Parameters.Others.Argument4)--)
|
if (retry && irpStack->Parameters.Others.Argument4)
|
||||||
{
|
{
|
||||||
|
irpStack->Parameters.Others.Argument4 =
|
||||||
|
(PVOID)((ULONG_PTR)irpStack->Parameters.Others.Argument4 - 1);
|
||||||
|
|
||||||
//
|
//
|
||||||
// Retry request.
|
// Retry request.
|
||||||
|
@ -2798,6 +2805,7 @@ Return Value:
|
||||||
//
|
//
|
||||||
case ReadLogSectors:
|
case ReadLogSectors:
|
||||||
{
|
{
|
||||||
|
sizeNeeded = 0;
|
||||||
if (diskData->FailurePredictionCapability ==
|
if (diskData->FailurePredictionCapability ==
|
||||||
FailurePredictionSmart)
|
FailurePredictionSmart)
|
||||||
{
|
{
|
||||||
|
@ -2853,6 +2861,7 @@ Return Value:
|
||||||
// );
|
// );
|
||||||
case WriteLogSectors:
|
case WriteLogSectors:
|
||||||
{
|
{
|
||||||
|
sizeNeeded = 0;
|
||||||
if (diskData->FailurePredictionCapability ==
|
if (diskData->FailurePredictionCapability ==
|
||||||
FailurePredictionSmart)
|
FailurePredictionSmart)
|
||||||
{
|
{
|
||||||
|
@ -2911,6 +2920,7 @@ Return Value:
|
||||||
// uint32 ReturnCode);
|
// uint32 ReturnCode);
|
||||||
case ExecuteSelfTest:
|
case ExecuteSelfTest:
|
||||||
{
|
{
|
||||||
|
sizeNeeded = 0;
|
||||||
if (diskData->FailurePredictionCapability ==
|
if (diskData->FailurePredictionCapability ==
|
||||||
FailurePredictionSmart)
|
FailurePredictionSmart)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1002,7 +1002,7 @@ Return Value:
|
||||||
KeInitializeEvent(&event, SynchronizationEvent, FALSE);
|
KeInitializeEvent(&event, SynchronizationEvent, FALSE);
|
||||||
|
|
||||||
IoSetCompletionRoutine(irp,
|
IoSetCompletionRoutine(irp,
|
||||||
ClassSignalCompletion,
|
(PIO_COMPLETION_ROUTINE)ClassSignalCompletion,
|
||||||
&event,
|
&event,
|
||||||
TRUE,
|
TRUE,
|
||||||
TRUE,
|
TRUE,
|
||||||
|
@ -1348,7 +1348,7 @@ Return Value:
|
||||||
{
|
{
|
||||||
ULONG i;
|
ULONG i;
|
||||||
BOOLEAN found;
|
BOOLEAN found;
|
||||||
PDISK_DETECT_INFO diskInfo;
|
PDISK_DETECT_INFO diskInfo = NULL;
|
||||||
PDISK_DATA diskData = FdoExtension->CommonExtension.DriverData;
|
PDISK_DATA diskData = FdoExtension->CommonExtension.DriverData;
|
||||||
|
|
||||||
PAGED_CODE ();
|
PAGED_CODE ();
|
||||||
|
|
|
@ -424,7 +424,7 @@ Return Value:
|
||||||
HalExamineMBR(fdoExtension->CommonExtension.DeviceObject,
|
HalExamineMBR(fdoExtension->CommonExtension.DeviceObject,
|
||||||
fdoExtension->DiskGeometry.BytesPerSector,
|
fdoExtension->DiskGeometry.BytesPerSector,
|
||||||
(ULONG)0x54,
|
(ULONG)0x54,
|
||||||
&dmSkew);
|
(PVOID*)&dmSkew);
|
||||||
|
|
||||||
if (dmSkew) {
|
if (dmSkew) {
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue