Source

gb_emulator / gb_debugger_msvs / program_provider.h

Full commit
/*  Copyright Š 2011 Chris Spencer <spencercw@gmail.com>

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */

#pragma once

#include <atlbase.h>
#include <atlcom.h>

#include "gb_debugger_msvs_i.h"

#if defined(_WIN32_WCE) && !defined(_CE_DCOM) && !defined(_CE_ALLOW_SINGLE_THREADED_OBJECTS_IN_MTA)
#error "Single-threaded COM objects are not properly supported on Windows CE platform, such as the Windows Mobile platforms that do not include full DCOM support. Define _CE_ALLOW_SINGLE_THREADED_OBJECTS_IN_MTA to force ATL to support creating single-thread COM object's and allow use of it's single-threaded COM object implementations. The threading model in your rgs file was set to 'Free' as that is the only threading model supported in non DCOM Windows CE platforms."
#endif

using namespace ATL;

class ATL_NO_VTABLE CProgramProvider :
	public CComObjectRootEx<CComSingleThreadModel>,
	public CComCoClass<CProgramProvider, &CLSID_ProgramProvider>,
	public IDebugProgramProvider2
{
public:
	CProgramProvider()
	{
	}

DECLARE_REGISTRY_RESOURCEID(IDR_PROGRAMPROVIDER)

BEGIN_COM_MAP(CProgramProvider)
	COM_INTERFACE_ENTRY(IDebugProgramProvider2)
END_COM_MAP()

	// IDebugProgramProvider2
	STDMETHOD(GetProviderProcessData)(
		PROVIDER_FLAGS Flags,
		IDebugDefaultPort2 *pPort,
		AD_PROCESS_ID processId,
		CONST_GUID_ARRAY EngineFilter,
		PROVIDER_PROCESS_DATA *pProcess);
	STDMETHOD(GetProviderProgramNode)(
		PROVIDER_FLAGS Flags,
		IDebugDefaultPort2 *pPort,
		AD_PROCESS_ID processId,
		const GUID &guidEngine,
		UINT64 programId,
		IDebugProgramNode2 **ppProgramNode);
	STDMETHOD(WatchForProviderEvents)(
		PROVIDER_FLAGS Flags,
		IDebugDefaultPort2 *pPort,
		AD_PROCESS_ID processId,
		CONST_GUID_ARRAY EngineFilter,
		const GUID & guidLaunchingEngine,
		IDebugPortNotify2 *pEventCallback);
	STDMETHOD(SetLocale)(WORD wLangID);

	DECLARE_PROTECT_FINAL_CONSTRUCT()

	HRESULT FinalConstruct()
	{
		return S_OK;
	}

	void FinalRelease()
	{
	}
};

OBJECT_ENTRY_AUTO(__uuidof(ProgramProvider), CProgramProvider)