Quelltext /~heha/enas/Convac-Ätzer/uba.zip/src/usb.h

/* Crippled for uba (control request only) usage, heha 2019
 * libusb0.dll dynamically loaded; EXE load fill not fail when DLL not present.
 * Copyright (c) 2000-2003 Johannes Erdfelt <johannes@erdfelt.com>
 * Copyright (c) 2015      Nathan Hjelm <hjelmn@cs.unm.edu>
 */
#pragma once
#include <windows.h>
#include <pshpack1.h>

/* Device descriptor */
struct usb_device_descriptor {
 BYTE bLength;
 BYTE bDescriptorType;
 WORD bcdUSB;
 BYTE bDeviceClass;
 BYTE bDeviceSubClass;
 BYTE bDeviceProtocol;
 BYTE bMaxPacketSize0;
 WORD idVendor;
 WORD idProduct;
 WORD bcdDevice;
 BYTE iManufacturer;
 BYTE iProduct;
 BYTE iSerialNumber;
 BYTE bNumConfigurations;
};

struct usb_bus;
/* Data types */
/* To maintain compatibility with applications already built with libusb,
 * we must only add entries to the end of this structure. NEVER delete or
 * move members and only change types if you really know what you're doing.
 */
struct usb_device {
  usb_device *next, *prev;
  char filename[512];
  usb_bus *bus;
  usb_device_descriptor descriptor;
  struct usb_config_descriptor *config;
  void *dev;		/* Darwin support */
  BYTE devnum;
  BYTE num_children;
  usb_device **children;
};

struct usb_bus {
  usb_bus *next, *prev;
  char dirname[512];
  usb_device *devices;
  DWORD location;
  usb_device *root_dev;
};

struct usb_dev_handle;

#include <poppack.h>

/* Function pointers needed, all other DLL entries removed */
extern struct usb{
 HINSTANCE hLib;
 void(_cdecl*init)();
 int (_cdecl*find_busses)();
 int (_cdecl*find_devices)();
 usb_bus*(_cdecl*get_busses)();
 usb_dev_handle*(_cdecl*open)(usb_device*dev);
 int (_cdecl*close)(usb_dev_handle*dev);
 int (_cdecl*control_msg)(usb_dev_handle*dev, int requesttype, int request,int value, int index, char*bytes, int size, int timeout);
 int (_cdecl*set_configuration)(usb_dev_handle*dev, int configuration);
 int (_cdecl*claim_interface)(usb_dev_handle*dev, int iface);
 int (_cdecl*release_interface)(usb_dev_handle*dev, int iface);
}usb;

extern const char libusbEntries[];

#pragma warning(disable:4200)
struct dynaprocs{
 HINSTANCE hLib;	// Libname = erster String
 FARPROC proc[];	// dynamisches Array aus Funktionszeigern; die Länge ergibt sich aus der Anzahl der
 bool _fastcall dynaload(const char*e);
};			// …nullterminierten Strings (doppel-null-terminiert)
Vorgefundene Kodierung: ANSI (CP1252)4
Umlaute falsch? - Datei sei ANSI-kodiert (CP1252)