Leaked source code of windows server 2003
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.

64 lines
2.0 KiB

  1. BOOL WINAPI USBMON_EnumPorts(LPWSTR pName, DWORD Level, LPBYTE pPorts, DWORD cbBuf,LPDWORD pcbNeeded, LPDWORD pcReturned);
  2. #define MAX_PORT_LEN 20 //chars, this is the max port len of a USB printer
  3. #define MAX_PORT_DESC_LEN 60 //chars This will probably need to get bigger or be made dynamic if we want port-unique descriptions
  4. #define MAX_MONITOR_NAME_LEN 40
  5. //#define PORT_NAME_BASE L"USB"
  6. //#define PORT_NAME_BASE_A "USB"
  7. #define MAX_PRINTER_NAME_LEN 222
  8. #define MONITOR_NAME L"USB Print Monitor"
  9. #define STANDARD_PORT_DESC L"Virtual printer port for USB"
  10. #define MAX_ENUM_PRINTER_BUFFER_SIZE 1024*512
  11. #define MAX_WRITE_CHUNK 10240
  12. typedef struct USBMON_PRINTER_INFO_DEF
  13. {
  14. WCHAR DevicePath[256];
  15. BOOL bLinked;
  16. DWORD dwVidPid;
  17. struct USBMON_PRINTER_INFO_DEF *pNext;
  18. } USBMON_PRINTER_INFO, *PUSBMON_PRINTER_INFO;
  19. typedef struct USBMON_PORT_INFO_DEF
  20. {
  21. WCHAR szPortName[MAX_PORT_LEN];
  22. WCHAR szPortDescription[MAX_PORT_DESC_LEN];
  23. WCHAR DevicePath[256];
  24. int iRefCount;
  25. DWORD ReadTimeoutMultiplier;
  26. DWORD ReadTimeoutConstant;
  27. DWORD WriteTimeoutMultiplier;
  28. DWORD WriteTimeoutConstant;
  29. HANDLE hDeviceHandle;
  30. HANDLE hPrinter; //handle to print queue
  31. DWORD dwCurrentJob;
  32. DWORD dwDeviceFlags;
  33. struct USBMON_PORT_INFO_DEF *pNext;
  34. } USBMON_PORT_INFO, *PUSBMON_PORT_INFO;
  35. typedef struct USBMON_BASENAME_DEF
  36. {
  37. WCHAR wcBaseName[MAX_PORT_LEN];
  38. struct USBMON_BASENAME_DEF *pNext;
  39. } USBMON_BASENAME, * PUSBMON_BASENAME;
  40. typedef struct USBMON_QUEUE_INFO_DEF
  41. {
  42. WCHAR wcPortName[MAX_PORT_LEN];
  43. WCHAR wcPrinterName[MAX_PRINTER_NAME_LEN];
  44. struct USBMON_QUEUE_INFO_DEF *pNext;
  45. } USBMON_QUEUE_INFO, *PUSBMON_QUEUE_INFO;
  46. extern PUSBMON_PORT_INFO pPortInfoG;
  47. extern PUSBMON_PRINTER_INFO pPrinterInfoG;
  48. extern char szDebugBuff[];
  49. extern HKEY hPortsKeyG; //global, declared in EnumPorts.
  50. extern PUSBMON_BASENAME GpBaseNameList;
  51. // {28D78FAD-5A12-11d1-AE5B-0000F803A8C2}
  52. static const GUID USB_PRINTER_GUID =
  53. { 0x28d78fad, 0x5a12, 0x11d1, { 0xae, 0x5b, 0x0, 0x0, 0xf8, 0x3, 0xa8, 0xc2 } };