Fixed GetAttrib return length

This commit is contained in:
akallabeth 2021-02-07 18:13:18 +01:00 committed by akallabeth
parent b0c11ebd91
commit 14d5ad0d79
2 changed files with 3 additions and 5 deletions

View File

@ -383,14 +383,10 @@ static LONG smartcard_ListReaderGroupsA_Call(SMARTCARD_DEVICE* smartcard,
DWORD cchGroups = 0;
IRP* irp = operation->irp;
cchGroups = SCARD_AUTOALLOCATE;
status = ret.ReturnCode =
SCardListReaderGroupsA(operation->hContext, (LPSTR)&mszGroups, &cchGroups);
ret.ReturnCode = SCardListReaderGroupsA(operation->hContext, (LPSTR)&mszGroups, &cchGroups);
ret.msz = (BYTE*)mszGroups;
ret.cBytes = cchGroups;
if (status != SCARD_S_SUCCESS)
return status;
status = smartcard_pack_list_reader_groups_return(smartcard, irp->output, &ret, FALSE);
if (status != SCARD_S_SUCCESS)

View File

@ -2802,6 +2802,8 @@ LONG smartcard_pack_get_attrib_return(SMARTCARD_DEVICE* smartcard, wStream* s,
return SCARD_F_INTERNAL_ERROR;
cbAttrLen = ret->cbAttrLen;
if (ret->ReturnCode == SCARD_E_INSUFFICIENT_BUFFER)
cbAttrLen = 0;
if (cbAttrLen == SCARD_AUTOALLOCATE)
cbAttrLen = 0;
Stream_Write_UINT32(s, cbAttrLen); /* cbAttrLen (4 bytes) */