Constants and Data Structures

This section outlines the constants and data structures used in the License Service API.

Type Definitions

Type

C Definition

Description

LS_STATUS_CODE

UINT32

Result of a License Service API function call - a 32-bit unsigned integer value.

LS_CHALLENGE

structure

Data used in challenge (see Challenge Mechanism on page 24).

LS_HANDLE

UINT32

Defines the handle used for identifying the context of licensing API calls.

LS_STR

char

Defines a NULL terminated string of characters in ASCII format.

LS_ULONG

UINT32

Defines a 32-bit unsigned integer type.

LS_LONG

INT32

Defines a 32-bit signed integer type.

LS_VOID

void

Unspecified type usually referring to a data buffer.


Supplemental Information

Definition

Description

INT32

Defines a 32-bit Integer for the particular platform being developed on.

UINT32

Defines an unsigned 32-bit Integer for the particular platform being developed on


Constants

Constant

Type

Value

Meaning

LS_DEFAULT_UNITS

LS_LONG

0xFFFFFFFF

Indicates that the number of units should be determined by the license system and the associated license policy.

LS_ANY

LS_STR

null string

Used in LSRequest(). Indicates that all license providers should be searched for a license match.

LS_USE_LAST

LS_ULONG

0x0000FFFF

Used in LSGetMessage() to indicates that the last status value returned for the current process should be used as input.

LS_BASIC_PROTOCOL

LS_ULONG

0x000000001

Indicates the Basic Challenge protocol.

LS_OUT_OF_BAND
_PROTOCOL

LS_ULONG

0xFFFFFFFF

Indicates an out of band challenge/response protocol.

LS_NULL

LS_VOID*

NULL

Indicates a NULL value for all optional pointer arguments. LS_NULL must be used to indicate the absence of a value.


Status Codes

The status codes returned through the API are 32-bit unsigned values. The value is subdivided into three parts as follows:

[ 31 . 30 | 29 ... 16 | 15 ... 0 ]

\ / | |

| | +-- Value (16-bit)

| +--- Always zero

+--- Severity (00=Success, 01=Info, 10=Warning, 11=Error)

The low order 16-bits indicates a value with respect to the severity (the uppermost two bits). The middle fourteen bits are always returned as 0x0000 and have no further meaning.

Status Code Constant

Status Value

Meaning

LS_SUCCESS

0x0

The function completed successfully.

LS_BAD_HANDLE

0xC0001001

Handle used on call did not describe a valid licensing system context.

LS_INSUFFICIENT_UNITS

0xC0001002

The licensing system could not locate enough available licensing resources to satisfy the request.

LS_SYSTEM_UNAVAILABLE

0xC0001003

No licensing system could be found with which to perform the function invoked.

LS_LICENSE_TERMINATED

0xC0001004

The licensing system has determined that the resources used to satisfy a previous request are no longer granted to the calling software.

LS_AUTHORIZATION_UNAVAILABLE

0xC0001005

The licensing system has no licensing resources that could satisfy the request.

LS_LICENSE_UNAVAILABLE

0xC0001006

The licensing system has licensing resources that could satisfy the request, but they are not available at the time of the request.

LS_RESOURCES_UNAVAILABLE

0xC0001007

Insufficient resources (such as memory) are available to complete the request.

LS_NETWORK_UNAVAILABLE

0xC0001008

The network is unavailable.

LS_TEXT_UNAVAILABLE

0x80001009

A warning occurred while looking up an error message string for the LSGetMessage() function.

LS_UNKNOWN_STATUS

0xC000100A

An unrecognized status code was passed into the LSGetMessage() function.

LS_BAD_INDEX

0xC000100B

An invalid index was specified in LSEnumProviders() or LSQuery().

LS_LICENSE_EXPIRED

0x8000100C

The license associated with the current context has expired. This may be due to a time-restriction on the license.

LS_BUFFER_TOO_SMALL

0xC000100D

The buffer passed in LSGetMessage() is too small to accomodate the text string to be returned. Or, the challenge data structure is too small to accomodate the challenge response.

LS_BAD_ARG

0xC000100E

One or more of the arguments is incorrect.