Contents - Index


4.2.3.27 Register Product

HRESULT SLS_Register(
                                        LPCSTR pszProductID,
                                        LPCSTR pszProductName,
                                        LPCSTR pszLicencePath)

The SLS_Register function registers a product's licence on user's PC.

Parameters

pszProductID

Points to a string that uniquely identifies the application's Product ID.

pszProductName

Points to a string that identifies the application's product name.

pszLicencePath

Points to a full path where licence files will be stored.

Return Values

SLS_SUCCESS if the function is successful. Otherwise an error status code is returned to indicate the cause of the error.

Remarks

The SLS_Register is the first function that needs to be called by the application before any other SLSAPI function can be called. Once a licence is registered successfully on the user's PC, there is no need to call SLS_Register. This function is typically used by an application's installation program to register the application's licence on the user's PC.

Additional Functions

1. SLS_SetPermissions
As Sheriff requires that all users have write access to Sheriff related registry keys and files. This function therefore sets write access for all users on all Sheriff related registry keys and files. Typically, the application calls SLS_SetPermissions after a successful call to SLS_Register.

NB. SLS_SetPermissions is not about setting user account privileges, it is to set all Sheriff related registry keys and file access privileges for other users. In other words, SLS_SetPermissions makes these registry keys and files writable for other users. Only an Admin account can make such changes, so the application first calls SLS_IsAdminAccount to make sure that the current account is an Admin account before calling SLS_SetPermissions.

2. SLS_IsLimitedAccount
This function returns SLS_SUCCESS if the user account is a limited account.

3. SLS_IsAdminAccount
This function returns SLS_SUCCESS if the user account is an admin account.

NB. These three functions only work on Windows NT/2000/XP