Use SIZE_T instead of ULONG for the size arguments of the virtual

memory functions.
This commit is contained in:
Alexandre Julliard 2005-09-12 10:36:06 +00:00
parent f8ee161a1b
commit 884599112e
5 changed files with 15 additions and 16 deletions

View File

@ -62,7 +62,7 @@ NTSTATUS WINAPI RtlCreateEnvironment(BOOLEAN inherit, PWSTR* env)
} }
else else
{ {
ULONG size = 1; SIZE_T size = 1;
PVOID addr = NULL; PVOID addr = NULL;
nts = NtAllocateVirtualMemory(NtCurrentProcess(), &addr, 0, &size, nts = NtAllocateVirtualMemory(NtCurrentProcess(), &addr, 0, &size,
MEM_RESERVE | MEM_COMMIT, PAGE_READWRITE); MEM_RESERVE | MEM_COMMIT, PAGE_READWRITE);
@ -77,7 +77,7 @@ NTSTATUS WINAPI RtlCreateEnvironment(BOOLEAN inherit, PWSTR* env)
*/ */
NTSTATUS WINAPI RtlDestroyEnvironment(PWSTR env) NTSTATUS WINAPI RtlDestroyEnvironment(PWSTR env)
{ {
ULONG size = 0; SIZE_T size = 0;
TRACE("(%p)!\n", env); TRACE("(%p)!\n", env);
@ -220,7 +220,7 @@ NTSTATUS WINAPI RtlSetEnvironmentVariable(PWSTR* penv, PUNICODE_STRING name,
if ((old_size + len) * sizeof(WCHAR) > mbi.RegionSize) if ((old_size + len) * sizeof(WCHAR) > mbi.RegionSize)
{ {
LPWSTR new_env; LPWSTR new_env;
ULONG new_size = (old_size + len) * sizeof(WCHAR); SIZE_T new_size = (old_size + len) * sizeof(WCHAR);
new_env = NULL; new_env = NULL;
nts = NtAllocateVirtualMemory(NtCurrentProcess(), (void**)&new_env, 0, nts = NtAllocateVirtualMemory(NtCurrentProcess(), (void**)&new_env, 0,
@ -422,7 +422,7 @@ NTSTATUS WINAPI RtlCreateProcessParameters( RTL_USER_PROCESS_PARAMETERS **result
static const UNICODE_STRING null_str = { 0, 0, NULL }; static const UNICODE_STRING null_str = { 0, 0, NULL };
const RTL_USER_PROCESS_PARAMETERS *cur_params; const RTL_USER_PROCESS_PARAMETERS *cur_params;
ULONG size, total_size; SIZE_T size, total_size;
void *ptr; void *ptr;
NTSTATUS status; NTSTATUS status;
@ -482,6 +482,6 @@ NTSTATUS WINAPI RtlCreateProcessParameters( RTL_USER_PROCESS_PARAMETERS **result
void WINAPI RtlDestroyProcessParameters( RTL_USER_PROCESS_PARAMETERS *params ) void WINAPI RtlDestroyProcessParameters( RTL_USER_PROCESS_PARAMETERS *params )
{ {
void *ptr = params; void *ptr = params;
ULONG size = 0; SIZE_T size = 0;
NtFreeVirtualMemory( NtCurrentProcess(), &ptr, &size, MEM_RELEASE ); NtFreeVirtualMemory( NtCurrentProcess(), &ptr, &size, MEM_RELEASE );
} }

View File

@ -74,7 +74,7 @@ void WINAPI RtlInitializeHandleTable(ULONG MaxHandleCount, ULONG HandleSize, RTL
*/ */
NTSTATUS WINAPI RtlDestroyHandleTable(RTL_HANDLE_TABLE * HandleTable) NTSTATUS WINAPI RtlDestroyHandleTable(RTL_HANDLE_TABLE * HandleTable)
{ {
ULONG Size = 0; SIZE_T Size = 0;
TRACE("(%p)\n", HandleTable); TRACE("(%p)\n", HandleTable);
@ -104,7 +104,7 @@ static NTSTATUS RtlpAllocateSomeHandles(RTL_HANDLE_TABLE * HandleTable)
if (!HandleTable->FirstHandle) if (!HandleTable->FirstHandle)
{ {
PVOID FirstHandleAddr = NULL; PVOID FirstHandleAddr = NULL;
ULONG MaxSize = HandleTable->MaxHandleCount * HandleTable->HandleSize; SIZE_T MaxSize = HandleTable->MaxHandleCount * HandleTable->HandleSize;
/* reserve memory for the handles, but don't commit it yet because we /* reserve memory for the handles, but don't commit it yet because we
* probably won't use most of it and it will use up physical memory */ * probably won't use most of it and it will use up physical memory */
@ -123,8 +123,7 @@ static NTSTATUS RtlpAllocateSomeHandles(RTL_HANDLE_TABLE * HandleTable)
} }
if (!HandleTable->NextFree) if (!HandleTable->NextFree)
{ {
ULONG CommitSize = 4096; /* one page */ SIZE_T Offset, CommitSize = 4096; /* one page */
ULONG Offset;
RTL_HANDLE * FreeHandle = NULL; RTL_HANDLE * FreeHandle = NULL;
PVOID NextAvailAddr = HandleTable->ReservedMemory; PVOID NextAvailAddr = HandleTable->ReservedMemory;

View File

@ -455,7 +455,7 @@ static WINE_MODREF *import_dll( HMODULE module, const IMAGE_IMPORT_DESCRIPTOR *d
const char *name = get_rva( module, descr->Name ); const char *name = get_rva( module, descr->Name );
DWORD len = strlen(name) + 1; DWORD len = strlen(name) + 1;
PVOID protect_base; PVOID protect_base;
DWORD protect_size = 0; SIZE_T protect_size = 0;
DWORD protect_old; DWORD protect_old;
thunk_list = get_rva( module, (DWORD)descr->FirstThunk ); thunk_list = get_rva( module, (DWORD)descr->FirstThunk );
@ -1287,7 +1287,7 @@ static NTSTATUS load_native_dll( LPCWSTR load_path, LPCWSTR name, HANDLE file,
OBJECT_ATTRIBUTES attr; OBJECT_ATTRIBUTES attr;
LARGE_INTEGER size; LARGE_INTEGER size;
IMAGE_NT_HEADERS *nt; IMAGE_NT_HEADERS *nt;
DWORD len = 0; SIZE_T len = 0;
WINE_MODREF *wm; WINE_MODREF *wm;
NTSTATUS status; NTSTATUS status;

View File

@ -126,7 +126,7 @@ static void fatal_perror( const char *err, ... )
void server_exit_thread( int status ) void server_exit_thread( int status )
{ {
struct wine_pthread_thread_info info; struct wine_pthread_thread_info info;
ULONG size; SIZE_T size;
RtlAcquirePebLock(); RtlAcquirePebLock();
RemoveEntryList( &NtCurrentTeb()->TlsLinks ); RemoveEntryList( &NtCurrentTeb()->TlsLinks );

View File

@ -84,7 +84,7 @@ static inline NTSTATUS init_teb( TEB *teb )
*/ */
static inline void free_teb( TEB *teb ) static inline void free_teb( TEB *teb )
{ {
ULONG size = 0; SIZE_T size = 0;
void *addr = teb; void *addr = teb;
struct ntdll_thread_data *thread_data = (struct ntdll_thread_data *)teb->SystemReserved2; struct ntdll_thread_data *thread_data = (struct ntdll_thread_data *)teb->SystemReserved2;
@ -105,7 +105,7 @@ void thread_init(void)
{ {
TEB *teb; TEB *teb;
void *addr; void *addr;
ULONG info_size; SIZE_T info_size;
struct ntdll_thread_data *thread_data; struct ntdll_thread_data *thread_data;
struct wine_pthread_thread_info thread_info; struct wine_pthread_thread_info thread_info;
static struct debug_info debug_info; /* debug info for initial thread */ static struct debug_info debug_info; /* debug info for initial thread */
@ -193,7 +193,7 @@ static void start_thread( struct wine_pthread_thread_info *info )
PRTL_THREAD_START_ROUTINE func = startup_info->entry_point; PRTL_THREAD_START_ROUTINE func = startup_info->entry_point;
void *arg = startup_info->entry_arg; void *arg = startup_info->entry_arg;
struct debug_info debug_info; struct debug_info debug_info;
ULONG size; SIZE_T size;
debug_info.str_pos = debug_info.strings; debug_info.str_pos = debug_info.strings;
debug_info.out_pos = debug_info.output; debug_info.out_pos = debug_info.output;
@ -323,7 +323,7 @@ error:
if (thread_data) wine_ldt_free_fs( thread_data->teb_sel ); if (thread_data) wine_ldt_free_fs( thread_data->teb_sel );
if (addr) if (addr)
{ {
ULONG size = 0; SIZE_T size = 0;
NtFreeVirtualMemory( NtCurrentProcess(), &addr, &size, MEM_RELEASE ); NtFreeVirtualMemory( NtCurrentProcess(), &addr, &size, MEM_RELEASE );
} }
if (info) RtlFreeHeap( GetProcessHeap(), 0, info ); if (info) RtlFreeHeap( GetProcessHeap(), 0, info );