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

📄 forusbdevice.h

📁 赠送两个学生毕业设计
💻 H
字号:
// ForUsbDevice.h
//
// Generated by DriverWizard 3.2.0 (Build 2485)
// Requires DDK and DriverWorks
// File created on 6/8/2007
//
// This include file contains the definition of a subclass of KPnpDevice.
// WDM drivers declare a subclass of KPnpDevice and override member
// functions to handle requests (IRPs) from the system.
//
#ifndef __FORUSBDEVICE_H__
#define __FORUSBDEVICE_H__

class ForUsbDevice : public KPnpDevice
{
public:
	SAFE_DESTRUCTORS;
	ForUsbDevice(PDEVICE_OBJECT Pdo, ULONG Unit);
	~ForUsbDevice();
	VOID Invalidate(void);

	// Member functions
	DEVMEMBER_DISPATCHERS

	virtual NTSTATUS OnStartDevice(KIrp I);
	virtual NTSTATUS OnStopDevice(KIrp I);
	virtual NTSTATUS OnRemoveDevice(KIrp I);
	virtual	NTSTATUS OnQueryCapabilities(KIrp I);
	MEMBER_COMPLETEIRP(ForUsbDevice, OnQueryCapabilitiesComplete)
	virtual NTSTATUS OnDevicePowerUp(KIrp I);
	virtual NTSTATUS OnDeviceSleep(KIrp I);
	virtual NTSTATUS DefaultPnp(KIrp I);
	virtual NTSTATUS DefaultPower(KIrp I);

	typedef struct _USB_COMPLETION_INFO
	{
		PURB m_pUrb;
		ForUsbDevice* m_pClass;
	} USB_COMPLETION_INFO, *PUSB_COMPLETION_INFO;

	MEMBER_COMPLETEIRPWITHCONTEXT(USB_COMPLETION_INFO, IoComplete)
	void TestBusInterface();

	void SerialRead(KIrp I);
	void SerialWrite(KIrp I);
	void Serial_IOCTL_Read_Handler(KIrp I);
	void Serial_IOCTL_Write_Handler(KIrp I);

protected:
	// Member data
	KUsbLowerDevice		m_Lower;
	KUsbInterface   	m_Interface;
	KUsbPipe			Pipe0;	// Pipe for USB endpoint address 81, type INTERRUPT
	KUsbPipe			Pipe1;	// Pipe for USB endpoint address 1, type INTERRUPT
	KUsbPipe			Pipe2;	// Pipe for USB endpoint address 82, type BULK
	KUsbPipe			Pipe3;	// Pipe for USB endpoint address 2, type BULK
#if (_WDM_ && (WDM_MAJORVERSION > 1 || ((WDM_MAJORVERSION == 1) && (WDM_MINORVERSION >= 0x20))))
	KUsbBusInterface	m_BusIntf;	// Direct client access to USB bus on Windows XP and above
	BOOLEAN				m_fBusIntfAvailable;
#endif
	// TODO:	Review the driver managed queues.  The wizard uses one or
	//			more instances of the same ForUsbQueue class. 
	//			Review that the number of queue instances is correct.
	//			You might choose to derive another class.
	ForUsbQueue	Pipe2Queue;	// Driver managed IRP queue
	ForUsbQueue	Pipe3Queue;	// Driver managed IRP queue

#ifdef __COMMENT_ONLY
		// The following member functions are actually defined by 
		// a DEVMEMBER_XXX or MEMBER_XXX macro (such as DEVMEMBER_DISPATCHERS).
		// The macro __COMMENT_ONLY never gets defined.  These comment-only
		// definitions simply allow easy navigation to the functions within
		// the Visual Studio IDE using the class browser.
	virtual NTSTATUS Create(KIrp I); 				// COMMENT_ONLY
	virtual NTSTATUS Close(KIrp I);					// COMMENT_ONLY
	virtual NTSTATUS Read(KIrp I);			  		// COMMENT_ONLY
	virtual NTSTATUS Write(KIrp I);					// COMMENT_ONLY
	virtual NTSTATUS DeviceControl(KIrp I);			// COMMENT_ONLY
	virtual NTSTATUS CleanUp(KIrp I); 				// COMMENT_ONLY
	virtual NTSTATUS SystemControl(KIrp I);			// COMMENT_ONLY
#endif // __COMMENT_ONLY
};

#endif // __FORUSBDEVICE_H__

⌨️ 快捷键说明

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