[APPLICATIONS] Fix 64 bit issues

This commit is contained in:
Timo Kreuzer 2018-03-04 16:12:18 +01:00
parent 807331436e
commit 6f13066647
16 changed files with 31 additions and 28 deletions

View 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)

View 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++;
}
}

View 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++;

View 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 */

View 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;

View 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,

View file

@ -348,7 +348,7 @@ public:
return FALSE;
}
ImageList_Destroy((HIMAGELIST) SetImageList(hImageList));
ImageList_Destroy(SetImageList(hImageList));
AddButtons(_countof(Buttons), Buttons);

View 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;

View 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)

View 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)
{

View 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);

View 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;

View 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)
{

View file

@ -484,7 +484,7 @@ WndProc(HWND hWnd,
BUTTONS_W,
BUTTONS_H,
hWnd,
(HMENU)i,
(HMENU)UlongToPtr(i),
hInst,
0);
if (!buttons[i])

View file

@ -157,7 +157,7 @@ AddDialogControl(
rect.right - rect.left,
rect.bottom - rect.top,
hwndDialog,
(HMENU)(wID),
UlongToPtr(wID),
hAppInstance,
NULL);

View 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