mirror of
https://github.com/reactos/reactos.git
synced 2024-10-04 08:25:53 +00:00
- Move IsWow64Process to proc.c
- Implement FatalAppExitW (based on Wine) svn path=/trunk/; revision=37167
This commit is contained in:
parent
b79ada3280
commit
bc1f150d78
|
@ -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
|
||||
*/
|
||||
|
|
|
@ -17,6 +17,8 @@
|
|||
#include <debug.h>
|
||||
|
||||
|
||||
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 */
|
||||
|
|
Loading…
Reference in a new issue