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

Method Register

libcppcryptfs/util/KeyCache.cpp:122–144  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

120}
121
122KeyCache::id_t KeyCache::Register(DWORD buf_size)
123{
124
125 lock_guard<mutex> lock(m_mutex);
126
127 if (!InitClearThread())
128 return 0;
129
130 KeyCacheEntry ent;
131
132 ent.pbuf = new LockZeroBuffer<BYTE>(buf_size, false);
133
134 if (!ent.pbuf->IsLocked()) {
135 return 0;
136 }
137
138 m_cur_id++;
139
140 m_entries[m_cur_id] = std::move(ent);
141
142 return m_cur_id;
143
144}
145
146bool KeyCache::Unregister(id_t id)
147{

Callers 1

FinalizeMethod · 0.80

Calls 1

IsLockedMethod · 0.80

Tested by

no test coverage detected