https://git.reactos.org/?p=reactos.git;a=commitdiff;h=1786a68256e71b827ca49…
commit 1786a68256e71b827ca49e93352e79301a50efbf
Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com>
AuthorDate: Sun Mar 9 06:55:05 2025 +0900
Commit: GitHub <noreply(a)github.com>
CommitDate: Sun Mar 9 06:55:05 2025 +0900
[EVENTVWR] Localize and check item count (#7757)
Don’t display garbage to the users.
JIRA issue: CORE-19786
- Localize message text by using
newly added
IDS_CONTFROMBEGINNING
and IDS_CONTFROMEND
resource strings.
- Check item count before
showing next/previous item.
- Add EnableEventDetailsButtons
function.
---
base/applications/mscutils/eventvwr/eventvwr.c | 6 ++-
base/applications/mscutils/eventvwr/evtdetctl.c | 46 +++++++++++++----------
base/applications/mscutils/eventvwr/evtdetctl.h | 5 +--
base/applications/mscutils/eventvwr/lang/bg-BG.rc | 2 +
base/applications/mscutils/eventvwr/lang/cs-CZ.rc | 2 +
base/applications/mscutils/eventvwr/lang/de-DE.rc | 2 +
base/applications/mscutils/eventvwr/lang/el-GR.rc | 2 +
base/applications/mscutils/eventvwr/lang/en-US.rc | 2 +
base/applications/mscutils/eventvwr/lang/es-ES.rc | 2 +
base/applications/mscutils/eventvwr/lang/fr-FR.rc | 2 +
base/applications/mscutils/eventvwr/lang/he-IL.rc | 2 +
base/applications/mscutils/eventvwr/lang/it-IT.rc | 2 +
base/applications/mscutils/eventvwr/lang/ja-JP.rc | 2 +
base/applications/mscutils/eventvwr/lang/ko-KR.rc | 2 +
base/applications/mscutils/eventvwr/lang/no-NO.rc | 2 +
base/applications/mscutils/eventvwr/lang/pl-PL.rc | 2 +
base/applications/mscutils/eventvwr/lang/pt-BR.rc | 2 +
base/applications/mscutils/eventvwr/lang/pt-PT.rc | 2 +
base/applications/mscutils/eventvwr/lang/ro-RO.rc | 2 +
base/applications/mscutils/eventvwr/lang/ru-RU.rc | 2 +
base/applications/mscutils/eventvwr/lang/sk-SK.rc | 2 +
base/applications/mscutils/eventvwr/lang/sq-AL.rc | 2 +
base/applications/mscutils/eventvwr/lang/sv-SE.rc | 2 +
base/applications/mscutils/eventvwr/lang/tr-TR.rc | 2 +
base/applications/mscutils/eventvwr/lang/uk-UA.rc | 2 +
base/applications/mscutils/eventvwr/lang/zh-CN.rc | 2 +
base/applications/mscutils/eventvwr/lang/zh-HK.rc | 2 +
base/applications/mscutils/eventvwr/lang/zh-TW.rc | 2 +
base/applications/mscutils/eventvwr/resource.h | 2 +
29 files changed, 86 insertions(+), 23 deletions(-)
diff --git a/base/applications/mscutils/eventvwr/eventvwr.c b/base/applications/mscutils/eventvwr/eventvwr.c
index 3a7a5107eab..87be9a337b3 100644
--- a/base/applications/mscutils/eventvwr/eventvwr.c
+++ b/base/applications/mscutils/eventvwr/eventvwr.c
@@ -1978,6 +1978,7 @@ EnumEventsThread(IN LPVOID lpParameter)
BOOL bResult = TRUE; /* Read succeeded */
HANDLE hProcessHeap = GetProcessHeap();
PSID pLastSid = NULL;
+ INT nItems;
UINT uStep = 0, uStepAt = 0, uPos = 0;
@@ -1997,11 +1998,12 @@ EnumEventsThread(IN LPVOID lpParameter)
SYSTEMTIME time;
LVITEMW lviEventItem;
+ EnableEventDetailsButtons(hwndEventDetails, FALSE);
+
/* Save the current event log filter globally */
EventLogFilter_AddRef(EventLogFilter);
ActiveFilter = EventLogFilter;
-
/** HACK!! **/
EventLog = EventLogFilter->EventLogs[0];
@@ -2263,6 +2265,8 @@ Quit:
/* All events loaded */
Cleanup:
+ nItems = ListView_GetItemCount(hwndListView);
+ EnableEventDetailsButtons(hwndEventDetails, (nItems > 0));
ShowWindow(hwndStatusProgress, SW_HIDE);
SendMessageW(hwndListView, LVM_PROGRESS, 0, FALSE);
diff --git a/base/applications/mscutils/eventvwr/evtdetctl.c b/base/applications/mscutils/eventvwr/evtdetctl.c
index 3a8d07eb221..1583440a0e8 100644
--- a/base/applications/mscutils/eventvwr/evtdetctl.c
+++ b/base/applications/mscutils/eventvwr/evtdetctl.c
@@ -792,6 +792,11 @@ EventDetailsCtrl(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
pData->EventLogFilter = DetailInfo->EventLogFilter;
pData->iEventItem = DetailInfo->iEventItem;
}
+ else
+ {
+ pData->iEventItem = -1;
+ }
+
pData->bDisplayWords = FALSE;
pData->hMonospaceFont = CreateMonospaceFont();
@@ -838,31 +843,26 @@ EventDetailsCtrl(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
case IDC_NEXT:
{
BOOL bPrev = (LOWORD(wParam) == IDC_PREVIOUS);
- INT iItem, iSel;
+ INT iItem, iSel, nItems = ListView_GetItemCount(hwndListView);
+ WCHAR szText[200];
+
+ if (nItems <= 0) /* No items? */
+ break;
/* Select the previous/next item from our current one */
- iItem = ListView_GetNextItem(hwndListView,
- pData->iEventItem,
- bPrev ? LVNI_ABOVE : LVNI_BELOW);
- if (iItem == -1)
+ iItem = ListView_GetNextItem(hwndListView, -1, LVNI_ALL | LVNI_SELECTED);
+ iItem = ListView_GetNextItem(hwndListView, iItem,
+ (bPrev ? LVNI_ABOVE : LVNI_BELOW));
+ if (iItem < 0 || iItem >= nItems)
{
- // TODO: Localization.
- if (MessageBoxW(hDlg,
- bPrev
- ? L"You have reached the beginning of the event log. Do you want to continue from the end?"
- : L"You have reached the end of the event log. Do you want to continue from the beginning?",
- szTitle,
- MB_YESNO | MB_ICONQUESTION)
- == IDNO)
- {
+ LoadStringW(hInst,
+ (bPrev ? IDS_CONTFROMEND : IDS_CONTFROMBEGINNING),
+ szText, _countof(szText));
+ if (MessageBoxW(hDlg, szText, szTitle, MB_YESNO | MB_ICONQUESTION) == IDNO)
break;
- }
/* Determine from where to restart */
- if (bPrev)
- iItem = ListView_GetItemCount(hwndListView) - 1;
- else
- iItem = 0;
+ iItem = (bPrev ? (nItems - 1) : 0);
}
/*
@@ -959,3 +959,11 @@ CreateEventDetailsCtrl(HINSTANCE hInstance,
MAKEINTRESOURCEW(IDD_EVENTDETAILS_CTRL),
hParentWnd, EventDetailsCtrl, lParam);
}
+
+VOID
+EnableEventDetailsButtons(HWND hWnd, BOOL bEnable)
+{
+ EnableDlgItem(hWnd, IDC_PREVIOUS, bEnable);
+ EnableDlgItem(hWnd, IDC_NEXT, bEnable);
+ EnableDlgItem(hWnd, IDC_COPY, bEnable);
+}
diff --git a/base/applications/mscutils/eventvwr/evtdetctl.h b/base/applications/mscutils/eventvwr/evtdetctl.h
index a123232bf86..cb22cfa0d0a 100644
--- a/base/applications/mscutils/eventvwr/evtdetctl.h
+++ b/base/applications/mscutils/eventvwr/evtdetctl.h
@@ -7,8 +7,7 @@
* Copyright 2016-2022 Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
*/
-#ifndef _EVTDETCTL_H_
-#define _EVTDETCTL_H_
+#pragma once
/* Optional structure passed by pointer
* as LPARAM to CreateEventDetailsCtrl() */
@@ -26,4 +25,4 @@ CreateEventDetailsCtrl(HINSTANCE hInstance,
HWND hParentWnd,
LPARAM lParam);
-#endif /* _EVTDETCTL_H_ */
+VOID EnableEventDetailsButtons(HWND hWnd, BOOL bEnable);
diff --git a/base/applications/mscutils/eventvwr/lang/bg-BG.rc b/base/applications/mscutils/eventvwr/lang/bg-BG.rc
index 26b7c2e4040..f1054ac80d2 100644
--- a/base/applications/mscutils/eventvwr/lang/bg-BG.rc
+++ b/base/applications/mscutils/eventvwr/lang/bg-BG.rc
@@ -167,6 +167,8 @@ BEGIN
IDS_CLEAREVENTS_MSG "Do you want to save this event log before clearing it?"
IDS_RESTOREDEFAULTS "Do you want to restore all settings for this log to their default values?"
IDS_EVENTSTRINGIDNOTFOUND "Не е намерено описанието на събитие ( %lu ) в източник ( %s ). Възможно е местият компютър да няма нужните сведения в регистъра или DLL файловет, нужни за показване на съобщения от отдалечен компютър.\n\nThe following information is part of the event:\n\n"
+ IDS_CONTFROMBEGINNING "You have reached the end of the event log. Do you want to continue from the beginning?"
+ IDS_CONTFROMEND "You have reached the beginning of the event log. Do you want to continue from the end?"
END
STRINGTABLE
diff --git a/base/applications/mscutils/eventvwr/lang/cs-CZ.rc b/base/applications/mscutils/eventvwr/lang/cs-CZ.rc
index 11e3a926d96..76dfbae4283 100644
--- a/base/applications/mscutils/eventvwr/lang/cs-CZ.rc
+++ b/base/applications/mscutils/eventvwr/lang/cs-CZ.rc
@@ -167,6 +167,8 @@ BEGIN
IDS_CLEAREVENTS_MSG "Chcete tento protokol před odstraněním uložit?"
IDS_RESTOREDEFAULTS "Do you want to restore all settings for this log to their default values?"
IDS_EVENTSTRINGIDNOTFOUND "Popis ID události ( %lu ) zdroj ( %s ) nebyl nalezen. Místní počítač neobsahuje potřebné informace v registru nebo chybí DLL soubory pro zobrazení zpráv ze vzdáleného počítače.\n\nThe following information is part of the event:\n\n"
+ IDS_CONTFROMBEGINNING "You have reached the end of the event log. Do you want to continue from the beginning?"
+ IDS_CONTFROMEND "You have reached the beginning of the event log. Do you want to continue from the end?"
END
STRINGTABLE
diff --git a/base/applications/mscutils/eventvwr/lang/de-DE.rc b/base/applications/mscutils/eventvwr/lang/de-DE.rc
index acb061a9078..26ffe324508 100644
--- a/base/applications/mscutils/eventvwr/lang/de-DE.rc
+++ b/base/applications/mscutils/eventvwr/lang/de-DE.rc
@@ -168,6 +168,8 @@ BEGIN
IDS_CLEAREVENTS_MSG "Möchten Sie dieses Protokoll vor dem Löschen speichern?"
IDS_RESTOREDEFAULTS "Möchten Sie alle Einstellungen für dieses Protokoll wieder auf die Standardwerte zurücksetzen?"
IDS_EVENTSTRINGIDNOTFOUND "Die Bezeichnung für die Ereignis-ID ( %lu ) in der Quelle ( %s ) kann nicht gefunden werden. Es könnte sein, dass der lokale Computer die notwendigen Registry Einträge oder Nachrichten DLLs, um Nachrichten entfernter Computer anzuzeigen, nicht besitzt.\n\nDas Ereignis enthält folgende Informationen:\n\n"
+ IDS_CONTFROMBEGINNING "You have reached the end of the event log. Do you want to continue from the beginning?"
+ IDS_CONTFROMEND "You have reached the beginning of the event log. Do you want to continue from the end?"
END
STRINGTABLE
diff --git a/base/applications/mscutils/eventvwr/lang/el-GR.rc b/base/applications/mscutils/eventvwr/lang/el-GR.rc
index 542531f3b8f..47806b2fc03 100644
--- a/base/applications/mscutils/eventvwr/lang/el-GR.rc
+++ b/base/applications/mscutils/eventvwr/lang/el-GR.rc
@@ -167,6 +167,8 @@ BEGIN
IDS_CLEAREVENTS_MSG "Do you want to save this event log before clearing it?"
IDS_RESTOREDEFAULTS "Do you want to restore all settings for this log to their default values?"
IDS_EVENTSTRINGIDNOTFOUND "The description for Event ID ( %lu ) in Source ( %s ) cannot be found. The local computer may not have the necessary registry information or message DLL files to display messages from a remote computer.\n\nThe following information is part of the event:\n\n"
+ IDS_CONTFROMBEGINNING "You have reached the end of the event log. Do you want to continue from the beginning?"
+ IDS_CONTFROMEND "You have reached the beginning of the event log. Do you want to continue from the end?"
END
STRINGTABLE
diff --git a/base/applications/mscutils/eventvwr/lang/en-US.rc b/base/applications/mscutils/eventvwr/lang/en-US.rc
index 917c26a60b0..045e76e3fe1 100644
--- a/base/applications/mscutils/eventvwr/lang/en-US.rc
+++ b/base/applications/mscutils/eventvwr/lang/en-US.rc
@@ -169,6 +169,8 @@ BEGIN
IDS_CLEAREVENTS_MSG "Do you want to save this event log before clearing it?"
IDS_RESTOREDEFAULTS "Do you want to restore all settings for this log to their default values?"
IDS_EVENTSTRINGIDNOTFOUND "The description for Event ID ( %lu ) in Source ( %s ) cannot be found. The local computer may not have the necessary registry information or message DLL files to display messages from a remote computer.\n\nThe following information is part of the event:\n\n"
+ IDS_CONTFROMBEGINNING "You have reached the end of the event log. Do you want to continue from the beginning?"
+ IDS_CONTFROMEND "You have reached the beginning of the event log. Do you want to continue from the end?"
END
STRINGTABLE
diff --git a/base/applications/mscutils/eventvwr/lang/es-ES.rc b/base/applications/mscutils/eventvwr/lang/es-ES.rc
index 494632a8589..86eb305e342 100644
--- a/base/applications/mscutils/eventvwr/lang/es-ES.rc
+++ b/base/applications/mscutils/eventvwr/lang/es-ES.rc
@@ -170,6 +170,8 @@ BEGIN
IDS_CLEAREVENTS_MSG "¿Desea guardar este registro de eventos antes de borrarlo?"
IDS_RESTOREDEFAULTS "Do you want to restore all settings for this log to their default values?"
IDS_EVENTSTRINGIDNOTFOUND "No se pudo recuperar la descripción para el evento con ID ( %lu ) y origen ( %s ). El equipo local puede no tener la información necesaria en el registro o las DLLs necesarias para mostrar los mensajes de un equipo remoto.\n\nLa siguiente información es parte del evento:\n\n"
+ IDS_CONTFROMBEGINNING "You have reached the end of the event log. Do you want to continue from the beginning?"
+ IDS_CONTFROMEND "You have reached the beginning of the event log. Do you want to continue from the end?"
END
STRINGTABLE
diff --git a/base/applications/mscutils/eventvwr/lang/fr-FR.rc b/base/applications/mscutils/eventvwr/lang/fr-FR.rc
index 18a0cf12254..99e5fbedf16 100644
--- a/base/applications/mscutils/eventvwr/lang/fr-FR.rc
+++ b/base/applications/mscutils/eventvwr/lang/fr-FR.rc
@@ -168,6 +168,8 @@ BEGIN
IDS_CLEAREVENTS_MSG "Voulez-vous enregistrer ce journal d'événements avant de l'effacer ?"
IDS_RESTOREDEFAULTS "Voulez-vous vraiment réinitialiser tous les paramètres pour ce journal aux valeurs par défaut ?"
IDS_EVENTSTRINGIDNOTFOUND "La description pour l'événement d'ID ( %lu ) dans la source ( %s ) ne peut être trouvée. L'ordinateur local pourrait ne pas avoir les informations registres nécessaires ou les fichiers DLL de message pour afficher les messages depuis un ordinateur distant.\n\nLes informations suivantes font partie de l'événement :\n\n"
+ IDS_CONTFROMBEGINNING "You have reached the end of the event log. Do you want to continue from the beginning?"
+ IDS_CONTFROMEND "You have reached the beginning of the event log. Do you want to continue from the end?"
END
STRINGTABLE
diff --git a/base/applications/mscutils/eventvwr/lang/he-IL.rc b/base/applications/mscutils/eventvwr/lang/he-IL.rc
index ac4b5e6a82e..f6ba603938a 100644
--- a/base/applications/mscutils/eventvwr/lang/he-IL.rc
+++ b/base/applications/mscutils/eventvwr/lang/he-IL.rc
@@ -167,6 +167,8 @@ BEGIN
IDS_CLEAREVENTS_MSG "Do you want to save this event log before clearing it?"
IDS_RESTOREDEFAULTS "Do you want to restore all settings for this log to their default values?"
IDS_EVENTSTRINGIDNOTFOUND "The description for Event ID ( %lu ) in Source ( %s ) cannot be found. The local computer may not have the necessary registry information or message DLL files to display messages from a remote computer.\n\nThe following information is part of the event:\n\n"
+ IDS_CONTFROMBEGINNING "You have reached the end of the event log. Do you want to continue from the beginning?"
+ IDS_CONTFROMEND "You have reached the beginning of the event log. Do you want to continue from the end?"
END
STRINGTABLE
diff --git a/base/applications/mscutils/eventvwr/lang/it-IT.rc b/base/applications/mscutils/eventvwr/lang/it-IT.rc
index e2c6d3605fc..387f675df2f 100644
--- a/base/applications/mscutils/eventvwr/lang/it-IT.rc
+++ b/base/applications/mscutils/eventvwr/lang/it-IT.rc
@@ -168,6 +168,8 @@ BEGIN
IDS_CLEAREVENTS_MSG "Do you want to save this event log before clearing it?"
IDS_RESTOREDEFAULTS "Do you want to restore all settings for this log to their default values?"
IDS_EVENTSTRINGIDNOTFOUND "La descrizione per l'ID evento ( %lu ) proveniente da ( %s ) non può essere trovata. Il computer locale potrebbe non avere le informazioni sul registry necessarie o i file DLL con i messaggi necessari per la visualizzazione da un computer remoto.\n\nThe following information is part of the event:\n\n"
+ IDS_CONTFROMBEGINNING "You have reached the end of the event log. Do you want to continue from the beginning?"
+ IDS_CONTFROMEND "You have reached the beginning of the event log. Do you want to continue from the end?"
END
STRINGTABLE
diff --git a/base/applications/mscutils/eventvwr/lang/ja-JP.rc b/base/applications/mscutils/eventvwr/lang/ja-JP.rc
index b2ce3e869eb..3a0f9c540fa 100644
--- a/base/applications/mscutils/eventvwr/lang/ja-JP.rc
+++ b/base/applications/mscutils/eventvwr/lang/ja-JP.rc
@@ -168,6 +168,8 @@ BEGIN
IDS_CLEAREVENTS_MSG "このイベントをクリアする前に保存したいですか?"
IDS_RESTOREDEFAULTS "すべての設定をデフォルトに戻しますか?"
IDS_EVENTSTRINGIDNOTFOUND "イベント ID (%lu) (ソース %s 内) に関する説明が見つかりませんでした。 リモート コンピュータからメッセージを表示するために必要なレジストリ情報またはメッセージ DLL ファイルがローカル コンピュータにない可能性があります。\n\n次の情報はイベントの一部です:\n\n"
+ IDS_CONTFROMBEGINNING "イベント ログの最後に到達しました。最初から続けますか?"
+ IDS_CONTFROMEND "イベント ログの先頭に到達しました。最後から続けますか?"
END
STRINGTABLE
diff --git a/base/applications/mscutils/eventvwr/lang/ko-KR.rc b/base/applications/mscutils/eventvwr/lang/ko-KR.rc
index 867322cf33e..e9150036115 100644
--- a/base/applications/mscutils/eventvwr/lang/ko-KR.rc
+++ b/base/applications/mscutils/eventvwr/lang/ko-KR.rc
@@ -167,6 +167,8 @@ BEGIN
IDS_CLEAREVENTS_MSG "Do you want to save this event log before clearing it?"
IDS_RESTOREDEFAULTS "Do you want to restore all settings for this log to their default values?"
IDS_EVENTSTRINGIDNOTFOUND "( %s ) 의 이벤트ID ( %lu ) 에 대한 설명을 찾을 수 없습니다. 로컬 컴퓨터가 원격 컴퓨터의 메세지를 표시하는데 필요한 레지스트리나 DLL 파일을 가지지 않고 있을수 있습니다.\n\nThe following information is part of the event:\n\n"
+ IDS_CONTFROMBEGINNING "You have reached the end of the event log. Do you want to continue from the beginning?"
+ IDS_CONTFROMEND "You have reached the beginning of the event log. Do you want to continue from the end?"
END
STRINGTABLE
diff --git a/base/applications/mscutils/eventvwr/lang/no-NO.rc b/base/applications/mscutils/eventvwr/lang/no-NO.rc
index e74b7300f55..16a5fd167c1 100644
--- a/base/applications/mscutils/eventvwr/lang/no-NO.rc
+++ b/base/applications/mscutils/eventvwr/lang/no-NO.rc
@@ -167,6 +167,8 @@ BEGIN
IDS_CLEAREVENTS_MSG "Do you want to save this event log before clearing it?"
IDS_RESTOREDEFAULTS "Do you want to restore all settings for this log to their default values?"
IDS_EVENTSTRINGIDNOTFOUND "Beskrivelsen for Hendelse ID ( %lu ) i kilden ( %s ) kan ikke bli finnet. Lokale datamaskinen har ikke nødvendige register informasjon eller melding DLL filer for å vise melding fra en fjern datamaskin.\n\nThe following information is part of the event:\n\n"
+ IDS_CONTFROMBEGINNING "You have reached the end of the event log. Do you want to continue from the beginning?"
+ IDS_CONTFROMEND "You have reached the beginning of the event log. Do you want to continue from the end?"
END
STRINGTABLE
diff --git a/base/applications/mscutils/eventvwr/lang/pl-PL.rc b/base/applications/mscutils/eventvwr/lang/pl-PL.rc
index 7d3dd9d957a..b7a42625686 100644
--- a/base/applications/mscutils/eventvwr/lang/pl-PL.rc
+++ b/base/applications/mscutils/eventvwr/lang/pl-PL.rc
@@ -170,6 +170,8 @@ BEGIN
IDS_CLEAREVENTS_MSG "Czy chcesz zapisać dziennik zdarzeń przed czyszczeniem?"
IDS_RESTOREDEFAULTS "Czy chcesz przywrócić wszystkie ustawienia tego dziennika do wartości domyślnych?"
IDS_EVENTSTRINGIDNOTFOUND "Opis zdarzenia dla danego numeru ID ( %lu ) nie został odnaleziony w źródle ( %s ). Ten komputer może nie miec wystarczających informacji w rejestrze, albo bibliotek DLL, aby wyświetlić wiadomości z komputera zdalnego.\n\nThe following information is part of the event:\n\n"
+ IDS_CONTFROMBEGINNING "You have reached the end of the event log. Do you want to continue from the beginning?"
+ IDS_CONTFROMEND "You have reached the beginning of the event log. Do you want to continue from the end?"
END
STRINGTABLE
diff --git a/base/applications/mscutils/eventvwr/lang/pt-BR.rc b/base/applications/mscutils/eventvwr/lang/pt-BR.rc
index 9302e01e9f4..0d6f9296cc9 100644
--- a/base/applications/mscutils/eventvwr/lang/pt-BR.rc
+++ b/base/applications/mscutils/eventvwr/lang/pt-BR.rc
@@ -167,6 +167,8 @@ BEGIN
IDS_CLEAREVENTS_MSG "Do you want to save this event log before clearing it?"
IDS_RESTOREDEFAULTS "Do you want to restore all settings for this log to their default values?"
IDS_EVENTSTRINGIDNOTFOUND "A descrição para Event ID ( %lu ) em Fonte ( %s ) não foi encontrado. O computador local talvez não possua a informação de registro necessária ou mensagem de arquivos DLL para exibir mensagens de um computador remoto.\n\nThe following information is part of the event:\n\n"
+ IDS_CONTFROMBEGINNING "You have reached the end of the event log. Do you want to continue from the beginning?"
+ IDS_CONTFROMEND "You have reached the beginning of the event log. Do you want to continue from the end?"
END
STRINGTABLE
diff --git a/base/applications/mscutils/eventvwr/lang/pt-PT.rc b/base/applications/mscutils/eventvwr/lang/pt-PT.rc
index fd0791aa3e0..1ea4d73a521 100644
--- a/base/applications/mscutils/eventvwr/lang/pt-PT.rc
+++ b/base/applications/mscutils/eventvwr/lang/pt-PT.rc
@@ -167,6 +167,8 @@ BEGIN
IDS_CLEAREVENTS_MSG "Deseja guardar este registo de eventos antes de limpar?"
IDS_RESTOREDEFAULTS "Tem a certeza de que pretende repor todas definições deste registo para os valores predefinidos?"
IDS_EVENTSTRINGIDNOTFOUND "A descrição do ID de Evento ( %lu ) na Origem ( %s ) não foi encontrado. O computador local talvez não possua a informação de registo necessária ou os ficheiros DLL necessárias para apresentar mensagens de um computador remoto.\n\nA informação seguinte é parte do evento:\n\n"
+ IDS_CONTFROMBEGINNING "You have reached the end of the event log. Do you want to continue from the beginning?"
+ IDS_CONTFROMEND "You have reached the beginning of the event log. Do you want to continue from the end?"
END
STRINGTABLE
diff --git a/base/applications/mscutils/eventvwr/lang/ro-RO.rc b/base/applications/mscutils/eventvwr/lang/ro-RO.rc
index b888fd857a8..c95bcd52d04 100644
--- a/base/applications/mscutils/eventvwr/lang/ro-RO.rc
+++ b/base/applications/mscutils/eventvwr/lang/ro-RO.rc
@@ -169,6 +169,8 @@ BEGIN
IDS_CLEAREVENTS_MSG "Doriți să salvați acest jurnal de evenimente înainte de a-l închide?"
IDS_RESTOREDEFAULTS "Doriți să restabiliți toate setările pentru acest jurnal la valorile lor implicite?"
IDS_EVENTSTRINGIDNOTFOUND "Imposibil de găsit descrierea evenimentului cu ID-ul ( %lu ) în sursa ( %s ). Este posibil ca computerul local să nu aibă informațiile de registru necesare sau fișierele DLL de mesaje pentru a afișa mesaje de la un computer la distanță.\n\nUrmătoarele informații fac parte din eveniment:\n\n"
+ IDS_CONTFROMBEGINNING "You have reached the end of the event log. Do you want to continue from the beginning?"
+ IDS_CONTFROMEND "You have reached the beginning of the event log. Do you want to continue from the end?"
END
STRINGTABLE
diff --git a/base/applications/mscutils/eventvwr/lang/ru-RU.rc b/base/applications/mscutils/eventvwr/lang/ru-RU.rc
index 9d3423bfd66..0bb9b7f61f7 100644
--- a/base/applications/mscutils/eventvwr/lang/ru-RU.rc
+++ b/base/applications/mscutils/eventvwr/lang/ru-RU.rc
@@ -171,6 +171,8 @@ BEGIN
IDS_CLEAREVENTS_MSG "Вы хотите сохранить журнал событий перед очисткой?"
IDS_RESTOREDEFAULTS "Do you want to restore all settings for this log to their default values?"
IDS_EVENTSTRINGIDNOTFOUND "Не найдено описание для события с кодом ( %lu ) в источнике ( %s ). Возможно, на локальном компьютере нет нужных данных в реестре или файлов DLL сообщений для отображения сообщений удаленного компьютера.\n\nСледующая информация часть события:\n\n"
+ IDS_CONTFROMBEGINNING "You have reached the end of the event log. Do you want to continue from the beginning?"
+ IDS_CONTFROMEND "You have reached the beginning of the event log. Do you want to continue from the end?"
END
STRINGTABLE
diff --git a/base/applications/mscutils/eventvwr/lang/sk-SK.rc b/base/applications/mscutils/eventvwr/lang/sk-SK.rc
index 3f6a3fe5bb0..16cd7cdb414 100644
--- a/base/applications/mscutils/eventvwr/lang/sk-SK.rc
+++ b/base/applications/mscutils/eventvwr/lang/sk-SK.rc
@@ -167,6 +167,8 @@ BEGIN
IDS_CLEAREVENTS_MSG "Do you want to save this event log before clearing it?"
IDS_RESTOREDEFAULTS "Do you want to restore all settings for this log to their default values?"
IDS_EVENTSTRINGIDNOTFOUND "Popis pre udalosť ID ( %lu ) zo zdroja ( %s ) nebol nájdený. The local computer may not have the necessary registry information or message DLL files to display messages from a remote computer.\n\nThe following information is part of the event:\n\n"
+ IDS_CONTFROMBEGINNING "You have reached the end of the event log. Do you want to continue from the beginning?"
+ IDS_CONTFROMEND "You have reached the beginning of the event log. Do you want to continue from the end?"
END
STRINGTABLE
diff --git a/base/applications/mscutils/eventvwr/lang/sq-AL.rc b/base/applications/mscutils/eventvwr/lang/sq-AL.rc
index 2a3b1a556b0..95f7e50fad9 100644
--- a/base/applications/mscutils/eventvwr/lang/sq-AL.rc
+++ b/base/applications/mscutils/eventvwr/lang/sq-AL.rc
@@ -167,6 +167,8 @@ BEGIN
IDS_CLEAREVENTS_MSG "Do you want to save this event log before clearing it?"
IDS_RESTOREDEFAULTS "Do you want to restore all settings for this log to their default values?"
IDS_EVENTSTRINGIDNOTFOUND "Përshkrimi për ngjarjet ID ( %lu ) në burim ( %s ) nuk gjindet. Kompjuter vendas mund të mos ketë informacionin e regjistrit te nevojshem ose mesazhin për dokumentat DLL për të shfaqur nga një kompjuter në distancë.\n\nThe following information is part of the event:\n\n"
+ IDS_CONTFROMBEGINNING "You have reached the end of the event log. Do you want to continue from the beginning?"
+ IDS_CONTFROMEND "You have reached the beginning of the event log. Do you want to continue from the end?"
END
STRINGTABLE
diff --git a/base/applications/mscutils/eventvwr/lang/sv-SE.rc b/base/applications/mscutils/eventvwr/lang/sv-SE.rc
index d4205142932..723a2ef1936 100644
--- a/base/applications/mscutils/eventvwr/lang/sv-SE.rc
+++ b/base/applications/mscutils/eventvwr/lang/sv-SE.rc
@@ -167,6 +167,8 @@ BEGIN
IDS_CLEAREVENTS_MSG "Do you want to save this event log before clearing it?"
IDS_RESTOREDEFAULTS "Do you want to restore all settings for this log to their default values?"
IDS_EVENTSTRINGIDNOTFOUND "Beskrivning av Händelse ID ( %lu ) i källan ( %s ) kan inte hittas. Lokal dator har inte nödvendig registerinformation eller meddelander DLL filer for å vise meddelander från en fjärr dator.\n\nThe following information is part of the event:\n\n"
+ IDS_CONTFROMBEGINNING "You have reached the end of the event log. Do you want to continue from the beginning?"
+ IDS_CONTFROMEND "You have reached the beginning of the event log. Do you want to continue from the end?"
END
STRINGTABLE
diff --git a/base/applications/mscutils/eventvwr/lang/tr-TR.rc b/base/applications/mscutils/eventvwr/lang/tr-TR.rc
index e9710e2c39a..b951b08dd5f 100644
--- a/base/applications/mscutils/eventvwr/lang/tr-TR.rc
+++ b/base/applications/mscutils/eventvwr/lang/tr-TR.rc
@@ -168,6 +168,8 @@ BEGIN
IDS_CLEAREVENTS_MSG "Silmeden önce bu olay kaydını kaydetmek ister misiniz?"
IDS_RESTOREDEFAULTS "Bu günlük için tüm ayarları varsayılan değerlerine geri yüklemek istiyor musunuz?"
IDS_EVENTSTRINGIDNOTFOUND "( %s ) kaynağındaki ( %lu ) olay kimliği için açıklama bulunamıyor. Yerel bilgisayarda, uzak bilgisayardan iletileri görüntülemesi için gerekli Kayıt Defteri bilgisi veya ileti DLL dosyaları olmayabilir.\n\nAşağıdaki bilgi olayın parçasıdır:\n\n"
+ IDS_CONTFROMBEGINNING "You have reached the end of the event log. Do you want to continue from the beginning?"
+ IDS_CONTFROMEND "You have reached the beginning of the event log. Do you want to continue from the end?"
END
STRINGTABLE
diff --git a/base/applications/mscutils/eventvwr/lang/uk-UA.rc b/base/applications/mscutils/eventvwr/lang/uk-UA.rc
index c50f93892e2..644267f9edc 100644
--- a/base/applications/mscutils/eventvwr/lang/uk-UA.rc
+++ b/base/applications/mscutils/eventvwr/lang/uk-UA.rc
@@ -169,6 +169,8 @@ BEGIN
IDS_CLEAREVENTS_MSG "Do you want to save this event log before clearing it?"
IDS_RESTOREDEFAULTS "Do you want to restore all settings for this log to their default values?"
IDS_EVENTSTRINGIDNOTFOUND "Опис для Ідентифікатора події ( %lu ) за джерелом ( %s ) не знайдено. Локальний комп'ютер може не мати необхідної інформації в реєстрі чи DLL файлів повідомлень для відображення повідомлень, що надходять від віддаленого комп'ютера.\n\nThe following information is part of the event:\n\n"
+ IDS_CONTFROMBEGINNING "You have reached the end of the event log. Do you want to continue from the beginning?"
+ IDS_CONTFROMEND "You have reached the beginning of the event log. Do you want to continue from the end?"
END
STRINGTABLE
diff --git a/base/applications/mscutils/eventvwr/lang/zh-CN.rc b/base/applications/mscutils/eventvwr/lang/zh-CN.rc
index 3a94b912034..42c84460560 100644
--- a/base/applications/mscutils/eventvwr/lang/zh-CN.rc
+++ b/base/applications/mscutils/eventvwr/lang/zh-CN.rc
@@ -169,6 +169,8 @@ BEGIN
IDS_CLEAREVENTS_MSG "你想要在清除之前保存此事件日志吗?"
IDS_RESTOREDEFAULTS "你想要将这个日志的所有设置恢复为默认值吗?"
IDS_EVENTSTRINGIDNOTFOUND "无法找到来源(%s)中的事件 ID(%lu)的描述。本地计算机可能没有显示来自远程计算机的消息所必需的注册表信息或消息 DLL 文件。\n\n下面的信息是事件的一部分:\n\n"
+ IDS_CONTFROMBEGINNING "You have reached the end of the event log. Do you want to continue from the beginning?"
+ IDS_CONTFROMEND "You have reached the beginning of the event log. Do you want to continue from the end?"
END
STRINGTABLE
diff --git a/base/applications/mscutils/eventvwr/lang/zh-HK.rc b/base/applications/mscutils/eventvwr/lang/zh-HK.rc
index 98097e61549..08a3105b454 100644
--- a/base/applications/mscutils/eventvwr/lang/zh-HK.rc
+++ b/base/applications/mscutils/eventvwr/lang/zh-HK.rc
@@ -168,6 +168,8 @@ BEGIN
IDS_CLEAREVENTS_MSG "您想在清除之前儲存這個事件記錄嗎?"
IDS_RESTOREDEFAULTS "您要將這個記錄的所有設定還原至預設值嗎?"
IDS_EVENTSTRINGIDNOTFOUND "找不到來源(%s)中的事件 ID(%lu)的描述。本地電腦可能沒有顯示來自遠端電腦訊息所需的註冊表資訊或訊息 DLL 檔。\n\n下列資訊是部分事件:\n\n"
+ IDS_CONTFROMBEGINNING "You have reached the end of the event log. Do you want to continue from the beginning?"
+ IDS_CONTFROMEND "You have reached the beginning of the event log. Do you want to continue from the end?"
END
STRINGTABLE
diff --git a/base/applications/mscutils/eventvwr/lang/zh-TW.rc b/base/applications/mscutils/eventvwr/lang/zh-TW.rc
index 43fafc0e500..f48152455f8 100644
--- a/base/applications/mscutils/eventvwr/lang/zh-TW.rc
+++ b/base/applications/mscutils/eventvwr/lang/zh-TW.rc
@@ -168,6 +168,8 @@ BEGIN
IDS_CLEAREVENTS_MSG "您要在清除之前儲存此事件記錄嗎?"
IDS_RESTOREDEFAULTS "您要這個記錄的所有設定還原至預設值嗎?"
IDS_EVENTSTRINGIDNOTFOUND "找不到來源(%s)中的事件 ID(%lu)的描述。本地電腦可能沒有顯示來自遠端電腦消息所必需的註冊表資訊或消息 DLL 檔。\n\n下列資訊是部分事件︰\n\n"
+ IDS_CONTFROMBEGINNING "You have reached the end of the event log. Do you want to continue from the beginning?"
+ IDS_CONTFROMEND "You have reached the beginning of the event log. Do you want to continue from the end?"
END
STRINGTABLE
diff --git a/base/applications/mscutils/eventvwr/resource.h b/base/applications/mscutils/eventvwr/resource.h
index 27c61bc2cb0..141d4945d6c 100644
--- a/base/applications/mscutils/eventvwr/resource.h
+++ b/base/applications/mscutils/eventvwr/resource.h
@@ -105,6 +105,8 @@
#define IDS_CLEAREVENTS_MSG 110
#define IDS_EVENTSTRINGIDNOTFOUND 111
#define IDS_RESTOREDEFAULTS 112
+#define IDS_CONTFROMBEGINNING 113
+#define IDS_CONTFROMEND 114
#define IDS_USAGE 120
#define IDS_EVENTLOGFILE 121
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=d1d300b44bee98c8ab11a…
commit d1d300b44bee98c8ab11a68994710377e1a7f775
Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com>
AuthorDate: Sat Mar 8 18:57:17 2025 +0900
Commit: GitHub <noreply(a)github.com>
CommitDate: Sat Mar 8 18:57:17 2025 +0900
[REACTOS] Add CODING_STYLE.md (#7753)
JIRA issue: CORE-20011
- Add CODING_STYLE.md at the root
directory.
- This CODING_STYLE.md is generated
from HTML text of
https://reactos.org/wiki/Coding_Style
---
CODING_STYLE.md | 356 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 356 insertions(+)
diff --git a/CODING_STYLE.md b/CODING_STYLE.md
new file mode 100644
index 00000000000..4aefe31fe9d
--- /dev/null
+++ b/CODING_STYLE.md
@@ -0,0 +1,356 @@
+# Coding Style
+
+This article describes general coding style guidelines, which should be used for new ReactOS code. These guidelines apply exclusively to C and C++ source files. The Members of ReactOS agreed on this document in the October 2013 meeting.
+
+As much existing ReactOS code as possible should be converted to this style unless there are reasons against doing this (like if the code is going to be rewritten from scratch in the near future). See [Notes on reformatting existing code](#notes-on-reformatting-existing-code) for more details.
+
+Code synchronized with other sources (like Wine) must not be rewritten. [3rd Party Files.txt](https://github.com/reactos/reactos/blob/master/media/doc/3rd%20P… and [WINESYNC.txt](https://github.com/reactos/reactos/blob/master/media/doc/WINE… files can be used for tracking synchronized files.
+
+## File Structure
+
+1. Every ReactOS source code file should include a file header like this:
+
+```
+/*
+ * PROJECT: ReactOS Kernel
+ * LICENSE: GPL-2.0-or-later (https://spdx.org/licenses/GPL-2.0-or-later)
+ * PURPOSE: Does cool things like Memory Management
+ * COPYRIGHT: Copyright 2017 Arno Nymous <abc(a)mailaddress.com>
+ * Copyright 2017 Mike Blablabla <mike(a)blabla.com>
+ */
+```
+
+Please use SPDX license identifiers available at https://spdx.org/licenses.
+This makes our source file parseable by licensing tools!
+
+You should add yourself to the `COPYRIGHT` section of a file if you did a major contribution to it and could take responsibility for the whole file or a part of it. Not more than 3 people shall be in that list for each file.
+
+`FILE` line of the old header should be removed.
+
+2. [Doxygen](https://doxygen.reactos.org/) documentation generator is used for ReactOS codebase, so use a proper header for functions, see [API Documentation](https://reactos.org/wiki/Documentation_Guidelines#API_Docume… for details.
+
+## Indentation and line width
+
+1. Line width must be at most **100 characters**.
+2. Do not add a space or tab at the end of any line.
+3. Indent with **4 spaces**, don't use tabs!
+4. Indent both a case label and the case statement of a switch statement.
+
+**Right:**
+```c
+switch (Condition)
+{
+ case 1:
+ DoSomething();
+ break;
+
+ case 2:
+ {
+ DoMany();
+ ManyMore();
+ OtherThings();
+ break;
+ }
+}
+```
+
+**Wrong:**
+```c
+switch(Condition)
+{
+case 1:
+ DoSomething();
+ break;
+case 2:
+ DoMany();
+ ManyMore();
+ OtherThings();
+ break;
+}
+```
+
+5. When a function call does not fit onto a line, align arguments like this:
+```c
+FunctionCall(arg1,
+ arg2,
+ arg3);
+```
+
+6. Function headers should have this format (preserving the order as in the example):
+```c
+static // scope identifier
+CODE_SEG("PAGE") // section placement
+// other attributes
+BOOLEAN // return type
+FASTCALL // calling convention
+IsOdd(
+ _In_ UINT32 Number);
+```
+
+## Spacing
+
+1. Do not use spaces around unary operators.
+**Right:** `i++;`
+**Wrong:** `i ++;`
+
+2. Place spaces around binary and ternary operators.
+**Right:** `a = b + c;`
+**Wrong:** `a=b+c;`
+
+3. Do not place spaces before comma and semicolon.
+
+**Right:**
+```c
+for (int i = 0; i < 5; i++)
+ DoSomething();
+
+func1(a, b);
+```
+
+**Wrong:**
+```c
+for (int i = 0; i < 5 ; i++)
+ DoSomething();
+
+func1(a , b) ;
+```
+
+4. Place spaces between control statements and their parentheses.
+
+**Right:**
+```c
+if (Condition)
+ DoSomething();
+```
+
+**Wrong:**
+```c
+if(Condition)
+ DoSomething();
+```
+
+5. Do not place spaces between a function and its parentheses, or between a parenthesis and its content.
+
+**Right:**
+```c
+func(a, b);
+```
+
+**Wrong:**
+```c
+func (a, b);
+func( a, b );
+```
+
+## Line breaking
+
+1. Each statement should get its own line.
+
+**Right:**
+```c
+x++;
+y++;
+
+if (Condition)
+ DoSomething();
+```
+
+**Wrong:**
+```c
+x++; y++;
+
+if (Condition) DoSomething();
+```
+
+## Braces
+
+1. Always put braces (`{` and `}`) on their own lines.
+2. One-line control clauses may use braces, but this is not a requirement. An exception are one-line control clauses including additional comments.
+
+**Right:**
+```c
+if (Condition)
+ DoSomething();
+
+if (Condition)
+{
+ DoSomething();
+}
+
+if (Condition)
+{
+ // This is a comment
+ DoSomething();
+}
+
+if (A_Very || (Very && Long || Condition) &&
+ On_Many && Lines)
+{
+ DoSomething();
+}
+
+if (Condition)
+ DoSomething();
+else
+ DoSomethingElse();
+
+if (Condition)
+{
+ DoSomething();
+}
+else
+{
+ DoSomethingElse();
+ YetAnother();
+}
+```
+
+**Wrong:**
+```c
+if (Condition) {
+ DoSomething();
+}
+
+if (Condition)
+ // This is a comment
+ DoSomething();
+
+if (A_Very || (Very && Long || Condition) &&
+ On_Many && Lines)
+ DoSomething();
+
+if (Condition)
+ DoSomething();
+else {
+ DoSomethingElse();
+ YetAnother();
+}
+```
+
+## Control structures
+
+1. Don't use inverse logic in control clauses.
+**Right:** `if (i == 1)`
+**Wrong:** `if (1 == i)`
+
+2. Avoid too many levels of cascaded control structures. Prefer a "linear style" over a "tree style". Use `goto` when it helps to make the code cleaner (e.g. for cleanup paths).
+
+**Right:**
+```c
+if (!func1())
+ return;
+
+i = func2();
+if (i == 0)
+ return;
+
+j = func3();
+if (j == 1)
+ return;
+...
+```
+
+**Wrong:**
+```c
+if (func1())
+{
+ i = func2();
+ if (func2())
+ {
+ j = func3();
+ if (func3())
+ {
+ ...
+ }
+ }
+}
+```
+
+## Naming
+
+1. Capitalize names of variables and functions. Hungarian Notation may be used when developing for Win32, but it is not required. If you don't use it, the first letter of a name must be a capital too (no lowerCamelCase). Do not use underscores as separators either.
+
+**Right:**
+```c
+PLIST_ENTRY FirstEntry;
+VOID NTAPI IopDeleteIoCompletion(PVOID ObjectBody);
+PWSTR pwszTest;
+```
+
+**Wrong:**
+```c
+PLIST_ENTRY first_entry;
+VOID NTAPI iop_delete_io_completion(PVOID objectBody);
+PWSTR pwsztest;
+```
+
+2. Avoid abbreviating function and variable names, use descriptive verbs where possible.
+
+3. Precede boolean values with meaningful verbs like "is" and "did" if possible and if it fits the usage.
+
+**Right:**
+```c
+BOOLEAN IsValid;
+BOOLEAN DidSendData;
+```
+
+**Wrong:**
+```c
+BOOLEAN Valid;
+BOOLEAN SentData;
+```
+
+## Commenting
+
+1. Avoid line-wasting comments, which could fit into a single line.
+
+**Right:**
+```c
+// This is a one-line comment
+
+/* This is a C-style comment */
+
+// This is a comment over multiple lines.
+// We don't define any strict rules for it.
+```
+
+**Wrong:**
+```c
+//
+// This comment wastes two lines
+//
+```
+
+## Null, false and 0
+
+1. The null pointer should be written as `NULL`. In the rare case that your environment recommends a different null pointer (e.g. C++11 `nullptr`), you may use this one of course. Just don't use the value `0`.
+
+2. Win32/NT Boolean values should be written as `TRUE` and `FALSE`. In the rare case that you use C/C++ `bool` variables, you should write them as `true` and `false`.
+
+3. When you need to terminate ANSI or OEM string, or check for its terminator, use `ANSI_NULL`. If the string is Unicode or Wide string, use `UNICODE_NULL`.
+
+## Notes on reformatting existing code
+
+- Never totally reformat a file and put a code change into it. Do this in separate commits.
+- If a commit only consists of formatting changes, say this clearly in the commit message by preceding it with *[FORMATTING]*.
+
+## Other points
+
+- Do not use `LARGE_INTEGER`/`ULARGE_INTEGER` unless needed for using APIs. Use `INT64`/`UINT64` instead
+- Use `#pragma once` instead of guard defines in headers
+- Don't specify a calling convention for a function unless required (usually for APIs or exported symbols)
+
+## Using an automatic code style tool
+
+TO BE ADDED BY User:Zefklop
+
+## Points deliberately left out
+
+Additional ideas were suggested during the discussion of this document, but a consensus couldn't be reached on them. Therefore we refrain from enforcing any rules on these points:
+
+- TO BE ADDED BY User:Hbelusca
+
+## See also
+
+- [Kernel Coding Style](https://reactos.org/wiki/Kernel_Coding_Style)
+- [GNU Indent](https://reactos.org/wiki/GNU_Indent)