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.

86 lines
2.3 KiB

  1. /*
  2. *************************************************************************
  3. * File: SECURITY.H
  4. *
  5. * Module: USBCCGP.SYS
  6. * USB Common Class Generic Parent driver.
  7. *
  8. * Copyright (c) 1998 Microsoft Corporation
  9. *
  10. *
  11. * Author: ervinp
  12. *
  13. *************************************************************************
  14. */
  15. #pragma pack(1)
  16. typedef struct {
  17. UCHAR bMethod;
  18. UCHAR bMethodVariant;
  19. } CS_METHOD_AND_VARIANT;
  20. typedef struct {
  21. UCHAR bLength;
  22. UCHAR bDescriptorType;
  23. UCHAR bChannelID;
  24. UCHAR bmAttributes;
  25. UCHAR bRecipient;
  26. UCHAR bRecipientAlt;
  27. UCHAR bRecipientLogicalUnit;
  28. CS_METHOD_AND_VARIANT methodAndVariant[0];
  29. } CS_CHANNEL_DESCRIPTOR;
  30. typedef struct {
  31. UCHAR bLength;
  32. UCHAR bDescriptorType;
  33. UCHAR bMethodID;
  34. UCHAR iCSMDescriptor;
  35. USHORT bcdVersion;
  36. UCHAR CSMData[0];
  37. } CSM_DESCRIPTOR;
  38. #pragma pack()
  39. // BUGBUG - get this into a shared header
  40. typedef struct _MEDIA_SERIAL_NUMBER_DATA {
  41. ULONG SerialNumberLength; // byte size of SerialNumberData[] (not of entire struct)
  42. ULONG Result;
  43. ULONG Reserved[2];
  44. UCHAR SerialNumberData[1];
  45. } MEDIA_SERIAL_NUMBER_DATA, *PMEDIA_SERIAL_NUMBER_DATA;
  46. /*
  47. * Values from USB Authentication Device spec
  48. */
  49. #define USB_AUTHENTICATION_HOST_COMMAND_PUT 0x00
  50. #define USB_AUTHENTICATION_DEVICE_RESPONSE_GET 0x01
  51. #define USB_AUTHENTICATION_SET_CHANNEL_SETTING 0x05
  52. #define USB_DEVICE_CLASS_CONTENT_SECURITY 0x0D
  53. #define CS_DESCRIPTOR_TYPE_CHANNEL 0x22
  54. #define CS_DESCRIPTOR_TYPE_CSM 0x23
  55. #define CS_DESCRIPTOR_TYPE_CSM_VER 0x24
  56. #define CSM_BASIC 1 // Microsoft
  57. #define CSM_DTCP 2 // Intel
  58. #define CSM_OCPS 3 // Philips
  59. #define CSM_ELLIPTIC_CURVE 4
  60. #define CSM1_REQUEST_GET_UNIQUE_ID (UCHAR)0x80
  61. #define CSM1_GET_UNIQUE_ID_LENGTH 0x100 // this value is fixed in the CSM1 spec
  62. CS_CHANNEL_DESCRIPTOR * GetChannelDescForInterface(PPARENT_FDO_EXT parentFdoExt, ULONG interfaceNum);
  63. NTSTATUS GetUniqueIdFromCSInterface(PPARENT_FDO_EXT parentFdoExt, PMEDIA_SERIAL_NUMBER_DATA serialNumData, ULONG serialNumLen);
  64. NTSTATUS GetMediaSerialNumber(PPARENT_FDO_EXT parentFdoExt, PIRP irp);
  65. VOID InitCSInfo(PPARENT_FDO_EXT parentFdoExt, ULONG CSIfaceNumber);