securitysystem.cpp

来自「网络游戏龙族 完整的登陆器 C++ 源代码」· C++ 代码 · 共 60 行

CPP
60
字号
// SecuritySystem.cpp: implementation of the CSecuritySystem class.
//
//////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "SecuritySystem.h"

#include "resource.h"
#include <atlbase.h>

#include "Common/Common.h"

#define ONE "0x3e28e1, 0xda26, 0x11e6, 0x1d, 0xd0, 0x1, 0xe0, 0x4c, 0x52, 0xf3, 0xe2"
#define MsgBox(msg) MessageBox(NULL, msg, "Dragonraja", MB_OK)

///////////////////////////////////////////////////////////////////////////////
// Construction/Destruction
///////////////////////////////////////////////////////////////////////////////

CSecuritySystem::CSecuritySystem()
{
	m_hSafeWnd = NULL;
}

CSecuritySystem::~CSecuritySystem()
{
	Disconnect();
}

///////////////////////////////////////////////////////////////////////////////
// Public Methdo
///////////////////////////////////////////////////////////////////////////////

int CSecuritySystem::Connect(HWND hWnd)
{
	HANDLE hObject = ::CreateMutex(NULL, FALSE, ONE);

	if (GetLastError() == ERROR_ALREADY_EXISTS)
	{
		::CloseHandle(hObject);
		return -1;
	}

	TCHAR szTempPath[_MAX_PATH];
    DWORD dwResult = ::GetTempPath(_MAX_PATH, szTempPath);
    Dbg_Assert(dwResult);
	
    UINT nResult = ::GetTempFileName(szTempPath, _T ("~Dr"), 0, m_szTempName);
    Dbg_Assert(nResult);

	::DeleteFile(m_szTempName);	
	
	if (!MakeExeFile(IDR_ETC_DATA1, m_szTempName))
	{	
		MsgBox("Run Error! \nERR.CODE.00-200!");
		return -2;
	}

	char szTemp[24];
	//盢纒壁HWND肚患

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?