MCPcopy Create free account
hub / github.com/NtQuery/Scylla / createFileMapping

Method createFileMapping

Scylla/DllInjectionPlugin.cpp:112–139  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

110
111
112bool DllInjectionPlugin::createFileMapping(DWORD mappingSize)
113{
114 hMapFile = CreateFileMapping(INVALID_HANDLE_VALUE, NULL, PAGE_READWRITE|SEC_COMMIT, 0, mappingSize, FILE_MAPPING_NAME);
115
116 if (hMapFile == NULL)
117 {
118#ifdef DEBUG_COMMENTS
119 Scylla::debugLog.log(L"createFileMapping :: CreateFileMapping failed 0x%X", GetLastError());
120#endif
121 return false;
122 }
123
124 lpViewOfFile = MapViewOfFile(hMapFile, FILE_MAP_ALL_ACCESS, 0, 0, 0);
125
126 if (lpViewOfFile == NULL)
127 {
128#ifdef DEBUG_COMMENTS
129 Scylla::debugLog.log(L"createFileMapping :: MapViewOfFile failed 0x%X", GetLastError());
130#endif
131 CloseHandle(hMapFile);
132 hMapFile = 0;
133 return false;
134 }
135 else
136 {
137 return true;
138 }
139}
140
141void DllInjectionPlugin::closeAllHandles()
142{

Callers

nothing calls this directly

Calls 1

logMethod · 0.80

Tested by

no test coverage detected