ReactOS 0.4.16-dev-1020-gf135cab
ntverrsrc.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

NTSTATUS NtGetVersionResource (IN PVOID BaseAddress, OUT PVOID *Resource, OUT PULONG ResourceSize OPTIONAL)
 
NTSTATUS NtVerQueryValue (IN const VOID *pBlock, IN PCWSTR lpSubBlock, OUT PVOID *lplpBuffer, OUT PUINT puLen)
 

Function Documentation

◆ NtGetVersionResource()

NTSTATUS NtGetVersionResource ( IN PVOID  BaseAddress,
OUT PVOID Resource,
OUT PULONG ResourceSize  OPTIONAL 
)

Definition at line 31 of file ntverrsrc.c.

35{
37 LDR_RESOURCE_INFO ResourceInfo;
38 PIMAGE_RESOURCE_DATA_ENTRY ResourceDataEntry;
39 PVOID Data = NULL;
40 ULONG Size = 0;
41
42 /* Try to find the resource (language-neutral) */
43 ResourceInfo.Type = RT_VERSION;
44 ResourceInfo.Name = VS_VERSION_INFO;
46
48 &ResourceInfo,
50 &ResourceDataEntry);
51 if (!NT_SUCCESS(Status))
52 {
53 DPRINT1("NtGetVersionResource: Version resource not found, Status 0x%08lx\n", Status);
54 return Status;
55 }
56
57 /* Access the resource */
59 ResourceDataEntry,
60 &Data,
61 &Size);
62 if (!NT_SUCCESS(Status))
63 {
64 DPRINT1("NtGetVersionResource: Cannot access Version resource, Status 0x%08lx\n", Status);
65 return Status;
66 }
67
68 *Resource = Data;
69 if (ResourceSize) *ResourceSize = Size;
70
71 return STATUS_SUCCESS;
72}
LONG NTSTATUS
Definition: precomp.h:26
#define DPRINT1
Definition: precomp.h:8
_Acquires_exclusive_lock_ Resource _Acquires_shared_lock_ Resource _Inout_ PERESOURCE Resource
Definition: cdprocs.h:843
#define NULL
Definition: types.h:112
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:33
Status
Definition: gdiplustypes.h:25
NTSTATUS NTAPI LdrAccessResource(_In_ PVOID BaseAddress, _In_ PIMAGE_RESOURCE_DATA_ENTRY ResourceDataEntry, _Out_opt_ PVOID *Resource, _Out_opt_ PULONG Size)
NTSTATUS NTAPI LdrFindResource_U(_In_ PVOID BaseAddress, _In_ PLDR_RESOURCE_INFO ResourceInfo, _In_ ULONG Level, _Out_ PIMAGE_RESOURCE_DATA_ENTRY *ResourceDataEntry)
#define RESOURCE_DATA_LEVEL
Definition: ldrtypes.h:33
_In_ HANDLE _Outptr_result_bytebuffer_ ViewSize PVOID * BaseAddress
Definition: mmfuncs.h:404
#define VS_VERSION_INFO
Definition: ntverrsrc.c:27
#define RT_VERSION
Definition: ntverrsrc.c:26
#define LANG_NEUTRAL
Definition: nls.h:22
#define MAKELANGID(p, s)
Definition: nls.h:15
#define SUBLANG_NEUTRAL
Definition: nls.h:167
#define STATUS_SUCCESS
Definition: shellext.h:65
Definition: pedump.c:458
ULONG_PTR Language
Definition: ldrtypes.h:187
ULONG_PTR Name
Definition: ldrtypes.h:186
ULONG_PTR Type
Definition: ldrtypes.h:185
uint32_t ULONG
Definition: typedefs.h:59
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
Definition: wdfdevice.h:4533

Referenced by CheckForValidPEAndVendor().

◆ NtVerQueryValue()

NTSTATUS NtVerQueryValue ( IN const VOID pBlock,
IN PCWSTR  lpSubBlock,
OUT PVOID lplpBuffer,
OUT PUINT  puLen 
)

Definition at line 175 of file ntverrsrc.c.

180{
182
183 DPRINT("%s (%p, %S, %p, %p)\n", __FUNCTION__, pBlock, lpSubBlock, lplpBuffer, puLen);
184
185 if (!pBlock)
186 return FALSE;
187
188 if (!lpSubBlock || !*lpSubBlock)
189 lpSubBlock = L"\\";
190
191 return VersionInfo32_QueryValue(info, lpSubBlock, lplpBuffer, puLen, NULL);
192}
#define FALSE
Definition: types.h:117
#define __FUNCTION__
Definition: types.h:116
#define L(x)
Definition: ntvdm.h:50
static NTSTATUS VersionInfo32_QueryValue(IN PCVS_VERSION_INFO_STRUCT32 info, IN PCWSTR lpSubBlock, OUT PVOID *lplpBuffer, OUT PUINT puLen OPTIONAL, OUT BOOL *pbText OPTIONAL)
Definition: ntverrsrc.c:125
#define DPRINT
Definition: sndvol32.h:73

Referenced by CheckForValidPEAndVendor().