#include "precomp.h"
#include <ndk/ldrtypes.h>
#include <ndk/ldrfuncs.h>
#include "ntverrsrc.h"
#include <debug.h>
Go to the source code of this file.
|
NTSTATUS | NtGetVersionResource (IN PVOID BaseAddress, OUT PVOID *Resource, OUT PULONG ResourceSize OPTIONAL) |
|
static PCVS_VERSION_INFO_STRUCT32 | VersionInfo32_FindChild (IN PCVS_VERSION_INFO_STRUCT32 info, IN PCWSTR szKey, IN UINT cchKey) |
|
static NTSTATUS | VersionInfo32_QueryValue (IN PCVS_VERSION_INFO_STRUCT32 info, IN PCWSTR lpSubBlock, OUT PVOID *lplpBuffer, OUT PUINT puLen OPTIONAL, OUT BOOL *pbText OPTIONAL) |
|
NTSTATUS | NtVerQueryValue (IN const VOID *pBlock, IN PCWSTR lpSubBlock, OUT PVOID *lplpBuffer, OUT PUINT puLen) |
|
◆ DWORD_ALIGN
◆ NDEBUG
◆ VersionInfo32_Children
#define VersionInfo32_Children |
( |
|
ver | ) |
|
Value:
( ( (ver)->wValueLength * \
((ver)->wType? 2 : 1) + 3 ) & ~3 ) )
const VS_VERSION_INFO_STRUCT32 * PCVS_VERSION_INFO_STRUCT32
#define VersionInfo32_Value(ver)
Definition at line 95 of file ntverrsrc.c.
◆ VersionInfo32_Next
◆ VersionInfo32_Value
◆ VS_FILE_INFO
◆ VS_VERSION_INFO
◆ PCVS_VERSION_INFO_STRUCT32
◆ PVS_VERSION_INFO_STRUCT32
◆ VS_VERSION_INFO_STRUCT32
◆ NtGetVersionResource()
Definition at line 26 of file ntverrsrc.c.
30{
31
32#define VS_VERSION_INFO 1
33#define VS_FILE_INFO RT_VERSION
34
40
41
42 ResourceInfo.
Type = 16;
45
47 &ResourceInfo,
49 &ResourceDataEntry);
51 {
52 DPRINT1(
"NtGetVersionResource: Version resource not found, Status 0x%08lx\n",
Status);
54 }
55
56
58 ResourceDataEntry,
62 {
63 DPRINT1(
"NtGetVersionResource: Cannot access Version resource, Status 0x%08lx\n",
Status);
65 }
66
68 if (ResourceSize) *ResourceSize =
Size;
69
71}
_Acquires_exclusive_lock_ Resource _Acquires_shared_lock_ Resource _Inout_ PERESOURCE Resource
#define NT_SUCCESS(StatCode)
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
_In_ HANDLE _Outptr_result_bytebuffer_ ViewSize PVOID * BaseAddress
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
Referenced by CheckForValidPEAndVendor().
◆ NtVerQueryValue()
Definition at line 174 of file ntverrsrc.c.
179{
181
183
184 if (!pBlock)
186
187 if (!lpSubBlock || !*lpSubBlock)
189
191}
static NTSTATUS VersionInfo32_QueryValue(IN PCVS_VERSION_INFO_STRUCT32 info, IN PCWSTR lpSubBlock, OUT PVOID *lplpBuffer, OUT PUINT puLen OPTIONAL, OUT BOOL *pbText OPTIONAL)
Referenced by CheckForValidPEAndVendor().
◆ VersionInfo32_FindChild()
Definition at line 104 of file ntverrsrc.c.
108{
110
112 {
115
118 }
119
121}
#define VersionInfo32_Next(ver)
#define VersionInfo32_Children(ver)
_Check_return_ _CRTIMP int __cdecl _wcsnicmp(_In_reads_or_z_(_MaxCount) const wchar_t *_Str1, _In_reads_or_z_(_MaxCount) const wchar_t *_Str2, _In_ size_t _MaxCount)
Referenced by VersionInfo32_QueryValue().
◆ VersionInfo32_QueryValue()
Definition at line 124 of file ntverrsrc.c.
130{
132
133 DPRINT(
"lpSubBlock : (%S)\n", lpSubBlock);
134
135 while (*lpSubBlock)
136 {
137
138 for (lpNextSlash = lpSubBlock; *lpNextSlash; lpNextSlash++)
139 {
140 if (*lpNextSlash == '\\')
141 break;
142 }
143
144
145 if (lpNextSlash == lpSubBlock)
146 {
147 lpSubBlock++;
148 continue;
149 }
150
151
154 {
155 if (puLen) *puLen = 0;
157 }
158
159
160 lpSubBlock = lpNextSlash;
161 }
162
163
165 if (puLen)
166 *puLen =
info->wValueLength;
167 if (pbText)
168 *pbText =
info->wType;
169
171}
#define STATUS_RESOURCE_TYPE_NOT_FOUND
static PCVS_VERSION_INFO_STRUCT32 VersionInfo32_FindChild(IN PCVS_VERSION_INFO_STRUCT32 info, IN PCWSTR szKey, IN UINT cchKey)
Referenced by NtVerQueryValue().