Alexandre Julliard : kernelbase: Avoid calling some kernel32 functions.

Alexandre Julliard julliard at winehq.org
Wed Dec 11 16:35:08 CST 2019


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

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Wed Dec 11 21:53:09 2019 +0100

kernelbase: Avoid calling some kernel32 functions.

Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/kernelbase/registry.c | 10 +++++-----
 dlls/kernelbase/thread.c   |  4 ++--
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/dlls/kernelbase/registry.c b/dlls/kernelbase/registry.c
index 1fee41ec5e..80f5ffef02 100644
--- a/dlls/kernelbase/registry.c
+++ b/dlls/kernelbase/registry.c
@@ -2687,10 +2687,10 @@ static LONG load_mui_string(const WCHAR *file_name, UINT res_id, WCHAR *buffer,
         return ERROR_NOT_ENOUGH_MEMORY;
     GetFullPathNameW(file_name, size, full_name, NULL);
 
-    EnterCriticalSection(&reg_mui_cs);
+    RtlEnterCriticalSection(&reg_mui_cs);
     size = reg_mui_cache_get(full_name, res_id, &string);
     if (!size) {
-        LeaveCriticalSection(&reg_mui_cs);
+        RtlLeaveCriticalSection(&reg_mui_cs);
 
         /* Load the file */
         hModule = LoadLibraryExW(full_name, NULL,
@@ -2705,9 +2705,9 @@ static LONG load_mui_string(const WCHAR *file_name, UINT res_id, WCHAR *buffer,
             goto cleanup;
         }
 
-        EnterCriticalSection(&reg_mui_cs);
+        RtlEnterCriticalSection(&reg_mui_cs);
         reg_mui_cache_put(full_name, res_id, string, size);
-        LeaveCriticalSection(&reg_mui_cs);
+        RtlLeaveCriticalSection(&reg_mui_cs);
     }
     *req_chars = size + 1;
 
@@ -2739,7 +2739,7 @@ cleanup:
     if (hModule)
         FreeLibrary(hModule);
     else
-        LeaveCriticalSection(&reg_mui_cs);
+        RtlLeaveCriticalSection(&reg_mui_cs);
     heap_free(full_name);
     return result;
 }
diff --git a/dlls/kernelbase/thread.c b/dlls/kernelbase/thread.c
index 2f0bcb7dde..f669c9d873 100644
--- a/dlls/kernelbase/thread.c
+++ b/dlls/kernelbase/thread.c
@@ -866,7 +866,7 @@ static void CDECL start_fiber(void)
     __TRY
     {
         start( fiber->param );
-        ExitThread( 1 );
+        RtlExitUserThread( 1 );
     }
     __EXCEPT(UnhandledExceptionFilter)
     {
@@ -996,7 +996,7 @@ void WINAPI DECLSPEC_HOTPATCH DeleteFiber( LPVOID fiber_ptr )
     if (fiber == NtCurrentTeb()->Tib.u.FiberData)
     {
         HeapFree( GetProcessHeap(), 0, fiber );
-        ExitThread(1);
+        RtlExitUserThread( 1 );
     }
     RtlFreeUserStack( fiber->stack_allocation );
     HeapFree( GetProcessHeap(), 0, fiber->fls_slots );




More information about the wine-cvs mailing list