215 lines
9.7 KiB
C
215 lines
9.7 KiB
C
//+--------------------------------------------------------------------------
|
|
//
|
|
// Microsoft Windows
|
|
// Copyright (C) Microsoft Corporation, 1996-1998
|
|
//
|
|
// File: tlsdef.h
|
|
//
|
|
// Contents:
|
|
//
|
|
// History: 12-09-97 HueiWang Created
|
|
//
|
|
//---------------------------------------------------------------------------
|
|
#ifndef __TLSDEF_H__
|
|
#define __TLSDEF_H__
|
|
|
|
//---------------------------------------------------------------------------
|
|
// Xenroll specific
|
|
//#define CERTIFICATE_CA_TYPE 1
|
|
//#define CERTITICATE_MF_TYPE 2
|
|
//#define CERTIFICATE_CH_TYPE 3
|
|
|
|
//#define CERTIFICATE_LEVEL_ROOT 0
|
|
|
|
|
|
//---------------------------------------------------------------------------
|
|
// KeyPack related code
|
|
//
|
|
#define LSKEYPACKTYPE_UNKNOWN 0x0
|
|
#define LSKEYPACKTYPE_RETAIL 0x1
|
|
#define LSKEYPACKTYPE_SELECT 0x2
|
|
#define LSKEYPACKTYPE_CONCURRENT 0x3
|
|
#define LSKEYPACKTYPE_TEMPORARY 0x4
|
|
#define LSKEYPACKTYPE_OPEN 0x5
|
|
#define LSKEYPACKTYPE_FREE 0x6
|
|
|
|
#define LSKEYPACKTYPE_FIRST LSKEYPACKTYPE_UNKNOWN
|
|
#define LSKEYPACKTYPE_LAST LSKEYPACKTYPE_FREE
|
|
|
|
#define LSKEYPACKSTATUS_UNKNOWN 0x0
|
|
#define LSKEYPACKSTATUS_ACTIVE 0x1
|
|
#define LSKEYPACKSTATUS_PENDING 0x2
|
|
#define LSKEYPACKSTATUS_RETURNED 0x3
|
|
#define LSKEYPACKSTATUS_REVOKED 0x4
|
|
#define LSKEYPACKSTATUS_TEMPORARY 0x5
|
|
#define LSKEYPACKSTATUS_OTHERS 0x6
|
|
#define LSKEYPACKSTATUS_ADD_LICENSE 0x7
|
|
#define LSKEYPACKSTATUS_REMOVE_LICENSE 0x8
|
|
#define LSKEYPACKSTATUS_ADD_DESC 0x9
|
|
#define LSKEYPACKSTATUS_REMOVE_DESC 0x10
|
|
#define LSKEYPACKSTATUS_FIRST LSKEYPACKSTATUS_UNKNOWN
|
|
#define LSKEYPACKSTATUS_LAST LSKEYPACKSTATUS_REMOVE_DESC
|
|
|
|
#define LSKEYPACKLICENSETYPE_UNKNOWN 0x0
|
|
#define LSKEYPACKLICENSETYPE_NEW 0x1
|
|
#define LSKEYPACKLICENSETYPE_UPGRADE 0x2
|
|
#define LSKEYPACKLICENSETYPE_COMPETITIVE 0x3
|
|
#define LSKEYPACKLICENSETYPE_TEMPORARY 0x4
|
|
|
|
#define LSKEYPACKLICENSETYPE_FIRST LSKEYPACKLICENSETYPE_UNKNOWN
|
|
#define LSKEYPACKLICENSETYPE_LAST LSKEYPACKLICENSETYPE_TEMPORARY
|
|
|
|
#define LSKEYPACKCHANNELOFPURCHASE_UNKNOWN 0x0
|
|
#define LSKEYPACKCHANNELOFPURCHASE_OEM 0x1
|
|
#define LSKEYPACKCHANNELOFPURCHASE_RETAIL 0x2
|
|
|
|
#define LSKEYPACKCHANNELOFPURCHASE_FIRST LSKEYPACKCHANNELOFPURCHASE_UNKNOWN
|
|
#define LSKEYPACKCHANNELOFPURCHASE_LAST LSKEYPACKCHANNELOFPURCHASE_RETAIL
|
|
|
|
#define LSKEYPACKPRODUCTFLAG_UNKNOWN 0x0000
|
|
|
|
#define LSKEYPACKPLATFORMTYPE_UNKNOWN 0x0000
|
|
#define LSKEYPACKPLATFORMTYPE_FREE 0x0002
|
|
#define LSKEYPACKPLATFORMTYPE_OTHERS 0x00FF
|
|
|
|
#define LSLICENSE_STATUS_UNKNOWN 0x0
|
|
#define LSLICENSE_STATUS_TEMPORARY 0x1
|
|
#define LSLICENSE_STATUS_ACTIVE 0x2
|
|
#define LSLICENSE_STATUS_UPGRADED 0x3
|
|
#define LSLICENSE_STATUS_REVOKE 0x4
|
|
#define LSLICENSE_STATUS_PENDING 0x5
|
|
#define LSLICENSE_STATUS_CONCURRENT 0x6
|
|
|
|
#define LSLICENSE_STATUS_FIRST LSLICENSE_STATUS_UNKNOWN
|
|
#define LSLICENSE_STATUS_LAST LSLICENSE_STATUS_CONCURRENT
|
|
|
|
//---------------------------------------------------------------------------
|
|
/// Key Pack Search Parameters
|
|
|
|
// Basic KeyPack Search Parameter
|
|
#define LSKEYPACK_SEARCH_INFO_ALL 0x0000FFFF
|
|
#define LSKEYPACK_SEARCH_KEYPACKID 0x00000001
|
|
#define LSKEYPACK_SEARCH_KEYPACKTYPE 0x00000002
|
|
#define LSKEYPACK_SEARCH_PRODUCTID 0x00000004
|
|
#define LSKEYPACK_SEARCH_MAJORVERSION 0x00000008
|
|
#define LSKEYPACK_SEARCH_MINORVERSION 0x00000010
|
|
#define LSKEYPACK_SEARCH_PLATFORMTYPE 0x00000020
|
|
#define LSKEYPACK_SEARCH_LICENSETYPE 0x00000040
|
|
#define LSKEYPACK_SEARCH_LANGID 0x00000080
|
|
#define LSKEYPACK_SEARCH_COP 0x00000100
|
|
#define LSKEYPACK_SEARCH_BSERIALNUMBER 0x00000200
|
|
#define LSKEYPACK_SEARCH_TOTALLICENSES 0x00000400
|
|
#define LSKEYPACK_SEARCH_PRODUCTFLAGS 0x00000800
|
|
#define LSKEYPACK_SEARCH_COMPANYNAME 0x00001000
|
|
#define LSKEYPACK_SEARCH_PRODUCTNAME 0x00002000
|
|
#define LSKEYPACK_SEARCH_PRODUCTDESC 0x00004000
|
|
#define LSKEYPACK_SEARCH_DUPLICATE \
|
|
(LSKEYPACK_SEARCH_KEYPACKID | LSKEYPACK_SEARCH_COMPANYNAME | \
|
|
LSKEYPACK_SEARCH_PRODUCTID | LSKEYPACK_SEARCH_MAJORVERSION | \
|
|
LSKEYPACK_SEARCH_MINORVERSION | LSKEYPACK_SEARCH_PLATFORMTYPE)
|
|
|
|
// Extended KeyPack Search Parameters
|
|
#define LSKEYPACK_EXSEARCH_ALL 0xFFFF0000
|
|
#define LSKEYPACK_EXSEARCH_DWINTERNAL 0x00010000
|
|
#define LSKEYPACK_EXSEARCH_KEYPACKSTATUS 0x00020000
|
|
#define LSKEYPACK_EXSEARCH_ACTIVATEDATE 0x00040000
|
|
#define LSKEYPACK_EXSEARCH_EXPIREDATE 0x00080000
|
|
#define LSKEYPACK_EXSEARCH_AVAILABLE 0x00100000
|
|
#define LSKEYPACK_EXSEARCH_ALLVERSION 0x10000000
|
|
|
|
#define LSKEYPACK_SEARCH_ALL (LSKEYPACK_SEARCH_INFO_ALL | LSKEYPACK_EXSEARCH_ALL)
|
|
#define LSKEYPACK_SEARCH_NONE 0x00000000
|
|
|
|
#define LSKEYPACK_SET_KEYPACKSTATUS LSKEYPACK_EXSEARCH_KEYPACKSTATUS
|
|
#define LSKEYPACK_SET_ACTIVATEDATE LSKEYPACK_EXSEARCH_ACTIVATEDATE
|
|
#define LSKEYPACK_SET_EXPIREDATE LSKEYPACK_EXSEARCH_EXPIREDATE
|
|
#define LSKEYPACK_SET_AVAILABLE LSKEYPACK_EXSEARCH_AVAILABLE
|
|
#define LSKEYPACK_SET_ALLSTATUS (LSKEYPACK_SET_KEYPACKSTATUS | LSKEYPACK_SET_ACTIVATEDATE | LSKEYPACK_SET_EXPIREDATE)
|
|
|
|
//-----------------------------------------------------------------------------
|
|
// License Search parameters
|
|
//
|
|
#define LSLICENSE_SEARCH_LICENSEID 0x00000001
|
|
#define LSLICENSE_SEARCH_KEYPACKID 0x00000002
|
|
#define LSLICENSE_SEARCH_MACHINENAME 0x00000008
|
|
#define LSLICENSE_SEARCH_USERNAME 0x00000010
|
|
#define LSLICENSE_SEARCH_ISSUEDATE 0x00000080
|
|
#define LSLICENSE_SEARCH_EXPIREDATE 0x00000100
|
|
#define LSLICENSE_SEARCH_NUMLICENSES 0x00000200
|
|
#define LSLICENSE_SEARCH_ENTRY_STATUS 0x20000000
|
|
#define LSLICENSE_SEARCH_MARK_FLAGS LSLICENSE_SEARCH_ENTRY_STATUS
|
|
#define LSLICENSE_EXSEARCH_LICENSESTATUS 0x00100000
|
|
#define LSLICENSE_SEARCH_ALL \
|
|
(LSLICENSE_SEARCH_LICENSEID | LSLICENSE_SEARCH_KEYPACKID | \
|
|
LSLICENSE_SEARCH_MACHINENAME | \
|
|
LSLICENSE_SEARCH_USERNAME | \
|
|
LSLICENSE_SEARCH_ISSUEDATE | LSLICENSE_SEARCH_NUMLICENSES | \
|
|
LSLICENSE_SEARCH_EXPIREDATE | LSLICENSE_EXSEARCH_LICENSESTATUS | \
|
|
LSLICENSE_SEARCH_ENTRY_STATUS)
|
|
|
|
#define LSLICENSE_SEARCH_NONE 0x00000000
|
|
|
|
//-----------------------------------------------------------------------------
|
|
// General Define
|
|
#define LSERVER_MAX_STRING_SIZE 255
|
|
#define GUID_MAX_SIZE 37
|
|
|
|
#define MAXCOMPUTERNAMELENGTH 32 // from MAX_COMPUTERNAME_LENGTH in winbase.h
|
|
#define MAXUSERNAMELENGTH 256 // UNLEN in lmcons.h
|
|
|
|
// HueiWang - temporary, need to define this
|
|
#define HLS_MAX_SCOPE_NAME_LENGTH MAX_COMPUTERNAME_LENGTH
|
|
|
|
//-------------------------------------------------------------
|
|
// Hydra License Server Return Code
|
|
#define LSERVER_S_SUCCESS ERROR_SUCCESS
|
|
#define LSERVER_SUCCESS_BASE 4000
|
|
#define LSERVER_ERROR_BASE 5000
|
|
|
|
#define LSERVER_I_NO_MORE_DATA (LSERVER_SUCCESS_BASE + 1)
|
|
#define LSERVER_I_PROXIMATE_LICENSE (LSERVER_SUCCESS_BASE + 2)
|
|
#define LSERVER_I_TEMPORARY_LICENSE (LSERVER_SUCCESS_BASE + 3)
|
|
#define LSERVER_I_LICENSE_UPGRADED (LSERVER_SUCCESS_BASE + 4)
|
|
#define LSERVER_I_CERTIFICATE_OVERWRITE (LSERVER_SUCCESS_BASE + 5)
|
|
#define LSERVER_I_REMOVE_TOOMANY (LSERVER_SUCCESS_BASE + 6)
|
|
#define LSERVER_I_SELFSIGN_CERTIFICATE (LSERVER_SUCCESS_BASE + 7)
|
|
#define LSERVER_I_NOT_LSERVER_CERTIFICATE (LSERVER_SUCCESS_BASE + 8)
|
|
#define LSERVER_I_TEMP_SELFSIGN_CERT (LSERVER_SUCCESS_BASE + 9)
|
|
#define LSERVER_I_SERVICE_SHUTDOWN (LSERVER_SUCCESS_BASE + 10)
|
|
|
|
#define LSERVER_E_INTERNAL_ERROR (LSERVER_ERROR_BASE + 1)
|
|
#define LSERVER_E_ERROR_GENERAL (LSERVER_ERROR_BASE + 2)
|
|
#define LSERVER_E_ACCESS_DENIED (LSERVER_ERROR_BASE + 3)
|
|
#define LSERVER_E_DUPLICATE (LSERVER_ERROR_BASE + 4)
|
|
#define LSERVER_E_INVALID_HANDLE (LSERVER_ERROR_BASE + 5)
|
|
#define LSERVER_E_INVALID_SEQUENCE (LSERVER_ERROR_BASE + 6)
|
|
#define LSERVER_E_SERVER_BUSY (LSERVER_ERROR_BASE + 7)
|
|
#define LSERVER_E_OUTOFMEMORY (LSERVER_ERROR_BASE + 8)
|
|
#define LSERVER_E_INVALID_DATA (LSERVER_ERROR_BASE + 9)
|
|
#define LSERVER_E_DATANOTFOUND (LSERVER_ERROR_BASE + 10)
|
|
#define LSERVER_E_NO_LICENSE (LSERVER_ERROR_BASE + 11)
|
|
#define LSERVER_E_NO_PRODUCT (LSERVER_ERROR_BASE + 12)
|
|
#define LSERVER_E_LICENSE_REJECTED (LSERVER_ERROR_BASE + 13)
|
|
#define LSERVER_E_LICENSE_REVOKED (LSERVER_ERROR_BASE + 14)
|
|
#define LSERVER_E_LICENSE_EXPIRED (LSERVER_ERROR_BASE + 15)
|
|
#define LSERVER_E_CORRUPT_DATABASE (LSERVER_ERROR_BASE + 16)
|
|
#define LSERVER_E_NOTSUPPORTED (LSERVER_ERROR_BASE + 17)
|
|
#define LSERVER_E_INVALID_NT_VERSION (LSERVER_ERROR_BASE + 18)
|
|
#define LSERVER_E_NOT_NTSERVER (LSERVER_ERROR_BASE + 19)
|
|
#define LSERVER_E_LS_NOTPRESENT (LSERVER_ERROR_BASE + 20)
|
|
#define LSERVER_E_LS_NOTRUNNING (LSERVER_ERROR_BASE + 21)
|
|
#define LSERVER_E_NO_CERTIFICATE (LSERVER_ERROR_BASE + 22)
|
|
#define LSERVER_E_NOT_LSCERTIFICATE (LSERVER_ERROR_BASE + 23)
|
|
#define LSERVER_E_POLICYMODULEERROR (LSERVER_ERROR_BASE + 24) // error in policy module return data
|
|
#define LSERVER_E_INVALID_RETURN (LSERVER_ERROR_BASE + 25)
|
|
#define LSERVER_E_INCOMPATIBLE (LSERVER_ERROR_BASE + 26)
|
|
#define LSERVER_E_INVALID_SPK (LSERVER_ERROR_BASE + 27)
|
|
#define LSERVER_E_INVALID_LKP (LSERVER_ERROR_BASE + 28)
|
|
#define LSERVER_E_INVALID_SIGN (LSERVER_ERROR_BASE + 29)
|
|
#define LSERVER_E_POLICYDENYREQUEST (LSERVER_ERROR_BASE + 30)
|
|
#define LSERVER_E_NOPOLICYMODULE (LSERVER_ERROR_BASE + 31)
|
|
#define ISPOLICYMODULECODE(x) (0x08000000 & x)
|
|
|
|
#define LSERVER_E_LASTERROR LSERVER_E_NOPOLICYMODULE
|
|
#endif
|