Alexandre Julliard : ntdll: Implement RtlExitUserProcess.
Alexandre Julliard
julliard at winehq.org
Fri Jul 19 13:19:41 CDT 2013
Module: wine
Branch: master
Commit: 3799d55d9b629d4733815d73a350e2ee868b98e9
URL: http://source.winehq.org/git/wine.git/?a=commit;h=3799d55d9b629d4733815d73a350e2ee868b98e9
Author: Alexandre Julliard <julliard at winehq.org>
Date: Fri Jul 19 12:15:15 2013 +0200
ntdll: Implement RtlExitUserProcess.
---
dlls/kernel32/process.c | 20 ++------------------
dlls/ntdll/loader.c | 14 ++++++++++++++
dlls/ntdll/ntdll.spec | 1 +
include/winternl.h | 1 +
4 files changed, 18 insertions(+), 18 deletions(-)
diff --git a/dlls/kernel32/process.c b/dlls/kernel32/process.c
index 6d2f80d..6ce43d8 100644
--- a/dlls/kernel32/process.c
+++ b/dlls/kernel32/process.c
@@ -2624,30 +2624,14 @@ __ASM_STDCALL_FUNC( ExitProcess, 4, /* Shrinker depend on this particular ExitPr
".byte 0x6A, 0x00\n\t" /* pushl $0 */
".byte 0x68, 0x00, 0x00, 0x00, 0x00\n\t" /* pushl $0 - 4 bytes immediate */
"pushl 8(%ebp)\n\t"
- "call " __ASM_NAME("process_ExitProcess") __ASM_STDCALL(4) "\n\t"
+ "call " __ASM_NAME("RtlExitUserProcess") __ASM_STDCALL(4) "\n\t"
"leave\n\t"
"ret $4" )
-
-void WINAPI process_ExitProcess( DWORD status )
-{
- ULONG magic;
- LdrLockLoaderLock( 0, 0, &magic );
- RtlAcquirePebLock();
- NtTerminateProcess(0, status);
- LdrShutdownProcess();
- NtTerminateProcess(GetCurrentProcess(), status);
- exit(status);
-}
-
#else
void WINAPI ExitProcess( DWORD status )
{
- RtlAcquirePebLock();
- NtTerminateProcess(0, status);
- LdrShutdownProcess();
- NtTerminateProcess(GetCurrentProcess(), status);
- exit(status);
+ RtlExitUserProcess( status );
}
#endif
diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c
index c4d7487..b3abad0 100644
--- a/dlls/ntdll/loader.c
+++ b/dlls/ntdll/loader.c
@@ -2392,6 +2392,20 @@ void WINAPI LdrShutdownProcess(void)
process_detach();
}
+
+/******************************************************************
+ * RtlExitUserProcess (NTDLL.@)
+ */
+void WINAPI RtlExitUserProcess( DWORD status )
+{
+ RtlEnterCriticalSection( &loader_section );
+ RtlAcquirePebLock();
+ NtTerminateProcess( 0, status );
+ LdrShutdownProcess();
+ NtTerminateProcess( GetCurrentProcess(), status );
+ exit( status );
+}
+
/******************************************************************
* LdrShutdownThread (NTDLL.@)
*
diff --git a/dlls/ntdll/ntdll.spec b/dlls/ntdll/ntdll.spec
index 3d4fa2e..0d4d62d 100644
--- a/dlls/ntdll/ntdll.spec
+++ b/dlls/ntdll/ntdll.spec
@@ -568,6 +568,7 @@
@ stdcall RtlEqualString(ptr ptr long)
@ stdcall RtlEqualUnicodeString(ptr ptr long)
@ stdcall RtlEraseUnicodeString(ptr)
+@ stdcall RtlExitUserProcess(long)
@ stdcall RtlExitUserThread(long)
@ stdcall RtlExpandEnvironmentStrings_U(ptr ptr ptr ptr)
@ stub RtlExtendHeap
diff --git a/include/winternl.h b/include/winternl.h
index b45a56c..955228a 100644
--- a/include/winternl.h
+++ b/include/winternl.h
@@ -2347,6 +2347,7 @@ NTSYSAPI BOOL WINAPI RtlEqualPrefixSid(PSID,PSID);
NTSYSAPI BOOL WINAPI RtlEqualSid(PSID,PSID);
NTSYSAPI BOOLEAN WINAPI RtlEqualString(const STRING*,const STRING*,BOOLEAN);
NTSYSAPI BOOLEAN WINAPI RtlEqualUnicodeString(const UNICODE_STRING*,const UNICODE_STRING*,BOOLEAN);
+NTSYSAPI void DECLSPEC_NORETURN WINAPI RtlExitUserProcess(ULONG);
NTSYSAPI void DECLSPEC_NORETURN WINAPI RtlExitUserThread(ULONG);
NTSYSAPI NTSTATUS WINAPI RtlExpandEnvironmentStrings_U(PCWSTR, const UNICODE_STRING*, UNICODE_STRING*, ULONG*);
NTSYSAPI NTSTATUS WINAPI RtlFindActivationContextSectionString(ULONG,const GUID*,ULONG,const UNICODE_STRING*,PVOID);
More information about the wine-cvs
mailing list