ReactOS  0.4.15-dev-509-g96a357b
test.c File Reference
#include <stdio.h>
#include <windows.h>
#include <usbdi.h>
Include dependency graph for test.c:

Go to the source code of this file.

Typedefs

typedef ULONG NTAPI(* USBD_GetInterfaceLengthTYPE) (PUSB_INTERFACE_DESCRIPTOR InterfaceDescriptor, PUCHAR BufferEnd)
 

Functions

int main ()
 

Typedef Documentation

◆ USBD_GetInterfaceLengthTYPE

typedef ULONG NTAPI(* USBD_GetInterfaceLengthTYPE) (PUSB_INTERFACE_DESCRIPTOR InterfaceDescriptor, PUCHAR BufferEnd)

Definition at line 6 of file test.c.

Function Documentation

◆ main()

int main ( void  )

Definition at line 11 of file test.c.

12 {
13  HMODULE Lib;
14  USB_INTERFACE_DESCRIPTOR InterfaceDescriptor;
16 
17  InterfaceDescriptor.bLength = 10;
18  InterfaceDescriptor.bNumEndpoints = 2;
19  InterfaceDescriptor.bDescriptorType = /*USB_INTERFACE_DESCRIPTOR_TYPE*/2;
20  InterfaceDescriptor.iInterface = 0x1;
21 
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 
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 }
unsigned char * PUCHAR
Definition: retypes.h:3
ULONG NTAPI USBD_GetInterfaceLength(PUSB_INTERFACE_DESCRIPTOR InterfaceDescriptor, PUCHAR BufferEnd)
Definition: usbd.c:414
smooth NULL
Definition: ftsmooth.c:416
#define FreeLibrary(x)
Definition: compat.h:414
unsigned long DWORD
Definition: ntddk_ex.h:95
#define DONT_RESOLVE_DLL_REFERENCES
Definition: winbase.h:337
ULONG NTAPI(* USBD_GetInterfaceLengthTYPE)(PUSB_INTERFACE_DESCRIPTOR InterfaceDescriptor, PUCHAR BufferEnd)
Definition: test.c:6
#define LoadLibraryEx
Definition: winbase.h:3703
#define GetProcAddress(x, y)
Definition: compat.h:419
#define printf
Definition: config.h:203