Re: [go-nuts] Re: Mapping C pointer to BYTE to golang []byte

2017-12-15 Thread 'Bryan C. Mills' via golang-nuts
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 fami

Re: [go-nuts] Re: Mapping C pointer to BYTE to golang []byte

2017-12-15 Thread snmed
Sorry if I wasn't clear about that, I calling CertFindCertificateInStore which according to MSDN returns a pointer to a struct of type PCCERT_CONTEXT and must be freed with CertFreeCertificateContext

Re: [go-nuts] Re: Mapping C pointer to BYTE to golang []byte

2017-12-15 Thread 'Bryan C. Mills' via golang-nuts
You haven't actually said which system call you're invoking, but from the name CERT_CONTEXT and the layout of the struct I'm guessing it's probably CertCreateCertificateContext or CertEnumCertificatesInStore