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.

78 lines
2.2 KiB

  1. #ifndef krmcommsstructs_h
  2. #define krmcommsstructs_h
  3. #include "BV4.h"
  4. #include "pkcrypto.h"
  5. // symmetric stream key
  6. typedef BV4_KEYSTRUCT STREAMKEY, *PSTREAMKEY;
  7. // DRM message and file digest
  8. typedef struct DRMDIGESTtag{
  9. UINT32 w1;
  10. UINT32 w2;
  11. } DRMDIGEST, *PDRMDIGEST;
  12. // Connection structure (to build test graphs)
  13. struct Conn{
  14. DWORD src;
  15. DWORD dest;
  16. };
  17. //----------------ECC cert section -----------------------
  18. #define VERSION_LEN 4
  19. #define DATE_LEN 4
  20. #define RIGHTS_LEN 4
  21. #define APPSEC_LEN 4
  22. #define SER_NUM_LEN 4
  23. #define ISSUER_LEN 4
  24. #define SUBJ_LEN 4
  25. #define INT_LEN 4
  26. #define USER_MODE_X
  27. typedef struct CERTDATAtag{
  28. PUBKEY pk;
  29. BYTE expiryDate[DATE_LEN];
  30. BYTE serialNumber[SER_NUM_LEN];
  31. BYTE issuer[ISSUER_LEN];
  32. BYTE subject[SUBJ_LEN];
  33. } CERTDATA, *PCERTDATA;
  34. typedef struct CERTtag{
  35. BYTE certVersion[VERSION_LEN];
  36. BYTE datalen[INT_LEN];
  37. BYTE sign[PK_ENC_SIGNATURE_LEN];
  38. CERTDATA cd;
  39. } CERT, *PCERT;
  40. typedef struct __DrmHandleTag {void* P;} *__DrmHandle;
  41. typedef struct __StreamHandleTag {void* P;} *__StreamHandle;
  42. // These "typed handles" are references to a KRM connection and a stream respectively
  43. typedef __DrmHandle DRMHANDLE, *PDRMHANDLE;
  44. typedef __StreamHandle STREAMHANDLE, *PSTREAMHANDLE;
  45. // Definitions for driver authentication failures and callbacks
  46. enum AuthFailureEnum {AuthOK, AuthNoCert, AuthNoDRMBit, AuthTampered, AuthCantParse, AuthBadProvingFunc, AuthBadImage};
  47. typedef struct AUTHSTRUCTtag{
  48. char path[MAX_PATH];
  49. enum AuthFailureEnum type;
  50. } AUTHSTRUCT , *PAUTHSTRUCT;
  51. typedef void (*AuthFail)(DWORD StreamId, AUTHSTRUCT* Comp, DWORD NumComponents, PVOID Context);
  52. // KRM operation ordinals
  53. #define _KRMINIT 1
  54. #define _GETKERNELDATA 2 // not used.
  55. #define _CREATESTREAM 3
  56. #define _DESTROYSTREAM 4
  57. #define _DESTROYSTREAMSBYHANDLE 5
  58. #define _WALKDRIVERS 6
  59. #define _KRMINIT1 7
  60. #define _KRMINIT2 8
  61. #define _DENUM 9 // not used.
  62. #define _GETKERNELDIGEST 12
  63. typedef NTSTATUS DRM_STATUS;
  64. #endif