#include <win32k.h>
#include <debug.h>
Go to the source code of this file.
|
PVOID NTAPI | EngMapSectionView (_In_ HANDLE hSection, _In_ SIZE_T cjSize, _In_ ULONG cjOffset, _Out_ PHANDLE phSecure) |
|
VOID NTAPI | EngUnmapSectionView (_In_ PVOID pvBits, _In_ ULONG cjOffset, _In_ HANDLE hSecure) |
|
PVOID NTAPI | EngCreateSection (_In_ ULONG fl, _In_ SIZE_T cjSize, _In_ ULONG ulTag) |
|
PVOID NTAPI | EngCreateSectionHack (_In_ ULONG fl, _In_ SIZE_T cjSize, _In_ ULONG ulTag) |
|
| _Success_ (return!=FALSE) |
|
BOOL APIENTRY | EngFreeSectionMem (_In_opt_ PVOID pvSection, _In_opt_ PVOID pvMappedBase) |
|
_Check_return_ PFILEVIEW NTAPI | EngLoadModuleEx (_In_z_ LPWSTR pwsz, _In_ ULONG cjSizeOfModule, _In_ FLONG fl) |
|
HANDLE APIENTRY | EngLoadModule (_In_ LPWSTR pwsz) |
|
HANDLE APIENTRY | EngLoadModuleForWrite (_In_ LPWSTR pwsz, _In_ ULONG cjSizeOfModule) |
|
VOID APIENTRY | EngFreeModule (_In_ _Post_invalid_ HANDLE h) |
|
| _Success_ (return !=0) |
|
BOOL APIENTRY | EngUnmapFile (_In_ ULONG_PTR iFile) |
|
VOID APIENTRY | EngUnmapFontFileFD (_In_ ULONG_PTR iFile) |
|
| __drv_preferredFunction ("EngMapFontFileFD", "Obsolete") |
|
VOID APIENTRY | EngUnmapFontFile (_In_ ULONG_PTR iFile) |
|
◆ NDEBUG
◆ __drv_preferredFunction()
__drv_preferredFunction |
( |
"EngMapFontFileFD" |
, |
|
|
"Obsolete" |
|
|
) |
| |
Definition at line 571 of file mapping.c.
580{
581
583}
_Check_return_ _Outptr_result_bytebuffer_ pcjBuf PULONG * ppjBuf
_Check_return_ _Outptr_result_bytebuffer_ pcjBuf PULONG _Out_ ULONG * pcjBuf
◆ _Success_() [1/2]
Definition at line 503 of file mapping.c.
511{
514
515
518 {
521 }
522
523
525 if (!pvBase)
526 {
529 }
530
531
533 return pvBase;
534}
VOID APIENTRY EngFreeModule(_In_ _Post_invalid_ HANDLE h)
_Check_return_ PFILEVIEW NTAPI EngLoadModuleEx(_In_z_ LPWSTR pwsz, _In_ ULONG cjSizeOfModule, _In_ FLONG fl)
◆ _Success_() [2/2]
_Success_ |
( |
return! |
= FALSE | ) |
|
Definition at line 171 of file mapping.c.
179{
183
184
192 {
195 }
196
198 {
199
201
202
204 pepProcess,
206 0,
211 0,
214 {
216 }
217 }
218 else
219 {
220
222
223
226 {
228 }
229 else
230 {
231 DPRINT1(
"Failed to unmap a section @ %p Status=0x%x\n",
233 }
234 }
235
236
238
239
242}
NTSTATUS NTAPI MmUnmapViewOfSection(IN PEPROCESS Process, IN PVOID BaseAddress)
#define NT_SUCCESS(StatCode)
#define PROCESS_VM_OPERATION
_In_ BOOL _In_ HANDLE hProcess
NTSTATUS NTAPI ObReferenceObjectByHandle(IN HANDLE Handle, IN ACCESS_MASK DesiredAccess, IN POBJECT_TYPE ObjectType, IN KPROCESSOR_MODE AccessMode, OUT PVOID *Object, OUT POBJECT_HANDLE_INFORMATION HandleInformation OPTIONAL)
NTSTATUS NTAPI MmMapViewOfSection(IN PVOID SectionObject, IN PEPROCESS Process, IN OUT PVOID *BaseAddress, IN ULONG_PTR ZeroBits, IN SIZE_T CommitSize, IN OUT PLARGE_INTEGER SectionOffset OPTIONAL, IN OUT PSIZE_T ViewSize, IN SECTION_INHERIT InheritDisposition, IN ULONG AllocationType, IN ULONG Protect)
#define ObDereferenceObject
◆ EngCreateSection()
Definition at line 91 of file mapping.c.
95{
98 PVOID pvSectionObject;
100
101
103 if (!pSection)
return NULL;
104
109 &liSize,
115 {
119 }
120
121
126
127 return pSection;
128}
#define SECTION_ALL_ACCESS
void * EngAllocMem(int zero, unsigned long size, int tag=0)
NTSTATUS NTAPI MmCreateSection(OUT PVOID *Section, IN ACCESS_MASK DesiredAccess, IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL, IN PLARGE_INTEGER MaximumSize, IN ULONG SectionPageProtection, IN ULONG AllocationAttributes, IN HANDLE FileHandle OPTIONAL, IN PFILE_OBJECT FileObject OPTIONAL)
_In_ ULONG _In_ ULONG ulTag
◆ EngCreateSectionHack()
Definition at line 132 of file mapping.c.
136{
139 PVOID pvSectionObject;
141
142
144 if (!pSection)
return NULL;
145
150 &liSize,
156 {
160 }
161
162
167
168 return pSection;
169}
Referenced by _Success_().
◆ EngFreeModule()
Definition at line 482 of file mapping.c.
484{
487
488
491 {
492 DPRINT1(
"MmUnmapViewInSessionSpace failed: 0x%lx\n",
Status);
494 }
495
496
498
499
501}
NTSTATUS NTAPI MmUnmapViewInSystemSpace(IN PVOID MappedBase)
GLfloat GLfloat GLfloat GLfloat h
struct _FILEVIEW * PFILEVIEW
Referenced by _Success_(), and EngUnmapFile().
◆ EngFreeSectionMem()
Definition at line 246 of file mapping.c.
249{
253
254
255 if (pvMappedBase)
256 {
259 {
260 DPRINT1(
"MmUnmapViewInSessionSpace failed: 0x%lx\n",
Status);
262 }
263 }
264
265
266 if (pSection)
267 {
268
270
271
273 }
274
275 return bResult;
276}
NTSTATUS NTAPI MmUnmapViewInSessionSpace(IN PVOID MappedBase)
Referenced by _Success_(), SURFACE_AllocSurface(), and SURFACE_vCleanup().
◆ EngLoadModule()
◆ EngLoadModuleEx()
Definition at line 329 of file mapping.c.
333{
343
345 {
347 }
348 else
349 {
351 }
352
353
354 if (!pFileView)
return NULL;
355
356
358 {
360 }
361 else
362 {
364 }
365
366
369 &ustrFileName,
371 hRootDir,
373
374
381 0,
385 0);
387 {
391 }
392
399 {
401 }
402
403
408 &liSize,
413
414
416
418 {
422 }
423
424
428
429 return pFileView;
430}
#define FILE_NON_DIRECTORY_FILE
IN PUNICODE_STRING IN POBJECT_ATTRIBUTES ObjectAttributes
#define FILE_ATTRIBUTE_NORMAL
#define OBJ_KERNEL_HANDLE
#define OBJ_CASE_INSENSITIVE
static OUT PIO_STATUS_BLOCK IoStatusBlock
static OUT PIO_STATUS_BLOCK OUT PVOID FileInformation
#define InitializeObjectAttributes(p, n, a, r, s)
NTSYSAPI NTSTATUS NTAPI ZwClose(_In_ HANDLE Handle)
#define PAGE_EXECUTE_READ
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
#define PAGE_EXECUTE_READWRITE
LARGE_INTEGER LastWriteTime
HANDLE ghSystem32Directory
Referenced by _Success_(), EngLoadModule(), and EngLoadModuleForWrite().
◆ EngLoadModuleForWrite()
◆ EngMapSectionView()
Definition at line 19 of file mapping.c.
24{
28
29
31 {
34 }
35
36
39
40
43 &pvBaseAddress,
44 0,
46 &liSectionOffset,
49 0,
52 {
55 }
56
57
59 if (!*phSecure)
60 {
63 }
64
65
67}
#define MM_ALLOCATION_GRANULARITY
#define NtCurrentProcess()
ENGAPI HANDLE APIENTRY EngSecureMem(_In_reads_bytes_(cjLength) PVOID Address, _In_ ULONG cjLength)
_In_ const BITMAPINFO _In_ UINT _In_opt_ HANDLE hSection
◆ EngUnmapFile()
◆ EngUnmapFontFile()
Definition at line 587 of file mapping.c.
589{
590
592}
VOID APIENTRY EngUnmapFontFileFD(_In_ ULONG_PTR iFile)
◆ EngUnmapFontFileFD()
◆ EngUnmapSectionView()
Definition at line 71 of file mapping.c.
75{
77
78
80
81
83
84
87}
ENGAPI VOID APIENTRY EngUnsecureMem(_In_ HANDLE hSecure)
#define PsGetCurrentProcess
Referenced by SURFACE_vCleanup().
◆ ghRootDirectory
◆ ghSystem32Directory