vcap.cpp

来自「2个avstream类型驱动演示」· C++ 代码 · 共 94 行

CPP
94
字号
// Vcap.cpp
//
// Generated by DriverWizard version DriverStudio 2.7.0 (Build 511)
// Requires Compuware's DriverWorks classes
//

// must be defined once (TODO: review!!)
#define KAVSTREAM_MAIN

#include	<vdw.h>
#include	<kavstream.h>

#include "Vcap.h"

#pragma hdrstop("Vcap.pch")

// Set a default 32-bit tag value to be stored with each heap block
// allocated by operator new. Use BoundsChecker to view the memory pool.
// This value can be overridden using the global function SetPoolTag().
POOLTAG DefaultPoolTag('pacV');

/////////////////////////////////////////////////////////////////////
// Begin INIT section
#pragma code_seg("INIT")

/////////////////////////////////////////////////////////////////////
// Declare driver 
//
DECLARE_KSMINIDRIVER_CLASS(VcapDriver)

////////////////////////////////////////////////////////////////////
// Tracer
KDebugOnlyTrace g_Trace("VcapDriver");

/////////////////////////////////////////////////////////////////////
//  VcapDriver::DriverEntry
//
//	Routine Description:
//		This is the first entry point called by the system when the
//		driver is loaded.
// 
//	Parameters:
//		RegistryPath - String used to find driver parameters in the
//			registry.  To locate Vcap look for:
//			HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Vcap
//
//	Return Value:
//		NTSTATUS - Return STATUS_SUCCESS if no errors are encountered.
//			Any other indicates to the system that an error has occured.
//
//	Comments:
//
NTSTATUS VcapDriver::DriverEntry(PUNICODE_STRING RegistryPath)
{
	UNREFERENCED_PARAMETER(RegistryPath);

	g_Trace << "VcapDriver::DriverEntry" << EOL;

	// Compile-time Design Check

	KsDesignRules<VcapDevice,VcapFilter,VcapPin>::Check();


	// Describe entities

	static KsDeviceDescriptor<VcapDevice>	Device;
	static KsFilterDescriptor<VcapFilter>	Filter;
	static KsPinDescriptor<VcapPin>			Pin;

	// Connect them into a hierarchy

	Device << (Filter << Pin);

#if DBG
	g_Trace << Device;		// dump the descriptor 
#endif

	// Finally, register the descriptrors with KS

	NTSTATUS status = ::KsInitializeDriver(*this, RegistryPath, Device);

	return status;
}


// 



// End INIT section
/////////////////////////////////////////////////////////////////////
#pragma code_seg()

⌨️ 快捷键说明

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