⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 vhidmou.cpp

📁 把USB访问的相关函数封装成DLL的源代码
💻 CPP
字号:
// vhidmou.cpp - Driver::Works HID minidriver sample
//=============================================================================
//
// Compuware Corporation
// NuMega Lab
// 9 Townsend West
// Nashua, NH 03060  USA
//
// Copyright (c) 1998 Compuware Corporation. All Rights Reserved.
// Unpublished - rights reserved under the Copyright laws of the
// United States.
//
//=============================================================================

// The Virtual HID Mouse is a HID minidriver that supplies 
// mouse input reports to HIDCLASS, without requiring any
// actual hardware. Instead. the driver accepts input from
// other drivers that call two exported entry points:
//
// 	VOID __stdcall MoveVirtualMouse(CHAR deltaX, CHAR deltaY)
//  VOID __stdcall ClickVirtualMouse(ULONG LeftOrRight, ULONG DownOrUp)
//

// This module implements the driver class. The device class in
// in module vmoudev.cpp.

#define VDW_MAIN
#include <khid.h> // Note: HID minidrivers include this rather than vdw.h

#include "vhidmou.h"	// the device class
#include "vmoudev.h"	// the driver class

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

DECLARE_DRIVER_CLASS(VirtualHidMouseDriver, NULL)

// Note: DriverEntry is inherited from KHidDriver

// End INIT section code
//////////////////////////////////////////////////////////////////////

#pragma code_seg()

// AddDevice
//
// Creates an instance of the device class
//
NTSTATUS VirtualHidMouseDriver::AddDevice(PDEVICE_OBJECT Fdo)
{
	NTSTATUS status;

	VirtualHidMouse* p = new (NonPagedPool) VirtualHidMouse(Fdo);

	if (p == NULL)
		status = STATUS_INSUFFICIENT_RESOURCES;

	else 
	{
		status = p->ConstructorStatus();
		if ( !NT_SUCCESS(status) )
			delete p;
	}

	return status;
}

⌨️ 快捷键说明

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