diff options
Diffstat (limited to 'c/common.cpp')
-rw-r--r-- | c/common.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/c/common.cpp b/c/common.cpp index 77d669c..7ce1372 100644 --- a/c/common.cpp +++ b/c/common.cpp @@ -55,6 +55,14 @@ wstring_owner WsoFromSz(const char* const sz, const int iCp) return wsz; } +wstring_owner WsoCopy(const wchar_t* const src) +{ + const int cb = wcslen(src)+1; + wchar_t* dst = new wchar_t[cb]; + memcpy(dst, src, cb*sizeof(wchar_t)); + return dst; +} + /* Win32Error: Exception for Windows API errors. */ Win32Error::Win32Error() : dwErr(GetLastError()) {} |