[KERNEL32][BEEP]
authorHermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
Sat, 8 Nov 2014 16:35:05 +0000 (16:35 +0000)
committerHermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
Sat, 8 Nov 2014 16:35:05 +0000 (16:35 +0000)
Int32x32To64 used with unsigned input values will cause unintentional sign extension. There is a lot of code in ROS that is still not fixed!!
Fixes BEEP sound. See also r64020, CORE-8502 and CORE-8505 for more details.
CORE-8505 #comment CsrCaptureTimeout and BEEP code fixed.

svn path=/trunk/; revision=65325

reactos/dll/ntdll/csr/capture.c
reactos/drivers/base/beep/beep.c

index ad26625..1f1e695 100644 (file)
@@ -321,7 +321,7 @@ CsrCaptureTimeout(IN ULONG Milliseconds,
     if (Milliseconds == -1) return NULL;
 
     /* Convert to relative ticks */
-    Timeout->QuadPart = Int32x32To64(Milliseconds, -10000);
+    Timeout->QuadPart = Milliseconds * -10000LL;
     return Timeout;
 }
 
index 9ba8670..7eb64c2 100644 (file)
@@ -339,7 +339,7 @@ BeepStartIo(IN PDEVICE_OBJECT DeviceObject,
         {
             /* Beep successful, queue a DPC to stop it */
             Status = STATUS_SUCCESS;
-            DueTime.QuadPart = Int32x32To64(BeepParam->Duration, -10000);
+            DueTime.QuadPart = BeepParam->Duration * -10000LL;
             InterlockedIncrement(&DeviceExtension->TimerActive);
             KeSetTimer(&DeviceExtension->Timer, DueTime, &DeviceObject->Dpc);
         }