ntdll: Use correct integral type.

Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Eric Pouech 2022-01-31 14:17:06 +01:00 committed by Alexandre Julliard
parent 1c374a7c51
commit 310d7c6883
3 changed files with 15 additions and 15 deletions

View File

@ -532,7 +532,7 @@ enum context_sections
typedef struct _ACTIVATION_CONTEXT
{
ULONG magic;
int ref_count;
LONG ref_count;
struct file_info config;
struct file_info appdir;
struct assembly *assemblies;

View File

@ -90,8 +90,8 @@ static BOOL is_prefix_bootstrap; /* are we bootstrapping the prefix? */
static BOOL imports_fixup_done = FALSE; /* set once the imports have been fixed up, before attaching them */
static BOOL process_detaching = FALSE; /* set on process detach to avoid deadlocks with thread detach */
static int free_lib_count; /* recursion depth of LdrUnloadDll calls */
static ULONG path_safe_mode; /* path mode set by RtlSetSearchPathMode */
static ULONG dll_safe_mode = 1; /* dll search mode */
static LONG path_safe_mode; /* path mode set by RtlSetSearchPathMode */
static LONG dll_safe_mode = 1; /* dll search mode */
static UNICODE_STRING dll_directory; /* extra path for LdrSetDllDirectory */
static UNICODE_STRING system_dll_path; /* path to search for system dependency dlls */
static DWORD default_search_flags; /* default flags set by LdrSetDefaultDllDirectories */
@ -250,8 +250,8 @@ RTL_UNLOAD_EVENT_TRACE * WINAPI RtlGetUnloadEventTrace(void)
*/
void WINAPI RtlGetUnloadEventTraceEx(ULONG **size, ULONG **count, void **trace)
{
static unsigned int element_size = sizeof(*unload_traces);
static unsigned int element_count = ARRAY_SIZE(unload_traces);
static ULONG element_size = sizeof(*unload_traces);
static ULONG element_count = ARRAY_SIZE(unload_traces);
*size = &element_size;
*count = &element_count;
@ -3334,7 +3334,7 @@ NTSTATUS WINAPI LdrQueryProcessModuleInformation(RTL_PROCESS_MODULES *smi,
}
static NTSTATUS query_dword_option( HANDLE hkey, LPCWSTR name, ULONG *value )
static NTSTATUS query_dword_option( HANDLE hkey, LPCWSTR name, LONG *value )
{
NTSTATUS status;
UNICODE_STRING str;
@ -4369,7 +4369,7 @@ NTSTATUS WINAPI RtlSetSearchPathMode( ULONG flags )
val = 0;
break;
case BASE_SEARCH_PATH_ENABLE_SAFE_SEARCHMODE | BASE_SEARCH_PATH_PERMANENT:
InterlockedExchange( (int *)&path_safe_mode, 2 );
InterlockedExchange( &path_safe_mode, 2 );
return STATUS_SUCCESS;
default:
return STATUS_INVALID_PARAMETER;
@ -4377,9 +4377,9 @@ NTSTATUS WINAPI RtlSetSearchPathMode( ULONG flags )
for (;;)
{
int prev = path_safe_mode;
LONG prev = path_safe_mode;
if (prev == 2) break; /* permanently set */
if (InterlockedCompareExchange( (int *)&path_safe_mode, val, prev ) == prev) return STATUS_SUCCESS;
if (InterlockedCompareExchange( &path_safe_mode, val, prev ) == prev) return STATUS_SUCCESS;
}
return STATUS_ACCESS_DENIED;
}

View File

@ -182,12 +182,12 @@ static inline NTSTATUS wait_semaphore( RTL_CRITICAL_SECTION *crit, int timeout )
}
else
{
int *lock = (int *)&crit->LockSemaphore;
LONG *lock = (LONG *)&crit->LockSemaphore;
while (!InterlockedCompareExchange( lock, 0, 1 ))
{
static const int zero;
static const LONG zero;
/* this may wait longer than specified in case of multiple wake-ups */
if (RtlWaitOnAddress( lock, &zero, sizeof(int), &time ) == STATUS_TIMEOUT)
if (RtlWaitOnAddress( lock, &zero, sizeof(LONG), &time ) == STATUS_TIMEOUT)
return STATUS_TIMEOUT;
}
return STATUS_WAIT_0;
@ -363,7 +363,7 @@ NTSTATUS WINAPI RtlpUnWaitCriticalSection( RTL_CRITICAL_SECTION *crit )
}
else
{
int *lock = (int *)&crit->LockSemaphore;
LONG *lock = (LONG *)&crit->LockSemaphore;
InterlockedExchange( lock, 1 );
RtlWakeAddressSingle( lock );
ret = STATUS_SUCCESS;
@ -761,7 +761,7 @@ void WINAPI RtlInitializeConditionVariable( RTL_CONDITION_VARIABLE *variable )
*/
void WINAPI RtlWakeConditionVariable( RTL_CONDITION_VARIABLE *variable )
{
InterlockedIncrement( (int *)&variable->Ptr );
InterlockedIncrement( (LONG *)&variable->Ptr );
RtlWakeAddressSingle( variable );
}
@ -772,7 +772,7 @@ void WINAPI RtlWakeConditionVariable( RTL_CONDITION_VARIABLE *variable )
*/
void WINAPI RtlWakeAllConditionVariable( RTL_CONDITION_VARIABLE *variable )
{
InterlockedIncrement( (int *)&variable->Ptr );
InterlockedIncrement( (LONG *)&variable->Ptr );
RtlWakeAddressAll( variable );
}