none
it does not work normally when i disabled a activex plugin 、 toolbar、BHO via registry!? RRS feed

  • 问题

  • i read these keys from below path:

    #define PLUGIN_REG_BHO "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Browser Helper Objects"
    #define PLUGIN_REG_EXTENSION "SOFTWARE\\Microsoft\\Internet Explorer\\Extensions"
    #define PLUGIN_REG_TOOLBAR "SOFTWARE\\Microsoft\\Internet Explorer\\Toolbar"
    #define PLUGIN_REG_ACTIVEX "Software\\Microsoft\\Windows\\CurrentVersion\\Ext\\Stats"
    #define PLUGIN_REG_SETTING "Software\\Microsoft\\Windows\\CurrentVersion\\Ext\\Settings"

    ps: i v considered 32bits and 64bits  oS situations.

    when is set  version and flags under .....Software\\Microsoft\\Windows\\CurrentVersion\\Ext\\Settings .

    it dosent work normally. 

    these is my code :

    if (enable) //启用插件
    {
    dwRes = RegOpenKeyEx(HKEY_USERS, szPluginSetting, 0, KEY_ALL_ACCESS | KEY_WOW64_64KEY, &hKey);
    if (ERROR_SUCCESS != dwRes)
    {
    m_ILogMgr->WriteLog(m_ILogMgr->levelDEBUG, "directop", "[%s] RegOpenKeyEx fail.Key:%s.Error code:%d", 
    __FUNCTION__, szPluginSetting, GetLastError());
    return true;
    }

    dwRes = RegDeleteKey(hKey, A2T(szCLSID));
    //dwRes = RegDeleteKeyEx(hKey, szCLSID, 0, 0);
    RegCloseKey(hKey);
    return ((dwRes == ERROR_SUCCESS) ? true : false);
    }
    else //禁用插件
    {
    swprintf(szKeyName, L"%s\\%s", szPluginSetting, A2T(szCLSID));
    dwRes = RegOpenKeyEx(HKEY_USERS, szKeyName, 0, KEY_ALL_ACCESS | KEY_WOW64_64KEY, &hKey);

    if (ERROR_SUCCESS != dwRes)
    {
    dwRes = RegCreateKeyEx(HKEY_USERS, szKeyName, 0, NULL, 0, KEY_ALL_ACCESS | KEY_WOW64_64KEY, NULL, &hKey, &dwDisposition);
    }

    if (ERROR_SUCCESS != dwRes)
    {
    m_ILogMgr->WriteLog(m_ILogMgr->levelDEBUG, "directop", "[%s] RegOpenKeyEx|RegCreateKeyEx fail.Key:%s.Error code:%d", 
    __FUNCTION__, szKeyName, GetLastError());
    return false;
    }

    dwData = 1;
    dwRes = RegSetValueEx(hKey, L"Version", 0, REG_SZ, (LPBYTE)"*", 1);
    dwRes = RegSetValueEx(hKey, L"Flags", 0, REG_DWORD, (LPBYTE)&dwData, sizeof(DWORD));

    2014年12月19日 9:50