in reply to [SOLVED] Dereferencing a pointer returned from Win32::API with unpack 'p'

You just need to pack an integer of the right size. Looks like 1) your build of Perl uses 8-byte pointers, 2) your system is little-endian, and 3) the pointer value that you are getting fits into a 4-byte integer. So you get success when you either pack an 8-byte integer or you pack a 4-byte (little-endian) integer followed by a 4-byte zero.

The only helpful thing I can think of is that you can determine how big of a pointer your Perl wants with something like length( pack "P", "q" ).

(Updated.)

- tye        

  • Comment on Re: Dereferencing a pointer returned from Win32::API with unpack 'p' (size)
  • Download Code