mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 22:33:00 +00:00
[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.
This commit is contained in:
parent
111c8cc62a
commit
1b564c1ba8
6 changed files with 21 additions and 18 deletions
|
@ -14,7 +14,6 @@
|
|||
#include <windef.h>
|
||||
#include <winbase.h>
|
||||
#include <winreg.h>
|
||||
#include <winuser.h>
|
||||
|
||||
#define NTOS_MODE_USER
|
||||
#include <ndk/cmfuncs.h>
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue