MCPcopy Create free account
hub / github.com/bailey27/cppcryptfs / CloseFile

Method CloseFile

libcppcryptfs/file/openfiles.cpp:57–83  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

55}
56
57bool CryptOpenFiles::CloseFile(LPCWSTR path, HANDLE h)
58{
59 wstring ucpath;
60
61 if (!touppercase(path, ucpath)) {
62 assert(false);
63 return false;
64 }
65
66 lock_guard<mutex> lock(m_mutex);
67
68 auto it = m_openfiles.find(ucpath);
69
70 if (it == m_openfiles.end()) {
71 return true;
72 }
73
74 auto result = it->second->Close(h);
75 if (!result) {
76 DbgPrint(L"openfiles cannot close handle %llx\n", h);
77 }
78
79 if (it->second->Empty())
80 m_openfiles.erase(it);
81
82 return true;
83}
84
85shared_ptr<CryptOpenFile> CryptOpenFiles::GetOpenFile(LPCWSTR path)
86{

Calls 6

touppercaseFunction · 0.85
DbgPrintFunction · 0.85
findMethod · 0.80
CloseMethod · 0.80
EmptyMethod · 0.80
eraseMethod · 0.80

Tested by

no test coverage detected