예제 #1
0
BioAPI_RETURN BioAPI mdsutil_GetModuleCredentialInfo(const BioAPI_UUID *uuid,
													CSSM_DATA_PTR Credential,
													CSSM_DATA_PTR ModuleName,
													CSSM_DATA_PTR ModulePath)
{
	char UuidStr[BioAPI_PRINTABLE_UUID_LENGTH];

	/*
	 * Convert the Uuid to a string.
	 */
	BioAPI_GetPrintableUUID(uuid, UuidStr);

	if (mdsutil_GetHLayerCredentialInfo(UuidStr,
										 Credential,
										 ModuleName,
										 ModulePath) == BioAPI_OK)
	{
		return (BioAPI_OK);
	}

	return (mdsutil_GetBspCredentialInfo(UuidStr,
										 Credential,
										 ModuleName,
										 ModulePath));
}
예제 #2
0
파일: bsp_schema.c 프로젝트: ozgend/hive
static BioAPI_RETURN BioAPI ConstructBioAPIBspCapabiltiesAttributes(
							MDSU_CONTEXT *pContext,
							const void *pSchemaData,
							CSSM_DB_RECORD_ATTRIBUTE_DATA *DbRecord,
							CSSM_BOOL bFillValues,
							void **ppAttrState )
{
	CSSM_RETURN rv = CSSM_OK;
	const BioAPI_BSP_SCHEMA *pBioAPIBspCap =
							(const BioAPI_BSP_SCHEMA*)pSchemaData;
	BIOAPI_BSP_ATTR_STATE *pState = NULL;
	CSSM_DB_ATTRIBUTE_DATA *DbRecordAttributes;
	uint32 i;

	assert( pContext && DbRecord && ppAttrState );
	assert( ( bFillValues == CSSM_FALSE ) ||
			( ( bFillValues == CSSM_TRUE ) && pSchemaData ) );

	/* Allocate the memory for the attributes */
	pState = MDSU_malloc( pContext, sizeof(BIOAPI_BSP_ATTR_STATE) );
	if ( pState == NULL )
	{
		ERR( rv = BioAPIERR_H_FRAMEWORK_MEMORY_ERROR );
	}
	else
	{
		/* Clear the structure */
		memset( pState, 0, sizeof(BIOAPI_BSP_ATTR_STATE) );
		DbRecordAttributes = pState->DbRecordAttributes;

		/* Fill in the record information */
		DbRecord->DataRecordType = BIOAPI_BSP_RECORDTYPE;
		DbRecord->SemanticInformation = 0;
		DbRecord->NumberOfAttributes = BIOAPI_BSP_NUM_ATTRIBUTES;
		DbRecord->AttributeData = DbRecordAttributes;

		/* Fill in attribute info */
		DbRecordAttributes[__ModuleId].Info = s_BioApiAttrInfo_ModuleId;
		DbRecordAttributes[__DeviceId].Info = s_BioApiAttrInfo_DeviceId;
		DbRecordAttributes[__BspName].Info = s_BioApiAttrInfo_BspName;
		DbRecordAttributes[__SpecVersion].Info = s_BioApiAttrInfo_SpecVersion;
		DbRecordAttributes[__ProductVersion].Info = s_BioApiAttrInfo_ProductVersion;
		DbRecordAttributes[__Vendor].Info = s_BioApiAttrInfo_Vendor;
		DbRecordAttributes[__BspSupportedFormats].Info = s_BioApiAttrInfo_BspSupportedFormats;
		DbRecordAttributes[__FactorsMask].Info = s_BioApiAttrInfo_FactorsMask;
		DbRecordAttributes[__Operations].Info = s_BioApiAttrInfo_Operations;
		DbRecordAttributes[__Options].Info = s_BioApiAttrInfo_Options;
		DbRecordAttributes[__PayloadPolicy].Info = s_BioApiAttrInfo_PayloadPolicy;
		DbRecordAttributes[__MaxPayloadSize].Info = s_BioApiAttrInfo_MaxPayloadSize;
		DbRecordAttributes[__DefaultVerifyTimeout].Info = s_BioApiAttrInfo_DefaultVerifyTimeout;
		DbRecordAttributes[__DefaultIdentifyTimeout].Info = s_BioApiAttrInfo_DefaultIdentifyTimeout;
		DbRecordAttributes[__DefaultCaptureTimeout].Info = s_BioApiAttrInfo_DefaultCaptureTimeout;
		DbRecordAttributes[__DefaultEnrollTimeout].Info = s_BioApiAttrInfo_DefaultEnrollTimeout;
		DbRecordAttributes[__MaxBspDbSize].Info = s_BioApiAttrInfo_MaxBspDbSize;
		DbRecordAttributes[__MaxIdentify].Info = s_BioApiAttrInfo_MaxIdentify;
		DbRecordAttributes[__Description].Info = s_BioApiAttrInfo_Description;
		DbRecordAttributes[__Path].Info = s_BioApiAttrInfo_Path;
		if ( bFillValues == CSSM_TRUE )
		{
			/* Connect the attribute value array to the attribute array */
			for ( i = 0; i < DbRecord->NumberOfAttributes; i++ )
			{
				DbRecordAttributes[i].Value = &pState->AttributeValues[i];
				DbRecordAttributes[i].NumberOfValues = 1;
			}

			/* Fill in the record contents */
			/* ModuleId */
			BioAPI_GetPrintableUUID( &pBioAPIBspCap->ModuleId,
									(char*)pState->PrintableUuid );
			DbRecordAttributes[__ModuleId].Value->Data =
													pState->PrintableUuid;
			DbRecordAttributes[__ModuleId].Value->Length =
								strlen( (char*)pState->PrintableUuid ) + 1;

			/* DeviceId */
			DbRecordAttributes[__DeviceId].Value->Length = sizeof(uint32);
			DbRecordAttributes[__DeviceId].Value->Data = (uint8*)&pBioAPIBspCap->DeviceId;

			/* BspName */
			DbRecordAttributes[__BspName].Value->Length =
										strlen( pBioAPIBspCap->BSPName ) + 1 ;
			DbRecordAttributes[__BspName].Value->Data =
												(uint8*)pBioAPIBspCap->BSPName;

			/* SpecVersion */
			BioAPI_GetPrintableVersion( &pBioAPIBspCap->SpecVersion,
									   (char*)pState->PrintableSpecVersion );
			DbRecordAttributes[__SpecVersion].Value->Data =
													pState->PrintableSpecVersion;
			DbRecordAttributes[__SpecVersion].Value->Length =
								strlen( (char*)pState->PrintableSpecVersion ) + 1;

			/* ProductVersion */
			BioAPI_GetPrintableVersion( &pBioAPIBspCap->ProductVersion,
									   (char*)pState->PrintableProductVersion );
			DbRecordAttributes[__ProductVersion].Value->Data =
													pState->PrintableProductVersion;
			DbRecordAttributes[__ProductVersion].Value->Length =
								strlen( (char*)pState->PrintableProductVersion ) + 1;

			/* Vendor */
			DbRecordAttributes[__Vendor].Value->Length =
										strlen( pBioAPIBspCap->Vendor ) + 1 ;
			DbRecordAttributes[__Vendor].Value->Data =
												(uint8*)pBioAPIBspCap->Vendor;

			/* SupportedFormats */
			DbRecordAttributes[__BspSupportedFormats].Value->Length =
											sizeof(uint32) * pBioAPIBspCap->NumSupportedFormats;
			DbRecordAttributes[__BspSupportedFormats].Value->Data = (uint8*)&pBioAPIBspCap->BspSupportedFormats;

			/* FactorsMask */
			DbRecordAttributes[__FactorsMask].Value->Length = sizeof(uint32);
			DbRecordAttributes[__FactorsMask].Value->Data = (uint8*)&pBioAPIBspCap->FactorsMask;

			/* Operations */
			DbRecordAttributes[__Operations].Value->Length = sizeof(uint32);
			DbRecordAttributes[__Operations].Value->Data = (uint8*)&pBioAPIBspCap->Operations;

			/* Options */
			DbRecordAttributes[__Options].Value->Length = sizeof(uint32);
			DbRecordAttributes[__Options].Value->Data = (uint8*)&pBioAPIBspCap->Options;

			/* PayLoadPolicy */
			DbRecordAttributes[__PayloadPolicy].Value->Length = sizeof(uint32);
			DbRecordAttributes[__PayloadPolicy].Value->Data = (uint8*)&pBioAPIBspCap->PayloadPolicy;

			/* MaxPayloadSize */
			DbRecordAttributes[__MaxPayloadSize].Value->Length = sizeof(uint32);
			DbRecordAttributes[__MaxPayloadSize].Value->Data = (uint8*)&pBioAPIBspCap->MaxPayloadSize;

			/* DefaultVerifyTimeout */
			DbRecordAttributes[__DefaultVerifyTimeout].Value->Length = sizeof(sint32);
			DbRecordAttributes[__DefaultVerifyTimeout].Value->Data = (uint8*)&pBioAPIBspCap->DefaultVerifyTimeout;

			/* DefaultIdentifyTimeout */
			DbRecordAttributes[__DefaultIdentifyTimeout].Value->Length = sizeof(sint32);
			DbRecordAttributes[__DefaultIdentifyTimeout].Value->Data = (uint8*)&pBioAPIBspCap->DefaultIdentifyTimeout;

			/* DefaultCaptureTimeout */
			DbRecordAttributes[__DefaultCaptureTimeout].Value->Length = sizeof(sint32);
			DbRecordAttributes[__DefaultCaptureTimeout].Value->Data = (uint8*)&pBioAPIBspCap->DefaultCaptureTimeout;

			/* DefaultEnrollTimeout */
			DbRecordAttributes[__DefaultEnrollTimeout].Value->Length = sizeof(sint32);
			DbRecordAttributes[__DefaultEnrollTimeout].Value->Data = (uint8*)&pBioAPIBspCap->DefaultEnrollTimeout;

			/* MaxBspDbSize */
			DbRecordAttributes[__MaxBspDbSize].Value->Length = sizeof(uint32);
			DbRecordAttributes[__MaxBspDbSize].Value->Data = (uint8*)&pBioAPIBspCap->MaxBspDbSize;

			/* Max Identify */
			DbRecordAttributes[__MaxIdentify].Value->Length = sizeof(uint32);
			DbRecordAttributes[__MaxIdentify].Value->Data = (uint8*)&pBioAPIBspCap->MaxIdentify;

			/* Description */
			DbRecordAttributes[__Description].Value->Length =
										strlen( pBioAPIBspCap->Description ) + 1 ;
			DbRecordAttributes[__Description].Value->Data =
												(uint8*)pBioAPIBspCap->Description;

			/* Path */
			DbRecordAttributes[__Path].Value->Length =
										strlen( pBioAPIBspCap->Path ) + 1 ;
			DbRecordAttributes[__Path].Value->Data =
												(uint8*)pBioAPIBspCap->Path;

		} /* bFillValues */
		else
		{
			for ( i = 0; i < DbRecord->NumberOfAttributes; i++ )
			{
				DbRecordAttributes[i].Value = NULL;
				DbRecordAttributes[i].NumberOfValues = 0;
			}
		}

		if ( rv != CSSM_OK )
		{
			/* Deallocate memory if there was an error */
			MDSU_free( pContext,
					   pState );
			pState = NULL;
		}
	} /* allocate DbRecordAttributes */

	*ppAttrState = (void*)pState;

	return rv;
}
예제 #3
0
BioAPI_RETURN BioAPI mdsutil_DeleteRecordByUuid(CSSM_DL_DB_HANDLE hDLDB,
											   const BioAPI_UUID *uuid,
											   CSSM_DB_RECORDTYPE RecordType)
{
	CSSM_QUERY Query;
	CSSM_SELECTION_PREDICATE Predicate;
	CSSM_DB_UNIQUE_RECORD_PTR RecordId = NULL;
	BioAPI_RETURN retValue = CSSM_OK;
	CSSM_HANDLE ResultsHandle = 0;
	char UuidStr[BioAPI_PRINTABLE_UUID_LENGTH];

	memset (&Query, 0, sizeof (CSSM_QUERY));
	memset (&Predicate, 0, sizeof (CSSM_SELECTION_PREDICATE));
	Query.RecordType = RecordType;
	Query.Conjunctive = CSSM_DB_NONE;
	Query.NumSelectionPredicates = 1;
	Query.SelectionPredicate = &Predicate;
	Query.QueryLimits.TimeLimit = CSSM_QUERY_TIMELIMIT_NONE;
	Query.QueryLimits.SizeLimit = CSSM_QUERY_SIZELIMIT_NONE;
	Query.QueryFlags = 0;

	Predicate.DbOperator = CSSM_DB_EQUAL;

	/*
	 * Convert the Uuid to a string.
	 */
	BioAPI_GetPrintableUUID (uuid, UuidStr);

	Predicate.Attribute.Info = s_BioApiAttrInfo_ModuleId;
	Predicate.Attribute.Value = (CSSM_DATA *) BioAPI_malloc(sizeof (CSSM_DATA), 0);
	if (Predicate.Attribute.Value == NULL)
		return (CSSM_ERRCODE_MEMORY_ERROR);
	Predicate.Attribute.NumberOfValues = 1;
	Predicate.Attribute.Value->Data = (unsigned char *)UuidStr;
	Predicate.Attribute.Value->Length = (uint32)strlen (UuidStr) + 1;

	if( !IsBadCodePtr((CSSM_PROC_ADDR)MDSFuncs.DataGetFirst))
		retValue = MDSFuncs.DataGetFirst(hDLDB, /* DLDBHandle */
											 &Query,
											 &ResultsHandle,
											 NULL,
											 NULL,
											 &RecordId);

	while (CSSM_OK == retValue)
	{
		if( !IsBadCodePtr((CSSM_PROC_ADDR)MDSFuncs.DataDelete))
			retValue = MDSFuncs.DataDelete(hDLDB, RecordId);

		if( !IsBadCodePtr((CSSM_PROC_ADDR)MDSFuncs.FreeUniqueRecord))
			MDSFuncs.FreeUniqueRecord(hDLDB, RecordId);

		if( !IsBadCodePtr((CSSM_PROC_ADDR)MDSFuncs.DataGetNext))
			retValue = MDSFuncs.DataGetNext(hDLDB, /* DLDBHandle */
											ResultsHandle,
											NULL,
											NULL,
											&RecordId);
	}

	if (CSSMERR_DL_ENDOFDATA == retValue)
	{
		retValue = CSSM_OK;
	}

	MDSFuncs.DataAbortQuery( hDLDB, ResultsHandle );
	BioAPI_free(Predicate.Attribute.Value, NULL);
	return (retValue);
}
예제 #4
0
파일: bsp_schema.c 프로젝트: ozgend/hive
static BioAPI_RETURN BioAPI ConstructBioAPIBspCapabiltiesPredicate(
							MDSU_CONTEXT *pContext,
							const void *pSchemaTemplate,
							MDSU_TEMPLATE_MASK ValidTemplates,
							CSSM_QUERY *pQuery,
							void **ppPredState )
{
	CSSM_RETURN rv = CSSM_OK;
	const BioAPI_BSP_SCHEMA *pBioAPIBspCap =
							(const BioAPI_BSP_SCHEMA*)pSchemaTemplate;
	BIOAPI_BSP_PRED_STATE *pState = NULL;
	CSSM_SELECTION_PREDICATE *pPredicates = NULL;
	uint32 uNumPredicates;
	uint32 uIndex = 0;
	uint32 i;

	assert( pContext &&
			pQuery &&
			ppPredState &&
			( ( pSchemaTemplate && ValidTemplates ) ||
			  ( !pSchemaTemplate && !ValidTemplates ) ) );

	/* Count the predicates */
	_CountBits( ValidTemplates, uNumPredicates );

	/* Allocate the predicate state and link the value structures */
	if ( uNumPredicates != 0 )
	{
		pState = MDSU_malloc( pContext, sizeof(BIOAPI_BSP_PRED_STATE) );
		if ( pState == NULL )
		{
			ERR( rv = BioAPIERR_H_FRAMEWORK_MEMORY_ERROR );
		}
		else
		{
			memset( pState,
					0,
					sizeof(BIOAPI_BSP_PRED_STATE) );
			pPredicates = pState->Predicates;

			/* Allocate a single attribute value struct per attribute */
			for ( i = 0; i < uNumPredicates; i++ )
			{
				pPredicates[i].Attribute.Value = &pState->PredicateValues[i];
				pPredicates[i].Attribute.NumberOfValues = 1;
			}
		} /* Allocate and link predicate values */
	} /* uNumPredicates != 0 */

	if ( rv == CSSM_OK )
	{
		/* Fill in the query parameters */
		pQuery->RecordType = BIOAPI_BSP_RECORDTYPE;
		pQuery->Conjunctive = CSSM_DB_AND;
		pQuery->NumSelectionPredicates = uNumPredicates;
		pQuery->QueryLimits.TimeLimit = CSSM_QUERY_TIMELIMIT_NONE;
		pQuery->QueryLimits.SizeLimit = CSSM_QUERY_SIZELIMIT_NONE;
		pQuery->QueryFlags = 0;
		pQuery->SelectionPredicate = pPredicates;
		for ( uIndex = 0; uIndex < uNumPredicates; uIndex++ )
		{
			pPredicates[uIndex].DbOperator = CSSM_DB_EQUAL;
		}


		/* Fill in the predicate data */
		uIndex = 0;
		if ( ValidTemplates & MDSU_BIOAPI_BSP_CAP_MODULEID )
		{
			/* ModuleId */
			pPredicates[uIndex].Attribute.Info = s_BioApiAttrInfo_ModuleId;
			BioAPI_GetPrintableUUID( &pBioAPIBspCap->ModuleId,
									(char*)pState->PrintableUuid );
			pPredicates[uIndex].Attribute.Value->Data = pState->PrintableUuid;
			pPredicates[uIndex].Attribute.Value->Length =
								strlen( (char*)pState->PrintableUuid ) + 1;
			uIndex++;
		}
		if ( ValidTemplates & MDSU_BIOAPI_BSP_CAP_DEVICEID )
		{
			/* DeviceId */
			pPredicates[uIndex].Attribute.Info =
												s_BioApiAttrInfo_DeviceId;
			pPredicates[uIndex].Attribute.Value->Length = sizeof(uint32);
			pPredicates[uIndex].Attribute.Value->Data =
												(uint8*)&pBioAPIBspCap->DeviceId;
			uIndex++;
		}
		if ( ValidTemplates & MDSU_BIOAPI_BSP_CAP_BSPNAME )
		{
			/* BSPName */
			pPredicates[uIndex].Attribute.Info = s_BioApiAttrInfo_BspName;
			pPredicates[uIndex].Attribute.Value->Length = strlen( pBioAPIBspCap->BSPName ) + 1;
			pPredicates[uIndex].Attribute.Value->Data =
												(uint8*)&pBioAPIBspCap->BSPName;
			uIndex++;
		}
		if ( ValidTemplates & MDSU_BIOAPI_BSP_CAP_SPECVERSION )
		{
			/* SpecVersion */
			pPredicates[uIndex].Attribute.Info = s_BioApiAttrInfo_SpecVersion;
			BioAPI_GetPrintableVersion( &pBioAPIBspCap->SpecVersion,
									   (char*)pState->PrintableSpecVersion );
			pPredicates[uIndex].Attribute.Value->Data =
												pState->PrintableSpecVersion;
			pPredicates[uIndex].Attribute.Value->Length =
							strlen( (char*)pState->PrintableSpecVersion ) + 1;
			uIndex++;
		}
		if ( ValidTemplates & MDSU_BIOAPI_BSP_CAP_PRODUCTVERSION )
		{
			/* ProductVersion */
			pPredicates[uIndex].Attribute.Info = s_BioApiAttrInfo_ProductVersion;
			BioAPI_GetPrintableVersion( &pBioAPIBspCap->ProductVersion,
									   (char*)pState->PrintableProductVersion );
			pPredicates[uIndex].Attribute.Value->Data =
												pState->PrintableProductVersion;
			pPredicates[uIndex].Attribute.Value->Length =
							strlen( (char*)pState->PrintableProductVersion ) + 1;
			uIndex++;
		}
		if ( ValidTemplates & MDSU_BIOAPI_BSP_CAP_VENDOR )
		{
			/* Vendor */
			pPredicates[uIndex].Attribute.Info = s_BioApiAttrInfo_Vendor;
			pPredicates[uIndex].Attribute.Value->Length =
										strlen( pBioAPIBspCap->Vendor ) + 1 ;
			pPredicates[uIndex].Attribute.Value->Data =
												(uint8*)pBioAPIBspCap->Vendor;
			uIndex++;
		}
		if ( ValidTemplates & MDSU_BIOAPI_BSP_CAP_SUPPORTEDFORMATS )
		{
			/* Supportedformats */
			pPredicates[uIndex].Attribute.Info = s_BioApiAttrInfo_BspSupportedFormats;
			pPredicates[uIndex].Attribute.Value->Length =
										sizeof(uint32) * pBioAPIBspCap->NumSupportedFormats;
			pPredicates[uIndex].Attribute.Value->Data =
												(uint8*)&pBioAPIBspCap->BspSupportedFormats;
			uIndex++;
		}
		if ( ValidTemplates & MDSU_BIOAPI_BSP_CAP_FACTORSMASK)
		{
			/* FactorsMask */
			pPredicates[uIndex].Attribute.Info = s_BioApiAttrInfo_FactorsMask;
			pPredicates[uIndex].Attribute.Value->Length =
										sizeof(uint32);
			pPredicates[uIndex].Attribute.Value->Data =
												(uint8*)&pBioAPIBspCap->FactorsMask;
			uIndex++;
		}
		if ( ValidTemplates & MDSU_BIOAPI_BSP_CAP_OPERATIONS )
		{
			/* operations */
			pPredicates[uIndex].Attribute.Info = s_BioApiAttrInfo_Operations;
			pPredicates[uIndex].Attribute.Value->Length =
										sizeof(uint32);
			pPredicates[uIndex].Attribute.Value->Data =
												(uint8*)&pBioAPIBspCap->Operations;
			uIndex++;
		}
		if ( ValidTemplates & MDSU_BIOAPI_BSP_CAP_OPTIONS )
		{
			/* Options */
			pPredicates[uIndex].Attribute.Info = s_BioApiAttrInfo_Options;
			pPredicates[uIndex].Attribute.Value->Length =
										sizeof(uint32);
			pPredicates[uIndex].Attribute.Value->Data =
												(uint8*)&pBioAPIBspCap->Options;
			uIndex++;
		}

		if ( ValidTemplates & MDSU_BIOAPI_BSP_CAP_PAYLOADPOLICY )
		{
			/* Payloadpolicy */
			pPredicates[uIndex].Attribute.Info = s_BioApiAttrInfo_PayloadPolicy;
			pPredicates[uIndex].Attribute.Value->Length =
										sizeof(uint32);
			pPredicates[uIndex].Attribute.Value->Data =
												(uint8*)&pBioAPIBspCap->PayloadPolicy;
			uIndex++;
		}

		if ( ValidTemplates & MDSU_BIOAPI_BSP_CAP_MAXPAYLOADSIZE )
		{
			/* MaxPayloadSize */
			pPredicates[uIndex].Attribute.Info = s_BioApiAttrInfo_MaxPayloadSize;
			pPredicates[uIndex].Attribute.Value->Length =
										sizeof(uint32);
			pPredicates[uIndex].Attribute.Value->Data =
												(uint8*)&pBioAPIBspCap->MaxPayloadSize;
			uIndex++;
		}

		if ( ValidTemplates & MDSU_BIOAPI_BSP_CAP_DEFAULTVERIFYTIMEOUT )
		{
			/* DefaultVerifyTimeout */
			pPredicates[uIndex].Attribute.Info = s_BioApiAttrInfo_DefaultVerifyTimeout;
			pPredicates[uIndex].Attribute.Value->Length =
										sizeof(sint32);
			pPredicates[uIndex].Attribute.Value->Data =
												(uint8*)&pBioAPIBspCap->DefaultVerifyTimeout;
			uIndex++;
		}

		if ( ValidTemplates & MDSU_BIOAPI_BSP_CAP_DEFAULTIDENTIFYTIMEOUT )
		{
			/* DefaultIdentifyTimeout */
			pPredicates[uIndex].Attribute.Info = s_BioApiAttrInfo_DefaultIdentifyTimeout;
			pPredicates[uIndex].Attribute.Value->Length =
										sizeof(sint32);
			pPredicates[uIndex].Attribute.Value->Data =
												(uint8*)&pBioAPIBspCap->DefaultIdentifyTimeout;
			uIndex++;
		}

		if ( ValidTemplates & MDSU_BIOAPI_BSP_CAP_DEFAULTCAPTURETIMEOUT )
		{
			/* DefaultCaptureTimeout */
			pPredicates[uIndex].Attribute.Info = s_BioApiAttrInfo_DefaultCaptureTimeout;
			pPredicates[uIndex].Attribute.Value->Length =
										sizeof(sint32);
			pPredicates[uIndex].Attribute.Value->Data =
												(uint8*)&pBioAPIBspCap->DefaultCaptureTimeout;
			uIndex++;
		}

		if ( ValidTemplates & MDSU_BIOAPI_BSP_CAP_DEFAULTENROLLTIMEOUT )
		{
			/* DefaultEnrollTimeout */
			pPredicates[uIndex].Attribute.Info = s_BioApiAttrInfo_DefaultEnrollTimeout;
			pPredicates[uIndex].Attribute.Value->Length =
										sizeof(sint32);
			pPredicates[uIndex].Attribute.Value->Data =
												(uint8*)&pBioAPIBspCap->DefaultEnrollTimeout;
			uIndex++;
		}

		if ( ValidTemplates & MDSU_BIOAPI_BSP_CAP_MAXBSPDBSIZE )
		{
			/* Maximum database size */
			pPredicates[uIndex].Attribute.Info = s_BioApiAttrInfo_MaxBspDbSize;
			pPredicates[uIndex].Attribute.Value->Length =
										sizeof(uint32);
			pPredicates[uIndex].Attribute.Value->Data =
												(uint8*)&pBioAPIBspCap->MaxBspDbSize;
			uIndex++;
		}

		if ( ValidTemplates & MDSU_BIOAPI_BSP_CAP_MAXIDENTIFY )
		{
			/* Maximum identify capacity */
			pPredicates[uIndex].Attribute.Info = s_BioApiAttrInfo_MaxIdentify;
			pPredicates[uIndex].Attribute.Value->Length =
										sizeof(sint32);
			pPredicates[uIndex].Attribute.Value->Data =
												(uint8*)&pBioAPIBspCap->MaxIdentify;
			uIndex++;
		}

		if ( ValidTemplates & MDSU_BIOAPI_BSP_CAP_DESCRIPTION )
		{
			/* Description */
			pPredicates[uIndex].Attribute.Info = s_BioApiAttrInfo_Description;
			pPredicates[uIndex].Attribute.Value->Length =
										strlen (pBioAPIBspCap->Description) + 1;
			pPredicates[uIndex].Attribute.Value->Data =
												(uint8*)pBioAPIBspCap->Description;
			uIndex++;
		}

		if ( ValidTemplates & MDSU_BIOAPI_BSP_CAP_PATH )
		{
			/* Path */
			pPredicates[uIndex].Attribute.Info = s_BioApiAttrInfo_Path;
			pPredicates[uIndex].Attribute.Value->Length =
										strlen (pBioAPIBspCap->Path) + 1;
			pPredicates[uIndex].Attribute.Value->Data =
												(uint8*)pBioAPIBspCap->Path;
			uIndex++;
		}

	} /* Initial allocation successful */


	*ppPredState = (void*)pState;
	return rv;
}