mirror of
https://github.com/reactos/reactos.git
synced 2025-07-25 17:43: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
2 changed files with 51 additions and 33 deletions
|
@ -531,35 +531,6 @@ IsSystemResumeAutomatic(
|
||||||
return 0;
|
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
|
* @unimplemented
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -17,6 +17,8 @@
|
||||||
#include <debug.h>
|
#include <debug.h>
|
||||||
|
|
||||||
|
|
||||||
|
typedef INT (WINAPI *MessageBoxW_Proc) (HWND, LPCWSTR, LPCWSTR, UINT);
|
||||||
|
|
||||||
/* GLOBALS *******************************************************************/
|
/* GLOBALS *******************************************************************/
|
||||||
|
|
||||||
WaitForInputIdleType lpfnGlobalRegisterWaitForInputIdle;
|
WaitForInputIdleType lpfnGlobalRegisterWaitForInputIdle;
|
||||||
|
@ -617,8 +619,8 @@ TerminateProcess (HANDLE hProcess,
|
||||||
* @unimplemented
|
* @unimplemented
|
||||||
*/
|
*/
|
||||||
VOID STDCALL
|
VOID STDCALL
|
||||||
FatalAppExitA (UINT uAction,
|
FatalAppExitA(UINT uAction,
|
||||||
LPCSTR lpMessageText)
|
LPCSTR lpMessageText)
|
||||||
{
|
{
|
||||||
UNICODE_STRING MessageTextU;
|
UNICODE_STRING MessageTextU;
|
||||||
ANSI_STRING MessageText;
|
ANSI_STRING MessageText;
|
||||||
|
@ -640,9 +642,24 @@ FatalAppExitA (UINT uAction,
|
||||||
*/
|
*/
|
||||||
VOID STDCALL
|
VOID STDCALL
|
||||||
FatalAppExitW(UINT uAction,
|
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;
|
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 */
|
/* EOF */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue