On 11/23/22 18:07, ToddAndMargo via perl6-users wrote:
removing my typos:


Hi All,

This is driving me nuts!

Native Call question. I have a Pointer ($ppSessionInf).

It points to a structure of $pCount bytes.

How do I load what $ppSessionInf points to into $Sessions

    # something gets assigned to it from an API call
    my Pointer $ppSessionInf = Pointer.new();

    # length of the data I want also from the API call
    my DWORD   $pCount;  # length of the data I want

    # Buffer I want the data pointer to by
    # $ppSessionInf loaded into
    my BYTES  $Sessions = CArray[BYTE].new( 0xFF xx $pCount );

    $Sessions = $ppSessionInf.deref;

Which obviously does not work:
      Internal error: unhandled target type

Many thanks,
-T



ppSessionInf = <NativeCall::Types::Pointer<5443017752000>>
pCount = <2>

--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Computers are like air conditioners.
They malfunction when you open windows
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Reply via email to