Example #1
0
void setAndCheckFeature( INTERNETFEATURELIST feature ) {
    HRESULT hr;
    hr = CoInternetSetFeatureEnabled( feature, SET_FEATURE_ON_PROCESS, true );
    LOGB_ERROR( hr != S_OK, "Feature could not be set : " + std::to_string( feature )  );
    hr = CoInternetIsFeatureEnabled( feature, SET_FEATURE_ON_PROCESS );
    LOGB_ERROR( hr != S_OK, "Feature is not set : " + std::to_string( feature )  );
}
Example #2
0
/**
*  ie内核线程函数
* @param lpszCmdline ie内核进程所用的父窗口句柄
*/
void RunIECore(LPCTSTR lpszCmdline)
{
	CRecordProgram::GetInstance()->RecordCommonInfo(MY_PRO_NAME, MY_THREAD_ID_INIT, L"进入RunIECore线程");

	//::DebugBreak();
	CExceptionHandle::MapSEtoCE();

		// 对历史信息的读写文件接口进行挂钩
		//CListManager::Initialize(false);
	if(! CListManager::_()->GetResult())
	{
		CRecordProgram::GetInstance()->FeedbackError(MY_PRO_NAME, MY_THREAD_ID_INIT, L"内核校验ListManager失败");
		return;
	}

	BankProtector::Init();
	// 设置进程内弹出窗口管理属性
	CoInternetSetFeatureEnabled(FEATURE_WEBOC_POPUPMANAGEMENT,SET_FEATURE_ON_PROCESS,TRUE);

	CoInitialize(NULL);

	// 初始化GDI对象
	Gdiplus::GdiplusStartupInput gdiplusStartupInput;
	ULONG_PTR gdiplusToken;
	Gdiplus::GdiplusStartup(&gdiplusToken, &gdiplusStartupInput, NULL);

	// Register Common Controls Class
	::AtlInitCommonControls(ICC_COOL_CLASSES | ICC_BAR_CLASSES);

	// Initialize
	CRegKeyManager::Initialize();

	CRecordProgram::GetInstance()->RecordCommonInfo(MY_PRO_NAME, MY_THREAD_ID_INIT, L"RegKeyManager初始化");


	// 对该ie页面的消息的处理进行挂钩
	CAxHookManager::Initialize();
	CInternetSecurityManagerImpl::Initialize();

	HWND hMainFrame = (HWND)_ttoi(lpszCmdline);	
	g_hMainFrame = hMainFrame; // gao

	DWORD dwThreadID;
	// 开启管理线程,界面线程


	::CloseHandle(::CreateThread(NULL, 0, _threadCheckState, (LPVOID)&hMainFrame, NULL, &dwThreadID));
	CRecordProgram::GetInstance()->RecordCommonInfo(MY_PRO_NAME, MY_THREAD_ID_INIT, L"开启监控线程");

	CAxUI axui;

	::SendMessage(hMainFrame, WM_MULTI_PROCESS_NOTIFY_AXUI_CREATED, 0, (LPARAM)axui.m_hWnd);
	CRecordProgram::GetInstance()->RecordCommonInfo(MY_PRO_NAME, MY_THREAD_ID_INIT, L"WM_MULTI_PROCESS_NOTIFY_AXUI_CREATED完成");
	// 将axui句柄保存到CprocessManager中
	CProcessManager::_()->OnAxUICreated (axui.m_hWnd);
	

	// 消息循环,等待新窗口创建的消息
	MSG msg;
	while (::GetMessage(&msg, NULL, 0, 0))
	{
		::TranslateMessage(&msg);
		::DispatchMessage(&msg);
	}

	try
	{
		CoUninitialize();
	}

	catch(CExceptionHandle eH)
	{
		eH.SetThreadName ("RunIECore Thread Error");
		eH.RecordException ();
	}
}