| 33 | |
| 34 | |
| 35 | bool CryptOpenFiles::OpenFile(LPCWSTR path, HANDLE h) |
| 36 | { |
| 37 | wstring ucpath; |
| 38 | |
| 39 | if (!touppercase(path, ucpath)) { |
| 40 | assert(false); |
| 41 | return false; |
| 42 | } |
| 43 | |
| 44 | lock_guard<mutex> lock(m_mutex); |
| 45 | |
| 46 | auto it = m_openfiles.find(ucpath); |
| 47 | |
| 48 | if (it != m_openfiles.end()) { |
| 49 | it->second->Open(h); |
| 50 | } else { |
| 51 | m_openfiles[ucpath] = make_shared<::CryptOpenFile>(h); |
| 52 | } |
| 53 | |
| 54 | return true; |
| 55 | } |
| 56 | |
| 57 | bool CryptOpenFiles::CloseFile(LPCWSTR path, HANDLE h) |
| 58 | { |
no test coverage detected