https://git.reactos.org/?p=reactos.git;a=commitdiff;h=9cab5b549d2ab671f14e7…
commit 9cab5b549d2ab671f14e77b9a824248d9bae290f
Author: Timo Kreuzer <timo.kreuzer(a)reactos.org>
AuthorDate: Sun Mar 4 16:11:41 2018 +0100
Commit: Timo Kreuzer <timo.kreuzer(a)reactos.org>
CommitDate: Sun Jul 8 10:59:16 2018 +0200
[ROSAPPS] Fix 64 bit issues
---
modules/rosapps/applications/devutils/gdihv/gdi.h | 2 +-
.../rosapps/applications/devutils/gdihv/handlelist.c | 10 +++++-----
.../applications/devutils/syscalldump/syscalldump.c | 10 +++++-----
.../applications/devutils/vgafontedit/editglyphdlg.c | 18 +++++++++---------
.../applications/devutils/vgafontedit/fontboxeswnd.c | 6 +++---
.../applications/devutils/vgafontedit/fontwnd.c | 6 +++---
.../applications/devutils/vgafontedit/mainwnd.c | 6 +++---
.../rosapps/applications/sysutils/utils/stats/stats.c | 2 +-
8 files changed, 30 insertions(+), 30 deletions(-)
diff --git a/modules/rosapps/applications/devutils/gdihv/gdi.h
b/modules/rosapps/applications/devutils/gdihv/gdi.h
index 60eed9d18f..341bc9aaef 100644
--- a/modules/rosapps/applications/devutils/gdihv/gdi.h
+++ b/modules/rosapps/applications/devutils/gdihv/gdi.h
@@ -23,7 +23,7 @@ typedef PGDI_TABLE_ENTRY (CALLBACK * GDIQUERYPROC) (void);
/* Handle macros */
#define GDI_HANDLE_CREATE(i, t) \
- ((HANDLE)(((i) & GDI_HANDLE_INDEX_MASK) | ((t) << 16)))
+ ((HANDLE)(((ULONG_PTR)(i) & GDI_HANDLE_INDEX_MASK) | ((t) << 16)))
#define GDI_HANDLE_GET_INDEX(h) \
(((ULONG_PTR)(h)) & GDI_HANDLE_INDEX_MASK)
diff --git a/modules/rosapps/applications/devutils/gdihv/handlelist.c
b/modules/rosapps/applications/devutils/gdihv/handlelist.c
index 63bf241962..98f11fe844 100644
--- a/modules/rosapps/applications/devutils/gdihv/handlelist.c
+++ b/modules/rosapps/applications/devutils/gdihv/handlelist.c
@@ -87,7 +87,7 @@ HandleList_Update(HWND hHandleListCtrl, HANDLE ProcessId)
(ProcessId == (HANDLE)2) )
{
if (ProcessId == (HANDLE)1 || ProcessId == (HANDLE)2 ||
- ((LONG)ProcessId & 0xfffc) == ((ULONG)pEntry->ProcessId & 0xfffc))
+ ((LONG_PTR)ProcessId & 0xfffc) == ((LONG_PTR)pEntry->ProcessId &
0xfffc))
{
handle = GDI_HANDLE_CREATE(i, pEntry->Type);
index = ListView_GetItemCount(hHandleListCtrl);
@@ -101,19 +101,19 @@ HandleList_Update(HWND hHandleListCtrl, HANDLE ProcessId)
wsprintf(strText, L"%d", i);
ListView_SetItemText(hHandleListCtrl, index, 1, strText);
- wsprintf(strText, L"%#08x", handle);
+ wsprintf(strText, L"%#08Ix", handle);
ListView_SetItemText(hHandleListCtrl, index, 2, strText);
str2 = GetTypeName(handle);
ListView_SetItemText(hHandleListCtrl, index, 3, str2);
- wsprintf(strText, L"%#08x", (UINT)pEntry->ProcessId);
+ wsprintf(strText, L"%#08Ix", (UINT_PTR)pEntry->ProcessId);
ListView_SetItemText(hHandleListCtrl, index, 4, strText);
- wsprintf(strText, L"%#08x", (UINT)pEntry->KernelData);
+ wsprintf(strText, L"%#08Ix", (UINT_PTR)pEntry->KernelData);
ListView_SetItemText(hHandleListCtrl, index, 5, strText);
- wsprintf(strText, L"%#08x", (UINT)pEntry->UserData);
+ wsprintf(strText, L"%#08Ix", (UINT_PTR)pEntry->UserData);
ListView_SetItemText(hHandleListCtrl, index, 6, strText);
wsprintf(strText, L"%#08x", (UINT)pEntry->Type);
diff --git a/modules/rosapps/applications/devutils/syscalldump/syscalldump.c
b/modules/rosapps/applications/devutils/syscalldump/syscalldump.c
index 141eb1e41d..8b35ce7553 100644
--- a/modules/rosapps/applications/devutils/syscalldump/syscalldump.c
+++ b/modules/rosapps/applications/devutils/syscalldump/syscalldump.c
@@ -55,7 +55,7 @@ BOOL CALLBACK EnumSymbolsProc(
ULONG SymbolSize,
PVOID UserContext)
{
- if ((UINT)UserContext == -1)
+ if ((INT_PTR)UserContext == -1)
{
printf("%s ", pSymInfo->Name);
}
@@ -63,11 +63,11 @@ BOOL CALLBACK EnumSymbolsProc(
{
if (!bX64)
{
- printf("%s@%d ", pSymInfo->Name, (UINT)UserContext);
+ printf("%s@%Iu ", pSymInfo->Name, (UINT_PTR)UserContext);
}
else
{
- printf("%s <+ %d> ", pSymInfo->Name, (UINT)UserContext);
+ printf("%s <+ %Iu> ", pSymInfo->Name, (UINT_PTR)UserContext);
}
}
return TRUE;
@@ -173,7 +173,7 @@ cont:
for (i = 0; i < dwServiceLimit; i++)
{
printf("0x%x:", i+0x1000);
- SymEnumSymbolsForAddr(hProcess, (DWORD64)pdwEntries32[i], EnumSymbolsProc,
(PVOID)(DWORD)pW32pArgumentTable[i]);
+ SymEnumSymbolsForAddr(hProcess, (DWORD64)pdwEntries32[i], EnumSymbolsProc,
(PVOID)(DWORD_PTR)pW32pArgumentTable[i]);
printf("\n");
}
}
@@ -184,7 +184,7 @@ cont:
for (i = 0; i < dwServiceLimit; i++)
{
printf("0x%x:", i+0x1000);
- SymEnumSymbolsForAddr(hProcess, (DWORD64)pdwEntries64[i], EnumSymbolsProc,
(PVOID)(DWORD)pW32pArgumentTable[i]);
+ SymEnumSymbolsForAddr(hProcess, (DWORD64)pdwEntries64[i], EnumSymbolsProc,
(PVOID)(DWORD_PTR)pW32pArgumentTable[i]);
printf("\n");
}
}
diff --git a/modules/rosapps/applications/devutils/vgafontedit/editglyphdlg.c
b/modules/rosapps/applications/devutils/vgafontedit/editglyphdlg.c
index 632957319d..ef027fa2bc 100644
--- a/modules/rosapps/applications/devutils/vgafontedit/editglyphdlg.c
+++ b/modules/rosapps/applications/devutils/vgafontedit/editglyphdlg.c
@@ -104,9 +104,9 @@ EditGlyphCommand(IN INT idCommand, IN PEDIT_GLYPH_INFO Info)
else
Info->FontWndInfo->LastEditGlyphWnd = Info->PrevEditGlyphWnd;
- SetWindowLongW(Info->hSelf, GWLP_USERDATA, 0);
- SetWindowLongW(Info->hEdit, GWLP_USERDATA, 0);
- SetWindowLongW(Info->hPreview, GWLP_USERDATA, 0 );
+ SetWindowLongPtrW(Info->hSelf, GWLP_USERDATA, 0);
+ SetWindowLongPtrW(Info->hEdit, GWLP_USERDATA, 0);
+ SetWindowLongPtrW(Info->hPreview, GWLP_USERDATA, 0 );
HeapFree(hProcessHeap, 0, Info);
return TRUE;
@@ -120,7 +120,7 @@ EditGlyphDlgProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
PEDIT_GLYPH_INFO Info;
- Info = (PEDIT_GLYPH_INFO) GetWindowLongW(hwnd, GWLP_USERDATA);
+ Info = (PEDIT_GLYPH_INFO) GetWindowLongPtrW(hwnd, GWLP_USERDATA);
if(Info || uMsg == WM_INITDIALOG)
{
@@ -135,9 +135,9 @@ EditGlyphDlgProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
Info->hEdit = GetDlgItem(hwnd, IDC_EDIT_GLYPH_EDIT);
Info->hPreview = GetDlgItem(hwnd, IDC_EDIT_GLYPH_PREVIEW);
- SetWindowLongW(hwnd, GWLP_USERDATA, (LONG)Info);
- SetWindowLongW(Info->hEdit, GWLP_USERDATA, (LONG)Info);
- SetWindowLongW(Info->hPreview, GWLP_USERDATA, (LONG)Info);
+ SetWindowLongPtrW(hwnd, GWLP_USERDATA, (LONG_PTR)Info);
+ SetWindowLongPtrW(Info->hEdit, GWLP_USERDATA, (LONG_PTR)Info);
+ SetWindowLongPtrW(Info->hPreview, GWLP_USERDATA, (LONG_PTR)Info);
InitToolbox(Info);
@@ -153,7 +153,7 @@ EditGlyphEditWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM
lParam)
{
PEDIT_GLYPH_INFO Info;
- Info = (PEDIT_GLYPH_INFO) GetWindowLongW(hwnd, GWLP_USERDATA);
+ Info = (PEDIT_GLYPH_INFO) GetWindowLongPtrW(hwnd, GWLP_USERDATA);
if(Info)
{
@@ -231,7 +231,7 @@ EditGlyphPreviewWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM
lParam)
{
PEDIT_GLYPH_INFO Info;
- Info = (PEDIT_GLYPH_INFO) GetWindowLongW(hwnd, GWLP_USERDATA);
+ Info = (PEDIT_GLYPH_INFO) GetWindowLongPtrW(hwnd, GWLP_USERDATA);
if(Info)
{
diff --git a/modules/rosapps/applications/devutils/vgafontedit/fontboxeswnd.c
b/modules/rosapps/applications/devutils/vgafontedit/fontboxeswnd.c
index d12fa6f545..ec5f57fd62 100644
--- a/modules/rosapps/applications/devutils/vgafontedit/fontboxeswnd.c
+++ b/modules/rosapps/applications/devutils/vgafontedit/fontboxeswnd.c
@@ -249,7 +249,7 @@ FontBoxesWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
PFONT_WND_INFO Info;
- Info = (PFONT_WND_INFO) GetWindowLongW(hwnd, GWLP_USERDATA);
+ Info = (PFONT_WND_INFO) GetWindowLongPtrW(hwnd, GWLP_USERDATA);
if(Info || uMsg == WM_CREATE)
{
@@ -257,7 +257,7 @@ FontBoxesWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
case WM_CREATE:
Info = (PFONT_WND_INFO)( ( (LPCREATESTRUCT)lParam )->lpCreateParams
);
- SetWindowLongW(hwnd, GWLP_USERDATA, (LONG)Info);
+ SetWindowLongPtrW(hwnd, GWLP_USERDATA, (LONG_PTR)Info);
// Set a fixed window size
SetWindowPos(hwnd, NULL, 0, 0, FONT_BOXES_WND_WIDTH,
FONT_BOXES_WND_HEIGHT, SWP_NOZORDER | SWP_NOMOVE);
@@ -265,7 +265,7 @@ FontBoxesWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
return 0;
case WM_DESTROY:
- SetWindowLongW(hwnd, GWLP_USERDATA, 0);
+ SetWindowLongPtrW(hwnd, GWLP_USERDATA, 0);
return 0;
case WM_KEYDOWN:
diff --git a/modules/rosapps/applications/devutils/vgafontedit/fontwnd.c
b/modules/rosapps/applications/devutils/vgafontedit/fontwnd.c
index 70c5d58518..fc865c2585 100644
--- a/modules/rosapps/applications/devutils/vgafontedit/fontwnd.c
+++ b/modules/rosapps/applications/devutils/vgafontedit/fontwnd.c
@@ -98,7 +98,7 @@ FontWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
PFONT_WND_INFO Info;
- Info = (PFONT_WND_INFO) GetWindowLongW(hwnd, GWLP_USERDATA);
+ Info = (PFONT_WND_INFO) GetWindowLongPtrW(hwnd, GWLP_USERDATA);
if(Info || uMsg == WM_CREATE)
{
@@ -114,7 +114,7 @@ FontWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
Info = (PFONT_WND_INFO)( ( (LPMDICREATESTRUCT) ( (LPCREATESTRUCT)lParam
)->lpCreateParams )->lParam );
Info->hSelf = hwnd;
- SetWindowLongW(hwnd, GWLP_USERDATA, (LONG)Info);
+ SetWindowLongPtrW(hwnd, GWLP_USERDATA, (LONG_PTR)Info);
CreateFontBoxesWindow(Info);
@@ -198,7 +198,7 @@ FontWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
HeapFree(hProcessHeap, 0, Info->OpenInfo);
HeapFree(hProcessHeap, 0, Info);
- SetWindowLongW(hwnd, GWLP_USERDATA, 0);
+ SetWindowLongPtrW(hwnd, GWLP_USERDATA, 0);
return 0;
case WM_SETFOCUS:
diff --git a/modules/rosapps/applications/devutils/vgafontedit/mainwnd.c
b/modules/rosapps/applications/devutils/vgafontedit/mainwnd.c
index ff7590254d..cde135a357 100644
--- a/modules/rosapps/applications/devutils/vgafontedit/mainwnd.c
+++ b/modules/rosapps/applications/devutils/vgafontedit/mainwnd.c
@@ -442,7 +442,7 @@ MainWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
PMAIN_WND_INFO Info;
- Info = (PMAIN_WND_INFO) GetWindowLongW(hwnd, GWLP_USERDATA);
+ Info = (PMAIN_WND_INFO) GetWindowLongPtrW(hwnd, GWLP_USERDATA);
if(Info || uMsg == WM_CREATE)
{
@@ -489,7 +489,7 @@ MainWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
Info = (PMAIN_WND_INFO)( ( (LPCREATESTRUCT)lParam )->lpCreateParams
);
Info->hMainWnd = hwnd;
Info->hMenu = GetMenu(hwnd);
- SetWindowLongW(hwnd, GWLP_USERDATA, (LONG)Info);
+ SetWindowLongPtrW(hwnd, GWLP_USERDATA, (LONG_PTR)Info);
hNextClipboardViewer = SetClipboardViewer(hwnd);
@@ -503,7 +503,7 @@ MainWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
UnInitResources(Info);
HeapFree(hProcessHeap, 0, Info);
- SetWindowLongW(hwnd, GWLP_USERDATA, 0);
+ SetWindowLongPtrW(hwnd, GWLP_USERDATA, 0);
PostQuitMessage(0);
return 0;
diff --git a/modules/rosapps/applications/sysutils/utils/stats/stats.c
b/modules/rosapps/applications/sysutils/utils/stats/stats.c
index d69b81a1f3..0a8c45f3c3 100644
--- a/modules/rosapps/applications/sysutils/utils/stats/stats.c
+++ b/modules/rosapps/applications/sysutils/utils/stats/stats.c
@@ -82,7 +82,7 @@ AddExtension(LPTSTR ExtName,
return NULL;
for(t = ExtName; *t != _T('\0'); t += _tcslen(t) + 1);
- ln = (DWORD)t - (DWORD)ExtName;
+ ln = (DWORD_PTR)t - (DWORD_PTR)ExtName;
ZeroMemory (ExtInfo, sizeof (EXTENSION_INFO));
memcpy (ExtInfo->ExtName, ExtName, ln);