[KERNEL32]
authorThomas Faber <thomas.faber@reactos.org>
Mon, 1 Sep 2014 11:58:42 +0000 (11:58 +0000)
committerThomas Faber <thomas.faber@reactos.org>
Mon, 1 Sep 2014 11:58:42 +0000 (11:58 +0000)
- Use signed multiplication for signed numbers
CORE-8502 #resolve

svn path=/trunk/; revision=64020

reactos/dll/win32/kernel32/client/file/mailslot.c
reactos/dll/win32/kernel32/client/file/npipe.c
reactos/dll/win32/kernel32/client/utils.c
reactos/dll/win32/kernel32/client/vista.c

index a6b22d6..a5c056b 100644 (file)
@@ -78,7 +78,7 @@ CreateMailslotW(IN LPCWSTR lpName,
     else
     {
         /* Convert to NT format */
-        DefaultTimeOut.QuadPart = UInt32x32To64(-10000, lReadTimeout);
+        DefaultTimeOut.QuadPart = lReadTimeout * -10000LL;
     }
 
     Status = NtCreateMailslotFile(&MailslotHandle,
@@ -185,7 +185,7 @@ SetMailslotInfo(IN HANDLE hMailslot,
     else
     {
         /* Convert to NT format */
-        Timeout.QuadPart = UInt32x32To64(-10000, lReadTimeout);
+        Timeout.QuadPart = lReadTimeout * -10000LL;
     }
 
     Buffer.ReadTimeout = &Timeout;
index 82ac4b5..6698acd 100644 (file)
@@ -287,7 +287,7 @@ CreateNamedPipeW(LPCWSTR lpName,
     if (nDefaultTimeOut)
     {
         /* Convert the time to NT format */
-        DefaultTimeOut.QuadPart = UInt32x32To64(nDefaultTimeOut, -10000);
+        DefaultTimeOut.QuadPart = nDefaultTimeOut * -10000LL;
     }
     else
     {
@@ -517,7 +517,7 @@ WaitNamedPipeW(LPCWSTR lpNamedPipeName,
         else
         {
             /* Convert to NT format */
-            WaitPipeInfo->Timeout.QuadPart = UInt32x32To64(-10000, nTimeOut);
+            WaitPipeInfo->Timeout.QuadPart = nTimeOut * -10000LL;
         }
 
         /* In both cases, we do have a timeout */
@@ -699,8 +699,7 @@ SetNamedPipeHandleState(HANDLE hNamedPipe,
         if (lpCollectDataTimeout)
         {
             /* Convert it to Quad */
-            RemoteSettings.CollectDataTime.QuadPart =
-                -(LONGLONG)UInt32x32To64(10000, *lpCollectDataTimeout);
+            RemoteSettings.CollectDataTime.QuadPart = *lpCollectDataTimeout * -10000LL;
         }
 
         /* Tell the driver to change them */
index fa476de..3113455 100644 (file)
@@ -292,7 +292,7 @@ BaseFormatTimeOut(OUT PLARGE_INTEGER Timeout,
     if (dwMilliseconds == INFINITE) return NULL;
 
     /* Otherwise, convert the time to NT Format */
-    Timeout->QuadPart = UInt32x32To64(dwMilliseconds, -10000);
+    Timeout->QuadPart = dwMilliseconds * -10000LL;
     return Timeout;
 }
 
index a5a1435..02927ab 100644 (file)
@@ -45,7 +45,7 @@ SleepConditionVariableCS(IN OUT PCONDITION_VARIABLE ConditionVariable,
 
     if (dwMilliseconds != INFINITE)
     {
-        TimeOut.QuadPart = UInt32x32To64(-10000, dwMilliseconds);
+        TimeOut.QuadPart = dwMilliseconds * -10000LL;
         TimeOutPtr = &TimeOut;
     }
 
@@ -80,7 +80,7 @@ SleepConditionVariableSRW(IN OUT PCONDITION_VARIABLE ConditionVariable,
 
     if (dwMilliseconds != INFINITE)
     {
-        TimeOut.QuadPart = UInt32x32To64(-10000, dwMilliseconds);
+        TimeOut.QuadPart = dwMilliseconds * -10000LL;
         TimeOutPtr = &TimeOut;
     }