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 _IORegistryEntryGetRegistryEntryID (
135 io_registry_entry_t entry
,
138 #define IORegistryEntryGetRegistryEntryID _IORegistryEntryGetRegistryEntryID
141 _IORegistryEntrySearchCFProperty (
142 io_registry_entry_t entry
,
143 const io_name_t plane
,
145 CFAllocatorRef allocator
,
148 #define IORegistryEntrySearchCFProperty _IORegistryEntrySearchCFProperty
151 _IOServiceGetMatchingServices (
152 mach_port_t masterPort
,
153 CFDictionaryRef matching
,
154 io_iterator_t
*existing
156 #define IOServiceGetMatchingServices _IOServiceGetMatchingServices
158 CFMutableDictionaryRef
162 #define IOServiceMatching _IOServiceMatching
165 #pragma mark Security.framework APIs
167 #if !TARGET_OS_IPHONE
169 CFTypeRef
_kSecAttrService();
170 #define kSecAttrService _kSecAttrService()
172 CFTypeRef
_kSecClass();
173 #define kSecClass _kSecClass()
175 CFTypeRef
_kSecClassGenericPassword();
176 #define kSecClassGenericPassword _kSecClassGenericPassword()
178 CFTypeRef
_kSecMatchLimit();
179 #define kSecMatchLimit _kSecMatchLimit()
181 CFTypeRef
_kSecMatchLimitAll();
182 #define kSecMatchLimitAll _kSecMatchLimitAll()
184 CFTypeRef
_kSecMatchSearchList();
185 #define kSecMatchSearchList _kSecMatchSearchList()
187 CFTypeRef
_kSecReturnRef();
188 #define kSecReturnRef _kSecReturnRef()
191 _AuthorizationMakeExternalForm (
192 AuthorizationRef authorization
,
193 AuthorizationExternalForm
*extForm
195 #define AuthorizationMakeExternalForm _AuthorizationMakeExternalForm
199 CFStringRef descriptor
,
200 CFArrayRef trustedlist
,
201 SecAccessRef
*accessRef
203 #define SecAccessCreate _SecAccessCreate
205 #if (__MAC_OS_X_VERSION_MIN_REQUIRED < 1070)
207 _SecAccessCreateFromOwnerAndACL (
208 const CSSM_ACL_OWNER_PROTOTYPE
*owner
,
210 const CSSM_ACL_ENTRY_INFO
*acls
,
211 SecAccessRef
*accessRef
213 #define SecAccessCreateFromOwnerAndACL _SecAccessCreateFromOwnerAndACL
214 #else // (__MAC_OS_X_VERSION_MIN_REQUIRED < 1070)
216 _SecAccessCreateWithOwnerAndACL (
219 SecAccessOwnerType ownerType
,
223 #define SecAccessCreateWithOwnerAndACL _SecAccessCreateWithOwnerAndACL
224 #endif // (__MAC_OS_X_VERSION_MIN_REQUIRED < 1070)
227 _SecItemCopyMatching (
228 CFDictionaryRef query
,
231 #define SecItemCopyMatching _SecItemCopyMatching
234 _SecKeychainCopyDomainDefault (
235 SecPreferencesDomain domain
,
236 SecKeychainRef
*keychain
238 #define SecKeychainCopyDomainDefault _SecKeychainCopyDomainDefault
241 _SecKeychainGetPreferenceDomain (
242 SecPreferencesDomain
*domain
244 #define SecKeychainGetPreferenceDomain _SecKeychainGetPreferenceDomain
248 const char *pathName
,
249 SecKeychainRef
*keychain
251 #define SecKeychainOpen _SecKeychainOpen
254 _SecKeychainSetDomainDefault (
255 SecPreferencesDomain domain
,
256 SecKeychainRef keychain
258 #define SecKeychainSetDomainDefault _SecKeychainSetDomainDefault
261 _SecKeychainSetPreferenceDomain (
262 SecPreferencesDomain domain
264 #define SecKeychainSetPreferenceDomain _SecKeychainSetPreferenceDomain
267 _SecKeychainItemCopyContent (
268 SecKeychainItemRef itemRef
,
269 SecItemClass
*itemClass
,
270 SecKeychainAttributeList
*attrList
,
274 #define SecKeychainItemCopyContent _SecKeychainItemCopyContent
277 _SecKeychainItemCreateFromContent (
278 SecItemClass itemClass
,
279 SecKeychainAttributeList
*attrList
,
282 SecKeychainRef keychainRef
,
283 SecAccessRef initialAccess
,
284 SecKeychainItemRef
*itemRef
286 #define SecKeychainItemCreateFromContent _SecKeychainItemCreateFromContent
289 _SecKeychainItemDelete (
290 SecKeychainItemRef itemRef
292 #define SecKeychainItemDelete _SecKeychainItemDelete
295 _SecKeychainItemFreeContent (
296 SecKeychainAttributeList
*attrList
,
299 #define SecKeychainItemFreeContent _SecKeychainItemFreeContent
302 _SecKeychainItemModifyContent (
303 SecKeychainItemRef itemRef
,
304 const SecKeychainAttributeList
*attrList
,
308 #define SecKeychainItemModifyContent _SecKeychainItemModifyContent
312 _SecTrustedApplicationCreateFromPath (
314 SecTrustedApplicationRef
*app
316 #define SecTrustedApplicationCreateFromPath _SecTrustedApplicationCreateFromPath
318 #endif // !TARGET_OS_IPHONE
321 _SecCertificateCreateWithData(
322 CFAllocatorRef allocator
,
325 #define SecCertificateCreateWithData _SecCertificateCreateWithData
329 #endif // _DY_FRAMEWORK_H