MCPcopy Create free account
hub / github.com/BeneficialCode/WinArk / Allocate

Method Allocate

KernelLibrary/kstring.h:194–205  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

192
193private:
194 wchar_t* Allocate(size_t chars, const wchar_t* src = nullptr) {
195 auto str = static_cast<wchar_t*>(ExAllocatePoolWithTag(PoolType,
196 sizeof(WCHAR) * (chars + 1), Tag));
197 if (!str) {
198 KdPrint(("Failed to allocate kstring of length %d chars\n", chars));
199 return nullptr;
200 }
201 if (src) {
202 wcscpy_s(str, chars + 1, src);
203 }
204 return str;
205 }
206private:
207 wchar_t* m_str;
208 size_t m_Len, m_Capacity;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected