亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? fileregistry.cpp

?? vxworks的完整的源代碼
?? CPP
字號:
/* unixRegistry.cpp - VxCOM Unix disk-based registry class *//* Copyright (c) 2001 Wind River Systems, Inc. *//*modification history--------------------01b,03jan02,nel  Remove T2OLE reference.01a,02oct01,dsellars  created*/#if defined (VXDCOM_PLATFORM_SOLARIS) || defined (VXDCOM_PLATFORM_LINUX)#include <dirent.h>#include <string>#include <fstream>#include <sys/param.h>#include <dlfcn.h>#include "comLib.h"#include "comObjLib.h"#include "private/comStl.h"#include "private/comMisc.h"////////////////////////////////////////////////////////////////////////////// The 'FileRegistry' class implements a 'plug-in' VxCOM registry for// Unix-based systems, where the coclasses are located in shared// libraries on disk. Each shared library must export a function// called DllGetClassObject() which must match the PFN_GETCLASSOBJECT// signature.//// A text-file (with extension .registry) is used to record the CLSIDs// and map them to shared libraries, which can be anywhere on the// system. The registration file must be in a directory which is// mentioned in the environment variable VXCOM_REGISTRY_PATH (which is// a list of directories, separated by colons, in the usual Unix way).//// Each line in the registry file must be of the form:-////  {CLSID}=/path/to/shared/library.so//// i.e. the string-form of the CLSID as defined by COM, followed by// the path to the shared-library itself.//class FileRegistry :    public CComObjectRoot,    public IRegistry    {  public:    virtual ~FileRegistry ();    FileRegistry ();    // IRegistry implementation...    HRESULT RegisterClass (REFCLSID, void*)        {        // Not required for this kind of registry...        return E_NOTIMPL;        }        HRESULT IsClassRegistered        (        REFCLSID                clsid        );    HRESULT CreateInstance        (        REFCLSID                clsid,        IUnknown *              pUnkOuter,        DWORD                   dwClsContext,        const char *            hint,        ULONG                   cMQIs,        MULTI_QI *              pMQIs        );    HRESULT GetClassObject        (        REFCLSID                clsid,        REFIID                  iid,        DWORD                   dwClsContext,        const char *            hint,        IUnknown **             ppClsObj        );    HRESULT GetClassID        (        DWORD                   dwIndex,        LPCLSID                 pclsid        );            // Load a .registry file...    int loadRegistryFile (const string& fileName);    BEGIN_COM_MAP(FileRegistry)        COM_INTERFACE_ENTRY(IRegistry)    END_COM_MAP()  private:    // Not implemented    FileRegistry (const FileRegistry& other);    FileRegistry& operator= (const FileRegistry& rhs);    // universal private instance-creation function    HRESULT instanceCreate        (        bool                    classMode,        REFCLSID                clsid,        IUnknown *              pUnkOuter,        DWORD                   dwClsContext,        const char *            hint,        ULONG                   cMQIs,        MULTI_QI *              pMQIs        );    // registry entry    struct entry        {        CLSID   clsid;        string  library;        entry (REFCLSID cid, const string& lib)          : clsid (cid), library (lib)            {}        entry ()            {}        };        typedef STL_MAP(CLSID, entry)       RegMap_t;    RegMap_t    m_regmap;    };typedef CComObject<FileRegistry> FileRegistryClass;////////////////////////////////////////////////////////////////////////////// theRegistryInstance - returns the single instance of FileRegistryClass//static HRESULT theRegistryInstance (FileRegistryClass **ppReg)    {    static FileRegistryClass* s_instance = 0;    if (! s_instance)        {        // Create one, add a ref to keep it around forever...        s_instance = new FileRegistryClass ();        if (! s_instance)            return E_FAIL;                s_instance->AddRef ();        }    *ppReg = s_instance;    return S_OK;    }////////////////////////////////////////////////////////////////////////////// comFileRegistryInit - initialise the Unix registry component//// This function reads all the registry files it can find, and adds// entries to the one-and-only instance of FileRegistryClass. It then// puts that registry into the VxCOM registry-list, so that classes// are accessible to CoCreateInstance() via this mechanism.//extern "C" int comFileRegistryInit ()     {    IRegistry* pReg;    FileRegistryClass* pur = 0;    // Find the one-and-only instance (adds a ref)...    HRESULT hr = theRegistryInstance (&pur);    if (FAILED (hr))        return hr;    // Get its IRegistry interface...    hr = pur->QueryInterface (IID_IRegistry, (void**) &pReg);    if (FAILED (hr))        return hr;    // Add it to the VxCOM registry...    hr = comRegistryAdd ("Unix Registry",                         CLSCTX_INPROC_SERVER,                         pReg);    // Done with the IRegistry interface...    pReg->Release ();    // Get path list...    const char* regPath = getenv ("VXCOM_REGISTRY_PATH");    if (! regPath)        return ERROR;    // Split into dirs...    string path (regPath);    size_t prev = 0;    size_t ix = 0;    while (ix != string::npos)        {        ix = path.find_first_of (':', prev);        string dirName = path.substr (prev, ix);        if (ix != string::npos)            prev = ix + 1;        if (dirName.length () == 0)            continue;        // Now look in this dir for *.registry files...        cout << "Searching directory " << dirName << endl;        DIR* dir = opendir (dirName.c_str ());        if (! dir)            {            perror (dirName.c_str ());            continue;            }        struct dirent* pDirent;        // Load them one by one...        while ((pDirent = readdir (dir)) != 0)            {            const string DOT_REGISTRY = ".registry";                        string f = pDirent->d_name;            if ((f.length () >= DOT_REGISTRY.length ()) &&                (f.rfind (DOT_REGISTRY) == (f.length() - DOT_REGISTRY.length ())))                {                // Found a file...                pur->loadRegistryFile (dirName + "/" + f);                }            }        // Tidy up...        closedir (dir);        }    // Clean up...    pur->Release ();    return S_OK;    }//////////////////////////////////////////////////////////////////////////FileRegistry::FileRegistry ()    {    }//////////////////////////////////////////////////////////////////////////FileRegistry::~FileRegistry ()    {    }////////////////////////////////////////////////////////////////////////////// FileRegistry::loadRegistryFile - load a .registry file//int FileRegistry::loadRegistryFile (const string& fileName)    {    cout << "Loading registry file " << fileName << endl;    ifstream str (fileName.c_str ());    if (! str)        return -1;    char buf [MAXPATHLEN + 40];    // big enough for GUID + path    while (str.getline (buf, sizeof (buf)))        {        string line = buf;        size_t eq = line.find_first_of ('=');        if (eq == string::npos)            continue;                string clsid = line.substr (0, eq);        string shlib = line.substr (eq+1, string::npos);                CLSID classid;        OLECHAR * pwsz = new OLECHAR [(strlen (clsid.c_str ()) + 1)];	comAsciiToWide (pwsz, clsid.c_str (), (strlen (clsid.c_str ()) + 1));        HRESULT hr = CLSIDFromString (pwsz, &classid);	delete []pwsz;        if (FAILED (hr))            return hr;        cout << "Registering CLSID " << clsid << endl             << "  for shared-lib " << shlib << endl;        m_regmap [classid] = entry (classid, shlib);        }        return 0;    }////////////////////////////////////////////////////////////////////////////// FileRegistry::IsClassRegistered - is class registered here?//HRESULT FileRegistry::IsClassRegistered    (    REFCLSID                clsid    )    {    RegMap_t::const_iterator i = m_regmap.find (clsid);    if (i == m_regmap.end ())        {        for (i = m_regmap.begin (); i != m_regmap.end (); ++i)            cout << (*i).first << endl;        return REGDB_E_CLASSNOTREG;        }    return S_OK;    }////////////////////////////////////////////////////////////////////////////// FileRegistry::CreateInstance - create an instance of the given class//HRESULT FileRegistry::CreateInstance    (    REFCLSID                clsid,    IUnknown *              pUnkOuter,    DWORD                   dwClsContext,    const char *            hint,    ULONG                   cMQIs,    MULTI_QI *              pMQIs    )    {    IClassFactory* pCF = 0;    // Get the class-factory...    HRESULT hr = GetClassObject (clsid,                                 IID_IClassFactory,                                 dwClsContext,                                 hint,                                 (IUnknown**) &pCF);        // Now get the instance...    IUnknown *punk = 0;    hr = pCF->CreateInstance (pUnkOuter, IID_IUnknown, (void**) &punk);    if (FAILED (hr))        return hr;    // Finished with the factory...    pCF->Release ();        // Ask for all the interfaces...    for (ULONG i = 0; i < cMQIs; ++i)        {        pMQIs[i].hr = punk->QueryInterface (*(pMQIs[i].pIID),                                            (void**) &pMQIs[i].pItf);        }        // Release our original ref...    punk->Release ();    return hr;    }////////////////////////////////////////////////////////////////////////////// FileRegistry::GetClassObject - get the class-factory object//HRESULT FileRegistry::GetClassObject    (    REFCLSID                clsid,    REFIID                  iid,    DWORD                   dwClsContext,    const char *            hint,    IUnknown **             ppClsObj    )    {    // Find the reg-entry...    RegMap_t::const_iterator i = m_regmap.find (clsid);    if (i == m_regmap.end ())        return REGDB_E_CLASSNOTREG;    string fileName = (*i).second.library;    // Open the shared-lib...    void* handle = dlopen (fileName.c_str (), RTLD_NOW | RTLD_GLOBAL);    if (! handle)        {        cout << dlerror () << endl;        return E_UNEXPECTED;        }        // Find the symbol...    PFN_GETCLASSOBJECT gco =        (PFN_GETCLASSOBJECT) dlsym (handle, "DllGetClassObject");    if (! gco)        {        dlclose (handle);        cout << dlerror () << endl;        return E_UNEXPECTED;        }    // Call the function to get the class-factory...    return gco (clsid, iid, (void**) ppClsObj);    }////////////////////////////////////////////////////////////////////////////// FileRegistry::GetClassID - enumerate class IDs//HRESULT FileRegistry::GetClassID    (    DWORD                   dwIndex,    LPCLSID                 pclsid    )    {    RegMap_t::const_iterator iter = m_regmap.begin ();    for (DWORD i = 0; i < dwIndex; ++i)        {        ++iter;        if (iter == m_regmap.end ())            return E_FAIL;        }    *pclsid = (*iter).first;            return S_OK;    }#endif  /* defined SOLARIS || LINUX */

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
福利一区二区在线| 在线观看区一区二| 日韩高清中文字幕一区| 国产欧美日韩精品在线| 在线播放中文一区| 99vv1com这只有精品| 激情图片小说一区| 香蕉影视欧美成人| 亚洲精品日韩综合观看成人91| 欧美xxxxx牲另类人与| 在线成人午夜影院| 欧美系列日韩一区| 在线亚洲一区观看| 99久久精品国产网站| 国产成+人+日韩+欧美+亚洲| 秋霞电影网一区二区| 亚洲亚洲人成综合网络| 亚洲视频一二三区| 中文成人av在线| 久久久美女艺术照精彩视频福利播放| 欧美日韩一区二区三区在线看 | 麻豆精品视频在线观看免费| 亚洲综合激情另类小说区| 18涩涩午夜精品.www| 国产亚洲女人久久久久毛片| 精品国产一区二区三区忘忧草 | 精品国产成人在线影院| 91精品国产黑色紧身裤美女| 欧美日韩在线免费视频| 在线观看精品一区| 欧美中文字幕一区二区三区亚洲| 91蜜桃免费观看视频| 99久久久久久99| 91亚洲精品一区二区乱码| 成人aa视频在线观看| 成人免费av网站| 不卡高清视频专区| 色综合天天狠狠| 在线观看视频一区二区欧美日韩| 99国产精品久久久久| 色av综合在线| 欧美日韩精品福利| 欧美一区二区日韩一区二区| 91精品国产一区二区三区蜜臀| 欧美一级免费观看| 精品国产三级a在线观看| 久久美女艺术照精彩视频福利播放| 2020日本不卡一区二区视频| 国产欧美一区二区精品性色| 国产精品卡一卡二卡三| 一区二区三区精品| 日本中文一区二区三区| 国内久久精品视频| 成人免费视频免费观看| 色猫猫国产区一区二在线视频| 欧亚一区二区三区| 亚洲午夜免费视频| 午夜久久福利影院| 久久se精品一区精品二区| 国产成人av资源| 一本色道久久综合亚洲aⅴ蜜桃| 欧美无砖专区一中文字| 日韩欧美成人一区二区| 日本一区二区三区四区在线视频 | 青青草国产成人99久久| 国产在线一区观看| 成人福利在线看| 欧美日韩国产中文| 久久免费看少妇高潮| 亚洲色图欧洲色图| 日韩高清中文字幕一区| 国产成人午夜精品影院观看视频 | 色综合久久久久| 7777精品伊人久久久大香线蕉 | 青青青爽久久午夜综合久久午夜| 国产在线乱码一区二区三区| av电影在线观看一区| 在线播放国产精品二区一二区四区 | 亚洲国产精品一区二区久久 | 精品一区二区三区视频| 成人激情视频网站| 欧美日韩不卡视频| 国产色产综合产在线视频| 一区二区三区中文字幕精品精品 | 91蝌蚪porny| 精品久久久久久久人人人人传媒| 777久久久精品| 欧美性做爰猛烈叫床潮| 欧美综合一区二区| 久久亚洲一区二区三区四区| 亚洲综合精品久久| 国产麻豆精品在线观看| 欧美性猛片aaaaaaa做受| 国产色综合一区| 欧美a一区二区| 色婷婷av一区二区三区软件| 久久亚洲精品国产精品紫薇| 亚洲国产精品久久久久秋霞影院| 国产黄色成人av| 亚洲日本va在线观看| 久久99精品久久久| 欧美日韩大陆一区二区| 亚洲精品视频免费观看| 粉嫩aⅴ一区二区三区四区| 欧美一区2区视频在线观看| 亚洲最大的成人av| 成人精品电影在线观看| 精品国产伦一区二区三区观看方式| 亚洲444eee在线观看| 色综合亚洲欧洲| 国产精品成人一区二区三区夜夜夜| 天天综合天天做天天综合| 717成人午夜免费福利电影| 日韩一区二区三| 91精品欧美久久久久久动漫| 欧美一级欧美一级在线播放| 一区二区三区日韩在线观看| 国产成人免费视频一区| 日韩免费电影网站| 青娱乐精品视频在线| 3atv一区二区三区| 午夜久久电影网| 欧美揉bbbbb揉bbbbb| 亚洲伊人色欲综合网| 91老师片黄在线观看| 中文字幕亚洲成人| 91亚洲精品一区二区乱码| **性色生活片久久毛片| eeuss鲁片一区二区三区在线观看| 欧美激情一区二区| 成人综合在线视频| 国产午夜精品久久| 国产精品一线二线三线| 日本一区二区三区高清不卡 | 蜜臀av性久久久久蜜臀aⅴ流畅 | 久久精品视频网| 91网站在线播放| 欧美国产一区视频在线观看| 国产成人一级电影| 99久久久无码国产精品| 国产精品网曝门| 国产高清一区日本| 欧美韩国日本综合| aaa欧美日韩| 亚洲欧美国产77777| 欧美综合亚洲图片综合区| 亚洲va国产va欧美va观看| 欧美老肥妇做.爰bbww视频| 日韩精品一二三区| 欧美mv日韩mv国产| 风间由美性色一区二区三区| 国产精品久久久久久妇女6080| 99久久免费国产| 亚洲h动漫在线| 日韩免费电影一区| 成人一区在线观看| 亚洲精品高清在线观看| 制服丝袜亚洲播放| 国产精品一区二区果冻传媒| √…a在线天堂一区| 欧美久久免费观看| 日本乱人伦aⅴ精品| 日韩精品91亚洲二区在线观看| 亚洲精品在线免费观看视频| 成人一区二区三区中文字幕| 日韩一区在线看| 国产欧美日韩综合| 91丨国产丨九色丨pron| 亚洲图片自拍偷拍| 精品国产乱码久久久久久图片 | 91.成人天堂一区| 极品美女销魂一区二区三区 | 99久久久免费精品国产一区二区| 亚洲五码中文字幕| 久久久久久久久久久久久久久99| 99久久99久久免费精品蜜臀| 无码av免费一区二区三区试看| 精品国产一区二区三区不卡| av成人老司机| 久久99精品国产麻豆不卡| 亚洲人成人一区二区在线观看| 欧美一区二区三区在线电影| 99免费精品在线| 乱中年女人伦av一区二区| 中文字幕在线不卡| 日韩美女一区二区三区| 欧洲一区二区三区在线| 国产成人亚洲综合a∨婷婷图片| 亚洲va欧美va人人爽| 国产精品免费视频网站| 日韩欧美国产一区二区在线播放| 91丨九色丨蝌蚪丨老版| 韩国女主播一区二区三区| 亚洲国产一二三| 亚洲欧洲精品一区二区精品久久久| 日韩亚洲欧美中文三级| 91久久奴性调教| 成人性色生活片| 韩国精品主播一区二区在线观看| 亚洲va国产va欧美va观看|