Reactos

[REACTOS] Use the RT_* resource type defines where possible (#6023)

And use the self-documenting `MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL)`
instead of `0` for the `LDR_RESOURCE_INFO::Language` structure member.

+21 -18
-1
base/setup/lib/precomp.h
··· 14 14 #include <windef.h> 15 15 #include <winbase.h> 16 16 #include <winreg.h> 17 - #include <winuser.h> 18 17 19 18 #define NTOS_MODE_USER 20 19 #include <ndk/cmfuncs.h>
+9 -8
base/setup/lib/utils/ntverrsrc.c
··· 22 22 23 23 /* FUNCTIONS ****************************************************************/ 24 24 25 + #define MAKEINTRESOURCE(i) ((ULONG_PTR)(USHORT)(i)) 26 + #define RT_VERSION MAKEINTRESOURCE(16) // See psdk/winuser.h 27 + #define VS_VERSION_INFO 1 // See psdk/verrsrc.h 28 + #define VS_FILE_INFO RT_VERSION 29 + 25 30 NTSTATUS 26 31 NtGetVersionResource( 27 32 IN PVOID BaseAddress, 28 33 OUT PVOID* Resource, 29 34 OUT PULONG ResourceSize OPTIONAL) 30 35 { 31 - // #define RT_VERSION MAKEINTRESOURCE(16) // See winuser.h 32 - #define VS_VERSION_INFO 1 // See psdk/verrsrc.h 33 - #define VS_FILE_INFO RT_VERSION 34 - 35 36 NTSTATUS Status; 36 37 LDR_RESOURCE_INFO ResourceInfo; 37 38 PIMAGE_RESOURCE_DATA_ENTRY ResourceDataEntry; 38 39 PVOID Data = NULL; 39 40 ULONG Size = 0; 40 41 41 - /* Try to find the resource */ 42 - ResourceInfo.Type = 16; // RT_VERSION; 43 - ResourceInfo.Name = VS_VERSION_INFO; // MAKEINTRESOURCEW(VS_VERSION_INFO); 44 - ResourceInfo.Language = 0; // Don't care about the language 42 + /* Try to find the resource (language-neutral) */ 43 + ResourceInfo.Type = RT_VERSION; 44 + ResourceInfo.Name = VS_VERSION_INFO; 45 + ResourceInfo.Language = MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL); 45 46 46 47 Status = LdrFindResource_U(BaseAddress, 47 48 &ResourceInfo,
+1 -1
dll/win32/kernel32/client/actctx.c
··· 156 156 /* Check whether the image has manifest resource associated with it */ 157 157 Info.Type = (ULONG_PTR)RT_MANIFEST; 158 158 Info.Name = (ULONG_PTR)ISOLATIONAWARE_MANIFEST_RESOURCE_ID; 159 - Info.Language = 0; 159 + Info.Language = MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL); 160 160 if (!(Status = LdrFindResource_U(DllHandle, &Info, 3, &Entry))) 161 161 { 162 162 /* Create the activation context */
+1 -1
drivers/ksfilter/ks/image.c
··· 38 38 /* set up resource info */ 39 39 ResourceInfo.Type = ResourceType; 40 40 ResourceInfo.Name = ResourceName; 41 - ResourceInfo.Language = 0; 41 + ResourceInfo.Language = MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL); 42 42 43 43 _SEH2_TRY 44 44 {
+5 -2
ntoskrnl/inbv/inbv.c
··· 91 91 92 92 /* FUNCTIONS *****************************************************************/ 93 93 94 + #define RT_BITMAP MAKEINTRESOURCE(2) 95 + 94 96 CODE_SEG("INIT") 95 97 static 96 98 PVOID ··· 131 133 if (NextEntry != ListHead) 132 134 { 133 135 /* Try to find the resource */ 134 - ResourceInfo.Type = 2; // RT_BITMAP; 136 + ResourceInfo.Type = RT_BITMAP; 135 137 ResourceInfo.Name = ResourceId; 136 - ResourceInfo.Language = 0; 138 + ResourceInfo.Language = MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL); 139 + 137 140 Status = LdrFindResource_U(LdrEntry->DllBase, 138 141 &ResourceInfo, 139 142 RESOURCE_DATA_LEVEL,
+5 -5
ntoskrnl/ke/bug.c
··· 310 310 LDR_DATA_TABLE_ENTRY, 311 311 InLoadOrderLinks); 312 312 313 - /* Cache the Bugcheck Message Strings. Prepare the Lookup Data */ 314 - ResourceInfo.Type = 11; 313 + /* Cache the bugcheck message strings. Prepare the lookup data. */ 314 + ResourceInfo.Type = RT_MESSAGETABLE; 315 315 ResourceInfo.Name = 1; 316 - ResourceInfo.Language = 9; 316 + ResourceInfo.Language = MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL); 317 317 318 - /* Do the lookup. */ 318 + /* Do the lookup */ 319 319 Status = LdrFindResource_U(LdrEntry->DllBase, 320 320 &ResourceInfo, 321 321 RESOURCE_DATA_LEVEL, ··· 449 449 NextEntry = ListHead->Flink; 450 450 while (NextEntry != ListHead) 451 451 { 452 - /* Get the reord */ 452 + /* Get the record */ 453 453 CurrentRecord = CONTAINING_RECORD(NextEntry, 454 454 KBUGCHECK_CALLBACK_RECORD, 455 455 Entry);