#pragma once
#include "afxmt.h"

// {153FB5B3-49AC-414B-9A75-67919F191991}
static const GUID c_guidWFPSessionGuid =
{ 0x153fb5b3, 0x49ac, 0x414b, { 0x9a, 0x75, 0x67, 0x91, 0x9f, 0x19, 0x19, 0x91 } };

static PCTSTR c_szDnsFireWallSecName = _T("dns_firewall_settings");



// CDnsDbgLauncherApp
//class CDbgLauncherCallbacks;
class CDnsDbgLauncherApp : public CWinApp
{
	DECLARE_DYNCREATE(CDnsDbgLauncherApp)

public:
	CDnsDbgLauncherApp();
	virtual ~CDnsDbgLauncherApp();

public:
	virtual BOOL InitInstance();
	virtual int ExitInstance();

protected:
	DECLARE_MESSAGE_MAP()
public:
    bool m_bCmdLineError;
    CString m_sDebuggedFileName;
    CString m_sModuleFileName;
    int m_nRetCode;
    CString m_sModuleFolder;
    CString m_sInjectedDllName;
    bool m_bDbgActive;
    DWORD m_dwProcessId;
    DWORD m_dwThreadId;
    HANDLE m_hLaunchedProcess;
    HANDLE m_hLaunchedThread;
    virtual int Run();
    bool m_bEventLoopExit;
    bool m_bDbgProcessStarted;
    HANDLE m_hDbgExeFile;
    HANDLE m_hDbgProcess;
    HANDLE m_hDbgThread;
    CLoadRemoteDLL* m_pLoadRemoteDLL;
    BYTE* m_pBaseOfImage;
    DEBUG_EVENT m_stDebugEvent;
    DWORD OnCreateProcessDebugEvent();
    DWORD OnExitProcessDebugEvent();
    DWORD OnInitialBreakpointDebugEvent(EXCEPTION_RECORD* pExceptionInfo);
    CEvent m_oDnsSvcStopedEvent;
    bool m_bRestart;
    DWORD m_dwLauncherId;
    CEvent m_oRestartInitEvent;
    CEvent m_oDnsSvcRestartNeedEvent;
};

extern CDnsDbgLauncherApp theApp;
