From bc1f150d78b66f19fc161ea0d57870a9f168da8b Mon Sep 17 00:00:00 2001 From: Dmitry Chapyshev Date: Mon, 3 Nov 2008 12:27:39 +0000 Subject: [PATCH] - Move IsWow64Process to proc.c - Implement FatalAppExitW (based on Wine) svn path=/trunk/; revision=37167 --- reactos/dll/win32/kernel32/misc/stubs.c | 29 ------------ reactos/dll/win32/kernel32/process/proc.c | 55 +++++++++++++++++++++-- 2 files changed, 51 insertions(+), 33 deletions(-) diff --git a/reactos/dll/win32/kernel32/misc/stubs.c b/reactos/dll/win32/kernel32/misc/stubs.c index 69aa0effa77..2c68be92df1 100644 --- a/reactos/dll/win32/kernel32/misc/stubs.c +++ b/reactos/dll/win32/kernel32/misc/stubs.c @@ -531,35 +531,6 @@ IsSystemResumeAutomatic( return 0; } -/* - * @implemented - */ -BOOL -STDCALL -IsWow64Process( - HANDLE hProcess, - PBOOL Wow64Process - ) -{ - ULONG pbi; - NTSTATUS Status; - - Status = NtQueryInformationProcess(hProcess, - ProcessWow64Information, - &pbi, - sizeof(pbi), - NULL); - - if (Status != STATUS_SUCCESS) - { - SetLastError(RtlNtStatusToDosError(Status)); - return FALSE; - } - - *Wow64Process = (pbi != 0); - return TRUE; -} - /* * @unimplemented */ diff --git a/reactos/dll/win32/kernel32/process/proc.c b/reactos/dll/win32/kernel32/process/proc.c index 7fe90e6844a..801a8570dbb 100644 --- a/reactos/dll/win32/kernel32/process/proc.c +++ b/reactos/dll/win32/kernel32/process/proc.c @@ -17,6 +17,8 @@ #include +typedef INT (WINAPI *MessageBoxW_Proc) (HWND, LPCWSTR, LPCWSTR, UINT); + /* GLOBALS *******************************************************************/ WaitForInputIdleType lpfnGlobalRegisterWaitForInputIdle; @@ -617,8 +619,8 @@ TerminateProcess (HANDLE hProcess, * @unimplemented */ VOID STDCALL -FatalAppExitA (UINT uAction, - LPCSTR lpMessageText) +FatalAppExitA(UINT uAction, + LPCSTR lpMessageText) { UNICODE_STRING MessageTextU; ANSI_STRING MessageText; @@ -640,9 +642,24 @@ FatalAppExitA (UINT uAction, */ VOID STDCALL FatalAppExitW(UINT uAction, - LPCWSTR lpMessageText) + LPCWSTR lpMessageText) { - return; + static const WCHAR szUser32[] = L"user32.dll\0"; + + HMODULE hModule = GetModuleHandleW(szUser32); + MessageBoxW_Proc pMessageBoxW = NULL; + + DPRINT1("AppExit\n"); + + if (hModule) + pMessageBoxW = (MessageBoxW_Proc) GetProcAddress(hModule, "MessageBoxW"); + + if (pMessageBoxW) + pMessageBoxW(0, lpMessageText, NULL, MB_SYSTEMMODAL | MB_OK); + else + DPRINT1("%s\n", lpMessageText); + + ExitProcess(0); } @@ -895,4 +912,34 @@ GetProcessHandleCount(HANDLE hProcess, return FALSE; } + +/* + * @implemented + */ +BOOL +STDCALL +IsWow64Process( + HANDLE hProcess, + PBOOL Wow64Process + ) +{ + ULONG pbi; + NTSTATUS Status; + + Status = NtQueryInformationProcess(hProcess, + ProcessWow64Information, + &pbi, + sizeof(pbi), + NULL); + + if (!NT_SUCCESS(Status)) + { + SetLastError(RtlNtStatusToDosError(Status)); + return FALSE; + } + + *Wow64Process = (pbi != 0); + return TRUE; +} + /* EOF */