friendly.cpp

来自「Vc.Net入门与提高源码」· C++ 代码 · 共 57 行

CPP
57
字号
// Friendly.cpp
//
// This is a part of the Active Template Library.
// Copyright (c) Microsoft Corporation.  All rights reserved.
//
// This source code is only intended as a supplement to the
// Active Template Library Reference and related
// electronic documentation provided with the library.
// See these sources for detailed information regarding the
// Active Template Library product.

// Friendly.cpp : Defines the entry point for the DLL application.
//

#include "stdafx.h"
#include "friendly.h"

HMODULE g_hModule;
CFriendlyUrlFilter g_filter;

BOOL APIENTRY DllMain(
					HMODULE hModule, 
					DWORD  dwReasonForCall, 
					LPVOID lpReserved
					)
{
    if (dwReasonForCall == DLL_PROCESS_ATTACH)
	{
		g_hModule = hModule;
		DisableThreadLibraryCalls(hModule);
    }
    return TRUE;
}

extern "C" BOOL WINAPI GetFilterVersion(
					PHTTP_FILTER_VERSION pVer
					)
{
	return g_filter.GetFilterVersion(g_hModule, pVer);
}

extern "C" DWORD WINAPI HttpFilterProc(
					PHTTP_FILTER_CONTEXT pfc, 
					DWORD NotificationType, 
					LPVOID pvNotification 
					)
{
	return g_filter.HttpFilterProc(pfc, NotificationType, pvNotification);
}

extern "C" BOOL WINAPI TerminateFilter(
					DWORD dwFlags
					)
{
	return g_filter.TerminateFilter(dwFlags);
}

⌨️ 快捷键说明

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