Skip to content

Missing null terminator \0 for PWSTR.AsSpan() when trying to use CryptCATCDFEnumMembersByCDFTagEx #1294

Answered by AArnott
codgician asked this question in Q&A
Discussion options

You must be logged in to vote

I'm not familiar with this particular API, but here are a couple ideas:

It is possible that the "friendly overload" you're using may be inappropriate for this function. You can always fallback to the extern declaration of the method which avoids the extra code.

Since the friendly overload evidently knows enough to realize that as an input it must include a null terminator, perhaps the exit code should be smart enough to avoid trimming that null terminator.

Seeing Value is being an internal member of PWSTR, what is the recommended way of using the return value as pwszPrevCDFTag argument in this scenario?

Don't let internal stop you. All CsWin32-generated APIs are internal by default. But…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by codgician
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants