| 110 | |
| 111 | |
| 112 | bool 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 | |
| 141 | void DllInjectionPlugin::closeAllHandles() |
| 142 | { |