Re: SCardTransmit Fails
From: Pieter Philippaerts (Pieter_at_nospam.mentalis.org)
Date: 03/25/04
- Next message: tlviewer: "Re: signing data with publc key that is not in the keystore"
- Previous message: Eugene Mayevski: "Re: signing data with publc key that is not in the keystore"
- In reply to: Barry Hostead: "Re: SCardTransmit Fails"
- Next in thread: Barry Hostead: "Re: SCardTransmit Fails"
- Reply: Barry Hostead: "Re: SCardTransmit Fails"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Date: Thu, 25 Mar 2004 20:38:30 +0100
"Barry Hostead" <b.hostead@ntlworld.com> wrote in message
> Public Declare Function SCardTransmit Lib "winscard.dll" _
> ( _
> ByVal hCard As Integer, _
> ByVal pioSendRequest As SCARD_IO_REQUEST, _
> ByRef SendBuff As Byte, _
> ByVal SendBuffLen As Integer, _
> ByVal pioRecvRequest As SCARD_IO_REQUEST, _
> ByRef RecvBuff As Byte, _
> ByRef RecvBuffLen As Integer _
> ) As Integer
This declaration is wrong; both pioSendRequest and pioRecvRequest should be
declared as references to SCARD_IO_REQUEST structures and you're passing
them by value.
I also prefer to declare pioRecvRequest as an IntPtr. You usually don't need
it, so I always pass IntPtr.Zero to it. But this is of course not an error
in the declaration.
So
Public Declare Function SCardTransmit Lib "winscard.dll" (ByVal hCard As
Integer, ByRef pioSendRequest As SCARD_IO_REQUEST, ByRef SendBuff As Byte,
ByVal SendBuffLen As Integer, ByRef pioRecvRequest As SCARD_IO_REQUEST,
ByRef RecvBuff As Byte, ByRef RecvBuffLen As Integer) As Integer
and
Public Declare Function SCardTransmit Lib "winscard.dll" (ByVal hCard As
Integer, ByRef pioSendRequest As SCARD_IO_REQUEST, ByRef SendBuff As Byte,
ByVal SendBuffLen As Integer, ByVal pioRecvRequest As IntPtr, ByRef RecvBuff
As Byte, ByRef RecvBuffLen As Integer) As Integer
should both work.
Regards,
Pieter Philippaerts
Managed SSL/TLS: http://mentalis.org/go.php?sl
- Next message: tlviewer: "Re: signing data with publc key that is not in the keystore"
- Previous message: Eugene Mayevski: "Re: signing data with publc key that is not in the keystore"
- In reply to: Barry Hostead: "Re: SCardTransmit Fails"
- Next in thread: Barry Hostead: "Re: SCardTransmit Fails"
- Reply: Barry Hostead: "Re: SCardTransmit Fails"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|