[DELAYIMP] Fix 2 Clang-Cl warnings about __pfnDliNotifyHook2Default and __pfnDliFailu...
[reactos.git] / sdk / lib / drivers / libusb / libusb.h
1 #ifndef LIBUSB_H__
2 #define LIBUSB_H__
3
4 #include <ntddk.h>
5 #include <hubbusif.h>
6 #include <usbbusif.h>
7
8 extern "C"
9 {
10 #include <usbdlib.h>
11 }
12
13 //
14 // FIXME:
15 // #include <usbprotocoldefs.h>
16 //
17 #include <stdio.h>
18 #include <wdmguid.h>
19
20 //
21 // FIXME:
22 // the following includes are required to get kcom to compile
23 //
24 #include <portcls.h>
25 #include <kcom.h>
26
27 #include "common_interfaces.h"
28
29 //
30 // flags for handling USB_REQUEST_SET_FEATURE / USB_REQUEST_GET_FEATURE
31 //
32 #define PORT_ENABLE 1
33 #define PORT_SUSPEND 2
34 #define PORT_OVER_CURRENT 3
35 #define PORT_RESET 4
36 #define PORT_POWER 8
37 #define C_PORT_CONNECTION 16
38 #define C_PORT_ENABLE 17
39 #define C_PORT_SUSPEND 18
40 #define C_PORT_OVER_CURRENT 19
41 #define C_PORT_RESET 20
42
43 typedef struct
44 {
45 BOOLEAN IsFDO; // is device a FDO or PDO
46 BOOLEAN IsHub; // is device a hub / child - not yet used
47 PDISPATCHIRP Dispatcher; // dispatches the code
48 }COMMON_DEVICE_EXTENSION, *PCOMMON_DEVICE_EXTENSION;
49
50
51 typedef struct _WORK_ITEM_DATA
52 {
53 WORK_QUEUE_ITEM WorkItem; // work item
54 PVOID CallbackContext; // callback context
55 PRH_INIT_CALLBACK CallbackRoutine; // callback routine
56 } INIT_ROOT_HUB_CONTEXT, *PINIT_ROOT_HUB_CONTEXT;
57
58 //
59 // tag for allocations
60 //
61 #define TAG_USBLIB 'LBSU'
62
63 //
64 // assert for c++ - taken from portcls
65 //
66 #define PC_ASSERT(exp) \
67 (VOID)((!(exp)) ? \
68 RtlAssert((PVOID) #exp, (PVOID)__FILE__, __LINE__, NULL ), FALSE : TRUE)
69
70 // hcd_controller.cpp
71 extern "C"
72 {
73 NTSTATUS NTAPI CreateHCDController(PHCDCONTROLLER *HcdController);
74
75 // hardware.cpp
76 NTSTATUS NTAPI CreateUSBHardware(PUSBHARDWAREDEVICE *OutHardware);
77
78 // misc.cpp
79 NTSTATUS NTAPI SyncForwardIrp(PDEVICE_OBJECT DeviceObject, PIRP Irp);
80 NTSTATUS NTAPI GetBusInterface(PDEVICE_OBJECT DeviceObject, PBUS_INTERFACE_STANDARD busInterface);
81
82 // root_hub_controller.cpp
83 NTSTATUS NTAPI CreateHubController(PHUBCONTROLLER * OutHubController);
84
85 // memory_manager.cpp
86 NTSTATUS NTAPI CreateDMAMemoryManager(PDMAMEMORYMANAGER *OutMemoryManager);
87
88 // usb_device.cpp
89 NTSTATUS NTAPI CreateUSBDevice(PUSBDEVICE *OutDevice);
90
91 // libusb.cpp
92 NTSTATUS NTAPI USBLIB_AddDevice(PDRIVER_OBJECT DriverObject, PDEVICE_OBJECT PhysicalDeviceObject);
93 NTSTATUS NTAPI USBLIB_Dispatch(PDEVICE_OBJECT DeviceObject, PIRP Irp);
94
95 }
96
97 #endif /* LIBUSB_H__ */