ntdll: Fix compilation warnings in 64-bit mode.

This commit is contained in:
Dmitry Timoshkov 2007-05-23 16:36:29 +09:00 committed by Alexandre Julliard
parent 4d0d9fcb69
commit e142779b09
12 changed files with 53 additions and 55 deletions

View file

@ -398,12 +398,12 @@ NTSTATUS WINAPI RtlpWaitForCriticalSection( RTL_CRITICAL_SECTION *crit )
if (crit->DebugInfo) name = (char *)crit->DebugInfo->Spare[0]; if (crit->DebugInfo) name = (char *)crit->DebugInfo->Spare[0];
if (!name) name = "?"; if (!name) name = "?";
ERR( "section %p %s wait timed out in thread %04x, blocked by %04x, retrying (60 sec)\n", ERR( "section %p %s wait timed out in thread %04x, blocked by %04x, retrying (60 sec)\n",
crit, debugstr_a(name), GetCurrentThreadId(), (DWORD)crit->OwningThread ); crit, debugstr_a(name), GetCurrentThreadId(), HandleToULong(crit->OwningThread) );
status = wait_semaphore( crit, 60 ); status = wait_semaphore( crit, 60 );
if ( status == STATUS_TIMEOUT && TRACE_ON(relay) ) if ( status == STATUS_TIMEOUT && TRACE_ON(relay) )
{ {
ERR( "section %p %s wait timed out in thread %04x, blocked by %04x, retrying (5 min)\n", ERR( "section %p %s wait timed out in thread %04x, blocked by %04x, retrying (5 min)\n",
crit, debugstr_a(name), GetCurrentThreadId(), (DWORD) crit->OwningThread ); crit, debugstr_a(name), GetCurrentThreadId(), HandleToULong(crit->OwningThread) );
status = wait_semaphore( crit, 300 ); status = wait_semaphore( crit, 300 );
} }
} }
@ -498,7 +498,7 @@ NTSTATUS WINAPI RtlEnterCriticalSection( RTL_CRITICAL_SECTION *crit )
if (interlocked_inc( &crit->LockCount )) if (interlocked_inc( &crit->LockCount ))
{ {
if (crit->OwningThread == (HANDLE)GetCurrentThreadId()) if (crit->OwningThread == ULongToHandle(GetCurrentThreadId()))
{ {
crit->RecursionCount++; crit->RecursionCount++;
return STATUS_SUCCESS; return STATUS_SUCCESS;
@ -508,7 +508,7 @@ NTSTATUS WINAPI RtlEnterCriticalSection( RTL_CRITICAL_SECTION *crit )
RtlpWaitForCriticalSection( crit ); RtlpWaitForCriticalSection( crit );
} }
done: done:
crit->OwningThread = (HANDLE)GetCurrentThreadId(); crit->OwningThread = ULongToHandle(GetCurrentThreadId());
crit->RecursionCount = 1; crit->RecursionCount = 1;
return STATUS_SUCCESS; return STATUS_SUCCESS;
} }
@ -536,11 +536,11 @@ BOOL WINAPI RtlTryEnterCriticalSection( RTL_CRITICAL_SECTION *crit )
BOOL ret = FALSE; BOOL ret = FALSE;
if (interlocked_cmpxchg( (int *)&crit->LockCount, 0, -1 ) == -1) if (interlocked_cmpxchg( (int *)&crit->LockCount, 0, -1 ) == -1)
{ {
crit->OwningThread = (HANDLE)GetCurrentThreadId(); crit->OwningThread = ULongToHandle(GetCurrentThreadId());
crit->RecursionCount = 1; crit->RecursionCount = 1;
ret = TRUE; ret = TRUE;
} }
else if (crit->OwningThread == (HANDLE)GetCurrentThreadId()) else if (crit->OwningThread == ULongToHandle(GetCurrentThreadId()))
{ {
interlocked_inc( &crit->LockCount ); interlocked_inc( &crit->LockCount );
crit->RecursionCount++; crit->RecursionCount++;

View file

@ -90,7 +90,7 @@ typedef struct tagARENA_FREE
#define HEAP_MIN_SHRINK_SIZE (HEAP_MIN_DATA_SIZE+sizeof(ARENA_FREE)) #define HEAP_MIN_SHRINK_SIZE (HEAP_MIN_DATA_SIZE+sizeof(ARENA_FREE))
/* Max size of the blocks on the free lists */ /* Max size of the blocks on the free lists */
static const DWORD HEAP_freeListSizes[] = static const SIZE_T HEAP_freeListSizes[] =
{ {
0x10, 0x20, 0x30, 0x40, 0x60, 0x80, 0x100, 0x200, 0x400, 0x1000, ~0UL 0x10, 0x20, 0x30, 0x40, 0x60, 0x80, 0x100, 0x200, 0x400, 0x1000, ~0UL
}; };
@ -236,7 +236,7 @@ static void HEAP_Dump( HEAP *heap )
DPRINTF( "\nFree lists:\n Block Stat Size Id\n" ); DPRINTF( "\nFree lists:\n Block Stat Size Id\n" );
for (i = 0; i < HEAP_NB_FREE_LISTS; i++) for (i = 0; i < HEAP_NB_FREE_LISTS; i++)
DPRINTF( "%p free %08x prev=%p next=%p\n", DPRINTF( "%p free %08lx prev=%p next=%p\n",
&heap->freeList[i].arena, HEAP_freeListSizes[i], &heap->freeList[i].arena, HEAP_freeListSizes[i],
LIST_ENTRY( heap->freeList[i].arena.entry.prev, ARENA_FREE, entry ), LIST_ENTRY( heap->freeList[i].arena.entry.prev, ARENA_FREE, entry ),
LIST_ENTRY( heap->freeList[i].arena.entry.next, ARENA_FREE, entry )); LIST_ENTRY( heap->freeList[i].arena.entry.next, ARENA_FREE, entry ));

View file

@ -516,7 +516,7 @@ static WINE_MODREF *import_dll( HMODULE module, const IMAGE_IMPORT_DESCRIPTOR *d
{ {
int ordinal = IMAGE_ORDINAL(import_list->u1.Ordinal); int ordinal = IMAGE_ORDINAL(import_list->u1.Ordinal);
WARN("No implementation for %s.%d", name, ordinal ); WARN("No implementation for %s.%d", name, ordinal );
thunk_list->u1.Function = allocate_stub( name, (const char *)ordinal ); thunk_list->u1.Function = allocate_stub( name, IntToPtr(ordinal) );
} }
else else
{ {
@ -543,7 +543,7 @@ static WINE_MODREF *import_dll( HMODULE module, const IMAGE_IMPORT_DESCRIPTOR *d
ordinal - exports->Base ); ordinal - exports->Base );
if (!thunk_list->u1.Function) if (!thunk_list->u1.Function)
{ {
thunk_list->u1.Function = allocate_stub( name, (const char *)ordinal ); thunk_list->u1.Function = allocate_stub( name, IntToPtr(ordinal) );
WARN("No implementation for %s.%d imported from %s, setting to %p\n", WARN("No implementation for %s.%d imported from %s, setting to %p\n",
name, ordinal, debugstr_w(current_modref->ldr.FullDllName.Buffer), name, ordinal, debugstr_w(current_modref->ldr.FullDllName.Buffer),
(void *)thunk_list->u1.Function ); (void *)thunk_list->u1.Function );

View file

@ -80,8 +80,8 @@ extern UNICODE_STRING system_dir;
/* redefine these to make sure we don't reference kernel symbols */ /* redefine these to make sure we don't reference kernel symbols */
#define GetProcessHeap() (NtCurrentTeb()->Peb->ProcessHeap) #define GetProcessHeap() (NtCurrentTeb()->Peb->ProcessHeap)
#define GetCurrentProcessId() ((DWORD)NtCurrentTeb()->ClientId.UniqueProcess) #define GetCurrentProcessId() (HandleToULong(NtCurrentTeb()->ClientId.UniqueProcess))
#define GetCurrentThreadId() ((DWORD)NtCurrentTeb()->ClientId.UniqueThread) #define GetCurrentThreadId() (HandleToULong(NtCurrentTeb()->ClientId.UniqueThread))
/* Device IO */ /* Device IO */
extern NTSTATUS CDROM_DeviceIoControl(HANDLE hDevice, extern NTSTATUS CDROM_DeviceIoControl(HANDLE hDevice,

View file

@ -386,7 +386,7 @@ NTSTATUS WINAPI NtOpenProcess(PHANDLE handle, ACCESS_MASK access,
SERVER_START_REQ( open_process ) SERVER_START_REQ( open_process )
{ {
req->pid = (process_id_t)cid->UniqueProcess; req->pid = HandleToULong(cid->UniqueProcess);
req->access = access; req->access = access;
req->attributes = attr ? attr->Attributes : 0; req->attributes = attr ? attr->Attributes : 0;
status = wine_server_call( req ); status = wine_server_call( req );

View file

@ -1148,7 +1148,7 @@ NTSTATUS WINAPI RtlQueryRegistryValues(IN ULONG RelativeTo, IN PCWSTR Path,
if (QueryTable->Flags & RTL_QUERY_REGISTRY_SUBKEY) if (QueryTable->Flags & RTL_QUERY_REGISTRY_SUBKEY)
{ {
handle = 0; handle = 0;
status = RTL_GetKeyHandle((ULONG)QueryTable->Name, Path, &handle); status = RTL_GetKeyHandle(PtrToUlong(QueryTable->Name), Path, &handle);
if(status != STATUS_SUCCESS) if(status != STATUS_SUCCESS)
{ {
ret = status; ret = status;

View file

@ -164,7 +164,7 @@ start:
} }
else if( rwl->iNumberActive < 0 ) /* exclusive lock in progress */ else if( rwl->iNumberActive < 0 ) /* exclusive lock in progress */
{ {
if( rwl->hOwningThreadId == (HANDLE)GetCurrentThreadId() ) if( rwl->hOwningThreadId == ULongToHandle(GetCurrentThreadId()) )
{ {
retVal = 1; retVal = 1;
rwl->iNumberActive--; rwl->iNumberActive--;
@ -189,7 +189,7 @@ wait:
goto wait; goto wait;
if( retVal == 1 ) if( retVal == 1 )
rwl->hOwningThreadId = (HANDLE)GetCurrentThreadId(); rwl->hOwningThreadId = ULongToHandle(GetCurrentThreadId());
done: done:
RtlLeaveCriticalSection( &rwl->rtlCS ); RtlLeaveCriticalSection( &rwl->rtlCS );
return retVal; return retVal;
@ -208,7 +208,7 @@ start:
RtlEnterCriticalSection( &rwl->rtlCS ); RtlEnterCriticalSection( &rwl->rtlCS );
if( rwl->iNumberActive < 0 ) if( rwl->iNumberActive < 0 )
{ {
if( rwl->hOwningThreadId == (HANDLE)GetCurrentThreadId() ) if( rwl->hOwningThreadId == ULongToHandle(GetCurrentThreadId()) )
{ {
rwl->iNumberActive--; rwl->iNumberActive--;
retVal = 1; retVal = 1;
@ -945,7 +945,7 @@ WORD WINAPI RtlQueryDepthSList(PSLIST_HEADER ListHeader)
TRACE("(%p)\n", ListHeader); TRACE("(%p)\n", ListHeader);
#ifdef _WIN64 #ifdef _WIN64
FIXME("stub\n"); FIXME("stub\n");
return NULL; return 0;
#else #else
return ListHeader->s.Depth; return ListHeader->s.Depth;
#endif #endif

View file

@ -460,7 +460,7 @@ NTSTATUS WINAPI RtlCopySecurityDescriptor(PSECURITY_DESCRIPTOR pSourceSD, PSECUR
if (isSelfRelative) if (isSelfRelative)
{ {
destSD->Owner = srcSD->Owner; destSD->Owner = srcSD->Owner;
RtlCopySid(length, (LPBYTE)destSD + (DWORD)destSD->Owner, Owner); RtlCopySid(length, (LPBYTE)destSD + (DWORD_PTR)destSD->Owner, Owner);
} }
else else
{ {
@ -475,7 +475,7 @@ NTSTATUS WINAPI RtlCopySecurityDescriptor(PSECURITY_DESCRIPTOR pSourceSD, PSECUR
if (isSelfRelative) if (isSelfRelative)
{ {
destSD->Group = srcSD->Group; destSD->Group = srcSD->Group;
RtlCopySid(length, (LPBYTE)destSD + (DWORD)destSD->Group, Group); RtlCopySid(length, (LPBYTE)destSD + (DWORD_PTR)destSD->Group, Group);
} }
else else
{ {
@ -492,7 +492,7 @@ NTSTATUS WINAPI RtlCopySecurityDescriptor(PSECURITY_DESCRIPTOR pSourceSD, PSECUR
if (isSelfRelative) if (isSelfRelative)
{ {
destSD->Dacl = srcSD->Dacl; destSD->Dacl = srcSD->Dacl;
copy_acl(length, (PACL)((LPBYTE)destSD + (DWORD)destSD->Dacl), Dacl); copy_acl(length, (PACL)((LPBYTE)destSD + (DWORD_PTR)destSD->Dacl), Dacl);
} }
else else
{ {
@ -510,7 +510,7 @@ NTSTATUS WINAPI RtlCopySecurityDescriptor(PSECURITY_DESCRIPTOR pSourceSD, PSECUR
if (isSelfRelative) if (isSelfRelative)
{ {
destSD->Sacl = srcSD->Sacl; destSD->Sacl = srcSD->Sacl;
copy_acl(length, (PACL)((LPBYTE)destSD + (DWORD)destSD->Sacl), Sacl); copy_acl(length, (PACL)((LPBYTE)destSD + (DWORD_PTR)destSD->Sacl), Sacl);
} }
else else
{ {
@ -552,14 +552,14 @@ ULONG WINAPI RtlLengthSecurityDescriptor(
PSECURITY_DESCRIPTOR pSecurityDescriptor) PSECURITY_DESCRIPTOR pSecurityDescriptor)
{ {
SECURITY_DESCRIPTOR* lpsd=pSecurityDescriptor; SECURITY_DESCRIPTOR* lpsd=pSecurityDescriptor;
ULONG offset = 0; ULONG_PTR offset = 0;
ULONG Size = SECURITY_DESCRIPTOR_MIN_LENGTH; ULONG Size = SECURITY_DESCRIPTOR_MIN_LENGTH;
if ( lpsd == NULL ) if ( lpsd == NULL )
return 0; return 0;
if ( lpsd->Control & SE_SELF_RELATIVE) if ( lpsd->Control & SE_SELF_RELATIVE)
offset = (ULONG) lpsd; offset = (ULONG_PTR) lpsd;
if ( lpsd->Owner != NULL ) if ( lpsd->Owner != NULL )
Size += RtlLengthSid((PSID)((LPBYTE)lpsd->Owner + offset)); Size += RtlLengthSid((PSID)((LPBYTE)lpsd->Owner + offset));
@ -599,7 +599,7 @@ NTSTATUS WINAPI RtlGetDaclSecurityDescriptor(
if ( (*lpbDaclPresent = (SE_DACL_PRESENT & lpsd->Control) ? 1 : 0) ) if ( (*lpbDaclPresent = (SE_DACL_PRESENT & lpsd->Control) ? 1 : 0) )
{ {
if ( SE_SELF_RELATIVE & lpsd->Control) if ( SE_SELF_RELATIVE & lpsd->Control)
*pDacl = (PACL) ((LPBYTE)lpsd + (DWORD)lpsd->Dacl); *pDacl = (PACL) ((LPBYTE)lpsd + (DWORD_PTR)lpsd->Dacl);
else else
*pDacl = lpsd->Dacl; *pDacl = lpsd->Dacl;
@ -662,7 +662,7 @@ NTSTATUS WINAPI RtlGetSaclSecurityDescriptor(
if ( (*lpbSaclPresent = (SE_SACL_PRESENT & lpsd->Control) ? 1 : 0) ) if ( (*lpbSaclPresent = (SE_SACL_PRESENT & lpsd->Control) ? 1 : 0) )
{ {
if (SE_SELF_RELATIVE & lpsd->Control) if (SE_SELF_RELATIVE & lpsd->Control)
*pSacl = (PACL) ((LPBYTE)lpsd + (DWORD)lpsd->Sacl); *pSacl = (PACL) ((LPBYTE)lpsd + (DWORD_PTR)lpsd->Sacl);
else else
*pSacl = lpsd->Sacl; *pSacl = lpsd->Sacl;
@ -716,8 +716,7 @@ NTSTATUS WINAPI RtlGetOwnerSecurityDescriptor(
if (lpsd->Owner != NULL) if (lpsd->Owner != NULL)
{ {
if (lpsd->Control & SE_SELF_RELATIVE) if (lpsd->Control & SE_SELF_RELATIVE)
*Owner = (PSID)((LPBYTE)lpsd + *Owner = (PSID)((LPBYTE)lpsd + (ULONG_PTR)lpsd->Owner);
(ULONG)lpsd->Owner);
else else
*Owner = lpsd->Owner; *Owner = lpsd->Owner;
@ -794,8 +793,7 @@ NTSTATUS WINAPI RtlGetGroupSecurityDescriptor(
if (lpsd->Group != NULL) if (lpsd->Group != NULL)
{ {
if (lpsd->Control & SE_SELF_RELATIVE) if (lpsd->Control & SE_SELF_RELATIVE)
*Group = (PSID)((LPBYTE)lpsd + *Group = (PSID)((LPBYTE)lpsd + (ULONG_PTR)lpsd->Group);
(ULONG)lpsd->Group);
else else
*Group = lpsd->Group; *Group = lpsd->Group;
@ -818,7 +816,7 @@ NTSTATUS WINAPI RtlMakeSelfRelativeSD(
IN PSECURITY_DESCRIPTOR pSelfRelativeSecurityDescriptor, IN PSECURITY_DESCRIPTOR pSelfRelativeSecurityDescriptor,
IN OUT LPDWORD lpdwBufferLength) IN OUT LPDWORD lpdwBufferLength)
{ {
ULONG offsetRel; ULONG_PTR offsetRel;
ULONG length; ULONG length;
SECURITY_DESCRIPTOR* pAbs = pAbsoluteSecurityDescriptor; SECURITY_DESCRIPTOR* pAbs = pAbsoluteSecurityDescriptor;
SECURITY_DESCRIPTOR* pRel = pSelfRelativeSecurityDescriptor; SECURITY_DESCRIPTOR* pRel = pSelfRelativeSecurityDescriptor;
@ -924,30 +922,30 @@ NTSTATUS WINAPI RtlSelfRelativeToAbsoluteSD(
} }
if (pRel->Control & SE_DACL_PRESENT && if (pRel->Control & SE_DACL_PRESENT &&
*lpdwDaclSize < ((PACL)((LPBYTE)pRel->Dacl + (ULONG)pRel))->AclSize) *lpdwDaclSize < ((PACL)((LPBYTE)pRel->Dacl + (ULONG_PTR)pRel))->AclSize)
{ {
*lpdwDaclSize = ((PACL)((LPBYTE)pRel->Dacl + (ULONG)pRel))->AclSize; *lpdwDaclSize = ((PACL)((LPBYTE)pRel->Dacl + (ULONG_PTR)pRel))->AclSize;
status = STATUS_BUFFER_TOO_SMALL; status = STATUS_BUFFER_TOO_SMALL;
} }
if (pRel->Control & SE_SACL_PRESENT && if (pRel->Control & SE_SACL_PRESENT &&
*lpdwSaclSize < ((PACL)((LPBYTE)pRel->Sacl + (ULONG)pRel))->AclSize) *lpdwSaclSize < ((PACL)((LPBYTE)pRel->Sacl + (ULONG_PTR)pRel))->AclSize)
{ {
*lpdwSaclSize = ((PACL)((LPBYTE)pRel->Sacl + (ULONG)pRel))->AclSize; *lpdwSaclSize = ((PACL)((LPBYTE)pRel->Sacl + (ULONG_PTR)pRel))->AclSize;
status = STATUS_BUFFER_TOO_SMALL; status = STATUS_BUFFER_TOO_SMALL;
} }
if (pRel->Owner && if (pRel->Owner &&
*lpdwOwnerSize < RtlLengthSid((PSID)((LPBYTE)pRel->Owner + (ULONG)pRel))) *lpdwOwnerSize < RtlLengthSid((PSID)((LPBYTE)pRel->Owner + (ULONG_PTR)pRel)))
{ {
*lpdwOwnerSize = RtlLengthSid((PSID)((LPBYTE)pRel->Owner + (ULONG)pRel)); *lpdwOwnerSize = RtlLengthSid((PSID)((LPBYTE)pRel->Owner + (ULONG_PTR)pRel));
status = STATUS_BUFFER_TOO_SMALL; status = STATUS_BUFFER_TOO_SMALL;
} }
if (pRel->Group && if (pRel->Group &&
*lpdwPrimaryGroupSize < RtlLengthSid((PSID)((LPBYTE)pRel->Group + (ULONG)pRel))) *lpdwPrimaryGroupSize < RtlLengthSid((PSID)((LPBYTE)pRel->Group + (ULONG_PTR)pRel)))
{ {
*lpdwPrimaryGroupSize = RtlLengthSid((PSID)((LPBYTE)pRel->Group + (ULONG)pRel)); *lpdwPrimaryGroupSize = RtlLengthSid((PSID)((LPBYTE)pRel->Group + (ULONG_PTR)pRel));
status = STATUS_BUFFER_TOO_SMALL; status = STATUS_BUFFER_TOO_SMALL;
} }
@ -964,7 +962,7 @@ NTSTATUS WINAPI RtlSelfRelativeToAbsoluteSD(
if (pRel->Control & SE_SACL_PRESENT) if (pRel->Control & SE_SACL_PRESENT)
{ {
PACL pAcl = (PACL)((LPBYTE)pRel->Sacl + (ULONG)pRel); PACL pAcl = (PACL)((LPBYTE)pRel->Sacl + (ULONG_PTR)pRel);
memcpy(pSacl, pAcl, pAcl->AclSize); memcpy(pSacl, pAcl, pAcl->AclSize);
pAbs->Sacl = pSacl; pAbs->Sacl = pSacl;
@ -972,21 +970,21 @@ NTSTATUS WINAPI RtlSelfRelativeToAbsoluteSD(
if (pRel->Control & SE_DACL_PRESENT) if (pRel->Control & SE_DACL_PRESENT)
{ {
PACL pAcl = (PACL)((LPBYTE)pRel->Dacl + (ULONG)pRel); PACL pAcl = (PACL)((LPBYTE)pRel->Dacl + (ULONG_PTR)pRel);
memcpy(pDacl, pAcl, pAcl->AclSize); memcpy(pDacl, pAcl, pAcl->AclSize);
pAbs->Dacl = pDacl; pAbs->Dacl = pDacl;
} }
if (pRel->Owner) if (pRel->Owner)
{ {
PSID psid = (PSID)((LPBYTE)pRel->Owner + (ULONG)pRel); PSID psid = (PSID)((LPBYTE)pRel->Owner + (ULONG_PTR)pRel);
memcpy(pOwner, psid, RtlLengthSid(psid)); memcpy(pOwner, psid, RtlLengthSid(psid));
pAbs->Owner = pOwner; pAbs->Owner = pOwner;
} }
if (pRel->Group) if (pRel->Group)
{ {
PSID psid = (PSID)((LPBYTE)pRel->Group + (ULONG)pRel); PSID psid = (PSID)((LPBYTE)pRel->Group + (ULONG_PTR)pRel);
memcpy(pPrimaryGroup, psid, RtlLengthSid(psid)); memcpy(pPrimaryGroup, psid, RtlLengthSid(psid));
pAbs->Group = pPrimaryGroup; pAbs->Group = pPrimaryGroup;
} }

View file

@ -1123,8 +1123,8 @@ size_t server_init_thread( int unix_pid, int unix_tid, void *entry_point )
req->wait_fd = ntdll_get_thread_data()->wait_fd[1]; req->wait_fd = ntdll_get_thread_data()->wait_fd[1];
req->debug_level = (TRACE_ON(server) != 0); req->debug_level = (TRACE_ON(server) != 0);
ret = wine_server_call( req ); ret = wine_server_call( req );
NtCurrentTeb()->ClientId.UniqueProcess = (HANDLE)reply->pid; NtCurrentTeb()->ClientId.UniqueProcess = ULongToHandle(reply->pid);
NtCurrentTeb()->ClientId.UniqueThread = (HANDLE)reply->tid; NtCurrentTeb()->ClientId.UniqueThread = ULongToHandle(reply->tid);
info_size = reply->info_size; info_size = reply->info_size;
version = reply->version; version = reply->version;
server_start_time = reply->server_start; server_start_time = reply->server_start;

View file

@ -778,7 +778,7 @@ static BOOL invoke_apc( const apc_call_t *call, apc_result_t *result )
call->create_thread.func, call->create_thread.func,
call->create_thread.arg, call->create_thread.arg,
&result->create_thread.handle, &id ); &result->create_thread.handle, &id );
result->create_thread.tid = (thread_id_t)id.UniqueThread; result->create_thread.tid = HandleToULong(id.UniqueThread);
break; break;
} }
default: default:

View file

@ -522,7 +522,7 @@ NTSTATUS WINAPI RtlCreateUserThread( HANDLE process, const SECURITY_DESCRIPTOR *
if (result.create_thread.status == STATUS_SUCCESS) if (result.create_thread.status == STATUS_SUCCESS)
{ {
if (id) id->UniqueThread = (HANDLE)result.create_thread.tid; if (id) id->UniqueThread = ULongToHandle(result.create_thread.tid);
if (handle_ptr) *handle_ptr = result.create_thread.handle; if (handle_ptr) *handle_ptr = result.create_thread.handle;
else NtClose( result.create_thread.handle ); else NtClose( result.create_thread.handle );
} }
@ -567,8 +567,8 @@ NTSTATUS WINAPI RtlCreateUserThread( HANDLE process, const SECURITY_DESCRIPTOR *
info->pthread_info.teb_size = size; info->pthread_info.teb_size = size;
if ((status = init_teb( teb ))) goto error; if ((status = init_teb( teb ))) goto error;
teb->ClientId.UniqueProcess = (HANDLE)GetCurrentProcessId(); teb->ClientId.UniqueProcess = ULongToHandle(GetCurrentProcessId());
teb->ClientId.UniqueThread = (HANDLE)tid; teb->ClientId.UniqueThread = ULongToHandle(tid);
thread_data = (struct ntdll_thread_data *)teb->SystemReserved2; thread_data = (struct ntdll_thread_data *)teb->SystemReserved2;
thread_regs = (struct ntdll_thread_regs *)teb->SpareBytes1; thread_regs = (struct ntdll_thread_regs *)teb->SpareBytes1;
@ -609,7 +609,7 @@ NTSTATUS WINAPI RtlCreateUserThread( HANDLE process, const SECURITY_DESCRIPTOR *
} }
pthread_functions.sigprocmask( SIG_SETMASK, &sigset, NULL ); pthread_functions.sigprocmask( SIG_SETMASK, &sigset, NULL );
if (id) id->UniqueThread = (HANDLE)tid; if (id) id->UniqueThread = ULongToHandle(tid);
if (handle_ptr) *handle_ptr = handle; if (handle_ptr) *handle_ptr = handle;
else NtClose( handle ); else NtClose( handle );
@ -650,7 +650,7 @@ NTSTATUS WINAPI NtOpenThread( HANDLE *handle, ACCESS_MASK access,
SERVER_START_REQ( open_thread ) SERVER_START_REQ( open_thread )
{ {
req->tid = (thread_id_t)id->UniqueThread; req->tid = HandleToULong(id->UniqueThread);
req->access = access; req->access = access;
req->attributes = attr ? attr->Attributes : 0; req->attributes = attr ? attr->Attributes : 0;
ret = wine_server_call( req ); ret = wine_server_call( req );
@ -1173,8 +1173,8 @@ NTSTATUS WINAPI NtQueryInformationThread( HANDLE handle, THREADINFOCLASS class,
{ {
info.ExitStatus = reply->exit_code; info.ExitStatus = reply->exit_code;
info.TebBaseAddress = reply->teb; info.TebBaseAddress = reply->teb;
info.ClientId.UniqueProcess = (HANDLE)reply->pid; info.ClientId.UniqueProcess = ULongToHandle(reply->pid);
info.ClientId.UniqueThread = (HANDLE)reply->tid; info.ClientId.UniqueThread = ULongToHandle(reply->tid);
info.AffinityMask = reply->affinity; info.AffinityMask = reply->affinity;
info.Priority = reply->priority; info.Priority = reply->priority;
info.BasePriority = reply->priority; /* FIXME */ info.BasePriority = reply->priority; /* FIXME */

View file

@ -1149,8 +1149,8 @@ static NTSTATUS map_image( HANDLE hmapping, int fd, char *base, SIZE_T total_siz
relocs = &nt->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_BASERELOC]; relocs = &nt->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_BASERELOC];
if (nt->FileHeader.Characteristics & IMAGE_FILE_RELOCS_STRIPPED) if (nt->FileHeader.Characteristics & IMAGE_FILE_RELOCS_STRIPPED)
{ {
WARN( "Need to relocate module from addr %x, but there are no relocation records\n", WARN( "Need to relocate module from addr %lx, but there are no relocation records\n",
nt->OptionalHeader.ImageBase ); (ULONG_PTR)nt->OptionalHeader.ImageBase );
status = STATUS_CONFLICTING_ADDRESSES; status = STATUS_CONFLICTING_ADDRESSES;
goto error; goto error;
} }