https://git.reactos.org/?p=reactos.git;a=commitdiff;h=5a1a35ca5a6fca02dcabc…
commit 5a1a35ca5a6fca02dcabced12a5d19b020dc184d
Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
AuthorDate: Sun Mar 4 17:38:06 2018 +0100
Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
CommitDate: Sat Apr 7 18:48:09 2018 +0200
[USERSRV] Hard-error improvements 3/7
- Cache localized hard error message components: the status severity,
the system process name and the unhandled exception debug strings.
- Try not to fail too much. In particular, don't fail if a string could
not be correctly captured in UserpCaptureStringParameters() (we then
use a default empty string). The next aim is to make UserpFormatMessages()
not failing at all.
- Use RtlStringCbPrintf(Ex)W where possible so that one can use counted
(and not NULL-terminated) UNICODE_STRINGs where possible. This allows
using counted resource strings without having to allocate memory.
- If available, prepend the window title of the application that
triggered the hard error to the hard error message box caption.
---
win32ss/user/winsrv/usersrv/harderror.c | 285 +++++++++++++++++++-----------
win32ss/user/winsrv/usersrv/init.c | 16 ++
win32ss/user/winsrv/usersrv/lang/bg-BG.rc | 17 ++
win32ss/user/winsrv/usersrv/lang/cs-CZ.rc | 17 ++
win32ss/user/winsrv/usersrv/lang/de-DE.rc | 17 ++
win32ss/user/winsrv/usersrv/lang/el-GR.rc | 17 ++
win32ss/user/winsrv/usersrv/lang/en-US.rc | 17 ++
win32ss/user/winsrv/usersrv/lang/es-ES.rc | 17 ++
win32ss/user/winsrv/usersrv/lang/fr-FR.rc | 17 ++
win32ss/user/winsrv/usersrv/lang/he-IL.rc | 17 ++
win32ss/user/winsrv/usersrv/lang/id-ID.rc | 17 ++
win32ss/user/winsrv/usersrv/lang/it-IT.rc | 17 ++
win32ss/user/winsrv/usersrv/lang/ja-JP.rc | 17 ++
win32ss/user/winsrv/usersrv/lang/no-NO.rc | 17 ++
win32ss/user/winsrv/usersrv/lang/pl-PL.rc | 17 ++
win32ss/user/winsrv/usersrv/lang/pt-BR.rc | 17 ++
win32ss/user/winsrv/usersrv/lang/ro-RO.rc | 17 ++
win32ss/user/winsrv/usersrv/lang/ru-RU.rc | 17 ++
win32ss/user/winsrv/usersrv/lang/sk-SK.rc | 17 ++
win32ss/user/winsrv/usersrv/lang/sv-SE.rc | 17 ++
win32ss/user/winsrv/usersrv/lang/tr-TR.rc | 17 ++
win32ss/user/winsrv/usersrv/lang/uk-UA.rc | 17 ++
win32ss/user/winsrv/usersrv/lang/zh-CN.rc | 17 ++
win32ss/user/winsrv/usersrv/lang/zh-TW.rc | 17 ++
win32ss/user/winsrv/usersrv/resource.h | 23 ++-
win32ss/user/winsrv/usersrv/shutdown.c | 12 --
win32ss/user/winsrv/usersrv/usersrv.h | 8 +
27 files changed, 601 insertions(+), 117 deletions(-)
diff --git a/win32ss/user/winsrv/usersrv/harderror.c
b/win32ss/user/winsrv/usersrv/harderror.c
index 19a8db644f..463911ba73 100644
--- a/win32ss/user/winsrv/usersrv/harderror.c
+++ b/win32ss/user/winsrv/usersrv/harderror.c
@@ -18,14 +18,49 @@
#include <undocelfapi.h>
#include <ntstrsafe.h>
+#include "resource.h"
+
#define NDEBUG
#include <debug.h>
-#define IDTRYAGAIN 10
-#define IDCONTINUE 11
/* FUNCTIONS ******************************************************************/
+/* Cache for the localized hard-error message box strings */
+LANGID g_CurrentUserLangId = 0;
+UNICODE_STRING g_SuccessU = {0, 0, NULL};
+UNICODE_STRING g_InformationU = {0, 0, NULL};
+UNICODE_STRING g_WarningU = {0, 0, NULL};
+UNICODE_STRING g_ErrorU = {0, 0, NULL};
+UNICODE_STRING g_SystemProcessU = {0, 0, NULL};
+UNICODE_STRING g_OKTerminateU = {0, 0, NULL};
+UNICODE_STRING g_CancelDebugU = {0, 0, NULL};
+
+VOID
+RtlLoadUnicodeString(
+ IN HINSTANCE hInstance OPTIONAL,
+ IN UINT uID,
+ OUT PUNICODE_STRING pUnicodeString,
+ IN PCWSTR pDefaultString)
+{
+ UINT Length;
+
+ /* Try to load the string from the resource */
+ Length = LoadStringW(hInstance, uID, (LPWSTR)&pUnicodeString->Buffer, 0);
+ if (Length == 0)
+ {
+ /* If the resource string was not found, use the fallback default one */
+ RtlInitUnicodeString(pUnicodeString, pDefaultString);
+ }
+ else
+ {
+ /* Set the string length (not NULL-terminated!) */
+ pUnicodeString->MaximumLength = (USHORT)(Length * sizeof(WCHAR));
+ pUnicodeString->Length = pUnicodeString->MaximumLength;
+ }
+}
+
+
/* FIXME */
int
WINAPI
@@ -133,15 +168,15 @@ static
VOID
UserpFreeStringParameters(
IN OUT PULONG_PTR Parameters,
- IN PHARDERROR_MSG HardErrorMessage)
+ IN PHARDERROR_MSG Message)
{
ULONG nParam;
/* Loop all parameters */
- for (nParam = 0; nParam < HardErrorMessage->NumberOfParameters; nParam++)
+ for (nParam = 0; nParam < Message->NumberOfParameters; ++nParam)
{
/* Check if the current parameter is a string */
- if ((HardErrorMessage->UnicodeStringParameterMask & (1 << nParam))
&& (Parameters[nParam] != 0))
+ if ((Message->UnicodeStringParameterMask & (1 << nParam)) &&
(Parameters[nParam] != 0))
{
/* Free the string buffer */
RtlFreeHeap(RtlGetProcessHeap(), 0, (PVOID)Parameters[nParam]);
@@ -150,14 +185,14 @@ UserpFreeStringParameters(
}
static
-NTSTATUS
+VOID
UserpCaptureStringParameters(
OUT PULONG_PTR Parameters,
OUT PULONG SizeOfAllUnicodeStrings,
- IN PHARDERROR_MSG HardErrorMessage,
+ IN PHARDERROR_MSG Message,
IN HANDLE hProcess OPTIONAL)
{
- NTSTATUS Status = STATUS_SUCCESS;
+ NTSTATUS Status;
ULONG nParam, Size = 0;
UNICODE_STRING TempStringU, ParamStringU;
ANSI_STRING TempStringA;
@@ -166,12 +201,12 @@ UserpCaptureStringParameters(
*SizeOfAllUnicodeStrings = 0;
/* Read all strings from client space */
- for (nParam = 0; nParam < HardErrorMessage->NumberOfParameters; nParam++)
+ for (nParam = 0; nParam < Message->NumberOfParameters; ++nParam)
{
Parameters[nParam] = 0;
/* Check if the current parameter is a unicode string */
- if (HardErrorMessage->UnicodeStringParameterMask & (1 << nParam))
+ if (Message->UnicodeStringParameterMask & (1 << nParam))
{
/* Skip this string if we do not have a client process */
if (!hProcess)
@@ -179,14 +214,14 @@ UserpCaptureStringParameters(
/* Read the UNICODE_STRING from the process memory */
Status = NtReadVirtualMemory(hProcess,
- (PVOID)HardErrorMessage->Parameters[nParam],
+ (PVOID)Message->Parameters[nParam],
&ParamStringU,
sizeof(ParamStringU),
NULL);
if (!NT_SUCCESS(Status))
{
/* We failed, skip this string */
- DPRINT1("NtReadVirtualMemory(HardErrorMessage->Parameters)
failed, Status 0x%lx\n", Status);
+ DPRINT1("NtReadVirtualMemory(Message->Parameters) failed, Status
0x%lx, skipping.\n", Status);
continue;
}
@@ -199,8 +234,7 @@ UserpCaptureStringParameters(
if (!TempStringU.Buffer)
{
/* We failed, skip this string */
- DPRINT1("Cannot allocate memory with size %u\n",
TempStringU.MaximumLength);
- Status = STATUS_NO_MEMORY;
+ DPRINT1("Cannot allocate memory with size %u, skipping.\n",
TempStringU.MaximumLength);
continue;
}
@@ -213,7 +247,7 @@ UserpCaptureStringParameters(
if (!NT_SUCCESS(Status))
{
/* We failed, skip this string */
- DPRINT1("NtReadVirtualMemory(ParamStringU) failed, Status
0x%lx\n", Status);
+ DPRINT1("NtReadVirtualMemory(ParamStringU) failed, Status 0x%lx,
skipping.\n", Status);
RtlFreeHeap(RtlGetProcessHeap(), 0, TempStringU.Buffer);
continue;
}
@@ -228,9 +262,8 @@ UserpCaptureStringParameters(
if (!TempStringA.Buffer)
{
/* We failed, skip this string */
- DPRINT1("Cannot allocate memory with size %u\n",
TempStringA.MaximumLength);
+ DPRINT1("Cannot allocate memory with size %u, skipping.\n",
TempStringA.MaximumLength);
RtlFreeHeap(RtlGetProcessHeap(), 0, TempStringU.Buffer);
- Status = STATUS_NO_MEMORY;
continue;
}
@@ -240,6 +273,7 @@ UserpCaptureStringParameters(
if (!NT_SUCCESS(Status))
{
/* We failed, skip this string */
+ DPRINT1("RtlUnicodeStringToAnsiString() failed, Status 0x%lx,
skipping.\n", Status);
RtlFreeHeap(RtlGetProcessHeap(), 0, TempStringA.Buffer);
continue;
}
@@ -251,22 +285,12 @@ UserpCaptureStringParameters(
else
{
/* It's not a unicode string, just copy the parameter */
- Parameters[nParam] = HardErrorMessage->Parameters[nParam];
+ Parameters[nParam] = Message->Parameters[nParam];
}
}
-#if 0
- if (!NT_SUCCESS(Status))
- {
- UserpFreeStringParameters(Parameters, HardErrorMessage);
- return Status;
- }
-#endif
-
if (SizeOfAllUnicodeStrings)
*SizeOfAllUnicodeStrings = Size;
-
- return Status;
}
static
@@ -280,11 +304,13 @@ UserpFormatMessages(
IN HANDLE hProcess OPTIONAL)
{
NTSTATUS Status;
- UNICODE_STRING FileNameU, TempStringU, FormatU, Format2U;
+ UNICODE_STRING FileNameU, TempStringU, WindowTitleU, FormatU, Format2U;
ANSI_STRING FormatA, Format2A;
+ HWND hwndOwner;
PMESSAGE_RESOURCE_ENTRY MessageResource;
ULONG_PTR CapturedParameters[MAXIMUM_HARDERROR_PARAMETERS];
- PWSTR FormatString;
+ PWSTR FormatString, pszBuffer;
+ size_t cchBuffer;
ULONG ExceptionCode, Severity;
ULONG Size;
@@ -302,8 +328,8 @@ UserpFormatMessages(
*/
if (!hProcess || !NT_SUCCESS(Status) || !FileNameU.Buffer)
{
- RtlInitUnicodeString(&FileNameU, L"System Process");
- hProcess = NULL;
+ hProcess = NULL;
+ FileNameU = g_SystemProcessU;
}
Severity = (ULONG)(Message->Status) >> 30;
@@ -324,7 +350,7 @@ UserpFormatMessages(
else
{
RtlInitAnsiString(&FormatA, (PCHAR)MessageResource->Text);
- RtlAnsiStringToUnicodeString(&FormatU, &FormatA, TRUE);
+ /* Status = */ RtlAnsiStringToUnicodeString(&FormatU, &FormatA,
TRUE);
}
}
else
@@ -354,23 +380,52 @@ UserpFormatMessages(
}
else
{
- /* FIXME: Use localized strings! */
-
if (Severity == STATUS_SEVERITY_SUCCESS)
- RtlInitUnicodeString(&TempStringU, L"Success");
+ TempStringU = g_SuccessU;
else if (Severity == STATUS_SEVERITY_INFORMATIONAL)
- RtlInitUnicodeString(&TempStringU, L"System Information");
+ TempStringU = g_InformationU;
else if (Severity == STATUS_SEVERITY_WARNING)
- RtlInitUnicodeString(&TempStringU, L"System Warning");
+ TempStringU = g_WarningU;
else if (Severity == STATUS_SEVERITY_ERROR)
- RtlInitUnicodeString(&TempStringU, L"System Error");
+ TempStringU = g_ErrorU;
else
RtlInitEmptyUnicodeString(&TempStringU, NULL, 0);
}
+ /* Retrieve the window title of the client, if it has one */
+ RtlInitEmptyUnicodeString(&WindowTitleU, NULL, 0);
+ hwndOwner = NULL;
+ EnumThreadWindows(HandleToUlong(Message->h.ClientId.UniqueThread),
+ FindTopLevelWnd, (LPARAM)&hwndOwner);
+ if (hwndOwner)
+ {
+ cchBuffer = GetWindowTextLengthW(hwndOwner);
+ if (cchBuffer != 0)
+ {
+ cchBuffer += 3; // 2 characters for ": " and a NULL terminator.
+ WindowTitleU.MaximumLength = (USHORT)(cchBuffer * sizeof(WCHAR));
+ WindowTitleU.Buffer = RtlAllocateHeap(RtlGetProcessHeap(),
+ HEAP_ZERO_MEMORY,
+ WindowTitleU.MaximumLength);
+ if (WindowTitleU.Buffer)
+ {
+ cchBuffer = GetWindowTextW(hwndOwner,
+ WindowTitleU.Buffer,
+ WindowTitleU.MaximumLength / sizeof(WCHAR));
+ WindowTitleU.Length = (USHORT)(cchBuffer * sizeof(WCHAR));
+ RtlAppendUnicodeToString(&WindowTitleU, L": ");
+ }
+ else
+ {
+ RtlInitEmptyUnicodeString(&WindowTitleU, NULL, 0);
+ }
+ }
+ }
+
/* Calculate buffer length for the caption */
- CaptionStringU->MaximumLength = FileNameU.Length + TempStringU.Length +
- 4 * sizeof(WCHAR);
+ CaptionStringU->MaximumLength = WindowTitleU.Length +
+ FileNameU.Length + TempStringU.Length +
+ 3 * sizeof(WCHAR) + sizeof(UNICODE_NULL);
/* Allocate a buffer for the caption */
CaptionStringU->Buffer = RtlAllocateHeap(RtlGetProcessHeap(),
@@ -382,17 +437,16 @@ UserpFormatMessages(
Status = STATUS_NO_MEMORY;
}
- /* Append the file name, seperator and the caption text */
- CaptionStringU->Length = 0;
- RtlAppendUnicodeStringToString(CaptionStringU, &FileNameU);
- RtlAppendUnicodeToString(CaptionStringU, L" - ");
- RtlAppendUnicodeStringToString(CaptionStringU, &TempStringU);
-
- /* Zero terminate the buffer */
- CaptionStringU->Buffer[CaptionStringU->Length / sizeof(WCHAR)] = UNICODE_NULL;
+ /* Append the file name, the separator and the caption text */
+ RtlStringCbPrintfW(CaptionStringU->Buffer,
+ CaptionStringU->MaximumLength,
+ L"%wZ%wZ - %wZ",
+ &WindowTitleU, &FileNameU, &TempStringU);
+ CaptionStringU->Length = wcslen(CaptionStringU->Buffer) * sizeof(WCHAR);
- /* Free the file name buffer */
- RtlFreeUnicodeString(&FileNameU);
+ /* Free string buffers if needed */
+ if (WindowTitleU.Buffer) RtlFreeUnicodeString(&WindowTitleU);
+ if (hProcess) RtlFreeUnicodeString(&FileNameU);
// FIXME: What is 42 == ??
Size = 42;
@@ -418,7 +472,7 @@ UserpFormatMessages(
else
{
RtlInitAnsiString(&Format2A, (PCHAR)MessageResource->Text);
- RtlAnsiStringToUnicodeString(&Format2U, &Format2A, TRUE);
+ /* Status = */ RtlAnsiStringToUnicodeString(&Format2U, &Format2A,
TRUE);
}
/* Handle special cases */
@@ -440,25 +494,23 @@ UserpFormatMessages(
}
else
{
- PWSTR pTmp;
-
/* Keep the existing FormatString */
CapturedParameters[2] = CapturedParameters[1];
CapturedParameters[1] = CapturedParameters[0];
- pTmp = Format2U.Buffer;
- if (!_wcsnicmp(pTmp, L"{EXCEPTION}", 11))
+ pszBuffer = Format2U.Buffer;
+ if (!_wcsnicmp(pszBuffer, L"{EXCEPTION}", 11))
{
/*
* This is a named exception. Skip the mark and
* retrieve the exception name that follows it.
*/
- pTmp += 11;
+ pszBuffer += 11;
/* Skip '\r', '\n' */
- pTmp += 2;
+ pszBuffer += 2;
- CapturedParameters[0] = (ULONG_PTR)pTmp;
+ CapturedParameters[0] = (ULONG_PTR)pszBuffer;
}
else
{
@@ -475,18 +527,16 @@ UserpFormatMessages(
CapturedParameters[0] = (ULONG_PTR)L"unknown software exception";
}
- /* FIXME: Use localized strings! */
if (Message->ValidResponseOptions == OptionOk ||
Message->ValidResponseOptions == OptionOkCancel)
{
- // Tmp = FormatString + wcslen(FormatString);
- // *++Tmp = L'\n';
- // *++Tmp = L'\n';
- Size += 1 + wcslen(L"Click on OK to terminate the program.");
+ /* Reserve space for one newline and the OK-terminate-program string */
+ Size += 1 + (g_OKTerminateU.Length / sizeof(WCHAR));
}
if (Message->ValidResponseOptions == OptionOkCancel)
{
- Size += 1 + wcslen(L"Click on CANCEL to debug the program.");
+ /* Reserve space for one newline and the CANCEL-debug-program string */
+ Size += 1 + (g_CancelDebugU.Length / sizeof(WCHAR));
}
}
@@ -505,50 +555,50 @@ UserpFormatMessages(
Status = STATUS_NO_MEMORY;
}
+ Status = STATUS_SUCCESS;
+
/* Wrap in SEH to protect from invalid string parameters */
_SEH2_TRY
{
/* Print the string into the buffer */
- RtlStringCbPrintfW(TextStringU->Buffer,
- TextStringU->MaximumLength,
- FormatString,
- CapturedParameters[0],
- CapturedParameters[1],
- CapturedParameters[2],
- CapturedParameters[3]);
+ pszBuffer = TextStringU->Buffer;
+ cchBuffer = TextStringU->MaximumLength;
+ RtlStringCbPrintfExW(pszBuffer, cchBuffer,
+ &pszBuffer, &cchBuffer,
+ STRSAFE_IGNORE_NULLS,
+ FormatString,
+ CapturedParameters[0],
+ CapturedParameters[1],
+ CapturedParameters[2],
+ CapturedParameters[3]);
if (Message->Status == STATUS_UNHANDLED_EXCEPTION)
{
- /* FIXME: Use localized strings! */
if (Message->ValidResponseOptions == OptionOk ||
Message->ValidResponseOptions == OptionOkCancel)
{
- // Tmp = FormatString + wcslen(FormatString);
- // *++Tmp = L'\n';
- // *++Tmp = L'\n';
- RtlStringCbCatW(TextStringU->Buffer,
- TextStringU->MaximumLength,
- L"\n");
- RtlStringCbCatW(TextStringU->Buffer,
- TextStringU->MaximumLength,
- L"Click on OK to terminate the program.");
+ RtlStringCbPrintfExW(pszBuffer, cchBuffer,
+ &pszBuffer, &cchBuffer,
+ STRSAFE_IGNORE_NULLS,
+ L"\n%wZ",
+ &g_OKTerminateU);
}
if (Message->ValidResponseOptions == OptionOkCancel)
{
- RtlStringCbCatW(TextStringU->Buffer,
- TextStringU->MaximumLength,
- L"\n");
- RtlStringCbCatW(TextStringU->Buffer,
- TextStringU->MaximumLength,
- L"Click on CANCEL to debug the program.");
+ RtlStringCbPrintfExW(pszBuffer, cchBuffer,
+ &pszBuffer, &cchBuffer,
+ STRSAFE_IGNORE_NULLS,
+ L"\n%wZ",
+ &g_CancelDebugU);
}
}
-
- Status = STATUS_SUCCESS;
}
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
{
/* An exception occurred, use a default string */
+ DPRINT1("Exception 0x%08lx occurred while building hard-error message, fall
back to default message.\n",
+ _SEH2_GetExceptionCode());
+
RtlStringCbPrintfW(TextStringU->Buffer,
TextStringU->MaximumLength,
L"Exception processing message 0x%08lx\n"
@@ -559,8 +609,6 @@ UserpFormatMessages(
/* Set error and free buffers */
// Status = _SEH2_GetExceptionCode();
- // RtlFreeHeap(RtlGetProcessHeap(), 0, TextStringU->Buffer);
- // RtlFreeHeap(RtlGetProcessHeap(), 0, CaptionStringU->Buffer);
}
_SEH2_END;
@@ -569,7 +617,7 @@ UserpFormatMessages(
TextStringU->Length = wcslen(TextStringU->Buffer) * sizeof(WCHAR);
}
- /* Free converted Unicode strings if the original format strings were Ansi */
+ /* Free converted Unicode strings */
if (Format2A.Buffer) RtlFreeUnicodeString(&Format2U);
if (FormatA.Buffer) RtlFreeUnicodeString(&FormatU);
@@ -863,13 +911,11 @@ UserServerHardError(
hProcess = NULL;
}
+ /* Re-initialize the hard errors cache */
+ UserInitHardErrorsCache();
+
/* Capture all string parameters from the process memory */
- Status = UserpCaptureStringParameters(Parameters, &Size, Message, hProcess);
- if (!NT_SUCCESS(Status))
- {
- if (hProcess) NtClose(hProcess);
- return;
- }
+ UserpCaptureStringParameters(Parameters, &Size, Message, hProcess);
/* Format the message caption and text */
Status = UserpFormatMessages(&TextU,
@@ -930,4 +976,45 @@ Quit:
return;
}
+VOID
+UserInitHardErrorsCache(VOID)
+{
+ NTSTATUS Status;
+ LCID CurrentUserLCID = 0;
+
+ Status = NtQueryDefaultLocale(TRUE, &CurrentUserLCID);
+ if (!NT_SUCCESS(Status) || CurrentUserLCID == 0)
+ {
+ /* Fall back to english locale */
+ DPRINT1("NtQueryDefaultLocale failed with Status = 0x%08lx\n",
Status);
+ // LOCALE_SYSTEM_DEFAULT;
+ CurrentUserLCID = MAKELCID(MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US),
SORT_DEFAULT);
+ }
+ if (g_CurrentUserLangId == LANGIDFROMLCID(CurrentUserLCID))
+ {
+ /* The current lang ID and the hard error strings have already been cached */
+ return;
+ }
+
+ /* Load the strings using the current system locale */
+ RtlLoadUnicodeString(UserServerDllInstance, IDS_SEVERITY_SUCCESS,
+ &g_SuccessU, L"Success");
+ RtlLoadUnicodeString(UserServerDllInstance, IDS_SEVERITY_INFORMATIONAL,
+ &g_InformationU, L"System Information");
+ RtlLoadUnicodeString(UserServerDllInstance, IDS_SEVERITY_WARNING,
+ &g_WarningU, L"System Warning");
+ RtlLoadUnicodeString(UserServerDllInstance, IDS_SEVERITY_ERROR,
+ &g_ErrorU, L"System Error");
+ // "unknown software exception"
+ RtlLoadUnicodeString(UserServerDllInstance, IDS_SYSTEM_PROCESS,
+ &g_SystemProcessU, L"System Process");
+ RtlLoadUnicodeString(UserServerDllInstance, IDS_OK_TERMINATE_PROGRAM,
+ &g_OKTerminateU, L"Click on OK to terminate the
program.");
+ RtlLoadUnicodeString(UserServerDllInstance, IDS_CANCEL_DEBUG_PROGRAM,
+ &g_CancelDebugU, L"Click on CANCEL to debug the
program.");
+
+ /* Remember that we cached the hard error strings */
+ g_CurrentUserLangId = LANGIDFROMLCID(CurrentUserLCID);
+}
+
/* EOF */
diff --git a/win32ss/user/winsrv/usersrv/init.c b/win32ss/user/winsrv/usersrv/init.c
index 2e9ac5a66f..8ee21e6417 100644
--- a/win32ss/user/winsrv/usersrv/init.c
+++ b/win32ss/user/winsrv/usersrv/init.c
@@ -90,6 +90,19 @@ PCHAR UserServerApiNameTable[UserpMaxApiNumber -
USERSRV_FIRST_API_NUMBER] =
/* FUNCTIONS ******************************************************************/
+BOOL CALLBACK
+FindTopLevelWnd(
+ IN HWND hWnd,
+ IN LPARAM lParam)
+{
+ if (GetWindow(hWnd, GW_OWNER) == NULL)
+ {
+ *(HWND*)lParam = hWnd;
+ return FALSE;
+ }
+ return TRUE;
+}
+
// PUSER_SOUND_SENTRY. Used in basesrv.dll
BOOL NTAPI _UserSoundSentry(VOID)
{
@@ -256,6 +269,9 @@ CSR_SERVER_DLL_INIT(UserServerDllInitialization)
/* Set the process creation notify routine for BASE */
BaseSetProcessCreateNotify(NtUserNotifyProcessCreate);
+ /* Initialize the hard errors cache */
+ UserInitHardErrorsCache();
+
/* Initialize the kernel mode subsystem */
Status = NtUserInitialize(USER_VERSION,
ghPowerRequestEvent,
diff --git a/win32ss/user/winsrv/usersrv/lang/bg-BG.rc
b/win32ss/user/winsrv/usersrv/lang/bg-BG.rc
index 56728454be..52e986ec16 100644
--- a/win32ss/user/winsrv/usersrv/lang/bg-BG.rc
+++ b/win32ss/user/winsrv/usersrv/lang/bg-BG.rc
@@ -22,3 +22,20 @@ BEGIN
LTEXT "За да се върнете в РеактОС и да проверите състоянието на приложението,
натиснете „Отказ“.", IDC_STATIC, 7, 26, 178, 16
LTEXT "Ако решите да затворите приложението веднага, ще изгубите всички
незаписани данни. За да прекратите приложението веднага, натиснете „Прекратяване
веднага“.", IDC_STATIC, 7, 53, 178, 26
END
+
+
+STRINGTABLE
+BEGIN
+ IDS_SEVERITY_SUCCESS "Success"
+ IDS_SEVERITY_INFORMATIONAL "System Information"
+ IDS_SEVERITY_WARNING "System Warning"
+ IDS_SEVERITY_ERROR "System Error"
+END
+
+STRINGTABLE
+BEGIN
+ IDS_SYSTEM_PROCESS "System Process"
+ IDS_UNKNOWN_SOFTWARE_EXCEPT "unknown software exception"
+ IDS_OK_TERMINATE_PROGRAM "Click on OK to terminate the program."
+ IDS_CANCEL_DEBUG_PROGRAM "Click on CANCEL to debug the program."
+END
diff --git a/win32ss/user/winsrv/usersrv/lang/cs-CZ.rc
b/win32ss/user/winsrv/usersrv/lang/cs-CZ.rc
index 747e0dcd16..46b44808ed 100644
--- a/win32ss/user/winsrv/usersrv/lang/cs-CZ.rc
+++ b/win32ss/user/winsrv/usersrv/lang/cs-CZ.rc
@@ -24,3 +24,20 @@ BEGIN
LTEXT "Kliknutím na Storno se lze vrátit do systému ReactOS a ověřit stav
programu.", IDC_STATIC, 7, 26, 178, 16
LTEXT "Pokud zvolíte okamžité ukončení programu, všechna neuložená data budou
ztracena. Kliknutím na Ukončit okamžitě ukončíte program.", IDC_STATIC, 7, 53, 178,
26
END
+
+
+STRINGTABLE
+BEGIN
+ IDS_SEVERITY_SUCCESS "Success"
+ IDS_SEVERITY_INFORMATIONAL "System Information"
+ IDS_SEVERITY_WARNING "System Warning"
+ IDS_SEVERITY_ERROR "System Error"
+END
+
+STRINGTABLE
+BEGIN
+ IDS_SYSTEM_PROCESS "System Process"
+ IDS_UNKNOWN_SOFTWARE_EXCEPT "unknown software exception"
+ IDS_OK_TERMINATE_PROGRAM "Click on OK to terminate the program."
+ IDS_CANCEL_DEBUG_PROGRAM "Click on CANCEL to debug the program."
+END
diff --git a/win32ss/user/winsrv/usersrv/lang/de-DE.rc
b/win32ss/user/winsrv/usersrv/lang/de-DE.rc
index afb4741ecf..8d854f06c3 100644
--- a/win32ss/user/winsrv/usersrv/lang/de-DE.rc
+++ b/win32ss/user/winsrv/usersrv/lang/de-DE.rc
@@ -22,3 +22,20 @@ BEGIN
LTEXT "Um zu ReactOS zurückzukehren und den Status der Anwendung zu überprüfen,
wählen Sie Abbrechen.", IDC_STATIC, 7, 26, 178, 16
LTEXT "Wenn Sie das Programm sofort beenden, werden Sie eventuell ungespeicherte
Daten verlieren. Um das Programm zu beenden, wählen Sie Jetzt beenden.", IDC_STATIC,
7, 53, 178, 26
END
+
+
+STRINGTABLE
+BEGIN
+ IDS_SEVERITY_SUCCESS "Success"
+ IDS_SEVERITY_INFORMATIONAL "System Information"
+ IDS_SEVERITY_WARNING "System Warning"
+ IDS_SEVERITY_ERROR "System Error"
+END
+
+STRINGTABLE
+BEGIN
+ IDS_SYSTEM_PROCESS "System Process"
+ IDS_UNKNOWN_SOFTWARE_EXCEPT "unknown software exception"
+ IDS_OK_TERMINATE_PROGRAM "Click on OK to terminate the program."
+ IDS_CANCEL_DEBUG_PROGRAM "Click on CANCEL to debug the program."
+END
diff --git a/win32ss/user/winsrv/usersrv/lang/el-GR.rc
b/win32ss/user/winsrv/usersrv/lang/el-GR.rc
index 7468f527f3..4adb7d79df 100644
--- a/win32ss/user/winsrv/usersrv/lang/el-GR.rc
+++ b/win32ss/user/winsrv/usersrv/lang/el-GR.rc
@@ -22,3 +22,20 @@ BEGIN
LTEXT "Για να επιστρέψετε στο ReactOS και να ελέγξετε την κατάσταση του
προγράμματος, πατήστε 'ʼκυρο'.", IDC_STATIC, 7, 26, 178, 16
LTEXT "Αν κλείσετε την εφαρμογή τώρα , θα χάσετε όλα τα μη αποθηκευμένα
δεδομένα. Για να κλείσετε το πρόγραμμα τώρα, πατήστε 'Κλείσιμο Τώρα'.",
IDC_STATIC, 7, 53, 178, 26
END
+
+
+STRINGTABLE
+BEGIN
+ IDS_SEVERITY_SUCCESS "Success"
+ IDS_SEVERITY_INFORMATIONAL "System Information"
+ IDS_SEVERITY_WARNING "System Warning"
+ IDS_SEVERITY_ERROR "System Error"
+END
+
+STRINGTABLE
+BEGIN
+ IDS_SYSTEM_PROCESS "System Process"
+ IDS_UNKNOWN_SOFTWARE_EXCEPT "unknown software exception"
+ IDS_OK_TERMINATE_PROGRAM "Click on OK to terminate the program."
+ IDS_CANCEL_DEBUG_PROGRAM "Click on CANCEL to debug the program."
+END
diff --git a/win32ss/user/winsrv/usersrv/lang/en-US.rc
b/win32ss/user/winsrv/usersrv/lang/en-US.rc
index c245f75236..b876aea3e2 100644
--- a/win32ss/user/winsrv/usersrv/lang/en-US.rc
+++ b/win32ss/user/winsrv/usersrv/lang/en-US.rc
@@ -22,3 +22,20 @@ BEGIN
LTEXT "To return to ReactOS and check the status of the program, click
Cancel.", IDC_STATIC, 7, 26, 178, 16
LTEXT "If you choose to end the program immediately, you will lose any unsaved
data. To end the program now, click End Now.", IDC_STATIC, 7, 53, 178, 26
END
+
+
+STRINGTABLE
+BEGIN
+ IDS_SEVERITY_SUCCESS "Success"
+ IDS_SEVERITY_INFORMATIONAL "System Information"
+ IDS_SEVERITY_WARNING "System Warning"
+ IDS_SEVERITY_ERROR "System Error"
+END
+
+STRINGTABLE
+BEGIN
+ IDS_SYSTEM_PROCESS "System Process"
+ IDS_UNKNOWN_SOFTWARE_EXCEPT "unknown software exception"
+ IDS_OK_TERMINATE_PROGRAM "Click on OK to terminate the program."
+ IDS_CANCEL_DEBUG_PROGRAM "Click on CANCEL to debug the program."
+END
diff --git a/win32ss/user/winsrv/usersrv/lang/es-ES.rc
b/win32ss/user/winsrv/usersrv/lang/es-ES.rc
index 781b485f5e..d502b8e19f 100644
--- a/win32ss/user/winsrv/usersrv/lang/es-ES.rc
+++ b/win32ss/user/winsrv/usersrv/lang/es-ES.rc
@@ -24,3 +24,20 @@ BEGIN
LTEXT "Para volver a ReactOS y ver el estado del programa, haga clic en
Cancelar.", IDC_STATIC, 7, 26, 178, 16
LTEXT "Si elige finalizar el programa ahora, perderá todos los datos no
guardados. Para finalizar el programa ahora, haga clic en Finalizar ahora.",
IDC_STATIC, 7, 53, 178, 26
END
+
+
+STRINGTABLE
+BEGIN
+ IDS_SEVERITY_SUCCESS "Success"
+ IDS_SEVERITY_INFORMATIONAL "System Information"
+ IDS_SEVERITY_WARNING "System Warning"
+ IDS_SEVERITY_ERROR "System Error"
+END
+
+STRINGTABLE
+BEGIN
+ IDS_SYSTEM_PROCESS "System Process"
+ IDS_UNKNOWN_SOFTWARE_EXCEPT "unknown software exception"
+ IDS_OK_TERMINATE_PROGRAM "Click on OK to terminate the program."
+ IDS_CANCEL_DEBUG_PROGRAM "Click on CANCEL to debug the program."
+END
diff --git a/win32ss/user/winsrv/usersrv/lang/fr-FR.rc
b/win32ss/user/winsrv/usersrv/lang/fr-FR.rc
index 9edf599095..94fcabb2b9 100644
--- a/win32ss/user/winsrv/usersrv/lang/fr-FR.rc
+++ b/win32ss/user/winsrv/usersrv/lang/fr-FR.rc
@@ -22,3 +22,20 @@ BEGIN
LTEXT "Pour retourner à ReactOS et vérifier l'état du programme, cliquez sur
Annuler.", IDC_STATIC, 7, 26, 178, 16
LTEXT "Si vous choisissez de terminer le programme immédiatement, vous perdrez
toutes les données non sauvegardées. Pour terminer le programme maintenant, cliquez sur
Terminer maintenant.", IDC_STATIC, 7, 53, 178, 26
END
+
+
+STRINGTABLE
+BEGIN
+ IDS_SEVERITY_SUCCESS "Succès"
+ IDS_SEVERITY_INFORMATIONAL "Information système"
+ IDS_SEVERITY_WARNING "Avertissement système"
+ IDS_SEVERITY_ERROR "Erreur système"
+END
+
+STRINGTABLE
+BEGIN
+ IDS_SYSTEM_PROCESS "Processus système"
+ IDS_UNKNOWN_SOFTWARE_EXCEPT "Exception logicielle inconnue"
+ IDS_OK_TERMINATE_PROGRAM "Cliquez sur OK pour terminer le programme."
+ IDS_CANCEL_DEBUG_PROGRAM "Cliquez sur Annuler pour déboguer le
programme."
+END
diff --git a/win32ss/user/winsrv/usersrv/lang/he-IL.rc
b/win32ss/user/winsrv/usersrv/lang/he-IL.rc
index 096191dbbc..50ec399ea9 100644
--- a/win32ss/user/winsrv/usersrv/lang/he-IL.rc
+++ b/win32ss/user/winsrv/usersrv/lang/he-IL.rc
@@ -24,3 +24,20 @@ BEGIN
LTEXT "כדי לחזור לReactOS ולבדוק את מצב התכנית, לחץ ביטול.", IDC_STATIC, 7,
26, 178, 16
LTEXT "אם תבחר לסיים את התכנית באופן מיידי, אתה תאבד את כל המידע שלא נשמר. כדי
לסיים את התכנית עכשיו, לחץ סיים כעת.", IDC_STATIC, 7, 53, 178, 26
END
+
+
+STRINGTABLE
+BEGIN
+ IDS_SEVERITY_SUCCESS "Success"
+ IDS_SEVERITY_INFORMATIONAL "System Information"
+ IDS_SEVERITY_WARNING "System Warning"
+ IDS_SEVERITY_ERROR "System Error"
+END
+
+STRINGTABLE
+BEGIN
+ IDS_SYSTEM_PROCESS "System Process"
+ IDS_UNKNOWN_SOFTWARE_EXCEPT "unknown software exception"
+ IDS_OK_TERMINATE_PROGRAM "Click on OK to terminate the program."
+ IDS_CANCEL_DEBUG_PROGRAM "Click on CANCEL to debug the program."
+END
diff --git a/win32ss/user/winsrv/usersrv/lang/id-ID.rc
b/win32ss/user/winsrv/usersrv/lang/id-ID.rc
index 5e39167d4b..6a67e699c4 100644
--- a/win32ss/user/winsrv/usersrv/lang/id-ID.rc
+++ b/win32ss/user/winsrv/usersrv/lang/id-ID.rc
@@ -22,3 +22,20 @@ BEGIN
LTEXT "Untuk kembali ke ReactOS dan memeriksa status program, klik Batal.",
IDC_STATIC, 7, 26, 178, 16
LTEXT "Jika anda memilih untuk segera mengakhiri program, anda akan kehilangan
data yang belum disimpan. Untuk mengakhiri program sekarang, klik Akhiri Sekarang.",
IDC_STATIC, 7, 53, 178, 26
END
+
+
+STRINGTABLE
+BEGIN
+ IDS_SEVERITY_SUCCESS "Success"
+ IDS_SEVERITY_INFORMATIONAL "System Information"
+ IDS_SEVERITY_WARNING "System Warning"
+ IDS_SEVERITY_ERROR "System Error"
+END
+
+STRINGTABLE
+BEGIN
+ IDS_SYSTEM_PROCESS "System Process"
+ IDS_UNKNOWN_SOFTWARE_EXCEPT "unknown software exception"
+ IDS_OK_TERMINATE_PROGRAM "Click on OK to terminate the program."
+ IDS_CANCEL_DEBUG_PROGRAM "Click on CANCEL to debug the program."
+END
diff --git a/win32ss/user/winsrv/usersrv/lang/it-IT.rc
b/win32ss/user/winsrv/usersrv/lang/it-IT.rc
index 031887167a..7a2354fcf6 100644
--- a/win32ss/user/winsrv/usersrv/lang/it-IT.rc
+++ b/win32ss/user/winsrv/usersrv/lang/it-IT.rc
@@ -30,3 +30,20 @@ BEGIN
LTEXT "Per tornare a ReactOS e controllare lo stato del programma, selezionare
Annulla.", IDC_STATIC, 7, 26, 178, 16
LTEXT "Se si sceglie di terminare il programma immediatamente, si perderanno
tutti i dati non salvati. Per terminare il programma ora, selezionare Termina ora.",
IDC_STATIC, 7, 53, 178, 26
END
+
+
+STRINGTABLE
+BEGIN
+ IDS_SEVERITY_SUCCESS "Success"
+ IDS_SEVERITY_INFORMATIONAL "System Information"
+ IDS_SEVERITY_WARNING "System Warning"
+ IDS_SEVERITY_ERROR "System Error"
+END
+
+STRINGTABLE
+BEGIN
+ IDS_SYSTEM_PROCESS "System Process"
+ IDS_UNKNOWN_SOFTWARE_EXCEPT "unknown software exception"
+ IDS_OK_TERMINATE_PROGRAM "Click on OK to terminate the program."
+ IDS_CANCEL_DEBUG_PROGRAM "Click on CANCEL to debug the program."
+END
diff --git a/win32ss/user/winsrv/usersrv/lang/ja-JP.rc
b/win32ss/user/winsrv/usersrv/lang/ja-JP.rc
index 2ac22bdb20..8bb5252d13 100644
--- a/win32ss/user/winsrv/usersrv/lang/ja-JP.rc
+++ b/win32ss/user/winsrv/usersrv/lang/ja-JP.rc
@@ -22,3 +22,20 @@ BEGIN
LTEXT "ReactOS に戻ってプログラムの状態を確認するには[キャンセル]をクリックしてください", IDC_STATIC, 7, 26,
178, 16
LTEXT
"プログラムをすぐに終了させるよう選択した場合、保存されていないデータはすべて失われます。プログラムを直ちに終了するには[すぐに終了]をクリックしてください",
IDC_STATIC, 7, 53, 178, 26
END
+
+
+STRINGTABLE
+BEGIN
+ IDS_SEVERITY_SUCCESS "Success"
+ IDS_SEVERITY_INFORMATIONAL "System Information"
+ IDS_SEVERITY_WARNING "System Warning"
+ IDS_SEVERITY_ERROR "System Error"
+END
+
+STRINGTABLE
+BEGIN
+ IDS_SYSTEM_PROCESS "System Process"
+ IDS_UNKNOWN_SOFTWARE_EXCEPT "unknown software exception"
+ IDS_OK_TERMINATE_PROGRAM "Click on OK to terminate the program."
+ IDS_CANCEL_DEBUG_PROGRAM "Click on CANCEL to debug the program."
+END
diff --git a/win32ss/user/winsrv/usersrv/lang/no-NO.rc
b/win32ss/user/winsrv/usersrv/lang/no-NO.rc
index f8d0c3a1d4..a942692ef3 100644
--- a/win32ss/user/winsrv/usersrv/lang/no-NO.rc
+++ b/win32ss/user/winsrv/usersrv/lang/no-NO.rc
@@ -22,3 +22,20 @@ BEGIN
LTEXT "For å returnere til ReactOS for å sjekke statusen på programmet, trykk på
avbryt.", IDC_STATIC, 7, 26, 178, 16
LTEXT "Hvis du velger å avslutte programmet øyeblikkelig, vil du miste alt data
som ikke er lagret. For å avslutte programmet nå, Trykk på Avslutt nå.", IDC_STATIC,
7, 53, 178, 26
END
+
+
+STRINGTABLE
+BEGIN
+ IDS_SEVERITY_SUCCESS "Success"
+ IDS_SEVERITY_INFORMATIONAL "System Information"
+ IDS_SEVERITY_WARNING "System Warning"
+ IDS_SEVERITY_ERROR "System Error"
+END
+
+STRINGTABLE
+BEGIN
+ IDS_SYSTEM_PROCESS "System Process"
+ IDS_UNKNOWN_SOFTWARE_EXCEPT "unknown software exception"
+ IDS_OK_TERMINATE_PROGRAM "Click on OK to terminate the program."
+ IDS_CANCEL_DEBUG_PROGRAM "Click on CANCEL to debug the program."
+END
diff --git a/win32ss/user/winsrv/usersrv/lang/pl-PL.rc
b/win32ss/user/winsrv/usersrv/lang/pl-PL.rc
index 539e0a1b27..5f9dd73401 100644
--- a/win32ss/user/winsrv/usersrv/lang/pl-PL.rc
+++ b/win32ss/user/winsrv/usersrv/lang/pl-PL.rc
@@ -30,3 +30,20 @@ BEGIN
LTEXT "Aby powrócić do ReactOS i sprawdzić status programu, kliknij
Anuluj.", IDC_STATIC, 7, 26, 178, 16
LTEXT "Jeśli zdecydujesz się zamknąć program natychmiastowo, utracisz wszelkie
niezapisane dane. Aby zakończyć program, wciśnij Zakończ teraz.", IDC_STATIC, 7, 53,
178, 26
END
+
+
+STRINGTABLE
+BEGIN
+ IDS_SEVERITY_SUCCESS "Success"
+ IDS_SEVERITY_INFORMATIONAL "System Information"
+ IDS_SEVERITY_WARNING "System Warning"
+ IDS_SEVERITY_ERROR "System Error"
+END
+
+STRINGTABLE
+BEGIN
+ IDS_SYSTEM_PROCESS "System Process"
+ IDS_UNKNOWN_SOFTWARE_EXCEPT "unknown software exception"
+ IDS_OK_TERMINATE_PROGRAM "Click on OK to terminate the program."
+ IDS_CANCEL_DEBUG_PROGRAM "Click on CANCEL to debug the program."
+END
diff --git a/win32ss/user/winsrv/usersrv/lang/pt-BR.rc
b/win32ss/user/winsrv/usersrv/lang/pt-BR.rc
index 4b7b520f4c..320cc195d7 100644
--- a/win32ss/user/winsrv/usersrv/lang/pt-BR.rc
+++ b/win32ss/user/winsrv/usersrv/lang/pt-BR.rc
@@ -24,3 +24,20 @@ BEGIN
LTEXT "Parar retornar ao ReactOS e verificar o estado do programa, pressione
Cancelar.", IDC_STATIC, 7, 26, 178, 16
LTEXT "Se você finalizar o programa imediatamente, você irá perder qualquer
alteração não salva. Para finalizar o programa agora, pressione Finalizar Agora.",
IDC_STATIC, 7, 53, 178, 26
END
+
+
+STRINGTABLE
+BEGIN
+ IDS_SEVERITY_SUCCESS "Success"
+ IDS_SEVERITY_INFORMATIONAL "System Information"
+ IDS_SEVERITY_WARNING "System Warning"
+ IDS_SEVERITY_ERROR "System Error"
+END
+
+STRINGTABLE
+BEGIN
+ IDS_SYSTEM_PROCESS "System Process"
+ IDS_UNKNOWN_SOFTWARE_EXCEPT "unknown software exception"
+ IDS_OK_TERMINATE_PROGRAM "Click on OK to terminate the program."
+ IDS_CANCEL_DEBUG_PROGRAM "Click on CANCEL to debug the program."
+END
diff --git a/win32ss/user/winsrv/usersrv/lang/ro-RO.rc
b/win32ss/user/winsrv/usersrv/lang/ro-RO.rc
index 2b802fc8dc..9ad34941d2 100644
--- a/win32ss/user/winsrv/usersrv/lang/ro-RO.rc
+++ b/win32ss/user/winsrv/usersrv/lang/ro-RO.rc
@@ -24,3 +24,20 @@ BEGIN
LTEXT "Pentru a vă întoarce în ReactOS și a verifica starea programului, apăsați
„Anulează”.", IDC_STATIC, 7, 26, 178, 16
LTEXT "Dacă alegeți închiderea imediată a programului, riscați pierderi de date.
Pentru a forța închiderea, apăsați „Termină forțat”.", IDC_STATIC, 7, 53, 178, 26
END
+
+
+STRINGTABLE
+BEGIN
+ IDS_SEVERITY_SUCCESS "Success"
+ IDS_SEVERITY_INFORMATIONAL "System Information"
+ IDS_SEVERITY_WARNING "System Warning"
+ IDS_SEVERITY_ERROR "System Error"
+END
+
+STRINGTABLE
+BEGIN
+ IDS_SYSTEM_PROCESS "System Process"
+ IDS_UNKNOWN_SOFTWARE_EXCEPT "unknown software exception"
+ IDS_OK_TERMINATE_PROGRAM "Click on OK to terminate the program."
+ IDS_CANCEL_DEBUG_PROGRAM "Click on CANCEL to debug the program."
+END
diff --git a/win32ss/user/winsrv/usersrv/lang/ru-RU.rc
b/win32ss/user/winsrv/usersrv/lang/ru-RU.rc
index 799da0aab7..0e54451831 100644
--- a/win32ss/user/winsrv/usersrv/lang/ru-RU.rc
+++ b/win32ss/user/winsrv/usersrv/lang/ru-RU.rc
@@ -22,3 +22,20 @@ BEGIN
LTEXT "Для возврата в ReactOS и проверки состояния приложения нажмите
""Отмена"".", IDC_STATIC, 7, 26, 178, 16
LTEXT "Если вы завершите программу сейчас, то вы можете потерять несохраненные
данные. Чтобы завершить программу сейчас нажмите ""Завершить"".",
IDC_STATIC, 7, 53, 178, 26
END
+
+
+STRINGTABLE
+BEGIN
+ IDS_SEVERITY_SUCCESS "Success"
+ IDS_SEVERITY_INFORMATIONAL "System Information"
+ IDS_SEVERITY_WARNING "System Warning"
+ IDS_SEVERITY_ERROR "System Error"
+END
+
+STRINGTABLE
+BEGIN
+ IDS_SYSTEM_PROCESS "System Process"
+ IDS_UNKNOWN_SOFTWARE_EXCEPT "unknown software exception"
+ IDS_OK_TERMINATE_PROGRAM "Click on OK to terminate the program."
+ IDS_CANCEL_DEBUG_PROGRAM "Click on CANCEL to debug the program."
+END
diff --git a/win32ss/user/winsrv/usersrv/lang/sk-SK.rc
b/win32ss/user/winsrv/usersrv/lang/sk-SK.rc
index 6f3f14f8a4..672a571dc9 100644
--- a/win32ss/user/winsrv/usersrv/lang/sk-SK.rc
+++ b/win32ss/user/winsrv/usersrv/lang/sk-SK.rc
@@ -27,3 +27,20 @@ BEGIN
LTEXT "Pre návrat do systému ReactOS a overenie stavu programu kliknite na
tlačidlo Zrušiť.", IDC_STATIC, 7, 26, 178, 16
LTEXT "Ak zvolíte okamžité ukončenie programu, stratíte všetky neuložené údaje.
Ak chcete program ukončiť okamžite, kliknite na tlačidlo Ukončiť ihneď.", IDC_STATIC,
7, 53, 178, 26
END
+
+
+STRINGTABLE
+BEGIN
+ IDS_SEVERITY_SUCCESS "Success"
+ IDS_SEVERITY_INFORMATIONAL "System Information"
+ IDS_SEVERITY_WARNING "System Warning"
+ IDS_SEVERITY_ERROR "System Error"
+END
+
+STRINGTABLE
+BEGIN
+ IDS_SYSTEM_PROCESS "System Process"
+ IDS_UNKNOWN_SOFTWARE_EXCEPT "unknown software exception"
+ IDS_OK_TERMINATE_PROGRAM "Click on OK to terminate the program."
+ IDS_CANCEL_DEBUG_PROGRAM "Click on CANCEL to debug the program."
+END
diff --git a/win32ss/user/winsrv/usersrv/lang/sv-SE.rc
b/win32ss/user/winsrv/usersrv/lang/sv-SE.rc
index 418e45e7b2..925daf2f23 100644
--- a/win32ss/user/winsrv/usersrv/lang/sv-SE.rc
+++ b/win32ss/user/winsrv/usersrv/lang/sv-SE.rc
@@ -24,3 +24,20 @@ BEGIN
LTEXT "För att återgå till ReactOS och undersöka programmets status klicka
Avbryt.", IDC_STATIC, 7, 26, 178, 16
LTEXT "Om du väljer att avsluta programmet omedelbart kommer du att förlora all
osparad data. För att avsluta programmet, klicka Avsluta nu.", IDC_STATIC, 7, 53,
178, 26
END
+
+
+STRINGTABLE
+BEGIN
+ IDS_SEVERITY_SUCCESS "Success"
+ IDS_SEVERITY_INFORMATIONAL "System Information"
+ IDS_SEVERITY_WARNING "System Warning"
+ IDS_SEVERITY_ERROR "System Error"
+END
+
+STRINGTABLE
+BEGIN
+ IDS_SYSTEM_PROCESS "System Process"
+ IDS_UNKNOWN_SOFTWARE_EXCEPT "unknown software exception"
+ IDS_OK_TERMINATE_PROGRAM "Click on OK to terminate the program."
+ IDS_CANCEL_DEBUG_PROGRAM "Click on CANCEL to debug the program."
+END
diff --git a/win32ss/user/winsrv/usersrv/lang/tr-TR.rc
b/win32ss/user/winsrv/usersrv/lang/tr-TR.rc
index 4645381471..72cd661da9 100644
--- a/win32ss/user/winsrv/usersrv/lang/tr-TR.rc
+++ b/win32ss/user/winsrv/usersrv/lang/tr-TR.rc
@@ -24,3 +24,20 @@ BEGIN
LTEXT "ReactOS'a dönmek ve programın durumunu denetlemek için İptal'e
tıklayınız.", IDC_STATIC, 7, 26, 178, 16
LTEXT "Programı hemen kapatmayı seçerseniz, tüm saklanmamış veriyi
yitireceksiniz. Programdan şimdi çıkmak için Şimdi Sonlandır'a tıklayınız.",
IDC_STATIC, 7, 53, 178, 26
END
+
+
+STRINGTABLE
+BEGIN
+ IDS_SEVERITY_SUCCESS "Success"
+ IDS_SEVERITY_INFORMATIONAL "System Information"
+ IDS_SEVERITY_WARNING "System Warning"
+ IDS_SEVERITY_ERROR "System Error"
+END
+
+STRINGTABLE
+BEGIN
+ IDS_SYSTEM_PROCESS "System Process"
+ IDS_UNKNOWN_SOFTWARE_EXCEPT "unknown software exception"
+ IDS_OK_TERMINATE_PROGRAM "Click on OK to terminate the program."
+ IDS_CANCEL_DEBUG_PROGRAM "Click on CANCEL to debug the program."
+END
diff --git a/win32ss/user/winsrv/usersrv/lang/uk-UA.rc
b/win32ss/user/winsrv/usersrv/lang/uk-UA.rc
index acd1a2e046..3104e91127 100644
--- a/win32ss/user/winsrv/usersrv/lang/uk-UA.rc
+++ b/win32ss/user/winsrv/usersrv/lang/uk-UA.rc
@@ -24,3 +24,20 @@ BEGIN
LTEXT "Щоб повернутися у ReactOS і перевірити стан програми, натисніть
'Скасувати'.", IDC_STATIC, 7, 26, 178, 16
LTEXT "Якщо завершити програму негайно, то можна втратити всі незбережені дані.
Щоб завершити програму зараз, натисніть 'Завершити зараз'.", IDC_STATIC, 7,
53, 178, 26
END
+
+
+STRINGTABLE
+BEGIN
+ IDS_SEVERITY_SUCCESS "Success"
+ IDS_SEVERITY_INFORMATIONAL "System Information"
+ IDS_SEVERITY_WARNING "System Warning"
+ IDS_SEVERITY_ERROR "System Error"
+END
+
+STRINGTABLE
+BEGIN
+ IDS_SYSTEM_PROCESS "System Process"
+ IDS_UNKNOWN_SOFTWARE_EXCEPT "unknown software exception"
+ IDS_OK_TERMINATE_PROGRAM "Click on OK to terminate the program."
+ IDS_CANCEL_DEBUG_PROGRAM "Click on CANCEL to debug the program."
+END
diff --git a/win32ss/user/winsrv/usersrv/lang/zh-CN.rc
b/win32ss/user/winsrv/usersrv/lang/zh-CN.rc
index c22137e50a..69b39c6e65 100644
--- a/win32ss/user/winsrv/usersrv/lang/zh-CN.rc
+++ b/win32ss/user/winsrv/usersrv/lang/zh-CN.rc
@@ -22,3 +22,20 @@ BEGIN
LTEXT "若要返回至 ReactOS 并检查该程序的状态,请点击“取消”。", IDC_STATIC, 7, 26, 178, 16
LTEXT "如果您选择立即终止程序,您将失去所有未保存的数据。若要立即结束程序,单击“立即终止”。", IDC_STATIC, 7, 53,
178, 26
END
+
+
+STRINGTABLE
+BEGIN
+ IDS_SEVERITY_SUCCESS "Success"
+ IDS_SEVERITY_INFORMATIONAL "System Information"
+ IDS_SEVERITY_WARNING "System Warning"
+ IDS_SEVERITY_ERROR "System Error"
+END
+
+STRINGTABLE
+BEGIN
+ IDS_SYSTEM_PROCESS "System Process"
+ IDS_UNKNOWN_SOFTWARE_EXCEPT "unknown software exception"
+ IDS_OK_TERMINATE_PROGRAM "Click on OK to terminate the program."
+ IDS_CANCEL_DEBUG_PROGRAM "Click on CANCEL to debug the program."
+END
diff --git a/win32ss/user/winsrv/usersrv/lang/zh-TW.rc
b/win32ss/user/winsrv/usersrv/lang/zh-TW.rc
index 8cf9dfa513..3fdf105aff 100644
--- a/win32ss/user/winsrv/usersrv/lang/zh-TW.rc
+++ b/win32ss/user/winsrv/usersrv/lang/zh-TW.rc
@@ -22,3 +22,20 @@ BEGIN
LTEXT "若要返回至 ReactOS 並檢視程式的狀態,請按下“取消”", IDC_STATIC, 7, 26, 178, 16
LTEXT "如果您選擇立即結束程式,您將失去所有未儲存的資料。若要立即結束程式,請按下“立即結束”。", IDC_STATIC, 7, 53,
178, 26
END
+
+
+STRINGTABLE
+BEGIN
+ IDS_SEVERITY_SUCCESS "Success"
+ IDS_SEVERITY_INFORMATIONAL "System Information"
+ IDS_SEVERITY_WARNING "System Warning"
+ IDS_SEVERITY_ERROR "System Error"
+END
+
+STRINGTABLE
+BEGIN
+ IDS_SYSTEM_PROCESS "System Process"
+ IDS_UNKNOWN_SOFTWARE_EXCEPT "unknown software exception"
+ IDS_OK_TERMINATE_PROGRAM "Click on OK to terminate the program."
+ IDS_CANCEL_DEBUG_PROGRAM "Click on CANCEL to debug the program."
+END
diff --git a/win32ss/user/winsrv/usersrv/resource.h
b/win32ss/user/winsrv/usersrv/resource.h
index 187dca1134..670b20116f 100644
--- a/win32ss/user/winsrv/usersrv/resource.h
+++ b/win32ss/user/winsrv/usersrv/resource.h
@@ -1,8 +1,8 @@
/*
- * COPYRIGHT: See COPYING in the top level directory
- * PROJECT: ReactOS User API Server DLL
- * FILE: win32ss/user/winsrv/usersrv/resource.h
- * PURPOSE: Resource #defines
+ * PROJECT: ReactOS User API Server DLL
+ * LICENSE: GPL-2.0+ (
https://spdx.org/licenses/GPL-2.0+)
+ * PURPOSE: Resource #defines.
+ * COPYRIGHT: Copyright 2012-2018 Hermes Belusca-Maito
*/
#pragma once
@@ -12,5 +12,16 @@
#define IDC_STATIC -1
-#define IDC_PROGRESS 101
-#define IDC_END_NOW 102
+#define IDC_PROGRESS 20
+#define IDC_END_NOW 21
+
+/* Strings */
+#define IDS_SEVERITY_SUCCESS 100
+#define IDS_SEVERITY_INFORMATIONAL 101
+#define IDS_SEVERITY_WARNING 102
+#define IDS_SEVERITY_ERROR 103
+
+#define IDS_SYSTEM_PROCESS 104
+#define IDS_UNKNOWN_SOFTWARE_EXCEPT 105
+#define IDS_OK_TERMINATE_PROGRAM 106
+#define IDS_CANCEL_DEBUG_PROGRAM 107
diff --git a/win32ss/user/winsrv/usersrv/shutdown.c
b/win32ss/user/winsrv/usersrv/shutdown.c
index f8d5329652..5c2f464f84 100644
--- a/win32ss/user/winsrv/usersrv/shutdown.c
+++ b/win32ss/user/winsrv/usersrv/shutdown.c
@@ -413,18 +413,6 @@ ConioConsoleCtrlEventTimeout(DWORD Event, PCSR_PROCESS ProcessData,
DWORD Timeou
/************************************************/
-static BOOL CALLBACK
-FindTopLevelWnd(IN HWND hWnd,
- IN LPARAM lParam)
-{
- if (GetWindow(hWnd, GW_OWNER) == NULL)
- {
- *(HWND*)lParam = hWnd;
- return FALSE;
- }
- return TRUE;
-}
-
static VOID
ThreadShutdownNotify(IN PCSR_THREAD CsrThread,
IN ULONG Flags,
diff --git a/win32ss/user/winsrv/usersrv/usersrv.h
b/win32ss/user/winsrv/usersrv/usersrv.h
index bb281e65de..76ed26925b 100644
--- a/win32ss/user/winsrv/usersrv/usersrv.h
+++ b/win32ss/user/winsrv/usersrv/usersrv.h
@@ -33,4 +33,12 @@ extern HANDLE UserServerHeap;
extern ULONG_PTR ServicesProcessId;
extern ULONG_PTR LogonProcessId;
+BOOL CALLBACK
+FindTopLevelWnd(
+ IN HWND hWnd,
+ IN LPARAM lParam);
+
+VOID
+UserInitHardErrorsCache(VOID);
+
#endif /* __USERSRV_H__ */