https://git.reactos.org/?p=reactos.git;a=commitdiff;h=6f1306664735830e08bf0…
commit 6f1306664735830e08bf074f07b82a57107f2912
Author: Timo Kreuzer <timo.kreuzer(a)reactos.org>
AuthorDate: Sun Mar 4 16:12:18 2018 +0100
Commit: Timo Kreuzer <timo.kreuzer(a)reactos.org>
CommitDate: Sat Aug 4 19:19:34 2018 +0200
[APPLICATIONS] Fix 64 bit issues
---
base/applications/cmdutils/dbgprint/dbgprint.c | 6 +++---
base/applications/drwtsn32/main.cpp | 2 +-
base/applications/mmc/console.c | 2 +-
base/applications/mplay32/mplay32.c | 4 ++--
base/applications/msconfig_new/utils.c | 10 ++++++----
base/applications/network/net/cmdUser.c | 2 +-
base/applications/rapps/gui.cpp | 2 +-
base/applications/rapps/include/crichedit.h | 6 +++---
base/applications/rapps/include/rosui.h | 2 +-
base/applications/rapps/loaddlg.cpp | 9 +++++----
base/applications/sc/config.c | 2 +-
base/applications/sc/misc.c | 2 +-
base/applications/shutdown/gui.c | 2 +-
base/applications/sndrec32/sndrec32.cpp | 2 +-
base/applications/sndvol32/dialog.c | 2 +-
sdk/include/reactos/rosctrls.h | 4 ++--
16 files changed, 31 insertions(+), 28 deletions(-)
diff --git a/base/applications/cmdutils/dbgprint/dbgprint.c
b/base/applications/cmdutils/dbgprint/dbgprint.c
index 6fd17317f9..1ea7f56766 100644
--- a/base/applications/cmdutils/dbgprint/dbgprint.c
+++ b/base/applications/cmdutils/dbgprint/dbgprint.c
@@ -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)
diff --git a/base/applications/drwtsn32/main.cpp b/base/applications/drwtsn32/main.cpp
index e67c735006..0c9d5664ce 100644
--- a/base/applications/drwtsn32/main.cpp
+++ b/base/applications/drwtsn32/main.cpp
@@ -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++;
}
}
diff --git a/base/applications/mmc/console.c b/base/applications/mmc/console.c
index ce34c56efc..58d98ad511 100644
--- a/base/applications/mmc/console.c
+++ b/base/applications/mmc/console.c
@@ -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++;
diff --git a/base/applications/mplay32/mplay32.c b/base/applications/mplay32/mplay32.c
index bf2a12da88..e5299cb539 100644
--- a/base/applications/mplay32/mplay32.c
+++ b/base/applications/mplay32/mplay32.c
@@ -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 */
diff --git a/base/applications/msconfig_new/utils.c
b/base/applications/msconfig_new/utils.c
index 52d5c2dd46..104081f78c 100644
--- a/base/applications/msconfig_new/utils.c
+++ b/base/applications/msconfig_new/utils.c
@@ -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;
diff --git a/base/applications/network/net/cmdUser.c
b/base/applications/network/net/cmdUser.c
index ec96c8163b..d093ffc9e0 100644
--- a/base/applications/network/net/cmdUser.c
+++ b/base/applications/network/net/cmdUser.c
@@ -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,
diff --git a/base/applications/rapps/gui.cpp b/base/applications/rapps/gui.cpp
index dca702fc9f..b85e5fa92e 100644
--- a/base/applications/rapps/gui.cpp
+++ b/base/applications/rapps/gui.cpp
@@ -348,7 +348,7 @@ public:
return FALSE;
}
- ImageList_Destroy((HIMAGELIST) SetImageList(hImageList));
+ ImageList_Destroy(SetImageList(hImageList));
AddButtons(_countof(Buttons), Buttons);
diff --git a/base/applications/rapps/include/crichedit.h
b/base/applications/rapps/include/crichedit.h
index 3b34fde3f4..e3cd93345d 100644
--- a/base/applications/rapps/include/crichedit.h
+++ b/base/applications/rapps/include/crichedit.h
@@ -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;
diff --git a/base/applications/rapps/include/rosui.h
b/base/applications/rapps/include/rosui.h
index e51a1c4c96..0d7cd296b3 100644
--- a/base/applications/rapps/include/rosui.h
+++ b/base/applications/rapps/include/rosui.h
@@ -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)
diff --git a/base/applications/rapps/loaddlg.cpp b/base/applications/rapps/loaddlg.cpp
index fe9ec04dec..4016aa550c 100644
--- a/base/applications/rapps/loaddlg.cpp
+++ b/base/applications/rapps/loaddlg.cpp
@@ -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)
{
diff --git a/base/applications/sc/config.c b/base/applications/sc/config.c
index 3e8ac43f51..25794f76f4 100644
--- a/base/applications/sc/config.c
+++ b/base/applications/sc/config.c
@@ -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);
diff --git a/base/applications/sc/misc.c b/base/applications/sc/misc.c
index e03aea4967..44d371c684 100644
--- a/base/applications/sc/misc.c
+++ b/base/applications/sc/misc.c
@@ -169,7 +169,7 @@ ParseFailureActions(
SC_ACTION *pActions = NULL;
LPTSTR pStringBuffer = NULL;
LPTSTR p;
- INT nLength;
+ INT_PTR nLength;
INT nCount = 0;
*pcActions = 0;
diff --git a/base/applications/shutdown/gui.c b/base/applications/shutdown/gui.c
index c3fb5a4b56..0c1a0e9c25 100644
--- a/base/applications/shutdown/gui.c
+++ b/base/applications/shutdown/gui.c
@@ -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)
{
diff --git a/base/applications/sndrec32/sndrec32.cpp
b/base/applications/sndrec32/sndrec32.cpp
index 7eabc446fa..18bf8f37d1 100644
--- a/base/applications/sndrec32/sndrec32.cpp
+++ b/base/applications/sndrec32/sndrec32.cpp
@@ -484,7 +484,7 @@ WndProc(HWND hWnd,
BUTTONS_W,
BUTTONS_H,
hWnd,
- (HMENU)i,
+ (HMENU)UlongToPtr(i),
hInst,
0);
if (!buttons[i])
diff --git a/base/applications/sndvol32/dialog.c b/base/applications/sndvol32/dialog.c
index 7e15e36695..ccaaf318f1 100644
--- a/base/applications/sndvol32/dialog.c
+++ b/base/applications/sndvol32/dialog.c
@@ -157,7 +157,7 @@ AddDialogControl(
rect.right - rect.left,
rect.bottom - rect.top,
hwndDialog,
- (HMENU)(wID),
+ UlongToPtr(wID),
hAppInstance,
NULL);
diff --git a/sdk/include/reactos/rosctrls.h b/sdk/include/reactos/rosctrls.h
index f332aca915..eb5cebc026 100644
--- a/sdk/include/reactos/rosctrls.h
+++ b/sdk/include/reactos/rosctrls.h
@@ -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