Eric Pouech : ntdll: Use correct integral type.

Alexandre Julliard julliard at winehq.org
Mon Jan 31 15:55:19 CST 2022


Module: wine
Branch: master
Commit: 310d7c688346e89a1cb0f4ec7cfbb0e690015543
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=310d7c688346e89a1cb0f4ec7cfbb0e690015543

Author: Eric Pouech <eric.pouech at gmail.com>
Date:   Mon Jan 31 14:17:06 2022 +0100

ntdll: Use correct integral type.

Signed-off-by: Eric Pouech <eric.pouech at gmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/ntdll/actctx.c |  2 +-
 dlls/ntdll/loader.c | 16 ++++++++--------
 dlls/ntdll/sync.c   | 12 ++++++------
 3 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/dlls/ntdll/actctx.c b/dlls/ntdll/actctx.c
index ca38f37e673..9fa93a3b5e3 100644
--- a/dlls/ntdll/actctx.c
+++ b/dlls/ntdll/actctx.c
@@ -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;
diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c
index b50b9e61bbc..2c3e62f6e25 100644
--- a/dlls/ntdll/loader.c
+++ b/dlls/ntdll/loader.c
@@ -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;
 }
diff --git a/dlls/ntdll/sync.c b/dlls/ntdll/sync.c
index bdb39e59d6d..06b594c633f 100644
--- a/dlls/ntdll/sync.c
+++ b/dlls/ntdll/sync.c
@@ -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 );
 }
 




More information about the wine-cvs mailing list