[ROSTESTS]

Fix 64 bit build of some modules (Samuel Serapion, modified by me)

svn path=/trunk/; revision=47551
This commit is contained in:
Timo Kreuzer 2010-06-03 20:08:26 +00:00
parent 859c81ee74
commit 5cede710e0
17 changed files with 78 additions and 71 deletions

View file

@ -46,7 +46,7 @@ VOID NtoskrnlIoMdlTest(HANDLE KeyHandle)
ok(Mdl == NULL,
"IoAllocateMdl should fail allocation of 2Gb or more, but got Mdl=0x%X",
(UINT32)Mdl);
(UINT_PTR)Mdl);
if (Mdl)
IoFreeMdl(Mdl);
@ -57,10 +57,10 @@ VOID NtoskrnlIoMdlTest(HANDLE KeyHandle)
ok(Mdl != NULL, "Mdl allocation failed");
// Check fields of the allocated struct
ok(Mdl->Next == NULL, "Mdl->Next should be NULL, but is 0x%X",
(UINT32)Mdl->Next);
(UINT_PTR)Mdl->Next);
ok(Mdl->ByteCount == MdlSize,
"Mdl->ByteCount should be equal to MdlSize, but is 0x%X",
(UINT32)Mdl->ByteCount);
(UINT_PTR)Mdl->ByteCount);
// TODO: Check other fields of MDL struct
IoFreeMdl(Mdl);
@ -70,7 +70,7 @@ VOID NtoskrnlIoMdlTest(HANDLE KeyHandle)
Mdl = IoAllocateMdl(VirtualAddress, MdlSize, FALSE, FALSE, Irp);
ok(Mdl != NULL, "Mdl allocation failed");
ok(Irp->MdlAddress == Mdl, "Irp->MdlAddress should be 0x%X, but is 0x%X",
(UINT32)Mdl, (UINT32)Irp->MdlAddress);
(UINT_PTR)Mdl, (UINT_PTR)Irp->MdlAddress);
IoFreeMdl(Mdl);

View file

@ -324,7 +324,7 @@ ObtCreateObjects()
"Object insertion should have failed, but got 0x%lX", Status);
ok(ObBody[0] == ObBody1[1],
"Object bodies doesn't match, 0x%p != 0x%p", ObBody[0], ObBody1[1]);
ok(ObHandle2[0] != NULL, "Bad handle returned 0x%lX", (ULONG)ObHandle2[0]);
ok(ObHandle2[0] != NULL, "Bad handle returned 0x%lX", (ULONG_PTR)ObHandle2[0]);
DPRINT1("%d %d %d %d %d %d %d\n", DumpCount, OpenCount, // deletecount+1
CloseCount, DeleteCount, ParseCount, OkayToCloseCount, QueryNameCount);

View file

@ -75,7 +75,7 @@ PWCHAR CreateLowerDeviceRegistryKey(PUNICODE_STRING RegistryPath, PWCHAR NewDriv
/* Remove the current driver name from the string */
/* FIXME: Dont use hard coded driver name, determine it from the string returned from the above Query */
Length = (wcslen((PWCHAR)ValuePartialInfo->Data) * 2) - (wcslen(L"kmtest.sys") * 2);
RtlZeroMemory((PVOID)((ULONG)ValuePartialInfo->Data + Length),
RtlZeroMemory((PVOID)((ULONG_PTR)ValuePartialInfo->Data + Length),
wcslen(L"drvtests.sys") * 2);
ZwClose(ServiceKey);

View file

@ -1,6 +1,6 @@
#include "ddrawtest.h"
LONG WINAPI BasicWindowProc (HWND hwnd, UINT message, UINT wParam, LONG lParam)
LRESULT WINAPI BasicWindowProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
switch (message)
{

View file

@ -7,7 +7,7 @@
DWORD WINAPI
thread_main1(LPVOID param)
{
printf("Thread 1 running (Counter %lu)\n", (DWORD)param);
printf("Thread 1 running (Counter %lu)\n", PtrToUlong(param));
SleepEx(INFINITE, TRUE);
return 0;
}
@ -16,7 +16,7 @@ thread_main1(LPVOID param)
DWORD WINAPI
thread_main2(LPVOID param)
{
printf("Thread 2 running (Counter %lu)\n", (DWORD)param);
printf("Thread 2 running (Counter %lu)\n", PtrToUlong(param));
Sleep(INFINITE);
return 0;
}
@ -34,7 +34,7 @@ int main (void)
CreateThread(NULL,
0,
thread_main1,
(LPVOID)i,
(LPVOID)(ULONG_PTR)i,
0,
&id);

View file

@ -58,109 +58,109 @@ WinMain(HINSTANCE hInstance,
hbtn[0] = CreateWindow(
"BUTTON","BS_DEFPUSHBUTTON",WS_VISIBLE | WS_CHILD | BS_DEFPUSHBUTTON,
10, 10, 200, 40, hWnd, NULL, (HINSTANCE) GetWindowLong(hWnd, GWL_HINSTANCE),NULL);
10, 10, 200, 40, hWnd, NULL, (HINSTANCE) GetWindowLongPtr(hWnd, GWL_HINSTANCE),NULL);
hbtn[1] = CreateWindow(
"BUTTON","BS_3STATE",WS_VISIBLE | WS_CHILD | BS_3STATE,
10, 60, 200, 20, hWnd, NULL, (HINSTANCE) GetWindowLong(hWnd, GWL_HINSTANCE),NULL);
10, 60, 200, 20, hWnd, NULL, (HINSTANCE) GetWindowLongPtr(hWnd, GWL_HINSTANCE),NULL);
hbtn[2] = CreateWindow(
"BUTTON","BS_AUTO3STATE",WS_VISIBLE | WS_CHILD | BS_AUTO3STATE,
10, 90, 200, 20, hWnd, NULL, (HINSTANCE) GetWindowLong(hWnd, GWL_HINSTANCE),NULL);
10, 90, 200, 20, hWnd, NULL, (HINSTANCE) GetWindowLongPtr(hWnd, GWL_HINSTANCE),NULL);
hbtn[3] = CreateWindow(
"BUTTON","BS_AUTOCHECKBOX",WS_VISIBLE | WS_CHILD | BS_AUTOCHECKBOX,
10, 120, 200, 20, hWnd, NULL, (HINSTANCE) GetWindowLong(hWnd, GWL_HINSTANCE),NULL);
10, 120, 200, 20, hWnd, NULL, (HINSTANCE) GetWindowLongPtr(hWnd, GWL_HINSTANCE),NULL);
hbtn[4] = CreateWindow(
"BUTTON","BS_AUTORADIOBUTTON",WS_VISIBLE | WS_CHILD | BS_AUTORADIOBUTTON,
10, 150, 200, 20, hWnd, NULL, (HINSTANCE) GetWindowLong(hWnd, GWL_HINSTANCE),NULL);
10, 150, 200, 20, hWnd, NULL, (HINSTANCE) GetWindowLongPtr(hWnd, GWL_HINSTANCE),NULL);
hbtn[5] = CreateWindow(
"BUTTON","BS_CHECKBOX",WS_VISIBLE | WS_CHILD | BS_CHECKBOX,
10, 180, 200, 20, hWnd, NULL, (HINSTANCE) GetWindowLong(hWnd, GWL_HINSTANCE),NULL);
10, 180, 200, 20, hWnd, NULL, (HINSTANCE) GetWindowLongPtr(hWnd, GWL_HINSTANCE),NULL);
hbtn[6] = CreateWindow(
"BUTTON","BS_GROUPBOX",WS_VISIBLE | WS_CHILD | BS_GROUPBOX,
10, 210, 200, 80, hWnd, NULL, (HINSTANCE) GetWindowLong(hWnd, GWL_HINSTANCE),NULL);
10, 210, 200, 80, hWnd, NULL, (HINSTANCE) GetWindowLongPtr(hWnd, GWL_HINSTANCE),NULL);
hbtn[7] = CreateWindow(
"BUTTON","BS_PUSHBUTTON",WS_VISIBLE | WS_CHILD | BS_PUSHBUTTON,
20, 230, 180, 30, hWnd, NULL, (HINSTANCE) GetWindowLong(hWnd, GWL_HINSTANCE),NULL);
20, 230, 180, 30, hWnd, NULL, (HINSTANCE) GetWindowLongPtr(hWnd, GWL_HINSTANCE),NULL);
hbtn[8] = CreateWindow(
"BUTTON","BS_RADIOBUTTON",WS_VISIBLE | WS_CHILD | BS_RADIOBUTTON,
10, 300, 200, 20, hWnd, NULL, (HINSTANCE) GetWindowLong(hWnd, GWL_HINSTANCE),NULL);
10, 300, 200, 20, hWnd, NULL, (HINSTANCE) GetWindowLongPtr(hWnd, GWL_HINSTANCE),NULL);
hbtn[9] = CreateWindow(
"BUTTON","BS_AUTORADIOBUTTON",WS_VISIBLE | WS_CHILD | BS_AUTORADIOBUTTON,
220, 160, 200, 20, hWnd, NULL, (HINSTANCE) GetWindowLong(hWnd, GWL_HINSTANCE),NULL);
220, 160, 200, 20, hWnd, NULL, (HINSTANCE) GetWindowLongPtr(hWnd, GWL_HINSTANCE),NULL);
hbtn[10] = CreateWindow(
"BUTTON","BS_DEFPUSHBUTTON|BS_BOTTOM",WS_VISIBLE | WS_CHILD | BS_DEFPUSHBUTTON | BS_BOTTOM,
220, 10, 250, 40, hWnd, NULL, (HINSTANCE) GetWindowLong(hWnd, GWL_HINSTANCE),NULL);
220, 10, 250, 40, hWnd, NULL, (HINSTANCE) GetWindowLongPtr(hWnd, GWL_HINSTANCE),NULL);
hbtn[11] = CreateWindow(
"BUTTON","BS_DEFPUSHBUTTON|BS_LEFT",WS_VISIBLE | WS_CHILD | BS_DEFPUSHBUTTON | BS_LEFT,
480, 10, 250, 40, hWnd, NULL, (HINSTANCE) GetWindowLong(hWnd, GWL_HINSTANCE),NULL);
480, 10, 250, 40, hWnd, NULL, (HINSTANCE) GetWindowLongPtr(hWnd, GWL_HINSTANCE),NULL);
hbtn[12] = CreateWindow(
"BUTTON","BS_DEFPUSHBUTTON|BS_RIGHT|BS_MULTILINE",WS_VISIBLE | WS_CHILD | BS_DEFPUSHBUTTON | BS_RIGHT |BS_MULTILINE,
740, 10, 150, 60, hWnd, NULL, (HINSTANCE) GetWindowLong(hWnd, GWL_HINSTANCE),NULL);
740, 10, 150, 60, hWnd, NULL, (HINSTANCE) GetWindowLongPtr(hWnd, GWL_HINSTANCE),NULL);
hbtn[13] = CreateWindow(
"BUTTON","BS_AUTORADIOBUTTON|BS_TOP",WS_VISIBLE | WS_CHILD | BS_AUTORADIOBUTTON | BS_TOP,
220, 60, 200, 60, hWnd, NULL, (HINSTANCE) GetWindowLong(hWnd, GWL_HINSTANCE),NULL);
220, 60, 200, 60, hWnd, NULL, (HINSTANCE) GetWindowLongPtr(hWnd, GWL_HINSTANCE),NULL);
// Other Combinations
hbtn[14] = CreateWindow(
"BUTTON","BS_AUTORADIOBUTTON|BS_BOTTOM|BS_MULTILINE",WS_VISIBLE | WS_CHILD | BS_AUTORADIOBUTTON | BS_BOTTOM | BS_MULTILINE,
480, 60, 200, 60, hWnd, NULL, (HINSTANCE) GetWindowLong(hWnd, GWL_HINSTANCE),NULL);
480, 60, 200, 60, hWnd, NULL, (HINSTANCE) GetWindowLongPtr(hWnd, GWL_HINSTANCE),NULL);
hbtn[15] = CreateWindow(
"BUTTON","BS_AUTORADIOBUTTON|BS_LEFT",WS_VISIBLE | WS_CHILD | BS_AUTORADIOBUTTON | BS_LEFT,
740, 80, 200, 20, hWnd, NULL, (HINSTANCE) GetWindowLong(hWnd, GWL_HINSTANCE),NULL);
740, 80, 200, 20, hWnd, NULL, (HINSTANCE) GetWindowLongPtr(hWnd, GWL_HINSTANCE),NULL);
hbtn[16] = CreateWindow(
"BUTTON","BS_AUTORADIOBUTTON|BS_RIGHT|BS_TOP",WS_VISIBLE | WS_CHILD | BS_AUTORADIOBUTTON | BS_RIGHT | BS_TOP,
220, 130, 200, 20, hWnd, NULL, (HINSTANCE) GetWindowLong(hWnd, GWL_HINSTANCE),NULL);
220, 130, 200, 20, hWnd, NULL, (HINSTANCE) GetWindowLongPtr(hWnd, GWL_HINSTANCE),NULL);
hbtn[17] = CreateWindow(
"BUTTON","BS_AUTORADIOBUTTON|BS_TOP|BS_MULTILINE",WS_VISIBLE | WS_CHILD | BS_AUTORADIOBUTTON | BS_TOP| BS_MULTILINE,
480, 130, 200, 60, hWnd, NULL, (HINSTANCE) GetWindowLong(hWnd, GWL_HINSTANCE),NULL);
480, 130, 200, 60, hWnd, NULL, (HINSTANCE) GetWindowLongPtr(hWnd, GWL_HINSTANCE),NULL);
hbtn[18] = CreateWindow(
"BUTTON","BS_AUTOCHECKBOX|BS_BOTTOM|BS_MULTILINE",WS_VISIBLE | WS_CHILD | BS_AUTOCHECKBOX | BS_BOTTOM | BS_MULTILINE,
740, 130, 200, 60, hWnd, NULL, (HINSTANCE) GetWindowLong(hWnd, GWL_HINSTANCE),NULL);
740, 130, 200, 60, hWnd, NULL, (HINSTANCE) GetWindowLongPtr(hWnd, GWL_HINSTANCE),NULL);
hbtn[19] = CreateWindow(
"BUTTON","BS_AUTOCHECKBOX|BS_TOP|BS_MULTILINE",WS_VISIBLE | WS_CHILD | BS_AUTOCHECKBOX | BS_TOP | BS_MULTILINE,
480, 190, 200, 60, hWnd, NULL, (HINSTANCE) GetWindowLong(hWnd, GWL_HINSTANCE),NULL);
480, 190, 200, 60, hWnd, NULL, (HINSTANCE) GetWindowLongPtr(hWnd, GWL_HINSTANCE),NULL);
hbtn[20] = CreateWindow(
"BUTTON","BS_AUTOCHECKBOX|BS_LEFT|BS_MULTILINE",WS_VISIBLE | WS_CHILD | BS_AUTOCHECKBOX | BS_LEFT | BS_MULTILINE,
220, 230, 200, 60, hWnd, NULL, (HINSTANCE) GetWindowLong(hWnd, GWL_HINSTANCE),NULL);
220, 230, 200, 60, hWnd, NULL, (HINSTANCE) GetWindowLongPtr(hWnd, GWL_HINSTANCE),NULL);
hbtn[21] = CreateWindow(
"BUTTON","BS_AUTOCHECKBOX|BS_RIGHT|BS_MULTILINE",WS_VISIBLE | WS_CHILD | BS_AUTOCHECKBOX | BS_RIGHT | BS_MULTILINE,
480, 240, 200, 60, hWnd, NULL, (HINSTANCE) GetWindowLong(hWnd, GWL_HINSTANCE),NULL);
480, 240, 200, 60, hWnd, NULL, (HINSTANCE) GetWindowLongPtr(hWnd, GWL_HINSTANCE),NULL);
hbtn[22] = CreateWindow(
"BUTTON","BS_GROUPBOX|BS_TOP",WS_VISIBLE | WS_CHILD | BS_GROUPBOX | BS_TOP,
10, 340, 200, 60, hWnd, NULL, (HINSTANCE) GetWindowLong(hWnd, GWL_HINSTANCE),NULL);
10, 340, 200, 60, hWnd, NULL, (HINSTANCE) GetWindowLongPtr(hWnd, GWL_HINSTANCE),NULL);
hbtn[23] = CreateWindow(
"BUTTON","BS_GROUPBOX|BS_BOTTOM",WS_VISIBLE | WS_CHILD | BS_GROUPBOX | BS_BOTTOM,
10, 410, 200, 60, hWnd, NULL, (HINSTANCE) GetWindowLong(hWnd, GWL_HINSTANCE),NULL);
10, 410, 200, 60, hWnd, NULL, (HINSTANCE) GetWindowLongPtr(hWnd, GWL_HINSTANCE),NULL);
hbtn[24] = CreateWindow(
"BUTTON","BS_GROUPBOXBOX|BS_LEFT",WS_VISIBLE | WS_CHILD | BS_GROUPBOX | BS_LEFT,
520, 340, 200, 60, hWnd, NULL, (HINSTANCE) GetWindowLong(hWnd, GWL_HINSTANCE),NULL);
520, 340, 200, 60, hWnd, NULL, (HINSTANCE) GetWindowLongPtr(hWnd, GWL_HINSTANCE),NULL);
hbtn[25] = CreateWindow(
"BUTTON","BS_GROUPBOX|BS_RIGHT|BS_BOTTOM",WS_VISIBLE | WS_CHILD | BS_GROUPBOX | BS_BOTTOM | BS_RIGHT,
300, 340, 200, 60, hWnd, NULL, (HINSTANCE) GetWindowLong(hWnd, GWL_HINSTANCE),NULL);
300, 340, 200, 60, hWnd, NULL, (HINSTANCE) GetWindowLongPtr(hWnd, GWL_HINSTANCE),NULL);
while(GetMessage(&msg, NULL, 0, 0))
{

View file

@ -11,8 +11,8 @@
UINT Timer = 1;
static BOOL CALLBACK DialogFunc(HWND,UINT,WPARAM,LPARAM);
static VOID CALLBACK TimerProc(HWND,UINT,UINT,DWORD);
static INT_PTR CALLBACK DialogFunc(HWND,UINT,WPARAM,LPARAM);
static VOID CALLBACK TimerProc(HWND,UINT,UINT_PTR,DWORD);
INT WINAPI WinMain (HINSTANCE hinst, HINSTANCE hinstPrev, LPSTR lpCmdLine, INT nCmdShow)
@ -50,7 +50,7 @@ static INT_PTR CALLBACK DialogFunc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
}
return FALSE;
}
static VOID CALLBACK TimerProc (HWND hwnd, UINT uMsg, UINT idEvent, DWORD dwTime)
static VOID CALLBACK TimerProc (HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD dwTime)
{
CHAR text [20];
SYSTEMTIME lt;

View file

@ -282,7 +282,7 @@ CreateCheckButton(const char* lpWindowName, DWORD xSize, DWORD id)
xSize, /* nWidth */
20, /* nHeight */
g_hwnd,
(HMENU) id,
UlongToHandle(id),
g_hInst,
NULL
);
@ -302,7 +302,7 @@ CreatePushButton(const char* lpWindowName, DWORD xSize, DWORD id,DWORD Style)
xSize, /* nWidth */
20, /* nHeight */
g_hwnd,
(HMENU) id,
LongToHandle(id),
g_hInst,
NULL
);

View file

@ -277,7 +277,7 @@ CreateCheckButton(const char* lpWindowName, DWORD xSize, DWORD id)
xSize, /* nWidth */
20, /* nHeight */
g_hwnd,
(HMENU) id,
UlongToHandle(id),
g_hInst,
NULL
);
@ -297,7 +297,7 @@ CreatePushButton(const char* lpWindowName, DWORD xSize, DWORD id,DWORD Style)
xSize, // nWidth
20, // nHeight
g_hwnd,
(HMENU) id,
(HMENU)(ULONG_PTR) id,
g_hInst,
NULL
);

View file

@ -146,6 +146,13 @@ void OUTPUT_HexDword(DWORD dw)
OUTPUT_Line(buffer);
}
void OUTPUT_Handle(HANDLE h)
{
char buffer[32];
sprintf(buffer, "0x%p", h);
OUTPUT_Line(buffer);
}
/*---------------------------------------------------------------------------
**
*/
@ -412,9 +419,9 @@ TEST_STATUS TestGlobalReAllocFixed()
else
{
OUTPUT_Line("Alloced Handle: ");
OUTPUT_HexDword((DWORD)hMem);
OUTPUT_Handle(hMem);
OUTPUT_Line("ReAlloced Handle: ");
OUTPUT_HexDword((DWORD)hReAlloced);
OUTPUT_Handle(hReAlloced);
if (hMem == hReAlloced)
{
OUTPUT_Line("GlobalReAlloc returned the same pointer. The documentation states that this is wrong, but Windows NT works this way.");
@ -455,9 +462,9 @@ TEST_STATUS TestGlobalReAllocFixed()
else
{
OUTPUT_Line("Alloced Handle: ");
OUTPUT_HexDword((DWORD)hMem);
OUTPUT_Handle(hMem);
OUTPUT_Line("ReAlloced Handle: ");
OUTPUT_HexDword((DWORD)hReAlloced);
OUTPUT_Handle(hReAlloced);
if (hMem != hReAlloced)
{
OUTPUT_Line("GlobalReAlloc returned a different.");
@ -516,9 +523,9 @@ TEST_STATUS TestGlobalReAllocMovable()
else
{
OUTPUT_Line("Alloced Handle: ");
OUTPUT_HexDword((DWORD)hMem);
OUTPUT_Handle(hMem);
OUTPUT_Line("ReAlloced Handle: ");
OUTPUT_HexDword((DWORD)hReAlloced);
OUTPUT_Handle(hReAlloced);
pMem = GlobalLock(hReAlloced);
hMem = hReAlloced;
@ -559,9 +566,9 @@ TEST_STATUS TestGlobalReAllocMovable()
else
{
OUTPUT_Line("Alloced Handle: ");
OUTPUT_HexDword((DWORD)hMem);
OUTPUT_Handle(hMem);
OUTPUT_Line("ReAlloced Handle: ");
OUTPUT_HexDword((DWORD)hReAlloced);
OUTPUT_Handle(hReAlloced);
if (hMem != hReAlloced)
{
OUTPUT_Line("GlobalReAlloc returned a different block.");
@ -638,7 +645,7 @@ TEST_STATUS TestGlobalFlagsMoveable()
OUTPUT_Result(result);
OUTPUT_Line("Pointer from handle: ");
OUTPUT_HexDword((DWORD)GlobalLock(hMem));
OUTPUT_Handle(GlobalLock(hMem));
OUTPUT_Line("Testing after a lock");
OUTPUT_Line("Testing for a lock of 1");
@ -679,7 +686,7 @@ TEST_STATUS TestGlobalFlagsMoveable()
if (0 != hMem)
{
OUTPUT_Line("Allocation handle: ");
OUTPUT_HexDword((DWORD)hMem);
OUTPUT_Handle(hMem);
OUTPUT_Line("Testing for a discarded flag");
uFlags = GlobalFlags(hMem);
if (0 != (uFlags & GMEM_DISCARDED)) /*discarded*/
@ -720,7 +727,7 @@ TEST_STATUS TestGlobalFlagsFixed()
{
OUTPUT_Line("Allocation handle: ");
OUTPUT_HexDword((DWORD)hMem);
OUTPUT_Handle(hMem);
OUTPUT_Line("Testing initial allocation");
OUTPUT_Line("Testing for non-discarded and lock of 0");
@ -737,7 +744,7 @@ TEST_STATUS TestGlobalFlagsFixed()
OUTPUT_Result(result);
OUTPUT_Line("Pointer from handle: ");
OUTPUT_HexDword((DWORD)GlobalLock(hMem));
OUTPUT_Handle(GlobalLock(hMem));
OUTPUT_Line("Testing after a lock");
OUTPUT_Line("Testing for non-discarded and lock of 0");
uFlags = GlobalFlags(hMem);
@ -796,7 +803,7 @@ TEST_STATUS TestGlobalHandle()
{
OUTPUT_Line("Allocation handle: ");
OUTPUT_HexDword((DWORD)hMem);
OUTPUT_Handle(hMem);
hTest = GlobalHandle(hMem);
if (hMem == hTest)
@ -806,7 +813,7 @@ TEST_STATUS TestGlobalHandle()
else
{
OUTPUT_Line("GlobalHandle returned:");
OUTPUT_HexDword((DWORD)hTest);
OUTPUT_Handle(hTest);
subtest = TEST_CombineStatus(subtest, FAILED);
}
@ -830,7 +837,7 @@ TEST_STATUS TestGlobalHandle()
{
OUTPUT_Line("Allocation handle: ");
OUTPUT_HexDword((DWORD)hMem);
OUTPUT_Handle(hMem);
pMem = GlobalLock(hMem);
hTest = GlobalHandle(pMem);
if (hMem == hTest)
@ -840,7 +847,7 @@ TEST_STATUS TestGlobalHandle()
else
{
OUTPUT_Line("GlobalHandle returned:");
OUTPUT_HexDword((DWORD)hTest);
OUTPUT_Handle(hTest);
subtest = TEST_CombineStatus(subtest, FAILED);
}
@ -979,7 +986,7 @@ TEST_STATUS TestGlobalDiscard()
if (0 != hMem)
{
OUTPUT_Line("Allocation handle: ");
OUTPUT_HexDword((DWORD)hMem);
OUTPUT_Handle(hMem);
hTest = GlobalDiscard(hMem);
if (0 == hTest)

View file

@ -21,7 +21,7 @@ void HexDump(char *buffer, ULONG size)
while (offset < (size & ~15))
{
ptr = (unsigned char*)((ULONG)buffer + offset);
ptr = (unsigned char*)((ULONG_PTR)buffer + offset);
printf("%08lx %02hx %02hx %02hx %02hx %02hx %02hx %02hx %02hx-%02hx %02hx %02hx %02hx %02hx %02hx %02hx %02hx",
offset,
ptr[0],
@ -62,7 +62,7 @@ void HexDump(char *buffer, ULONG size)
offset += 16;
}
ptr = (unsigned char*)((ULONG)buffer + offset);
ptr = (unsigned char*)((ULONG_PTR)buffer + offset);
if (offset < size)
{
printf("%08lx ", offset);

View file

@ -17,7 +17,7 @@ int main( int argc, char **argv ) {
if( argc == 2 ) {
#ifdef WIN64
file_map = (void *)atoi64(argv[1]);
file_map = (void *)_atoi64(argv[1]);
#else
file_map = (void *)UlongToPtr(atoi(argv[1]));
#endif

View file

@ -160,7 +160,7 @@ HWND CreateNewMDIChild(HWND hMDIClient)
mcs.y = mcs.cy = CW_USEDEFAULT;
mcs.style = MDIS_ALLCHILDSTYLES;
hChild = (HWND)SendMessage(hMDIClient, WM_MDICREATE, 0, (LONG)&mcs);
hChild = (HWND)SendMessage(hMDIClient, WM_MDICREATE, 0, (LPARAM)&mcs);
if(!hChild)
{
MessageBox(hMDIClient, "MDI Child creation failed.", "Oh Oh...",

View file

@ -36,7 +36,7 @@ int main()
printf("Opening MIDI output #0\n");
Result = midiOutOpen(&Handle, 0, 0, 0, CALLBACK_NULL);
printf("Result == %d Handle == %d\n", Result, (int)Handle);
printf("Result == %d Handle == %p\n", Result, Handle);
// play something:
midiOutShortMsg(Handle, 0x007f3090);

View file

@ -157,7 +157,7 @@ LRESULT CALLBACK MultiWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
HDC hDC;
RECT Client;
HBRUSH Brush;
DWORD Ret;
DWORD_PTR Ret;
static COLORREF Colors[] =
{

View file

@ -15,7 +15,7 @@ int main( int argc, char **argv ) {
fprintf( stderr, "%lu: Starting\n", GetCurrentProcessId() );
if( argc == 2 ) {
h_process = (HANDLE)atoi(argv[1]);
h_process = (HANDLE)(ULONG_PTR)atoi(argv[1]);
} else {
if( !DuplicateHandle( GetCurrentProcess(),
GetCurrentProcess(),
@ -38,7 +38,7 @@ int main( int argc, char **argv ) {
memset( &si, 0, sizeof( si ) );
memset( &pi, 0, sizeof( pi ) );
sprintf( cmdline, "%s %lu", argv[0], (DWORD)h_process );
sprintf( cmdline, "%s %p", argv[0], h_process );
if( !CreateProcess(NULL, cmdline, NULL, NULL, TRUE, 0, NULL, NULL,
&si, &pi ) ) {
fprintf( stderr, "%lu: Could not create child process.\n",

View file

@ -122,7 +122,7 @@ void FormatBox(HWND hWnd, DWORD Flags, WCHAR *Caption, WCHAR *Format, ...)
LRESULT CALLBACK WndSubclassProc( HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
WND_DATA *data = (WND_DATA*)GetWindowLong(hwnd, GWL_USERDATA);
WND_DATA *data = (WND_DATA*)GetWindowLongPtr(hwnd, GWL_USERDATA);
if(uMsg == WM_INPUTLANGCHANGE)
{
@ -143,9 +143,9 @@ LRESULT CALLBACK WndSubclassProc( HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lP
void SubclassWnd(HWND hWnd, WCHAR* Name)
{
WND_DATA *data = HeapAlloc(GetProcessHeap(), 0, sizeof(WND_DATA));
data->OrigProc = (WNDPROC)SetWindowLong( hWnd, GWL_WNDPROC, (LONG)WndSubclassProc);
data->OrigProc = (WNDPROC)SetWindowLongPtr( hWnd, GWL_WNDPROC, (LONG_PTR)WndSubclassProc);
wcsncpy(data->WndName, Name, 25);
SetWindowLong(hWnd, GWL_USERDATA, (LONG)data);
SetWindowLongPtr(hWnd, GWL_USERDATA, (LONG_PTR)data);
return;
}