* Copyright (c) 2014 Google, Inc. All rights reserved.
* Copyright (c) 2007-2008 VMware, Inc. All rights reserved.
* **********************************************************/
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* * Neither the name of VMware, Inc. nor the names of its contributors may be
* used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL VMWARE, INC. OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
* DAMAGE.
*/
#if !defined(AFX_DYNAMORIO_H__23EBE600_BBF9_4F81_B49E_8CA6E806E7F8__INCLUDED_)
# define AFX_DYNAMORIO_H__23EBE600_BBF9_4F81_B49E_8CA6E806E7F8__INCLUDED_
# include "configure.h"
# if _MSC_VER > 1000
# pragma once
# endif
# ifndef __AFXWIN_H__
# error include 'stdafx.h' before including this file for PCH
# endif
# include "resource.h"
# include "MainFrm.h"
# include "DynamoRIODoc.h"
# include "DynamoRIOView.h"
# define MYMBFLAGS MB_TOPMOST | MB_ICONEXCLAMATION
# ifdef UNICODE
# define ASCII_PRINTF _T("S")
# define UNICODE_PRINTF _T("s")
# else
# define ASCII_PRINTF _T("s")
# define UNICODE_PRINTF _T("S")
# endif
class CDynamoRIOApp : public CWinApp {
public:
# ifndef DRSTATS_DEMO
BOOL
ConfigureForNewUser();
void
SetEnvVarPermanently(TCHAR *var, TCHAR *val);
void
PreExit();
BOOL
RunNewApp(LPCTSTR lpszFileName);
# endif
CDocument *
OpenDocumentFile(LPCTSTR lpszFileName);
CDynamoRIOApp();
static CDynamoRIOView *
GetActiveView();
static BOOL
CDynamoRIOApp::GetWindowsVersion(OSVERSIONINFOW *version);
# ifndef DRSTATS_DEMO
static BOOL
SystemwideSet();
static TCHAR *
GetDllPath();
static DLL_TYPE
GetDllType();
static void
SetSystemwideSetting(int val);
static void
AboutToExit();
# endif
static void
SetStatusbarText(TCHAR *txt);
public:
virtual BOOL
InitInstance();
virtual int
ExitInstance();
afx_msg void
OnAppAbout();
afx_msg void
OnAppExit();
# ifndef DRSTATS_DEMO
afx_msg void
OnEditOptions();
afx_msg void
OnLibraryRelease();
afx_msg void
OnLibraryProfile();
afx_msg void
OnLibraryDebug();
afx_msg void
OnFileRun();
afx_msg void
OnFileSystemwide();
afx_msg void
OnHelpHelp();
afx_msg void
OnEditIgnorelist();
# endif
DECLARE_MESSAGE_MAP()
protected:
BOOL
CheckWindowsVersion(BOOL &windows_NT);
CMainFrame *m_pMainFrame;
# ifndef DRSTATS_DEMO
void
DisableMissingLibraries(BOOL notify);
void
DisableSystemwideInject();
BOOL m_bSystemwideAllowed;
BOOL
SetSystemwideInject(TCHAR *val);
BOOL m_bInjectAll;
BOOL
SwitchLibraries(TCHAR *newdllpath, BOOL notify);
TCHAR m_dynamorio_home[_MAX_DIR];
TCHAR m_inject_all_value[MAX_PATH];
TCHAR m_dll_path[MAX_PATH];
DLL_TYPE m_dll_type;
# endif
};
#endif