mirror of
https://github.com/reactos/reactos.git
synced 2025-07-25 17:53:48 +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;
|
||||
}
|
||||
|
||||
/*
|
||||
* @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,7 +619,7 @@ TerminateProcess (HANDLE hProcess,
|
|||
* @unimplemented
|
||||
*/
|
||||
VOID STDCALL
|
||||
FatalAppExitA (UINT uAction,
|
||||
FatalAppExitA(UINT uAction,
|
||||
LPCSTR lpMessageText)
|
||||
{
|
||||
UNICODE_STRING MessageTextU;
|
||||
|
@ -642,7 +644,22 @@ VOID STDCALL
|
|||
FatalAppExitW(UINT uAction,
|
||||
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…
Add table
Add a link
Reference in a new issue