ntdll: Implement RtlExitUserProcess.

This commit is contained in:
Alexandre Julliard 2013-07-19 12:15:15 +02:00
parent 1c11770159
commit 3799d55d9b
4 changed files with 18 additions and 18 deletions

View File

@ -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

View File

@ -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.@)
*

View File

@ -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

View File

@ -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);