Lsapi: Sample for Licensing API

Click to open or copy the files for the Lsapi sample.

This sample demonstrates the Licensing API. It consists of two parts: Challeng.c, and Simple.c.

Challeng.c

This example demonstrates how license updates are made and how the challenge mechanism is used at request and update times. You should analyze the application to determine the appropriate time to perform an update. For example, this application prints a message 20 times; the developer decided that the appropriate time to do an update was after every 5th message was printed.

Simple.c

This example uses the minimum amount of code required to use any licensing system. This example is provided in the SDK and you can use it to familiarize yourself with a licensing system or as a template for an application. Note that the code exits if a grant cannot be obtained. Recall that this is strictly an application's decision and is not dictated by any licensing system which adheres to the LSAPI standard.

In order to use these samples, copy Lsapi32.dll and Mslsp32.dll from mstools\bin to the %systemroot%\system32 directory on Windows NT® or to the %windir%\system directory on Windows® 95.

Building SDK Samples

This sample uses the following keywords:

checkchallenge; exit; ff; getchallenge; getlasterror; getsystemdirectory; gg; hh; lsfreehandle; lsgetmessage; lsinstall; lslicenseunitsset; lsrelease; lsrequest; lstrcat; lsupdate; md4final; md4init; md4update; memcpy; placeint; printerrors; printf; rand; rotate_left; sprintf; srand; strcpy; swap; time