[APPLICATIONS] Fix 64 bit issues
authorTimo Kreuzer <timo.kreuzer@reactos.org>
Sun, 4 Mar 2018 15:12:18 +0000 (16:12 +0100)
committerTimo Kreuzer <timo.kreuzer@reactos.org>
Sat, 4 Aug 2018 17:19:34 +0000 (19:19 +0200)
16 files changed:
base/applications/cmdutils/dbgprint/dbgprint.c
base/applications/drwtsn32/main.cpp
base/applications/mmc/console.c
base/applications/mplay32/mplay32.c
base/applications/msconfig_new/utils.c
base/applications/network/net/cmdUser.c
base/applications/rapps/gui.cpp
base/applications/rapps/include/crichedit.h
base/applications/rapps/include/rosui.h
base/applications/rapps/loaddlg.cpp
base/applications/sc/config.c
base/applications/sc/misc.c
base/applications/shutdown/gui.c
base/applications/sndrec32/sndrec32.cpp
base/applications/sndvol32/dialog.c
sdk/include/reactos/rosctrls.h

index 6fd1731..1ea7f56 100644 (file)
@@ -17,9 +17,9 @@
 int _tmain(int argc, TCHAR ** argv)
 {
     TCHAR * buf;
-    int bufsize;
+    size_t bufsize;
     int i;
-    int offset;
+    size_t offset;
 
     bufsize = 0;
     for(i = 1; i < argc; i++)
@@ -106,7 +106,7 @@ int _tmain(int argc, TCHAR ** argv)
         offset = 0;
         for(i = 1; i < argc; i++)
         {
-            int length = _tcslen(argv[i]);
+            size_t length = _tcslen(argv[i]);
             _tcsncpy(&buf[offset], argv[i], length);
             offset += length;
             if (i + 1 < argc)
index e67c735..0c9d566 100644 (file)
@@ -285,7 +285,7 @@ int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE, LPWSTR cmdLine, INT)
         {
             if (n + 1 < argc)
             {
-                data.Event = (HANDLE)wcstoul(argv[n+1], NULL, 10);
+                data.Event = (HANDLE)(ULONG_PTR)_wcstoui64(argv[n+1], NULL, 10);
                 n++;
             }
         }
index ce34c56..58d98ad 100644 (file)
@@ -97,7 +97,7 @@ CreateNewMDIChild(PCONSOLE_MAINFRAME_WND Info,
     mcs.y = mcs.cy = CW_USEDEFAULT;
     mcs.style = MDIS_ALLCHILDSTYLES;
 
-    hChild = (HWND)SendMessage(hwndMDIClient, WM_MDICREATE, 0, (LONG)&mcs);
+    hChild = (HWND)SendMessage(hwndMDIClient, WM_MDICREATE, 0, (LPARAM)&mcs);
     if (hChild)
     {
         Info->nConsoleCount++;
index bf2a12d..e5299cb 100644 (file)
@@ -963,8 +963,8 @@ BuildFileFilterAndDeviceMenu(VOID)
     DWORD dwPosition = 0;
     DWORD i;
     DWORD j;
-    UINT uSizeRemain;
-    UINT uMaskRemain;
+    size_t uSizeRemain;
+    size_t uMaskRemain;
     HKEY hKey = NULL;
 
     /* Always load the default (all files) filter */
index 52d5c2d..104081f 100644 (file)
@@ -142,10 +142,12 @@ RunCommand(IN LPCWSTR lpszCommand,
     lpszExpandedCommand = (LPWSTR)MemAlloc(0, dwNumOfChars * sizeof(WCHAR));
     ExpandEnvironmentStringsW(lpszCommand, lpszExpandedCommand, dwNumOfChars);
 
-    dwRes = (DWORD)ShellExecuteW(NULL, NULL /* and not L"open" !! */,
-                                 lpszExpandedCommand,
-                                 lpszParameters,
-                                 NULL, nShowCmd);
+    dwRes = (DWORD_PTR)ShellExecuteW(NULL,
+                                     NULL /* and not L"open" !! */,
+                                     lpszExpandedCommand,
+                                     lpszParameters,
+                                     NULL,
+                                     nShowCmd);
     MemFree(lpszExpandedCommand);
 
     return dwRes;
index ec96c81..d093ffc 100644 (file)
@@ -29,7 +29,7 @@ EnumerateUsers(VOID)
     PSERVER_INFO_100 pServer = NULL;
     DWORD dwRead = 0, dwTotal = 0;
     DWORD i;
-    DWORD_PTR ResumeHandle = 0;
+    DWORD ResumeHandle = 0;
     NET_API_STATUS Status;
 
     Status = NetServerGetInfo(NULL,
index dca702f..b85e5fa 100644 (file)
@@ -348,7 +348,7 @@ public:
             return FALSE;
         }
 
-        ImageList_Destroy((HIMAGELIST) SetImageList(hImageList));
+        ImageList_Destroy(SetImageList(hImageList));
 
         AddButtons(_countof(Buttons), Buttons);
 
index 3b34fde..e3cd933 100644 (file)
@@ -6,10 +6,10 @@ class CRichEdit :
 {
     HMODULE m_LoadedLibrary;
 
-    VOID GenericInsertText(LPCWSTR lpszText, LONG InsertedTextLen, DWORD dwEffects)
+    VOID GenericInsertText(LPCWSTR lpszText, SIZE_T InsertedTextLen, DWORD dwEffects)
     {
         SETTEXTEX SetText;
-        LONG Len = GetTextLen();
+        SIZE_T Len = GetTextLen();
 
         if (InsertedTextLen)
         {
@@ -34,7 +34,7 @@ class CRichEdit :
 public:
     CRichEdit() : CWindow(), m_LoadedLibrary(NULL) {}
 
-    VOID SetRangeFormatting(LONG Start, LONG End, DWORD dwEffects)
+    VOID SetRangeFormatting(SIZE_T Start, SIZE_T End, DWORD dwEffects)
     {
         CHARFORMAT2W CharFormat;
 
index e51a1c4..0d7cd29 100644 (file)
@@ -47,7 +47,7 @@ public:
 
     virtual INT OnCompareItems(T * p1, T * p2)
     {
-        INT t = (reinterpret_cast<INT>(p2) - reinterpret_cast<INT>(p1));
+        INT_PTR t = (reinterpret_cast<INT_PTR>(p2) - reinterpret_cast<INT_PTR>(p1));
         if (t > 0)
             return 1;
         if (t < 0)
index fe9ec04..4016aa5 100644 (file)
@@ -190,11 +190,12 @@ public:
         Item = GetDlgItem(m_hDialog, IDC_DOWNLOAD_STATUS);
         if (Item && szStatusText && wcslen(szStatusText) > 0 && m_UrlHasBeenCopied == FALSE)
         {
-            DWORD len = wcslen(szStatusText) + 1;
+            SIZE_T len = wcslen(szStatusText) + 1;
             ATL::CStringW buf;
+            DWORD dummyLen;
 
             /* beautify our url for display purposes */
-            if (!InternetCanonicalizeUrlW(szStatusText, buf.GetBuffer(len), &len, ICU_DECODE | ICU_NO_ENCODE))
+            if (!InternetCanonicalizeUrlW(szStatusText, buf.GetBuffer(len), &dummyLen, ICU_DECODE | ICU_NO_ENCODE))
             {
                 /* just use the original */
                 buf.ReleaseBuffer();
@@ -405,8 +406,8 @@ INT_PTR CALLBACK CDownloadManager::DownloadDlgProc(HWND Dlg, UINT uMsg, WPARAM w
         HICON hIconSm, hIconBg;
         ATL::CStringW szTempCaption;
 
-        hIconBg = (HICON) GetClassLongW(hMainWnd, GCLP_HICON);
-        hIconSm = (HICON) GetClassLongW(hMainWnd, GCLP_HICONSM);
+        hIconBg = (HICON) GetClassLongPtrW(hMainWnd, GCLP_HICON);
+        hIconSm = (HICON) GetClassLongPtrW(hMainWnd, GCLP_HICONSM);
 
         if (hIconBg && hIconSm)
         {
index 3e8ac43..25794f7 100644 (file)
@@ -17,7 +17,7 @@ BOOL QueryConfig(LPCTSTR ServiceName)
     DWORD cbBytesNeeded = 0;
     LPQUERY_SERVICE_CONFIG pServiceConfig = NULL;
     LPWSTR lpPtr;
-    INT nLen, i;
+    SSIZE_T nLen, i;
 
 #ifdef SCDBG
     _tprintf(_T("service to show configuration - %s\n\n"), ServiceName);
index e03aea4..44d371c 100644 (file)
@@ -169,7 +169,7 @@ ParseFailureActions(
     SC_ACTION *pActions = NULL;
     LPTSTR pStringBuffer = NULL;
     LPTSTR p;
-    INT nLength;
+    INT_PTR nLength;
     INT nCount = 0;
 
     *pcActions = 0;
index c3fb5a4..0c1a0e9 100644 (file)
@@ -8,7 +8,7 @@
 
 #include "precomp.h"
 
-BOOL CALLBACK ShutdownGuiProc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
+INT_PTR CALLBACK ShutdownGuiProc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
 {
     switch(msg)
     {
index 7eabc44..18bf8f3 100644 (file)
@@ -484,7 +484,7 @@ WndProc(HWND hWnd,
                                           BUTTONS_W,
                                           BUTTONS_H,
                                           hWnd,
-                                          (HMENU)i,
+                                          (HMENU)UlongToPtr(i),
                                           hInst,
                                           0);
                 if (!buttons[i])
index 7e15e36..ccaaf31 100644 (file)
@@ -157,7 +157,7 @@ AddDialogControl(
                            rect.right - rect.left,
                            rect.bottom - rect.top,
                            hwndDialog,
-                           (HMENU)(wID),
+                           UlongToPtr(wID),
                            hAppInstance,
                            NULL);
 
index f332aca..eb5cebc 100644 (file)
@@ -395,9 +395,9 @@ public: // Layout management methods
     }
 
 public: // Image list management methods
-    DWORD SetImageList(HIMAGELIST himl)
+    HIMAGELIST SetImageList(HIMAGELIST himl)
     {
-        return SendMessageW(TB_SETIMAGELIST, 0, reinterpret_cast<LPARAM>(himl));
+        return (HIMAGELIST)SendMessageW(TB_SETIMAGELIST, 0, reinterpret_cast<LPARAM>(himl));
     }
 
 public: // Other methods