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.

113 lines
3.8 KiB

  1. //============================================================================
  2. //
  3. // Microsoft Windows Media Technology
  4. //
  5. // Copyright (C) Microsoft Corporation, 1999 - 2002
  6. //
  7. // File: DRMsecure.idl
  8. //
  9. // Description: This IDL contains interface definitions for Windows Media DRM
  10. //
  11. //============================================================================
  12. cpp_quote( "//=========================================================================" )
  13. cpp_quote( "//" )
  14. cpp_quote( "// THIS SOFTWARE HAS BEEN LICENSED FROM MICROSOFT CORPORATION PURSUANT " )
  15. cpp_quote( "// TO THE TERMS OF AN END USER LICENSE AGREEMENT (\"EULA\"). " )
  16. cpp_quote( "// PLEASE REFER TO THE TEXT OF THE EULA TO DETERMINE THE RIGHTS TO USE THE SOFTWARE. " )
  17. cpp_quote( "//" )
  18. cpp_quote( "// Copyright (C) Microsoft Corporation, 1999 - 2002 All Rights Reserved." )
  19. cpp_quote( "//" )
  20. cpp_quote( "//=========================================================================" )
  21. import "oaidl.idl";
  22. import "ocidl.idl";
  23. cpp_quote ("// {C4C4C4C4-0049-4E2B-98FB-9537F6CE516D}")
  24. cpp_quote ("DEFINE_GUID(SID_DRMSecureServiceChannel,")
  25. cpp_quote ("0xC4C4C4C4, 0x0049, 0x4E2B, 0x98, 0xFB, 0x95, 0x37, 0xF6, 0xCE, 0x51, 0x6D);")
  26. cpp_quote ("// {30D76B74-58C1-4f6c-AC01-872C56A2263D}")
  27. cpp_quote( "DEFINE_GUID( IID_IDRMSecureChannel,")
  28. cpp_quote ("0x30d76b74, 0x58c1, 0x4f6c, 0xac, 0x01, 0x87, 0x2c, 0x56, 0xa2, 0x26, 0x3d );" )
  29. //
  30. // IDRMSecureChannel Interface : provides methods that allow two DLLs to validate
  31. // each other and do secure communication.
  32. //
  33. [
  34. object,
  35. uuid( 30D76B74-58C1-4f6c-AC01-872C56A2263D ),
  36. helpstring( "IDRMSecureChannel Interface"),
  37. pointer_default(unique),
  38. local
  39. ]
  40. interface IDRMSecureChannel : IUnknown
  41. {
  42. //
  43. // Adds certificates that this object can present to other securechannel objects
  44. // If no certs are added, then this object can only connect to objects with
  45. // no signatures
  46. //
  47. HRESULT DRMSC_SetCertificate( [in] BYTE *pbCert, [in] DWORD cbCert );
  48. HRESULT DRMSC_SetPrivateKeyBlob( [in] BYTE *pbPrivKeyBlob, [in] DWORD cbPrivKeyBlob );
  49. //
  50. // Adds signatures that this object will look for when trying to connect.
  51. // If no signatures are added, then this object will connect to any other object.
  52. //
  53. HRESULT DRMSC_AddVerificationPubKey( [in] BYTE *pbPubKey, [in] DWORD cbPubKey );
  54. HRESULT DRMSC_SetOtherSide( [in] IDRMSecureChannel* pOtherSide );
  55. //
  56. // Initiate, check, and destroy the connection
  57. //
  58. HRESULT DRMSC_Connect( [in] IDRMSecureChannel* pOtherSide );
  59. HRESULT DRMSC_IsConnected( [out] BOOL* pfIsConnected );
  60. HRESULT DRMSC_Disconnect();
  61. HRESULT DRMSC_Authenticate(
  62. [in] DWORD dwProtocolID,
  63. [in] DWORD dwPass,
  64. [in] BYTE *pbDataIn,
  65. [in] DWORD cbDataIn,
  66. [out] BYTE **ppbDataOut,
  67. [out] DWORD *pcbDataOut
  68. );
  69. HRESULT DRMSC_AtomicConnectAndDisconnect(
  70. [in] BYTE *pbCert,
  71. [in] DWORD cbCert,
  72. [in] BYTE *pbPrivKeyBlob,
  73. [in] DWORD cbPrivKeyBlob,
  74. [in] BYTE *pbPubKey,
  75. [in] DWORD cbPubKey,
  76. [in] IDRMSecureChannel* pOtherSide
  77. );
  78. //
  79. // Encrypt and Decrypt data across DLL boundaries. Encrypt holds a lock on the connection
  80. // which is released by Decrypt, so threads should not block between calls to encrypt
  81. // and decrypt
  82. //
  83. HRESULT DRMSC_Encrypt( [in] BYTE* pbData, [in] DWORD cbData );
  84. HRESULT DRMSC_Decrypt( [in] BYTE* pbData, [in] DWORD cbData );
  85. //
  86. // Lock and Unlock are used by Encrypt and Decrypt to serialize access to the connection.
  87. //
  88. HRESULT DRMSC_Lock();
  89. HRESULT DRMSC_Unlock();
  90. };
  91. //
  92. // This handy function will create an object that implements IDRMSecureChannel.
  93. //
  94. cpp_quote( "HRESULT STDMETHODCALLTYPE DRMCreateSecureChannel( IDRMSecureChannel** ppChannel );" )