Re: [go-nuts] How to access pointer to pointer in cgo

2017-07-05 Thread Manohar Reddy
okay the golang’s alternative for `optional->_32->Magic` is simply `optional._32.Magic.` So I’ve written my code regarding the about statement is given in https://play.golang.org/p/8sIAlxsmcj Thanks, solved. On Wednesday, July 5, 2017 at 7:02:10 PM UTC+5:30, Nathan Kerr wrote: > > Did

Re: [go-nuts] How to access pointer to pointer in cgo

2017-07-05 Thread Nathan Kerr
Did you assign something to the pointer? My guess is that you did not, because the code compiles and then fails at runtime telling the pointer is NULL. On Wednesday, July 5, 2017 at 1:19:47 PM UTC+2, Manohar Reddy wrote: > > > fmt.Println(optional._32.Magic) // did not work for me: HOW TO

Re: [go-nuts] How to access pointer to pointer in cgo

2017-07-05 Thread Manohar Reddy
> fmt.Println(optional._32.Magic) // did not work for me: HOW TO ACCESS MAGIC VARIABLE This line returns null pointer de-reference at run time. Can you please guide me on how what is the alternative for optional->_32-> Magic in Golang? Thanks On Wednesday, July 5, 2017 at 4:42:07 PM UTC+5:30,

Re: [go-nuts] How to access pointer to pointer in cgo

2017-07-05 Thread Jan Mercl
On Wed, Jul 5, 2017 at 1:04 PM Manohar Reddy wrote: > fmt.Println(optional._32.Magic) // did not work for me: HOW TO ACCESS MAGIC VARIABLE Who wants to guess what does "did not work for me" mean without having the source code and the compiler output to look at? Please post

[go-nuts] How to access pointer to pointer in cgo

2017-07-05 Thread Manohar Reddy
These are the things I have in C. IMAGE_OPTIONAL_HEADER *pe_optional(pe_ctx_t *ctx); typedef struct { uint16_t Magic; }IMAGE_OPTIONAL_HEADER_32; typedef struct { uint16_t type; IMAGE_OPTIONAL_HEADER_32 *_32; }IMAGE_OPTIONAL_HEADER; In c language to access Magic variable, I did