共用方式為


WinBioFree 函式(winbio.h)

釋放先前呼叫 Windows 生物特徵框架 API 函式所分配給用戶端應用程式的記憶體。 從 Windows 10 版本 1607 開始,此功能可用於行動映像檔。

語法

HRESULT WinBioFree(
  [in] PVOID Address
);

參數

[in] Address

要刪除的記憶體區塊位址。

返回值

如果函式成功,則會傳回S_OK。 如果函式失敗,它會傳回指出錯誤的 HRESULT 值。 可能的值包括但不限於下表中的值。 如需常見錯誤碼的清單,請參閱 常見的 HRESULT 值

回傳碼 Description
E_POINTER
位址參數不能是 NULL。

備註

Windows 生物特徵框架 API 中的多個函式會分配用戶端應用程式的記憶體,並將該記憶體的位址傳遞給用戶端。 為防止記憶體洩漏,使用完區塊內資訊後,必須呼叫 WinBioFree 刪除該區塊。 你要把記憶體的位址傳給 WinBioFree。 你可以透過在以下每個函式中,解除參考對應參數指定的指標來找到地址。

功能 參數 分配的區塊類型
WinBioCapture範例 範例 結構
WinBioEnumBiometricUnits 單元結構陣列 結構陣列
WinBioEnumDatabases StorageSchemaArray 結構陣列
WinBioEnumenrollments 子因子陣列 一連串整數
WinBioEnumServiceProviders BspSchemaArray 結構陣列
回電事件 Event 結構
CaptureCallback 範例 結構
 

範例

以下函式呼叫 WinBioEnumBiometricUnits 來枚舉已安裝的生物特徵感測器,並呼叫 WinBioFree ,釋放由 WinBioEnumBiometricUnits 產生的記憶體。 連結至 Winbio.lib 靜態程式庫,並包含下列標頭檔:

  • Windows.h
  • 標準.h
  • Conio.h
  • Winbio.h
HRESULT EnumerateSensors( )
{
    HRESULT hr = S_OK;
    PWINBIO_UNIT_SCHEMA unitSchema = NULL;
    SIZE_T unitCount = 0;

    // Enumerate the installed biometric units.
    hr = WinBioEnumBiometricUnits( 
            WINBIO_TYPE_FINGERPRINT,        // Type of biometric unit
            &unitSchema,                    // Array of unit schemas
            &unitCount );                   // Count of unit schemas

    if (FAILED(hr))
    {
        wprintf_s(L"\nWinBioEnumBiometricUnits failed. hr = 0x%x\n", hr);
        goto e_Exit;
    }

e_Exit:

    // Free memory.
    if (unitSchema != NULL)
    {
        WinBioFree(unitSchema);
        unitSchema = NULL;
    }

    return hr;
}


需求

Requirement 價值觀
最低支援的用戶端 Windows 7 [僅限桌面應用程式]
支援的最低伺服器 Windows Server 2008 R2 [僅限傳統型應用程式]
目標平臺 窗戶
Header winbio.h(包括Winbio.h)
Library Winbio.lib 網站
DLL Winbio.dll

另請參閱

WinBioCapture範例

WinBioEnumBiometricUnits

WinBioEnumDatabases

WinBioEnumenrollments

WinBioEnumServiceProviders