Lines Matching defs:dll

106     nsDll *dll;
107 rv = CreateDll(nsnull, aLocation, &dll);
111 if (!dll)
114 if (!dll->IsLoaded()) {
117 dll->GetDisplayPath(displayPath);
123 if (!dll->Load()) {
133 DumpLoadError(dll, "GetFactory", errorMsg);
145 rv = GetFactoryFromModule(dll, aCID, _retval);
152 // If the dll failed to get us a factory. But the dll registered that
154 // We cannot just delete the dll as the dll could be hosting
157 // creating the object, we will query the dll again. Since the
158 // dll is loaded, this aint a big hit. So for optimized builds
263 nsFreeLibrary(nsDll *dll, nsIServiceManager *serviceMgr, PRInt32 when)
267 if (!dll || dll->IsLoaded() == PR_FALSE)
272 // Get if the dll was marked for unload in an earlier round
273 PRBool dllMarkedForUnload = dll->IsMarkedForUnload();
275 // Reset dll marking for unload just in case we return with
277 dll->MarkForUnload(PR_FALSE);
284 rv = dll->GetModule(NS_STATIC_CAST(nsIComponentManager*, nsComponentManagerImpl::gComponentManager),
292 // When shutting down, whether we can unload the dll or not,
293 // we will shutdown the dll to release any memory it has got
296 dll->Shutdown();
304 dll->GetDisplayPath(displayPath);
319 dll->GetDisplayPath(displayPath);
328 rv = dll->Unload();
335 dll->GetDisplayPath(displayPath);
346 dll->GetDisplayPath(displayPath);
365 nsDll *dll = (nsDll *) aData;
367 nsFreeLibrary(dll,
376 * Given a dll abstraction, this will load, selfregister the dll and
377 * unload the dll.
381 nsNativeComponentLoader::SelfRegisterDll(nsDll *dll,
385 // Precondition: dll is not loaded already, unless we're deferred
386 PR_ASSERT(deferred || dll->IsLoaded() == PR_FALSE);
393 if (dll->Load() == PR_FALSE)
395 // Cannot load. Probably not a dll.
400 DumpLoadError(dll, "SelfRegisterDll", errorMsg);
407 dll->GetDisplayPath(displayPath);
416 res = dll->GetModule(mCompMgr, getter_AddRefs(mobj));
424 * the value of 'dll' to get nulled out! The two seem to be *
427 nsresult res2 = dll->GetDllSpec(getter_AddRefs(fs)); // don't change 'res2' -- see warning, above
442 dll->GetDisplayPath(displayPath);
444 ("nsNativeComponentLoader: dll->GetDllSpec() on %s FAILED.",
451 // Update the timestamp and size of the dll in registry
466 res = dll->GetDllSpec(getter_AddRefs(fs));
484 nsNativeComponentLoader::DumpLoadError(nsDll *dll,
490 if (nsnull == dll || nsnull == aNsprErrorMsg)
536 dll->GetDisplayPath(displayPath);
558 nsNativeComponentLoader::SelfUnregisterDll(nsDll *dll)
565 if (dll->Load() == PR_FALSE)
567 // Cannot load. Probably not a dll.
573 res = dll->GetModule(mCompMgr, getter_AddRefs(mobj));
578 dll->GetDisplayPath(displayPath);
584 res = dll->GetDllSpec(getter_AddRefs(fs));
635 nsDll *dll = NULL;
636 rv = CreateDll(component, persistentDescriptor, &dll);
637 if (NS_FAILED(rv) || dll == NULL) return rv;
639 rv = SelfUnregisterDll(dll);
643 dll->GetDisplayPath(displayPath);
653 // Remove any autoreg info about this dll
680 ".dll", /* Windows */
764 static const char s_szSuff[] = "-x86.dll";
766 static const char s_szSuff[] = ".dll";
767 static const char s_szSuffInvalid[] = "-x86.dll";
812 // Get the registry representation of the dll, if any
813 nsDll *dll;
814 rv = CreateDll(component, persistentDescriptor, &dll);
818 if (dll != NULL)
820 // We already have seen this dll. Check if this dll changed
821 if (!dll->HasChanged())
825 dll->GetDisplayPath(displayPath);
836 // Aagh! the dll has changed since the last time we saw it.
837 // re-register dll
855 if (NS_SUCCEEDED(dll->GetDllSpec(getter_AddRefs(dllSpec))) && dllSpec)
870 if (dll->IsLoaded())
872 // We loaded the old version of the dll and now we find that the
873 // on-disk copy if newer. Try to unload the dll.
877 rv = nsFreeLibrary(dll, serviceMgr, when);
882 // this dll.
885 dll->GetDisplayPath(displayPath);
895 // dll doesn't have a CanUnload proc. Guess it is
897 dll->Unload();
900 dll->GetDisplayPath(displayPath);
907 } // dll isloaded
910 if (dll->IsLoaded())
912 // We went through all the above to make sure the dll
913 // is unloaded. And here we are with the dll still
917 dll->GetDisplayPath(displayPath);
924 } // dll != NULL
927 // Create and add the dll to the mDllStore
930 // when we encounter the same dll.
931 dll = new nsDll(component, this);
932 if (dll == NULL)
934 mDllStore.Put(&key, (void *) dll);
935 } // dll == NULL
937 // Either we are seeing the dll for the first time or the dll has
940 // Now we can try register the dll for sure.
941 nsresult res = SelfRegisterDll(dll, persistentDescriptor, PR_FALSE);
946 mDeferredComponents.AppendElement(dll);
952 dll->GetDisplayPath(displayPath);
965 dll->GetDisplayPath(displayPath);
971 // Marking dll along with modified time and size in the
992 nsDll *dll = NS_STATIC_CAST(nsDll *, mDeferredComponents[i]);
993 nsresult rv = SelfRegisterDll(dll,
1041 // The only way to create a dll or get it from the dll cache. This will
1044 // 1. Autoregister will create one for each dll it is trying to register. This
1049 // the registry represented name of the dll. If modtime and size are zero,
1053 // 3. Prepopulation of dllCache A dll object created off a registry entry.
1054 // Specifically dll name is stored in rel: or abs: or lib: formats in the
1062 nsDll *dll;
1068 dll = (nsDll *)mDllStore.Get(&key);
1069 if (dll)
1071 *aDll = dll;
1091 if (!dll)
1093 dll = new nsDll(spec, this);
1094 if (!dll)
1098 *aDll = dll;
1099 mDllStore.Put(&key, dll);