2014-05-26 23:57:37 +04:00
|
|
|
/**
|
|
|
|
* WinPR: Windows Portable Runtime
|
|
|
|
* Smart Card API
|
|
|
|
*
|
|
|
|
* Copyright 2014 Marc-Andre Moreau <marcandre.moreau@gmail.com>
|
2020-02-17 16:07:20 +03:00
|
|
|
* Copyright 2020 Armin Novak <armin.novak@thincast.com>
|
|
|
|
* Copyright 2020 Thincast Technologies GmbH
|
2014-05-26 23:57:37 +04:00
|
|
|
*
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
* You may obtain a copy of the License at
|
|
|
|
*
|
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
*
|
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
* See the License for the specific language governing permissions and
|
|
|
|
* limitations under the License.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
#include "config.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include <winpr/crt.h>
|
2014-05-27 01:54:39 +04:00
|
|
|
#include <winpr/wlog.h>
|
|
|
|
#include <winpr/file.h>
|
|
|
|
#include <winpr/path.h>
|
2014-05-26 23:57:37 +04:00
|
|
|
#include <winpr/library.h>
|
|
|
|
#include <winpr/smartcard.h>
|
|
|
|
|
|
|
|
#include "smartcard_inspect.h"
|
|
|
|
|
2021-11-05 15:09:42 +03:00
|
|
|
#include "../log.h"
|
|
|
|
#define TAG WINPR_TAG("smartcard.inspect")
|
|
|
|
|
|
|
|
#define xstr(s) str(s)
|
|
|
|
#define str(s) #s
|
|
|
|
|
|
|
|
#define SCARDAPI_STUB_CALL_LONG(status, _name, ...) \
|
|
|
|
if (!g_SCardApi || !g_SCardApi->pfn##_name) \
|
|
|
|
{ \
|
|
|
|
WLog_DBG(TAG, "Missing function pointer g_SCardApi=%p->" xstr(pfn##_name) "=%p", \
|
|
|
|
g_SCardApi, g_SCardApi ? g_SCardApi->pfn##_name : NULL); \
|
|
|
|
status = SCARD_E_NO_SERVICE; \
|
|
|
|
} \
|
|
|
|
else \
|
|
|
|
status = g_SCardApi->pfn##_name(__VA_ARGS__)
|
|
|
|
|
|
|
|
#define SCARDAPI_STUB_CALL_HANDLE(status, _name, ...) \
|
|
|
|
if (!g_SCardApi || !g_SCardApi->pfn##_name) \
|
|
|
|
{ \
|
|
|
|
WLog_DBG(TAG, "Missing function pointer g_SCardApi=%p->" xstr(pfn##_name) "=%p", \
|
|
|
|
g_SCardApi, g_SCardApi ? g_SCardApi->pfn##_name : NULL); \
|
|
|
|
status = NULL; \
|
|
|
|
} \
|
|
|
|
else \
|
|
|
|
status = g_SCardApi->pfn##_name(__VA_ARGS__)
|
|
|
|
|
|
|
|
#define SCARDAPI_STUB_CALL_VOID(_name, ...) \
|
|
|
|
if (!g_SCardApi || !g_SCardApi->pfn##_name) \
|
|
|
|
{ \
|
|
|
|
WLog_DBG(TAG, "Missing function pointer g_SCardApi=%p->" xstr(pfn##_name) "=%p", \
|
|
|
|
g_SCardApi, g_SCardApi ? g_SCardApi->pfn##_name : NULL); \
|
|
|
|
} \
|
|
|
|
else \
|
|
|
|
g_SCardApi->pfn##_name(__VA_ARGS__)
|
|
|
|
|
2020-02-17 12:52:31 +03:00
|
|
|
static const DWORD g_LogLevel = WLOG_DEBUG;
|
2014-05-27 01:54:39 +04:00
|
|
|
static wLog* g_Log = NULL;
|
|
|
|
|
2020-02-17 12:52:31 +03:00
|
|
|
static const SCardApiFunctionTable* g_SCardApi = NULL;
|
2014-05-26 23:57:37 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Standard Windows Smart Card API
|
|
|
|
*/
|
|
|
|
|
2019-11-20 13:07:42 +03:00
|
|
|
static LONG WINAPI Inspect_SCardEstablishContext(DWORD dwScope, LPCVOID pvReserved1,
|
|
|
|
LPCVOID pvReserved2, LPSCARDCONTEXT phContext)
|
2014-05-26 23:57:37 +04:00
|
|
|
{
|
|
|
|
LONG status;
|
|
|
|
|
2020-02-17 12:52:31 +03:00
|
|
|
WLog_Print(g_Log, g_LogLevel, "SCardEstablishContext { dwScope: %s (0x%08" PRIX32 ")",
|
2019-11-06 17:24:51 +03:00
|
|
|
SCardGetScopeString(dwScope), dwScope);
|
2014-05-27 01:54:39 +04:00
|
|
|
|
2021-11-05 15:09:42 +03:00
|
|
|
SCARDAPI_STUB_CALL_LONG(status, SCardEstablishContext, dwScope, pvReserved1, pvReserved2,
|
|
|
|
phContext);
|
2014-05-26 23:57:37 +04:00
|
|
|
|
2020-02-17 12:52:31 +03:00
|
|
|
WLog_Print(g_Log, g_LogLevel, "SCardEstablishContext } status: %s (0x%08" PRIX32 ")",
|
2019-11-06 17:24:51 +03:00
|
|
|
SCardGetErrorString(status), status);
|
2014-05-27 01:54:39 +04:00
|
|
|
|
2014-05-26 23:57:37 +04:00
|
|
|
return status;
|
|
|
|
}
|
|
|
|
|
2019-11-20 13:07:42 +03:00
|
|
|
static LONG WINAPI Inspect_SCardReleaseContext(SCARDCONTEXT hContext)
|
2014-05-26 23:57:37 +04:00
|
|
|
{
|
|
|
|
LONG status;
|
|
|
|
|
2020-02-17 12:52:31 +03:00
|
|
|
WLog_Print(g_Log, g_LogLevel, "SCardReleaseContext { hContext: %p", (void*)hContext);
|
2014-05-27 01:54:39 +04:00
|
|
|
|
2021-11-05 15:09:42 +03:00
|
|
|
SCARDAPI_STUB_CALL_LONG(status, SCardReleaseContext, hContext);
|
2014-05-26 23:57:37 +04:00
|
|
|
|
2020-02-17 12:52:31 +03:00
|
|
|
WLog_Print(g_Log, g_LogLevel, "SCardReleaseContext } status: %s (0x%08" PRIX32 ")",
|
2019-11-06 17:24:51 +03:00
|
|
|
SCardGetErrorString(status), status);
|
2014-05-27 01:54:39 +04:00
|
|
|
|
2014-05-26 23:57:37 +04:00
|
|
|
return status;
|
|
|
|
}
|
|
|
|
|
2019-11-20 13:07:42 +03:00
|
|
|
static LONG WINAPI Inspect_SCardIsValidContext(SCARDCONTEXT hContext)
|
2014-05-26 23:57:37 +04:00
|
|
|
{
|
|
|
|
LONG status;
|
|
|
|
|
2020-02-17 12:52:31 +03:00
|
|
|
WLog_Print(g_Log, g_LogLevel, "SCardIsValidContext { hContext: %p", (void*)hContext);
|
2014-05-27 01:54:39 +04:00
|
|
|
|
2021-11-05 15:09:42 +03:00
|
|
|
SCARDAPI_STUB_CALL_LONG(status, SCardIsValidContext, hContext);
|
2014-05-26 23:57:37 +04:00
|
|
|
|
2020-02-17 12:52:31 +03:00
|
|
|
WLog_Print(g_Log, g_LogLevel, "SCardIsValidContext } status: %s (0x%08" PRIX32 ")",
|
2019-11-06 17:24:51 +03:00
|
|
|
SCardGetErrorString(status), status);
|
2014-05-27 01:54:39 +04:00
|
|
|
|
2014-05-26 23:57:37 +04:00
|
|
|
return status;
|
|
|
|
}
|
|
|
|
|
2019-11-20 13:07:42 +03:00
|
|
|
static LONG WINAPI Inspect_SCardListReaderGroupsA(SCARDCONTEXT hContext, LPSTR mszGroups,
|
|
|
|
LPDWORD pcchGroups)
|
2014-05-26 23:57:37 +04:00
|
|
|
{
|
|
|
|
LONG status;
|
|
|
|
|
2020-02-17 12:52:31 +03:00
|
|
|
WLog_Print(g_Log, g_LogLevel, "SCardListReaderGroupsA { hContext: %p", (void*)hContext);
|
2014-05-27 01:54:39 +04:00
|
|
|
|
2021-11-05 15:09:42 +03:00
|
|
|
SCARDAPI_STUB_CALL_LONG(status, SCardListReaderGroupsA, hContext, mszGroups, pcchGroups);
|
2014-05-26 23:57:37 +04:00
|
|
|
|
2020-02-17 12:52:31 +03:00
|
|
|
WLog_Print(g_Log, g_LogLevel, "SCardListReaderGroupsA } status: %s (0x%08" PRIX32 ")",
|
2019-11-06 17:24:51 +03:00
|
|
|
SCardGetErrorString(status), status);
|
2014-05-27 01:54:39 +04:00
|
|
|
|
2014-05-26 23:57:37 +04:00
|
|
|
return status;
|
|
|
|
}
|
|
|
|
|
2019-11-20 13:07:42 +03:00
|
|
|
static LONG WINAPI Inspect_SCardListReaderGroupsW(SCARDCONTEXT hContext, LPWSTR mszGroups,
|
|
|
|
LPDWORD pcchGroups)
|
2014-05-26 23:57:37 +04:00
|
|
|
{
|
|
|
|
LONG status;
|
|
|
|
|
2020-02-17 12:52:31 +03:00
|
|
|
WLog_Print(g_Log, g_LogLevel, "SCardListReaderGroupsW { hContext: %p", (void*)hContext);
|
2014-05-27 01:54:39 +04:00
|
|
|
|
2021-11-05 15:09:42 +03:00
|
|
|
SCARDAPI_STUB_CALL_LONG(status, SCardListReaderGroupsW, hContext, mszGroups, pcchGroups);
|
2014-05-26 23:57:37 +04:00
|
|
|
|
2020-02-17 12:52:31 +03:00
|
|
|
WLog_Print(g_Log, g_LogLevel, "SCardListReaderGroupsW } status: %s (0x%08" PRIX32 ")",
|
2019-11-06 17:24:51 +03:00
|
|
|
SCardGetErrorString(status), status);
|
2014-05-27 01:54:39 +04:00
|
|
|
|
2014-05-26 23:57:37 +04:00
|
|
|
return status;
|
|
|
|
}
|
|
|
|
|
2019-11-20 13:07:42 +03:00
|
|
|
static LONG WINAPI Inspect_SCardListReadersA(SCARDCONTEXT hContext, LPCSTR mszGroups,
|
|
|
|
LPSTR mszReaders, LPDWORD pcchReaders)
|
2014-05-26 23:57:37 +04:00
|
|
|
{
|
|
|
|
LONG status;
|
|
|
|
|
2020-02-17 12:52:31 +03:00
|
|
|
WLog_Print(g_Log, g_LogLevel, "SCardListReadersA { hContext: %p", (void*)hContext);
|
2014-05-27 01:54:39 +04:00
|
|
|
|
2021-11-05 15:09:42 +03:00
|
|
|
SCARDAPI_STUB_CALL_LONG(status, SCardListReadersA, hContext, mszGroups, mszReaders,
|
|
|
|
pcchReaders);
|
2014-05-26 23:57:37 +04:00
|
|
|
|
2020-02-17 12:52:31 +03:00
|
|
|
WLog_Print(g_Log, g_LogLevel, "SCardListReadersA } status: %s (0x%08" PRIX32 ")",
|
2019-11-06 17:24:51 +03:00
|
|
|
SCardGetErrorString(status), status);
|
2014-05-27 01:54:39 +04:00
|
|
|
|
2014-05-26 23:57:37 +04:00
|
|
|
return status;
|
|
|
|
}
|
|
|
|
|
2019-11-20 13:07:42 +03:00
|
|
|
static LONG WINAPI Inspect_SCardListReadersW(SCARDCONTEXT hContext, LPCWSTR mszGroups,
|
|
|
|
LPWSTR mszReaders, LPDWORD pcchReaders)
|
2014-05-26 23:57:37 +04:00
|
|
|
{
|
|
|
|
LONG status;
|
2020-02-17 12:52:31 +03:00
|
|
|
WLog_Print(g_Log, g_LogLevel, "SCardListReadersW { hContext: %p", (void*)hContext);
|
2014-05-27 01:54:39 +04:00
|
|
|
|
2021-11-05 15:09:42 +03:00
|
|
|
SCARDAPI_STUB_CALL_LONG(status, SCardListReadersW, hContext, mszGroups, mszReaders,
|
|
|
|
pcchReaders);
|
2020-02-17 12:52:31 +03:00
|
|
|
WLog_Print(g_Log, g_LogLevel, "SCardListReadersW } status: %s (0x%08" PRIX32 ")",
|
2019-11-06 17:24:51 +03:00
|
|
|
SCardGetErrorString(status), status);
|
2014-05-27 01:54:39 +04:00
|
|
|
|
2014-05-26 23:57:37 +04:00
|
|
|
return status;
|
|
|
|
}
|
|
|
|
|
2019-11-20 13:07:42 +03:00
|
|
|
static LONG WINAPI Inspect_SCardListCardsA(SCARDCONTEXT hContext, LPCBYTE pbAtr,
|
|
|
|
LPCGUID rgquidInterfaces, DWORD cguidInterfaceCount,
|
|
|
|
CHAR* mszCards, LPDWORD pcchCards)
|
2014-05-26 23:57:37 +04:00
|
|
|
{
|
|
|
|
LONG status;
|
|
|
|
|
2020-02-17 12:52:31 +03:00
|
|
|
WLog_Print(g_Log, g_LogLevel, "SCardListCardsA { hContext: %p", (void*)hContext);
|
2014-05-27 01:54:39 +04:00
|
|
|
|
2021-11-05 15:09:42 +03:00
|
|
|
SCARDAPI_STUB_CALL_LONG(status, SCardListCardsA, hContext, pbAtr, rgquidInterfaces,
|
|
|
|
cguidInterfaceCount, mszCards, pcchCards);
|
2014-05-26 23:57:37 +04:00
|
|
|
|
2020-02-17 12:52:31 +03:00
|
|
|
WLog_Print(g_Log, g_LogLevel, "SCardListCardsA } status: %s (0x%08" PRIX32 ")",
|
2019-11-06 17:24:51 +03:00
|
|
|
SCardGetErrorString(status), status);
|
2014-05-27 01:54:39 +04:00
|
|
|
|
2014-05-26 23:57:37 +04:00
|
|
|
return status;
|
|
|
|
}
|
|
|
|
|
2019-11-20 13:07:42 +03:00
|
|
|
static LONG WINAPI Inspect_SCardListCardsW(SCARDCONTEXT hContext, LPCBYTE pbAtr,
|
|
|
|
LPCGUID rgquidInterfaces, DWORD cguidInterfaceCount,
|
|
|
|
WCHAR* mszCards, LPDWORD pcchCards)
|
2014-05-26 23:57:37 +04:00
|
|
|
{
|
|
|
|
LONG status;
|
|
|
|
|
2020-02-17 12:52:31 +03:00
|
|
|
WLog_Print(g_Log, g_LogLevel, "SCardListCardsW { hContext: %p", (void*)hContext);
|
2014-05-27 01:54:39 +04:00
|
|
|
|
2021-11-05 15:09:42 +03:00
|
|
|
SCARDAPI_STUB_CALL_LONG(status, SCardListCardsW, hContext, pbAtr, rgquidInterfaces,
|
|
|
|
cguidInterfaceCount, mszCards, pcchCards);
|
2014-05-26 23:57:37 +04:00
|
|
|
|
2020-02-17 12:52:31 +03:00
|
|
|
WLog_Print(g_Log, g_LogLevel, "SCardListCardsW } status: %s (0x%08" PRIX32 ")",
|
2019-11-06 17:24:51 +03:00
|
|
|
SCardGetErrorString(status), status);
|
2014-05-27 01:54:39 +04:00
|
|
|
|
2014-05-26 23:57:37 +04:00
|
|
|
return status;
|
|
|
|
}
|
|
|
|
|
2019-11-20 13:07:42 +03:00
|
|
|
static LONG WINAPI Inspect_SCardListInterfacesA(SCARDCONTEXT hContext, LPCSTR szCard,
|
|
|
|
LPGUID pguidInterfaces, LPDWORD pcguidInterfaces)
|
2014-05-26 23:57:37 +04:00
|
|
|
{
|
|
|
|
LONG status;
|
|
|
|
|
2020-02-17 12:52:31 +03:00
|
|
|
WLog_Print(g_Log, g_LogLevel, "SCardListInterfacesA { hContext: %p", (void*)hContext);
|
2014-05-27 01:54:39 +04:00
|
|
|
|
2021-11-05 15:09:42 +03:00
|
|
|
SCARDAPI_STUB_CALL_LONG(status, SCardListInterfacesA, hContext, szCard, pguidInterfaces,
|
|
|
|
pcguidInterfaces);
|
2014-05-26 23:57:37 +04:00
|
|
|
|
2020-02-17 12:52:31 +03:00
|
|
|
WLog_Print(g_Log, g_LogLevel, "SCardListInterfacesA } status: %s (0x%08" PRIX32 ")",
|
2019-11-06 17:24:51 +03:00
|
|
|
SCardGetErrorString(status), status);
|
2014-05-27 01:54:39 +04:00
|
|
|
|
2014-05-26 23:57:37 +04:00
|
|
|
return status;
|
|
|
|
}
|
|
|
|
|
2019-11-20 13:07:42 +03:00
|
|
|
static LONG WINAPI Inspect_SCardListInterfacesW(SCARDCONTEXT hContext, LPCWSTR szCard,
|
|
|
|
LPGUID pguidInterfaces, LPDWORD pcguidInterfaces)
|
2014-05-26 23:57:37 +04:00
|
|
|
{
|
|
|
|
LONG status;
|
|
|
|
|
2020-02-17 12:52:31 +03:00
|
|
|
WLog_Print(g_Log, g_LogLevel, "SCardListInterfacesW { hContext: %p", (void*)hContext);
|
2014-05-27 01:54:39 +04:00
|
|
|
|
2021-11-05 15:09:42 +03:00
|
|
|
SCARDAPI_STUB_CALL_LONG(status, SCardListInterfacesW, hContext, szCard, pguidInterfaces,
|
|
|
|
pcguidInterfaces);
|
2014-05-26 23:57:37 +04:00
|
|
|
|
2020-02-17 12:52:31 +03:00
|
|
|
WLog_Print(g_Log, g_LogLevel, "SCardListInterfacesW } status: %s (0x%08" PRIX32 ")",
|
2019-11-06 17:24:51 +03:00
|
|
|
SCardGetErrorString(status), status);
|
2014-05-27 01:54:39 +04:00
|
|
|
|
2014-05-26 23:57:37 +04:00
|
|
|
return status;
|
|
|
|
}
|
|
|
|
|
2019-11-20 13:07:42 +03:00
|
|
|
static LONG WINAPI Inspect_SCardGetProviderIdA(SCARDCONTEXT hContext, LPCSTR szCard,
|
|
|
|
LPGUID pguidProviderId)
|
2014-05-26 23:57:37 +04:00
|
|
|
{
|
|
|
|
LONG status;
|
|
|
|
|
2020-02-17 12:52:31 +03:00
|
|
|
WLog_Print(g_Log, g_LogLevel, "SCardGetProviderIdA { hContext: %p", (void*)hContext);
|
2014-05-27 01:54:39 +04:00
|
|
|
|
2021-11-05 15:09:42 +03:00
|
|
|
SCARDAPI_STUB_CALL_LONG(status, SCardGetProviderIdA, hContext, szCard, pguidProviderId);
|
2014-05-26 23:57:37 +04:00
|
|
|
|
2020-02-17 12:52:31 +03:00
|
|
|
WLog_Print(g_Log, g_LogLevel, "SCardGetProviderIdA } status: %s (0x%08" PRIX32 ")",
|
2019-11-06 17:24:51 +03:00
|
|
|
SCardGetErrorString(status), status);
|
2014-05-27 01:54:39 +04:00
|
|
|
|
2014-05-26 23:57:37 +04:00
|
|
|
return status;
|
|
|
|
}
|
|
|
|
|
2019-11-20 13:07:42 +03:00
|
|
|
static LONG WINAPI Inspect_SCardGetProviderIdW(SCARDCONTEXT hContext, LPCWSTR szCard,
|
|
|
|
LPGUID pguidProviderId)
|
2014-05-26 23:57:37 +04:00
|
|
|
{
|
|
|
|
LONG status;
|
|
|
|
|
2020-02-17 12:52:31 +03:00
|
|
|
WLog_Print(g_Log, g_LogLevel, "SCardGetProviderIdW { hContext: %p", (void*)hContext);
|
2014-05-27 01:54:39 +04:00
|
|
|
|
2021-11-05 15:09:42 +03:00
|
|
|
SCARDAPI_STUB_CALL_LONG(status, SCardGetProviderIdW, hContext, szCard, pguidProviderId);
|
2014-05-26 23:57:37 +04:00
|
|
|
|
2020-02-17 12:52:31 +03:00
|
|
|
WLog_Print(g_Log, g_LogLevel, "SCardGetProviderIdW } status: %s (0x%08" PRIX32 ")",
|
2019-11-06 17:24:51 +03:00
|
|
|
SCardGetErrorString(status), status);
|
2014-05-27 01:54:39 +04:00
|
|
|
|
2014-05-26 23:57:37 +04:00
|
|
|
return status;
|
|
|
|
}
|
|
|
|
|
2019-11-20 13:07:42 +03:00
|
|
|
static LONG WINAPI Inspect_SCardGetCardTypeProviderNameA(SCARDCONTEXT hContext, LPCSTR szCardName,
|
|
|
|
DWORD dwProviderId, CHAR* szProvider,
|
|
|
|
LPDWORD pcchProvider)
|
2014-05-26 23:57:37 +04:00
|
|
|
{
|
|
|
|
LONG status;
|
|
|
|
|
2020-02-17 12:52:31 +03:00
|
|
|
WLog_Print(g_Log, g_LogLevel, "SCardGetCardTypeProviderNameA { hContext: %p", (void*)hContext);
|
2014-05-27 01:54:39 +04:00
|
|
|
|
2021-11-05 15:09:42 +03:00
|
|
|
SCARDAPI_STUB_CALL_LONG(status, SCardGetCardTypeProviderNameA, hContext, szCardName,
|
|
|
|
dwProviderId, szProvider, pcchProvider);
|
2014-05-26 23:57:37 +04:00
|
|
|
|
2020-02-17 12:52:31 +03:00
|
|
|
WLog_Print(g_Log, g_LogLevel, "SCardGetCardTypeProviderNameA } status: %s (0x%08" PRIX32 ")",
|
2019-11-06 17:24:51 +03:00
|
|
|
SCardGetErrorString(status), status);
|
2014-05-27 01:54:39 +04:00
|
|
|
|
2014-05-26 23:57:37 +04:00
|
|
|
return status;
|
|
|
|
}
|
|
|
|
|
2019-11-20 13:07:42 +03:00
|
|
|
static LONG WINAPI Inspect_SCardGetCardTypeProviderNameW(SCARDCONTEXT hContext, LPCWSTR szCardName,
|
|
|
|
DWORD dwProviderId, WCHAR* szProvider,
|
|
|
|
LPDWORD pcchProvider)
|
2014-05-26 23:57:37 +04:00
|
|
|
{
|
|
|
|
LONG status;
|
|
|
|
|
2020-02-17 12:52:31 +03:00
|
|
|
WLog_Print(g_Log, g_LogLevel, "SCardGetCardTypeProviderNameW { hContext: %p", (void*)hContext);
|
2014-05-27 01:54:39 +04:00
|
|
|
|
2021-11-05 15:09:42 +03:00
|
|
|
SCARDAPI_STUB_CALL_LONG(status, SCardGetCardTypeProviderNameW, hContext, szCardName,
|
|
|
|
dwProviderId, szProvider, pcchProvider);
|
2014-05-26 23:57:37 +04:00
|
|
|
|
2020-02-17 12:52:31 +03:00
|
|
|
WLog_Print(g_Log, g_LogLevel, "SCardGetCardTypeProviderNameW } status: %s (0x%08" PRIX32 ")",
|
2019-11-06 17:24:51 +03:00
|
|
|
SCardGetErrorString(status), status);
|
2014-05-27 01:54:39 +04:00
|
|
|
|
2014-05-26 23:57:37 +04:00
|
|
|
return status;
|
|
|
|
}
|
|
|
|
|
2019-11-20 13:07:42 +03:00
|
|
|
static LONG WINAPI Inspect_SCardIntroduceReaderGroupA(SCARDCONTEXT hContext, LPCSTR szGroupName)
|
2014-05-26 23:57:37 +04:00
|
|
|
{
|
|
|
|
LONG status;
|
|
|
|
|
2020-02-17 12:52:31 +03:00
|
|
|
WLog_Print(g_Log, g_LogLevel, "SCardIntroduceReaderGroupA { hContext: %p", (void*)hContext);
|
2014-05-27 01:54:39 +04:00
|
|
|
|
2021-11-05 15:09:42 +03:00
|
|
|
SCARDAPI_STUB_CALL_LONG(status, SCardIntroduceReaderGroupA, hContext, szGroupName);
|
2014-05-26 23:57:37 +04:00
|
|
|
|
2020-02-17 12:52:31 +03:00
|
|
|
WLog_Print(g_Log, g_LogLevel, "SCardIntroduceReaderGroupA } status: %s (0x%08" PRIX32 ")",
|
2019-11-06 17:24:51 +03:00
|
|
|
SCardGetErrorString(status), status);
|
2014-05-27 01:54:39 +04:00
|
|
|
|
2014-05-26 23:57:37 +04:00
|
|
|
return status;
|
|
|
|
}
|
|
|
|
|
2019-11-20 13:07:42 +03:00
|
|
|
static LONG WINAPI Inspect_SCardIntroduceReaderGroupW(SCARDCONTEXT hContext, LPCWSTR szGroupName)
|
2014-05-26 23:57:37 +04:00
|
|
|
{
|
|
|
|
LONG status;
|
|
|
|
|
2020-02-17 12:52:31 +03:00
|
|
|
WLog_Print(g_Log, g_LogLevel, "SCardIntroduceReaderGroupW { hContext: %p", (void*)hContext);
|
2014-05-27 01:54:39 +04:00
|
|
|
|
2021-11-05 15:09:42 +03:00
|
|
|
SCARDAPI_STUB_CALL_LONG(status, SCardIntroduceReaderGroupW, hContext, szGroupName);
|
2014-05-26 23:57:37 +04:00
|
|
|
|
2020-02-17 12:52:31 +03:00
|
|
|
WLog_Print(g_Log, g_LogLevel, "SCardIntroduceReaderGroupW } status: %s (0x%08" PRIX32 ")",
|
2019-11-06 17:24:51 +03:00
|
|
|
SCardGetErrorString(status), status);
|
2014-05-27 01:54:39 +04:00
|
|
|
|
2014-05-26 23:57:37 +04:00
|
|
|
return status;
|
|
|
|
}
|
|
|
|
|
2019-11-20 13:07:42 +03:00
|
|
|
static LONG WINAPI Inspect_SCardForgetReaderGroupA(SCARDCONTEXT hContext, LPCSTR szGroupName)
|
2014-05-26 23:57:37 +04:00
|
|
|
{
|
|
|
|
LONG status;
|
|
|
|
|
2020-02-17 12:52:31 +03:00
|
|
|
WLog_Print(g_Log, g_LogLevel, "SCardForgetReaderGroupA { hContext: %p", (void*)hContext);
|
2014-05-27 01:54:39 +04:00
|
|
|
|
2021-11-05 15:09:42 +03:00
|
|
|
SCARDAPI_STUB_CALL_LONG(status, SCardForgetReaderGroupA, hContext, szGroupName);
|
2014-05-26 23:57:37 +04:00
|
|
|
|
2020-02-17 12:52:31 +03:00
|
|
|
WLog_Print(g_Log, g_LogLevel, "SCardForgetReaderGroupA } status: %s (0x%08" PRIX32 ")",
|
2019-11-06 17:24:51 +03:00
|
|
|
SCardGetErrorString(status), status);
|
2014-05-27 01:54:39 +04:00
|
|
|
|
2014-05-26 23:57:37 +04:00
|
|
|
return status;
|
|
|
|
}
|
|
|
|
|
2019-11-20 13:07:42 +03:00
|
|
|
static LONG WINAPI Inspect_SCardForgetReaderGroupW(SCARDCONTEXT hContext, LPCWSTR szGroupName)
|
2014-05-26 23:57:37 +04:00
|
|
|
{
|
|
|
|
LONG status;
|
|
|
|
|
2020-02-17 12:52:31 +03:00
|
|
|
WLog_Print(g_Log, g_LogLevel, "SCardForgetReaderGroupW { hContext: %p", (void*)hContext);
|
2014-05-27 01:54:39 +04:00
|
|
|
|
2021-11-05 15:09:42 +03:00
|
|
|
SCARDAPI_STUB_CALL_LONG(status, SCardForgetReaderGroupW, hContext, szGroupName);
|
2014-05-26 23:57:37 +04:00
|
|
|
|
2020-02-17 12:52:31 +03:00
|
|
|
WLog_Print(g_Log, g_LogLevel, "SCardForgetReaderGroupW } status: %s (0x%08" PRIX32 ")",
|
2019-11-06 17:24:51 +03:00
|
|
|
SCardGetErrorString(status), status);
|
2014-05-27 01:54:39 +04:00
|
|
|
|
2014-05-26 23:57:37 +04:00
|
|
|
return status;
|
|
|
|
}
|
|
|
|
|
2019-11-20 13:07:42 +03:00
|
|
|
static LONG WINAPI Inspect_SCardIntroduceReaderA(SCARDCONTEXT hContext, LPCSTR szReaderName,
|
|
|
|
LPCSTR szDeviceName)
|
2014-05-26 23:57:37 +04:00
|
|
|
{
|
|
|
|
LONG status;
|
|
|
|
|
2020-02-17 12:52:31 +03:00
|
|
|
WLog_Print(g_Log, g_LogLevel, "SCardIntroduceReaderA { hContext: %p", (void*)hContext);
|
2014-05-27 01:54:39 +04:00
|
|
|
|
2021-11-05 15:09:42 +03:00
|
|
|
SCARDAPI_STUB_CALL_LONG(status, SCardIntroduceReaderA, hContext, szReaderName, szDeviceName);
|
2014-05-26 23:57:37 +04:00
|
|
|
|
2020-02-17 12:52:31 +03:00
|
|
|
WLog_Print(g_Log, g_LogLevel, "SCardIntroduceReaderA } status: %s (0x%08" PRIX32 ")",
|
2019-11-06 17:24:51 +03:00
|
|
|
SCardGetErrorString(status), status);
|
2014-05-27 01:54:39 +04:00
|
|
|
|
2014-05-26 23:57:37 +04:00
|
|
|
return status;
|
|
|
|
}
|
|
|
|
|
2019-11-20 13:07:42 +03:00
|
|
|
static LONG WINAPI Inspect_SCardIntroduceReaderW(SCARDCONTEXT hContext, LPCWSTR szReaderName,
|
|
|
|
LPCWSTR szDeviceName)
|
2014-05-26 23:57:37 +04:00
|
|
|
{
|
|
|
|
LONG status;
|
|
|
|
|
2020-02-17 12:52:31 +03:00
|
|
|
WLog_Print(g_Log, g_LogLevel, "SCardIntroduceReaderW { hContext: %p", (void*)hContext);
|
2014-05-27 01:54:39 +04:00
|
|
|
|
2021-11-05 15:09:42 +03:00
|
|
|
SCARDAPI_STUB_CALL_LONG(status, SCardIntroduceReaderW, hContext, szReaderName, szDeviceName);
|
2014-05-26 23:57:37 +04:00
|
|
|
|
2020-02-17 12:52:31 +03:00
|
|
|
WLog_Print(g_Log, g_LogLevel, "SCardIntroduceReaderW } status: %s (0x%08" PRIX32 ")",
|
2019-11-06 17:24:51 +03:00
|
|
|
SCardGetErrorString(status), status);
|
2014-05-27 01:54:39 +04:00
|
|
|
|
2014-05-26 23:57:37 +04:00
|
|
|
return status;
|
|
|
|
}
|
|
|
|
|
2019-11-20 13:07:42 +03:00
|
|
|
static LONG WINAPI Inspect_SCardForgetReaderA(SCARDCONTEXT hContext, LPCSTR szReaderName)
|
2014-05-26 23:57:37 +04:00
|
|
|
{
|
|
|
|
LONG status;
|
|
|
|
|
2020-02-17 12:52:31 +03:00
|
|
|
WLog_Print(g_Log, g_LogLevel, "SCardForgetReaderA { hContext: %p", (void*)hContext);
|
2014-05-27 01:54:39 +04:00
|
|
|
|
2021-11-05 15:09:42 +03:00
|
|
|
SCARDAPI_STUB_CALL_LONG(status, SCardForgetReaderA, hContext, szReaderName);
|
2014-05-26 23:57:37 +04:00
|
|
|
|
2020-02-17 12:52:31 +03:00
|
|
|
WLog_Print(g_Log, g_LogLevel, "SCardForgetReaderA } status: %s (0x%08" PRIX32 ")",
|
2019-11-06 17:24:51 +03:00
|
|
|
SCardGetErrorString(status), status);
|
2014-05-27 01:54:39 +04:00
|
|
|
|
2014-05-26 23:57:37 +04:00
|
|
|
return status;
|
|
|
|
}
|
|
|
|
|
2019-11-20 13:07:42 +03:00
|
|
|
static LONG WINAPI Inspect_SCardForgetReaderW(SCARDCONTEXT hContext, LPCWSTR szReaderName)
|
2014-05-26 23:57:37 +04:00
|
|
|
{
|
|
|
|
LONG status;
|
|
|
|
|
2020-02-17 12:52:31 +03:00
|
|
|
WLog_Print(g_Log, g_LogLevel, "SCardForgetReaderW { hContext: %p", (void*)hContext);
|
2014-05-27 01:54:39 +04:00
|
|
|
|
2021-11-05 15:09:42 +03:00
|
|
|
SCARDAPI_STUB_CALL_LONG(status, SCardForgetReaderW, hContext, szReaderName);
|
2014-05-26 23:57:37 +04:00
|
|
|
|
2020-02-17 12:52:31 +03:00
|
|
|
WLog_Print(g_Log, g_LogLevel, "SCardForgetReaderW } status: %s (0x%08" PRIX32 ")",
|
2019-11-06 17:24:51 +03:00
|
|
|
SCardGetErrorString(status), status);
|
2014-05-27 01:54:39 +04:00
|
|
|
|
2014-05-26 23:57:37 +04:00
|
|
|
return status;
|
|
|
|
}
|
|
|
|
|
2019-11-20 13:07:42 +03:00
|
|
|
static LONG WINAPI Inspect_SCardAddReaderToGroupA(SCARDCONTEXT hContext, LPCSTR szReaderName,
|
|
|
|
LPCSTR szGroupName)
|
2014-05-26 23:57:37 +04:00
|
|
|
{
|
|
|
|
LONG status;
|
|
|
|
|
2020-02-17 12:52:31 +03:00
|
|
|
WLog_Print(g_Log, g_LogLevel, "SCardAddReaderToGroupA { hContext: %p", (void*)hContext);
|
2014-05-27 01:54:39 +04:00
|
|
|
|
2021-11-05 15:09:42 +03:00
|
|
|
SCARDAPI_STUB_CALL_LONG(status, SCardAddReaderToGroupA, hContext, szReaderName, szGroupName);
|
2014-05-26 23:57:37 +04:00
|
|
|
|
2020-02-17 12:52:31 +03:00
|
|
|
WLog_Print(g_Log, g_LogLevel, "SCardAddReaderToGroupA } status: %s (0x%08" PRIX32 ")",
|
2019-11-06 17:24:51 +03:00
|
|
|
SCardGetErrorString(status), status);
|
2014-05-27 01:54:39 +04:00
|
|
|
|
2014-05-26 23:57:37 +04:00
|
|
|
return status;
|
|
|
|
}
|
|
|
|
|
2019-11-20 13:07:42 +03:00
|
|
|
static LONG WINAPI Inspect_SCardAddReaderToGroupW(SCARDCONTEXT hContext, LPCWSTR szReaderName,
|
|
|
|
LPCWSTR szGroupName)
|
2014-05-26 23:57:37 +04:00
|
|
|
{
|
|
|
|
LONG status;
|
|
|
|
|
2020-02-17 12:52:31 +03:00
|
|
|
WLog_Print(g_Log, g_LogLevel, "SCardAddReaderToGroupW { hContext: %p", (void*)hContext);
|
2014-05-27 01:54:39 +04:00
|
|
|
|
2021-11-05 15:09:42 +03:00
|
|
|
SCARDAPI_STUB_CALL_LONG(status, SCardAddReaderToGroupW, hContext, szReaderName, szGroupName);
|
2014-05-26 23:57:37 +04:00
|
|
|
|
2020-02-17 12:52:31 +03:00
|
|
|
WLog_Print(g_Log, g_LogLevel, "SCardAddReaderToGroupW } status: %s (0x%08" PRIX32 ")",
|
2019-11-06 17:24:51 +03:00
|
|
|
SCardGetErrorString(status), status);
|
2014-05-27 01:54:39 +04:00
|
|
|
|
2014-05-26 23:57:37 +04:00
|
|
|
return status;
|
|
|
|
}
|
|
|
|
|
2019-11-20 13:07:42 +03:00
|
|
|
static LONG WINAPI Inspect_SCardRemoveReaderFromGroupA(SCARDCONTEXT hContext, LPCSTR szReaderName,
|
|
|
|
LPCSTR szGroupName)
|
2014-05-26 23:57:37 +04:00
|
|
|
{
|
|
|
|
LONG status;
|
|
|
|
|
2020-02-17 12:52:31 +03:00
|
|
|
WLog_Print(g_Log, g_LogLevel, "SCardRemoveReaderFromGroupA { hContext: %p", (void*)hContext);
|
2014-05-27 01:54:39 +04:00
|
|
|
|
2021-11-05 15:09:42 +03:00
|
|
|
SCARDAPI_STUB_CALL_LONG(status, SCardRemoveReaderFromGroupA, hContext, szReaderName,
|
|
|
|
szGroupName);
|
2014-05-26 23:57:37 +04:00
|
|
|
|
2020-02-17 12:52:31 +03:00
|
|
|
WLog_Print(g_Log, g_LogLevel, "SCardRemoveReaderFromGroupA } status: %s (0x%08" PRIX32 ")",
|
2019-11-06 17:24:51 +03:00
|
|
|
SCardGetErrorString(status), status);
|
2014-05-27 01:54:39 +04:00
|
|
|
|
2014-05-26 23:57:37 +04:00
|
|
|
return status;
|
|
|
|
}
|
|
|
|
|
2019-11-20 13:07:42 +03:00
|
|
|
static LONG WINAPI Inspect_SCardRemoveReaderFromGroupW(SCARDCONTEXT hContext, LPCWSTR szReaderName,
|
|
|
|
LPCWSTR szGroupName)
|
2014-05-26 23:57:37 +04:00
|
|
|
{
|
|
|
|
LONG status;
|
|
|
|
|
2020-02-17 12:52:31 +03:00
|
|
|
WLog_Print(g_Log, g_LogLevel, "SCardRemoveReaderFromGroupW { hContext: %p", (void*)hContext);
|
2014-05-27 01:54:39 +04:00
|
|
|
|
2021-11-05 15:09:42 +03:00
|
|
|
SCARDAPI_STUB_CALL_LONG(status, SCardRemoveReaderFromGroupW, hContext, szReaderName,
|
|
|
|
szGroupName);
|
2014-05-26 23:57:37 +04:00
|
|
|
|
2020-02-17 12:52:31 +03:00
|
|
|
WLog_Print(g_Log, g_LogLevel, "SCardRemoveReaderFromGroupW } status: %s (0x%08" PRIX32 ")",
|
2019-11-06 17:24:51 +03:00
|
|
|
SCardGetErrorString(status), status);
|
2014-05-27 01:54:39 +04:00
|
|
|
|
2014-05-26 23:57:37 +04:00
|
|
|
return status;
|
|
|
|
}
|
|
|
|
|
2019-11-20 13:07:42 +03:00
|
|
|
static LONG WINAPI Inspect_SCardIntroduceCardTypeA(SCARDCONTEXT hContext, LPCSTR szCardName,
|
|
|
|
LPCGUID pguidPrimaryProvider,
|
|
|
|
LPCGUID rgguidInterfaces, DWORD dwInterfaceCount,
|
|
|
|
LPCBYTE pbAtr, LPCBYTE pbAtrMask, DWORD cbAtrLen)
|
2014-05-26 23:57:37 +04:00
|
|
|
{
|
|
|
|
LONG status;
|
|
|
|
|
2020-02-17 12:52:31 +03:00
|
|
|
WLog_Print(g_Log, g_LogLevel, "SCardIntroduceCardTypeA { hContext: %p", (void*)hContext);
|
2014-05-27 01:54:39 +04:00
|
|
|
|
2021-11-05 15:09:42 +03:00
|
|
|
SCARDAPI_STUB_CALL_LONG(status, SCardIntroduceCardTypeA, hContext, szCardName,
|
|
|
|
pguidPrimaryProvider, rgguidInterfaces, dwInterfaceCount, pbAtr,
|
|
|
|
pbAtrMask, cbAtrLen);
|
2014-05-26 23:57:37 +04:00
|
|
|
|
2020-02-17 12:52:31 +03:00
|
|
|
WLog_Print(g_Log, g_LogLevel, "SCardIntroduceCardTypeA } status: %s (0x%08" PRIX32 ")",
|
2019-11-06 17:24:51 +03:00
|
|
|
SCardGetErrorString(status), status);
|
2014-05-27 01:54:39 +04:00
|
|
|
|
2014-05-26 23:57:37 +04:00
|
|
|
return status;
|
|
|
|
}
|
|
|
|
|
2019-11-20 13:07:42 +03:00
|
|
|
static LONG WINAPI Inspect_SCardIntroduceCardTypeW(SCARDCONTEXT hContext, LPCWSTR szCardName,
|
|
|
|
LPCGUID pguidPrimaryProvider,
|
|
|
|
LPCGUID rgguidInterfaces, DWORD dwInterfaceCount,
|
|
|
|
LPCBYTE pbAtr, LPCBYTE pbAtrMask, DWORD cbAtrLen)
|
2014-05-26 23:57:37 +04:00
|
|
|
{
|
|
|
|
LONG status;
|
|
|
|
|
2020-02-17 12:52:31 +03:00
|
|
|
WLog_Print(g_Log, g_LogLevel, "SCardIntroduceCardTypeW { hContext: %p", (void*)hContext);
|
2014-05-27 01:54:39 +04:00
|
|
|
|
2021-11-05 15:09:42 +03:00
|
|
|
SCARDAPI_STUB_CALL_LONG(status, SCardIntroduceCardTypeW, hContext, szCardName,
|
|
|
|
pguidPrimaryProvider, rgguidInterfaces, dwInterfaceCount, pbAtr,
|
|
|
|
pbAtrMask, cbAtrLen);
|
2014-05-26 23:57:37 +04:00
|
|
|
|
2020-02-17 12:52:31 +03:00
|
|
|
WLog_Print(g_Log, g_LogLevel, "SCardIntroduceCardTypeW } status: %s (0x%08" PRIX32 ")",
|
2019-11-06 17:24:51 +03:00
|
|
|
SCardGetErrorString(status), status);
|
2014-05-27 01:54:39 +04:00
|
|
|
|
2014-05-26 23:57:37 +04:00
|
|
|
return status;
|
|
|
|
}
|
|
|
|
|
2019-11-20 13:07:42 +03:00
|
|
|
static LONG WINAPI Inspect_SCardSetCardTypeProviderNameA(SCARDCONTEXT hContext, LPCSTR szCardName,
|
|
|
|
DWORD dwProviderId, LPCSTR szProvider)
|
2014-05-26 23:57:37 +04:00
|
|
|
{
|
|
|
|
LONG status;
|
|
|
|
|
2020-02-17 12:52:31 +03:00
|
|
|
WLog_Print(g_Log, g_LogLevel, "SCardSetCardTypeProviderNameA { hContext: %p", (void*)hContext);
|
2014-05-27 01:54:39 +04:00
|
|
|
|
2021-11-05 15:09:42 +03:00
|
|
|
SCARDAPI_STUB_CALL_LONG(status, SCardSetCardTypeProviderNameA, hContext, szCardName,
|
|
|
|
dwProviderId, szProvider);
|
2014-05-26 23:57:37 +04:00
|
|
|
|
2020-02-17 12:52:31 +03:00
|
|
|
WLog_Print(g_Log, g_LogLevel, "SCardSetCardTypeProviderNameA } status: %s (0x%08" PRIX32 ")",
|
2019-11-06 17:24:51 +03:00
|
|
|
SCardGetErrorString(status), status);
|
2014-05-27 01:54:39 +04:00
|
|
|
|
2014-05-26 23:57:37 +04:00
|
|
|
return status;
|
|
|
|
}
|
|
|
|
|
2019-11-20 13:07:42 +03:00
|
|
|
static LONG WINAPI Inspect_SCardSetCardTypeProviderNameW(SCARDCONTEXT hContext, LPCWSTR szCardName,
|
|
|
|
DWORD dwProviderId, LPCWSTR szProvider)
|
2014-05-26 23:57:37 +04:00
|
|
|
{
|
|
|
|
LONG status;
|
|
|
|
|
2020-02-17 12:52:31 +03:00
|
|
|
WLog_Print(g_Log, g_LogLevel, "SCardSetCardTypeProviderNameA { hContext: %p", (void*)hContext);
|
2014-05-27 01:54:39 +04:00
|
|
|
|
2021-11-05 15:09:42 +03:00
|
|
|
SCARDAPI_STUB_CALL_LONG(status, SCardSetCardTypeProviderNameW, hContext, szCardName,
|
|
|
|
dwProviderId, szProvider);
|
2014-05-26 23:57:37 +04:00
|
|
|
|
2020-02-17 12:52:31 +03:00
|
|
|
WLog_Print(g_Log, g_LogLevel, "SCardSetCardTypeProviderNameW } status: %s (0x%08" PRIX32 ")",
|
2019-11-06 17:24:51 +03:00
|
|
|
SCardGetErrorString(status), status);
|
2014-05-27 01:54:39 +04:00
|
|
|
|
2014-05-26 23:57:37 +04:00
|
|
|
return status;
|
|
|
|
}
|
|
|
|
|
2019-11-20 13:07:42 +03:00
|
|
|
static LONG WINAPI Inspect_SCardForgetCardTypeA(SCARDCONTEXT hContext, LPCSTR szCardName)
|
2014-05-26 23:57:37 +04:00
|
|
|
{
|
|
|
|
LONG status;
|
|
|
|
|
2020-02-17 12:52:31 +03:00
|
|
|
WLog_Print(g_Log, g_LogLevel, "SCardForgetCardTypeA { hContext: %p", (void*)hContext);
|
2014-05-27 01:54:39 +04:00
|
|
|
|
2021-11-05 15:09:42 +03:00
|
|
|
SCARDAPI_STUB_CALL_LONG(status, SCardForgetCardTypeA, hContext, szCardName);
|
2014-05-26 23:57:37 +04:00
|
|
|
|
2020-02-17 12:52:31 +03:00
|
|
|
WLog_Print(g_Log, g_LogLevel, "SCardForgetCardTypeA } status: %s (0x%08" PRIX32 ")",
|
2019-11-06 17:24:51 +03:00
|
|
|
SCardGetErrorString(status), status);
|
2014-05-27 01:54:39 +04:00
|
|
|
|
2014-05-26 23:57:37 +04:00
|
|
|
return status;
|
|
|
|
}
|
|
|
|
|
2019-11-20 13:07:42 +03:00
|
|
|
static LONG WINAPI Inspect_SCardForgetCardTypeW(SCARDCONTEXT hContext, LPCWSTR szCardName)
|
2014-05-26 23:57:37 +04:00
|
|
|
{
|
|
|
|
LONG status;
|
|
|
|
|
2020-02-17 12:52:31 +03:00
|
|
|
WLog_Print(g_Log, g_LogLevel, "SCardForgetCardTypeW { hContext: %p", (void*)hContext);
|
2014-05-27 01:54:39 +04:00
|
|
|
|
2021-11-05 15:09:42 +03:00
|
|
|
SCARDAPI_STUB_CALL_LONG(status, SCardForgetCardTypeW, hContext, szCardName);
|
2014-05-26 23:57:37 +04:00
|
|
|
|
2020-02-17 12:52:31 +03:00
|
|
|
WLog_Print(g_Log, g_LogLevel, "SCardForgetCardTypeW } status: %s (0x%08" PRIX32 ")",
|
2019-11-06 17:24:51 +03:00
|
|
|
SCardGetErrorString(status), status);
|
2014-05-27 01:54:39 +04:00
|
|
|
|
2014-05-26 23:57:37 +04:00
|
|
|
return status;
|
|
|
|
}
|
|
|
|
|
2020-02-17 12:52:31 +03:00
|
|
|
static LONG WINAPI Inspect_SCardFreeMemory(SCARDCONTEXT hContext, LPVOID pvMem)
|
2014-05-26 23:57:37 +04:00
|
|
|
{
|
|
|
|
LONG status;
|
|
|
|
|
2020-02-17 12:52:31 +03:00
|
|
|
WLog_Print(g_Log, g_LogLevel, "SCardFreeMemory { hContext: %p", (void*)hContext);
|
2014-05-27 01:54:39 +04:00
|
|
|
|
2021-11-05 15:09:42 +03:00
|
|
|
SCARDAPI_STUB_CALL_LONG(status, SCardFreeMemory, hContext, pvMem);
|
2014-05-26 23:57:37 +04:00
|
|
|
|
2020-02-17 12:52:31 +03:00
|
|
|
WLog_Print(g_Log, g_LogLevel, "SCardFreeMemory } status: %s (0x%08" PRIX32 ")",
|
2019-11-06 17:24:51 +03:00
|
|
|
SCardGetErrorString(status), status);
|
2014-05-27 01:54:39 +04:00
|
|
|
|
2014-05-26 23:57:37 +04:00
|
|
|
return status;
|
|
|
|
}
|
|
|
|
|
2019-11-20 13:07:42 +03:00
|
|
|
static HANDLE WINAPI Inspect_SCardAccessStartedEvent(void)
|
2014-05-26 23:57:37 +04:00
|
|
|
{
|
|
|
|
HANDLE hEvent;
|
|
|
|
|
2020-02-17 12:52:31 +03:00
|
|
|
WLog_Print(g_Log, g_LogLevel, "SCardAccessStartedEvent {");
|
2014-05-27 01:54:39 +04:00
|
|
|
|
2021-11-05 15:09:42 +03:00
|
|
|
SCARDAPI_STUB_CALL_HANDLE(hEvent, SCardAccessStartedEvent);
|
2014-05-26 23:57:37 +04:00
|
|
|
|
2020-02-17 12:52:31 +03:00
|
|
|
WLog_Print(g_Log, g_LogLevel, "SCardAccessStartedEvent } hEvent: %p", hEvent);
|
2014-05-27 01:54:39 +04:00
|
|
|
|
2014-05-26 23:57:37 +04:00
|
|
|
return hEvent;
|
|
|
|
}
|
|
|
|
|
2019-11-20 13:07:42 +03:00
|
|
|
static void WINAPI Inspect_SCardReleaseStartedEvent(void)
|
2014-05-26 23:57:37 +04:00
|
|
|
{
|
2020-02-17 12:52:31 +03:00
|
|
|
WLog_Print(g_Log, g_LogLevel, "SCardReleaseStartedEvent {");
|
2014-05-27 01:54:39 +04:00
|
|
|
|
2021-11-05 15:09:42 +03:00
|
|
|
SCARDAPI_STUB_CALL_VOID(SCardReleaseStartedEvent);
|
2014-05-27 01:54:39 +04:00
|
|
|
|
2020-02-17 12:52:31 +03:00
|
|
|
WLog_Print(g_Log, g_LogLevel, "SCardReleaseStartedEvent }");
|
2014-05-26 23:57:37 +04:00
|
|
|
}
|
|
|
|
|
2019-11-20 13:07:42 +03:00
|
|
|
static LONG WINAPI Inspect_SCardLocateCardsA(SCARDCONTEXT hContext, LPCSTR mszCards,
|
|
|
|
LPSCARD_READERSTATEA rgReaderStates, DWORD cReaders)
|
2014-05-26 23:57:37 +04:00
|
|
|
{
|
|
|
|
LONG status;
|
|
|
|
|
2020-02-17 12:52:31 +03:00
|
|
|
WLog_Print(g_Log, g_LogLevel, "SCardLocateCardsA { hContext: %p", (void*)hContext);
|
2014-05-27 01:54:39 +04:00
|
|
|
|
2021-11-05 15:09:42 +03:00
|
|
|
SCARDAPI_STUB_CALL_LONG(status, SCardLocateCardsA, hContext, mszCards, rgReaderStates,
|
|
|
|
cReaders);
|
2014-05-26 23:57:37 +04:00
|
|
|
|
2020-02-17 12:52:31 +03:00
|
|
|
WLog_Print(g_Log, g_LogLevel, "SCardLocateCardsA } status: %s (0x%08" PRIX32 ")",
|
2019-11-06 17:24:51 +03:00
|
|
|
SCardGetErrorString(status), status);
|
2014-05-27 01:54:39 +04:00
|
|
|
|
2014-05-26 23:57:37 +04:00
|
|
|
return status;
|
|
|
|
}
|
|
|
|
|
2019-11-20 13:07:42 +03:00
|
|
|
static LONG WINAPI Inspect_SCardLocateCardsW(SCARDCONTEXT hContext, LPCWSTR mszCards,
|
|
|
|
LPSCARD_READERSTATEW rgReaderStates, DWORD cReaders)
|
2014-05-26 23:57:37 +04:00
|
|
|
{
|
|
|
|
LONG status;
|
|
|
|
|
2020-02-17 12:52:31 +03:00
|
|
|
WLog_Print(g_Log, g_LogLevel, "SCardLocateCardsW { hContext: %p", (void*)hContext);
|
2014-05-27 01:54:39 +04:00
|
|
|
|
2021-11-05 15:09:42 +03:00
|
|
|
SCARDAPI_STUB_CALL_LONG(status, SCardLocateCardsW, hContext, mszCards, rgReaderStates,
|
|
|
|
cReaders);
|
2014-05-26 23:57:37 +04:00
|
|
|
|
2020-02-17 12:52:31 +03:00
|
|
|
WLog_Print(g_Log, g_LogLevel, "SCardLocateCardsW } status: %s (0x%08" PRIX32 ")",
|
2019-11-06 17:24:51 +03:00
|
|
|
SCardGetErrorString(status), status);
|
2014-05-27 01:54:39 +04:00
|
|
|
|
2014-05-26 23:57:37 +04:00
|
|
|
return status;
|
|
|
|
}
|
|
|
|
|
2019-11-20 13:07:42 +03:00
|
|
|
static LONG WINAPI Inspect_SCardLocateCardsByATRA(SCARDCONTEXT hContext, LPSCARD_ATRMASK rgAtrMasks,
|
|
|
|
DWORD cAtrs, LPSCARD_READERSTATEA rgReaderStates,
|
|
|
|
DWORD cReaders)
|
2014-05-26 23:57:37 +04:00
|
|
|
{
|
|
|
|
LONG status;
|
|
|
|
|
2020-02-17 12:52:31 +03:00
|
|
|
WLog_Print(g_Log, g_LogLevel, "SCardLocateCardsByATRA { hContext: %p", (void*)hContext);
|
2014-05-27 01:54:39 +04:00
|
|
|
|
2021-11-05 15:09:42 +03:00
|
|
|
SCARDAPI_STUB_CALL_LONG(status, SCardLocateCardsByATRA, hContext, rgAtrMasks, cAtrs,
|
|
|
|
rgReaderStates, cReaders);
|
2014-05-26 23:57:37 +04:00
|
|
|
|
2020-02-17 12:52:31 +03:00
|
|
|
WLog_Print(g_Log, g_LogLevel, "SCardLocateCardsByATRA } status: %s (0x%08" PRIX32 ")",
|
2019-11-06 17:24:51 +03:00
|
|
|
SCardGetErrorString(status), status);
|
2014-05-27 01:54:39 +04:00
|
|
|
|
2014-05-26 23:57:37 +04:00
|
|
|
return status;
|
|
|
|
}
|
|
|
|
|
2019-11-20 13:07:42 +03:00
|
|
|
static LONG WINAPI Inspect_SCardLocateCardsByATRW(SCARDCONTEXT hContext, LPSCARD_ATRMASK rgAtrMasks,
|
|
|
|
DWORD cAtrs, LPSCARD_READERSTATEW rgReaderStates,
|
|
|
|
DWORD cReaders)
|
2014-05-26 23:57:37 +04:00
|
|
|
{
|
|
|
|
LONG status;
|
|
|
|
|
2020-02-17 12:52:31 +03:00
|
|
|
WLog_Print(g_Log, g_LogLevel, "SCardLocateCardsByATRW { hContext: %p", (void*)hContext);
|
2014-05-27 01:54:39 +04:00
|
|
|
|
2021-11-05 15:09:42 +03:00
|
|
|
SCARDAPI_STUB_CALL_LONG(status, SCardLocateCardsByATRW, hContext, rgAtrMasks, cAtrs,
|
|
|
|
rgReaderStates, cReaders);
|
2014-05-26 23:57:37 +04:00
|
|
|
|
2020-02-17 12:52:31 +03:00
|
|
|
WLog_Print(g_Log, g_LogLevel, "SCardLocateCardsByATRW } status: %s (0x%08" PRIX32 ")",
|
2019-11-06 17:24:51 +03:00
|
|
|
SCardGetErrorString(status), status);
|
2014-05-27 01:54:39 +04:00
|
|
|
|
2014-05-26 23:57:37 +04:00
|
|
|
return status;
|
|
|
|
}
|
|
|
|
|
2019-11-20 13:07:42 +03:00
|
|
|
static LONG WINAPI Inspect_SCardGetStatusChangeA(SCARDCONTEXT hContext, DWORD dwTimeout,
|
|
|
|
LPSCARD_READERSTATEA rgReaderStates,
|
|
|
|
DWORD cReaders)
|
2014-05-26 23:57:37 +04:00
|
|
|
{
|
|
|
|
LONG status;
|
|
|
|
|
2020-02-17 12:52:31 +03:00
|
|
|
WLog_Print(g_Log, g_LogLevel, "SCardGetStatusChangeA { hContext: %p", (void*)hContext);
|
2014-05-27 01:54:39 +04:00
|
|
|
|
2021-11-05 15:09:42 +03:00
|
|
|
SCARDAPI_STUB_CALL_LONG(status, SCardGetStatusChangeA, hContext, dwTimeout, rgReaderStates,
|
|
|
|
cReaders);
|
2014-05-26 23:57:37 +04:00
|
|
|
|
2020-02-17 12:52:31 +03:00
|
|
|
WLog_Print(g_Log, g_LogLevel, "SCardGetStatusChangeA } status: %s (0x%08" PRIX32 ")",
|
2019-11-06 17:24:51 +03:00
|
|
|
SCardGetErrorString(status), status);
|
2014-05-27 01:54:39 +04:00
|
|
|
|
2014-05-26 23:57:37 +04:00
|
|
|
return status;
|
|
|
|
}
|
|
|
|
|
2019-11-20 13:07:42 +03:00
|
|
|
static LONG WINAPI Inspect_SCardGetStatusChangeW(SCARDCONTEXT hContext, DWORD dwTimeout,
|
|
|
|
LPSCARD_READERSTATEW rgReaderStates,
|
|
|
|
DWORD cReaders)
|
2014-05-26 23:57:37 +04:00
|
|
|
{
|
|
|
|
LONG status;
|
|
|
|
|
2020-02-17 12:52:31 +03:00
|
|
|
WLog_Print(g_Log, g_LogLevel, "SCardGetStatusChangeW { hContext: %p", (void*)hContext);
|
2014-05-27 01:54:39 +04:00
|
|
|
|
2021-11-05 15:09:42 +03:00
|
|
|
SCARDAPI_STUB_CALL_LONG(status, SCardGetStatusChangeW, hContext, dwTimeout, rgReaderStates,
|
|
|
|
cReaders);
|
2014-05-26 23:57:37 +04:00
|
|
|
|
2020-02-17 12:52:31 +03:00
|
|
|
WLog_Print(g_Log, g_LogLevel, "SCardGetStatusChangeW } status: %s (0x%08" PRIX32 ")",
|
2019-11-06 17:24:51 +03:00
|
|
|
SCardGetErrorString(status), status);
|
2014-05-27 01:54:39 +04:00
|
|
|
|
2014-05-26 23:57:37 +04:00
|
|
|
return status;
|
|
|
|
}
|
|
|
|
|
2019-11-20 13:07:42 +03:00
|
|
|
static LONG WINAPI Inspect_SCardCancel(SCARDCONTEXT hContext)
|
2014-05-26 23:57:37 +04:00
|
|
|
{
|
|
|
|
LONG status;
|
|
|
|
|
2020-02-17 12:52:31 +03:00
|
|
|
WLog_Print(g_Log, g_LogLevel, "SCardCancel { hContext: %p", (void*)hContext);
|
2014-05-27 01:54:39 +04:00
|
|
|
|
2021-11-05 15:09:42 +03:00
|
|
|
SCARDAPI_STUB_CALL_LONG(status, SCardCancel, hContext);
|
2014-05-26 23:57:37 +04:00
|
|
|
|
2020-02-17 12:52:31 +03:00
|
|
|
WLog_Print(g_Log, g_LogLevel, "SCardCancel } status: %s (0x%08" PRIX32 ")",
|
2019-11-06 17:24:51 +03:00
|
|
|
SCardGetErrorString(status), status);
|
2014-05-27 01:54:39 +04:00
|
|
|
|
2014-05-26 23:57:37 +04:00
|
|
|
return status;
|
|
|
|
}
|
|
|
|
|
2019-11-20 13:07:42 +03:00
|
|
|
static LONG WINAPI Inspect_SCardConnectA(SCARDCONTEXT hContext, LPCSTR szReader, DWORD dwShareMode,
|
|
|
|
DWORD dwPreferredProtocols, LPSCARDHANDLE phCard,
|
|
|
|
LPDWORD pdwActiveProtocol)
|
2014-05-26 23:57:37 +04:00
|
|
|
{
|
|
|
|
LONG status;
|
|
|
|
|
2020-02-17 12:52:31 +03:00
|
|
|
WLog_Print(g_Log, g_LogLevel, "SCardConnectA { hContext: %p", (void*)hContext);
|
2014-05-27 01:54:39 +04:00
|
|
|
|
2021-11-05 15:09:42 +03:00
|
|
|
SCARDAPI_STUB_CALL_LONG(status, SCardConnectA, hContext, szReader, dwShareMode,
|
|
|
|
dwPreferredProtocols, phCard, pdwActiveProtocol);
|
2014-05-26 23:57:37 +04:00
|
|
|
|
2020-02-17 12:52:31 +03:00
|
|
|
WLog_Print(g_Log, g_LogLevel, "SCardConnectA } status: %s (0x%08" PRIX32 ")",
|
2019-11-06 17:24:51 +03:00
|
|
|
SCardGetErrorString(status), status);
|
2014-05-27 01:54:39 +04:00
|
|
|
|
2014-05-26 23:57:37 +04:00
|
|
|
return status;
|
|
|
|
}
|
|
|
|
|
2019-11-20 13:07:42 +03:00
|
|
|
static LONG WINAPI Inspect_SCardConnectW(SCARDCONTEXT hContext, LPCWSTR szReader, DWORD dwShareMode,
|
|
|
|
DWORD dwPreferredProtocols, LPSCARDHANDLE phCard,
|
|
|
|
LPDWORD pdwActiveProtocol)
|
2014-05-26 23:57:37 +04:00
|
|
|
{
|
|
|
|
LONG status;
|
|
|
|
|
2020-02-17 12:52:31 +03:00
|
|
|
WLog_Print(g_Log, g_LogLevel, "SCardConnectW { hContext: %p", (void*)hContext);
|
2014-05-27 01:54:39 +04:00
|
|
|
|
2021-11-05 15:09:42 +03:00
|
|
|
SCARDAPI_STUB_CALL_LONG(status, SCardConnectW, hContext, szReader, dwShareMode,
|
|
|
|
dwPreferredProtocols, phCard, pdwActiveProtocol);
|
2014-05-26 23:57:37 +04:00
|
|
|
|
2020-02-17 12:52:31 +03:00
|
|
|
WLog_Print(g_Log, g_LogLevel, "SCardConnectW } status: %s (0x%08" PRIX32 ")",
|
2019-11-06 17:24:51 +03:00
|
|
|
SCardGetErrorString(status), status);
|
2014-05-27 01:54:39 +04:00
|
|
|
|
2014-05-26 23:57:37 +04:00
|
|
|
return status;
|
|
|
|
}
|
|
|
|
|
2019-11-20 13:07:42 +03:00
|
|
|
static LONG WINAPI Inspect_SCardReconnect(SCARDHANDLE hCard, DWORD dwShareMode,
|
|
|
|
DWORD dwPreferredProtocols, DWORD dwInitialization,
|
|
|
|
LPDWORD pdwActiveProtocol)
|
2014-05-26 23:57:37 +04:00
|
|
|
{
|
|
|
|
LONG status;
|
|
|
|
|
2020-02-17 12:52:31 +03:00
|
|
|
WLog_Print(g_Log, g_LogLevel, "SCardReconnect { hCard: %p", (void*)hCard);
|
2014-05-27 01:54:39 +04:00
|
|
|
|
2021-11-05 15:09:42 +03:00
|
|
|
SCARDAPI_STUB_CALL_LONG(status, SCardReconnect, hCard, dwShareMode, dwPreferredProtocols,
|
|
|
|
dwInitialization, pdwActiveProtocol);
|
2014-05-26 23:57:37 +04:00
|
|
|
|
2020-02-17 12:52:31 +03:00
|
|
|
WLog_Print(g_Log, g_LogLevel, "SCardReconnect } status: %s (0x%08" PRIX32 ")",
|
2019-11-06 17:24:51 +03:00
|
|
|
SCardGetErrorString(status), status);
|
2014-05-27 01:54:39 +04:00
|
|
|
|
2014-05-26 23:57:37 +04:00
|
|
|
return status;
|
|
|
|
}
|
|
|
|
|
2019-11-20 13:07:42 +03:00
|
|
|
static LONG WINAPI Inspect_SCardDisconnect(SCARDHANDLE hCard, DWORD dwDisposition)
|
2014-05-26 23:57:37 +04:00
|
|
|
{
|
|
|
|
LONG status;
|
|
|
|
|
2020-02-17 12:52:31 +03:00
|
|
|
WLog_Print(g_Log, g_LogLevel, "SCardDisconnect { hCard: %p", (void*)hCard);
|
2014-05-27 01:54:39 +04:00
|
|
|
|
2021-11-05 15:09:42 +03:00
|
|
|
SCARDAPI_STUB_CALL_LONG(status, SCardDisconnect, hCard, dwDisposition);
|
2014-05-26 23:57:37 +04:00
|
|
|
|
2020-02-17 12:52:31 +03:00
|
|
|
WLog_Print(g_Log, g_LogLevel, "SCardDisconnect } status: %s (0x%08" PRIX32 ")",
|
2019-11-06 17:24:51 +03:00
|
|
|
SCardGetErrorString(status), status);
|
2014-05-27 01:54:39 +04:00
|
|
|
|
2014-05-26 23:57:37 +04:00
|
|
|
return status;
|
|
|
|
}
|
|
|
|
|
2019-11-20 13:07:42 +03:00
|
|
|
static LONG WINAPI Inspect_SCardBeginTransaction(SCARDHANDLE hCard)
|
2014-05-26 23:57:37 +04:00
|
|
|
{
|
|
|
|
LONG status;
|
|
|
|
|
2020-02-17 12:52:31 +03:00
|
|
|
WLog_Print(g_Log, g_LogLevel, "SCardBeginTransaction { hCard: %p", (void*)hCard);
|
2014-05-27 01:54:39 +04:00
|
|
|
|
2021-11-05 15:09:42 +03:00
|
|
|
SCARDAPI_STUB_CALL_LONG(status, SCardBeginTransaction, hCard);
|
2014-05-26 23:57:37 +04:00
|
|
|
|
2020-02-17 12:52:31 +03:00
|
|
|
WLog_Print(g_Log, g_LogLevel, "SCardBeginTransaction } status: %s (0x%08" PRIX32 ")",
|
2019-11-06 17:24:51 +03:00
|
|
|
SCardGetErrorString(status), status);
|
2014-05-27 01:54:39 +04:00
|
|
|
|
2014-05-26 23:57:37 +04:00
|
|
|
return status;
|
|
|
|
}
|
|
|
|
|
2019-11-20 13:07:42 +03:00
|
|
|
static LONG WINAPI Inspect_SCardEndTransaction(SCARDHANDLE hCard, DWORD dwDisposition)
|
2014-05-26 23:57:37 +04:00
|
|
|
{
|
|
|
|
LONG status;
|
|
|
|
|
2020-02-17 12:52:31 +03:00
|
|
|
WLog_Print(g_Log, g_LogLevel, "SCardEndTransaction { hCard: %p", (void*)hCard);
|
2014-05-27 01:54:39 +04:00
|
|
|
|
2021-11-05 15:09:42 +03:00
|
|
|
SCARDAPI_STUB_CALL_LONG(status, SCardEndTransaction, hCard, dwDisposition);
|
2014-05-26 23:57:37 +04:00
|
|
|
|
2020-02-17 12:52:31 +03:00
|
|
|
WLog_Print(g_Log, g_LogLevel, "SCardEndTransaction } status: %s (0x%08" PRIX32 ")",
|
2019-11-06 17:24:51 +03:00
|
|
|
SCardGetErrorString(status), status);
|
2014-05-27 01:54:39 +04:00
|
|
|
|
2014-05-26 23:57:37 +04:00
|
|
|
return status;
|
|
|
|
}
|
|
|
|
|
2019-11-20 13:07:42 +03:00
|
|
|
static LONG WINAPI Inspect_SCardCancelTransaction(SCARDHANDLE hCard)
|
2014-05-26 23:57:37 +04:00
|
|
|
{
|
|
|
|
LONG status;
|
|
|
|
|
2020-02-17 12:52:31 +03:00
|
|
|
WLog_Print(g_Log, g_LogLevel, "SCardCancelTransaction { hCard: %p", (void*)hCard);
|
2014-05-27 01:54:39 +04:00
|
|
|
|
2021-11-05 15:09:42 +03:00
|
|
|
SCARDAPI_STUB_CALL_LONG(status, SCardCancelTransaction, hCard);
|
2014-05-26 23:57:37 +04:00
|
|
|
|
2020-02-17 12:52:31 +03:00
|
|
|
WLog_Print(g_Log, g_LogLevel, "SCardCancelTransaction } status: %s (0x%08" PRIX32 ")",
|
2019-11-06 17:24:51 +03:00
|
|
|
SCardGetErrorString(status), status);
|
2014-05-27 01:54:39 +04:00
|
|
|
|
2014-05-26 23:57:37 +04:00
|
|
|
return status;
|
|
|
|
}
|
|
|
|
|
2019-11-20 13:07:42 +03:00
|
|
|
static LONG WINAPI Inspect_SCardState(SCARDHANDLE hCard, LPDWORD pdwState, LPDWORD pdwProtocol,
|
|
|
|
LPBYTE pbAtr, LPDWORD pcbAtrLen)
|
2014-05-26 23:57:37 +04:00
|
|
|
{
|
|
|
|
LONG status;
|
|
|
|
|
2020-02-17 12:52:31 +03:00
|
|
|
WLog_Print(g_Log, g_LogLevel, "SCardState { hCard: %p", (void*)hCard);
|
2014-05-27 01:54:39 +04:00
|
|
|
|
2021-11-05 15:09:42 +03:00
|
|
|
SCARDAPI_STUB_CALL_LONG(status, SCardState, hCard, pdwState, pdwProtocol, pbAtr, pcbAtrLen);
|
2014-05-26 23:57:37 +04:00
|
|
|
|
2020-02-17 12:52:31 +03:00
|
|
|
WLog_Print(g_Log, g_LogLevel, "SCardState } status: %s (0x%08" PRIX32 ")",
|
2019-11-06 17:24:51 +03:00
|
|
|
SCardGetErrorString(status), status);
|
2014-05-27 01:54:39 +04:00
|
|
|
|
2014-05-26 23:57:37 +04:00
|
|
|
return status;
|
|
|
|
}
|
|
|
|
|
2019-11-20 13:07:42 +03:00
|
|
|
static LONG WINAPI Inspect_SCardStatusA(SCARDHANDLE hCard, LPSTR mszReaderNames,
|
|
|
|
LPDWORD pcchReaderLen, LPDWORD pdwState,
|
|
|
|
LPDWORD pdwProtocol, LPBYTE pbAtr, LPDWORD pcbAtrLen)
|
2014-05-26 23:57:37 +04:00
|
|
|
{
|
|
|
|
LONG status;
|
|
|
|
|
2020-02-17 12:52:31 +03:00
|
|
|
WLog_Print(g_Log, g_LogLevel, "SCardStatusA { hCard: %p", (void*)hCard);
|
2014-05-27 01:54:39 +04:00
|
|
|
|
2021-11-05 15:09:42 +03:00
|
|
|
SCARDAPI_STUB_CALL_LONG(status, SCardStatusA, hCard, mszReaderNames, pcchReaderLen, pdwState,
|
|
|
|
pdwProtocol, pbAtr, pcbAtrLen);
|
2014-05-26 23:57:37 +04:00
|
|
|
|
2020-02-17 12:52:31 +03:00
|
|
|
WLog_Print(g_Log, g_LogLevel, "SCardStatusA } status: %s (0x%08" PRIX32 ")",
|
2019-11-06 17:24:51 +03:00
|
|
|
SCardGetErrorString(status), status);
|
2014-05-27 01:54:39 +04:00
|
|
|
|
2014-05-26 23:57:37 +04:00
|
|
|
return status;
|
|
|
|
}
|
|
|
|
|
2019-11-20 13:07:42 +03:00
|
|
|
static LONG WINAPI Inspect_SCardStatusW(SCARDHANDLE hCard, LPWSTR mszReaderNames,
|
|
|
|
LPDWORD pcchReaderLen, LPDWORD pdwState,
|
|
|
|
LPDWORD pdwProtocol, LPBYTE pbAtr, LPDWORD pcbAtrLen)
|
2014-05-26 23:57:37 +04:00
|
|
|
{
|
|
|
|
LONG status;
|
|
|
|
|
2020-02-17 12:52:31 +03:00
|
|
|
WLog_Print(g_Log, g_LogLevel, "SCardStatusW { hCard: %p", (void*)hCard);
|
2014-05-27 01:54:39 +04:00
|
|
|
|
2021-11-05 15:09:42 +03:00
|
|
|
SCARDAPI_STUB_CALL_LONG(status, SCardStatusW, hCard, mszReaderNames, pcchReaderLen, pdwState,
|
|
|
|
pdwProtocol, pbAtr, pcbAtrLen);
|
2014-05-26 23:57:37 +04:00
|
|
|
|
2020-02-17 12:52:31 +03:00
|
|
|
WLog_Print(g_Log, g_LogLevel, "SCardStatusW } status: %s (0x%08" PRIX32 ")",
|
2019-11-06 17:24:51 +03:00
|
|
|
SCardGetErrorString(status), status);
|
2014-05-27 01:54:39 +04:00
|
|
|
|
2014-05-26 23:57:37 +04:00
|
|
|
return status;
|
|
|
|
}
|
|
|
|
|
2019-11-20 13:07:42 +03:00
|
|
|
static LONG WINAPI Inspect_SCardTransmit(SCARDHANDLE hCard, LPCSCARD_IO_REQUEST pioSendPci,
|
|
|
|
LPCBYTE pbSendBuffer, DWORD cbSendLength,
|
|
|
|
LPSCARD_IO_REQUEST pioRecvPci, LPBYTE pbRecvBuffer,
|
|
|
|
LPDWORD pcbRecvLength)
|
2014-05-26 23:57:37 +04:00
|
|
|
{
|
|
|
|
LONG status;
|
|
|
|
|
2020-02-17 12:52:31 +03:00
|
|
|
WLog_Print(g_Log, g_LogLevel, "SCardTransmit { hCard: %p", (void*)hCard);
|
2014-05-27 01:54:39 +04:00
|
|
|
|
2021-11-05 15:09:42 +03:00
|
|
|
SCARDAPI_STUB_CALL_LONG(status, SCardTransmit, hCard, pioSendPci, pbSendBuffer, cbSendLength,
|
|
|
|
pioRecvPci, pbRecvBuffer, pcbRecvLength);
|
2014-05-26 23:57:37 +04:00
|
|
|
|
2020-02-17 12:52:31 +03:00
|
|
|
WLog_Print(g_Log, g_LogLevel, "SCardTransmit } status: %s (0x%08" PRIX32 ")",
|
2019-11-06 17:24:51 +03:00
|
|
|
SCardGetErrorString(status), status);
|
2014-05-27 01:54:39 +04:00
|
|
|
|
2014-05-26 23:57:37 +04:00
|
|
|
return status;
|
|
|
|
}
|
|
|
|
|
2019-11-20 13:07:42 +03:00
|
|
|
static LONG WINAPI Inspect_SCardGetTransmitCount(SCARDHANDLE hCard, LPDWORD pcTransmitCount)
|
2014-05-26 23:57:37 +04:00
|
|
|
{
|
|
|
|
LONG status;
|
|
|
|
|
2020-02-17 12:52:31 +03:00
|
|
|
WLog_Print(g_Log, g_LogLevel, "SCardGetTransmitCount { hCard: %p", (void*)hCard);
|
2014-05-27 01:54:39 +04:00
|
|
|
|
2021-11-05 15:09:42 +03:00
|
|
|
SCARDAPI_STUB_CALL_LONG(status, SCardGetTransmitCount, hCard, pcTransmitCount);
|
2014-05-26 23:57:37 +04:00
|
|
|
|
2020-02-17 12:52:31 +03:00
|
|
|
WLog_Print(g_Log, g_LogLevel, "SCardGetTransmitCount } status: %s (0x%08" PRIX32 ")",
|
2019-11-06 17:24:51 +03:00
|
|
|
SCardGetErrorString(status), status);
|
2014-05-27 01:54:39 +04:00
|
|
|
|
2014-05-26 23:57:37 +04:00
|
|
|
return status;
|
|
|
|
}
|
|
|
|
|
2019-11-20 13:07:42 +03:00
|
|
|
static LONG WINAPI Inspect_SCardControl(SCARDHANDLE hCard, DWORD dwControlCode, LPCVOID lpInBuffer,
|
|
|
|
DWORD cbInBufferSize, LPVOID lpOutBuffer,
|
|
|
|
DWORD cbOutBufferSize, LPDWORD lpBytesReturned)
|
2014-05-26 23:57:37 +04:00
|
|
|
{
|
|
|
|
LONG status;
|
|
|
|
|
2020-02-17 12:52:31 +03:00
|
|
|
WLog_Print(g_Log, g_LogLevel, "SCardControl { hCard: %p", (void*)hCard);
|
2014-05-27 01:54:39 +04:00
|
|
|
|
2021-11-05 15:09:42 +03:00
|
|
|
SCARDAPI_STUB_CALL_LONG(status, SCardControl, hCard, dwControlCode, lpInBuffer, cbInBufferSize,
|
|
|
|
lpOutBuffer, cbOutBufferSize, lpBytesReturned);
|
2014-05-26 23:57:37 +04:00
|
|
|
|
2020-02-17 12:52:31 +03:00
|
|
|
WLog_Print(g_Log, g_LogLevel, "SCardControl } status: %s (0x%08" PRIX32 ")",
|
2019-11-06 17:24:51 +03:00
|
|
|
SCardGetErrorString(status), status);
|
2014-05-27 01:54:39 +04:00
|
|
|
|
2014-05-26 23:57:37 +04:00
|
|
|
return status;
|
|
|
|
}
|
|
|
|
|
2019-11-20 13:07:42 +03:00
|
|
|
static LONG WINAPI Inspect_SCardGetAttrib(SCARDHANDLE hCard, DWORD dwAttrId, LPBYTE pbAttr,
|
|
|
|
LPDWORD pcbAttrLen)
|
2014-05-26 23:57:37 +04:00
|
|
|
{
|
|
|
|
LONG status;
|
|
|
|
|
2020-02-17 12:52:31 +03:00
|
|
|
WLog_Print(g_Log, g_LogLevel, "SCardGetAttrib { hCard: %p", (void*)hCard);
|
2014-05-27 01:54:39 +04:00
|
|
|
|
2021-11-05 15:09:42 +03:00
|
|
|
SCARDAPI_STUB_CALL_LONG(status, SCardGetAttrib, hCard, dwAttrId, pbAttr, pcbAttrLen);
|
2014-05-26 23:57:37 +04:00
|
|
|
|
2020-02-17 12:52:31 +03:00
|
|
|
WLog_Print(g_Log, g_LogLevel, "SCardGetAttrib } status: %s (0x%08" PRIX32 ")",
|
2019-11-06 17:24:51 +03:00
|
|
|
SCardGetErrorString(status), status);
|
2014-05-27 01:54:39 +04:00
|
|
|
|
2014-05-26 23:57:37 +04:00
|
|
|
return status;
|
|
|
|
}
|
|
|
|
|
2019-11-20 13:07:42 +03:00
|
|
|
static LONG WINAPI Inspect_SCardSetAttrib(SCARDHANDLE hCard, DWORD dwAttrId, LPCBYTE pbAttr,
|
|
|
|
DWORD cbAttrLen)
|
2014-05-26 23:57:37 +04:00
|
|
|
{
|
|
|
|
LONG status;
|
|
|
|
|
2020-02-17 12:52:31 +03:00
|
|
|
WLog_Print(g_Log, g_LogLevel, "SCardSetAttrib { hCard: %p", (void*)hCard);
|
2014-05-27 01:54:39 +04:00
|
|
|
|
2021-11-05 15:09:42 +03:00
|
|
|
SCARDAPI_STUB_CALL_LONG(status, SCardSetAttrib, hCard, dwAttrId, pbAttr, cbAttrLen);
|
2014-05-26 23:57:37 +04:00
|
|
|
|
2020-02-17 12:52:31 +03:00
|
|
|
WLog_Print(g_Log, g_LogLevel, "SCardSetAttrib } status: %s (0x%08" PRIX32 ")",
|
2019-11-06 17:24:51 +03:00
|
|
|
SCardGetErrorString(status), status);
|
2014-05-27 01:54:39 +04:00
|
|
|
|
2014-05-26 23:57:37 +04:00
|
|
|
return status;
|
|
|
|
}
|
|
|
|
|
2019-11-20 13:07:42 +03:00
|
|
|
static LONG WINAPI Inspect_SCardUIDlgSelectCardA(LPOPENCARDNAMEA_EX pDlgStruc)
|
2014-05-26 23:57:37 +04:00
|
|
|
{
|
|
|
|
LONG status;
|
|
|
|
|
2020-02-17 12:52:31 +03:00
|
|
|
WLog_Print(g_Log, g_LogLevel, "SCardUIDlgSelectCardA {");
|
2014-05-27 01:54:39 +04:00
|
|
|
|
2021-11-05 15:09:42 +03:00
|
|
|
SCARDAPI_STUB_CALL_LONG(status, SCardUIDlgSelectCardA, pDlgStruc);
|
2014-05-26 23:57:37 +04:00
|
|
|
|
2020-02-17 12:52:31 +03:00
|
|
|
WLog_Print(g_Log, g_LogLevel, "SCardUIDlgSelectCardA } status: %s (0x%08" PRIX32 ")",
|
2019-11-06 17:24:51 +03:00
|
|
|
SCardGetErrorString(status), status);
|
2014-05-27 01:54:39 +04:00
|
|
|
|
2014-05-26 23:57:37 +04:00
|
|
|
return status;
|
|
|
|
}
|
|
|
|
|
2019-11-20 13:07:42 +03:00
|
|
|
static LONG WINAPI Inspect_SCardUIDlgSelectCardW(LPOPENCARDNAMEW_EX pDlgStruc)
|
2014-05-26 23:57:37 +04:00
|
|
|
{
|
|
|
|
LONG status;
|
|
|
|
|
2020-02-17 12:52:31 +03:00
|
|
|
WLog_Print(g_Log, g_LogLevel, "SCardUIDlgSelectCardW {");
|
2014-05-27 01:54:39 +04:00
|
|
|
|
2021-11-05 15:09:42 +03:00
|
|
|
SCARDAPI_STUB_CALL_LONG(status, SCardUIDlgSelectCardW, pDlgStruc);
|
2014-05-26 23:57:37 +04:00
|
|
|
|
2020-02-17 12:52:31 +03:00
|
|
|
WLog_Print(g_Log, g_LogLevel, "SCardUIDlgSelectCardW } status: %s (0x%08" PRIX32 ")",
|
2019-11-06 17:24:51 +03:00
|
|
|
SCardGetErrorString(status), status);
|
2014-05-27 01:54:39 +04:00
|
|
|
|
2014-05-26 23:57:37 +04:00
|
|
|
return status;
|
|
|
|
}
|
|
|
|
|
2019-11-20 13:07:42 +03:00
|
|
|
static LONG WINAPI Inspect_GetOpenCardNameA(LPOPENCARDNAMEA pDlgStruc)
|
2014-05-26 23:57:37 +04:00
|
|
|
{
|
|
|
|
LONG status;
|
|
|
|
|
2020-02-17 12:52:31 +03:00
|
|
|
WLog_Print(g_Log, g_LogLevel, "GetOpenCardNameA {");
|
2014-05-27 01:54:39 +04:00
|
|
|
|
2021-11-05 15:09:42 +03:00
|
|
|
SCARDAPI_STUB_CALL_LONG(status, GetOpenCardNameA, pDlgStruc);
|
2014-05-26 23:57:37 +04:00
|
|
|
|
2020-02-17 12:52:31 +03:00
|
|
|
WLog_Print(g_Log, g_LogLevel, "GetOpenCardNameA } status: %s (0x%08" PRIX32 ")",
|
2019-11-06 17:24:51 +03:00
|
|
|
SCardGetErrorString(status), status);
|
2014-05-27 01:54:39 +04:00
|
|
|
|
2014-05-26 23:57:37 +04:00
|
|
|
return status;
|
|
|
|
}
|
|
|
|
|
2019-11-20 13:07:42 +03:00
|
|
|
static LONG WINAPI Inspect_GetOpenCardNameW(LPOPENCARDNAMEW pDlgStruc)
|
2014-05-26 23:57:37 +04:00
|
|
|
{
|
|
|
|
LONG status;
|
|
|
|
|
2020-02-17 12:52:31 +03:00
|
|
|
WLog_Print(g_Log, g_LogLevel, "GetOpenCardNameW {");
|
2014-05-27 01:54:39 +04:00
|
|
|
|
2021-11-05 15:09:42 +03:00
|
|
|
SCARDAPI_STUB_CALL_LONG(status, GetOpenCardNameW, pDlgStruc);
|
2014-05-26 23:57:37 +04:00
|
|
|
|
2020-02-17 12:52:31 +03:00
|
|
|
WLog_Print(g_Log, g_LogLevel, "GetOpenCardNameW } status: %s (0x%08" PRIX32 ")",
|
2019-11-06 17:24:51 +03:00
|
|
|
SCardGetErrorString(status), status);
|
2014-05-27 01:54:39 +04:00
|
|
|
|
2014-05-26 23:57:37 +04:00
|
|
|
return status;
|
|
|
|
}
|
|
|
|
|
2019-11-20 13:07:42 +03:00
|
|
|
static LONG WINAPI Inspect_SCardDlgExtendedError(void)
|
2014-05-26 23:57:37 +04:00
|
|
|
{
|
|
|
|
LONG status;
|
|
|
|
|
2020-02-17 12:52:31 +03:00
|
|
|
WLog_Print(g_Log, g_LogLevel, "SCardDlgExtendedError {");
|
2014-05-27 01:54:39 +04:00
|
|
|
|
2021-11-05 15:09:42 +03:00
|
|
|
SCARDAPI_STUB_CALL_LONG(status, SCardDlgExtendedError);
|
2014-05-26 23:57:37 +04:00
|
|
|
|
2020-02-17 12:52:31 +03:00
|
|
|
WLog_Print(g_Log, g_LogLevel, "SCardDlgExtendedError } status: %s (0x%08" PRIX32 ")",
|
2019-11-06 17:24:51 +03:00
|
|
|
SCardGetErrorString(status), status);
|
2014-05-27 01:54:39 +04:00
|
|
|
|
2014-05-26 23:57:37 +04:00
|
|
|
return status;
|
|
|
|
}
|
|
|
|
|
2019-11-20 13:07:42 +03:00
|
|
|
static LONG WINAPI Inspect_SCardReadCacheA(SCARDCONTEXT hContext, UUID* CardIdentifier,
|
|
|
|
DWORD FreshnessCounter, LPSTR LookupName, PBYTE Data,
|
|
|
|
DWORD* DataLen)
|
2014-05-26 23:57:37 +04:00
|
|
|
{
|
|
|
|
LONG status;
|
|
|
|
|
2020-02-17 12:52:31 +03:00
|
|
|
WLog_Print(g_Log, g_LogLevel, "SCardReadCacheA { hContext: %p", (void*)hContext);
|
2014-05-27 01:54:39 +04:00
|
|
|
|
2021-11-05 15:09:42 +03:00
|
|
|
SCARDAPI_STUB_CALL_LONG(status, SCardReadCacheA, hContext, CardIdentifier, FreshnessCounter,
|
|
|
|
LookupName, Data, DataLen);
|
2014-05-26 23:57:37 +04:00
|
|
|
|
2020-02-17 12:52:31 +03:00
|
|
|
WLog_Print(g_Log, g_LogLevel, "SCardReadCacheA } status: %s (0x%08" PRIX32 ")",
|
2019-11-06 17:24:51 +03:00
|
|
|
SCardGetErrorString(status), status);
|
2014-05-27 01:54:39 +04:00
|
|
|
|
2014-05-26 23:57:37 +04:00
|
|
|
return status;
|
|
|
|
}
|
|
|
|
|
2019-11-20 13:07:42 +03:00
|
|
|
static LONG WINAPI Inspect_SCardReadCacheW(SCARDCONTEXT hContext, UUID* CardIdentifier,
|
|
|
|
DWORD FreshnessCounter, LPWSTR LookupName, PBYTE Data,
|
|
|
|
DWORD* DataLen)
|
2014-05-26 23:57:37 +04:00
|
|
|
{
|
|
|
|
LONG status;
|
|
|
|
|
2020-02-17 12:52:31 +03:00
|
|
|
WLog_Print(g_Log, g_LogLevel, "SCardReadCacheW { hContext: %p", (void*)hContext);
|
2014-05-27 01:54:39 +04:00
|
|
|
|
2021-11-05 15:09:42 +03:00
|
|
|
SCARDAPI_STUB_CALL_LONG(status, SCardReadCacheW, hContext, CardIdentifier, FreshnessCounter,
|
|
|
|
LookupName, Data, DataLen);
|
2014-05-26 23:57:37 +04:00
|
|
|
|
2020-02-17 12:52:31 +03:00
|
|
|
WLog_Print(g_Log, g_LogLevel, "SCardReadCacheW } status: %s (0x%08" PRIX32 ")",
|
2019-11-06 17:24:51 +03:00
|
|
|
SCardGetErrorString(status), status);
|
2014-05-27 01:54:39 +04:00
|
|
|
|
2014-05-26 23:57:37 +04:00
|
|
|
return status;
|
|
|
|
}
|
|
|
|
|
2019-11-20 13:07:42 +03:00
|
|
|
static LONG WINAPI Inspect_SCardWriteCacheA(SCARDCONTEXT hContext, UUID* CardIdentifier,
|
|
|
|
DWORD FreshnessCounter, LPSTR LookupName, PBYTE Data,
|
|
|
|
DWORD DataLen)
|
2014-05-26 23:57:37 +04:00
|
|
|
{
|
|
|
|
LONG status;
|
|
|
|
|
2020-02-17 12:52:31 +03:00
|
|
|
WLog_Print(g_Log, g_LogLevel, "SCardWriteCacheA { hContext: %p", (void*)hContext);
|
2014-05-27 01:54:39 +04:00
|
|
|
|
2021-11-05 15:09:42 +03:00
|
|
|
SCARDAPI_STUB_CALL_LONG(status, SCardWriteCacheA, hContext, CardIdentifier, FreshnessCounter,
|
|
|
|
LookupName, Data, DataLen);
|
2014-05-26 23:57:37 +04:00
|
|
|
|
2020-02-17 12:52:31 +03:00
|
|
|
WLog_Print(g_Log, g_LogLevel, "SCardWriteCacheA } status: %s (0x%08" PRIX32 ")",
|
2019-11-06 17:24:51 +03:00
|
|
|
SCardGetErrorString(status), status);
|
2014-05-27 01:54:39 +04:00
|
|
|
|
2014-05-26 23:57:37 +04:00
|
|
|
return status;
|
|
|
|
}
|
|
|
|
|
2019-11-20 13:07:42 +03:00
|
|
|
static LONG WINAPI Inspect_SCardWriteCacheW(SCARDCONTEXT hContext, UUID* CardIdentifier,
|
|
|
|
DWORD FreshnessCounter, LPWSTR LookupName, PBYTE Data,
|
|
|
|
DWORD DataLen)
|
2014-05-26 23:57:37 +04:00
|
|
|
{
|
|
|
|
LONG status;
|
|
|
|
|
2020-02-17 12:52:31 +03:00
|
|
|
WLog_Print(g_Log, g_LogLevel, "SCardWriteCacheW { hContext: %p", (void*)hContext);
|
2014-05-27 01:54:39 +04:00
|
|
|
|
2021-11-05 15:09:42 +03:00
|
|
|
SCARDAPI_STUB_CALL_LONG(status, SCardWriteCacheW, hContext, CardIdentifier, FreshnessCounter,
|
|
|
|
LookupName, Data, DataLen);
|
2014-05-26 23:57:37 +04:00
|
|
|
|
2020-02-17 12:52:31 +03:00
|
|
|
WLog_Print(g_Log, g_LogLevel, "SCardWriteCacheW } status: %s (0x%08" PRIX32 ")",
|
2019-11-06 17:24:51 +03:00
|
|
|
SCardGetErrorString(status), status);
|
2014-05-27 01:54:39 +04:00
|
|
|
|
2014-05-26 23:57:37 +04:00
|
|
|
return status;
|
|
|
|
}
|
|
|
|
|
2019-11-20 13:07:42 +03:00
|
|
|
static LONG WINAPI Inspect_SCardGetReaderIconA(SCARDCONTEXT hContext, LPCSTR szReaderName,
|
|
|
|
LPBYTE pbIcon, LPDWORD pcbIcon)
|
2014-05-26 23:57:37 +04:00
|
|
|
{
|
|
|
|
LONG status;
|
|
|
|
|
2020-02-17 12:52:31 +03:00
|
|
|
WLog_Print(g_Log, g_LogLevel, "SCardGetReaderIconA { hContext: %p", (void*)hContext);
|
2014-05-27 01:54:39 +04:00
|
|
|
|
2021-11-05 15:09:42 +03:00
|
|
|
SCARDAPI_STUB_CALL_LONG(status, SCardGetReaderIconA, hContext, szReaderName, pbIcon, pcbIcon);
|
2014-05-26 23:57:37 +04:00
|
|
|
|
2020-02-17 12:52:31 +03:00
|
|
|
WLog_Print(g_Log, g_LogLevel, "SCardGetReaderIconA } status: %s (0x%08" PRIX32 ")",
|
2019-11-06 17:24:51 +03:00
|
|
|
SCardGetErrorString(status), status);
|
2014-05-27 01:54:39 +04:00
|
|
|
|
2014-05-26 23:57:37 +04:00
|
|
|
return status;
|
|
|
|
}
|
|
|
|
|
2019-11-20 13:07:42 +03:00
|
|
|
static LONG WINAPI Inspect_SCardGetReaderIconW(SCARDCONTEXT hContext, LPCWSTR szReaderName,
|
|
|
|
LPBYTE pbIcon, LPDWORD pcbIcon)
|
2014-05-26 23:57:37 +04:00
|
|
|
{
|
|
|
|
LONG status;
|
|
|
|
|
2020-02-17 12:52:31 +03:00
|
|
|
WLog_Print(g_Log, g_LogLevel, "SCardGetReaderIconW { hContext: %p", (void*)hContext);
|
2014-05-27 01:54:39 +04:00
|
|
|
|
2021-11-05 15:09:42 +03:00
|
|
|
SCARDAPI_STUB_CALL_LONG(status, SCardGetReaderIconW, hContext, szReaderName, pbIcon, pcbIcon);
|
2014-05-26 23:57:37 +04:00
|
|
|
|
2020-02-17 12:52:31 +03:00
|
|
|
WLog_Print(g_Log, g_LogLevel, "SCardGetReaderIconW } status: %s (0x%08" PRIX32 ")",
|
2019-11-06 17:24:51 +03:00
|
|
|
SCardGetErrorString(status), status);
|
2014-05-27 01:54:39 +04:00
|
|
|
|
2014-05-26 23:57:37 +04:00
|
|
|
return status;
|
|
|
|
}
|
|
|
|
|
2019-11-20 13:07:42 +03:00
|
|
|
static LONG WINAPI Inspect_SCardGetDeviceTypeIdA(SCARDCONTEXT hContext, LPCSTR szReaderName,
|
|
|
|
LPDWORD pdwDeviceTypeId)
|
2014-05-26 23:57:37 +04:00
|
|
|
{
|
|
|
|
LONG status;
|
|
|
|
|
2020-02-17 12:52:31 +03:00
|
|
|
WLog_Print(g_Log, g_LogLevel, "SCardGetDeviceTypeIdA { hContext: %p", (void*)hContext);
|
2014-05-27 01:54:39 +04:00
|
|
|
|
2021-11-05 15:09:42 +03:00
|
|
|
SCARDAPI_STUB_CALL_LONG(status, SCardGetDeviceTypeIdA, hContext, szReaderName, pdwDeviceTypeId);
|
2014-05-26 23:57:37 +04:00
|
|
|
|
2020-02-17 12:52:31 +03:00
|
|
|
WLog_Print(g_Log, g_LogLevel, "SCardGetDeviceTypeIdA } status: %s (0x%08" PRIX32 ")",
|
2019-11-06 17:24:51 +03:00
|
|
|
SCardGetErrorString(status), status);
|
2014-05-27 01:54:39 +04:00
|
|
|
|
2014-05-26 23:57:37 +04:00
|
|
|
return status;
|
|
|
|
}
|
|
|
|
|
2019-11-20 13:07:42 +03:00
|
|
|
static LONG WINAPI Inspect_SCardGetDeviceTypeIdW(SCARDCONTEXT hContext, LPCWSTR szReaderName,
|
|
|
|
LPDWORD pdwDeviceTypeId)
|
2014-05-26 23:57:37 +04:00
|
|
|
{
|
|
|
|
LONG status;
|
|
|
|
|
2020-02-17 12:52:31 +03:00
|
|
|
WLog_Print(g_Log, g_LogLevel, "SCardGetDeviceTypeIdW { hContext: %p", (void*)hContext);
|
2014-05-27 01:54:39 +04:00
|
|
|
|
2021-11-05 15:09:42 +03:00
|
|
|
SCARDAPI_STUB_CALL_LONG(status, SCardGetDeviceTypeIdW, hContext, szReaderName, pdwDeviceTypeId);
|
2014-05-26 23:57:37 +04:00
|
|
|
|
2020-02-17 12:52:31 +03:00
|
|
|
WLog_Print(g_Log, g_LogLevel, "SCardGetDeviceTypeIdW } status: %s (0x%08" PRIX32 ")",
|
2019-11-06 17:24:51 +03:00
|
|
|
SCardGetErrorString(status), status);
|
2014-05-27 01:54:39 +04:00
|
|
|
|
2014-05-26 23:57:37 +04:00
|
|
|
return status;
|
|
|
|
}
|
|
|
|
|
2019-11-20 13:07:42 +03:00
|
|
|
static LONG WINAPI Inspect_SCardGetReaderDeviceInstanceIdA(SCARDCONTEXT hContext,
|
|
|
|
LPCSTR szReaderName,
|
|
|
|
LPSTR szDeviceInstanceId,
|
|
|
|
LPDWORD pcchDeviceInstanceId)
|
2014-05-26 23:57:37 +04:00
|
|
|
{
|
|
|
|
LONG status;
|
|
|
|
|
2020-02-17 12:52:31 +03:00
|
|
|
WLog_Print(g_Log, g_LogLevel, "SCardGetReaderDeviceInstanceIdA { hContext: %p",
|
2019-11-06 17:24:51 +03:00
|
|
|
(void*)hContext);
|
2014-05-27 01:54:39 +04:00
|
|
|
|
2021-11-05 15:09:42 +03:00
|
|
|
SCARDAPI_STUB_CALL_LONG(status, SCardGetReaderDeviceInstanceIdA, hContext, szReaderName,
|
|
|
|
szDeviceInstanceId, pcchDeviceInstanceId);
|
2014-05-26 23:57:37 +04:00
|
|
|
|
2020-02-17 12:52:31 +03:00
|
|
|
WLog_Print(g_Log, g_LogLevel, "SCardGetReaderDeviceInstanceIdA } status: %s (0x%08" PRIX32 ")",
|
2019-11-06 17:24:51 +03:00
|
|
|
SCardGetErrorString(status), status);
|
2014-05-27 01:54:39 +04:00
|
|
|
|
2014-05-26 23:57:37 +04:00
|
|
|
return status;
|
|
|
|
}
|
|
|
|
|
2019-11-20 13:07:42 +03:00
|
|
|
static LONG WINAPI Inspect_SCardGetReaderDeviceInstanceIdW(SCARDCONTEXT hContext,
|
|
|
|
LPCWSTR szReaderName,
|
|
|
|
LPWSTR szDeviceInstanceId,
|
|
|
|
LPDWORD pcchDeviceInstanceId)
|
2014-05-26 23:57:37 +04:00
|
|
|
{
|
|
|
|
LONG status;
|
|
|
|
|
2020-02-17 12:52:31 +03:00
|
|
|
WLog_Print(g_Log, g_LogLevel, "SCardGetReaderDeviceInstanceIdW { hContext: %p",
|
2019-11-06 17:24:51 +03:00
|
|
|
(void*)hContext);
|
2014-05-27 01:54:39 +04:00
|
|
|
|
2021-11-05 15:09:42 +03:00
|
|
|
SCARDAPI_STUB_CALL_LONG(status, SCardGetReaderDeviceInstanceIdW, hContext, szReaderName,
|
|
|
|
szDeviceInstanceId, pcchDeviceInstanceId);
|
2014-05-26 23:57:37 +04:00
|
|
|
|
2020-02-17 12:52:31 +03:00
|
|
|
WLog_Print(g_Log, g_LogLevel, "SCardGetReaderDeviceInstanceIdW } status: %s (0x%08" PRIX32 ")",
|
2019-11-06 17:24:51 +03:00
|
|
|
SCardGetErrorString(status), status);
|
2014-05-27 01:54:39 +04:00
|
|
|
|
2014-05-26 23:57:37 +04:00
|
|
|
return status;
|
|
|
|
}
|
|
|
|
|
2019-11-20 13:07:42 +03:00
|
|
|
static LONG WINAPI Inspect_SCardListReadersWithDeviceInstanceIdA(SCARDCONTEXT hContext,
|
|
|
|
LPCSTR szDeviceInstanceId,
|
|
|
|
LPSTR mszReaders,
|
|
|
|
LPDWORD pcchReaders)
|
2014-05-26 23:57:37 +04:00
|
|
|
{
|
|
|
|
LONG status;
|
|
|
|
|
2020-02-17 12:52:31 +03:00
|
|
|
WLog_Print(g_Log, g_LogLevel, "SCardListReadersWithDeviceInstanceIdA { hContext: %p",
|
2019-11-06 17:24:51 +03:00
|
|
|
(void*)hContext);
|
2014-05-27 01:54:39 +04:00
|
|
|
|
2021-11-05 15:09:42 +03:00
|
|
|
SCARDAPI_STUB_CALL_LONG(status, SCardListReadersWithDeviceInstanceIdA, hContext,
|
|
|
|
szDeviceInstanceId, mszReaders, pcchReaders);
|
2014-05-26 23:57:37 +04:00
|
|
|
|
2020-02-17 12:52:31 +03:00
|
|
|
WLog_Print(g_Log, g_LogLevel,
|
2019-11-06 17:24:51 +03:00
|
|
|
"SCardListReadersWithDeviceInstanceIdA } status: %s (0x%08" PRIX32 ")",
|
|
|
|
SCardGetErrorString(status), status);
|
2014-05-27 01:54:39 +04:00
|
|
|
|
2014-05-26 23:57:37 +04:00
|
|
|
return status;
|
|
|
|
}
|
|
|
|
|
2019-11-20 13:07:42 +03:00
|
|
|
static LONG WINAPI Inspect_SCardListReadersWithDeviceInstanceIdW(SCARDCONTEXT hContext,
|
|
|
|
LPCWSTR szDeviceInstanceId,
|
|
|
|
LPWSTR mszReaders,
|
|
|
|
LPDWORD pcchReaders)
|
2014-05-26 23:57:37 +04:00
|
|
|
{
|
|
|
|
LONG status;
|
|
|
|
|
2020-02-17 12:52:31 +03:00
|
|
|
WLog_Print(g_Log, g_LogLevel, "SCardListReadersWithDeviceInstanceIdW { hContext: %p",
|
2019-11-06 17:24:51 +03:00
|
|
|
(void*)hContext);
|
2014-05-27 01:54:39 +04:00
|
|
|
|
2021-11-05 15:09:42 +03:00
|
|
|
SCARDAPI_STUB_CALL_LONG(status, SCardListReadersWithDeviceInstanceIdW, hContext,
|
|
|
|
szDeviceInstanceId, mszReaders, pcchReaders);
|
2014-05-26 23:57:37 +04:00
|
|
|
|
2020-02-17 12:52:31 +03:00
|
|
|
WLog_Print(g_Log, g_LogLevel,
|
2019-11-06 17:24:51 +03:00
|
|
|
"SCardListReadersWithDeviceInstanceIdW } status: %s (0x%08" PRIX32 ")",
|
|
|
|
SCardGetErrorString(status), status);
|
2014-05-27 01:54:39 +04:00
|
|
|
|
2014-05-26 23:57:37 +04:00
|
|
|
return status;
|
|
|
|
}
|
|
|
|
|
2019-11-20 13:07:42 +03:00
|
|
|
static LONG WINAPI Inspect_SCardAudit(SCARDCONTEXT hContext, DWORD dwEvent)
|
2014-05-26 23:57:37 +04:00
|
|
|
{
|
|
|
|
LONG status;
|
|
|
|
|
2020-02-17 12:52:31 +03:00
|
|
|
WLog_Print(g_Log, g_LogLevel, "SCardAudit { hContext: %p", (void*)hContext);
|
2014-05-27 01:54:39 +04:00
|
|
|
|
2021-11-05 15:09:42 +03:00
|
|
|
SCARDAPI_STUB_CALL_LONG(status, SCardAudit, hContext, dwEvent);
|
2014-05-26 23:57:37 +04:00
|
|
|
|
2020-02-17 12:52:31 +03:00
|
|
|
WLog_Print(g_Log, g_LogLevel, "SCardAudit } status: %s (0x%08" PRIX32 ")",
|
2019-11-06 17:24:51 +03:00
|
|
|
SCardGetErrorString(status), status);
|
2014-05-27 01:54:39 +04:00
|
|
|
|
2014-05-26 23:57:37 +04:00
|
|
|
return status;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Extended API
|
|
|
|
*/
|
|
|
|
|
2020-02-17 12:52:31 +03:00
|
|
|
static const SCardApiFunctionTable Inspect_SCardApiFunctionTable = {
|
2014-05-26 23:57:37 +04:00
|
|
|
0, /* dwVersion */
|
|
|
|
0, /* dwFlags */
|
|
|
|
|
2019-11-06 17:24:51 +03:00
|
|
|
Inspect_SCardEstablishContext, /* SCardEstablishContext */
|
|
|
|
Inspect_SCardReleaseContext, /* SCardReleaseContext */
|
|
|
|
Inspect_SCardIsValidContext, /* SCardIsValidContext */
|
|
|
|
Inspect_SCardListReaderGroupsA, /* SCardListReaderGroupsA */
|
|
|
|
Inspect_SCardListReaderGroupsW, /* SCardListReaderGroupsW */
|
|
|
|
Inspect_SCardListReadersA, /* SCardListReadersA */
|
|
|
|
Inspect_SCardListReadersW, /* SCardListReadersW */
|
|
|
|
Inspect_SCardListCardsA, /* SCardListCardsA */
|
|
|
|
Inspect_SCardListCardsW, /* SCardListCardsW */
|
|
|
|
Inspect_SCardListInterfacesA, /* SCardListInterfacesA */
|
|
|
|
Inspect_SCardListInterfacesW, /* SCardListInterfacesW */
|
|
|
|
Inspect_SCardGetProviderIdA, /* SCardGetProviderIdA */
|
|
|
|
Inspect_SCardGetProviderIdW, /* SCardGetProviderIdW */
|
|
|
|
Inspect_SCardGetCardTypeProviderNameA, /* SCardGetCardTypeProviderNameA */
|
|
|
|
Inspect_SCardGetCardTypeProviderNameW, /* SCardGetCardTypeProviderNameW */
|
|
|
|
Inspect_SCardIntroduceReaderGroupA, /* SCardIntroduceReaderGroupA */
|
|
|
|
Inspect_SCardIntroduceReaderGroupW, /* SCardIntroduceReaderGroupW */
|
|
|
|
Inspect_SCardForgetReaderGroupA, /* SCardForgetReaderGroupA */
|
|
|
|
Inspect_SCardForgetReaderGroupW, /* SCardForgetReaderGroupW */
|
|
|
|
Inspect_SCardIntroduceReaderA, /* SCardIntroduceReaderA */
|
|
|
|
Inspect_SCardIntroduceReaderW, /* SCardIntroduceReaderW */
|
|
|
|
Inspect_SCardForgetReaderA, /* SCardForgetReaderA */
|
|
|
|
Inspect_SCardForgetReaderW, /* SCardForgetReaderW */
|
|
|
|
Inspect_SCardAddReaderToGroupA, /* SCardAddReaderToGroupA */
|
|
|
|
Inspect_SCardAddReaderToGroupW, /* SCardAddReaderToGroupW */
|
|
|
|
Inspect_SCardRemoveReaderFromGroupA, /* SCardRemoveReaderFromGroupA */
|
|
|
|
Inspect_SCardRemoveReaderFromGroupW, /* SCardRemoveReaderFromGroupW */
|
|
|
|
Inspect_SCardIntroduceCardTypeA, /* SCardIntroduceCardTypeA */
|
|
|
|
Inspect_SCardIntroduceCardTypeW, /* SCardIntroduceCardTypeW */
|
|
|
|
Inspect_SCardSetCardTypeProviderNameA, /* SCardSetCardTypeProviderNameA */
|
|
|
|
Inspect_SCardSetCardTypeProviderNameW, /* SCardSetCardTypeProviderNameW */
|
|
|
|
Inspect_SCardForgetCardTypeA, /* SCardForgetCardTypeA */
|
|
|
|
Inspect_SCardForgetCardTypeW, /* SCardForgetCardTypeW */
|
|
|
|
Inspect_SCardFreeMemory, /* SCardFreeMemory */
|
|
|
|
Inspect_SCardAccessStartedEvent, /* SCardAccessStartedEvent */
|
|
|
|
Inspect_SCardReleaseStartedEvent, /* SCardReleaseStartedEvent */
|
|
|
|
Inspect_SCardLocateCardsA, /* SCardLocateCardsA */
|
|
|
|
Inspect_SCardLocateCardsW, /* SCardLocateCardsW */
|
|
|
|
Inspect_SCardLocateCardsByATRA, /* SCardLocateCardsByATRA */
|
|
|
|
Inspect_SCardLocateCardsByATRW, /* SCardLocateCardsByATRW */
|
|
|
|
Inspect_SCardGetStatusChangeA, /* SCardGetStatusChangeA */
|
|
|
|
Inspect_SCardGetStatusChangeW, /* SCardGetStatusChangeW */
|
|
|
|
Inspect_SCardCancel, /* SCardCancel */
|
|
|
|
Inspect_SCardConnectA, /* SCardConnectA */
|
|
|
|
Inspect_SCardConnectW, /* SCardConnectW */
|
|
|
|
Inspect_SCardReconnect, /* SCardReconnect */
|
|
|
|
Inspect_SCardDisconnect, /* SCardDisconnect */
|
|
|
|
Inspect_SCardBeginTransaction, /* SCardBeginTransaction */
|
|
|
|
Inspect_SCardEndTransaction, /* SCardEndTransaction */
|
|
|
|
Inspect_SCardCancelTransaction, /* SCardCancelTransaction */
|
|
|
|
Inspect_SCardState, /* SCardState */
|
|
|
|
Inspect_SCardStatusA, /* SCardStatusA */
|
|
|
|
Inspect_SCardStatusW, /* SCardStatusW */
|
|
|
|
Inspect_SCardTransmit, /* SCardTransmit */
|
|
|
|
Inspect_SCardGetTransmitCount, /* SCardGetTransmitCount */
|
|
|
|
Inspect_SCardControl, /* SCardControl */
|
|
|
|
Inspect_SCardGetAttrib, /* SCardGetAttrib */
|
|
|
|
Inspect_SCardSetAttrib, /* SCardSetAttrib */
|
|
|
|
Inspect_SCardUIDlgSelectCardA, /* SCardUIDlgSelectCardA */
|
|
|
|
Inspect_SCardUIDlgSelectCardW, /* SCardUIDlgSelectCardW */
|
|
|
|
Inspect_GetOpenCardNameA, /* GetOpenCardNameA */
|
|
|
|
Inspect_GetOpenCardNameW, /* GetOpenCardNameW */
|
|
|
|
Inspect_SCardDlgExtendedError, /* SCardDlgExtendedError */
|
|
|
|
Inspect_SCardReadCacheA, /* SCardReadCacheA */
|
|
|
|
Inspect_SCardReadCacheW, /* SCardReadCacheW */
|
|
|
|
Inspect_SCardWriteCacheA, /* SCardWriteCacheA */
|
|
|
|
Inspect_SCardWriteCacheW, /* SCardWriteCacheW */
|
|
|
|
Inspect_SCardGetReaderIconA, /* SCardGetReaderIconA */
|
|
|
|
Inspect_SCardGetReaderIconW, /* SCardGetReaderIconW */
|
|
|
|
Inspect_SCardGetDeviceTypeIdA, /* SCardGetDeviceTypeIdA */
|
|
|
|
Inspect_SCardGetDeviceTypeIdW, /* SCardGetDeviceTypeIdW */
|
|
|
|
Inspect_SCardGetReaderDeviceInstanceIdA, /* SCardGetReaderDeviceInstanceIdA */
|
|
|
|
Inspect_SCardGetReaderDeviceInstanceIdW, /* SCardGetReaderDeviceInstanceIdW */
|
2014-05-26 23:57:37 +04:00
|
|
|
Inspect_SCardListReadersWithDeviceInstanceIdA, /* SCardListReadersWithDeviceInstanceIdA */
|
|
|
|
Inspect_SCardListReadersWithDeviceInstanceIdW, /* SCardListReadersWithDeviceInstanceIdW */
|
2019-11-06 17:24:51 +03:00
|
|
|
Inspect_SCardAudit /* SCardAudit */
|
2014-05-26 23:57:37 +04:00
|
|
|
};
|
|
|
|
|
2019-11-20 13:30:14 +03:00
|
|
|
static void Inspect_InitLog(void)
|
2014-05-27 01:54:39 +04:00
|
|
|
{
|
|
|
|
if (g_Log)
|
|
|
|
return;
|
|
|
|
|
2015-05-05 20:45:34 +03:00
|
|
|
if (!(g_Log = WLog_Get("WinSCard")))
|
|
|
|
return;
|
2014-05-27 01:54:39 +04:00
|
|
|
}
|
|
|
|
|
2020-02-17 12:52:31 +03:00
|
|
|
const SCardApiFunctionTable* Inspect_RegisterSCardApi(const SCardApiFunctionTable* pSCardApi)
|
2014-05-26 23:57:37 +04:00
|
|
|
{
|
|
|
|
g_SCardApi = pSCardApi;
|
2014-05-27 01:54:39 +04:00
|
|
|
|
|
|
|
Inspect_InitLog();
|
|
|
|
|
2014-05-26 23:57:37 +04:00
|
|
|
return &Inspect_SCardApiFunctionTable;
|
|
|
|
}
|