一个在Windows环境下允许用户程序访问USB设备的接口库的源代码.
源代码在线查看: debug.c
#include "libusb_filter.h" #include #include #include #define DEBUG_BUFFER_SIZE 1024 static int debug_level = DEBUG_MSG; void debug_print_nl(void) { if(debug_level) KdPrint((" ")); } void debug_set_level(int level) { debug_level = level; } void debug_printf(int level, char *format, ...) { char tmp[DEBUG_BUFFER_SIZE]; va_list args; if(level { va_start(args, format); vsprintf(tmp, format, args); va_end(args); KdPrint(("LIBUSB_FILTER - %s\n", tmp)); } }