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.

157 lines
5.2 KiB

  1. /*
  2. * Copyright (C) Microsoft Corporation, 1990-1999
  3. *
  4. * LSAPI.H
  5. *
  6. * NOTE: If you are using this header file on the Windows for DOS platform,
  7. * then you are required to include "windows.h" prior to including
  8. * this header file.
  9. */
  10. #ifndef LSAPI_H
  11. #define LSAPI_H
  12. #if _MSC_VER > 1000
  13. #pragma once
  14. #endif
  15. #ifdef __cplusplus
  16. extern "C" {
  17. #endif
  18. #if defined(WINVER) // Windows for NT or DOS
  19. #if defined(WINAPIV)
  20. #define LS_API_ENTRY WINAPIV
  21. #else
  22. #define LS_API_ENTRY WINAPI
  23. #endif
  24. #else
  25. #define LS_API_ENTRY
  26. #endif
  27. typedef unsigned long LS_STATUS_CODE;
  28. typedef ULONG_PTR LS_HANDLE;
  29. // **************************************************
  30. // Standard LSAPI C status codes
  31. //***************************************************
  32. #define LS_SUCCESS ((LS_STATUS_CODE) 0x0)
  33. #define LS_BAD_HANDLE ((LS_STATUS_CODE) 0xC0001001)
  34. #define LS_INSUFFICIENT_UNITS ((LS_STATUS_CODE) 0xC0001002)
  35. #define LS_SYSTEM_UNAVAILABLE ((LS_STATUS_CODE) 0xC0001003)
  36. #define LS_LICENSE_TERMINATED ((LS_STATUS_CODE) 0xC0001004)
  37. #define LS_AUTHORIZATION_UNAVAILABLE ((LS_STATUS_CODE) 0xC0001005)
  38. #define LS_LICENSE_UNAVAILABLE ((LS_STATUS_CODE) 0xC0001006)
  39. #define LS_RESOURCES_UNAVAILABLE ((LS_STATUS_CODE) 0xC0001007)
  40. #define LS_NETWORK_UNAVAILABLE ((LS_STATUS_CODE) 0xC0001008)
  41. #define LS_TEXT_UNAVAILABLE ((LS_STATUS_CODE) 0x80001009)
  42. #define LS_UNKNOWN_STATUS ((LS_STATUS_CODE) 0xC000100A)
  43. #define LS_BAD_INDEX ((LS_STATUS_CODE) 0xC000100B)
  44. #define LS_LICENSE_EXPIRED ((LS_STATUS_CODE) 0x8000100C)
  45. #define LS_BUFFER_TOO_SMALL ((LS_STATUS_CODE) 0xC000100D)
  46. #define LS_BAD_ARG ((LS_STATUS_CODE) 0xC000100E)
  47. //***************************************************
  48. //* Nt LS API data structure and constant
  49. //***************************************************
  50. #define NT_LS_USER_NAME ((ULONG) 0) // username only
  51. #define NT_LS_USER_SID ((ULONG) 1) // SID only
  52. typedef struct {
  53. ULONG DataType; // Type of the following data, ie. user name, sid...
  54. VOID *Data; // Actual data. username, sid, etc...
  55. // if call the unicode API character data
  56. // must be in unicode as well
  57. BOOL IsAdmin;
  58. } NT_LS_DATA;
  59. //
  60. // Prototypes for License Request routines
  61. //
  62. typedef LS_STATUS_CODE
  63. (LS_API_ENTRY * PNT_LICENSE_REQUEST_W)(
  64. LPWSTR ProductName,
  65. LPWSTR Version,
  66. LS_HANDLE *LicenseHandle,
  67. NT_LS_DATA *NtData);
  68. typedef LS_STATUS_CODE
  69. (LS_API_ENTRY * PNT_LS_FREE_HANDLE)(
  70. LS_HANDLE LicenseHandle );
  71. #ifdef UNICODE
  72. #define NtLicenseRequest NtLicenseRequestW
  73. #else
  74. #define NtLicenseRequest NtLicenseRequestA
  75. #endif // !UNICODE
  76. LS_STATUS_CODE LS_API_ENTRY NtLicenseRequestA(
  77. LPSTR ProductName,
  78. LPSTR Version,
  79. LS_HANDLE FAR *LicenseHandle,
  80. NT_LS_DATA *NtData);
  81. LS_STATUS_CODE LS_API_ENTRY NtLicenseRequestW(
  82. LPWSTR ProductName,
  83. LPWSTR Version,
  84. LS_HANDLE FAR *LicenseHandle,
  85. NT_LS_DATA *NtData);
  86. LS_STATUS_CODE LS_API_ENTRY NtLSFreeHandle(
  87. LS_HANDLE LicenseHandle );
  88. /***************************************************/
  89. /* standard LS API c datatype definitions */
  90. /***************************************************/
  91. typedef char LS_STR;
  92. typedef unsigned long LS_ULONG;
  93. typedef long LS_LONG;
  94. typedef void LS_VOID;
  95. typedef struct {
  96. LS_STR MessageDigest[16]; /* a 128-bit message digest */
  97. } LS_MSG_DIGEST;
  98. typedef struct {
  99. LS_ULONG SecretIndex; /* index of secret, X */
  100. LS_ULONG Random; /* a random 32-bit value, R */
  101. LS_MSG_DIGEST MsgDigest; /* the message digest h(in,R,S,Sx) */
  102. } LS_CHALLDATA;
  103. typedef struct {
  104. LS_ULONG Protocol; /* Specifies the protocol */
  105. LS_ULONG Size; /* size of ChallengeData structure */
  106. LS_CHALLDATA ChallengeData; /* challenge & response */
  107. } LS_CHALLENGE;
  108. /***************************************************/
  109. /* Standard LSAPI C constant definitions */
  110. /***************************************************/
  111. #define LS_DEFAULT_UNITS ((LS_ULONG) 0xFFFFFFFF)
  112. #define LS_ANY ((LS_STR FAR *) "")
  113. #define LS_USE_LAST ((LS_ULONG) 0x0800FFFF)
  114. #define LS_INFO_NONE ((LS_ULONG) 0)
  115. #define LS_INFO_SYSTEM ((LS_ULONG) 1)
  116. #define LS_INFO_DATA ((LS_ULONG) 2)
  117. #define LS_UPDATE_PERIOD ((LS_ULONG) 3)
  118. #define LS_LICENSE_CONTEXT ((LS_ULONG) 4)
  119. #define LS_BASIC_PROTOCOL ((LS_ULONG) 0x00000001)
  120. #define LS_SQRT_PROTOCOL ((LS_ULONG) 0x00000002)
  121. #define LS_OUT_OF_BAND_PROTOCOL ((LS_ULONG) 0xFFFFFFFF)
  122. #define LS_NULL ((LS_VOID FAR *) NULL)
  123. #ifdef __cplusplus
  124. }
  125. #endif
  126. #endif /* LSAPI_H */