dnsContext.serviceRef = OT_OPEN_INTERNET_SERVICES(kDefaultInternetServicesPath, NULL, &errOT); if (errOT != kOTNoError) return;     PR_ASSERT((dnsContext.serviceRef != NULL) && (errOT == kOTNoError));   errOT = OTInstallNotifier(dnsContext.serviceRef, DNS_NOTIFIER_ROUTINE, &dnsContext); PR_ASSERT(errOT == kOTNoError);   errOT = OTSetAsynchronous(dnsContext.serviceRef); PR_ASSERT(errOT == kOTNoError);
gOTInitialized = PR_FALSE;
void _MD_InitNetAccess(){    OSErr       err;    OSStatus    errOT;    PRBool      hasOTTCPIP = PR_FALSE;    PRBool      hasOT = PR_FALSE;    long        gestaltResult;    err = Gestalt(gestaltOpenTpt, &gestaltResult);    if (err == noErr)        if (gestaltResult & GESTALT_OPEN_TPT_PRESENT)            hasOT = PR_TRUE;        if (hasOT)        if (gestaltResult & GESTALT_OPEN_TPT_TCP_PRESENT)            hasOTTCPIP = PR_TRUE;            PR_ASSERT(hasOTTCPIP == PR_TRUE);#ifdef TARGET_CARBON    DNSNotifierRoutineUPP	=  NewOTNotifyUPP(DNSNotifierRoutine);    notifierRoutineUPP		=  NewOTNotifyUPP(NotifierRoutine);    errOT = OTAllocClientContext((UInt32)0, &clientContext);    PR_ASSERT(err == kOTNoError);#endif    errOT = INIT_OPEN_TRANSPORT();    PR_ASSERT(err == kOTNoError);	dnsContext.lock = PR_NewLock();	PR_ASSERT(dnsContext.lock != NULL);	dnsContext.thread = _PR_MD_CURRENT_THREAD();	dnsContext.cookie = NULL;	    dnsContext.serviceRef = OT_OPEN_INTERNET_SERVICES(kDefaultInternetServicesPath, NULL, &errOT);    if (errOT != kOTNoError) return;    /* no network -- oh well */    PR_ASSERT((dnsContext.serviceRef != NULL) && (errOT == kOTNoError));    /* Install notify function for DNR Address To String completion */    errOT = OTInstallNotifier(dnsContext.serviceRef, DNS_NOTIFIER_ROUTINE, &dnsContext);    PR_ASSERT(errOT == kOTNoError);    /* Put us into async mode */    errOT = OTSetAsynchronous(dnsContext.serviceRef);    PR_ASSERT(errOT == kOTNoError);/* XXX Does not handle absence of open tpt and tcp yet! */}