mirror of
https://github.com/decompals/wibo.git
synced 2025-10-17 15:45:15 +00:00
Always use _exit to terminate (for now)
This commit is contained in:
parent
dc5a91c480
commit
e185629d19
@ -1,5 +1,6 @@
|
||||
#include "common.h"
|
||||
#include "context.h"
|
||||
#include "kernel32/internal.h"
|
||||
#include "modules.h"
|
||||
|
||||
#include <csignal>
|
||||
@ -291,7 +292,7 @@ void WIN_ENTRY exit(int status) {
|
||||
(*it)();
|
||||
}
|
||||
}
|
||||
::_exit(status);
|
||||
kernel32::exitInternal(status);
|
||||
}
|
||||
|
||||
void WIN_ENTRY _cexit() {
|
||||
@ -310,7 +311,7 @@ void WIN_ENTRY _cexit() {
|
||||
void WIN_ENTRY _exit(int status) {
|
||||
HOST_CONTEXT_GUARD();
|
||||
DEBUG_LOG("_exit(%i)\n", status);
|
||||
::_exit(status);
|
||||
kernel32::exitInternal(status);
|
||||
}
|
||||
|
||||
void WIN_ENTRY abort(void) {
|
||||
|
@ -3,6 +3,7 @@
|
||||
#include "common.h"
|
||||
#include "context.h"
|
||||
#include "errors.h"
|
||||
#include "internal.h"
|
||||
|
||||
namespace {
|
||||
|
||||
@ -35,7 +36,7 @@ void WIN_FUNC RaiseException(DWORD dwExceptionCode, DWORD dwExceptionFlags, DWOR
|
||||
(void)dwExceptionFlags;
|
||||
(void)nNumberOfArguments;
|
||||
(void)lpArguments;
|
||||
exit(static_cast<int>(dwExceptionCode));
|
||||
exitInternal(dwExceptionCode);
|
||||
}
|
||||
|
||||
PVOID WIN_FUNC AddVectoredExceptionHandler(ULONG First, PVECTORED_EXCEPTION_HANDLER Handler) {
|
||||
|
@ -183,5 +183,6 @@ inline bool isPseudoCurrentThreadHandle(HANDLE h) {
|
||||
|
||||
void tryMarkExecutable(void *mem);
|
||||
void setLastErrorFromErrno();
|
||||
[[noreturn]] void exitInternal(DWORD exitCode);
|
||||
|
||||
} // namespace kernel32
|
||||
|
@ -312,17 +312,24 @@ DWORD_PTR WIN_FUNC SetThreadAffinityMask(HANDLE hThread, DWORD_PTR dwThreadAffin
|
||||
return processMask;
|
||||
}
|
||||
|
||||
[[noreturn]] void exitInternal(DWORD exitCode) {
|
||||
DEBUG_LOG("exitInternal(%u)\n", exitCode);
|
||||
// We have some problems cleaning up when shutting down with exit;
|
||||
// temporarily use _exit to terminate without running cleanup
|
||||
_exit(static_cast<int>(exitCode));
|
||||
}
|
||||
|
||||
void WIN_FUNC ExitProcess(UINT uExitCode) {
|
||||
HOST_CONTEXT_GUARD();
|
||||
DEBUG_LOG("ExitProcess(%u)\n", uExitCode);
|
||||
exit(static_cast<int>(uExitCode));
|
||||
exitInternal(uExitCode);
|
||||
}
|
||||
|
||||
BOOL WIN_FUNC TerminateProcess(HANDLE hProcess, UINT uExitCode) {
|
||||
HOST_CONTEXT_GUARD();
|
||||
DEBUG_LOG("TerminateProcess(%p, %u)\n", hProcess, uExitCode);
|
||||
if (isPseudoCurrentProcessHandle(hProcess)) {
|
||||
exit(static_cast<int>(uExitCode));
|
||||
exitInternal(uExitCode);
|
||||
}
|
||||
auto process = wibo::handles().getAs<ProcessObject>(hProcess);
|
||||
if (!process) {
|
||||
|
@ -1,5 +1,6 @@
|
||||
#include "common.h"
|
||||
#include "context.h"
|
||||
#include "kernel32/internal.h"
|
||||
#include "modules.h"
|
||||
|
||||
namespace mscoree {
|
||||
@ -7,7 +8,7 @@ namespace mscoree {
|
||||
void WIN_FUNC CorExitProcess(int exitCode) {
|
||||
HOST_CONTEXT_GUARD();
|
||||
DEBUG_LOG("CorExitProcess(%i)\n", exitCode);
|
||||
exit(exitCode);
|
||||
kernel32::exitInternal(exitCode);
|
||||
}
|
||||
|
||||
} // namespace mscoree
|
||||
|
@ -2741,7 +2741,7 @@ namespace msvcrt {
|
||||
void WIN_ENTRY exit(int status) {
|
||||
HOST_CONTEXT_GUARD();
|
||||
VERBOSE_LOG("exit(%d)\n", status);
|
||||
_Exit(status);
|
||||
kernel32::exitInternal(status);
|
||||
}
|
||||
|
||||
int WIN_ENTRY wcsncmp(const uint16_t *string1, const uint16_t *string2, size_t count) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user