MCPcopy Create free account
hub / github.com/acl-dev/acl / Allocate

Method Allocate

lib_fiber/cpp/src/detours/image.cpp:689–713  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

687 }
688
689 LPCSTR Allocate(_In_ LPCSTR pszString, _Out_ DWORD *pnVirtAddr)
690 {
691 DWORD nLen = (DWORD)strlen(pszString) + 1;
692 nLen += (nLen & 1);
693
694 if (m_nChars + nLen > m_nCharsMax) {
695 *pnVirtAddr = 0;
696 return NULL;
697 }
698
699 *pnVirtAddr = m_nCharVirtAddr;
700 HRESULT hrRet = StringCchCopyA(m_pChars, m_nCharsMax, pszString);
701
702 if (FAILED(hrRet)) {
703 return NULL;
704 }
705
706 pszString = m_pChars;
707
708 m_pChars += nLen;
709 m_nChars += nLen;
710 m_nCharVirtAddr += nLen;
711
712 return pszString;
713 }
714
715 LPCSTR Allocate(_In_ LPCSTR pszString, _In_ DWORD nHint, _Out_ DWORD *pnVirtAddr)
716 {

Callers 1

WriteMethod · 0.45

Calls 1

StringCchCopyAFunction · 0.85

Tested by

no test coverage detected