featurereports.h

来自「一本在讲述USB驱动程式的书 及其范例原码」· C头文件 代码 · 共 39 行

H
39
字号
// FeatureReports.h -- Declaration of feature report structures for HIDFAKE driver
// Copyright (C) 2002 by Walter Oney
// All rights reserved

// The HIDFAKE sample driver uses feature reports for out-of-bad communication
// between an application and the driver. This file, which is shared between
// the user-mode test applet and the driver, defines the format of the feature
// reports.

#pragma once

#include <pshpack1.h>

// Dummy VID/PID values to simplify test applet's scan. You *must* use your own
// unique values here, or else you'll likely collide with some other vendor's
// fake HID device.

#define HIDFAKE_VID		0x1234
#define HIDFAKE_PID		0x5678

///////////////////////////////////////////////////////////////////////////////

typedef struct _FEATURE_REPORT_GET_VERSION {
	UCHAR id;					// feature id (FEATURE_CODE_GET_VERSION)
	ULONG Version;				// driver revision level
	} FEATURE_REPORT_GET_VERSION, *PFEATURE_REPORT_GET_VERSION;

#define FEATURE_CODE_GET_VERSION	2

///////////////////////////////////////////////////////////////////////////////

typedef struct _FEATURE_REPORT_SET_BUTTON {
	UCHAR id;					// feature id (FEATURE_CODE_SET_BUTTON)
	UCHAR ButtonDown;			// TRUE if button 1 considered down, FALSE otherwise
	} FEATURE_REPORT_SET_BUTTON, *PFEATURE_REPORT_SET_BUTTON;

#define FEATURE_CODE_SET_BUTTON		3

#include <poppack.h>

⌨️ 快捷键说明

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