Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

205 lines
4.1 KiB

  1. /*++
  2. Copyright (c) 1996 Microsoft Corporation
  3. Module Name:
  4. VALIDATE.H
  5. Abstract:
  6. This module contains the PRIVATE (driver-only) definitions for the
  7. code that implements the validate lower level filter driver.
  8. Environment:
  9. Kernel mode
  10. Revision History:
  11. Feb-97 : created by Kenneth Ray
  12. --*/
  13. #ifndef _VALUEADD_LOCAL_H
  14. #define _VALUEADD_LOCAL_H
  15. #include "usb100.h"
  16. #include "usbdi.h"
  17. #include "usbdlib.h"
  18. #define HIDV_POOL_TAG (ULONG) 'ulaV'
  19. #undef ExAllocatePool
  20. #define ExAllocatePool(type, size) \
  21. ExAllocatePoolWithTag (type, size, HIDV_POOL_TAG);
  22. // ExAllocatePool is only called in the descript.c and hidparse.c code.
  23. // all other modules are linked into the user DLL. They cannot allocate any
  24. // memory.
  25. #pragma warning(error:4100) // Unreferenced formal parameter
  26. #pragma warning(error:4705) // Statement has no effect
  27. #if DBG
  28. #define VA_KdPrint(_x_) \
  29. DbgPrint ("USB_VA: "); \
  30. DbgPrint _x_;
  31. #define TRAP() DbgBreakPoint()
  32. #else
  33. #define VA_KdPrint(_x_)
  34. #define TRAP()
  35. #endif
  36. #define MIN(a,b) (((a) < (b)) ? (a) : (b))
  37. #define MAX(a,b) (((a) < (b)) ? (b) : (a))
  38. //
  39. // A device extension for the controling device object
  40. //
  41. typedef struct _VA_CONTROL_DATA
  42. {
  43. LIST_ENTRY UsbDevices; // A list of the Device device extensions
  44. ULONG NumUsbDevices;
  45. KSPIN_LOCK Spin; // a sync spin lock for this data.
  46. } VA_CONTROL_DATA, *PVA_CONTROL_DATA;
  47. //
  48. // A device extension for the device object placed into the attachment
  49. // chain.
  50. //
  51. typedef struct _VA_USB_DATA
  52. {
  53. BOOLEAN Started; // This device has been started
  54. BOOLEAN Removed; // This device has been removed
  55. UCHAR Reseved2[2];
  56. PDEVICE_OBJECT Self; // a back pointer to the actual DeviceObject
  57. PDEVICE_OBJECT PDO; // The PDO to which this filter is attached.
  58. PDEVICE_OBJECT TopOfStack; // The top of the device stack just
  59. // beneath this filter device object.
  60. ULONG PrintMask;
  61. LIST_ENTRY List; // A link point for a list of hid device extensions
  62. KEVENT StartEvent; // an event to sync the start IRP.
  63. KEVENT RemoveEvent; // an event to synch outstandIO to zero
  64. ULONG OutstandingIO; // 1 biased count of reasons why
  65. // this object should stick around
  66. USB_DEVICE_DESCRIPTOR DeviceDesc;
  67. WCHAR FriendlyName;
  68. } VA_USB_DATA, *PVA_USB_DATA;
  69. struct _VA_GLOBALS {
  70. PDEVICE_OBJECT ControlObject;
  71. };
  72. extern struct _VA_GLOBALS Global;
  73. //
  74. // Print Masks
  75. //
  76. #define VA_PRINT_COMMAND 0x00000001
  77. #define VA_PRINT_CONTROL 0x00000002
  78. #define VA_PRINT_TRANSFER 0x00000004
  79. #define VA_PRINT_DESCRIPTOR 0x00000008
  80. #define VA_PRINT_FEATURE 0x00000010
  81. #define VA_PRINT_FUNCTION 0x00000020
  82. #define VA_PRINT_BEFORE 0x10000000
  83. #define VA_PRINT_AFTER 0x20000000
  84. #define VA_PRINT_ALL 0x000000FF
  85. NTSTATUS
  86. VA_CreateClose (
  87. IN PDEVICE_OBJECT DeviceObject,
  88. IN PIRP Irp
  89. );
  90. NTSTATUS
  91. VA_Pass (
  92. IN PDEVICE_OBJECT DeviceObject,
  93. IN PIRP Irp
  94. );
  95. NTSTATUS
  96. VA_Power (
  97. IN PDEVICE_OBJECT DeviceObject,
  98. IN PIRP Irp
  99. );
  100. NTSTATUS
  101. VA_PnP (
  102. IN PDEVICE_OBJECT DeviceObject,
  103. IN PIRP Irp
  104. );
  105. NTSTATUS
  106. VA_Ioctl (
  107. IN PDEVICE_OBJECT DeviceObject,
  108. IN PIRP Irp
  109. );
  110. NTSTATUS
  111. VA_Read (
  112. IN PDEVICE_OBJECT DeviceObject,
  113. IN PIRP Irp
  114. );
  115. NTSTATUS
  116. VA_Write (
  117. IN PDEVICE_OBJECT DeviceObject,
  118. IN PIRP Irp
  119. );
  120. NTSTATUS
  121. VA_AddDevice(
  122. IN PDRIVER_OBJECT DriverObject,
  123. IN PDEVICE_OBJECT PhysicalDeviceObject
  124. );
  125. VOID
  126. VA_Unload(
  127. IN PDRIVER_OBJECT DriverObject
  128. );
  129. NTSTATUS
  130. VA_StartDevice (
  131. IN PVA_USB_DATA UsbData,
  132. IN PIRP Irp
  133. );
  134. VOID
  135. VA_StopDevice (
  136. IN PVA_USB_DATA HidDevice,
  137. IN BOOLEAN TouchTheHardware
  138. );
  139. NTSTATUS
  140. VA_CallUSBD(
  141. IN PVA_USB_DATA UsbData,
  142. IN PURB Urb,
  143. IN PIRP Pirp
  144. );
  145. NTSTATUS
  146. VA_FilterURB (
  147. IN PDEVICE_OBJECT DeviceObject,
  148. IN PIRP Irp
  149. );
  150. #endif