Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Win32::API to import function

by esskar (Deacon)
on Feb 28, 2005 at 20:38 UTC ( [id://435185]=note: print w/replies, xml ) Need Help??


in reply to Win32::API to import function

have you tried
my $sFuncRscIoCheck = new Win32::API('Rscw32', 'USHORT RscIoCheck(ULON +G ulConnectionHandle,ULONG ulSessionHandle,SHORT *pnIoHandle,VOID *pv +ReplyBuffer,USHORT *puReplySize)');
?

Replies are listed 'Best First'.
Re^2: Win32::API to import function
by Anonymous Monk on Mar 01, 2005 at 13:55 UTC
    If I use the following line to import the function:

    Win32::API->Import('Rscw32', 'USHORT RSCCHK(ULONG ulConnectionHandle,ULONG ulSessionHandle,SHORT *pnIoHandle,VOID *pvReplyBuffer,USHORT *puReplySize)');

    I have a crash at this line (i.e. as soon as I use it):

    $sReturn = RSCCHK($sConnectionHandle,
    $sSessionHandle,
    $sCheckAll,
    $sReplyBuffer,
    $sReplySize);

    Note: To import the "RscIoCheck" function, I need to use his API function name "RSCCHK".
      I have try the "Import" and the following:

      my $sFuncRscIoCheck = new Win32::API('Rscw32', 'USHORT RSCCHK(ULONG ul +ConnectionHandle,ULONG ulSessionHandle,SHORT *pnIoHandle,VOID *pvRepl +yBuffer,USHORT *puReplySize)'); $sReturn = $sFuncRscIoCheck->Call($sConnectionHandle, $sSessionHandle, $sCheckAll, $sReplyBuffer, $sReplySize);

      They crash the perl interpreter with the Win error message: "Perl Command Line Interpreter has encountered a problem and needs to close. We are sorry for the inconvenience.".

      Any other idea?
        To make it work, write:

        my $sReturn = $sFuncRscIoCheck->Call($sConnectionHandle, $sSessionHandle, $sCheckAll,<br> $sReplyBuffer, $sReplySize) & 0xFF; print "My Return is : $sReturn\n";

        The return value will be set to 17 as expected.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://435185]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (2)
As of 2024-04-20 05:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found