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

Function StringCchCopyA

lib_fiber/cpp/src/detours/image.cpp:64–92  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

62}
63
64_Must_inspect_result_
65static inline HRESULT StringCchCopyA(
66 _Out_writes_(cchDest) _Always_(_Post_z_) LPSTR pszDest,
67 _In_ size_t cchDest,
68 _In_ LPCSTR pszSrc)
69{
70 HRESULT hr = S_OK;
71
72 if (cchDest == 0) {
73 // can not null terminate a zero-byte dest buffer
74 hr = ERROR_INVALID_PARAMETER;
75 }
76 else {
77 while (cchDest && (*pszSrc != '\0')) {
78 *pszDest++ = *pszSrc++;
79 cchDest--;
80 }
81
82 if (cchDest == 0) {
83 // we are going to truncate pszDest
84 pszDest--;
85 hr = ERROR_INVALID_PARAMETER;
86 }
87
88 *pszDest= '\0';
89 }
90
91 return hr;
92}
93
94_Must_inspect_result_
95static inline HRESULT StringCchCatA(

Callers 7

DetourFindFunctionFunction · 0.85
StringCchCatAFunction · 0.85
DuplicateStringFunction · 0.85
AllocateMethod · 0.85
WriteMethod · 0.85
AllocExeHelperFunction · 0.85
UPDATE_IMPORTS_XXFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…