2 * Copyright (c) 2002-2008, 2010, 2011 Apple Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
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
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.
21 * @APPLE_LICENSE_HEADER_END@
25 #ifndef _DY_FRAMEWORK_H
26 #define _DY_FRAMEWORK_H
28 #include <Availability.h>
29 #include <TargetConditionals.h>
30 #include <sys/cdefs.h>
31 #include <mach/mach.h>
32 #include <CoreFoundation/CoreFoundation.h>
33 #include <IOKit/IOKitLib.h>
34 #include <Security/Security.h>
35 #include <Security/SecItem.h> // only needed for Mac OS X 10.6[.x]
40 #pragma mark IOKit.framework APIs
42 CFMutableDictionaryRef
44 mach_port_t masterPort
,
48 #define IOBSDNameMatching _IOBSDNameMatching
52 io_iterator_t iterator
54 #define IOIteratorNext _IOIteratorNext
58 mach_port_t bootstrapPort
,
59 mach_port_t
*masterPort
61 #define IOMasterPort _IOMasterPort
66 const io_name_t className
68 #define IOObjectConformsTo _IOObjectConformsTo
75 #define IOObjectGetClass _IOObjectGetClass
81 #define IOObjectRelease _IOObjectRelease
84 _IORegistryEntryCreateCFProperty (
85 io_registry_entry_t entry
,
87 CFAllocatorRef allocator
,
90 #define IORegistryEntryCreateCFProperty _IORegistryEntryCreateCFProperty
93 _IORegistryEntryCreateCFProperties (
94 io_registry_entry_t entry
,
95 CFMutableDictionaryRef
*properties
,
96 CFAllocatorRef allocator
,
99 #define IORegistryEntryCreateCFProperties _IORegistryEntryCreateCFProperties
102 _IORegistryEntryCreateIterator (
103 io_registry_entry_t entry
,
104 const io_name_t plane
,
105 IOOptionBits options
,
106 io_iterator_t
*iterator
108 #define IORegistryEntryCreateIterator _IORegistryEntryCreateIterator
111 _IORegistryEntryGetName (
112 io_registry_entry_t entry
,
115 #define IORegistryEntryGetName _IORegistryEntryGetName
118 _IORegistryEntryGetParentEntry (
119 io_registry_entry_t entry
,
120 const io_name_t plane
,
121 io_registry_entry_t
*parent
123 #define IORegistryEntryGetParentEntry _IORegistryEntryGetParentEntry
126 _IORegistryEntryGetPath (
127 io_registry_entry_t entry
,
128 const io_name_t plane
,
131 #define IORegistryEntryGetPath _IORegistryEntryGetPath
134 _IORegistryEntrySearchCFProperty (
135 io_registry_entry_t entry
,
136 const io_name_t plane
,
138 CFAllocatorRef allocator
,
141 #define IORegistryEntrySearchCFProperty _IORegistryEntrySearchCFProperty
144 _IOServiceGetMatchingServices (
145 mach_port_t masterPort
,
146 CFDictionaryRef matching
,
147 io_iterator_t
*existing
149 #define IOServiceGetMatchingServices _IOServiceGetMatchingServices
151 CFMutableDictionaryRef
155 #define IOServiceMatching _IOServiceMatching
158 #pragma mark Security.framework APIs
160 #if !TARGET_OS_IPHONE
162 CFTypeRef
_kSecAttrService();
163 #define kSecAttrService _kSecAttrService()
165 CFTypeRef
_kSecClass();
166 #define kSecClass _kSecClass()
168 CFTypeRef
_kSecClassGenericPassword();
169 #define kSecClassGenericPassword _kSecClassGenericPassword()
171 CFTypeRef
_kSecMatchLimit();
172 #define kSecMatchLimit _kSecMatchLimit()
174 CFTypeRef
_kSecMatchLimitAll();
175 #define kSecMatchLimitAll _kSecMatchLimitAll()
177 CFTypeRef
_kSecMatchSearchList();
178 #define kSecMatchSearchList _kSecMatchSearchList()
180 CFTypeRef
_kSecReturnRef();
181 #define kSecReturnRef _kSecReturnRef()
184 _AuthorizationMakeExternalForm (
185 AuthorizationRef authorization
,
186 AuthorizationExternalForm
*extForm
188 #define AuthorizationMakeExternalForm _AuthorizationMakeExternalForm
192 CFStringRef descriptor
,
193 CFArrayRef trustedlist
,
194 SecAccessRef
*accessRef
196 #define SecAccessCreate _SecAccessCreate
198 #if (__MAC_OS_X_VERSION_MIN_REQUIRED < 1070)
200 _SecAccessCreateFromOwnerAndACL (
201 const CSSM_ACL_OWNER_PROTOTYPE
*owner
,
203 const CSSM_ACL_ENTRY_INFO
*acls
,
204 SecAccessRef
*accessRef
206 #define SecAccessCreateFromOwnerAndACL _SecAccessCreateFromOwnerAndACL
207 #else // (__MAC_OS_X_VERSION_MIN_REQUIRED < 1070)
209 _SecAccessCreateWithOwnerAndACL (
212 SecAccessOwnerType ownerType
,
216 #define SecAccessCreateWithOwnerAndACL _SecAccessCreateWithOwnerAndACL
217 #endif // (__MAC_OS_X_VERSION_MIN_REQUIRED < 1070)
220 _SecItemCopyMatching (
221 CFDictionaryRef query
,
224 #define SecItemCopyMatching _SecItemCopyMatching
227 _SecKeychainCopyDomainDefault (
228 SecPreferencesDomain domain
,
229 SecKeychainRef
*keychain
231 #define SecKeychainCopyDomainDefault _SecKeychainCopyDomainDefault
234 _SecKeychainGetPreferenceDomain (
235 SecPreferencesDomain
*domain
237 #define SecKeychainGetPreferenceDomain _SecKeychainGetPreferenceDomain
241 const char *pathName
,
242 SecKeychainRef
*keychain
244 #define SecKeychainOpen _SecKeychainOpen
247 _SecKeychainSetDomainDefault (
248 SecPreferencesDomain domain
,
249 SecKeychainRef keychain
251 #define SecKeychainSetDomainDefault _SecKeychainSetDomainDefault
254 _SecKeychainSetPreferenceDomain (
255 SecPreferencesDomain domain
257 #define SecKeychainSetPreferenceDomain _SecKeychainSetPreferenceDomain
260 _SecKeychainItemCopyContent (
261 SecKeychainItemRef itemRef
,
262 SecItemClass
*itemClass
,
263 SecKeychainAttributeList
*attrList
,
267 #define SecKeychainItemCopyContent _SecKeychainItemCopyContent
270 _SecKeychainItemCreateFromContent (
271 SecItemClass itemClass
,
272 SecKeychainAttributeList
*attrList
,
275 SecKeychainRef keychainRef
,
276 SecAccessRef initialAccess
,
277 SecKeychainItemRef
*itemRef
279 #define SecKeychainItemCreateFromContent _SecKeychainItemCreateFromContent
282 _SecKeychainItemDelete (
283 SecKeychainItemRef itemRef
285 #define SecKeychainItemDelete _SecKeychainItemDelete
288 _SecKeychainItemFreeContent (
289 SecKeychainAttributeList
*attrList
,
292 #define SecKeychainItemFreeContent _SecKeychainItemFreeContent
295 _SecKeychainItemModifyContent (
296 SecKeychainItemRef itemRef
,
297 const SecKeychainAttributeList
*attrList
,
301 #define SecKeychainItemModifyContent _SecKeychainItemModifyContent
305 _SecTrustedApplicationCreateFromPath (
307 SecTrustedApplicationRef
*app
309 #define SecTrustedApplicationCreateFromPath _SecTrustedApplicationCreateFromPath
311 #endif // !TARGET_OS_IPHONE
314 _SecCertificateCreateWithData(
315 CFAllocatorRef allocator
,
318 #define SecCertificateCreateWithData _SecCertificateCreateWithData
322 #endif // _DY_FRAMEWORK_H