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.

84 lines
2.6 KiB

  1. /****************************************************************************
  2. *
  3. * (C) COPYRIGHT 2000, MICROSOFT CORP.
  4. *
  5. * FILE: ptpusd.h
  6. *
  7. * VERSION: 1.0
  8. *
  9. * DATE: 12/12/2000
  10. *
  11. * AUTHOR: Dave Parsons
  12. *
  13. * DESCRIPTION:
  14. * Structures and constants needed to issue vendor-specific Picture
  15. * Transfer Protocol (PIMA 15740 - digital still camera command
  16. * protocol) commands through the WIA PTP driver.
  17. *
  18. *****************************************************************************/
  19. //
  20. // Pass this value in the dwEscapeCode argument of IWiaItemExtras::Escape
  21. // to execute a PTP vendor command
  22. //
  23. const DWORD ESCAPE_PTP_CLEAR_STALLS = 0x0200;
  24. const DWORD ESCAPE_PTP_VENDOR_COMMAND = 0x0100;
  25. const DWORD ESCAPE_PTP_ADD_OBJ_CMD = 0x0010;
  26. const DWORD ESCAPE_PTP_REM_OBJ_CMD = 0x0020;
  27. const DWORD ESCAPE_PTP_ADD_OBJ_RESP = 0x0040;
  28. const DWORD ESCAPE_PTP_REM_OBJ_RESP = 0x0080;
  29. const DWORD ESCAPE_PTP_ADDREM_PARM1 = 0x0000;
  30. const DWORD ESCAPE_PTP_ADDREM_PARM2 = 0x0001;
  31. const DWORD ESCAPE_PTP_ADDREM_PARM3 = 0x0002;
  32. const DWORD ESCAPE_PTP_ADDREM_PARM4 = 0x0003;
  33. const DWORD ESCAPE_PTP_ADDREM_PARM5 = 0x0004;
  34. //
  35. // PTP command request
  36. //
  37. const DWORD PTP_MAX_PARAMS = 5;
  38. #pragma pack(push, Old, 1)
  39. typedef struct _PTP_VENDOR_DATA_IN
  40. {
  41. WORD OpCode; // Opcode
  42. DWORD SessionId; // Session id
  43. DWORD TransactionId; // Transaction id
  44. DWORD Params[PTP_MAX_PARAMS]; // Parameters to the command
  45. DWORD NumParams; // Number of parameters passed in
  46. DWORD NextPhase; // Indicates whether to read data,
  47. BYTE VendorWriteData[1]; // Optional first byte of data to
  48. // write to the device
  49. } PTP_VENDOR_DATA_IN, *PPTP_VENDOR_DATA_IN;
  50. //
  51. // PTP response block
  52. //
  53. typedef struct _PTP_VENDOR_DATA_OUT
  54. {
  55. WORD ResponseCode; // Response code
  56. DWORD SessionId; // Session id
  57. DWORD TransactionId; // Transaction id
  58. DWORD Params[PTP_MAX_PARAMS]; // Parameters of the response
  59. BYTE VendorReadData[1]; // Optional first byte of data to
  60. // read from the device
  61. } PTP_VENDOR_DATA_OUT, *PPTP_VENDOR_DATA_OUT;
  62. #pragma pack(pop, Old)
  63. //
  64. // Handy structure size constants
  65. //
  66. const DWORD SIZEOF_REQUIRED_VENDOR_DATA_IN = sizeof(PTP_VENDOR_DATA_IN) - 1;
  67. const DWORD SIZEOF_REQUIRED_VENDOR_DATA_OUT = sizeof(PTP_VENDOR_DATA_OUT) - 1;
  68. //
  69. // NextPhase constants
  70. //
  71. const DWORD PTP_NEXTPHASE_READ_DATA = 3;
  72. const DWORD PTP_NEXTPHASE_WRITE_DATA = 4;
  73. const DWORD PTP_NEXTPHASE_NO_DATA = 5;