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.

135 lines
3.5 KiB

  1. // gntlsapi.h
  2. //
  3. // Global NT License Service, for cooperative machine-wide CAL counting
  4. #ifndef _GNTLSAPI_H
  5. #define _GNTLSAPI_H
  6. #ifdef __cplusplus
  7. extern "C"{
  8. #endif
  9. #include <ntlsapi.h> // using this for definitions of basic types and structs
  10. // GNtLicenseRequest
  11. //
  12. // Same as NtLicenseRequest, except guaranteed not to double count, so will only call NtLicenseRequest
  13. // once no matter how many times GNtLicenseRequest is called for client/product/version on this machine.
  14. // Same return values as NtLicenseRequest.
  15. LS_STATUS_CODE LS_API_ENTRY GNtLicenseRequestW(
  16. LPWSTR ProductName,
  17. LPWSTR Version,
  18. LS_HANDLE FAR* LicenseHandle,
  19. NT_LS_DATA* NtData); // supports NT_LS_USER_NAME only
  20. LS_STATUS_CODE LS_API_ENTRY GNtLicenseRequestA(
  21. LPSTR ProductName,
  22. LPSTR Version,
  23. LS_HANDLE FAR* LicenseHandle,
  24. NT_LS_DATA* NtData); // supports NT_LS_USER_NAME only
  25. #ifdef UNICODE
  26. #define GNtLicenseRequest GNtLicenseRequestW
  27. #else
  28. #define GNtLicenseRequest GNtLicenseRequestA
  29. #endif // !UNICODE
  30. // GNtLicenseExemption
  31. //
  32. // By calling GNtLicenseExemption, the caller is saying that this client/product/version is exempt
  33. // from requiring (further) licenses on this machine. The caller may or may not have already consumed
  34. // license(s) for this client/product/version by calling directly to NtLicenseRequest. The exemption is
  35. // released by calling GNtLSFreeHandle. This is ref counted, so must call GNtLSFreeHandle for each call
  36. // to GNtLicenseExemption.
  37. // Returns LS_SUCCESS or LS_BAD_ARG.
  38. LS_STATUS_CODE LS_API_ENTRY GNtLicenseExemptionW(
  39. LPWSTR ProductName,
  40. LPWSTR Version,
  41. LS_HANDLE FAR* LicenseHandle,
  42. NT_LS_DATA* NtData); // supports NT_LS_USER_NAME only
  43. LS_STATUS_CODE LS_API_ENTRY GNtLicenseExemptionA(
  44. LPSTR ProductName,
  45. LPSTR Version,
  46. LS_HANDLE FAR* LicenseHandle,
  47. NT_LS_DATA* NtData); // supports NT_LS_USER_NAME only
  48. #ifdef UNICODE
  49. #define GNtLicenseExemption GNtLicenseExemptionW
  50. #else
  51. #define GNtLicenseExemption GNtLicenseExemptionA
  52. #endif // !UNICODE
  53. // GNtLSFreeHandle
  54. //
  55. // Same as NtLSFreeHandle, except works for LicenseHandles returned from both GNtLicenseRequest and
  56. // GNtLicenseExemption. Do not call this with a LicenseHandle returned by NtLicenseRequest.
  57. // Same return values as NtLSFreeHandle.
  58. LS_STATUS_CODE LS_API_ENTRY GNtLSFreeHandle(
  59. LS_HANDLE LicenseHandle);
  60. //
  61. // function pointer typedefs
  62. //
  63. typedef LS_STATUS_CODE
  64. (LS_API_ENTRY * PGNT_LICENSE_REQUEST_W)(
  65. LPWSTR ProductName,
  66. LPWSTR Version,
  67. LS_HANDLE *LicenseHandle,
  68. NT_LS_DATA *NtData);
  69. typedef LS_STATUS_CODE
  70. (LS_API_ENTRY * PGNT_LICENSE_REQUEST_A)(
  71. LPSTR ProductName,
  72. LPSTR Version,
  73. LS_HANDLE *LicenseHandle,
  74. NT_LS_DATA *NtData);
  75. #ifdef UNICODE
  76. #define PGNT_LICENSE_REQUEST PGNT_LICENSE_REQUEST_W
  77. #else
  78. #define PGNT_LICENSE_REQUEST PGNT_LICENSE_REQUEST_A
  79. #endif // !UNICODE
  80. typedef LS_STATUS_CODE
  81. (LS_API_ENTRY * PGNT_LICENSE_EXEMPTION_W)(
  82. LPWSTR ProductName,
  83. LPWSTR Version,
  84. LS_HANDLE *LicenseHandle,
  85. NT_LS_DATA *NtData);
  86. typedef LS_STATUS_CODE
  87. (LS_API_ENTRY * PGNT_LICENSE_EXEMPTION_A)(
  88. LPSTR ProductName,
  89. LPSTR Version,
  90. LS_HANDLE *LicenseHandle,
  91. NT_LS_DATA *NtData);
  92. #ifdef UNICODE
  93. #define PGNT_LICENSE_EXEMPTION PGNT_LICENSE_EXEMPTION_W
  94. #else
  95. #define PGNT_LICENSE_EXEMPTION PGNT_LICENSE_EXEMPTION_A
  96. #endif // !UNICODE
  97. typedef LS_STATUS_CODE
  98. (LS_API_ENTRY * PGNT_LS_FREE_HANDLE)(
  99. LS_HANDLE LicenseHandle );
  100. #ifdef __cplusplus
  101. }
  102. #endif
  103. #endif