[SCSIPORT]
authorTimo Kreuzer <timo.kreuzer@reactos.org>
Tue, 21 Dec 2010 23:48:15 +0000 (23:48 +0000)
committerTimo Kreuzer <timo.kreuzer@reactos.org>
Tue, 21 Dec 2010 23:48:15 +0000 (23:48 +0000)
ScsiPortConvertPhysicalAddressToUlong takes an ULONG_PTR as input, fix function accordingly and do the "calculation" directly instead of calling RtlConvertUlongToLargeInteger
Spotted by Samuel.

svn path=/trunk/; revision=50089

reactos/boot/freeldr/freeldr/disk/scsiport.c
reactos/drivers/storage/ide/uniata/srb.h
reactos/drivers/storage/scsiport/stubs.c
reactos/include/ddk/srb.h

index ce306a3..254760f 100644 (file)
@@ -445,9 +445,12 @@ ScsiPortConvertPhysicalAddressToUlong(
 SCSI_PHYSICAL_ADDRESS
 NTAPI
 ScsiPortConvertUlongToPhysicalAddress(
-    IN ULONG UlongAddress)
+    IN ULONG_PTR UlongAddress)
 {
-    return RtlConvertUlongToLargeInteger(UlongAddress);
+    SCSI_PHYSICAL_ADDRESS Address;
+
+    Address.QuadPart = UlongAddress;
+    return Address;
 }
 
 VOID
@@ -1540,7 +1543,7 @@ LoadBootDeviceDriver(VOID)
     {
         CHAR* Name;
         PVOID Function;
-    } ExportTable[] = 
+    } ExportTable[] =
     {
         { "ScsiDebugPrint", ScsiDebugPrint },
         { "ScsiPortCompleteRequest", ScsiPortCompleteRequest },
@@ -1618,7 +1621,7 @@ LoadBootDeviceDriver(VOID)
     ImageDosHeader.e_lfanew = SWAPD((ULONG_PTR)&ImageNtHeaders - (ULONG_PTR)&ImageDosHeader);
     ImageNtHeaders.Signature = IMAGE_NT_SIGNATURE;
     ImageNtHeaders.OptionalHeader.NumberOfRvaAndSizes = SWAPD(IMAGE_DIRECTORY_ENTRY_EXPORT + 1);
-    ImageNtHeaders.OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_EXPORT].VirtualAddress = 
+    ImageNtHeaders.OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_EXPORT].VirtualAddress =
         SWAPW((ULONG_PTR)&ImageExportDirectory - (ULONG_PTR)&ImageDosHeader);
     ImageNtHeaders.OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_EXPORT].Size = 1;
     ImageExportDirectory.NumberOfNames = sizeof(ExportTable) / sizeof(ExportTable[0]);
index b3795b2..0932284 100644 (file)
@@ -935,7 +935,7 @@ ScsiPortWriteRegisterBufferUlong(
 SCSIPORT_API
 SCSI_PHYSICAL_ADDRESS NTAPI
 ScsiPortConvertUlongToPhysicalAddress(
-    ULONG UlongAddress
+    ULONG_PTR UlongAddress
     );
 
 SCSIPORT_API
index b4bc2f5..28070bc 100644 (file)
 SCSI_PHYSICAL_ADDRESS
 NTAPI
 ScsiPortConvertUlongToPhysicalAddress(
-    IN ULONG  UlongAddress)
+    IN ULONG_PTR UlongAddress)
 {
-    return RtlConvertUlongToLargeInteger(UlongAddress);
+    SCSI_PHYSICAL_ADDRESS Address;
+
+    Address.QuadPart = UlongAddress;
+    return Address;
 }
 
 VOID
index cca653d..cddc829 100644 (file)
@@ -550,7 +550,7 @@ SCSIPORTAPI
 SCSI_PHYSICAL_ADDRESS
 NTAPI
 ScsiPortConvertUlongToPhysicalAddress(
-  IN ULONG UlongAddress);
+  IN ULONG_PTR UlongAddress);
 
 SCSIPORTAPI
 VOID