You can ignore the vet warning if you are certain that the uintptr values
you are converting to unsafe.Pointer are *valid pointers* (i.e., not
non-pointer sentinel values) that point *outside the Go heap*.

It sounds like that is probably the case, but you might want to check with
someone more familiar with Windows system calls to be sure.

On Fri, Dec 15, 2017 at 3:23 PM, snmed <sandro.p.da...@gmail.com> wrote:

> Sorry if I wasn't clear about that, I calling CertFindCertificateInStore
> <https://msdn.microsoft.com/en-us/library/windows/desktop/aa376064(v=vs.85).aspx>
>  which according to MSDN returns a pointer to a struct of
> type PCCERT_CONTEXT and must be freed with CertFreeCertificateContext
> <https://msdn.microsoft.com/en-us/library/windows/desktop/aa376075(v=vs.85).aspx>
> .
>
> The returned pointer is freed when passed as the *pPrevCertContext*
>> parameter on a subsequent call to the function. Otherwise, the pointer must
>> be explicitly freed by calling *CertFreeCertificateContext*
>> <https://msdn.microsoft.com/en-us/library/windows/desktop/aa376075(v=vs.85).aspx>.
>> A *pPrevCertContext* that is not *NULL* is always freed by
>> *CertFindCertificateInStore* using a call to *CertFreeCertificateContext*,
>> even if there is an error in the function.
>
>
> So yes it is allocated by the crypt API of Windows, but i'm still not sure
> if can ignore the vet warning or not. As far as I understand, go only
> manages the pointer to the struct but not the struct itself.
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "golang-nuts" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/
> topic/golang-nuts/0JYB0-ZcFpk/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> golang-nuts+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to