MCPcopy Create free account
hub / github.com/decaf-emu/decaf-emu / closeMemoryMappedFile

Function closeMemoryMappedFile

src/common/src/platform_win_memory.cpp:130–156  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

128
129
130bool
131closeMemoryMappedFile(MapFileHandle handle)
132{
133 auto windowsHandle = reinterpret_cast<WindowsMapFileHandle *>(handle);
134
135 if (windowsHandle->fileHandle) {
136 if (!CloseHandle(windowsHandle->fileHandle)) {
137 gLog->error("closeMemoryMappedFile({}) close file handle failed with error: {}",
138 handle, GetLastError());
139 }
140
141 windowsHandle->fileHandle = NULL;
142 }
143
144 if (windowsHandle->mappingHandle) {
145 if (!CloseHandle(windowsHandle->mappingHandle)) {
146 gLog->error("closeMemoryMappedFile({}) close map handle failed with error: {}",
147 handle, GetLastError());
148 return false;
149 }
150
151 windowsHandle->mappingHandle = NULL;
152 }
153
154 delete windowsHandle;
155 return true;
156}
157
158
159void *

Callers 3

~ReplayFileMethod · 0.50
openReplayFunction · 0.50
freeMethod · 0.50

Calls 1

errorMethod · 0.45

Tested by

no test coverage detected