Sync to trunk head(r38096)
[reactos.git] / reactos / drivers / storage / scsiport / scsiport.c
index fa3d1fb..7485c13 100644 (file)
@@ -552,7 +552,7 @@ ScsiPortGetDeviceBase(IN PVOID HwDeviceExtension,
 
     /* i/o space */
     if (AddressSpace != 0)
-        return((PVOID)TranslatedAddress.u.LowPart);
+        return((PVOID)(ULONG_PTR)TranslatedAddress.QuadPart);
 
     MappedAddress = MmMapIoSpace(TranslatedAddress,
                                  NumberOfBytes,
@@ -1223,8 +1223,8 @@ CreatePortConfig:
             PortConfig->AccessRanges = (PVOID)(PortConfig+1);
 
             /* Align to LONGLONG */
-            PortConfig->AccessRanges = (PVOID)((ULONG)(PortConfig->AccessRanges) + 7);
-            PortConfig->AccessRanges = (PVOID)((ULONG)(PortConfig->AccessRanges) & ~7);
+            PortConfig->AccessRanges = (PVOID)((ULONG_PTR)(PortConfig->AccessRanges) + 7);
+            PortConfig->AccessRanges = (PVOID)((ULONG_PTR)(PortConfig->AccessRanges) & ~7);
 
             /* Copy the data */
             RtlCopyMemory(PortConfig->AccessRanges,
@@ -1957,6 +1957,9 @@ ScsiPortNotification(IN SCSI_NOTIFICATION_TYPE NotificationType,
                                               TargetId,
                                               Lun);
 
+            /* If returned LunExtension is NULL, break out */
+            if (!LunExtension) break;
+
             /* This request should not be processed if */
             if ((LunExtension->ReadyLun) ||
                 (LunExtension->SrbInfo.Srb))