Author: janderwald
Date: Mon Feb 6 06:50:19 2012
New Revision: 55447
URL:
http://svn.reactos.org/svn/reactos?rev=55447&view=rev
Log:
[DISK_NEW]
- Fix compilation of new disk driver
- Patch by Alex Ionescu
Modified:
branches/usb-bringup-trunk/drivers/storage/class/disk_new/CMakeLists.txt
branches/usb-bringup-trunk/drivers/storage/class/disk_new/data.c
branches/usb-bringup-trunk/drivers/storage/class/disk_new/disk.c
branches/usb-bringup-trunk/drivers/storage/class/disk_new/disk.h
branches/usb-bringup-trunk/drivers/storage/class/disk_new/diskwmi.c
branches/usb-bringup-trunk/drivers/storage/class/disk_new/geometry.c
branches/usb-bringup-trunk/drivers/storage/class/disk_new/pnp.c
Modified: branches/usb-bringup-trunk/drivers/storage/class/disk_new/CMakeLists.txt
URL:
http://svn.reactos.org/svn/reactos/branches/usb-bringup-trunk/drivers/stora…
==============================================================================
--- branches/usb-bringup-trunk/drivers/storage/class/disk_new/CMakeLists.txt [iso-8859-1]
(original)
+++ branches/usb-bringup-trunk/drivers/storage/class/disk_new/CMakeLists.txt [iso-8859-1]
Mon Feb 6 06:50:19 2012
@@ -1,13 +1,14 @@
-remove_definitions(-D_WIN32_WINNT=0x502)
-add_definitions(-D_WIN32_WINNT=0x600)
-
include_directories(..)
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)
add_importlibs(disk
- class2
+ classpnp
scsiport
ntoskrnl
hal)
Modified: branches/usb-bringup-trunk/drivers/storage/class/disk_new/data.c
URL:
http://svn.reactos.org/svn/reactos/branches/usb-bringup-trunk/drivers/stora…
==============================================================================
--- branches/usb-bringup-trunk/drivers/storage/class/disk_new/data.c [iso-8859-1]
(original)
+++ branches/usb-bringup-trunk/drivers/storage/class/disk_new/data.c [iso-8859-1] Mon Feb
6 06:50:19 2012
@@ -60,15 +60,20 @@
{ NULL , NULL , NULL, 0x0 }
};
+//
+// ======== ROS DIFF ========
+// Added MediaTypes in their own brace nesting level
+// ======== ROS DIFF ========
+//
DISK_MEDIA_TYPES_LIST const DiskMediaTypes[] = {
- { "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 },
- { "iomega" , "jaz" , NULL, 1, 1, IOMEGA_JAZ , 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 },
- { "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 },
- { NULL , NULL , NULL, 0, 0, 0 , 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 }},
+ { "iomega" , "jaz" , NULL, 1, 1, {IOMEGA_JAZ ,
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 }},
+ { "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 }},
+ { NULL , NULL , NULL, 0, 0, {0 , 0 , 0 , 0
}}
};
#ifdef ALLOC_DATA_PRAGMA
Modified: branches/usb-bringup-trunk/drivers/storage/class/disk_new/disk.c
URL:
http://svn.reactos.org/svn/reactos/branches/usb-bringup-trunk/drivers/stora…
==============================================================================
--- branches/usb-bringup-trunk/drivers/storage/class/disk_new/disk.c [iso-8859-1]
(original)
+++ branches/usb-bringup-trunk/drivers/storage/class/disk_new/disk.c [iso-8859-1] Mon Feb
6 06:50:19 2012
@@ -173,6 +173,7 @@
NTSTATUS
+NTAPI
DriverEntry(
IN PDRIVER_OBJECT DriverObject,
IN PUNICODE_STRING RegistryPath
@@ -1304,7 +1305,7 @@
//
buffer = (PUCHAR)srbControl;
- (ULONG_PTR)buffer += srbControl->HeaderLength;
+ buffer += srbControl->HeaderLength;
//
// Ensure correct target is set in the cmd parameters.
@@ -1341,7 +1342,7 @@
if (NT_SUCCESS(status)) {
buffer = (PUCHAR)srbControl;
- (ULONG_PTR)buffer += srbControl->HeaderLength;
+ buffer += srbControl->HeaderLength;
RtlMoveMemory (Irp->AssociatedIrp.SystemBuffer, buffer,
sizeof(GETVERSIONINPARAMS));
@@ -1444,7 +1445,7 @@
//
buffer = (PUCHAR)srbControl;
- (ULONG_PTR)buffer += srbControl->HeaderLength;
+ buffer += srbControl->HeaderLength;
//
// Ensure correct target is set in the cmd parameters.
@@ -1494,7 +1495,7 @@
//
buffer = (PUCHAR)srbControl;
- (ULONG_PTR)buffer += srbControl->HeaderLength;
+ buffer += srbControl->HeaderLength;
if (NT_SUCCESS(status)) {
@@ -1640,7 +1641,7 @@
//
buffer = (PUCHAR)srbControl;
- (ULONG_PTR)buffer += srbControl->HeaderLength;
+ buffer += srbControl->HeaderLength;
//
// Ensure correct target is set in the cmd parameters.
@@ -1690,7 +1691,7 @@
//
buffer = (PUCHAR)srbControl;
- (ULONG_PTR)buffer += srbControl->HeaderLength;
+ buffer += srbControl->HeaderLength;
//
// Update the return buffer size based on the sub-command.
@@ -1828,7 +1829,7 @@
//
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.
@@ -2165,7 +2166,7 @@
IoMarkIrpPending(Irp);
IoQueueWorkItem(Context->WorkItem,
- DiskIoctlVerify,
+ (PIO_WORKITEM_ROUTINE)DiskIoctlVerify,
DelayedWorkQueue,
Context);
@@ -3521,7 +3522,7 @@
((PMODE_PARAMETER_HEADER)buffer)->BlockDescriptorLength =
sizeof(MODE_PARAMETER_BLOCK);
- (PULONG)blockDescriptor = (buffer + 1);
+ blockDescriptor = (PMODE_PARAMETER_BLOCK)(buffer + 1);
//
// Set size
@@ -3888,7 +3889,7 @@
if (workItem) {
IoQueueWorkItem(workItem,
- DisableWriteCache,
+ (PIO_WORKITEM_ROUTINE)DisableWriteCache,
CriticalWorkQueue,
workItem);
}
Modified: branches/usb-bringup-trunk/drivers/storage/class/disk_new/disk.h
URL:
http://svn.reactos.org/svn/reactos/branches/usb-bringup-trunk/drivers/stora…
==============================================================================
--- branches/usb-bringup-trunk/drivers/storage/class/disk_new/disk.h [iso-8859-1]
(original)
+++ branches/usb-bringup-trunk/drivers/storage/class/disk_new/disk.h [iso-8859-1] Mon Feb
6 06:50:19 2012
@@ -19,6 +19,9 @@
Revision History:
--*/
+#undef _WIN32_WINNT
+#define _WIN32_WINNT 0x0501
+#define NTDDI_VERSION NTDDI_WINXP
#include "ntddk.h"
#include "scsi.h"
Modified: branches/usb-bringup-trunk/drivers/storage/class/disk_new/diskwmi.c
URL:
http://svn.reactos.org/svn/reactos/branches/usb-bringup-trunk/drivers/stora…
==============================================================================
--- branches/usb-bringup-trunk/drivers/storage/class/disk_new/diskwmi.c [iso-8859-1]
(original)
+++ branches/usb-bringup-trunk/drivers/storage/class/disk_new/diskwmi.c [iso-8859-1] Mon
Feb 6 06:50:19 2012
@@ -546,7 +546,7 @@
//
buffer = (PUCHAR)SrbControl;
- (ULONG_PTR)buffer += sizeof(SRB_IO_CONTROL);
+ buffer += sizeof(SRB_IO_CONTROL);
cmdInParameters = (PSENDCMDINPARAMS)buffer;
cmdOutParameters = (PSENDCMDOUTPARAMS)buffer;
@@ -641,11 +641,16 @@
break;
}
+ default:
+ controlCode = 0;
+ break;
+
}
} else if (Command == ID_CMD) {
controlCode = IOCTL_SCSI_MINIPORT_IDENTIFY;
lengthNeeded = IDENTIFY_BUFFER_SIZE + sizeof(SENDCMDOUTPARAMS) -1;
} else {
+ controlCode = 0;
ASSERT(FALSE);
}
@@ -1393,8 +1398,10 @@
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.
@@ -2798,6 +2805,7 @@
//
case ReadLogSectors:
{
+ sizeNeeded = 0;
if (diskData->FailurePredictionCapability ==
FailurePredictionSmart)
{
@@ -2853,6 +2861,7 @@
// );
case WriteLogSectors:
{
+ sizeNeeded = 0;
if (diskData->FailurePredictionCapability ==
FailurePredictionSmart)
{
@@ -2911,6 +2920,7 @@
// uint32 ReturnCode);
case ExecuteSelfTest:
{
+ sizeNeeded = 0;
if (diskData->FailurePredictionCapability ==
FailurePredictionSmart)
{
Modified: branches/usb-bringup-trunk/drivers/storage/class/disk_new/geometry.c
URL:
http://svn.reactos.org/svn/reactos/branches/usb-bringup-trunk/drivers/stora…
==============================================================================
--- branches/usb-bringup-trunk/drivers/storage/class/disk_new/geometry.c [iso-8859-1]
(original)
+++ branches/usb-bringup-trunk/drivers/storage/class/disk_new/geometry.c [iso-8859-1] Mon
Feb 6 06:50:19 2012
@@ -1002,7 +1002,7 @@
KeInitializeEvent(&event, SynchronizationEvent, FALSE);
IoSetCompletionRoutine(irp,
- ClassSignalCompletion,
+ (PIO_COMPLETION_ROUTINE)ClassSignalCompletion,
&event,
TRUE,
TRUE,
@@ -1348,7 +1348,7 @@
{
ULONG i;
BOOLEAN found;
- PDISK_DETECT_INFO diskInfo;
+ PDISK_DETECT_INFO diskInfo = NULL;
PDISK_DATA diskData = FdoExtension->CommonExtension.DriverData;
PAGED_CODE ();
Modified: branches/usb-bringup-trunk/drivers/storage/class/disk_new/pnp.c
URL:
http://svn.reactos.org/svn/reactos/branches/usb-bringup-trunk/drivers/stora…
==============================================================================
--- branches/usb-bringup-trunk/drivers/storage/class/disk_new/pnp.c [iso-8859-1]
(original)
+++ branches/usb-bringup-trunk/drivers/storage/class/disk_new/pnp.c [iso-8859-1] Mon Feb
6 06:50:19 2012
@@ -424,7 +424,7 @@
HalExamineMBR(fdoExtension->CommonExtension.DeviceObject,
fdoExtension->DiskGeometry.BytesPerSector,
(ULONG)0x54,
- &dmSkew);
+ (PVOID*)&dmSkew);
if (dmSkew) {