[ros-dev] [ros-diffs] [hbelusca] 58154: [REACTOS] Fix the debugging macros introduced in r58132 (for the _FATAL case): do not use exceptions but instead a breakpoint followed by a process termination procedure (or a bug...
Timo Kreuzer
timo.kreuzer at web.de
Fri Jan 11 21:11:38 UTC 2013
Why not use NtTerminateProcess() for non-native apps?
Am 10.01.2013 02:45, schrieb hbelusca at svn.reactos.org:
> +/*
> + * Declare a target-dependent process termination procedure.
> + */
> +#ifndef_NTDDK_ /* User-Mode */
> + #ifndef NTOS_MODE_USER /* Should be Win32 */
> + #ifndef _WIN32
> + #error "Unsupported target."
> + #else
> + #define TerminateCurrentProcess(Status) TerminateProcess(GetCurrentProcess(), (Status))
> + #endif
> + #else /* Native */
> + #ifndef _PSFUNCS_H
> + NTSYSCALLAPI
> + NTSTATUS
> + NTAPI
> + NtTerminateProcess(
> + IN HANDLE ProcessHandle,
> + IN NTSTATUS ExitStatus
> + );
> + #endif
> + #ifndef NtCurrentProcess
> + #define NtCurrentProcess() ((HANDLE)(LONG_PTR)-1)
> + #endif
> + #define TerminateCurrentProcess(Status) NtTerminateProcess(NtCurrentProcess(), (Status))
> + #endif
> +#else /* Kernel-Mode */
> + #include <bugcodes.h>
> + #define TerminateCurrentProcess(Status) KeBugCheckEx(CRITICAL_SERVICE_FAILED, (Status), 0, 0, 0)
> +#endif
> +
More information about the Ros-dev
mailing list