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>
9 // The disclaimer up top used to be true but rdar://24426719 removed libsecurity_cdsa_plugin_generate
10 #include "LegacyAPICounts.h"
13 DLAbstractPluginSession::~DLAbstractPluginSession()
16 static CSSM_RETURN CSSMDLI
cssm_DataGetFirst(CSSM_DL_DB_HANDLE DLDBHandle
,
17 const CSSM_QUERY
*Query
,
18 CSSM_HANDLE_PTR ResultsHandle
,
19 CSSM_DB_RECORD_ATTRIBUTE_DATA_PTR Attributes
,
21 CSSM_DB_UNIQUE_RECORD_PTR
*UniqueId
)
24 if ((Required(ResultsHandle
) = findSession
<DLPluginSession
>(DLDBHandle
.DLHandle
).DataGetFirst(DLDBHandle
.DBHandle
,
25 CssmQuery::optional(Query
),
27 CssmData::optional(Data
),
28 Required(UniqueId
))) == CSSM_INVALID_HANDLE
)
29 return CSSMERR_DL_ENDOFDATA
;
33 static CSSM_RETURN CSSMDLI
cssm_GetDbNames(CSSM_DL_HANDLE DLHandle
,
34 CSSM_NAME_LIST_PTR
*NameList
)
37 findSession
<DLPluginSession
>(DLHandle
).GetDbNames(Required(NameList
));
41 static CSSM_RETURN CSSMDLI
cssm_DbClose(CSSM_DL_DB_HANDLE DLDBHandle
)
44 findSession
<DLPluginSession
>(DLDBHandle
.DLHandle
).DbClose(DLDBHandle
.DBHandle
);
48 static CSSM_RETURN CSSMDLI
cssm_DataInsert(CSSM_DL_DB_HANDLE DLDBHandle
,
49 CSSM_DB_RECORDTYPE RecordType
,
50 const CSSM_DB_RECORD_ATTRIBUTE_DATA
*Attributes
,
51 const CSSM_DATA
*Data
,
52 CSSM_DB_UNIQUE_RECORD_PTR
*UniqueId
)
55 findSession
<DLPluginSession
>(DLDBHandle
.DLHandle
).DataInsert(DLDBHandle
.DBHandle
,
58 CssmData::optional(Data
),
63 static CSSM_RETURN CSSMDLI
cssm_GetDbNameFromHandle(CSSM_DL_DB_HANDLE DLDBHandle
,
67 findSession
<DLPluginSession
>(DLDBHandle
.DLHandle
).GetDbNameFromHandle(DLDBHandle
.DBHandle
,
72 static CSSM_RETURN CSSMDLI
cssm_ChangeDbAcl(CSSM_DL_DB_HANDLE DLDBHandle
,
73 const CSSM_ACCESS_CREDENTIALS
*AccessCred
,
74 const CSSM_ACL_EDIT
*AclEdit
)
77 findSession
<DLPluginSession
>(DLDBHandle
.DLHandle
).ChangeDbAcl(DLDBHandle
.DBHandle
,
78 AccessCredentials::required(AccessCred
),
83 static CSSM_RETURN CSSMDLI
cssm_FreeNameList(CSSM_DL_HANDLE DLHandle
,
84 CSSM_NAME_LIST_PTR NameList
)
87 findSession
<DLPluginSession
>(DLHandle
).FreeNameList(Required(NameList
));
91 static CSSM_RETURN CSSMDLI
cssm_CreateRelation(CSSM_DL_DB_HANDLE DLDBHandle
,
92 CSSM_DB_RECORDTYPE RelationID
,
93 const char *RelationName
,
94 uint32 NumberOfAttributes
,
95 const CSSM_DB_SCHEMA_ATTRIBUTE_INFO
*pAttributeInfo
,
96 uint32 NumberOfIndexes
,
97 const CSSM_DB_SCHEMA_INDEX_INFO
*pIndexInfo
)
100 findSession
<DLPluginSession
>(DLDBHandle
.DLHandle
).CreateRelation(DLDBHandle
.DBHandle
,
106 Required(pIndexInfo
));
110 static CSSM_RETURN CSSMDLI
cssm_DataAbortQuery(CSSM_DL_DB_HANDLE DLDBHandle
,
111 CSSM_HANDLE ResultsHandle
)
114 findSession
<DLPluginSession
>(DLDBHandle
.DLHandle
).DataAbortQuery(DLDBHandle
.DBHandle
,
119 static CSSM_RETURN CSSMDLI
cssm_DataModify(CSSM_DL_DB_HANDLE DLDBHandle
,
120 CSSM_DB_RECORDTYPE RecordType
,
121 CSSM_DB_UNIQUE_RECORD_PTR UniqueRecordIdentifier
,
122 const CSSM_DB_RECORD_ATTRIBUTE_DATA
*AttributesToBeModified
,
123 const CSSM_DATA
*DataToBeModified
,
124 CSSM_DB_MODIFY_MODE ModifyMode
)
127 findSession
<DLPluginSession
>(DLDBHandle
.DLHandle
).DataModify(DLDBHandle
.DBHandle
,
129 Required(UniqueRecordIdentifier
),
130 AttributesToBeModified
,
131 CssmData::optional(DataToBeModified
),
136 static CSSM_RETURN CSSMDLI
cssm_DestroyRelation(CSSM_DL_DB_HANDLE DLDBHandle
,
137 CSSM_DB_RECORDTYPE RelationID
)
140 findSession
<DLPluginSession
>(DLDBHandle
.DLHandle
).DestroyRelation(DLDBHandle
.DBHandle
,
145 static CSSM_RETURN CSSMDLI
cssm_DbCreate(CSSM_DL_HANDLE DLHandle
,
147 const CSSM_NET_ADDRESS
*DbLocation
,
148 const CSSM_DBINFO
*DBInfo
,
149 CSSM_DB_ACCESS_TYPE AccessRequest
,
150 const CSSM_RESOURCE_CONTROL_CONTEXT
*CredAndAclEntry
,
151 const void *OpenParameters
,
152 CSSM_DB_HANDLE
*DbHandle
)
155 findSession
<DLPluginSession
>(DLHandle
).DbCreate(DbName
,
165 static CSSM_RETURN CSSMDLI
cssm_DbOpen(CSSM_DL_HANDLE DLHandle
,
167 const CSSM_NET_ADDRESS
*DbLocation
,
168 CSSM_DB_ACCESS_TYPE AccessRequest
,
169 const CSSM_ACCESS_CREDENTIALS
*AccessCred
,
170 const void *OpenParameters
,
171 CSSM_DB_HANDLE
*DbHandle
)
174 findSession
<DLPluginSession
>(DLHandle
).DbOpen(DbName
,
177 AccessCredentials::optional(AccessCred
),
183 static CSSM_RETURN CSSMDLI
cssm_DataGetNext(CSSM_DL_DB_HANDLE DLDBHandle
,
184 CSSM_HANDLE ResultsHandle
,
185 CSSM_DB_RECORD_ATTRIBUTE_DATA_PTR Attributes
,
187 CSSM_DB_UNIQUE_RECORD_PTR
*UniqueId
)
190 if (!findSession
<DLPluginSession
>(DLDBHandle
.DLHandle
).DataGetNext(DLDBHandle
.DBHandle
,
193 CssmData::optional(Data
),
195 return CSSMERR_DL_ENDOFDATA
;
199 static CSSM_RETURN CSSMDLI
cssm_FreeUniqueRecord(CSSM_DL_DB_HANDLE DLDBHandle
,
200 CSSM_DB_UNIQUE_RECORD_PTR UniqueRecord
)
203 findSession
<DLPluginSession
>(DLDBHandle
.DLHandle
).FreeUniqueRecord(DLDBHandle
.DBHandle
,
204 Required(UniqueRecord
));
208 static CSSM_RETURN CSSMDLI
cssm_ChangeDbOwner(CSSM_DL_DB_HANDLE DLDBHandle
,
209 const CSSM_ACCESS_CREDENTIALS
*AccessCred
,
210 const CSSM_ACL_OWNER_PROTOTYPE
*NewOwner
)
213 findSession
<DLPluginSession
>(DLDBHandle
.DLHandle
).ChangeDbOwner(DLDBHandle
.DBHandle
,
214 AccessCredentials::required(AccessCred
),
219 static CSSM_RETURN CSSMDLI
cssm_DbDelete(CSSM_DL_HANDLE DLHandle
,
221 const CSSM_NET_ADDRESS
*DbLocation
,
222 const CSSM_ACCESS_CREDENTIALS
*AccessCred
)
225 findSession
<DLPluginSession
>(DLHandle
).DbDelete(DbName
,
227 AccessCredentials::optional(AccessCred
));
231 static CSSM_RETURN CSSMDLI
cssm_Authenticate(CSSM_DL_DB_HANDLE DLDBHandle
,
232 CSSM_DB_ACCESS_TYPE AccessRequest
,
233 const CSSM_ACCESS_CREDENTIALS
*AccessCred
)
236 findSession
<DLPluginSession
>(DLDBHandle
.DLHandle
).Authenticate(DLDBHandle
.DBHandle
,
238 AccessCredentials::required(AccessCred
));
242 static CSSM_RETURN CSSMDLI
cssm_DataDelete(CSSM_DL_DB_HANDLE DLDBHandle
,
243 const CSSM_DB_UNIQUE_RECORD
*UniqueRecordIdentifier
)
246 findSession
<DLPluginSession
>(DLDBHandle
.DLHandle
).DataDelete(DLDBHandle
.DBHandle
,
247 Required(UniqueRecordIdentifier
));
251 static CSSM_RETURN CSSMDLI
cssm_GetDbOwner(CSSM_DL_DB_HANDLE DLDBHandle
,
252 CSSM_ACL_OWNER_PROTOTYPE_PTR Owner
)
255 findSession
<DLPluginSession
>(DLDBHandle
.DLHandle
).GetDbOwner(DLDBHandle
.DBHandle
,
260 static CSSM_RETURN CSSMDLI
cssm_PassThrough(CSSM_DL_DB_HANDLE DLDBHandle
,
261 uint32 PassThroughId
,
262 const void *InputParams
,
266 findSession
<DLPluginSession
>(DLDBHandle
.DLHandle
).PassThrough(DLDBHandle
.DBHandle
,
273 static CSSM_RETURN CSSMDLI
cssm_GetDbAcl(CSSM_DL_DB_HANDLE DLDBHandle
,
274 const CSSM_STRING
*SelectionTag
,
275 uint32
*NumberOfAclInfos
,
276 CSSM_ACL_ENTRY_INFO_PTR
*AclInfos
)
279 findSession
<DLPluginSession
>(DLDBHandle
.DLHandle
).GetDbAcl(DLDBHandle
.DBHandle
,
281 Required(NumberOfAclInfos
),
286 static CSSM_RETURN CSSMDLI
cssm_DataGetFromUniqueRecordId(CSSM_DL_DB_HANDLE DLDBHandle
,
287 const CSSM_DB_UNIQUE_RECORD
*UniqueRecord
,
288 CSSM_DB_RECORD_ATTRIBUTE_DATA_PTR Attributes
,
292 findSession
<DLPluginSession
>(DLDBHandle
.DLHandle
).DataGetFromUniqueRecordId(DLDBHandle
.DBHandle
,
293 Required(UniqueRecord
),
295 CssmData::optional(Data
));
300 static const CSSM_SPI_DL_FUNCS DLFunctionStruct
= {
306 cssm_DestroyRelation
,
313 cssm_GetDbNameFromHandle
,
321 cssm_DataGetFromUniqueRecordId
,
322 cssm_FreeUniqueRecord
,
326 static CSSM_MODULE_FUNCS DLFunctionTable
= {
327 CSSM_SERVICE_DL
, // service type
328 23, // number of functions
329 (const CSSM_PROC_ADDR
*)&DLFunctionStruct
332 CSSM_MODULE_FUNCS_PTR
DLPluginSession::construct()
334 return &DLFunctionTable
;