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.
28 // Provide some flexibility for the includer
30 #if !defined(SPIPREFIX)
31 # define SPIPREFIX extern "C" CSSMSPI
35 SPIPREFIX CSSM_RETURN
CSSM_SPI_ModuleLoad (const CSSM_GUID
*CssmGuid
,
36 const CSSM_GUID
*ModuleGuid
,
37 CSSM_SPI_ModuleEventHandler CssmNotifyCallback
,
38 void *CssmNotifyCallbackCtx
)
41 plugin().moduleLoad(Guid::required(CssmGuid
),
42 Guid::required(ModuleGuid
),
43 ModuleCallback(CssmNotifyCallback
, CssmNotifyCallbackCtx
));
47 SPIPREFIX CSSM_RETURN
CSSM_SPI_ModuleUnload (const CSSM_GUID
*CssmGuid
,
48 const CSSM_GUID
*ModuleGuid
,
49 CSSM_SPI_ModuleEventHandler CssmNotifyCallback
,
50 void *CssmNotifyCallbackCtx
)
53 plugin().moduleUnload(Guid::required(CssmGuid
),
54 Guid::required(ModuleGuid
),
55 ModuleCallback(CssmNotifyCallback
, CssmNotifyCallbackCtx
));
59 SPIPREFIX CSSM_RETURN
CSSM_SPI_ModuleAttach (const CSSM_GUID
*ModuleGuid
,
60 const CSSM_VERSION
*Version
,
62 CSSM_SERVICE_TYPE SubServiceType
,
63 CSSM_ATTACH_FLAGS AttachFlags
,
64 CSSM_MODULE_HANDLE ModuleHandle
,
65 CSSM_KEY_HIERARCHY KeyHierarchy
,
66 const CSSM_GUID
*CssmGuid
,
67 const CSSM_GUID
*ModuleManagerGuid
,
68 const CSSM_GUID
*CallerGuid
,
69 const CSSM_UPCALLS
*Upcalls
,
70 CSSM_MODULE_FUNCS_PTR
*FuncTbl
)
73 plugin().moduleAttach(ModuleHandle
,
74 Guid::required(CssmGuid
),
75 Guid::required(ModuleGuid
),
76 Guid::required(ModuleManagerGuid
),
77 Guid::required(CallerGuid
),
88 SPIPREFIX CSSM_RETURN
CSSM_SPI_ModuleDetach (CSSM_MODULE_HANDLE ModuleHandle
)
91 plugin().moduleDetach(ModuleHandle
);