if (filepath.IsEmpty()) { return NS_ERROR_UNEXPECTED; }
HRESULT hres = CoCreateInstance(CLSID_ShellLink, NULL, CLSCTX_INPROC_SERVER, IID_IShellLink, (void**)&mShellLink); if (SUCCEEDED(hres)) {  hres = mShellLink->QueryInterface(IID_IPersistFile, (void**)&mPersistFile); }
        nsresult Init(nsILocalFile* parent)        {            nsCAutoString filepath;            parent->GetNativeTarget(filepath);            if (filepath.IsEmpty())            {                parent->GetNativePath(filepath);            }            if (filepath.IsEmpty())            {                return NS_ERROR_UNEXPECTED;            }            mDir = PR_OpenDir(filepath.get());            if (mDir == nsnull)    // not a directory?                return NS_ERROR_FAILURE;            mParent = parent;            return NS_OK;        }