mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 16:32:59 +00:00
[REACTOS] Usage improvements for some RtlFindMessage invocations (#6023)
Use `RT_MESSAGETABLE` and `MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL)` instead of hardcoding their values.
This commit is contained in:
parent
2f805d7a02
commit
111c8cc62a
6 changed files with 41 additions and 28 deletions
|
@ -31,8 +31,8 @@ PciGetDescriptionMessage(IN ULONG Identifier,
|
|||
/* Find the message identifier in the message table */
|
||||
MessageString.Buffer = NULL;
|
||||
Status = RtlFindMessage(PciDriverObject->DriverStart,
|
||||
11, // RT_MESSAGETABLE
|
||||
LANG_NEUTRAL,
|
||||
RT_MESSAGETABLE,
|
||||
MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL),
|
||||
Identifier,
|
||||
&Entry);
|
||||
if (!NT_SUCCESS(Status)) return NULL;
|
||||
|
|
|
@ -294,10 +294,10 @@ PreloadGlobalMessageTable(IN PVOID ImageBase)
|
|||
TotalLength = 0;
|
||||
for (MessageId = 1; MessageId != SAC_MAX_MESSAGES; MessageId++)
|
||||
{
|
||||
/* Find this message ID in the string table*/
|
||||
/* Find this message in the message table */
|
||||
Status2 = RtlFindMessage(ImageBase,
|
||||
11,
|
||||
LANG_NEUTRAL,
|
||||
RT_MESSAGETABLE,
|
||||
MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL),
|
||||
MessageId,
|
||||
&MessageEntry);
|
||||
if (NT_SUCCESS(Status2))
|
||||
|
@ -339,10 +339,10 @@ PreloadGlobalMessageTable(IN PVOID ImageBase)
|
|||
/* Now loop over our entries again */
|
||||
for (i = 0, MessageId = 1; MessageId != SAC_MAX_MESSAGES; MessageId++)
|
||||
{
|
||||
/* Make sure the message is still there...! */
|
||||
/* Make sure the message is still there! */
|
||||
Status2 = RtlFindMessage(ImageBase,
|
||||
11,
|
||||
LANG_NEUTRAL,
|
||||
RT_MESSAGETABLE,
|
||||
MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL),
|
||||
MessageId,
|
||||
&MessageEntry);
|
||||
if (NT_SUCCESS(Status2))
|
||||
|
|
|
@ -1145,8 +1145,8 @@ ExpInitializeExecutive(IN ULONG Cpu,
|
|||
{
|
||||
/* Get the service pack string */
|
||||
Status = RtlFindMessage(NtosEntry->DllBase,
|
||||
11,
|
||||
0,
|
||||
RT_MESSAGETABLE,
|
||||
MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL),
|
||||
WINDOWS_NT_CSD_STRING,
|
||||
&MsgEntry);
|
||||
if (NT_SUCCESS(Status))
|
||||
|
@ -1434,8 +1434,8 @@ Phase1InitializationDiscard(IN PVOID Context)
|
|||
|
||||
/* Find the banner message */
|
||||
MsgStatus = RtlFindMessage(NtosEntry->DllBase,
|
||||
11,
|
||||
0,
|
||||
RT_MESSAGETABLE,
|
||||
MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL),
|
||||
WINDOWS_NT_BANNER,
|
||||
&MsgEntry);
|
||||
|
||||
|
@ -1623,8 +1623,8 @@ Phase1InitializationDiscard(IN PVOID Context)
|
|||
|
||||
/* Get the information string from our resource file */
|
||||
MsgStatus = RtlFindMessage(NtosEntry->DllBase,
|
||||
11,
|
||||
0,
|
||||
RT_MESSAGETABLE,
|
||||
MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL),
|
||||
KeNumberProcessors > 1 ?
|
||||
WINDOWS_NT_INFO_STRING_PLURAL :
|
||||
WINDOWS_NT_INFO_STRING,
|
||||
|
@ -1797,8 +1797,8 @@ Phase1InitializationDiscard(IN PVOID Context)
|
|||
|
||||
/* Find the message to print out */
|
||||
Status = RtlFindMessage(NtosEntry->DllBase,
|
||||
11,
|
||||
0,
|
||||
RT_MESSAGETABLE,
|
||||
MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL),
|
||||
MessageCode,
|
||||
&MsgEntry);
|
||||
if (NT_SUCCESS(Status))
|
||||
|
@ -1817,8 +1817,8 @@ Phase1InitializationDiscard(IN PVOID Context)
|
|||
{
|
||||
/* Find the message to print out */
|
||||
Status = RtlFindMessage(NtosEntry->DllBase,
|
||||
11,
|
||||
0,
|
||||
RT_MESSAGETABLE,
|
||||
MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL),
|
||||
BOOTLOG_ENABLED,
|
||||
&MsgEntry);
|
||||
if (NT_SUCCESS(Status))
|
||||
|
|
|
@ -344,13 +344,7 @@ C_ASSERT(HEAP_CREATE_VALID_MASK == 0x0007F0FF);
|
|||
#define RTL_INIT_OBJECT_ATTRIBUTES(n, a) \
|
||||
RTL_CONSTANT_OBJECT_ATTRIBUTES(n, a)
|
||||
|
||||
#else /* NTOS_MODE_USER */
|
||||
//
|
||||
// Message Resource Flag
|
||||
//
|
||||
#define MESSAGE_RESOURCE_UNICODE 0x0001
|
||||
|
||||
#endif /* !NTOS_MODE_USER */
|
||||
#endif /* NTOS_MODE_USER */
|
||||
|
||||
//
|
||||
// RtlImageNtHeaderEx Flags
|
||||
|
@ -1905,6 +1899,23 @@ typedef struct _RTL_UNICODE_STRING_BUFFER
|
|||
|
||||
#ifndef NTOS_MODE_USER
|
||||
|
||||
#ifndef MAKEINTRESOURCE
|
||||
#define MAKEINTRESOURCE(i) ((ULONG_PTR)(USHORT)(i))
|
||||
#endif
|
||||
|
||||
/* Predefined Resource Types */
|
||||
#ifndef RT_STRING
|
||||
#define RT_STRING MAKEINTRESOURCE(6)
|
||||
#endif
|
||||
#ifndef RT_MESSAGETABLE
|
||||
#define RT_MESSAGETABLE MAKEINTRESOURCE(11)
|
||||
#endif
|
||||
|
||||
//
|
||||
// Message Resource Flag
|
||||
//
|
||||
#define MESSAGE_RESOURCE_UNICODE 0x0001
|
||||
|
||||
//
|
||||
// Message Resource Entry, Block and Data
|
||||
//
|
||||
|
|
|
@ -583,7 +583,7 @@
|
|||
#define SECTION_MAP_EXECUTE 8
|
||||
#define SECTION_ALL_ACCESS 0xf001f
|
||||
#define WRITE_WATCH_FLAG_RESET 0x01
|
||||
#define MESSAGE_RESOURCE_UNICODE 1
|
||||
|
||||
#define RTL_CRITSECT_TYPE 0
|
||||
#define RTL_RESOURCE_TYPE 1
|
||||
|
||||
|
@ -2648,6 +2648,8 @@ typedef struct _MESSAGE_RESOURCE_ENTRY {
|
|||
BYTE Text[1];
|
||||
} MESSAGE_RESOURCE_ENTRY, *PMESSAGE_RESOURCE_ENTRY;
|
||||
|
||||
#define MESSAGE_RESOURCE_UNICODE 1
|
||||
|
||||
typedef struct _MESSAGE_RESOURCE_BLOCK {
|
||||
DWORD LowId;
|
||||
DWORD HighId;
|
||||
|
|
|
@ -519,7 +519,7 @@ UserpFormatMessages(
|
|||
FormatA.Buffer = NULL;
|
||||
Status = RtlFindMessage(GetModuleHandleW(L"ntdll"),
|
||||
(ULONG_PTR)RT_MESSAGETABLE,
|
||||
LANG_NEUTRAL,
|
||||
MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL),
|
||||
Message->Status,
|
||||
&MessageResource);
|
||||
if (NT_SUCCESS(Status))
|
||||
|
@ -660,7 +660,7 @@ UserpFormatMessages(
|
|||
/* Retrieve the description of the exception code */
|
||||
Status = RtlFindMessage(GetModuleHandleW(L"ntdll"),
|
||||
(ULONG_PTR)RT_MESSAGETABLE,
|
||||
LANG_NEUTRAL,
|
||||
MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL),
|
||||
ExceptionCode,
|
||||
&MessageResource);
|
||||
if (NT_SUCCESS(Status))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue