{
size_t rpos = 0, wpos = 0;
- if (LinkedList_Count(list) < 1)
+ if (*mszReaders == NULL || LinkedList_Count(list) < 1)
return cchReaders;
do
cchReaders = SCARD_AUTOALLOCATE;
status = ret.ReturnCode = SCardListReadersA(operation->hContext, (LPCSTR) call->mszGroups,
(LPSTR) &mszReaders, &cchReaders);
- cchReaders = filter_device_by_name_a(smartcard->names, &mszReaders, cchReaders);
- ret.msz = (BYTE*) mszReaders;
- ret.cBytes = cchReaders;
if (call->mszGroups)
{
return status;
}
+ cchReaders = filter_device_by_name_a(smartcard->names, &mszReaders, cchReaders);
+ ret.msz = (BYTE*) mszReaders;
+ ret.cBytes = cchReaders;
smartcard_trace_list_readers_return(smartcard, &ret, FALSE);
if ((status = smartcard_pack_list_readers_return(smartcard, irp->output, &ret)))
cchReaders = SCARD_AUTOALLOCATE;
status = ret.ReturnCode = SCardListReadersW(operation->hContext,
(LPCWSTR) call->mszGroups, (LPWSTR) &mszReaders, &cchReaders);
- cchReaders = filter_device_by_name_w(smartcard->names, &mszReaders, cchReaders);
- ret.msz = (BYTE*) mszReaders;
- ret.cBytes = cchReaders * 2;
if (call->mszGroups)
{
return status;
}
+ cchReaders = filter_device_by_name_w(smartcard->names, &mszReaders, cchReaders);
+ ret.msz = (BYTE*) mszReaders;
+ ret.cBytes = cchReaders * 2;
smartcard_trace_list_readers_return(smartcard, &ret, TRUE);
if ((status = smartcard_pack_list_readers_return(smartcard, irp->output, &ret)))