[smartcard] fix multi string conversion

This commit is contained in:
Armin Novak 2022-11-30 11:05:52 +01:00 committed by David Fort
parent a57c480b29
commit 58bc1ee4c9
3 changed files with 4 additions and 4 deletions

View File

@ -295,7 +295,7 @@ static DWORD filter_device_by_name_w(wLinkedList* list, LPWSTR* mszReaders, DWOR
if (LinkedList_Count(list) < 1)
return cchReaders;
readers = ConvertWCharNToUtf8Alloc(*mszReaders, cchReaders, NULL);
readers = ConvertMszWCharNToUtf8Alloc(*mszReaders, cchReaders, NULL);
if (!readers)
{

View File

@ -392,7 +392,7 @@ static char* smartcard_msz_dump_w(const WCHAR* msz, size_t len, char* buffer, si
size_t szlen = 0;
if (!msz)
return NULL;
char* sz = ConvertWCharNToUtf8Alloc(msz, len, &szlen);
char* sz = ConvertMszWCharNToUtf8Alloc(msz, len, &szlen);
if (!sz)
return NULL;

View File

@ -2006,7 +2006,7 @@ static LONG WINAPI PCSC_SCardStatus_Internal(SCARDHANDLE hCard, LPSTR mszReaderN
if (unicode)
{
size_t size = 0;
WCHAR* tmp = ConvertMszUtf8NToWCharAlloc(tReader, *pcchReaderLen, &size);
WCHAR* tmp = ConvertMszUtf8NToWCharAlloc(tReader, pcsc_cchReaderLen + 1, &size);
if (tmp == NULL)
{
@ -2418,7 +2418,7 @@ static LONG WINAPI PCSC_SCardGetAttrib_FriendlyName(SCARDHANDLE hCard, DWORD dwA
if (status != SCARD_S_SUCCESS)
return status;
namePCSC = ConvertWCharNToUtf8Alloc(pbAttrW, *pcbAttrLen, NULL);
namePCSC = ConvertMszWCharNToUtf8Alloc(pbAttrW, *pcbAttrLen, NULL);
PCSC_SCardFreeMemory_Internal(hContext, pbAttrW);
}
else