Store_Keys.h
上传用户:super_houu
上传日期:2008-09-21
资源大小:4099k
文件大小:3k
源码类别:

DVD

开发平台:

Others

  1. #ifndef _STORE_KEYS_H
  2. #define _STORE_KEYS_H
  3. #include "Config.h" // Global Configuration - do not remove!
  4. #include "IncludeSysdefs.h"
  5. #define STORE_KEYS_HEADER 0x12345678
  6. #define SCRAMBLE_KEYS_SIZE_IN_BYTE 6
  7. #define KEY_SELECT_VECTOR_SIZE_IN_BYTE 5
  8. //HDCP
  9. #define HDCP_KEYS_SIZE_IN_BYTE 280
  10. //#define IS_HDCP_KEYS_VALID ( HDCP_keys_struct->HDCP_keys_header == STORE_KEYS_HEADER )
  11. typedef DWORD _HDCP_KEYS_HEAD;
  12. typedef struct {
  13. BYTE Scramble_keys[SCRAMBLE_KEYS_SIZE_IN_BYTE];
  14. BYTE Key_Select_Vector[KEY_SELECT_VECTOR_SIZE_IN_BYTE];
  15. BYTE HDCP_keys[HDCP_KEYS_SIZE_IN_BYTE];
  16. }_HDCP_KEYS_ST;
  17. typedef struct {
  18. _HDCP_KEYS_HEAD HDCP_keys_header;
  19. _HDCP_KEYS_ST HDCP_keys_st;
  20. } _HDCP_KEYS_STRUCT;
  21. //DVDA
  22. #define DVDA_KEYS_SIZE_IN_BYTE 192
  23. //#define IS_DVDA_KEYS_VALID ( HDCP_keys_struct->HDCP_keys_header == STORE_KEYS_HEADER )
  24. typedef DWORD _DVDA_KEYS_HEAD;
  25. typedef struct {
  26. BYTE DVDA_Type;
  27. BYTE DVDA_Keys[DVDA_KEYS_SIZE_IN_BYTE];
  28. }_DVDA_KEYS_ST;
  29. typedef struct {
  30. _DVDA_KEYS_HEAD DVDA_keys_header;
  31. _DVDA_KEYS_ST DVDA_keys_st;
  32. } _DVDA_KEYS_STRUCT;
  33. //DVDVR
  34. #define DVDVR_KEYS_SIZE_IN_BYTE 192
  35. typedef DWORD _DVDVR_KEYS_HEAD;
  36. typedef struct {
  37. BYTE DVDVR_Type;
  38. BYTE DVDVR_Keys[DVDVR_KEYS_SIZE_IN_BYTE];
  39. }_DVDVR_KEYS_ST;
  40. typedef struct {
  41. _DVDVR_KEYS_HEAD DVDVR_keys_header;
  42. _DVDVR_KEYS_ST DVDVR_keys_st;
  43. } _DVDVR_KEYS_STRUCT;
  44. typedef enum
  45. {
  46. KEY_TYPE_HDCP = 0x00,
  47. KEY_TYPE_DVDA = 0x10,
  48. KEY_TYPE_DVDA_CPRM_TYPE_A = 0x10,
  49. KEY_TYPE_DVDA_CPRM_TYPE_B = 0x11,
  50. KEY_TYPE_DVDA_CPRM_TYPE_C = 0x12,
  51. KEY_TYPE_DVDVR = 0x20,
  52. }KEY_TYPE;
  53. #define STORE_KEYS_START_OFFSET 0
  54. #define HDCP_KEYS_OFFSET STORE_KEYS_START_OFFSET
  55. #ifdef STORE_HDCP_KEYS
  56. #define HDCP_KEYS_STORE_SIZE sizeof(_HDCP_KEYS_STRUCT)
  57. #define HDCP_KEYS_NUM 1
  58. #else
  59. #define HDCP_KEYS_STORE_SIZE 0
  60. #define HDCP_KEYS_NUM 0
  61. #endif
  62. #define DVDA_KEYS_OFFSET (HDCP_KEYS_OFFSET + HDCP_KEYS_STORE_SIZE)
  63. #ifdef STORE_DVDA_KEYS
  64. #define DVDA_KEYS_STORE_SIZE sizeof(_DVDA_KEYS_STRUCT)
  65. #define DVDA_KEYS_NUM 1
  66. #else
  67. #define DVDA_KEYS_STORE_SIZE 0
  68. #define DVDA_KEYS_NUM 0
  69. #endif
  70. #define DVDVR_KEYS_OFFSET (DVDA_KEYS_OFFSET + DVDA_KEYS_STORE_SIZE)
  71. #ifdef STORE_DVDVR_KEYS
  72. #define DVDVR_KEYS_STORE_SIZE sizeof(_DVDVR_KEYS_STRUCT)
  73. #define DVDVR_KEYS_NUM 1
  74. #else
  75. #define DVDVR_KEYS_STORE_SIZE 0
  76. #define DVDVR_KEYS_NUM 0
  77. #endif
  78. #define STORE_KEYS_END_OFFSET (DVDVR_KEYS_OFFSET + DVDVR_KEYS_STORE_SIZE)
  79. #define STORE_KEYS_NUM (HDCP_KEYS_NUM + DVDA_KEYS_NUM + DVDVR_KEYS_NUM)
  80. #define MK_FP(seg,ofs) ((void __seg *)(seg) + (void __near *)(ofs))
  81. #define STORE_KEYS_START_ADDRESS MK_FP(STORE_KEYS_SEG, STORE_KEYS_START_OFFSET)
  82. #define HDCP_KEYS_START_ADDRESS MK_FP(STORE_KEYS_SEG, HDCP_KEYS_OFFSET)
  83. #define DVDA_KEYS_START_ADDRESS MK_FP(STORE_KEYS_SEG, DVDA_KEYS_OFFSET)
  84. #define DVDVR_KEYS_START_ADDRESS MK_FP(STORE_KEYS_SEG, DVDVR_KEYS_OFFSET)
  85. typedef struct{
  86. BYTE  Keys_type;
  87. int Keys_length;
  88. WORD Keys_offset;
  89. DWORD Keys_store_address;
  90. }KEYS_STORE_STRUCT;
  91. #endif