Commit 74a5851e authored by Alexandre Julliard's avatar Alexandre Julliard

ntdll: Use int instead of long types in a few places.

To avoid typecasts in debug traces.
parent 1a7cacc4
......@@ -299,7 +299,7 @@ int __cdecl __wine_dbg_header( enum __wine_debug_class cls, struct __wine_debug_
{
if (TRACE_ON(timestamp))
{
ULONG ticks = NtGetTickCount();
UINT ticks = NtGetTickCount();
pos += sprintf( pos, "%3u.%03u:", ticks / 1000, ticks % 1000 );
}
if (TRACE_ON(pid)) pos += sprintf( pos, "%04x:", GetCurrentProcessId() );
......
......@@ -85,7 +85,7 @@ const WCHAR system_dir[] = {'\\','?','?','\\','C',':','\\','w','i','n','d','o','
static CPTABLEINFO unix_cp = { CP_UTF8, 4, '?', 0xfffd, '?', '?' };
static char *get_nls_file_path( ULONG type, ULONG id )
static char *get_nls_file_path( UINT type, UINT id )
{
const char *dir = build_dir ? build_dir : data_dir;
const char *name = NULL;
......@@ -169,7 +169,7 @@ static NTSTATUS open_nls_data_file( const char *path, const WCHAR *sysdir, HANDL
return status;
}
static NTSTATUS get_nls_section_name( ULONG type, ULONG id, WCHAR name[32] )
static NTSTATUS get_nls_section_name( UINT type, UINT id, WCHAR name[32] )
{
char buffer[32];
......@@ -1068,7 +1068,7 @@ static void add_system_dll_path_var( WCHAR **env, SIZE_T *pos, SIZE_T *size )
static void add_dynamic_environment( WCHAR **env, SIZE_T *pos, SIZE_T *size )
{
const char *overrides = getenv( "WINEDLLOVERRIDES" );
DWORD i;
unsigned int i;
char str[22];
add_path_var( env, pos, size, "WINEDATADIR", data_dir );
......
......@@ -1600,7 +1600,7 @@ static int fd_get_file_info( int fd, unsigned int options, struct stat *st, ULON
}
static int fd_set_dos_attrib( int fd, ULONG attr )
static int fd_set_dos_attrib( int fd, UINT attr )
{
/* we only store the HIDDEN and SYSTEM attributes */
attr &= XATTR_ATTRIBS_MASK;
......@@ -1618,7 +1618,7 @@ static int fd_set_dos_attrib( int fd, ULONG attr )
/* set the stat info and file attributes for a file (by file descriptor) */
NTSTATUS fd_set_file_info( int fd, ULONG attr )
NTSTATUS fd_set_file_info( int fd, UINT attr )
{
struct stat st;
......@@ -5338,7 +5338,7 @@ NTSTATUS WINAPI NtReadFile( HANDLE handle, HANDLE event, PIO_APC_ROUTINE apc, vo
unsigned int options;
struct io_timeouts timeouts;
NTSTATUS status, ret_status;
ULONG total = 0;
UINT total = 0;
client_ptr_t iosb_ptr = iosb_client_ptr(io);
enum server_fd_type type;
ULONG_PTR cvalue = apc ? 0 : (ULONG_PTR)apc_user;
......@@ -5540,7 +5540,7 @@ NTSTATUS WINAPI NtReadFileScatter( HANDLE file, HANDLE event, PIO_APC_ROUTINE ap
int result, unix_handle, needs_close;
unsigned int options;
NTSTATUS status;
ULONG pos = 0, total = 0;
UINT pos = 0, total = 0;
client_ptr_t iosb_ptr = iosb_client_ptr(io);
enum server_fd_type type;
ULONG_PTR cvalue = apc ? 0 : (ULONG_PTR)apc_user;
......@@ -5619,7 +5619,7 @@ NTSTATUS WINAPI NtWriteFile( HANDLE handle, HANDLE event, PIO_APC_ROUTINE apc, v
unsigned int options;
struct io_timeouts timeouts;
NTSTATUS status, ret_status;
ULONG total = 0;
UINT total = 0;
client_ptr_t iosb_ptr = iosb_client_ptr(io);
enum server_fd_type type;
ULONG_PTR cvalue = apc ? 0 : (ULONG_PTR)apc_user;
......@@ -5848,7 +5848,7 @@ NTSTATUS WINAPI NtWriteFileGather( HANDLE file, HANDLE event, PIO_APC_ROUTINE ap
int result, unix_handle, needs_close;
unsigned int options;
NTSTATUS status;
ULONG pos = 0, total = 0;
UINT pos = 0, total = 0;
client_ptr_t iosb_ptr = iosb_client_ptr(io);
enum server_fd_type type;
ULONG_PTR cvalue = apc ? 0 : (ULONG_PTR)apc_user;
......@@ -7094,8 +7094,8 @@ NTSTATUS WINAPI NtQueryObject( HANDLE handle, OBJECT_INFORMATION_CLASS info_clas
OBJECT_TYPE_INFORMATION *p;
struct object_type_info *buffer;
/* assume at most 32 types, with an average 16-char name */
ULONG size = 32 * (sizeof(struct object_type_info) + 16 * sizeof(WCHAR));
ULONG i, count, pos, total, align = sizeof(DWORD_PTR) - 1;
UINT size = 32 * (sizeof(struct object_type_info) + 16 * sizeof(WCHAR));
UINT i, count, pos, total, align = sizeof(DWORD_PTR) - 1;
buffer = malloc( size );
SERVER_START_REQ( get_object_types )
......
......@@ -295,7 +295,7 @@ static NTSTATUS get_line_control(int fd, SERIAL_LINE_CONTROL* slc)
return STATUS_SUCCESS;
}
static NTSTATUS get_modem_status(int fd, DWORD* lpModemStat)
static NTSTATUS get_modem_status(int fd, UINT* lpModemStat)
{
NTSTATUS status = STATUS_NOT_SUPPORTED;
int mstat;
......@@ -418,7 +418,7 @@ static void stop_waiting( HANDLE handle )
SERVER_END_REQ;
}
static NTSTATUS get_wait_mask(HANDLE hDevice, DWORD *mask, DWORD *cookie, DWORD *pending_write, BOOL start_wait)
static NTSTATUS get_wait_mask(HANDLE hDevice, UINT *mask, UINT *cookie, BOOL *pending_write, BOOL start_wait)
{
NTSTATUS status;
......@@ -831,10 +831,10 @@ typedef struct async_commio
DWORD* events;
client_ptr_t iosb;
HANDLE hEvent;
DWORD evtmask;
DWORD cookie;
DWORD mstat;
DWORD pending_write;
UINT evtmask;
UINT cookie;
UINT mstat;
BOOL pending_write;
serial_irq_info irq_info;
} async_commio;
......@@ -890,10 +890,10 @@ static NTSTATUS get_irq_info(int fd, serial_irq_info *irq_info)
}
static DWORD check_events(int fd, DWORD mask,
static DWORD check_events(int fd, UINT mask,
const serial_irq_info *new,
const serial_irq_info *old,
DWORD new_mstat, DWORD old_mstat, DWORD pending_write)
UINT new_mstat, UINT old_mstat, BOOL pending_write)
{
DWORD ret = 0, queue;
......@@ -946,7 +946,7 @@ static void CALLBACK wait_for_event(LPVOID arg)
if (!server_get_unix_fd( commio->hDevice, FILE_READ_DATA | FILE_WRITE_DATA, &fd, &needs_close, NULL, NULL ))
{
serial_irq_info new_irq_info;
DWORD new_mstat, dummy, cookie;
UINT new_mstat, dummy, cookie;
LARGE_INTEGER time;
TRACE("device=%p fd=0x%08x mask=0x%08x buffer=%p event=%p irq_info=%p\n",
......
......@@ -176,28 +176,28 @@ enum arm_trap_code
struct syscall_frame
{
DWORD r0; /* 000 */
DWORD r1; /* 004 */
DWORD r2; /* 008 */
DWORD r3; /* 00c */
DWORD r4; /* 010 */
DWORD r5; /* 014 */
DWORD r6; /* 018 */
DWORD r7; /* 01c */
DWORD r8; /* 020 */
DWORD r9; /* 024 */
DWORD r10; /* 028 */
DWORD r11; /* 02c */
DWORD r12; /* 030 */
DWORD pc; /* 034 */
DWORD sp; /* 038 */
DWORD lr; /* 03c */
DWORD cpsr; /* 040 */
DWORD restore_flags; /* 044 */
DWORD fpscr; /* 048 */
UINT r0; /* 000 */
UINT r1; /* 004 */
UINT r2; /* 008 */
UINT r3; /* 00c */
UINT r4; /* 010 */
UINT r5; /* 014 */
UINT r6; /* 018 */
UINT r7; /* 01c */
UINT r8; /* 020 */
UINT r9; /* 024 */
UINT r10; /* 028 */
UINT r11; /* 02c */
UINT r12; /* 030 */
UINT pc; /* 034 */
UINT sp; /* 038 */
UINT lr; /* 03c */
UINT cpsr; /* 040 */
UINT restore_flags; /* 044 */
UINT fpscr; /* 048 */
struct syscall_frame *prev_frame; /* 04c */
SYSTEM_SERVICE_TABLE *syscall_table; /* 050 */
DWORD align[3]; /* 054 */
UINT align[3]; /* 054 */
ULONGLONG d[32]; /* 060 */
};
......@@ -301,7 +301,7 @@ static uint32_t regmask(int first_bit, int n_bits)
/***********************************************************************
* ehabi_virtual_unwind
*/
static NTSTATUS ehabi_virtual_unwind( DWORD ip, DWORD *frame, CONTEXT *context,
static NTSTATUS ehabi_virtual_unwind( UINT ip, DWORD *frame, CONTEXT *context,
const struct exidx_entry *entry,
PEXCEPTION_ROUTINE *handler, void **handler_data )
{
......@@ -314,12 +314,11 @@ static NTSTATUS ehabi_virtual_unwind( DWORD ip, DWORD *frame, CONTEXT *context,
int extra_words;
int finish = 0;
int set_pc = 0;
DWORD func_begin = prel31_to_abs(&entry->addr);
UINT func_begin = prel31_to_abs(&entry->addr);
*frame = context->Sp;
TRACE( "ip %#x function %#lx\n",
ip, (unsigned long)func_begin );
TRACE( "ip %#x function %#x\n", ip, func_begin );
if (entry->data == 1)
{
......@@ -1255,7 +1254,7 @@ NTSTATUS WINAPI NtCallbackReturn( void *ret_ptr, ULONG ret_len, NTSTATUS status
static BOOL handle_syscall_fault( ucontext_t *context, EXCEPTION_RECORD *rec )
{
struct syscall_frame *frame = arm_thread_data()->syscall_frame;
DWORD i;
UINT i;
if (!is_inside_syscall( context ) && !ntdll_get_thread_data()->jmp_buf) return FALSE;
......
......@@ -439,22 +439,22 @@ struct syscall_frame
{
WORD syscall_flags; /* 000 */
WORD restore_flags; /* 002 */
DWORD eflags; /* 004 */
DWORD eip; /* 008 */
DWORD esp; /* 00c */
UINT eflags; /* 004 */
UINT eip; /* 008 */
UINT esp; /* 00c */
WORD cs; /* 010 */
WORD ss; /* 012 */
WORD ds; /* 014 */
WORD es; /* 016 */
WORD fs; /* 018 */
WORD gs; /* 01a */
DWORD eax; /* 01c */
DWORD ebx; /* 020 */
DWORD ecx; /* 024 */
DWORD edx; /* 028 */
DWORD edi; /* 02c */
DWORD esi; /* 030 */
DWORD ebp; /* 034 */
UINT eax; /* 01c */
UINT ebx; /* 020 */
UINT ecx; /* 024 */
UINT edx; /* 028 */
UINT edi; /* 02c */
UINT esi; /* 030 */
UINT ebp; /* 034 */
SYSTEM_SERVICE_TABLE *syscall_table; /* 038 */
struct syscall_frame *prev_frame; /* 03c */
union /* 040 */
......@@ -472,14 +472,14 @@ C_ASSERT( sizeof(struct syscall_frame) == 0x380 );
struct x86_thread_data
{
DWORD fs; /* 1d4 TEB selector */
DWORD gs; /* 1d8 libc selector; update winebuild if you move this! */
DWORD dr0; /* 1dc debug registers */
DWORD dr1; /* 1e0 */
DWORD dr2; /* 1e4 */
DWORD dr3; /* 1e8 */
DWORD dr6; /* 1ec */
DWORD dr7; /* 1f0 */
UINT fs; /* 1d4 TEB selector */
UINT gs; /* 1d8 libc selector; update winebuild if you move this! */
UINT dr0; /* 1dc debug registers */
UINT dr1; /* 1e0 */
UINT dr2; /* 1e4 */
UINT dr3; /* 1e8 */
UINT dr6; /* 1ec */
UINT dr7; /* 1f0 */
void *exit_frame; /* 1f4 exit frame pointer */
struct syscall_frame *syscall_frame; /* 1f8 frame pointer on syscall entry */
};
......@@ -1275,37 +1275,37 @@ union atl_thunk
{
struct
{
DWORD movl; /* movl this,4(%esp) */
DWORD this;
UINT movl; /* movl this,4(%esp) */
UINT this;
BYTE jmp; /* jmp func */
int func;
} t1;
struct
{
BYTE movl; /* movl this,ecx */
DWORD this;
UINT this;
BYTE jmp; /* jmp func */
int func;
} t2;
struct
{
BYTE movl1; /* movl this,edx */
DWORD this;
UINT this;
BYTE movl2; /* movl func,ecx */
DWORD func;
UINT func;
WORD jmp; /* jmp ecx */
} t3;
struct
{
BYTE movl1; /* movl this,ecx */
DWORD this;
UINT this;
BYTE movl2; /* movl func,eax */
DWORD func;
UINT func;
WORD jmp; /* jmp eax */
} t4;
struct
{
DWORD inst1; /* pop ecx
UINT inst1; /* pop ecx
* pop eax
* push ecx
* jmp 4(%eax) */
......@@ -1769,7 +1769,7 @@ static BOOL handle_syscall_fault( ucontext_t *sigcontext, void *stack_ptr,
EXCEPTION_RECORD *rec, CONTEXT *context )
{
struct syscall_frame *frame = x86_thread_data()->syscall_frame;
DWORD i, *stack;
UINT i, *stack;
if (!is_inside_syscall( sigcontext ) && !ntdll_get_thread_data()->jmp_buf) return FALSE;
......@@ -1800,9 +1800,9 @@ static BOOL handle_syscall_fault( ucontext_t *sigcontext, void *stack_ptr,
else
{
TRACE( "returning to user mode ip=%08x ret=%08x\n", frame->eip, rec->ExceptionCode );
stack = (DWORD *)frame;
stack = (UINT *)frame;
*(--stack) = rec->ExceptionCode;
*(--stack) = (DWORD)frame;
*(--stack) = (UINT)frame;
*(--stack) = 0xdeadbabe; /* return address */
ESP_sig(sigcontext) = (DWORD)stack;
EIP_sig(sigcontext) = (DWORD)__wine_syscall_dispatcher_return;
......
......@@ -144,7 +144,7 @@ struct async_transmit_ioctl
unsigned int buffer_cursor; /* amount of data currently in the buffer already sent */
unsigned int tail_cursor; /* amount of tail data already sent */
unsigned int file_len; /* total file length to send */
DWORD flags;
unsigned int flags;
const char *head;
const char *tail;
unsigned int head_len;
......
......@@ -253,7 +253,7 @@ static NTSTATUS TAPE_GetMediaParams( int fd, TAPE_GET_MEDIA_PARAMETERS *data )
/******************************************************************
* TAPE_GetPosition
*/
static NTSTATUS TAPE_GetPosition( int fd, ULONG type, TAPE_GET_POSITION *data )
static NTSTATUS TAPE_GetPosition( int fd, UINT type, TAPE_GET_POSITION *data )
{
#ifdef HAVE_SYS_MTIO_H
struct mtget get;
......
......@@ -27,8 +27,8 @@
struct afd_wsabuf_32
{
ULONG len;
ULONG buf;
UINT len;
UINT buf;
};
#ifdef USE_WS_PREFIX
......
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