diff --git a/base/setup/lib/precomp.h b/base/setup/lib/precomp.h index 2195c55a9e6..fac676f9658 100644 --- a/base/setup/lib/precomp.h +++ b/base/setup/lib/precomp.h @@ -14,7 +14,6 @@ #include #include #include -#include #define NTOS_MODE_USER #include diff --git a/base/setup/lib/utils/ntverrsrc.c b/base/setup/lib/utils/ntverrsrc.c index d8c1c64fc66..fc9859d416f 100644 --- a/base/setup/lib/utils/ntverrsrc.c +++ b/base/setup/lib/utils/ntverrsrc.c @@ -22,26 +22,27 @@ /* FUNCTIONS ****************************************************************/ +#define MAKEINTRESOURCE(i) ((ULONG_PTR)(USHORT)(i)) +#define RT_VERSION MAKEINTRESOURCE(16) // See psdk/winuser.h +#define VS_VERSION_INFO 1 // See psdk/verrsrc.h +#define VS_FILE_INFO RT_VERSION + NTSTATUS NtGetVersionResource( IN PVOID BaseAddress, OUT PVOID* Resource, OUT PULONG ResourceSize OPTIONAL) { -// #define RT_VERSION MAKEINTRESOURCE(16) // See winuser.h -#define VS_VERSION_INFO 1 // See psdk/verrsrc.h -#define VS_FILE_INFO RT_VERSION - NTSTATUS Status; LDR_RESOURCE_INFO ResourceInfo; PIMAGE_RESOURCE_DATA_ENTRY ResourceDataEntry; PVOID Data = NULL; ULONG Size = 0; - /* Try to find the resource */ - ResourceInfo.Type = 16; // RT_VERSION; - ResourceInfo.Name = VS_VERSION_INFO; // MAKEINTRESOURCEW(VS_VERSION_INFO); - ResourceInfo.Language = 0; // Don't care about the language + /* Try to find the resource (language-neutral) */ + ResourceInfo.Type = RT_VERSION; + ResourceInfo.Name = VS_VERSION_INFO; + ResourceInfo.Language = MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL); Status = LdrFindResource_U(BaseAddress, &ResourceInfo, diff --git a/dll/win32/kernel32/client/actctx.c b/dll/win32/kernel32/client/actctx.c index cad514ef065..fe43928ab8a 100644 --- a/dll/win32/kernel32/client/actctx.c +++ b/dll/win32/kernel32/client/actctx.c @@ -156,7 +156,7 @@ BasepProbeForDllManifest(IN PVOID DllHandle, /* Check whether the image has manifest resource associated with it */ Info.Type = (ULONG_PTR)RT_MANIFEST; Info.Name = (ULONG_PTR)ISOLATIONAWARE_MANIFEST_RESOURCE_ID; - Info.Language = 0; + Info.Language = MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL); if (!(Status = LdrFindResource_U(DllHandle, &Info, 3, &Entry))) { /* Create the activation context */ diff --git a/drivers/ksfilter/ks/image.c b/drivers/ksfilter/ks/image.c index c35728fea92..a34cbaa4661 100644 --- a/drivers/ksfilter/ks/image.c +++ b/drivers/ksfilter/ks/image.c @@ -38,7 +38,7 @@ KsLoadResource( /* set up resource info */ ResourceInfo.Type = ResourceType; ResourceInfo.Name = ResourceName; - ResourceInfo.Language = 0; + ResourceInfo.Language = MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL); _SEH2_TRY { diff --git a/ntoskrnl/inbv/inbv.c b/ntoskrnl/inbv/inbv.c index 006f96a4192..31902337e15 100644 --- a/ntoskrnl/inbv/inbv.c +++ b/ntoskrnl/inbv/inbv.c @@ -91,6 +91,8 @@ static ULONG InbvTerminalBkgdColor = 40; /* FUNCTIONS *****************************************************************/ +#define RT_BITMAP MAKEINTRESOURCE(2) + CODE_SEG("INIT") static PVOID @@ -131,9 +133,10 @@ FindBitmapResource( if (NextEntry != ListHead) { /* Try to find the resource */ - ResourceInfo.Type = 2; // RT_BITMAP; + ResourceInfo.Type = RT_BITMAP; ResourceInfo.Name = ResourceId; - ResourceInfo.Language = 0; + ResourceInfo.Language = MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL); + Status = LdrFindResource_U(LdrEntry->DllBase, &ResourceInfo, RESOURCE_DATA_LEVEL, diff --git a/ntoskrnl/ke/bug.c b/ntoskrnl/ke/bug.c index bf0843ed23e..7ab38c6614b 100644 --- a/ntoskrnl/ke/bug.c +++ b/ntoskrnl/ke/bug.c @@ -310,12 +310,12 @@ KiInitializeBugCheck(VOID) LDR_DATA_TABLE_ENTRY, InLoadOrderLinks); - /* Cache the Bugcheck Message Strings. Prepare the Lookup Data */ - ResourceInfo.Type = 11; + /* Cache the bugcheck message strings. Prepare the lookup data. */ + ResourceInfo.Type = RT_MESSAGETABLE; ResourceInfo.Name = 1; - ResourceInfo.Language = 9; + ResourceInfo.Language = MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL); - /* Do the lookup. */ + /* Do the lookup */ Status = LdrFindResource_U(LdrEntry->DllBase, &ResourceInfo, RESOURCE_DATA_LEVEL, @@ -449,7 +449,7 @@ KiDoBugCheckCallbacks(VOID) NextEntry = ListHead->Flink; while (NextEntry != ListHead) { - /* Get the reord */ + /* Get the record */ CurrentRecord = CONTAINING_RECORD(NextEntry, KBUGCHECK_CALLBACK_RECORD, Entry);