Commit c23de979 authored by Eric Pouech's avatar Eric Pouech Committed by Alexandre Julliard

ntoskrnl.exe: Enable compilation with long types.

parent 23bd3bc2
EXTRADEFS = -DWINE_NO_LONG_TYPES
MODULE = ntoskrnl.exe MODULE = ntoskrnl.exe
IMPORTLIB = ntoskrnl IMPORTLIB = ntoskrnl
IMPORTS = advapi32 hal msvcrt IMPORTS = advapi32 hal msvcrt
......
...@@ -353,7 +353,7 @@ static DWORD emulate_instruction( EXCEPTION_RECORD *rec, CONTEXT *context ) ...@@ -353,7 +353,7 @@ static DWORD emulate_instruction( EXCEPTION_RECORD *rec, CONTEXT *context )
{ {
int reg = (instr[2] >> 3) & 7; int reg = (instr[2] >> 3) & 7;
DWORD *data = get_reg_address( context, instr[2] ); DWORD *data = get_reg_address( context, instr[2] );
TRACE( "mov cr%u,%s at 0x%08x\n", reg, reg_names[instr[2] & 7], context->Eip ); TRACE( "mov cr%u,%s at 0x%08lx\n", reg, reg_names[instr[2] & 7], context->Eip );
switch (reg) switch (reg)
{ {
case 0: *data = CR0_PE|CR0_ET|CR0_NE|CR0_WP|CR0_AM|CR0_PG; break; case 0: *data = CR0_PE|CR0_ET|CR0_NE|CR0_WP|CR0_AM|CR0_PG; break;
...@@ -369,7 +369,7 @@ static DWORD emulate_instruction( EXCEPTION_RECORD *rec, CONTEXT *context ) ...@@ -369,7 +369,7 @@ static DWORD emulate_instruction( EXCEPTION_RECORD *rec, CONTEXT *context )
{ {
int reg = (instr[2] >> 3) & 7; int reg = (instr[2] >> 3) & 7;
DWORD *data = get_reg_address( context, instr[2] ); DWORD *data = get_reg_address( context, instr[2] );
TRACE( "mov dr%u,%s at 0x%08x\n", reg, reg_names[instr[2] & 7], context->Eip ); TRACE( "mov dr%u,%s at 0x%08lx\n", reg, reg_names[instr[2] & 7], context->Eip );
switch (reg) switch (reg)
{ {
case 0: *data = context->Dr0; break; case 0: *data = context->Dr0; break;
...@@ -387,7 +387,7 @@ static DWORD emulate_instruction( EXCEPTION_RECORD *rec, CONTEXT *context ) ...@@ -387,7 +387,7 @@ static DWORD emulate_instruction( EXCEPTION_RECORD *rec, CONTEXT *context )
{ {
int reg = (instr[2] >> 3) & 7; int reg = (instr[2] >> 3) & 7;
DWORD *data = get_reg_address( context, instr[2] ); DWORD *data = get_reg_address( context, instr[2] );
TRACE( "mov %s,cr%u at 0x%08x, %s=%08x\n", reg_names[instr[2] & 7], TRACE( "mov %s,cr%u at 0x%08lx, %s=%08lx\n", reg_names[instr[2] & 7],
reg, context->Eip, reg_names[instr[2] & 7], *data ); reg, context->Eip, reg_names[instr[2] & 7], *data );
switch (reg) switch (reg)
{ {
...@@ -404,7 +404,7 @@ static DWORD emulate_instruction( EXCEPTION_RECORD *rec, CONTEXT *context ) ...@@ -404,7 +404,7 @@ static DWORD emulate_instruction( EXCEPTION_RECORD *rec, CONTEXT *context )
{ {
int reg = (instr[2] >> 3) & 7; int reg = (instr[2] >> 3) & 7;
DWORD *data = get_reg_address( context, instr[2] ); DWORD *data = get_reg_address( context, instr[2] );
TRACE( "mov %s,dr%u at 0x%08x %s=%08x\n", reg_names[instr[2] & 7], TRACE( "mov %s,dr%u at 0x%08lx %s=%08lx\n", reg_names[instr[2] & 7],
reg, context->Eip, reg_names[instr[2] & 7], *data ); reg, context->Eip, reg_names[instr[2] & 7], *data );
switch (reg) switch (reg)
{ {
...@@ -735,7 +735,7 @@ static DWORD emulate_instruction( EXCEPTION_RECORD *rec, CONTEXT *context ) ...@@ -735,7 +735,7 @@ static DWORD emulate_instruction( EXCEPTION_RECORD *rec, CONTEXT *context )
int reg = REGMODRM_REG( instr[2], rex ); int reg = REGMODRM_REG( instr[2], rex );
int rm = REGMODRM_RM( instr[2], rex ); int rm = REGMODRM_RM( instr[2], rex );
DWORD64 *data = get_int_reg( context, rm ); DWORD64 *data = get_int_reg( context, rm );
TRACE( "mov cr%u,%s at %lx\n", reg, reg_names[rm], context->Rip ); TRACE( "mov cr%u,%s at %Ix\n", reg, reg_names[rm], context->Rip );
switch (reg) switch (reg)
{ {
case 0: *data = 0x10; break; /* FIXME: set more bits ? */ case 0: *data = 0x10; break; /* FIXME: set more bits ? */
...@@ -753,7 +753,7 @@ static DWORD emulate_instruction( EXCEPTION_RECORD *rec, CONTEXT *context ) ...@@ -753,7 +753,7 @@ static DWORD emulate_instruction( EXCEPTION_RECORD *rec, CONTEXT *context )
int reg = REGMODRM_REG( instr[2], rex ); int reg = REGMODRM_REG( instr[2], rex );
int rm = REGMODRM_RM( instr[2], rex ); int rm = REGMODRM_RM( instr[2], rex );
DWORD64 *data = get_int_reg( context, rm ); DWORD64 *data = get_int_reg( context, rm );
TRACE( "mov dr%u,%s at %lx\n", reg, reg_names[rm], context->Rip ); TRACE( "mov dr%u,%s at %Ix\n", reg, reg_names[rm], context->Rip );
switch (reg) switch (reg)
{ {
case 0: *data = context->Dr0; break; case 0: *data = context->Dr0; break;
...@@ -774,7 +774,7 @@ static DWORD emulate_instruction( EXCEPTION_RECORD *rec, CONTEXT *context ) ...@@ -774,7 +774,7 @@ static DWORD emulate_instruction( EXCEPTION_RECORD *rec, CONTEXT *context )
int reg = REGMODRM_REG( instr[2], rex ); int reg = REGMODRM_REG( instr[2], rex );
int rm = REGMODRM_RM( instr[2], rex ); int rm = REGMODRM_RM( instr[2], rex );
DWORD64 *data = get_int_reg( context, rm ); DWORD64 *data = get_int_reg( context, rm );
TRACE( "mov %s,cr%u at %lx, %s=%lx\n", reg_names[rm], reg, context->Rip, reg_names[rm], *data ); TRACE( "mov %s,cr%u at %Ix, %s=%Ix\n", reg_names[rm], reg, context->Rip, reg_names[rm], *data );
switch (reg) switch (reg)
{ {
case 0: break; case 0: break;
...@@ -792,7 +792,7 @@ static DWORD emulate_instruction( EXCEPTION_RECORD *rec, CONTEXT *context ) ...@@ -792,7 +792,7 @@ static DWORD emulate_instruction( EXCEPTION_RECORD *rec, CONTEXT *context )
int reg = REGMODRM_REG( instr[2], rex ); int reg = REGMODRM_REG( instr[2], rex );
int rm = REGMODRM_RM( instr[2], rex ); int rm = REGMODRM_RM( instr[2], rex );
DWORD64 *data = get_int_reg( context, rm ); DWORD64 *data = get_int_reg( context, rm );
TRACE( "mov %s,dr%u at %lx, %s=%lx\n", reg_names[rm], reg, context->Rip, reg_names[rm], *data ); TRACE( "mov %s,dr%u at %Ix, %s=%Ix\n", reg_names[rm], reg, context->Rip, reg_names[rm], *data );
switch (reg) switch (reg)
{ {
case 0: context->Dr0 = *data; break; case 0: context->Dr0 = *data; break;
...@@ -811,7 +811,7 @@ static DWORD emulate_instruction( EXCEPTION_RECORD *rec, CONTEXT *context ) ...@@ -811,7 +811,7 @@ static DWORD emulate_instruction( EXCEPTION_RECORD *rec, CONTEXT *context )
case 0x32: /* rdmsr */ case 0x32: /* rdmsr */
{ {
ULONG reg = context->Rcx; ULONG reg = context->Rcx;
TRACE("rdmsr CR 0x%08x\n", reg); TRACE("rdmsr CR 0x%08lx\n", reg);
switch (reg) switch (reg)
{ {
case MSR_LSTAR: case MSR_LSTAR:
...@@ -822,7 +822,7 @@ static DWORD emulate_instruction( EXCEPTION_RECORD *rec, CONTEXT *context ) ...@@ -822,7 +822,7 @@ static DWORD emulate_instruction( EXCEPTION_RECORD *rec, CONTEXT *context )
break; break;
} }
default: default:
FIXME("reg %#x, returning 0.\n", reg); FIXME("reg %#lx, returning 0.\n", reg);
context->Rdx = 0; context->Rdx = 0;
context->Rax = 0; context->Rax = 0;
break; break;
...@@ -935,14 +935,14 @@ LONG CALLBACK vectored_handler( EXCEPTION_POINTERS *ptrs ) ...@@ -935,14 +935,14 @@ LONG CALLBACK vectored_handler( EXCEPTION_POINTERS *ptrs )
{ {
if (emulate_instruction( record, context ) == ExceptionContinueExecution) if (emulate_instruction( record, context ) == ExceptionContinueExecution)
{ {
TRACE( "next instruction rip=%lx\n", context->Rip ); TRACE( "next instruction rip=%Ix\n", context->Rip );
TRACE( " rax=%016lx rbx=%016lx rcx=%016lx rdx=%016lx\n", TRACE( " rax=%016Ix rbx=%016Ix rcx=%016Ix rdx=%016Ix\n",
context->Rax, context->Rbx, context->Rcx, context->Rdx ); context->Rax, context->Rbx, context->Rcx, context->Rdx );
TRACE( " rsi=%016lx rdi=%016lx rbp=%016lx rsp=%016lx\n", TRACE( " rsi=%016Ix rdi=%016Ix rbp=%016Ix rsp=%016Ix\n",
context->Rsi, context->Rdi, context->Rbp, context->Rsp ); context->Rsi, context->Rdi, context->Rbp, context->Rsp );
TRACE( " r8=%016lx r9=%016lx r10=%016lx r11=%016lx\n", TRACE( " r8=%016Ix r9=%016Ix r10=%016Ix r11=%016Ix\n",
context->R8, context->R9, context->R10, context->R11 ); context->R8, context->R9, context->R10, context->R11 );
TRACE( " r12=%016lx r13=%016lx r14=%016lx r15=%016lx\n", TRACE( " r12=%016Ix r13=%016Ix r14=%016Ix r15=%016Ix\n",
context->R12, context->R13, context->R14, context->R15 ); context->R12, context->R13, context->R14, context->R15 );
return EXCEPTION_CONTINUE_EXECUTION; return EXCEPTION_CONTINUE_EXECUTION;
......
...@@ -52,7 +52,7 @@ NTSTATUS WINAPI KeWaitForMultipleObjects(ULONG count, void *pobjs[], ...@@ -52,7 +52,7 @@ NTSTATUS WINAPI KeWaitForMultipleObjects(ULONG count, void *pobjs[],
NTSTATUS ret; NTSTATUS ret;
ULONG i; ULONG i;
TRACE("count %u, objs %p, wait_type %u, reason %u, mode %d, alertable %u, timeout %p, wait_blocks %p.\n", TRACE("count %lu, objs %p, wait_type %u, reason %u, mode %d, alertable %u, timeout %p, wait_blocks %p.\n",
count, objs, wait_type, reason, mode, alertable, timeout, wait_blocks); count, objs, wait_type, reason, mode, alertable, timeout, wait_blocks);
/* We co-opt DISPATCHER_HEADER.WaitListHead: /* We co-opt DISPATCHER_HEADER.WaitListHead:
...@@ -239,7 +239,7 @@ LONG WINAPI KeSetEvent( PRKEVENT event, KPRIORITY increment, BOOLEAN wait ) ...@@ -239,7 +239,7 @@ LONG WINAPI KeSetEvent( PRKEVENT event, KPRIORITY increment, BOOLEAN wait )
HANDLE handle; HANDLE handle;
LONG ret = 0; LONG ret = 0;
TRACE("event %p, increment %d, wait %u.\n", event, increment, wait); TRACE("event %p, increment %ld, wait %u.\n", event, increment, wait);
if (event->Header.WaitListHead.Blink != INVALID_HANDLE_VALUE) if (event->Header.WaitListHead.Blink != INVALID_HANDLE_VALUE)
{ {
...@@ -328,7 +328,7 @@ LONG WINAPI KeReadStateEvent( PRKEVENT event ) ...@@ -328,7 +328,7 @@ LONG WINAPI KeReadStateEvent( PRKEVENT event )
*/ */
void WINAPI KeInitializeSemaphore( PRKSEMAPHORE semaphore, LONG count, LONG limit ) void WINAPI KeInitializeSemaphore( PRKSEMAPHORE semaphore, LONG count, LONG limit )
{ {
TRACE("semaphore %p, count %d, limit %d.\n", semaphore, count, limit); TRACE("semaphore %p, count %ld, limit %ld.\n", semaphore, count, limit);
semaphore->Header.Type = TYPE_SEMAPHORE; semaphore->Header.Type = TYPE_SEMAPHORE;
semaphore->Header.SignalState = count; semaphore->Header.SignalState = count;
...@@ -346,7 +346,7 @@ LONG WINAPI KeReleaseSemaphore( PRKSEMAPHORE semaphore, KPRIORITY increment, ...@@ -346,7 +346,7 @@ LONG WINAPI KeReleaseSemaphore( PRKSEMAPHORE semaphore, KPRIORITY increment,
HANDLE handle; HANDLE handle;
LONG ret; LONG ret;
TRACE("semaphore %p, increment %d, count %d, wait %u.\n", TRACE("semaphore %p, increment %ld, count %ld, wait %u.\n",
semaphore, increment, count, wait); semaphore, increment, count, wait);
EnterCriticalSection( &sync_cs ); EnterCriticalSection( &sync_cs );
...@@ -372,7 +372,7 @@ POBJECT_TYPE ExSemaphoreObjectType = &semaphore_type; ...@@ -372,7 +372,7 @@ POBJECT_TYPE ExSemaphoreObjectType = &semaphore_type;
*/ */
void WINAPI KeInitializeMutex( PRKMUTEX mutex, ULONG level ) void WINAPI KeInitializeMutex( PRKMUTEX mutex, ULONG level )
{ {
TRACE("mutex %p, level %u.\n", mutex, level); TRACE("mutex %p, level %lu.\n", mutex, level);
mutex->Header.Type = TYPE_MUTEX; mutex->Header.Type = TYPE_MUTEX;
mutex->Header.SignalState = 1; mutex->Header.SignalState = 1;
...@@ -450,7 +450,7 @@ BOOLEAN WINAPI KeSetTimerEx( KTIMER *timer, LARGE_INTEGER duetime, LONG period, ...@@ -450,7 +450,7 @@ BOOLEAN WINAPI KeSetTimerEx( KTIMER *timer, LARGE_INTEGER duetime, LONG period,
{ {
BOOL ret; BOOL ret;
TRACE("timer %p, duetime %s, period %d, dpc %p.\n", TRACE("timer %p, duetime %s, period %ld, dpc %p.\n",
timer, wine_dbgstr_longlong(duetime.QuadPart), period, dpc); timer, wine_dbgstr_longlong(duetime.QuadPart), period, dpc);
EnterCriticalSection( &sync_cs ); EnterCriticalSection( &sync_cs );
...@@ -1150,7 +1150,7 @@ void WINAPI ExReleaseResourceForThreadLite( ERESOURCE *resource, ERESOURCE_THREA ...@@ -1150,7 +1150,7 @@ void WINAPI ExReleaseResourceForThreadLite( ERESOURCE *resource, ERESOURCE_THREA
OWNER_ENTRY *entry; OWNER_ENTRY *entry;
KIRQL irql; KIRQL irql;
TRACE("resource %p, thread %#lx.\n", resource, thread); TRACE("resource %p, thread %#Ix.\n", resource, thread);
KeAcquireSpinLock( &resource->SpinLock, &irql ); KeAcquireSpinLock( &resource->SpinLock, &irql );
...@@ -1166,7 +1166,7 @@ void WINAPI ExReleaseResourceForThreadLite( ERESOURCE *resource, ERESOURCE_THREA ...@@ -1166,7 +1166,7 @@ void WINAPI ExReleaseResourceForThreadLite( ERESOURCE *resource, ERESOURCE_THREA
} }
else else
{ {
ERR("Trying to release %p for thread %#lx, but resource is exclusively owned by %#lx.\n", ERR("Trying to release %p for thread %#Ix, but resource is exclusively owned by %#Ix.\n",
resource, thread, resource->OwnerEntry.OwnerThread); resource, thread, resource->OwnerEntry.OwnerThread);
return; return;
} }
...@@ -1181,7 +1181,7 @@ void WINAPI ExReleaseResourceForThreadLite( ERESOURCE *resource, ERESOURCE_THREA ...@@ -1181,7 +1181,7 @@ void WINAPI ExReleaseResourceForThreadLite( ERESOURCE *resource, ERESOURCE_THREA
} }
else else
{ {
ERR("Trying to release %p for thread %#lx, but resource is not owned by that thread.\n", resource, thread); ERR("Trying to release %p for thread %#Ix, but resource is not owned by that thread.\n", resource, thread);
return; return;
} }
} }
...@@ -1299,7 +1299,7 @@ ULONG WINAPI ExIsResourceAcquiredSharedLite( ERESOURCE *resource ) ...@@ -1299,7 +1299,7 @@ ULONG WINAPI ExIsResourceAcquiredSharedLite( ERESOURCE *resource )
void WINAPI IoInitializeRemoveLockEx( IO_REMOVE_LOCK *lock, ULONG tag, void WINAPI IoInitializeRemoveLockEx( IO_REMOVE_LOCK *lock, ULONG tag,
ULONG max_minutes, ULONG max_count, ULONG size ) ULONG max_minutes, ULONG max_count, ULONG size )
{ {
TRACE("lock %p, tag %#x, max_minutes %u, max_count %u, size %u.\n", TRACE("lock %p, tag %#lx, max_minutes %lu, max_count %lu, size %lu.\n",
lock, tag, max_minutes, max_count, size); lock, tag, max_minutes, max_count, size);
KeInitializeEvent( &lock->Common.RemoveEvent, NotificationEvent, FALSE ); KeInitializeEvent( &lock->Common.RemoveEvent, NotificationEvent, FALSE );
...@@ -1313,7 +1313,7 @@ void WINAPI IoInitializeRemoveLockEx( IO_REMOVE_LOCK *lock, ULONG tag, ...@@ -1313,7 +1313,7 @@ void WINAPI IoInitializeRemoveLockEx( IO_REMOVE_LOCK *lock, ULONG tag,
NTSTATUS WINAPI IoAcquireRemoveLockEx( IO_REMOVE_LOCK *lock, void *tag, NTSTATUS WINAPI IoAcquireRemoveLockEx( IO_REMOVE_LOCK *lock, void *tag,
const char *file, ULONG line, ULONG size ) const char *file, ULONG line, ULONG size )
{ {
TRACE("lock %p, tag %p, file %s, line %u, size %u.\n", lock, tag, debugstr_a(file), line, size); TRACE("lock %p, tag %p, file %s, line %lu, size %lu.\n", lock, tag, debugstr_a(file), line, size);
if (lock->Common.Removed) if (lock->Common.Removed)
return STATUS_DELETE_PENDING; return STATUS_DELETE_PENDING;
...@@ -1329,7 +1329,7 @@ void WINAPI IoReleaseRemoveLockEx( IO_REMOVE_LOCK *lock, void *tag, ULONG size ) ...@@ -1329,7 +1329,7 @@ void WINAPI IoReleaseRemoveLockEx( IO_REMOVE_LOCK *lock, void *tag, ULONG size )
{ {
LONG count; LONG count;
TRACE("lock %p, tag %p, size %u.\n", lock, tag, size); TRACE("lock %p, tag %p, size %lu.\n", lock, tag, size);
if (!(count = InterlockedDecrement( &lock->Common.IoCount )) && lock->Common.Removed) if (!(count = InterlockedDecrement( &lock->Common.IoCount )) && lock->Common.Removed)
KeSetEvent( &lock->Common.RemoveEvent, IO_NO_INCREMENT, FALSE ); KeSetEvent( &lock->Common.RemoveEvent, IO_NO_INCREMENT, FALSE );
...@@ -1344,7 +1344,7 @@ void WINAPI IoReleaseRemoveLockAndWaitEx( IO_REMOVE_LOCK *lock, void *tag, ULONG ...@@ -1344,7 +1344,7 @@ void WINAPI IoReleaseRemoveLockAndWaitEx( IO_REMOVE_LOCK *lock, void *tag, ULONG
{ {
LONG count; LONG count;
TRACE("lock %p, tag %p, size %u.\n", lock, tag, size); TRACE("lock %p, tag %p, size %lu.\n", lock, tag, size);
lock->Common.Removed = TRUE; lock->Common.Removed = TRUE;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment