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.

136 lines
6.9 KiB

  1. /**INC+**********************************************************************/
  2. /* Header: CLicense.h */
  3. /* */
  4. /* Purpose: Client License Manager functions */
  5. /* */
  6. /* Copyright(C) Microsoft Corporation 1997 */
  7. /* */
  8. /****************************************************************************/
  9. /** Changes:
  10. * $Log$
  11. **/
  12. /**INC-**********************************************************************/
  13. #ifndef _CLICENSE_H
  14. #define _CLICENSE_H
  15. /****************************************************************************/
  16. /* Define the calling convention */
  17. /****************************************************************************/
  18. #ifndef OS_WINCE
  19. #define CALL_TYPE _stdcall
  20. #else
  21. #define CALL_TYPE
  22. #endif
  23. class CSL;
  24. class CUT;
  25. class CMCS;
  26. class CUI;
  27. #include "objs.h"
  28. class CLic
  29. {
  30. public:
  31. CLic(CObjs* objs);
  32. ~CLic();
  33. /**PROC+*********************************************************************/
  34. /* Name: CLicenseInit */
  35. /* */
  36. /* Purpose: Initialize ClientLicense Manager */
  37. /* */
  38. /* Returns: Handle to be passed to subsequent License Manager functions */
  39. /* */
  40. /* Params: None */
  41. /* */
  42. /* Operation: LicenseInit is called during Client initialization. Its */
  43. /* purpose is to allow one-time initialization. It returns a */
  44. /* handle which is subsequently passed to all License Manager */
  45. /* functions. A typical use for this handle is as a pointer to */
  46. /* memory containing per-instance data. */
  47. /* */
  48. /**PROC-*********************************************************************/
  49. int CALL_TYPE CLicenseInit(
  50. HANDLE FAR * phContext
  51. );
  52. /**PROC+*********************************************************************/
  53. /* Name: CLicenseData */
  54. /* */
  55. /* Purpose: Handle license data received from the Server */
  56. /* */
  57. /* Returns: LICENSE_OK - License negotiation is complete */
  58. /* LICENSE_CONTINUE - License negotiation will continue */
  59. /* */
  60. /* Params: pHandle - handle returned by LicenseInit */
  61. /* pData - data received from Server */
  62. /* dataLen - length of data received */
  63. /* puiExtendedErrorInfo - receives extended error info code */
  64. /* */
  65. /* Operation: This function is passed all license packets received from the */
  66. /* Server. It should parse the packet and respond (by calling */
  67. /* suitable SL functions - see aslapi.h) as required. */
  68. /* */
  69. /* If license negotiation is complete, this function must return */
  70. /* LICENSE_OK */
  71. /* If license negotiation is not yet complete, return */
  72. /* LICENSE_CONTINUE */
  73. /* */
  74. /* Incoming packets from the Client will continue to be */
  75. /* interpreted as license packets until this function returns */
  76. /* LICENSE_OK. */
  77. /* */
  78. /**PROC-*********************************************************************/
  79. int CALL_TYPE CLicenseData(
  80. HANDLE hContext,
  81. LPVOID pData,
  82. DWORD dataLen,
  83. UINT32 *puiExtendedErrorInfo
  84. );
  85. #define LICENSE_OK 0
  86. #define LICENSE_CONTINUE 2
  87. #define LICENSE_ERROR 4
  88. /**PROC+*********************************************************************/
  89. /* Name: CLicenseTerm */
  90. /* */
  91. /* Purpose: Terminate Client License Manager */
  92. /* */
  93. /* Returns: None */
  94. /* */
  95. /* Params: pHandle - handle returned from LicenseInit */
  96. /* */
  97. /* Operation: This function is provided to do one-time termination of the */
  98. /* License Manager. For example, if pHandle points to per- */
  99. /* instance memory, this would be a good place to free it. */
  100. /* */
  101. /**PROC-*********************************************************************/
  102. int CALL_TYPE CLicenseTerm(
  103. HANDLE hContext
  104. );
  105. VOID SetEncryptLicensingPackets(BOOL b) {_fEncryptLicensePackets = b;}
  106. BOOL GetEncryptLicensingPackets() {return _fEncryptLicensePackets;}
  107. private:
  108. CSL* _pSl;
  109. CUT* _pUt;
  110. CMCS* _pMcs;
  111. CUI* _pUi;
  112. private:
  113. CObjs* _pClientObjects;
  114. //
  115. // Flag set to specify server capability
  116. // indicating client should encrypt licensing
  117. // packets to the server.
  118. //
  119. BOOL _fEncryptLicensePackets;
  120. };
  121. #endif /* _CLICENSE_H */