ReactOS 0.4.15-dev-7942-gd23573b
verifier.c
Go to the documentation of this file.
1/*
2 * PROJECT: ReactOS NT User Mode Library
3 * LICENSE: GPL-2.0+ (https://spdx.org/licenses/GPL-2.0+)
4 * PURPOSE: Verifier support routines
5 * COPYRIGHT: Copyright 2011 Aleksey Bragin (aleksey@reactos.org)
6 * Copyright 2018 Mark Jansen (mark.jansen@reactos.org)
7 */
8
9
10#include <ntdll.h>
11#include <reactos/verifier.h>
12
13#define NDEBUG
14#include <debug.h>
15
23
24#define VERIFIER_DLL_FLAGS_RESOLVED 1
25
26
27typedef struct _VERIFIER_PROVIDER
28{
33
34 // Provider data
40
41
42
43
44VOID
47{
49
51 L"VerifierDlls",
52 REG_SZ,
54 sizeof(AVrfpVerifierDllsString) - sizeof(WCHAR),
55 NULL);
56
57 if (!NT_SUCCESS(Status))
59
61 L"VerifierFlags",
64 sizeof(AVrfpVerifierFlags),
65 NULL);
66 if (!NT_SUCCESS(Status))
68
70 L"VerifierDebug",
73 sizeof(AVrfpDebug),
74 NULL);
75 if (!NT_SUCCESS(Status))
76 AVrfpDebug = 0;
77}
78
79
83{
84 /* If global flags request DPH, perform some additional actions */
86 {
87 // TODO: Read advanced DPH flags from the registry if requested
88 if (ReadAdvancedOptions)
89 {
91 }
92
93 /* Enable page heap */
95 }
96
98
99 return STATUS_SUCCESS;
100}
101
104{
107
109 {
111
112 if (BaseAddress == Provider->BaseAddress)
113 return TRUE;
114 }
115
116 return FALSE;
117}
118
119SIZE_T
121{
122 SIZE_T Count = 0;
123 while (Thunk[Count].u1.Function)
124 Count++;
125 return Count;
126}
127
128VOID
130{
131 ULONG Size;
132 PIMAGE_IMPORT_DESCRIPTOR ImportDescriptor;
133 PBYTE DllBase = LdrEntry->DllBase;
134
136 if (!ImportDescriptor)
137 {
138 //SHIMENG_INFO("Skipping module 0x%p \"%wZ\" due to no iat found\n", LdrEntry->DllBase, &LdrEntry->BaseDllName);
139 return;
140 }
141
142 for (; ImportDescriptor->Name && ImportDescriptor->OriginalFirstThunk; ImportDescriptor++)
143 {
144 PIMAGE_THUNK_DATA FirstThunk;
145 PVOID UnprotectedPtr = NULL;
146 SIZE_T UnprotectedSize = 0;
147 ULONG OldProtection = 0;
148 FirstThunk = (PIMAGE_THUNK_DATA)(DllBase + ImportDescriptor->FirstThunk);
149
150 /* Walk all imports */
151 for (;FirstThunk->u1.Function; FirstThunk++)
152 {
155
157 {
158 PRTL_VERIFIER_DLL_DESCRIPTOR DllDescriptor;
159
161 for (DllDescriptor = Provider->ProviderDlls; DllDescriptor && DllDescriptor->DllName; ++DllDescriptor)
162 {
163 PRTL_VERIFIER_THUNK_DESCRIPTOR ThunkDescriptor;
164
165 for (ThunkDescriptor = DllDescriptor->DllThunks; ThunkDescriptor && ThunkDescriptor->ThunkName; ++ThunkDescriptor)
166 {
167 /* Just compare function addresses, the loader will have handled forwarders and ordinals for us */
168 if ((PVOID)FirstThunk->u1.Function != ThunkDescriptor->ThunkOldAddress)
169 continue;
170
171 if (!UnprotectedPtr)
172 {
173 PVOID Ptr = &FirstThunk->u1.Function;
174 SIZE_T Size = sizeof(FirstThunk->u1.Function) * AVrfpCountThunks(FirstThunk);
176
177 UnprotectedPtr = Ptr;
178 UnprotectedSize = Size;
179
181 &Ptr,
182 &Size,
184 &OldProtection);
185
186 if (!NT_SUCCESS(Status))
187 {
188 DbgPrint("AVRF: Unable to unprotect IAT to modify thunks (status %08X).\n", Status);
189 UnprotectedPtr = NULL;
190 continue;
191 }
192 }
193
194 if (ThunkDescriptor->ThunkNewAddress == NULL)
195 {
196 DbgPrint("AVRF: internal error: New thunk for %s is null.\n", ThunkDescriptor->ThunkName);
197 continue;
198 }
199 FirstThunk->u1.Function = (SIZE_T)ThunkDescriptor->ThunkNewAddress;
201 DbgPrint("AVRF: Snapped (%wZ: %s) with (%wZ: %p).\n",
202 &LdrEntry->BaseDllName,
203 ThunkDescriptor->ThunkName,
204 &Provider->DllName,
205 ThunkDescriptor->ThunkNewAddress);
206 }
207 }
208 }
209 }
210
211 if (UnprotectedPtr)
212 {
213 PVOID Ptr = UnprotectedPtr;
214 SIZE_T Size = UnprotectedSize;
216
217 UnprotectedPtr = Ptr;
218 UnprotectedSize = Size;
219
221 &Ptr,
222 &Size,
223 OldProtection,
224 &OldProtection);
225 if (!NT_SUCCESS(Status))
226 {
227 DbgPrint("AVRF: Unable to reprotect IAT to modify thunks (status %08X).\n", Status);
228 }
229 }
230 }
231}
232
233
234VOID
236{
239
240 if (!AVrfpInitialized)
241 return;
242
244 {
245 PRTL_VERIFIER_DLL_DESCRIPTOR DllDescriptor;
246
248
249 for (DllDescriptor = Provider->ProviderDlls; DllDescriptor && DllDescriptor->DllName; ++DllDescriptor)
250 {
251 PRTL_VERIFIER_THUNK_DESCRIPTOR ThunkDescriptor;
252
253 if ((DllDescriptor->DllFlags & VERIFIER_DLL_FLAGS_RESOLVED) ||
254 _wcsicmp(DllDescriptor->DllName, LdrEntry->BaseDllName.Buffer))
255 continue;
256
258 DbgPrint("AVRF: pid 0x%X: found dll descriptor for `%wZ' with verified exports\n",
260 &LdrEntry->BaseDllName);
261
262 for (ThunkDescriptor = DllDescriptor->DllThunks; ThunkDescriptor && ThunkDescriptor->ThunkName; ++ThunkDescriptor)
263 {
264 if (!ThunkDescriptor->ThunkOldAddress)
265 {
266 ANSI_STRING ThunkName;
267
268 RtlInitAnsiString(&ThunkName, ThunkDescriptor->ThunkName);
269 /* We cannot call the public api, because that would run init routines! */
270 if (NT_SUCCESS(LdrpGetProcedureAddress(LdrEntry->DllBase, &ThunkName, 0, &ThunkDescriptor->ThunkOldAddress, FALSE)))
271 {
273 DbgPrint("AVRF: (%wZ) %Z export found.\n", &LdrEntry->BaseDllName, &ThunkName);
274 }
275 else
276 {
278 DbgPrint("AVRF: warning: did not find `%Z' export in %wZ.\n", &ThunkName, &LdrEntry->BaseDllName);
279 }
280 }
281 }
282
283 DllDescriptor->DllFlags |= VERIFIER_DLL_FLAGS_RESOLVED;
284 }
285 }
286
287 AVrfpSnapDllImports(LdrEntry);
288}
289
290
291
292VOID
293NTAPI
295{
297
299 return;
300
302 if (!AVrfpIsVerifierProviderDll(LdrEntry->DllBase))
303 {
304 AvrfpResolveThunks(LdrEntry);
305
307 {
309 RTL_VERIFIER_DLL_LOAD_CALLBACK ProviderDllLoadCallback;
310
312
313 ProviderDllLoadCallback = Provider->ProviderDllLoadCallback;
314 if (ProviderDllLoadCallback)
315 {
316 ProviderDllLoadCallback(LdrEntry->BaseDllName.Buffer,
317 LdrEntry->DllBase,
318 LdrEntry->SizeOfImage,
319 LdrEntry);
320 }
321 }
322 }
324}
325
326VOID
327NTAPI
329{
331
333 return;
334
336 if (!AVrfpIsVerifierProviderDll(LdrEntry->DllBase))
337 {
339 {
341 RTL_VERIFIER_DLL_UNLOAD_CALLBACK ProviderDllUnloadCallback;
342
344
345 ProviderDllUnloadCallback = Provider->ProviderDllUnloadCallback;
346 if (ProviderDllUnloadCallback)
347 {
348 ProviderDllUnloadCallback(LdrEntry->BaseDllName.Buffer,
349 LdrEntry->DllBase,
350 LdrEntry->SizeOfImage,
351 LdrEntry);
352 }
353 }
354 }
356}
357
358
359VOID
360NTAPI
362{
363 /* Check if page heap dll notification is turned on */
365 return;
366
367 /* We don't support this flag currently */
369}
370
371
372VOID
373NTAPI
375{
376 PLIST_ENTRY ListHead, ListEntry;
377
378 ListHead = &NtCurrentPeb()->Ldr->InLoadOrderModuleList;
379 for (ListEntry = ListHead->Flink; ListHead != ListEntry; ListEntry = ListEntry->Flink)
380 {
381 PLDR_DATA_TABLE_ENTRY LdrEntry;
382
383 LdrEntry = CONTAINING_RECORD(ListEntry, LDR_DATA_TABLE_ENTRY, InLoadOrderLinks);
384
385 if (AVrfpIsVerifierProviderDll(LdrEntry->DllBase))
386 {
388 DbgPrint("AVRF: skipped resnapping provider %wZ ...\n", &LdrEntry->BaseDllName);
389 }
390 else
391 {
393 DbgPrint("AVRF: resnapping %wZ ...\n", &LdrEntry->BaseDllName);
394
395 AvrfpResolveThunks(LdrEntry);
396 }
397 }
398}
399
400PVOID
401NTAPI
402AvrfpFindDuplicateThunk(PLIST_ENTRY EndEntry, PWCHAR DllName, PCHAR ThunkName)
403{
405
406 for (Entry = AVrfpVerifierProvidersList.Flink; Entry != EndEntry; Entry = Entry->Flink)
407 {
409 PRTL_VERIFIER_DLL_DESCRIPTOR DllDescriptor;
410
412
414 DbgPrint("AVRF: chain: searching in %wZ\n", &Provider->DllName);
415
416 for (DllDescriptor = Provider->ProviderDlls; DllDescriptor && DllDescriptor->DllName; ++DllDescriptor)
417 {
418 PRTL_VERIFIER_THUNK_DESCRIPTOR ThunkDescriptor;
419
421 DbgPrint("AVRF: chain: dll: %ws\n", DllDescriptor->DllName);
422
423 if (_wcsicmp(DllDescriptor->DllName, DllName))
424 continue;
425
426 for (ThunkDescriptor = DllDescriptor->DllThunks; ThunkDescriptor && ThunkDescriptor->ThunkName; ++ThunkDescriptor)
427 {
429 DbgPrint("AVRF: chain: thunk: %s == %s ?\n", ThunkDescriptor->ThunkName, ThunkName);
430
431 if (!_stricmp(ThunkDescriptor->ThunkName, ThunkName))
432 {
434 DbgPrint("AVRF: Found duplicate for (%ws: %s) in %wZ\n",
435 DllDescriptor->DllName, ThunkDescriptor->ThunkName, &Provider->DllName);
436
437 return ThunkDescriptor->ThunkNewAddress;
438 }
439 }
440 }
441 }
442 return NULL;
443}
444
445
446VOID
447NTAPI
449{
452
454 {
455 PRTL_VERIFIER_DLL_DESCRIPTOR DllDescriptor;
456 PRTL_VERIFIER_THUNK_DESCRIPTOR ThunkDescriptor;
457
459
460 for (DllDescriptor = Provider->ProviderDlls; DllDescriptor && DllDescriptor->DllName; ++DllDescriptor)
461 {
462 for (ThunkDescriptor = DllDescriptor->DllThunks; ThunkDescriptor && ThunkDescriptor->ThunkName; ++ThunkDescriptor)
463 {
464 PVOID Ptr;
465
467 DbgPrint("AVRF: Checking %wZ for duplicate (%ws: %s)\n",
468 &Provider->DllName, DllDescriptor->DllName, ThunkDescriptor->ThunkName);
469
470 Ptr = AvrfpFindDuplicateThunk(Entry, DllDescriptor->DllName, ThunkDescriptor->ThunkName);
471 if (Ptr)
472 {
474 DbgPrint("AVRF: Chaining (%ws: %s) to %wZ\n", DllDescriptor->DllName, ThunkDescriptor->ThunkName, &Provider->DllName);
475
476 ThunkDescriptor->ThunkOldAddress = Ptr;
477 }
478 }
479 }
480 }
481}
482
484NTAPI
486{
492
493 RtlInitEmptyUnicodeString(&DllPath, StringBuffer, sizeof(StringBuffer));
495 RtlAppendUnicodeToString(&DllPath, L"\\System32\\");
496
498 DbgPrint("AVRF: verifier dll `%wZ'\n", &Provider->DllName);
499
500 Status = LdrLoadDll(DllPath.Buffer, NULL, &Provider->DllName, &Provider->BaseAddress);
501 if (!NT_SUCCESS(Status))
502 {
503 DbgPrint("AVRF: %wZ: failed to load provider `%wZ' (status %08X) from %wZ\n",
505 &Provider->DllName,
506 Status,
507 &DllPath);
508 return Status;
509 }
510
511 /* Prevent someone funny from specifying his own application as provider */
513 if (!ImageNtHeader ||
515 {
516 DbgPrint("AVRF: provider %wZ is not a DLL image\n", &Provider->DllName);
518 }
519
520 Provider->EntryPoint = LdrpFetchAddressOfEntryPoint(Provider->BaseAddress);
521 if (!Provider->EntryPoint)
522 {
523 DbgPrint("AVRF: cannot find an entry point for provider %wZ\n", &Provider->DllName);
525 }
526
528 {
529 if (LdrpCallInitRoutine(Provider->EntryPoint,
530 Provider->BaseAddress,
532 &Descriptor))
533 {
535 {
536 /* Copy the data */
537 Provider->ProviderDlls = Descriptor->ProviderDlls;
538 Provider->ProviderDllLoadCallback = Descriptor->ProviderDllLoadCallback;
539 Provider->ProviderDllUnloadCallback = Descriptor->ProviderDllUnloadCallback;
540 Provider->ProviderNtdllHeapFreeCallback = Descriptor->ProviderNtdllHeapFreeCallback;
541
542 /* Update some info for the provider */
544 Descriptor->VerifierFlags = AVrfpVerifierFlags;
545 Descriptor->VerifierDebug = AVrfpDebug;
546
547 /* We don't have these yet */
548 DPRINT1("AVRF: RtlpGetStackTraceAddress MISSING\n");
549 DPRINT1("AVRF: RtlpDebugPageHeapCreate MISSING\n");
550 DPRINT1("AVRF: RtlpDebugPageHeapDestroy MISSING\n");
551 Descriptor->RtlpGetStackTraceAddress = NULL;
552 Descriptor->RtlpDebugPageHeapCreate = NULL;
553 Descriptor->RtlpDebugPageHeapDestroy = NULL;
555 }
556 else
557 {
558 DbgPrint("AVRF: provider %wZ passed an invalid descriptor @ %p\n", &Provider->DllName, Descriptor);
560 }
561 }
562 else
563 {
564 DbgPrint("AVRF: provider %wZ did not initialize correctly\n", &Provider->DllName);
566 }
567 }
569 {
571 }
572 _SEH2_END;
573
574 if (!NT_SUCCESS(Status))
575 return Status;
576
577
579 DbgPrint("AVRF: initialized provider %wZ (descriptor @ %p)\n", &Provider->DllName, Descriptor);
580
581 /* Done loading providers, allow dll notifications */
583
586
587 /* Manually call with DLL_PROCESS_ATTACH, since the process is not done initializing */
589 {
590 if (!LdrpCallInitRoutine(Provider->EntryPoint,
591 Provider->BaseAddress,
593 NULL))
594 {
595 DbgPrint("AVRF: provider %wZ did not initialize correctly\n", &Provider->DllName);
597 }
598
599 }
601 {
603 }
604 _SEH2_END;
605
606 return Status;
607}
608
609
611NTAPI
613{
617 WCHAR* Ptr, *Next;
618
621
622 if (!NT_SUCCESS(Status))
623 return Status;
624
625 DbgPrint("AVRF: %wZ: pid 0x%X: flags 0x%X: application verifier enabled\n",
627
628 Provider = RtlAllocateHeap(RtlGetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(VERIFIER_PROVIDER));
629 if (!Provider)
630 return STATUS_NO_MEMORY;
631
632 RtlInitUnicodeString(&Provider->DllName, L"verifier.dll");
634
636
637 do
638 {
639 while (*Next == L' ' || *Next == L'\t')
640 Next++;
641
642 Ptr = Next;
643
644 while (*Next != ' ' && *Next != '\t' && *Next)
645 Next++;
646
647 if (*Next)
648 *(Next++) = '\0';
649 else
650 Next = NULL;
651
652 if (*Ptr)
653 {
654 Provider = RtlAllocateHeap(RtlGetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(VERIFIER_PROVIDER));
655 if (!Provider)
656 return STATUS_NO_MEMORY;
659 }
660 } while (Next);
661
664 {
666 Entry = Entry->Flink;
667
669 if (!NT_SUCCESS(Status))
670 {
671 RemoveEntryList(&Provider->ListEntry);
672 RtlFreeHeap(RtlGetProcessHeap(), 0, Provider);
673 }
674 }
675
676 if (!NT_SUCCESS(Status))
677 {
678 DbgPrint("AVRF: %wZ: pid 0x%X: application verifier will be disabled due to an initialization error.\n",
680 NtCurrentPeb()->NtGlobalFlag &= ~FLG_APPLICATION_VERIFIER;
681 }
682
683 return Status;
684}
685
#define NtCurrentPeb()
Definition: FLS.c:22
unsigned char BOOLEAN
LONG NTSTATUS
Definition: precomp.h:26
#define DPRINT1
Definition: precomp.h:8
#define UNIMPLEMENTED
Definition: debug.h:115
PVOID NTAPI RtlAllocateHeap(IN PVOID HeapHandle, IN ULONG Flags, IN SIZE_T Size)
Definition: heap.c:590
BOOLEAN NTAPI RtlFreeHeap(IN PVOID HeapHandle, IN ULONG Flags, IN PVOID HeapBase)
Definition: heap.c:608
#define _stricmp
Definition: cat.c:22
PIMAGE_NT_HEADERS WINAPI ImageNtHeader(_In_ PVOID)
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define DLL_PROCESS_ATTACH
Definition: compat.h:131
#define RtlImageDirectoryEntryToData
Definition: compat.h:809
#define RtlImageNtHeader
Definition: compat.h:806
#define MAX_PATH
Definition: compat.h:34
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
PPEB Peb
Definition: dllmain.c:27
#define RemoveEntryList(Entry)
Definition: env_spec_w32.h:986
#define InsertTailList(ListHead, Entry)
NTSTATUS RtlAppendUnicodeToString(IN PUNICODE_STRING Str1, IN PWSTR Str2)
Definition: string_lib.cpp:62
#define InitializeListHead(ListHead)
Definition: env_spec_w32.h:944
#define _SEH2_END
Definition: filesup.c:22
#define _SEH2_TRY
Definition: filesup.c:19
unsigned int BOOL
Definition: ntddk_ex.h:94
_Must_inspect_result_ _In_ PFSRTL_PER_STREAM_CONTEXT Ptr
Definition: fsrtlfuncs.h:898
Status
Definition: gdiplustypes.h:25
GLdouble u1
Definition: glext.h:8308
#define DbgPrint
Definition: hal.h:12
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
#define FLG_HEAP_PAGE_ALLOCS
Definition: pstypes.h:84
#define FLG_APPLICATION_VERIFIER
Definition: pstypes.h:64
#define NtCurrentTeb
#define REG_SZ
Definition: layer.c:22
NTSTATUS NTAPI DECLSPEC_HOTPATCH LdrLoadDll(_In_opt_ PWSTR SearchPath, _In_opt_ PULONG DllCharacteristics, _In_ PUNICODE_STRING DllName, _Out_ PVOID *BaseAddress)
Definition: ldrapi.c:312
NTSTATUS NTAPI LdrQueryImageFileKeyOption(_In_ HANDLE KeyHandle, _In_ PCWSTR ValueName, _In_ ULONG Type, _Out_ PVOID Buffer, _In_ ULONG BufferSize, _Out_opt_ PULONG ReturnedLength)
Definition: ldrinit.c:185
WCHAR StringBuffer[156]
Definition: ldrinit.c:41
if(dx< 0)
Definition: linetemp.h:194
static const char const char * DllPath
Definition: image.c:34
_Must_inspect_result_ _Out_ PNDIS_STATUS _In_ NDIS_HANDLE _In_ ULONG _Out_ PNDIS_STRING _Out_ PNDIS_HANDLE KeyHandle
Definition: ndis.h:4715
_In_ HANDLE _Outptr_result_bytebuffer_ ViewSize PVOID * BaseAddress
Definition: mmfuncs.h:404
NTSYSAPI NTSTATUS NTAPI RtlEnterCriticalSection(_In_ PRTL_CRITICAL_SECTION CriticalSection)
NTSYSAPI NTSTATUS NTAPI RtlLeaveCriticalSection(_In_ PRTL_CRITICAL_SECTION CriticalSection)
NTSYSAPI NTSTATUS NTAPI RtlInitializeCriticalSection(_In_ PRTL_CRITICAL_SECTION CriticalSection)
int Count
Definition: noreturn.cpp:7
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
#define NtCurrentProcess()
Definition: nt_native.h:1657
NTSYSAPI VOID NTAPI RtlInitAnsiString(PANSI_STRING DestinationString, PCSZ SourceString)
#define PAGE_EXECUTE_READWRITE
Definition: nt_native.h:1308
#define UNICODE_NULL
ULONG AVrfpVerifierFlags
Definition: verifier.c:17
LIST_ENTRY AVrfpVerifierProvidersList
Definition: verifier.c:22
PLDR_DATA_TABLE_ENTRY LdrpImageEntry
Definition: ldrinit.c:39
NTSTATUS NTAPI LdrpInitializeApplicationVerifierPackage(HANDLE KeyHandle, PPEB Peb, BOOLEAN SystemWide, BOOLEAN ReadAdvancedOptions)
Definition: verifier.c:82
BOOL AVrfpInitialized
Definition: verifier.c:20
VOID NTAPI AVrfReadIFEO(HANDLE KeyHandle)
Definition: verifier.c:46
ULONG AVrfpDebug
Definition: verifier.c:19
NTSTATUS NTAPI AVrfInitializeVerifier(VOID)
Definition: verifier.c:612
struct _VERIFIER_PROVIDER * PVERIFIER_PROVIDER
RTL_CRITICAL_SECTION AVrfpVerifierLock
Definition: verifier.c:21
SIZE_T AVrfpCountThunks(PIMAGE_THUNK_DATA Thunk)
Definition: verifier.c:120
#define VERIFIER_DLL_FLAGS_RESOLVED
Definition: verifier.c:24
VOID NTAPI AVrfpResnapInitialModules(VOID)
Definition: verifier.c:374
struct _VERIFIER_PROVIDER VERIFIER_PROVIDER
PVOID NTAPI AvrfpFindDuplicateThunk(PLIST_ENTRY EndEntry, PWCHAR DllName, PCHAR ThunkName)
Definition: verifier.c:402
BOOLEAN AVrfpIsVerifierProviderDll(PVOID BaseAddress)
Definition: verifier.c:103
WCHAR AVrfpVerifierDllsString[256]
Definition: verifier.c:18
VOID NTAPI AVrfDllUnloadNotification(IN PLDR_DATA_TABLE_ENTRY LdrEntry)
Definition: verifier.c:328
NTSTATUS NTAPI AVrfpLoadAndInitializeProvider(PVERIFIER_PROVIDER Provider)
Definition: verifier.c:485
VOID NTAPI AVrfDllLoadNotification(IN PLDR_DATA_TABLE_ENTRY LdrEntry)
Definition: verifier.c:294
VOID NTAPI AVrfpChainDuplicateThunks(VOID)
Definition: verifier.c:448
VOID AVrfpSnapDllImports(IN PLDR_DATA_TABLE_ENTRY LdrEntry)
Definition: verifier.c:129
VOID NTAPI AVrfPageHeapDllNotification(IN PLDR_DATA_TABLE_ENTRY LdrEntry)
Definition: verifier.c:361
VOID AvrfpResolveThunks(IN PLDR_DATA_TABLE_ENTRY LdrEntry)
Definition: verifier.c:235
ULONG RtlpDphGlobalFlags
Definition: heappage.c:108
NTSTATUS NTAPI LdrpGetProcedureAddress(_In_ PVOID BaseAddress, _In_opt_ _When_(Ordinal==0, _Notnull_) PANSI_STRING Name, _In_opt_ _When_(Name==NULL, _In_range_(>, 0)) ULONG Ordinal, _Out_ PVOID *ProcedureAddress, _In_ BOOLEAN ExecuteInit)
Definition: ldrutils.c:2252
BOOLEAN NTAPI LdrpCallInitRoutine(IN PDLL_INIT_ROUTINE EntryPoint, IN PVOID BaseAddress, IN ULONG Reason, IN PVOID Context)
Definition: ldrutils.c:100
PVOID NTAPI LdrpFetchAddressOfEntryPoint(PVOID ImageBase)
BOOLEAN RtlpPageHeapEnabled
Definition: heappage.c:107
#define DPH_FLAG_DLL_NOTIFY
Definition: ntdllp.h:24
PIMAGE_THUNK_DATA32 PIMAGE_THUNK_DATA
Definition: ntimage.h:566
ULONG NtGlobalFlag
Definition: init.c:54
NTSTATUS NTAPI NtProtectVirtualMemory(IN HANDLE ProcessHandle, IN OUT PVOID *UnsafeBaseAddress, IN OUT SIZE_T *UnsafeNumberOfBytesToProtect, IN ULONG NewAccessProtection, OUT PULONG UnsafeOldAccessProtection)
Definition: virtual.c:3111
#define STATUS_INVALID_PARAMETER_4
Definition: ntstatus.h:478
#define STATUS_NO_MEMORY
Definition: ntstatus.h:260
#define STATUS_PROCEDURE_NOT_FOUND
Definition: ntstatus.h:358
#define STATUS_DLL_INIT_FAILED
Definition: ntstatus.h:558
#define L(x)
Definition: ntvdm.h:50
#define IMAGE_DIRECTORY_ENTRY_IMPORT
Definition: pedump.c:260
BYTE * PBYTE
Definition: pedump.c:66
#define IMAGE_FILE_DLL
Definition: pedump.c:169
#define _SEH2_GetExceptionCode()
Definition: pseh2_64.h:159
#define _SEH2_EXCEPT(...)
Definition: pseh2_64.h:34
#define REG_DWORD
Definition: sdbapi.c:596
_Check_return_ _CRTIMP int __cdecl _wcsicmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
#define SharedUserData
#define STATUS_SUCCESS
Definition: shellext.h:65
base of all file and directory entries
Definition: entries.h:83
HANDLE UniqueProcess
Definition: compat.h:825
IMAGE_FILE_HEADER FileHeader
Definition: ntddk_ex.h:183
union _IMAGE_THUNK_DATA32::@2134 u1
Definition: btrfs_drv.h:1876
PVOID DllBase
Definition: btrfs_drv.h:1880
UNICODE_STRING BaseDllName
Definition: ldrtypes.h:145
Definition: typedefs.h:120
struct _LIST_ENTRY * Flink
Definition: typedefs.h:121
ULONG NtGlobalFlag
Definition: ntddk_ex.h:270
PRTL_VERIFIER_THUNK_DESCRIPTOR DllThunks
Definition: verifier.h:20
UNICODE_STRING DllName
Definition: verifier.c:30
LIST_ENTRY ListEntry
Definition: verifier.c:29
RTL_VERIFIER_NTDLLHEAPFREE_CALLBACK ProviderNtdllHeapFreeCallback
Definition: verifier.c:38
PRTL_VERIFIER_DLL_DESCRIPTOR ProviderDlls
Definition: verifier.c:35
RTL_VERIFIER_DLL_LOAD_CALLBACK ProviderDllLoadCallback
Definition: verifier.c:36
RTL_VERIFIER_DLL_UNLOAD_CALLBACK ProviderDllUnloadCallback
Definition: verifier.c:37
#define NTAPI
Definition: typedefs.h:36
ULONG_PTR SIZE_T
Definition: typedefs.h:80
#define IN
Definition: typedefs.h:39
uint16_t * PWCHAR
Definition: typedefs.h:56
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260
uint32_t ULONG
Definition: typedefs.h:59
char * PCHAR
Definition: typedefs.h:51
VOID(NTAPI * RTL_VERIFIER_NTDLLHEAPFREE_CALLBACK)(PVOID AllocationBase, SIZE_T AllocationSize)
Definition: verifier.h:8
#define RTL_VRF_DBG_SHOWFOUNDEXPORTS
Definition: verifier.h:70
#define RTL_VRF_DBG_SHOWCHAINING
Definition: verifier.h:73
#define RTL_VRF_DBG_LISTPROVIDERS
Definition: verifier.h:72
#define RTL_VRF_FLG_HANDLE_CHECKS
Definition: verifier.h:47
#define RTL_VRF_DBG_SHOWSNAPS
Definition: verifier.h:69
#define DLL_PROCESS_VERIFIER
Definition: verifier.h:4
#define RTL_VRF_DBG_SHOWCHAINING_DEBUG
Definition: verifier.h:74
#define RTL_VRF_DBG_SHOWVERIFIEDEXPORTS
Definition: verifier.h:71
VOID(NTAPI * RTL_VERIFIER_DLL_UNLOAD_CALLBACK)(PWSTR DllName, PVOID DllBase, SIZE_T DllSize, PVOID Reserved)
Definition: verifier.h:7
#define RTL_VRF_FLG_LOCK_CHECKS
Definition: verifier.h:64
#define RTL_VRF_FLG_FAST_FILL_HEAP
Definition: verifier.h:60
VOID(NTAPI * RTL_VERIFIER_DLL_LOAD_CALLBACK)(PWSTR DllName, PVOID DllBase, SIZE_T DllSize, PVOID Reserved)
Definition: verifier.h:6
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
Definition: wdfdevice.h:4533
_Must_inspect_result_ _In_ WDFIORESLIST _In_ PIO_RESOURCE_DESCRIPTOR Descriptor
Definition: wdfresource.h:342
_Out_ PCLIENT_ID ClientId
Definition: kefuncs.h:1151
__wchar_t WCHAR
Definition: xmlstorage.h:180