sub Unpack { my $type = $_[0]; # ADDED if ($type eq "MYBUFFER*") { DEBUG "(PM)Type::Unpack: got packing 'c', is a pointer, unpacking 'Z*' '$_[1]'\n"; $_[1] = unpack("A*", $_[1]); DEBUG "(PM)Type::Unpack: returning '$_[1]'\n"; return $_[1]; } elsif(packing($type) eq 'c' and is_pointer($type)) { DEBUG "(PM)Type::Unpack: got packing 'c', is a pointer, unpacking 'Z*' '$_[1]'\n"; $_[1] = unpack("Z*", $_[1]); DEBUG "(PM)Type::Unpack: returning '$_[1]'\n"; return $_[1]; } DEBUG "(PM)Type::Unpack: unpacking '".packing($type)."' '$_[1]'\n"; $_[1] = unpack( packing($type), $_[1]); DEBUG "(PM)Type::Unpack: returning '$_[1]'\n"; return $_[1]; } #### $GetSharedMem = Win32::API->new('shmdll', 'int GetSharedMem(int shareIndex,MYBUFFER* lpszBuf, DWORD bufLength)');