Fix building some modules. special thanks to Basil Gello.

svn path=/branches/ros-amd64-bringup/; revision=44462
This commit is contained in:
Samuel Serapion 2009-12-07 23:09:35 +00:00
parent 5fc07e5280
commit 0d2d36c7de
12 changed files with 38 additions and 36 deletions

View file

@ -48,7 +48,7 @@ VOID NtoskrnlIoMdlTest()
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);
@ -59,10 +59,10 @@ VOID NtoskrnlIoMdlTest()
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);
@ -72,7 +72,7 @@ VOID NtoskrnlIoMdlTest()
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

@ -139,7 +139,7 @@ void OUTPUT_Result(TEST_STATUS status)
/*---------------------------------------------------------------------------
**
*/
void OUTPUT_HexDword(DWORD dw)
void OUTPUT_HexDword(ULONG_PTR dw)
{
char buffer[32];
sprintf(buffer, "0x%lX",dw);
@ -412,9 +412,9 @@ TEST_STATUS TestGlobalReAllocFixed()
else
{
OUTPUT_Line("Alloced Handle: ");
OUTPUT_HexDword((DWORD)hMem);
OUTPUT_HexDword((ULONG_PTR)hMem);
OUTPUT_Line("ReAlloced Handle: ");
OUTPUT_HexDword((DWORD)hReAlloced);
OUTPUT_HexDword((ULONG_PTR)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 +455,9 @@ TEST_STATUS TestGlobalReAllocFixed()
else
{
OUTPUT_Line("Alloced Handle: ");
OUTPUT_HexDword((DWORD)hMem);
OUTPUT_HexDword((ULONG_PTR)hMem);
OUTPUT_Line("ReAlloced Handle: ");
OUTPUT_HexDword((DWORD)hReAlloced);
OUTPUT_HexDword((ULONG_PTR)hReAlloced);
if (hMem != hReAlloced)
{
OUTPUT_Line("GlobalReAlloc returned a different.");
@ -516,9 +516,9 @@ TEST_STATUS TestGlobalReAllocMovable()
else
{
OUTPUT_Line("Alloced Handle: ");
OUTPUT_HexDword((DWORD)hMem);
OUTPUT_HexDword((ULONG_PTR)hMem);
OUTPUT_Line("ReAlloced Handle: ");
OUTPUT_HexDword((DWORD)hReAlloced);
OUTPUT_HexDword((ULONG_PTR)hReAlloced);
pMem = GlobalLock(hReAlloced);
hMem = hReAlloced;
@ -559,9 +559,9 @@ TEST_STATUS TestGlobalReAllocMovable()
else
{
OUTPUT_Line("Alloced Handle: ");
OUTPUT_HexDword((DWORD)hMem);
OUTPUT_HexDword((ULONG_PTR)hMem);
OUTPUT_Line("ReAlloced Handle: ");
OUTPUT_HexDword((DWORD)hReAlloced);
OUTPUT_HexDword((ULONG_PTR)hReAlloced);
if (hMem != hReAlloced)
{
OUTPUT_Line("GlobalReAlloc returned a different block.");
@ -638,7 +638,7 @@ TEST_STATUS TestGlobalFlagsMoveable()
OUTPUT_Result(result);
OUTPUT_Line("Pointer from handle: ");
OUTPUT_HexDword((DWORD)GlobalLock(hMem));
OUTPUT_HexDword((ULONG_PTR)GlobalLock(hMem));
OUTPUT_Line("Testing after a lock");
OUTPUT_Line("Testing for a lock of 1");
@ -679,7 +679,7 @@ TEST_STATUS TestGlobalFlagsMoveable()
if (0 != hMem)
{
OUTPUT_Line("Allocation handle: ");
OUTPUT_HexDword((DWORD)hMem);
OUTPUT_HexDword((ULONG_PTR)hMem);
OUTPUT_Line("Testing for a discarded flag");
uFlags = GlobalFlags(hMem);
if (0 != (uFlags & GMEM_DISCARDED)) /*discarded*/
@ -720,7 +720,7 @@ TEST_STATUS TestGlobalFlagsFixed()
{
OUTPUT_Line("Allocation handle: ");
OUTPUT_HexDword((DWORD)hMem);
OUTPUT_HexDword((ULONG_PTR)hMem);
OUTPUT_Line("Testing initial allocation");
OUTPUT_Line("Testing for non-discarded and lock of 0");
@ -737,7 +737,7 @@ TEST_STATUS TestGlobalFlagsFixed()
OUTPUT_Result(result);
OUTPUT_Line("Pointer from handle: ");
OUTPUT_HexDword((DWORD)GlobalLock(hMem));
OUTPUT_HexDword((ULONG_PTR)GlobalLock(hMem));
OUTPUT_Line("Testing after a lock");
OUTPUT_Line("Testing for non-discarded and lock of 0");
uFlags = GlobalFlags(hMem);
@ -796,7 +796,7 @@ TEST_STATUS TestGlobalHandle()
{
OUTPUT_Line("Allocation handle: ");
OUTPUT_HexDword((DWORD)hMem);
OUTPUT_HexDword((ULONG_PTR)hMem);
hTest = GlobalHandle(hMem);
if (hMem == hTest)
@ -806,7 +806,7 @@ TEST_STATUS TestGlobalHandle()
else
{
OUTPUT_Line("GlobalHandle returned:");
OUTPUT_HexDword((DWORD)hTest);
OUTPUT_HexDword((ULONG_PTR)hTest);
subtest = TEST_CombineStatus(subtest, FAILED);
}
@ -830,7 +830,7 @@ TEST_STATUS TestGlobalHandle()
{
OUTPUT_Line("Allocation handle: ");
OUTPUT_HexDword((DWORD)hMem);
OUTPUT_HexDword((ULONG_PTR)hMem);
pMem = GlobalLock(hMem);
hTest = GlobalHandle(pMem);
if (hMem == hTest)
@ -840,7 +840,7 @@ TEST_STATUS TestGlobalHandle()
else
{
OUTPUT_Line("GlobalHandle returned:");
OUTPUT_HexDword((DWORD)hTest);
OUTPUT_HexDword((ULONG_PTR)hTest);
subtest = TEST_CombineStatus(subtest, FAILED);
}
@ -979,7 +979,7 @@ TEST_STATUS TestGlobalDiscard()
if (0 != hMem)
{
OUTPUT_Line("Allocation handle: ");
OUTPUT_HexDword((DWORD)hMem);
OUTPUT_HexDword((ULONG_PTR)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 == %x\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 %x", 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);
SetWindowLong(hWnd, GWL_USERDATA, (LONG_PTR)data);
return;
}

View file

@ -23,8 +23,10 @@
/* With Visual Studio >= 2005, swprintf() takes an extra parameter unless
* the following macro is defined.
*/
#ifdef _MSC_VER
#define _CRT_NON_CONFORMING_SWPRINTFS
#endif
#include <stdio.h>
#include "windef.h"