MCPcopy Create free account
hub / github.com/OpenNI/OpenNI / xnOSCloseSharedMemory

Function xnOSCloseSharedMemory

Source/OpenNI/Win32/Win32SharedMemory.cpp:210–227  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

208}
209
210XN_C_API XnStatus xnOSCloseSharedMemory(XN_SHARED_MEMORY_HANDLE hSharedMem)
211{
212 XN_VALIDATE_INPUT_PTR(hSharedMem);
213
214 if (!UnmapViewOfFile(hSharedMem->pAddress))
215 {
216 XN_LOG_ERROR_RETURN(XN_STATUS_OS_FAILED_TO_CLOSE_SHARED_MEMORY, XN_MASK_OS, "Could not unmap view of file (%d).", GetLastError());
217 }
218
219 if (!CloseHandle(hSharedMem->hMapFile))
220 {
221 XN_LOG_ERROR_RETURN(XN_STATUS_OS_FAILED_TO_CLOSE_SHARED_MEMORY, XN_MASK_OS, "Could not close shared memory handle (%d).", GetLastError());
222 }
223
224 xnOSFree(hSharedMem);
225
226 return (XN_STATUS_OK);
227}
228
229XN_C_API XnStatus xnOSSharedMemoryGetAddress(XN_SHARED_MEMORY_HANDLE hSharedMem, void** ppAddress)
230{

Callers

nothing calls this directly

Calls 1

xnOSFreeFunction · 0.70

Tested by

no test coverage detected