]> git.saurik.com Git - apple/security.git/blob - OSX/libsecurity_cssm/lib/emmspi.h
Security-59306.120.7.tar.gz
[apple/security.git] / OSX / libsecurity_cssm / lib / emmspi.h
1 /*
2 * Copyright (c) 1999-2001,2004,2011,2014 Apple Inc. All Rights Reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
11 * file.
12 *
13 * The Original Code and all software distributed under the License are
14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 * Please see the License for the specific language governing rights and
19 * limitations under the License.
20 *
21 * @APPLE_LICENSE_HEADER_END@
22 *
23 * emmspi.h -- Service Provider Interface for Elective Module Managers
24 */
25
26 #ifndef _EMMSPI_H_
27 #define _EMMSPI_H_ 1
28
29 #include <Security/cssmtype.h>
30 #include <Security/emmtype.h> /* CSSM_MANAGER_EVENT_NOTIFICATION */
31 #include <Security/cssmspi.h> /* CSSM_UPCALLS_PTR */
32
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36
37 #pragma clang diagnostic push
38 #pragma clang diagnostic ignored "-Wdeprecated-declarations"
39
40 typedef struct DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER cssm_state_funcs {
41 CSSM_RETURN (CSSMAPI *cssm_GetAttachFunctions)
42 (CSSM_MODULE_HANDLE hAddIn,
43 CSSM_SERVICE_MASK AddinType,
44 void **SPFunctions,
45 CSSM_GUID_PTR Guid,
46 CSSM_BOOL *Serialized);
47 CSSM_RETURN (CSSMAPI *cssm_ReleaseAttachFunctions)
48 (CSSM_MODULE_HANDLE hAddIn);
49 CSSM_RETURN (CSSMAPI *cssm_GetAppMemoryFunctions)
50 (CSSM_MODULE_HANDLE hAddIn,
51 CSSM_UPCALLS_PTR UpcallTable);
52 CSSM_RETURN (CSSMAPI *cssm_IsFuncCallValid)
53 (CSSM_MODULE_HANDLE hAddin,
54 CSSM_PROC_ADDR SrcAddress,
55 CSSM_PROC_ADDR DestAddress,
56 CSSM_PRIVILEGE InPriv,
57 CSSM_PRIVILEGE *OutPriv,
58 CSSM_BITMASK Hints,
59 CSSM_BOOL *IsOK);
60 CSSM_RETURN (CSSMAPI *cssm_DeregisterManagerServices)
61 (const CSSM_GUID *GUID);
62 CSSM_RETURN (CSSMAPI *cssm_DeliverModuleManagerEvent)
63 (const CSSM_MANAGER_EVENT_NOTIFICATION *EventDescription);
64 } CSSM_STATE_FUNCS DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER, *CSSM_STATE_FUNCS_PTR DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
65
66 typedef struct DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER cssm_manager_registration_info {
67 /* loading, unloading, dispatch table, and event notification */
68 CSSM_RETURN (CSSMAPI *Initialize)
69 (uint32 VerMajor,
70 uint32 VerMinor);
71 CSSM_RETURN (CSSMAPI *Terminate) (void);
72 CSSM_RETURN (CSSMAPI *RegisterDispatchTable)
73 (CSSM_STATE_FUNCS_PTR CssmStateCallTable);
74 CSSM_RETURN (CSSMAPI *DeregisterDispatchTable) (void);
75 CSSM_RETURN (CSSMAPI *EventNotifyManager)
76 (const CSSM_MANAGER_EVENT_NOTIFICATION *EventDescription);
77 CSSM_RETURN (CSSMAPI *RefreshFunctionTable)
78 (CSSM_FUNC_NAME_ADDR_PTR FuncNameAddrPtr,
79 uint32 NumOfFuncNameAddr);
80 } CSSM_MANAGER_REGISTRATION_INFO DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER, *CSSM_MANAGER_REGISTRATION_INFO_PTR DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
81
82 enum {
83 CSSM_HINT_NONE = 0,
84 CSSM_HINT_ADDRESS_APP = 1 << 0,
85 CSSM_HINT_ADDRESS_SP = 1 << 1
86 };
87
88 #pragma clang diagnostic pop
89
90 #ifdef __cplusplus
91 }
92 #endif
93
94 #endif /* _EMMSPI_H_ */