Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- DWORD Encoder::Base64Encoding(CONST PBYTE pbBinary, DWORD cbBinary, PTSTR *pszOut) {
- DWORD dwStringLen = 0;
- if (CryptBinaryToString(pbBinary, cbBinary, CRYPT_STRING_BASE64, NULL, &dwStringLen)) {
- *pszOut = (PTSTR)CoTaskMemAlloc(sizeof(TCHAR) * dwStringLen);
- if (*pszOut) {
- if (!CryptBinaryToString(pbBinary, cbBinary, CRYPT_STRING_BASE64, *pszOut, &dwStringLen)) {
- CoTaskMemFree(*pszOut);
- }
- }
- }
- return dwStringLen;
- }
Advertisement
Add Comment
Please, Sign In to add comment