On 1/14/21 4:32 PM, Paul Procacci wrote:
https://docs.microsoft.com/en-us/windows/win32/api/tlhelp32/nf-tlhelp32-createtoolhelp32snapshot <https://docs.microsoft.com/en-us/windows/win32/api/tlhelp32/nf-tlhelp32-createtoolhelp32snapshot>

On Thu, Jan 14, 2021 at 7:30 PM ToddAndMargo via perl6-users <perl6-us...@perl.org <mailto:perl6-us...@perl.org>> wrote:

    On 1/14/21 3:42 PM, Paul Procacci wrote:
     > Let me preface this by saying if I were using a lower level language
     > (like C) I wouldn't have this problem; as I know how to shift and
    mask
     > accordingly.
     >
     > On raku however, how to do so *eloquantly* eludes me.
     >
     > I've defined a CStruct as follows:
     >
     > class test is repr('CStruct') {
     >
     >    has int64 $.a1;
     >
     >    has int64 $.a2;
     >
     >    ...
     >
     >    has int64 $.a65;
     >
     > }
     >
     > Under normal circumstances I would have defined the member as:
     > `HAS int16 @.a[260] is CArray` however that seems to be broken. See:
     >
     > https://github.com/rakudo/rakudo/issues/3633
    <https://github.com/rakudo/rakudo/issues/3633>
     > <https://github.com/rakudo/rakudo/issues/3633
    <https://github.com/rakudo/rakudo/issues/3633>>
     >
     > The function that gets called with these members $.a1 .. $.a65
    should
     > get filled with a wchar_t character array.
     >
     > Does raku employ a simple method of decoding the 4 wchar_t's that
    get
     > placed into a int64 structure?  The characters I'd like to
    extract are
     > at bit positions [15:0], [31.16], [47:32], [63:48]
     >
     > I'm imagining something along the lines of:
     >
     > buf16.new( $.a1, ... $.a64);
     >
     > ... but that doesn't quite work like I would expect.
     >
     > Thanks,
     > ~Paul

    Hi Paul,

    Would you post the system call you are trying to
    interface with?

    -T


Did you see?

https://docs.microsoft.com/en-us/windows/win32/toolhelp/taking-a-snapshot-and-viewing-processes

Reply via email to