StorageAdapterGetDataFormat function

Called by the Windows Biometric Framework to retrieve format and version information used by the current database associated with the pipeline.

Syntax


HRESULT WINAPI StorageAdapterGetDataFormat(
  _Inout_ PWINBIO_PIPELINE Pipeline,
  _Out_   PWINBIO_UUID     Format,
  _Out_   PWINBIO_VERSION  Version
);

Parameters

Pipeline [in, out]

Pointer to a WINBIO_PIPELINE structure associated with the biometric unit performing the operation.

Format [out]

Pointer to a variable that receives a GUID that uniquely identifies the data format used by this storage adapter when it stores templates in the database.

Version [out]

Pointer to a WINBIO_VERSION structure that receives the version number of the storage adapter component.

Return value

If the function succeeds, it returns S_OK. If the function fails, it must return one of the following HRESULT values to indicate the error.

Return codeDescription
E_POINTER

A mandatory pointer argument is NULL.

WINBIO_E_INVALID_DEVICE_STATE

The StorageContext member of the pipeline object is NULL.

 

Examples

The following pseudocode shows one possible implementation of this function. The example does not compile. You must adapt it to suit your purpose.


/////////////////////////////////////////////////////////////////////////////////////////
//
// StorageAdapterGetDataFormat
//
// Purpose:
//      Retrieves format and version information used by the current database 
//      associated with the pipeline.
//
// Parameters:
//      Pipeline - Pointer to a WINBIO_PIPELINE structure associated with 
//                 the biometric unit performing the operation.
//      Format   - Pointer to a variable that receives a GUID that uniquely 
//                 identifies the data format used by this storage adapter when 
//                 it stores templates 
//      Version  - Pointer to a WINBIO_VERSION structure that receives the 
//                 version number of the storage adapter component.
//
static HRESULT
WINAPI
StorageAdapterGetDataFormat(
    __inout PWINBIO_PIPELINE Pipeline,
    __out PWINBIO_UUID Format,
    __out PWINBIO_VERSION Version
    )
{
    HRESULT hr = S_OK;

    // Verify that pointer arguments are not NULL.
    if (!ARGUMENT_PRESENT(Pipeline) ||
        !ARGUMENT_PRESENT(Format) ||
        !ARGUMENT_PRESENT(Version)))
    {
        hr = E_POINTER;
        goto cleanup;
    }

    // Retrieve the context from the pipeline.
    PWINBIO_STORAGE_CONTEXT storageContext = 
           (PWINBIO_STORAGE_CONTEXT)Pipeline->StorageContext;

    // Verify the pipeline state.
    if (storageContext == NULL ||
        Pipeline->StorageHandle == INVALID_HANDLE_VALUE)
    {
        hr = WINBIO_E_INVALID_DEVICE_STATE;
        goto cleanup;
    }

    // Retrieve the format and version information that were stored in the
    // context when the database was opened.
    CopyMemory( 
        Format, 
        &storageContext->TemplateFormat, 
        sizeof(WINBIO_UUID)
        );

    *Version = storageContext->Version;

cleanup:

    return hr;
}


Requirements

Minimum supported client

Windows 7 [desktop apps only]

Minimum supported server

Windows Server 2008 R2 [desktop apps only]

Header

Winbio_adapter.h (include Winbio_adapter.h)

See also

Plug-in Functions

 

 

Show: