如何使用 winapi (winscard.h) 区分智能卡读取器和指纹读取器

问题描述 投票:0回答:0

为了在我的电脑上检索读者,我应该使用:

SCARDCONTEXT SCardContext;
if (SCardEstablishContext(SCARD_SCOPE_USER, NULL, NULL, &SCardContext)) {
  char ReaderNames[1000];
  DWORD Length = 1000;
  if(Status = SCardListReaders(SCardContext, NULL, ReaderNames, &Length)) {
    SCARD_READERSTATE ReaderStates[PCSC_READER_MAX_COUNT];
    DWORD ReaderCount = 0;
    // Place the readers into the state array.
    LPSTR Rdr = ReaderNames;
    for (DWORD dwI = 0; dwI < MAXIMUM_SMARTCARD_READERS; dwI++ )
    {
      if (0 == *Rdr)
        break;
      ReaderStates[dwI].szReader = Rdr;
      ReaderStates[dwI].dwCurrentState = SCARD_STATE_UNAWARE;
      Rdr += lstrlen(szRdr) + 1;
    }
    ReaderCount = dwI;

    // Do something with the readers;
  }
  SCardReleaseContext(SCardContext);
}

我如何识别哪个读卡器实际上是读卡器,哪个是指纹识别器或面部识别器?

我使用的是Windows Hello Fingerprint reader,在上面的代码中显示为智能卡读卡器。我试图用

SCardGetStatusChangeA()
获取每个读者的状态。指纹读取器返回
0x422
,表示
SCARD_STATE_UNPOWERED | SCARD_STATE_PRESENT | SCARD_STATE_CHANGED
.

指纹读取器如何返回

SCARD_STATE_PRESENT

c winapi smartcard fingerprint reader
© www.soinside.com 2019 - 2024. All rights reserved.