[FLOPPY_NEW] WindowsSync to 8fb512a (#2238)
authorSerge Gautherie <32623169+SergeGautherie@users.noreply.github.com>
Tue, 14 Jan 2020 17:50:19 +0000 (18:50 +0100)
committerHermès BÉLUSCA - MAÏTO <hermes.belusca-maito@reactos.org>
Tue, 14 Jan 2020 17:50:19 +0000 (18:50 +0100)
* [FLOPPY_NEW] Make 6 '#ifdef' explicit about '__REACTOS__'

* [FLOPPY_NEW] RtlStringCbPrintf?() need bytes, not chars

Import
https://github.com/microsoft/Windows-driver-samples/commit/8fb512ac674df5ba129a69906d450f2a1361136d

drivers/storage/floppy_new/floppy.c
media/doc/README.FSD

index 01db49e..90f0615 100644 (file)
@@ -28,7 +28,7 @@ Revision History:
 
 --*/
 
-#ifdef _MSC_VER
+#if !defined(__REACTOS__) || defined(_MSC_VER)
 #pragma warning(disable:4214) // nonstandard extension used : bit field types other than int
 #pragma warning(disable:4201) // nonstandard extension used : nameless struct/union
 #endif
@@ -585,7 +585,7 @@ ScsiFlopUnload(
 // using #pragma.
 //
 
-#ifdef _MSC_VER
+#if !defined(__REACTOS__) || defined(_MSC_VER)
 #pragma warning(push)
 #pragma warning(disable:28152)
 #endif
@@ -699,7 +699,7 @@ Return Value:
         DeviceCount++;
 
         status = RtlStringCbPrintfA((PCCHAR) name,
-                                    sizeof(name)/sizeof(UCHAR),
+                                    sizeof(name),
                                     "\\Device\\Floppy%u",
                                     DeviceCount);
         if (NT_SUCCESS(status)) {
@@ -809,7 +809,7 @@ CreateFlopDeviceObjectExit:
     return status;
 
 } // end CreateFlopDeviceObject()
-#ifdef _MSC_VER
+#if !defined(__REACTOS__) || defined(_MSC_VER)
 #pragma warning(pop)
 #endif
 
@@ -934,7 +934,7 @@ ScsiFlopInitDevice(
     return (STATUS_SUCCESS);
 }
 
-#ifdef _MSC_VER
+#if !defined(__REACTOS__) || defined(_MSC_VER)
 #pragma warning(suppress:6262) // This function uses 1096 bytes of stack which exceed default value of 1024 bytes used by Code Analysis for flagging as warning
 #endif
 #ifdef __REACTOS__
@@ -974,7 +974,7 @@ NTSTATUS ScsiFlopStartDevice(
     //
 
     RtlStringCbPrintfW(ntNameBuffer,
-                       sizeof(ntNameBuffer)/sizeof(WCHAR),
+                       sizeof(ntNameBuffer),
                        L"\\Device\\Floppy%u",
                        fdoExtension->DeviceNumber);
 
@@ -1020,7 +1020,7 @@ NTSTATUS ScsiFlopStartDevice(
     if (NT_SUCCESS(status)) {
 
         RtlStringCbPrintfW(arcNameBuffer,
-                           sizeof(arcNameBuffer)/sizeof(WCHAR),
+                           sizeof(arcNameBuffer),
                            L"\\ArcName\\scsi(%u)disk(%u)fdisk(%u)",
                            scsiAddress.PortNumber,
                            scsiAddress.TargetId,
@@ -1042,7 +1042,7 @@ NTSTATUS ScsiFlopStartDevice(
     //
 
     RtlStringCbPrintfW(arcNameBuffer,
-                       sizeof(arcNameBuffer)/sizeof(WCHAR),
+                       sizeof(arcNameBuffer),
                        L"\\ArcName\\multi(%u)disk(%u)fdisk(%u)",
                        0,
                        0,
@@ -2146,7 +2146,7 @@ Return Value:
 
 
      // driveMediaType is bounded below by DriveMediaLimits[].LowestDriveMediaType
-#ifdef _MSC_VER
+#if !defined(__REACTOS__) || defined(_MSC_VER)
 #pragma warning(push)
 #pragma warning(disable:33010) // 33010: Enum used as array index may be negative
 #endif
@@ -2176,7 +2176,7 @@ Return Value:
             return TRUE;
         }
     }
-#ifdef _MSC_VER
+#if !defined(__REACTOS__) || defined(_MSC_VER)
 #pragma warning(pop)
 #endif
 }
index 859b183..28ff44c 100644 (file)
@@ -20,7 +20,7 @@ The following FSD are shared with: https://github.com/Microsoft/Windows-driver-s
 
 reactos/drivers/filesystems/fastfat_new     # Synced to 2817004
 reactos/drivers/filesystems/cdfs            # Synced to f73e552
-reactos/drivers/storage/floppy_new         # Synced to 9d23d43
+reactos/drivers/storage/floppy_new          # Synced to 8fb512a
 
 The following FS libs are shared with: https://github.com/dosfstools/dosfstools
 reactos/sdk/lib/fslib/vfatlib/check         # Synced to 4.1