2 * Copyright (c) 2000-2001 Apple Computer, Inc. All Rights Reserved.
4 * The contents of this file constitute Original Code as defined in and are
5 * subject to the Apple Public Source License Version 1.2 (the 'License').
6 * You may not use this file except in compliance with the License. Please obtain
7 * a copy of the License at http://www.apple.com/publicsource and read it before
10 * This Original Code and all software distributed under the License are
11 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS
12 * OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, INCLUDING WITHOUT
13 * LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
14 * PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. Please see the License for the
15 * specific language governing rights and limitations under the License.
20 // pluginspi - "roof" level entry points into a CSSM plugin.
22 // This file is meant to be included into the top-level source file
23 // for a CSSM plugin written to the C++ alternate interface.
24 // It contains actual code that defines the four required entry points.
26 #include <security_cdsa_utilities/cssmbridge.h>
30 // Provide some flexibility for the includer
32 #if !defined(SPIPREFIX)
33 # define SPIPREFIX extern "C" CSSMSPI
40 SPIPREFIX CSSM_RETURN
SPINAME(CSSM_SPI_ModuleLoad
) (const CSSM_GUID
*CssmGuid
,
41 const CSSM_GUID
*ModuleGuid
,
42 CSSM_SPI_ModuleEventHandler CssmNotifyCallback
,
43 void *CssmNotifyCallbackCtx
);
45 SPIPREFIX CSSM_RETURN
SPINAME(CSSM_SPI_ModuleLoad
) (const CSSM_GUID
*CssmGuid
,
46 const CSSM_GUID
*ModuleGuid
,
47 CSSM_SPI_ModuleEventHandler CssmNotifyCallback
,
48 void *CssmNotifyCallbackCtx
)
51 plugin().moduleLoad(Guid::required(CssmGuid
),
52 Guid::required(ModuleGuid
),
53 ModuleCallback(CssmNotifyCallback
, CssmNotifyCallbackCtx
));
57 SPIPREFIX CSSM_RETURN
SPINAME(CSSM_SPI_ModuleUnload
) (const CSSM_GUID
*CssmGuid
,
58 const CSSM_GUID
*ModuleGuid
,
59 CSSM_SPI_ModuleEventHandler CssmNotifyCallback
,
60 void *CssmNotifyCallbackCtx
);
62 SPIPREFIX CSSM_RETURN
SPINAME(CSSM_SPI_ModuleUnload
) (const CSSM_GUID
*CssmGuid
,
63 const CSSM_GUID
*ModuleGuid
,
64 CSSM_SPI_ModuleEventHandler CssmNotifyCallback
,
65 void *CssmNotifyCallbackCtx
)
68 plugin().moduleUnload(Guid::required(CssmGuid
),
69 Guid::required(ModuleGuid
),
70 ModuleCallback(CssmNotifyCallback
, CssmNotifyCallbackCtx
));
74 SPIPREFIX CSSM_RETURN
SPINAME(CSSM_SPI_ModuleAttach
) (const CSSM_GUID
*ModuleGuid
,
75 const CSSM_VERSION
*Version
,
77 CSSM_SERVICE_TYPE SubServiceType
,
78 CSSM_ATTACH_FLAGS AttachFlags
,
79 CSSM_MODULE_HANDLE ModuleHandle
,
80 CSSM_KEY_HIERARCHY KeyHierarchy
,
81 const CSSM_GUID
*CssmGuid
,
82 const CSSM_GUID
*ModuleManagerGuid
,
83 const CSSM_GUID
*CallerGuid
,
84 const CSSM_UPCALLS
*Upcalls
,
85 CSSM_MODULE_FUNCS_PTR
*FuncTbl
);
87 SPIPREFIX CSSM_RETURN
SPINAME(CSSM_SPI_ModuleAttach
) (const CSSM_GUID
*ModuleGuid
,
88 const CSSM_VERSION
*Version
,
90 CSSM_SERVICE_TYPE SubServiceType
,
91 CSSM_ATTACH_FLAGS AttachFlags
,
92 CSSM_MODULE_HANDLE ModuleHandle
,
93 CSSM_KEY_HIERARCHY KeyHierarchy
,
94 const CSSM_GUID
*CssmGuid
,
95 const CSSM_GUID
*ModuleManagerGuid
,
96 const CSSM_GUID
*CallerGuid
,
97 const CSSM_UPCALLS
*Upcalls
,
98 CSSM_MODULE_FUNCS_PTR
*FuncTbl
)
101 plugin().moduleAttach(ModuleHandle
,
102 Guid::required(CssmGuid
),
103 Guid::required(ModuleGuid
),
104 Guid::required(ModuleManagerGuid
),
105 Guid::required(CallerGuid
),
116 SPIPREFIX CSSM_RETURN
SPINAME(CSSM_SPI_ModuleDetach
) (CSSM_MODULE_HANDLE ModuleHandle
);
118 SPIPREFIX CSSM_RETURN
SPINAME(CSSM_SPI_ModuleDetach
) (CSSM_MODULE_HANDLE ModuleHandle
)
121 plugin().moduleDetach(ModuleHandle
);