Commit 3799d55d authored by Alexandre Julliard's avatar Alexandre Julliard

ntdll: Implement RtlExitUserProcess.

parent 1c117701
...@@ -2624,30 +2624,14 @@ __ASM_STDCALL_FUNC( ExitProcess, 4, /* Shrinker depend on this particular ExitPr ...@@ -2624,30 +2624,14 @@ __ASM_STDCALL_FUNC( ExitProcess, 4, /* Shrinker depend on this particular ExitPr
".byte 0x6A, 0x00\n\t" /* pushl $0 */ ".byte 0x6A, 0x00\n\t" /* pushl $0 */
".byte 0x68, 0x00, 0x00, 0x00, 0x00\n\t" /* pushl $0 - 4 bytes immediate */ ".byte 0x68, 0x00, 0x00, 0x00, 0x00\n\t" /* pushl $0 - 4 bytes immediate */
"pushl 8(%ebp)\n\t" "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" "leave\n\t"
"ret $4" ) "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 #else
void WINAPI ExitProcess( DWORD status ) void WINAPI ExitProcess( DWORD status )
{ {
RtlAcquirePebLock(); RtlExitUserProcess( status );
NtTerminateProcess(0, status);
LdrShutdownProcess();
NtTerminateProcess(GetCurrentProcess(), status);
exit(status);
} }
#endif #endif
......
...@@ -2392,6 +2392,20 @@ void WINAPI LdrShutdownProcess(void) ...@@ -2392,6 +2392,20 @@ void WINAPI LdrShutdownProcess(void)
process_detach(); process_detach();
} }
/******************************************************************
* RtlExitUserProcess (NTDLL.@)
*/
void WINAPI RtlExitUserProcess( DWORD status )
{
RtlEnterCriticalSection( &loader_section );
RtlAcquirePebLock();
NtTerminateProcess( 0, status );
LdrShutdownProcess();
NtTerminateProcess( GetCurrentProcess(), status );
exit( status );
}
/****************************************************************** /******************************************************************
* LdrShutdownThread (NTDLL.@) * LdrShutdownThread (NTDLL.@)
* *
......
...@@ -568,6 +568,7 @@ ...@@ -568,6 +568,7 @@
@ stdcall RtlEqualString(ptr ptr long) @ stdcall RtlEqualString(ptr ptr long)
@ stdcall RtlEqualUnicodeString(ptr ptr long) @ stdcall RtlEqualUnicodeString(ptr ptr long)
@ stdcall RtlEraseUnicodeString(ptr) @ stdcall RtlEraseUnicodeString(ptr)
@ stdcall RtlExitUserProcess(long)
@ stdcall RtlExitUserThread(long) @ stdcall RtlExitUserThread(long)
@ stdcall RtlExpandEnvironmentStrings_U(ptr ptr ptr ptr) @ stdcall RtlExpandEnvironmentStrings_U(ptr ptr ptr ptr)
@ stub RtlExtendHeap @ stub RtlExtendHeap
......
...@@ -2347,6 +2347,7 @@ NTSYSAPI BOOL WINAPI RtlEqualPrefixSid(PSID,PSID); ...@@ -2347,6 +2347,7 @@ NTSYSAPI BOOL WINAPI RtlEqualPrefixSid(PSID,PSID);
NTSYSAPI BOOL WINAPI RtlEqualSid(PSID,PSID); NTSYSAPI BOOL WINAPI RtlEqualSid(PSID,PSID);
NTSYSAPI BOOLEAN WINAPI RtlEqualString(const STRING*,const STRING*,BOOLEAN); NTSYSAPI BOOLEAN WINAPI RtlEqualString(const STRING*,const STRING*,BOOLEAN);
NTSYSAPI BOOLEAN WINAPI RtlEqualUnicodeString(const UNICODE_STRING*,const UNICODE_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 void DECLSPEC_NORETURN WINAPI RtlExitUserThread(ULONG);
NTSYSAPI NTSTATUS WINAPI RtlExpandEnvironmentStrings_U(PCWSTR, const UNICODE_STRING*, UNICODE_STRING*, 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); NTSYSAPI NTSTATUS WINAPI RtlFindActivationContextSectionString(ULONG,const GUID*,ULONG,const UNICODE_STRING*,PVOID);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment