2 // DL plugin transition layer.
3 // This file was automatically generated. Do not edit on penalty of futility!
5 #include <security_cdsa_plugin/DLsession.h>
6 #include <security_cdsa_plugin/cssmplugin.h>
7 #include <security_cdsa_utilities/cssmbridge.h>
8 #include <Security/cssmdli.h>
11 DLAbstractPluginSession::~DLAbstractPluginSession()
14 static CSSM_RETURN CSSMDLI
cssm_DataGetFirst(CSSM_DL_DB_HANDLE DLDBHandle
,
15 const CSSM_QUERY
*Query
,
16 CSSM_HANDLE_PTR ResultsHandle
,
17 CSSM_DB_RECORD_ATTRIBUTE_DATA_PTR Attributes
,
19 CSSM_DB_UNIQUE_RECORD_PTR
*UniqueId
)
22 if ((Required(ResultsHandle
) = findSession
<DLPluginSession
>(DLDBHandle
.DLHandle
).DataGetFirst(DLDBHandle
.DBHandle
,
23 CssmQuery::optional(Query
),
25 CssmData::optional(Data
),
26 Required(UniqueId
))) == CSSM_INVALID_HANDLE
)
27 return CSSMERR_DL_ENDOFDATA
;
31 static CSSM_RETURN CSSMDLI
cssm_GetDbNames(CSSM_DL_HANDLE DLHandle
,
32 CSSM_NAME_LIST_PTR
*NameList
)
35 findSession
<DLPluginSession
>(DLHandle
).GetDbNames(Required(NameList
));
39 static CSSM_RETURN CSSMDLI
cssm_DbClose(CSSM_DL_DB_HANDLE DLDBHandle
)
42 findSession
<DLPluginSession
>(DLDBHandle
.DLHandle
).DbClose(DLDBHandle
.DBHandle
);
46 static CSSM_RETURN CSSMDLI
cssm_DataInsert(CSSM_DL_DB_HANDLE DLDBHandle
,
47 CSSM_DB_RECORDTYPE RecordType
,
48 const CSSM_DB_RECORD_ATTRIBUTE_DATA
*Attributes
,
49 const CSSM_DATA
*Data
,
50 CSSM_DB_UNIQUE_RECORD_PTR
*UniqueId
)
53 findSession
<DLPluginSession
>(DLDBHandle
.DLHandle
).DataInsert(DLDBHandle
.DBHandle
,
56 CssmData::optional(Data
),
61 static CSSM_RETURN CSSMDLI
cssm_GetDbNameFromHandle(CSSM_DL_DB_HANDLE DLDBHandle
,
65 findSession
<DLPluginSession
>(DLDBHandle
.DLHandle
).GetDbNameFromHandle(DLDBHandle
.DBHandle
,
70 static CSSM_RETURN CSSMDLI
cssm_ChangeDbAcl(CSSM_DL_DB_HANDLE DLDBHandle
,
71 const CSSM_ACCESS_CREDENTIALS
*AccessCred
,
72 const CSSM_ACL_EDIT
*AclEdit
)
75 findSession
<DLPluginSession
>(DLDBHandle
.DLHandle
).ChangeDbAcl(DLDBHandle
.DBHandle
,
76 AccessCredentials::required(AccessCred
),
81 static CSSM_RETURN CSSMDLI
cssm_FreeNameList(CSSM_DL_HANDLE DLHandle
,
82 CSSM_NAME_LIST_PTR NameList
)
85 findSession
<DLPluginSession
>(DLHandle
).FreeNameList(Required(NameList
));
89 static CSSM_RETURN CSSMDLI
cssm_CreateRelation(CSSM_DL_DB_HANDLE DLDBHandle
,
90 CSSM_DB_RECORDTYPE RelationID
,
91 const char *RelationName
,
92 uint32 NumberOfAttributes
,
93 const CSSM_DB_SCHEMA_ATTRIBUTE_INFO
*pAttributeInfo
,
94 uint32 NumberOfIndexes
,
95 const CSSM_DB_SCHEMA_INDEX_INFO
*pIndexInfo
)
98 findSession
<DLPluginSession
>(DLDBHandle
.DLHandle
).CreateRelation(DLDBHandle
.DBHandle
,
104 Required(pIndexInfo
));
108 static CSSM_RETURN CSSMDLI
cssm_DataAbortQuery(CSSM_DL_DB_HANDLE DLDBHandle
,
109 CSSM_HANDLE ResultsHandle
)
112 findSession
<DLPluginSession
>(DLDBHandle
.DLHandle
).DataAbortQuery(DLDBHandle
.DBHandle
,
117 static CSSM_RETURN CSSMDLI
cssm_DataModify(CSSM_DL_DB_HANDLE DLDBHandle
,
118 CSSM_DB_RECORDTYPE RecordType
,
119 CSSM_DB_UNIQUE_RECORD_PTR UniqueRecordIdentifier
,
120 const CSSM_DB_RECORD_ATTRIBUTE_DATA
*AttributesToBeModified
,
121 const CSSM_DATA
*DataToBeModified
,
122 CSSM_DB_MODIFY_MODE ModifyMode
)
125 findSession
<DLPluginSession
>(DLDBHandle
.DLHandle
).DataModify(DLDBHandle
.DBHandle
,
127 Required(UniqueRecordIdentifier
),
128 AttributesToBeModified
,
129 CssmData::optional(DataToBeModified
),
134 static CSSM_RETURN CSSMDLI
cssm_DestroyRelation(CSSM_DL_DB_HANDLE DLDBHandle
,
135 CSSM_DB_RECORDTYPE RelationID
)
138 findSession
<DLPluginSession
>(DLDBHandle
.DLHandle
).DestroyRelation(DLDBHandle
.DBHandle
,
143 static CSSM_RETURN CSSMDLI
cssm_DbCreate(CSSM_DL_HANDLE DLHandle
,
145 const CSSM_NET_ADDRESS
*DbLocation
,
146 const CSSM_DBINFO
*DBInfo
,
147 CSSM_DB_ACCESS_TYPE AccessRequest
,
148 const CSSM_RESOURCE_CONTROL_CONTEXT
*CredAndAclEntry
,
149 const void *OpenParameters
,
150 CSSM_DB_HANDLE
*DbHandle
)
153 findSession
<DLPluginSession
>(DLHandle
).DbCreate(DbName
,
163 static CSSM_RETURN CSSMDLI
cssm_DbOpen(CSSM_DL_HANDLE DLHandle
,
165 const CSSM_NET_ADDRESS
*DbLocation
,
166 CSSM_DB_ACCESS_TYPE AccessRequest
,
167 const CSSM_ACCESS_CREDENTIALS
*AccessCred
,
168 const void *OpenParameters
,
169 CSSM_DB_HANDLE
*DbHandle
)
172 findSession
<DLPluginSession
>(DLHandle
).DbOpen(DbName
,
175 AccessCredentials::optional(AccessCred
),
181 static CSSM_RETURN CSSMDLI
cssm_DataGetNext(CSSM_DL_DB_HANDLE DLDBHandle
,
182 CSSM_HANDLE ResultsHandle
,
183 CSSM_DB_RECORD_ATTRIBUTE_DATA_PTR Attributes
,
185 CSSM_DB_UNIQUE_RECORD_PTR
*UniqueId
)
188 if (!findSession
<DLPluginSession
>(DLDBHandle
.DLHandle
).DataGetNext(DLDBHandle
.DBHandle
,
191 CssmData::optional(Data
),
193 return CSSMERR_DL_ENDOFDATA
;
197 static CSSM_RETURN CSSMDLI
cssm_FreeUniqueRecord(CSSM_DL_DB_HANDLE DLDBHandle
,
198 CSSM_DB_UNIQUE_RECORD_PTR UniqueRecord
)
201 findSession
<DLPluginSession
>(DLDBHandle
.DLHandle
).FreeUniqueRecord(DLDBHandle
.DBHandle
,
202 Required(UniqueRecord
));
206 static CSSM_RETURN CSSMDLI
cssm_ChangeDbOwner(CSSM_DL_DB_HANDLE DLDBHandle
,
207 const CSSM_ACCESS_CREDENTIALS
*AccessCred
,
208 const CSSM_ACL_OWNER_PROTOTYPE
*NewOwner
)
211 findSession
<DLPluginSession
>(DLDBHandle
.DLHandle
).ChangeDbOwner(DLDBHandle
.DBHandle
,
212 AccessCredentials::required(AccessCred
),
217 static CSSM_RETURN CSSMDLI
cssm_DbDelete(CSSM_DL_HANDLE DLHandle
,
219 const CSSM_NET_ADDRESS
*DbLocation
,
220 const CSSM_ACCESS_CREDENTIALS
*AccessCred
)
223 findSession
<DLPluginSession
>(DLHandle
).DbDelete(DbName
,
225 AccessCredentials::optional(AccessCred
));
229 static CSSM_RETURN CSSMDLI
cssm_Authenticate(CSSM_DL_DB_HANDLE DLDBHandle
,
230 CSSM_DB_ACCESS_TYPE AccessRequest
,
231 const CSSM_ACCESS_CREDENTIALS
*AccessCred
)
234 findSession
<DLPluginSession
>(DLDBHandle
.DLHandle
).Authenticate(DLDBHandle
.DBHandle
,
236 AccessCredentials::required(AccessCred
));
240 static CSSM_RETURN CSSMDLI
cssm_DataDelete(CSSM_DL_DB_HANDLE DLDBHandle
,
241 const CSSM_DB_UNIQUE_RECORD
*UniqueRecordIdentifier
)
244 findSession
<DLPluginSession
>(DLDBHandle
.DLHandle
).DataDelete(DLDBHandle
.DBHandle
,
245 Required(UniqueRecordIdentifier
));
249 static CSSM_RETURN CSSMDLI
cssm_GetDbOwner(CSSM_DL_DB_HANDLE DLDBHandle
,
250 CSSM_ACL_OWNER_PROTOTYPE_PTR Owner
)
253 findSession
<DLPluginSession
>(DLDBHandle
.DLHandle
).GetDbOwner(DLDBHandle
.DBHandle
,
258 static CSSM_RETURN CSSMDLI
cssm_PassThrough(CSSM_DL_DB_HANDLE DLDBHandle
,
259 uint32 PassThroughId
,
260 const void *InputParams
,
264 findSession
<DLPluginSession
>(DLDBHandle
.DLHandle
).PassThrough(DLDBHandle
.DBHandle
,
271 static CSSM_RETURN CSSMDLI
cssm_GetDbAcl(CSSM_DL_DB_HANDLE DLDBHandle
,
272 const CSSM_STRING
*SelectionTag
,
273 uint32
*NumberOfAclInfos
,
274 CSSM_ACL_ENTRY_INFO_PTR
*AclInfos
)
277 findSession
<DLPluginSession
>(DLDBHandle
.DLHandle
).GetDbAcl(DLDBHandle
.DBHandle
,
279 Required(NumberOfAclInfos
),
284 static CSSM_RETURN CSSMDLI
cssm_DataGetFromUniqueRecordId(CSSM_DL_DB_HANDLE DLDBHandle
,
285 const CSSM_DB_UNIQUE_RECORD
*UniqueRecord
,
286 CSSM_DB_RECORD_ATTRIBUTE_DATA_PTR Attributes
,
290 findSession
<DLPluginSession
>(DLDBHandle
.DLHandle
).DataGetFromUniqueRecordId(DLDBHandle
.DBHandle
,
291 Required(UniqueRecord
),
293 CssmData::optional(Data
));
298 static const CSSM_SPI_DL_FUNCS DLFunctionStruct
= {
304 cssm_DestroyRelation
,
311 cssm_GetDbNameFromHandle
,
319 cssm_DataGetFromUniqueRecordId
,
320 cssm_FreeUniqueRecord
,
324 static CSSM_MODULE_FUNCS DLFunctionTable
= {
325 CSSM_SERVICE_DL
, // service type
326 23, // number of functions
327 (const CSSM_PROC_ADDR
*)&DLFunctionStruct
330 CSSM_MODULE_FUNCS_PTR
DLPluginSession::construct()
332 return &DLFunctionTable
;