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.

82 lines
1.5 KiB

  1. #ifndef __DVDCPP_H__
  2. #define __DVDCPP_H__
  3. #include "ksmedia.h"
  4. #define CG_INDEX 0xc0
  5. #define CG_DATA 0xc1
  6. #define COM 0x00
  7. #define CNT_1 0x01
  8. #define CNT_2 0x02
  9. #define SD_STS 0x03
  10. #define DETP_L 0x04
  11. #define DETP_M 0x05
  12. #define VER 0x0f
  13. #define ETKG1 0x10
  14. #define ETKG2 0x11
  15. #define ETKG3 0x12
  16. #define ETKG4 0x13
  17. #define ETKG5 0x14
  18. #define ETKG6 0x15
  19. #define ACC 0x20
  20. #define CHGG1 0x30
  21. #define CHGG2 0x31
  22. #define CHGG3 0x32
  23. #define CHGG4 0x33
  24. #define CHGG5 0x34
  25. #define CHGG6 0x35
  26. #define CHGG7 0x36
  27. #define CHGG8 0x37
  28. #define CHGG9 0x38
  29. #define CHGG10 0x39
  30. #define RSPG1 0x40
  31. #define RSPG2 0x41
  32. #define RSPG3 0x42
  33. #define RSPG4 0x43
  34. #define RSPG5 0x44
  35. #define CMD_NOP 0x00
  36. #define CMD_DEC_RAND 0x12
  37. #define CMD_DEC_DKY 0x15
  38. #define CMD_DRV_AUTH 0x17
  39. #define CMD_DEC_AUTH 0x18
  40. #define CMD_DEC_DTK 0x25
  41. #define CMD_DEC_DT 0x23
  42. #define CNT2_DEFAULT 0xf2
  43. typedef enum
  44. {
  45. NO_GUARD,
  46. GUARD
  47. } CPPMODE;
  48. class Cpp
  49. {
  50. private:
  51. PUCHAR ioBase;
  52. void cpp_outp( UCHAR index, UCHAR data );
  53. UCHAR cpp_inp( UCHAR index );
  54. void wait( ULONG msec );
  55. BOOLEAN cmd_wait_loop( void );
  56. public:
  57. void init( const PDEVICE_INIT_INFO pDevInit );
  58. BOOLEAN reset( CPPMODE mode );
  59. BOOLEAN decoder_challenge( PKS_DVDCOPY_CHLGKEY r1 );
  60. BOOLEAN drive_bus( PKS_DVDCOPY_BUSKEY fsr1 );
  61. BOOLEAN drive_challenge( PKS_DVDCOPY_CHLGKEY r2 );
  62. BOOLEAN decoder_bus( PKS_DVDCOPY_BUSKEY fsr2 );
  63. BOOLEAN DiscKeyStart();
  64. BOOLEAN DiscKeyEnd();
  65. BOOLEAN TitleKey( PKS_DVDCOPY_TITLEKEY tk );
  66. };
  67. #endif // __DVDCPP_H__