40 lines
983 B
C
40 lines
983 B
C
#include <Windows.h>
|
|
#include <Dbt.h>
|
|
#include "hidsdi.h"
|
|
#include "hidclass.h"
|
|
#include "hidpddi.h"
|
|
#include "hidport.h"
|
|
#include "SetupAPI.h"
|
|
#include <stdio.h>
|
|
#include "malloc.h"
|
|
|
|
#pragma comment(lib,"setupapi.lib")
|
|
#pragma comment(lib,"hid.lib")
|
|
#pragma comment(lib,"comctl32.lib")
|
|
|
|
#ifndef BULKUSBH_INC
|
|
#define BULKUSBH_INC
|
|
|
|
#define BULKUSB_IOCTL_INDEX 0x0000
|
|
|
|
#define IOCTL_BULKUSB_GET_CONFIG_DESCRIPTOR CTL_CODE(FILE_DEVICE_UNKNOWN, \
|
|
0x0000, \
|
|
METHOD_BUFFERED, \
|
|
FILE_ANY_ACCESS)
|
|
|
|
#define IOCTL_BULKUSB_RESET_DEVICE CTL_CODE(FILE_DEVICE_UNKNOWN, \
|
|
0x0001, \
|
|
METHOD_BUFFERED, \
|
|
FILE_ANY_ACCESS)
|
|
|
|
#define IOCTL_BULKUSB_RESET_PIPE CTL_CODE(FILE_DEVICE_UNKNOWN,
|
|
0x0002, \
|
|
METHOD_BUFFERED, \
|
|
FILE_ANY_ACCESS)
|
|
|
|
extern HANDLE open_file(char *filename);
|
|
extern int GetUsbPath(char *path);
|
|
extern int WriteUsb(HANDLE hUsb, char *Outbuff, int len);
|
|
extern int ReadUsb(HANDLE hUsb, BYTE inbuff[], DWORD &nBytesRead, int nToRead);
|
|
|
|
#endif |