https://git.reactos.org/?p=reactos.git;a=commitdiff;h=2890a22179528006e637c…
commit 2890a22179528006e637cd5efdfc2abb7e2ceb5b
Author: Timo Kreuzer <timo.kreuzer(a)reactos.org>
AuthorDate: Sun Jan 20 09:04:58 2019 +0100
Commit: GitHub <noreply(a)github.com>
CommitDate: Sun Jan 20 09:04:58 2019 +0100
[ROSAPPS] Fix 64 bit issues
---
modules/rosapps/applications/CMakeLists.txt | 6 ++--
.../screensavers/butterflies/butterflies.c | 6 ++--
.../applications/screensavers/matrix/config.c | 8 +++---
.../applications/screensavers/matrix/screensave.c | 2 +-
.../rosapps/applications/sysutils/CMakeLists.txt | 4 ++-
modules/rosapps/applications/sysutils/ctm/ctm.c | 7 +++--
.../rosapps/applications/sysutils/tlist/tlist.c | 32 +++++++++++-----------
modules/rosapps/templates/dialog/memdlg.c | 4 +--
modules/rosapps/templates/mdi/framewnd.c | 4 +--
modules/rosapps/templates/mdi/main.c | 4 +--
10 files changed, 41 insertions(+), 36 deletions(-)
diff --git a/modules/rosapps/applications/CMakeLists.txt
b/modules/rosapps/applications/CMakeLists.txt
index 74dd129590..19c0ecfe9a 100644
--- a/modules/rosapps/applications/CMakeLists.txt
+++ b/modules/rosapps/applications/CMakeLists.txt
@@ -1,7 +1,9 @@
add_subdirectory(cmdutils)
add_subdirectory(devutils)
-add_subdirectory(explorer-old)
-add_subdirectory(fraginator)
+if (ARCH STREQUAL "i386")
+ add_subdirectory(explorer-old)
+ add_subdirectory(fraginator)
+endif()
add_subdirectory(imagesoft)
add_subdirectory(net)
add_subdirectory(notevil)
diff --git a/modules/rosapps/applications/screensavers/butterflies/butterflies.c
b/modules/rosapps/applications/screensavers/butterflies/butterflies.c
index b11a45dd13..1c181fea91 100644
--- a/modules/rosapps/applications/screensavers/butterflies/butterflies.c
+++ b/modules/rosapps/applications/screensavers/butterflies/butterflies.c
@@ -230,7 +230,7 @@ void Display()
}
-BOOL AboutProc(HWND hdlg, UINT msg, WPARAM wpm, LPARAM lpm){
+INT_PTR AboutProc(HWND hdlg, UINT msg, WPARAM wpm, LPARAM lpm){
switch(msg){
case WM_CTLCOLORSTATIC:
@@ -238,7 +238,7 @@ BOOL AboutProc(HWND hdlg, UINT msg, WPARAM wpm, LPARAM lpm){
{
SetTextColor((HDC)wpm, RGB(0,0,255));
SetBkColor((HDC)wpm, (COLORREF)GetSysColor(COLOR_3DFACE));
- return((int)GetSysColorBrush(COLOR_3DFACE));
+ return (INT_PTR)GetSysColorBrush(COLOR_3DFACE);
}
break;
case WM_COMMAND:
@@ -314,7 +314,7 @@ BOOL WINAPI ScreenSaverConfigureDialog(HWND hDlg, UINT message,
EndDialog(hDlg, TRUE);
break;
case IDABOUT:
- DialogBox(hInstance, MAKEINTRESOURCE(IDD_DLG_ABOUT), hDlg,
(DLGPROC)AboutProc);
+ DialogBox(hInstance, MAKEINTRESOURCE(IDD_DLG_ABOUT), hDlg, AboutProc);
break;
}
}
diff --git a/modules/rosapps/applications/screensavers/matrix/config.c
b/modules/rosapps/applications/screensavers/matrix/config.c
index 1caa402593..f504a3b23c 100644
--- a/modules/rosapps/applications/screensavers/matrix/config.c
+++ b/modules/rosapps/applications/screensavers/matrix/config.c
@@ -36,7 +36,7 @@ void AddFonts(HWND hwndCombo)
lf.lfFaceName[0] = _T('\0');
hdc = GetDC(0);
- EnumFontFamiliesEx(hdc, &lf, (FONTENUMPROC)EnumFontProc, (LONG)hwndCombo, 0);
+ EnumFontFamiliesEx(hdc, &lf, (FONTENUMPROC)EnumFontProc, (LONG_PTR)hwndCombo, 0);
ReleaseDC(0, hdc);
}
@@ -53,7 +53,7 @@ void UpdatePreview(HWND hwnd)
//
// Dialogbox procedure for Configuration window
//
-BOOL CALLBACK ConfigDlgProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
+INT_PTR CALLBACK ConfigDlgProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
static TCHAR buf[256];
HWND hwndCombo, hwndCtrl;
@@ -112,7 +112,7 @@ BOOL CALLBACK ConfigDlgProc(HWND hwnd, UINT uMsg, WPARAM wParam,
LPARAM lParam)
{
SetTextColor((HDC)wParam, RGB(0,80,0));
SetBkColor((HDC)wParam, GetSysColor(COLOR_3DFACE));
- return (BOOL)GetSysColorBrush(COLOR_3DFACE);
+ return (INT_PTR)GetSysColorBrush(COLOR_3DFACE);
}
else if(GetDlgCtrlID((HWND)lParam) == IDC_PREVIEW)
{
@@ -167,7 +167,7 @@ BOOL CALLBACK ConfigDlgProc(HWND hwnd, UINT uMsg, WPARAM wParam,
LPARAM lParam)
DrawText(hdc, buf, -1, &rect, DT_CENTER|DT_VCENTER|DT_WORDBREAK);
- return (BOOL)GetStockObject(NULL_BRUSH);
+ return (INT_PTR)GetStockObject(NULL_BRUSH);
}
else
{
diff --git a/modules/rosapps/applications/screensavers/matrix/screensave.c
b/modules/rosapps/applications/screensavers/matrix/screensave.c
index adfc9d9191..2c521598aa 100644
--- a/modules/rosapps/applications/screensavers/matrix/screensave.c
+++ b/modules/rosapps/applications/screensavers/matrix/screensave.c
@@ -121,7 +121,7 @@ VOID ParseCommandLine(LPWSTR szCmdLine, UCHAR *chOption, HWND
*hwndParent)
if(isdigit(ch))
{
- unsigned int i = _wtoi(szCmdLine - 1);
+ ULONG_PTR i = _wtoi(szCmdLine - 1);
*hwndParent = (HWND)i;
}
else
diff --git a/modules/rosapps/applications/sysutils/CMakeLists.txt
b/modules/rosapps/applications/sysutils/CMakeLists.txt
index ec5888deb7..997681dbf8 100644
--- a/modules/rosapps/applications/sysutils/CMakeLists.txt
+++ b/modules/rosapps/applications/sysutils/CMakeLists.txt
@@ -6,7 +6,9 @@ add_subdirectory(kill)
add_subdirectory(logevent)
add_subdirectory(lsdd)
add_subdirectory(man)
-add_subdirectory(pedump)
+if (ARCH STREQUAL "i386")
+ add_subdirectory(pedump)
+endif()
add_subdirectory(regexpl)
add_subdirectory(rosddt)
add_subdirectory(screenshot)
diff --git a/modules/rosapps/applications/sysutils/ctm/ctm.c
b/modules/rosapps/applications/sysutils/ctm/ctm.c
index dd45ff0a6f..9f6715e579 100644
--- a/modules/rosapps/applications/sysutils/ctm/ctm.c
+++ b/modules/rosapps/applications/sysutils/ctm/ctm.c
@@ -189,7 +189,8 @@ void DisplayScreen()
lines = ProcPerScreen;
for (idx=0; idx<ProcPerScreen; idx++)
{
- int len, i;
+ int i;
+ SIZE_T len;
TCHAR lpNumber[5];
TCHAR lpPid[8];
TCHAR lpCpu[6];
@@ -501,7 +502,7 @@ void PerfDataRefresh()
// so that we can establish delta values
pPDOld = NULL;
for (Idx2=0; Idx2<ProcessCountOld; Idx2++) {
- if (pPerfDataOld[Idx2].ProcessId == (ULONG)(pSPI->UniqueProcessId) &&
+ if (pPerfDataOld[Idx2].ProcessId == HandleToUlong(pSPI->UniqueProcessId)
&&
/* check also for the creation time, a new process may have an id of an old one
*/
pPerfDataOld[Idx2].CreateTime.QuadPart == pSPI->CreateTime.QuadPart) {
pPDOld = &pPerfDataOld[Idx2];
@@ -525,7 +526,7 @@ void PerfDataRefresh()
#endif
}
- pPerfData[Idx].ProcessId = (ULONG)(pSPI->UniqueProcessId);
+ pPerfData[Idx].ProcessId = HandleToUlong(pSPI->UniqueProcessId);
pPerfData[Idx].CreateTime = pSPI->CreateTime;
if (pPDOld) {
diff --git a/modules/rosapps/applications/sysutils/tlist/tlist.c
b/modules/rosapps/applications/sysutils/tlist/tlist.c
index 85958fbb26..5d8db27018 100644
--- a/modules/rosapps/applications/sysutils/tlist/tlist.c
+++ b/modules/rosapps/applications/sysutils/tlist/tlist.c
@@ -47,7 +47,7 @@ void *PsaiMalloc(SIZE_T size)
NtCurrentProcess(),
&pBuf,
0,
- (PULONG)&size,
+ &size,
MEM_COMMIT,
PAGE_READWRITE
);
@@ -58,7 +58,7 @@ void *PsaiMalloc(SIZE_T size)
void PsaiFree(void *ptr)
{
- ULONG nSize = 0;
+ SIZE_T nSize = 0;
NtFreeVirtualMemory(NtCurrentProcess(), &ptr, &nSize, MEM_RELEASE);
}
@@ -117,7 +117,7 @@ ProcessHasDescendants (
if (NULL == pInfo) return 0;
do {
- if (ALREADY_PROCESSED != (DWORD)pInfo->InheritedFromUniqueProcessId)
+ if (ALREADY_PROCESSED != HandleToUlong(pInfo->InheritedFromUniqueProcessId))
{
if ((Pid != (HANDLE)pInfo->UniqueProcessId) && (Pid ==
(HANDLE)pInfo->InheritedFromUniqueProcessId))
{
@@ -158,8 +158,8 @@ int WINAPI PrintProcessInfoDepth (
wprintf (
L"%s (%d, %d) %s\n",
Module,
- pInfo->UniqueProcessId,
- pInfo->InheritedFromUniqueProcessId,
+ HandleToUlong(pInfo->UniqueProcessId),
+ HandleToUlong(pInfo->InheritedFromUniqueProcessId),
Title
);
return EXIT_SUCCESS;
@@ -177,13 +177,13 @@ PrintProcessAndDescendants (
if (NULL == pInfo) return EXIT_FAILURE;
/* Print current pInfo process */
PrintProcessInfoDepth (pInfo, Depth ++);
- pInfo->InheritedFromUniqueProcessId = (HANDLE)ALREADY_PROCESSED;
+ pInfo->InheritedFromUniqueProcessId = UlongToHandle(ALREADY_PROCESSED);
/* Save current process' PID */
Pid = pInfo->UniqueProcessId;
/* Scan and print possible children */
do {
- if (ALREADY_PROCESSED != (DWORD)pInfo->InheritedFromUniqueProcessId)
+ if (ALREADY_PROCESSED != HandleToUlong(pInfo->InheritedFromUniqueProcessId))
{
if (Pid == pInfo->InheritedFromUniqueProcessId)
{
@@ -198,7 +198,7 @@ PrintProcessAndDescendants (
else
{
PrintProcessInfoDepth (pInfo, Depth);
- pInfo->InheritedFromUniqueProcessId = (HANDLE)ALREADY_PROCESSED;
+ pInfo->InheritedFromUniqueProcessId = UlongToHandle(ALREADY_PROCESSED);
}
}
}
@@ -227,16 +227,16 @@ int WINAPI PrintProcessList (BOOL DisplayTree)
{
GetProcessInfo (pInfo, & Module, & Title);
wprintf (
- L"%4d %-16s %s\n",
- pInfo->UniqueProcessId,
+ L"%4d %-16s %s (%04d)\n",
+ HandleToUlong(pInfo->UniqueProcessId),
Module,
Title,
- pInfo->InheritedFromUniqueProcessId
+ HandleToUlong(pInfo->InheritedFromUniqueProcessId)
);
}
else
{
- if (ALREADY_PROCESSED != (DWORD)pInfo->InheritedFromUniqueProcessId)
+ if (ALREADY_PROCESSED != HandleToUlong(pInfo->InheritedFromUniqueProcessId))
{
PrintProcessAndDescendants (pInfo, pInfoBase, 0);
}
@@ -310,8 +310,8 @@ int WINAPI PrintThreads (PSYSTEM_PROCESS_INFORMATION pInfo)
NtClose (hThread);
/* Now print the collected information */
- wprintf (L" %4d Win32StartAddr:0x%08x LastErr:0x%08x State:%s\n",
- CurThread->ClientId.UniqueThread,
+ wprintf (L" %4d Win32StartAddr:0x%p LastErr:0x%08x State:%s\n",
+ HandleToUlong(CurThread->ClientId.UniqueThread),
Win32StartAddress,
0 /* FIXME: ((PTEB) tInfo.TebBaseAddress)->LastErrorValue */,
ThreadStateName[CurThread->ThreadState]
@@ -357,7 +357,7 @@ int WINAPI PrintProcess (char * PidStr)
CLIENT_ID ClientId = {0, 0};
- ClientId.UniqueProcess = (PVOID) atol (PidStr);
+ ClientId.UniqueProcess = UlongToHandle(atol (PidStr));
if (FALSE == AcquirePrivileges ())
{
@@ -411,7 +411,7 @@ int WINAPI PrintProcess (char * PidStr)
GetProcessInfo (pInfo, & Module, & Title);
- wprintf (L"%4d %s\n", ClientId.UniqueProcess, Module);
+ wprintf (L"%4d %s\n", HandleToUlong(ClientId.UniqueProcess), Module);
#if 0
printf (" CWD: %s\n", ""); /* it won't appear if empty
*/
printf (" CmdLine: %s\n", ""); /* it won't appear if empty
*/
diff --git a/modules/rosapps/templates/dialog/memdlg.c
b/modules/rosapps/templates/dialog/memdlg.c
index 310d242b43..dd95e49f42 100644
--- a/modules/rosapps/templates/dialog/memdlg.c
+++ b/modules/rosapps/templates/dialog/memdlg.c
@@ -40,9 +40,9 @@ LRESULT CALLBACK DialogWndProc(HWND hDlg, UINT message, WPARAM wParam,
LPARAM lP
LPWORD lpwAlign(LPWORD lpIn)
{
- ULONG ul;
+ ULONG_PTR ul;
- ul = (ULONG)lpIn;
+ ul = (ULONG_PTR)lpIn;
ul += 3;
ul >>= 2;
ul <<= 2;
diff --git a/modules/rosapps/templates/mdi/framewnd.c
b/modules/rosapps/templates/mdi/framewnd.c
index ef4e5d0d46..184927a251 100644
--- a/modules/rosapps/templates/mdi/framewnd.c
+++ b/modules/rosapps/templates/mdi/framewnd.c
@@ -205,7 +205,7 @@ void OnEnterMenuLoop(HWND hWnd)
// Update the status bar pane sizes
nParts = -1;
- SendMessage(hStatusBar, SB_SETPARTS, 1, (long)&nParts);
+ SendMessage(hStatusBar, SB_SETPARTS, 1, (LPARAM)&nParts);
bInMenuLoop = TRUE;
SendMessage(hStatusBar, SB_SETTEXT, (WPARAM)0, (LPARAM)_T(""));
}
@@ -221,7 +221,7 @@ void OnExitMenuLoop(HWND hWnd)
nParts[0] = 100;
nParts[1] = 210;
nParts[2] = rc.right;
- SendMessage(hStatusBar, SB_SETPARTS, 3, (long)nParts);
+ SendMessage(hStatusBar, SB_SETPARTS, 3, (LPARAM)nParts);
SendMessage(hStatusBar, SB_SETTEXT, 0, (LPARAM)_T(""));
UpdateStatusBar();
}
diff --git a/modules/rosapps/templates/mdi/main.c b/modules/rosapps/templates/mdi/main.c
index 6cb88c281a..977a082350 100644
--- a/modules/rosapps/templates/mdi/main.c
+++ b/modules/rosapps/templates/mdi/main.c
@@ -127,7 +127,7 @@ BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
hFont = CreateFont(-MulDiv(8,GetDeviceCaps(hdc,LOGPIXELSY),72), 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, _T("MS Sans Serif"));
ReleaseDC(0, hdc);
- hFrameWnd = CreateWindowEx(0, (LPCTSTR)(int)hFrameWndClass, szTitle,
+ hFrameWnd = CreateWindowEx(0, (LPCTSTR)hFrameWndClass, szTitle,
// hFrameWnd = CreateWindow(szFrameClass, szTitle,
WS_OVERLAPPEDWINDOW | WS_CLIPCHILDREN,
CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,
@@ -165,7 +165,7 @@ BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
nParts[0] = 100;
nParts[1] = 210;
nParts[2] = 400;
- SendMessage(hStatusBar, SB_SETPARTS, 3, (long)nParts);
+ SendMessage(hStatusBar, SB_SETPARTS, 3, (LPARAM)nParts);
} else {
CheckMenuItem(hMenuOptions, ID_OPTIONS_TOOLBAR, MF_BYCOMMAND|MF_GRAYED);
CheckMenuItem(hMenuOptions, ID_OPTIONS_STATUSBAR, MF_BYCOMMAND|MF_GRAYED);