pluginDir->Append(NS_LITERAL_CSTRING("Essential Files")); pluginDir->Append(NS_LITERAL_CSTRING("PrintDialogPDE.plugin"));
pluginDir->AppendNative(NS_LITERAL_CSTRING("Essential Files")); pluginDir->AppendNative(NS_LITERAL_CSTRING("PrintDialogPDE.plugin"));
static CFPlugInRef LoadPDEPlugIn(){#ifndef XP_MACOSX    if (!gPDEPlugIn) {                nsresult rv;            nsCOMPtr<nsIProperties> dirService(do_GetService(NS_DIRECTORY_SERVICE_CONTRACTID));        if (!dirService)            return nsnull;        nsCOMPtr<nsILocalFileMac> pluginDir;        rv = dirService->Get(NS_XPCOM_CURRENT_PROCESS_DIR, NS_GET_IID(nsILocalFileMac), getter_AddRefs(pluginDir));        if (NS_FAILED(rv))            return nsnull;        pluginDir->Append(NS_LITERAL_CSTRING("Essential Files"));        pluginDir->Append(NS_LITERAL_CSTRING("PrintDialogPDE.plugin"));        FSSpec pluginSpec;        rv = pluginDir->GetFSSpec(&pluginSpec);        if (NS_FAILED(rv))            return nsnull;                    OSErr err;        FSRef pluginFSRef;        char pathBuf[512];                err = ::FSpMakeFSRef(&pluginSpec, &pluginFSRef);        if (err)            return nsnull;        err = ::FSRefMakePath(&pluginFSRef, (UInt8 *)pathBuf, sizeof(pathBuf)-1);        if (err)            return nsnull;                    CFStringRef pathRef = ::CFStringCreateWithCString(NULL, pathBuf, kCFStringEncodingUTF8);        if (!pathRef)            return nsnull;        CFURLRef url = ::CFURLCreateWithFileSystemPath(NULL, pathRef, kCFURLPOSIXPathStyle, TRUE);        if (url)            gPDEPlugIn = ::CFPlugInCreate(NULL, url);                ::CFRelease(pathRef);            ::CFRelease(url);       }#endif    return gPDEPlugIn;}