[REACTOS] Fix MSVC printf format warnings
[reactos.git] / drivers / storage / class / disk_new / pnp.c
index fe1ef90..ecccc51 100644 (file)
@@ -39,8 +39,8 @@ extern NTSYSAPI ULONG InitSafeBootMode;
 
 #endif
 
-\f
 NTSTATUS
+NTAPI
 DiskAddDevice(
     IN PDRIVER_OBJECT DriverObject,
     IN PDEVICE_OBJECT PhysicalDeviceObject
@@ -185,9 +185,8 @@ Return Value:
 
 } // end DiskAddDevice()
 
-
-\f
 NTSTATUS
+NTAPI
 DiskInitFdo(
     IN PDEVICE_OBJECT Fdo
     )
@@ -214,16 +213,16 @@ Return Value:
 
     PDISK_DATA diskData = (PDISK_DATA) fdoExtension->CommonExtension.DriverData;
 
-    ULONG srbFlags = 0;
+    //ULONG srbFlags = 0;
 
     ULONG timeOut = 0;
 
     ULONG bytesPerSector;
-    UCHAR sectorShift;
+    //UCHAR sectorShift;
 
-    BOOLEAN dmActive = FALSE;
+    //BOOLEAN dmActive = FALSE;
     PULONG dmSkew;
-    ULONG dmByteSkew;
+    //ULONG dmByteSkew;
 
     NTSTATUS status;
 
@@ -279,7 +278,7 @@ Return Value:
 
     DiskScanRegistryForSpecial(fdoExtension);
 
-    srbFlags = fdoExtension->SrbFlags;
+    //srbFlags = fdoExtension->SrbFlags;
 
     //
     // Clear buffer for drive geometry.
@@ -364,7 +363,7 @@ Return Value:
     status = ClassReadDriveCapacity(Fdo);
 
     //
-    // If the read capcity failed then just return, unless this is a
+    // If the read capacity failed then just return, unless this is a
     // removable disk where a device object partition needs to be created.
     //
 
@@ -413,7 +412,7 @@ Return Value:
         bytesPerSector = fdoExtension->DiskGeometry.BytesPerSector = 512;
     }
 
-    sectorShift = fdoExtension->SectorShift;
+    //sectorShift = fdoExtension->SectorShift;
 
     //
     // Determine is DM Driver is loaded on an IDE drive that is
@@ -439,12 +438,12 @@ Return Value:
         fdoExtension->DMByteSkew = fdoExtension->DMSkew * bytesPerSector;
 
         //
-        // Save away the infomation that we need, since this deviceExtension will soon be
+        // Save away the information that we need, since this deviceExtension will soon be
         // blown away.
         //
 
-        dmActive = TRUE;
-        dmByteSkew = fdoExtension->DMByteSkew;
+        //dmActive = TRUE;
+        //dmByteSkew = fdoExtension->DMByteSkew;
 
     }
 
@@ -496,7 +495,7 @@ Return Value:
     DiskCreateSymbolicLinks(Fdo);
 
     //
-    // Determine the type of disk and enable failure preiction in the hardware
+    // Determine the type of disk and enable failure prediction in the hardware
     // and enable failure prediction polling.
     //
 
@@ -557,8 +556,8 @@ Return Value:
 
 } // end DiskInitFdo()
 
-\f
 NTSTATUS
+NTAPI
 DiskInitPdo(
     IN PDEVICE_OBJECT Pdo
     )
@@ -615,8 +614,8 @@ Routine Description:
     return STATUS_SUCCESS;
 }
 
-\f
 NTSTATUS
+NTAPI
 DiskStartPdo(
     IN PDEVICE_OBJECT Pdo
     )
@@ -637,6 +636,7 @@ Routine Description:
 }
 
 NTSTATUS
+NTAPI
 DiskStopDevice(
     IN PDEVICE_OBJECT DeviceObject,
     IN UCHAR Type
@@ -654,8 +654,8 @@ DiskStopDevice(
     return STATUS_SUCCESS;
 }
 
-\f
 NTSTATUS
+NTAPI
 DiskQueryId(
     IN PDEVICE_OBJECT Pdo,
     IN BUS_QUERY_ID_TYPE IdType,
@@ -695,7 +695,7 @@ Return Value:
 {
     ANSI_STRING ansiIdString;
 
-    NTSTATUS status;
+    //NTSTATUS status;
 
     PAGED_CODE();
     ASSERT_PDO(Pdo);
@@ -715,7 +715,7 @@ Return Value:
 
     if(IdType == BusQueryInstanceID) {
 
-        PPHYSICAL_DEVICE_EXTENSION pdoExtension = Pdo->DeviceExtension;
+        //PPHYSICAL_DEVICE_EXTENSION pdoExtension = Pdo->DeviceExtension;
         PCOMMON_DEVICE_EXTENSION commonExtension = Pdo->DeviceExtension;
         PDISK_DATA diskData = commonExtension->PartitionZeroExtension->CommonExtension.DriverData;
 
@@ -724,13 +724,13 @@ Return Value:
         if((Pdo->Characteristics & FILE_REMOVABLE_MEDIA) == 0) {
 
             if (diskData->PartitionStyle == PARTITION_STYLE_MBR) {
-                sprintf(string, "S%08lx_O%I64lx_L%I64lx",
+                sprintf(string, "S%08lx_O%I64x_L%I64x",
                         diskData->Mbr.Signature,
-                        commonExtension->StartingOffset,
-                        commonExtension->PartitionLength);
+                        commonExtension->StartingOffset.QuadPart,
+                        commonExtension->PartitionLength.QuadPart);
             } else {
                 sprintf(string,
-                        "S%08lx-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02xS_O%I64lx_L%I64lx",
+                        "S%08lx-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02xS_O%I64x_L%I64x",
                         diskData->Efi.DiskId.Data1,
                         diskData->Efi.DiskId.Data2,
                         diskData->Efi.DiskId.Data3,
@@ -742,8 +742,8 @@ Return Value:
                         diskData->Efi.DiskId.Data4[5],
                         diskData->Efi.DiskId.Data4[6],
                         diskData->Efi.DiskId.Data4[7],
-                        commonExtension->StartingOffset,
-                        commonExtension->PartitionLength);
+                        commonExtension->StartingOffset.QuadPart,
+                        commonExtension->PartitionLength.QuadPart);
             }
         } else {
             sprintf(string, "RM");
@@ -778,8 +778,8 @@ Return Value:
     return STATUS_NOT_IMPLEMENTED;
 }
 
-\f
 NTSTATUS
+NTAPI
 DiskGenerateDeviceName(
     IN BOOLEAN IsFdo,
     IN ULONG DeviceNumber,
@@ -859,8 +859,8 @@ Return Value:
     return STATUS_SUCCESS;
 }
 
-\f
 VOID
+NTAPI
 DiskCreateSymbolicLinks(
     IN PDEVICE_OBJECT DeviceObject
     )
@@ -983,8 +983,8 @@ Return Value:
     return;
 }
 
-\f
 VOID
+NTAPI
 DiskDeleteSymbolicLinks(
     IN PDEVICE_OBJECT DeviceObject
     )
@@ -1049,8 +1049,8 @@ Return Value:
     return;
 }
 
-\f
 NTSTATUS
+NTAPI
 DiskRemoveDevice(
     IN PDEVICE_OBJECT DeviceObject,
     IN UCHAR Type
@@ -1132,7 +1132,7 @@ Return Value:
 
     } else {
 
-        PPHYSICAL_DEVICE_EXTENSION pdoExtension = DeviceObject->DeviceExtension;
+        //PPHYSICAL_DEVICE_EXTENSION pdoExtension = DeviceObject->DeviceExtension;
 
     }
 
@@ -1157,8 +1157,8 @@ Return Value:
     return STATUS_SUCCESS;
 }
 
-\f
 NTSTATUS
+NTAPI
 DiskStartFdo(
     IN PDEVICE_OBJECT Fdo
     )
@@ -1314,7 +1314,7 @@ Return Value:
 
     if (NT_SUCCESS(status))
     {
-        if (cacheInfo.WriteCacheEnabled == TRUE)
+        if (cacheInfo.WriteCacheEnabled != FALSE)
         {
             if (writeCacheOverride == DiskWriteCacheDisable)
             {
@@ -1400,4 +1400,3 @@ Return Value:
     return STATUS_SUCCESS;
 
 } // end DiskStartFdo()
-