Try this allocation:
pcsKeyId = (WCHAR*)HeapAlloc(GetProcessHeap(), 0, sizeof(WCHAR) * count_reqd);
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
API NcryptCreatePersistedKey is not accepting a WCHAR* pointer for the parameter pszKeyName. It crashes . If I give a string literal like L"sample_key" then it works. Can someone pls suggest a workaround?
Try this allocation:
pcsKeyId = (WCHAR*)HeapAlloc(GetProcessHeap(), 0, sizeof(WCHAR) * count_reqd);