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

📄 usbsoftlockdevice.h

📁 < FPGA数字电子系统设计与开发实例导航> 一书的代码
💻 H
字号:
// USBSoftLockDevice.h
//
// Generated by DriverWizard version DriverStudio 2.7.0 (Build 562)
// Requires Compuware's DriverWorks classes
//

#ifndef __USBSoftLockDevice_h__
#define __USBSoftLockDevice_h__

#define PASSWORD_LENGTH			8
#define REQUEST_GET_PASSWORD	0xF0
#define REQUEST_SET_PASSWORD_HIGH	0xF1
#define REQUEST_SET_PASSWORD_LOW	0xF2
#define OPERATION_TIMEOUT		1000L

	// Forward declaration
class USBSoftLockDevice;

struct USB_COMPLETION_INFO
{
	PURB m_pUrb;
	USBSoftLockDevice* m_pClass;
};

class USBSoftLockDevice : public KPnpDevice
{
	// Constructors
public:
	SAFE_DESTRUCTORS;
	USBSoftLockDevice(PDEVICE_OBJECT Pdo, ULONG Unit);
	~USBSoftLockDevice();

	// Member Functions
public:
	DEVMEMBER_DISPATCHERS
	MEMBER_COMPLETEIRPWITHCONTEXT(USB_COMPLETION_INFO, ReadComplete)
	MEMBER_COMPLETEIRPWITHCONTEXT(USB_COMPLETION_INFO, WriteComplete)
	virtual NTSTATUS OnStartDevice(KIrp I);
	virtual NTSTATUS OnStopDevice(KIrp I);
	virtual NTSTATUS OnRemoveDevice(KIrp I);
	virtual NTSTATUS DefaultPnp(KIrp I);
	virtual NTSTATUS DefaultPower(KIrp I);
	virtual NTSTATUS OnDevicePowerUp(KIrp I);
	virtual NTSTATUS OnDeviceSleep(KIrp I);
	NTSTATUS USBSOFTLOCK_IOCTL_GET_PASSWORD_Handler(KIrp I);
	NTSTATUS USBSOFTLOCK_IOCTL_SET_PASSWORD_Handler(KIrp I);

#ifdef _COMMENT_ONLY

		// The following member functions are actually defined by the
		// 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 Developer Studio using the class browser.

	NTSTATUS __stdcall ReadComplete(KIrp I, USB_COMPLETION_INFO* pContext); // COMMENT_ONLY
	NTSTATUS __stdcall WriteComplete(KIrp I, USB_COMPLETION_INFO* pContext); // COMMENT_ONLY
	virtual NTSTATUS CleanUp(KIrp I);				// COMMENT_ONLY
	virtual NTSTATUS Create(KIrp I);				// COMMENT_ONLY
	virtual NTSTATUS Close(KIrp I);					// COMMENT_ONLY
	virtual NTSTATUS DeviceControl(KIrp I);			// COMMENT_ONLY
	virtual NTSTATUS SystemControl(KIrp I);			// COMMENT_ONLY
	virtual NTSTATUS Read(KIrp I);					// COMMENT_ONLY
	virtual NTSTATUS Write(KIrp I);					// COMMENT_ONLY
#endif

	// Member Data
protected:
		// Unit number for this device (0-9)
	ULONG				m_Unit;
	KUsbLowerDevice		m_Lower;
	KUsbInterface   	m_Interface;
		// Pipe for USB endpoint 1 IN (address 0x81)
	KUsbPipe			m_Endpoint1IN;
		// Pipe for USB endpoint 1 OUT (address 0x1)
	KUsbPipe			m_Endpoint1OUT;
		// Pipe for USB endpoint 2 IN (address 0x82)
	KUsbPipe			m_Endpoint2IN;
		// Pipe for USB endpoint 2 OUT (address 0x2)
	KUsbPipe			m_Endpoint2OUT;
};

#endif

⌨️ 快捷键说明

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