-#if 0
-void CCallbackMgr::AddCallbackUPP(KCCallbackUPP inCallbackFunction,
- KCEventMask inEventMask,
- void* inContext)
-{
- CallbackInfo info( reinterpret_cast<SecKeychainCallbackProcPtr>(inCallbackFunction), inEventMask, inContext );
- CallbackInfo existingInfo;
-
-#if TARGET_API_MAC_OS8
- OSErr err = noErr;
- err = ::GetCurrentProcess( &info.mProcessID );
- KCThrowIf_( err );
-#endif
-
- CallbackInfoListIterator ix = find( CCallbackMgr::Instance().mEventCallbacks.begin(),
- CCallbackMgr::Instance().mEventCallbacks.end(), info );
-
- // make sure it is not already there
- if ( ix!=CCallbackMgr::Instance().mEventCallbacks.end() )
- {
- // It's already there. This could mean that the old process died unexpectedly,
- // so we need to validate the process ID of the existing callback.
-#if TARGET_API_MAC_OS8
- if (ValidProcess(ix->mProcessID)) // existing callback is OK, so don't add this one.
- MacOSError::throwMe(errKCDuplicateCallback);
-
- // Process is gone, so remove the old entry
- CCallbackMgr::Instance().mEventCallbacks.erase(ix);
-#else
- // On Mac OS X this list is per process so this is always a duplicate
- MacOSError::throwMe(errKCDuplicateCallback);
-#endif
- }
-
- CCallbackMgr::Instance().mEventCallbacks.push_back(info);
-}
-#endif
-