the problem to get smart card reader name by winscard.dll

L

Levi Fan

hi everyone,

I want to get the all smart card reader in my pc by calling winscard.dll,
but the reader name was truncated. its length just has 20 char, but my
reader name is about 40 char when it is displayed in device manager.

who can help me to solve it? below is my source code:

[DllImport("WinScard.dll")]
public static extern uint SCardListReaders(int hContext, string
cGroups,
ref string cReaderLists, ref int nReaderCount);

public IEnumerable<string> ListReaders(string group)
{
int stringSize = -1;
string cReaders = "\0";
uint retVal = NativeMethods.SCardListReaders(nContext, group,
ref cReaders, ref stringSize);

CheckReturnValue(retVal);
if (cReaders == null)
cReaders = "";
return cReaders.Split('\0');
}

the reader is GemPC410, and it is a stardard PC/SC smartcard


thanks

Levi Fan
 
L

Levi Fan

I always update to all the last hotfixes. How can I do now?

Thanks

Levi

Andrew E. said:
Thier are 2 hotfixes for smart card.1 890837 and 2. 894069

Levi Fan said:
hi everyone,

I want to get the all smart card reader in my pc by calling winscard.dll,
but the reader name was truncated. its length just has 20 char, but my
reader name is about 40 char when it is displayed in device manager.

who can help me to solve it? below is my source code:

[DllImport("WinScard.dll")]
public static extern uint SCardListReaders(int hContext, string
cGroups,
ref string cReaderLists, ref int nReaderCount);

public IEnumerable<string> ListReaders(string group)
{
int stringSize = -1;
string cReaders = "\0";
uint retVal = NativeMethods.SCardListReaders(nContext, group,
ref cReaders, ref stringSize);

CheckReturnValue(retVal);
if (cReaders == null)
cReaders = "";
return cReaders.Split('\0');
}

the reader is GemPC410, and it is a stardard PC/SC smartcard


thanks

Levi Fan
 
Top