[ros-diffs] [tkreuzer] 41047: Get rid of deprectaed LargeInteger functions and use native int64 math instead.

tkreuzer at svn.reactos.org tkreuzer at svn.reactos.org
Sat May 23 01:52:53 CEST 2009


Author: tkreuzer
Date: Sat May 23 03:52:52 2009
New Revision: 41047

URL: http://svn.reactos.org/svn/reactos?rev=41047&view=rev
Log:
Get rid of deprectaed LargeInteger functions and use native int64 math instead.

Modified:
    branches/ros-amd64-bringup/reactos/dll/win32/shell32/drive.c

Modified: branches/ros-amd64-bringup/reactos/dll/win32/shell32/drive.c
URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/dll/win32/shell32/drive.c?rev=41047&r1=41046&r2=41047&view=diff
==============================================================================
--- branches/ros-amd64-bringup/reactos/dll/win32/shell32/drive.c [iso-8859-1] (original)
+++ branches/ros-amd64-bringup/reactos/dll/win32/shell32/drive.c [iso-8859-1] Sat May 23 03:52:52 2009
@@ -17,12 +17,6 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
-
-#define LARGEINT_PROTOS
-#define LargeIntegerDivide RtlLargeIntegerDivide
-#define ExtendedIntegerMultiply RtlExtendedIntegerMultiply
-#define ConvertUlongToLargeInteger RtlConvertUlongToLargeInteger
-#define LargeIntegerSubtract RtlLargeIntegerSubtract
 #define MAX_PROPERTY_SHEET_PAGE 32
 
 #define WIN32_NO_STATUS
@@ -33,7 +27,6 @@
 #include <windows.h>
 #include <ndk/ntndk.h>
 #include <fmifs/fmifs.h>
-#include <largeint.h>
 
 #include <precomp.h>
 
@@ -294,20 +287,21 @@
 LARGE_INTEGER
 GetFreeBytesShare(LARGE_INTEGER TotalNumberOfFreeBytes, LARGE_INTEGER TotalNumberOfBytes)
 {
-   LARGE_INTEGER Temp, Result, Remainder;
+   LARGE_INTEGER Temp, Result;
 
    if (TotalNumberOfFreeBytes.QuadPart == 0LL)
    {
-      return ConvertUlongToLargeInteger(0);
+      Result.QuadPart = 1;
+      return Result;
    }
 
-   Temp = LargeIntegerDivide(TotalNumberOfBytes, ConvertUlongToLargeInteger(100), &Remainder);
+   Temp.QuadPart = TotalNumberOfBytes.QuadPart / 100;
    if (Temp.QuadPart >= TotalNumberOfFreeBytes.QuadPart)
    {
-      Result = ConvertUlongToLargeInteger(1);
+      Result.QuadPart = 1;
    }else
    {
-      Result = LargeIntegerDivide(TotalNumberOfFreeBytes, Temp, &Remainder);
+      Result.QuadPart = TotalNumberOfFreeBytes.QuadPart / Temp.QuadPart;
    }
 
    return Result;
@@ -431,7 +425,7 @@
          swprintf(szResult, L"%02d%%", Result.QuadPart);
          SendDlgItemMessageW(hwndDlg, 14007, WM_SETTEXT, (WPARAM)0, (LPARAM)szResult);
          /* store used share amount */
-         Result = LargeIntegerSubtract(ConvertUlongToLargeInteger(100), Result);
+         Result.QuadPart = 100 - Result.QuadPart;
          swprintf(szResult, L"%02d%%", Result.QuadPart);
          SendDlgItemMessageW(hwndDlg, 14005, WM_SETTEXT, (WPARAM)0, (LPARAM)szResult);
          if (LoadStringW(shell32_hInstance, IDS_DRIVE_FIXED, szBuffer, sizeof(szBuffer) / sizeof(WCHAR)))



More information about the Ros-diffs mailing list