Thread Win32::API und LibUSB-Win32 (36 answers)
Opened by rosti at 2017-02-03 11:40

rosti
 2017-02-04 16:19
#186030 #186030
User since
2011-03-19
3180 Artikel
BenutzerIn
[Homepage]
user image
Aus der Doku rauskopiert:

Code (perl): (dl )
1
2
3
my $Point = Win32::API::Struct->new( 'POINT' ); 

=> Unknown Win32::API::Struct 'POINT'


Ja, was denn nun? Ich brauche einen Pointer auf ein Struct was ich übergeben muss.

Hier weiß ich nun wirklich nicht mehr weiter. Bitte um einen Impuls ;)

PS/Edit: Ich glaub ich habs jetzt kapiert. Mit untenstehenden Eigenschaften muss ich zunächst alle Structs erstellen entsprechend der usb.h

Sieht z.B. so aus:
Code (perl): (dl )
1
2
3
4
5
Win32::API::Struct->typedef('usb_device');
my $dev = Win32::API::Struct->new( 'usb_device' ); 

$dev->{filename} =  '';  # char filename[LIBUSB_PATH_MAX];
$dev->{devnum}   =  1;   # unsigned char devnum;


Die Frage ist noch, wie setze ich ein struct usb_device *next, *prev; in das Struct?




Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
DLL version:    1.2.6.0
Driver version: 1.2.6.0

bus/device idVendor/idProduct
bus-0/\\.\libusb0-0001--0xffff-0x1122 FFFF/1122
- Manufacturer : HANSON
- Product : USB Remote
bLength: 18
bDescriptorType: 01h
bcdUSB: 0110h
bDeviceClass: 00h
bDeviceSubClass: 00h
bDeviceProtocol: 00h
bMaxPacketSize0: 08h
idVendor: FFFFh
idProduct: 1122h
bcdDevice: 0001h
iManufacturer: 1
iProduct: 2
iSerialNumber: 0
bNumConfigurations: 1
wTotalLength: 34
bNumInterfaces: 1
bConfigurationValue: 1
iConfiguration: 0
bmAttributes: a0h
MaxPower: 50
bInterfaceNumber: 0
bAlternateSetting: 0
bNumEndpoints: 1
bInterfaceClass: 3
bInterfaceSubClass: 0
bInterfaceProtocol: 0
iInterface: 0
bEndpointAddress: 02h
bmAttributes: 03h
wMaxPacketSize: 8
bInterval: 10
bRefresh: 0
bSynchAddress: 0

Last edited: 2017-02-04 17:03:13 +0100 (CET)

View full thread Win32::API und LibUSB-Win32