Export (0) Print
Expand All

WinBioGetEnabledSetting function

Retrieves a value that specifies whether the Windows Biometric Framework is currently enabled.

Syntax


HRESULT WINAPI WinBioGetEnabledSetting(
  _Out_  BOOLEAN *Value,
  _Out_  PWINBIO_SETTING_SOURCE_TYPE Source
);

Parameters

Value [out]

Pointer to a Boolean value that specifies whether the Windows Biometric Framework is currently enabled.

Source [out]

Pointer to a WINBIO_SETTING_SOURCE_TYPE value that specifics the setting source. This can be one of the following values:

ValueMeaning
WINBIO_SETTING_SOURCE_INVALID

The setting is not valid.

WINBIO_SETTING_SOURCE_DEFAULT

The setting originated from built-in policy.

WINBIO_SETTING_SOURCE_LOCAL

The setting originated in the local computer registry.

WINBIO_SETTING_SOURCE_POLICY

The setting was created by Group Policy.

 

Return value

If the function succeeds, it returns S_OK. If the function fails, it returns an HRESULT value that indicates the error. For a list of common error codes, see Common HRESULT Values.

Examples

The following function calls WinBioGetEnabledSetting to determine whether the Windows Biometric Framework is enabled. Link to the Winbio.lib static library and include the following header files:

  • Windows.h
  • Stdio.h
  • Conio.h
  • Winbio.h

HRESULT TestGetEnabledSetting()
{
    HRESULT hr = S_OK;
    BOOLEAN value = FALSE;
    WINBIO_SETTING_SOURCE_TYPE source = WINBIO_SETTING_SOURCE_INVALID;

    // Call WinBioGetEnabledSetting.
    wprintf_s(L"\n Calling WinBioGetEnabledSetting ");
    WinBioGetEnabledSetting( 
        &value,     // Whether biometric domain logons are enabled 
        &source     // The source of the setting 
        );

    // Print any errors.
    if (source == WINBIO_SETTING_SOURCE_INVALID)
    {
        wprintf_s(L"\n WinBioGetEnabledSetting returned ");
        wprintf_s(L"WINBIO_SETTING_SOURCE_INVALID.");
        hr = E_FAIL;
        goto e_Exit;
    }
    else if 
    (
        source != WINBIO_SETTING_SOURCE_INVALID 
        && 
        source != WINBIO_SETTING_SOURCE_DEFAULT
        && 
        source != WINBIO_SETTING_SOURCE_POLICY
        && 
        source != WINBIO_SETTING_SOURCE_LOCAL
    )
    {
        wprintf_s(L"\n WinBioGetEnabledSetting returned garbage.");
        hr = E_FAIL;
        goto e_Exit;
    }

    // Print the value and source output parameters.
    else
    {
        wprintf_s(L"\n Value: %s, Source: ", value ? L"TRUE" : L"FALSE");

        switch(source)
        {
            case WINBIO_SETTING_SOURCE_INVALID:
                wprintf_s(L"WINBIO_SETTING_SOURCE_INVALID\n");
                break;
            case WINBIO_SETTING_SOURCE_DEFAULT:
                wprintf_s(L"WINBIO_SETTING_SOURCE_DEFAULT\n");
                break;
            case WINBIO_SETTING_SOURCE_POLICY:
                wprintf_s(L"WINBIO_SETTING_SOURCE_POLICY\n");
                break;
            case WINBIO_SETTING_SOURCE_LOCAL:
                wprintf_s(L"WINBIO_SETTING_SOURCE_LOCAL\n");
                break;
            default:
                wprintf_s(L"[unrecognized source!]\n");
                break;
        }
    }

e_Exit:

    wprintf_s(L"\n Press any key to exit...");
    _getch();

    return hr;
}



Requirements

Minimum supported client

Windows 7 [desktop apps only]

Minimum supported server

Windows Server 2008 R2 [desktop apps only]

Header

Winbio.h (include Winbio.h)

Library

Winbio.lib

DLL

Winbio.dll

See also

Client Application Functions

 

 

Community Additions

ADD
Show:
© 2014 Microsoft