On2Decrypt.h 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. //==========================================================================
  2. //
  3. // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
  4. // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
  5. // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
  6. // PURPOSE.
  7. //
  8. // Copyright (c) 1999 - 2001 On2 Technologies Inc. All Rights Reserved.
  9. //
  10. //--------------------------------------------------------------------------
  11. #if !defined(ON2DECRYPT_H)
  12. #define ON2DECRYPT_H
  13. //______________________________________________________________________________
  14. //
  15. // On2Decrypt.h
  16. // test api for testing the encryption code in on2crypt.h
  17. //--------------------------------------------------------------------------
  18. #ifdef _USRDLL
  19. #define DLLExport __declspec(dllexport)
  20. #else
  21. #define DLLExport
  22. #endif
  23. #define DLLCC __stdcall
  24. #ifdef __cplusplus
  25. extern "C"
  26. {
  27. #endif
  28. typedef void* HOn2Decryptor;
  29. DLLExport int DLLCC MakeDecryptor(unsigned char* pDRMX, int iDRMXLength, HOn2Decryptor* phOn2Decryptor);
  30. //***************************************************************************************
  31. // Name : MakeDecryptor
  32. // Description: set up an decryption session
  33. // Inputs : pDRMX -> information to be used by decryptor to set up decryption session
  34. // iDRMXLength -> number of bytes used in pDRMX
  35. // Outputs : phOn2Decryptor -> pointer to an decryption session
  36. // Returns : 0 = success
  37. //***************************************************************************************
  38. DLLExport int DLLCC DecryptBytes(HOn2Decryptor hOn2Decryptor, unsigned char* pBufferIn, int iSizeIn, unsigned char* pBufferOut, int iSizeOutMax, int* piSizeOut);
  39. //***************************************************************************************
  40. // Name : DecryptBytes
  41. // Description: decrypts bytes in input buffer and stores them to the output buffer
  42. // Inputs : hOn2Decryptor -> handle of decryption sesion to use ( from make decryptor)
  43. // : pBufferIn -> buffer holding bytes to decrypt
  44. // iSizeIn -> number of bytes to decrypt of that buffer
  45. // Outputs : pBufferOut -> buffer for holding decrypted bytes
  46. // iSizeOutMax -> maximum number of bytes to write to pBufferOut
  47. // piSizeOut -> number of bytes actually written to pbufferout
  48. // Returns : 0 = success
  49. //***************************************************************************************
  50. DLLExport int DLLCC DeleteDecryptor(HOn2Decryptor hOn2Decryptor);
  51. //***************************************************************************************
  52. // Name : DeleteDecryptor
  53. // Description: ends the decryption session and cleans up
  54. // Inputs : hOn2Decryptor -> handle of decryption sesion to use ( from make decryptor)
  55. // Outputs :
  56. // Returns : 0 = success
  57. //***************************************************************************************
  58. typedef int (DLLCC *PFNMakeDecryptor)(unsigned char* pDRMX, int iDRMXLength, HOn2Decryptor* phOn2Decryptor);
  59. typedef int (DLLCC *PFNDecryptBytes)(HOn2Decryptor hOn2Decryptor, unsigned char* pBufferIn, int iSizeIn, unsigned char* pBufferOut, int iSizeOutMax, int* piSizeOut);
  60. typedef int (DLLCC *PFNDeleteDecryptor)(HOn2Decryptor hOn2Decryptor);
  61. #ifdef __cplusplus
  62. } // extern "C"
  63. #endif
  64. #endif // ON2DECRYPT_H