ReactOS
0.4.16-dev-297-gc569aee
Toggle main menu visibility
Main Page
Related Pages
Modules
Namespaces
Namespace List
Namespace Members
All
_
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
w
x
Functions
_
a
b
c
d
e
f
g
h
i
l
m
o
p
r
s
t
u
v
w
Variables
_
c
d
e
f
g
h
i
l
n
o
p
s
t
u
x
Typedefs
_
a
b
c
d
e
f
g
h
i
l
m
o
p
r
s
t
u
v
w
x
Enumerations
_
c
d
f
i
l
m
o
p
s
t
w
x
Enumerator
a
b
c
d
e
f
g
h
i
m
n
o
p
r
s
t
u
v
w
x
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerations
_
a
b
c
d
e
f
h
i
k
l
m
n
o
p
r
s
t
u
v
w
z
Enumerator
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Properties
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Related Functions
_
a
b
c
d
e
f
g
h
i
l
m
n
o
p
q
r
s
t
v
x
Files
File List
File Members
All
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Variables
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerations
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerator
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Macros
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Examples
test.c
Go to the documentation of this file.
1
#include <stdio.h>
2
#include <windows.h>
3
#include <
usbdi.h
>
4
5
typedef
ULONG
NTAPI
6
(*
USBD_GetInterfaceLengthTYPE
)(
7
PUSB_INTERFACE_DESCRIPTOR
InterfaceDescriptor
,
8
PUCHAR
BufferEnd
9
);
10
11
int
main
()
12
{
13
HMODULE
Lib;
14
USB_INTERFACE_DESCRIPTOR
InterfaceDescriptor
;
15
USBD_GetInterfaceLengthTYPE
USBD_GetInterfaceLength
;
16
17
InterfaceDescriptor
.bLength = 10;
18
InterfaceDescriptor
.bNumEndpoints = 2;
19
InterfaceDescriptor
.bDescriptorType =
/*USB_INTERFACE_DESCRIPTOR_TYPE*/
2;
20
InterfaceDescriptor
.iInterface = 0x1;
21
22
Lib =
LoadLibraryEx
(
"usbd.sys"
,
NULL
,
DONT_RESOLVE_DLL_REFERENCES
);
23
USBD_GetInterfaceLength
= (
USBD_GetInterfaceLengthTYPE
)
GetProcAddress
(Lib,
"USBD_GetInterfaceLength"
);
24
printf
(
"%X\n"
,
USBD_GetInterfaceLength
(&
InterfaceDescriptor
, (
PUCHAR
)((
DWORD
)&
InterfaceDescriptor
+
sizeof
(
InterfaceDescriptor
))));
25
FreeLibrary
(Lib);
26
27
Lib =
LoadLibraryEx
(
"usbd.ms"
,
NULL
,
DONT_RESOLVE_DLL_REFERENCES
);
28
USBD_GetInterfaceLength
= (
USBD_GetInterfaceLengthTYPE
)
GetProcAddress
(Lib,
"USBD_GetInterfaceLength"
);
29
printf
(
"%X\n"
,
USBD_GetInterfaceLength
(&
InterfaceDescriptor
, (
PUCHAR
)((
DWORD
)&
InterfaceDescriptor
+
sizeof
(
InterfaceDescriptor
))));
30
FreeLibrary
(Lib);
31
return
0;
32
}
33
NULL
#define NULL
Definition:
types.h:112
GetProcAddress
#define GetProcAddress(x, y)
Definition:
compat.h:753
FreeLibrary
#define FreeLibrary(x)
Definition:
compat.h:748
main
int main()
Definition:
test.c:6
USBD_GetInterfaceLengthTYPE
ULONG NTAPI(* USBD_GetInterfaceLengthTYPE)(PUSB_INTERFACE_DESCRIPTOR InterfaceDescriptor, PUCHAR BufferEnd)
Definition:
test.c:6
DWORD
unsigned long DWORD
Definition:
ntddk_ex.h:95
printf
#define printf
Definition:
freeldr.h:97
void
Definition:
nsiface.idl:2307
_USB_INTERFACE_DESCRIPTOR
Definition:
usb100.h:147
NTAPI
#define NTAPI
Definition:
typedefs.h:36
PUCHAR
unsigned char * PUCHAR
Definition:
typedefs.h:53
ULONG
uint32_t ULONG
Definition:
typedefs.h:59
USBD_GetInterfaceLength
ULONG NTAPI USBD_GetInterfaceLength(PUSB_INTERFACE_DESCRIPTOR InterfaceDescriptor, PUCHAR BufferEnd)
Definition:
usbd.c:414
usbdi.h
BufferEnd
_In_ PUCHAR BufferEnd
Definition:
usbdlib.h:189
InterfaceDescriptor
_In_ WDFUSBINTERFACE _In_ UCHAR _Out_ PUSB_INTERFACE_DESCRIPTOR InterfaceDescriptor
Definition:
wdfusb.h:2334
LoadLibraryEx
#define LoadLibraryEx
Definition:
winbase.h:3888
DONT_RESOLVE_DLL_REFERENCES
#define DONT_RESOLVE_DLL_REFERENCES
Definition:
winbase.h:367
drivers
usb
usbd
test.c
Generated on Wed Nov 27 2024 06:13:19 for ReactOS by
1.9.6