edll1.cpp

来自「微软提供的截取Win32 API函数的开发包和例子detours-src-1.2」· C++ 代码 · 共 55 行

CPP
55
字号
//////////////////////////////////////////////////////////////////////////////
//
//	Module:		einst.exe/edll1.dll - Detours Test Program
//	File:		edll1.cpp
//	Author:		Galen C. Hunt
//
//  Copyright 1998-1999, Microsoft Corporation
//	http://www.research.microsoft.com/sn/detours
//
#include <stdio.h>
#include <windows.h>
#include <detours.h>

//////////////////////////////////////////////////////////////////// DLL Stuff
//
#define arrayof(x)		(sizeof(x)/sizeof(x[0]))

struct CPrivateStuff
{
	DETOUR_SECTION_HEADER	header;
	DETOUR_SECTION_RECORD 	record;
	CHAR					szMessage[32];
};

#pragma data_seg(".detour")

static CPrivateStuff private_stuff = {
	DETOUR_SECTION_HEADER_DECLARE(sizeof(CPrivateStuff)),
	{
		(sizeof(CPrivateStuff) - sizeof(DETOUR_SECTION_HEADER)),
		0,
		{ /* d9ab8a40-f4cc-11d1-b6d7-006097b010e3 */
			0xd9ab8a40,
			0xf4cc,
			0x11d1,
			{0xb6, 0xd7, 0x00, 0x60, 0x97, 0xb0, 0x10, 0xe3}
		}
	},
	"The First Dll!"
};
#pragma data_seg()

__declspec(dllexport) VOID WINAPI EDll1Function(VOID)
{
	return;
}

__declspec(dllexport) ULONG WINAPI
DllMain(HINSTANCE hInstance, DWORD dwReason, PVOID lpReserved)
{
	return TRUE;
}

///////////////////////////////////////////////////////////////// End of File.

⌨️ 快捷键说明

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