I tried to test this with calc, but then you need to explicitly add a
linkage to ntdll (in cmakelists.txt), that I don't want to do.
-----Message d'origine-----
De : ros-dev-bounces(a)reactos.org [mailto:ros-dev-bounces@reactos.org] De la
part de Timo Kreuzer
Envoyé : vendredi 11 janvier 2013 22:12
À : ros-dev(a)reactos.org
Objet : Re: [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...
Why not use NtTerminateProcess() for non-native apps?
Am 10.01.2013 02:45, schrieb hbelusca(a)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
+
_______________________________________________
Ros-dev mailing list
Ros-dev(a)reactos.org
http://www.reactos.org/mailman/listinfo/ros-dev