Re: trying to work with WinSCard
From: Dan Griffin (dangriff_at_online.microsoft.com)
Date: 10/23/03
- Next message: Drew Cooper [MSFT]: "Re: 'Perfect' Impersonation.."
- Previous message: Dan Griffin: "Re: Kerberos subauth filter causes netlogon to pend?"
- In reply to: Ray: "trying to work with WinSCard"
- Next in thread: Ray: "Re: trying to work with WinSCard"
- Reply: Ray: "Re: trying to work with WinSCard"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Date: Wed, 22 Oct 2003 17:14:24 -0700
Personally, I would first try to get the code working in C/C++, then move to
C#. Then, pick one of the simplest commands your card supports and try
sending that - i.e. a short command that only expects a status word in
response.
--
Dan Griffin [MS]
Please do not send email directly to this alias. This alias is for
newsgroup purposes only.
This posting is provided "AS IS" with no warranties, and confers no rights.
"Ray" <Ray@noSpamPlease.com> wrote in message
news:RGYkb.57778$th6.20097@twister.socal.rr.com...
> I am having a problem with issuing commands to my smartcard, I converted
the
> call to SCardTransmit as follows:
>
> [C#]
>
> [DllImport("WinSCard.dll", EntryPoint="SCardTransmit",
> CharSet=CharSet.Unicode, CallingConvention=CallingConvention.StdCall)]
> public static extern uint SCardTransmit(
> [In] uint hCard,
> [In] byte[] pioSendPci,
> [In] byte[] pbSendBuffer,
> [In] int cbSendLength,
> ref byte[] pioRecvPci,
> [Out] byte[] pbRecvBuffer,
> ref int pcbRecvLength);
>
> and created byte arrays of the lengths needed to mimic each of the structs
> that are supposed to be passed in/out, but when I call SCardTransmit, i
get
> an return value which means Invalid Parameter. I've tried several
different
> approaches, none of which worked any better. (first I actually had
structs
> created with all the layout sizes and offsets defined, but I decided to
just
> try this instead, but all give me the same response) If anyone has a clue
> to what I am doing incorrectly here, please lemme know.
>
> (BTW, I have called SCardEstablishContext, and SCardConnect before this
call
> successfully)
>
> Thanks.
>
> Ray
>
>
>
- Next message: Drew Cooper [MSFT]: "Re: 'Perfect' Impersonation.."
- Previous message: Dan Griffin: "Re: Kerberos subauth filter causes netlogon to pend?"
- In reply to: Ray: "trying to work with WinSCard"
- Next in thread: Ray: "Re: trying to work with WinSCard"
- Reply: Ray: "Re: trying to work with WinSCard"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|