Detach Function

NOTE   This function is deprecated and has been replaced by the Transfer function.

Description

Performs either of the following functions:

>Detaches a license for a Product from a Sentinel SL key (on the host machine), according to customizable parameters. Features defined as detachable and memory files that belong to the Product are detached.

>Cancels a detached license from the Sentinel SL key (on the recipient machine), typically before the detached license was due to expire.

You do not need to be logged in to a Feature in order to use this function.

Syntax

hasp_status_t HASP_CALLCONV hasp_detach(
            const char *detach_action,
            const char *scope,
            hasp_vendor_code_t vendor_code,
            const char *recipient,
            char **info
            )

Parameters

detach_action

Detach

Detach operation parameters, in XML format. The following example specifies that a detached license for Product ID 12345 will expire after 604,800 seconds (one week):

<detach>

    <product id=”12345”>

        <duration>604800</duration>

    </product>

</detach>

Cancel

Cancel operation parameters, in XML format. The following example specifies that the Sentinel SL key with ID “12321” for the detached license should be cancelled:

<cancel> <hasp id=”12321”/> </cancel>

scope

Search parameters for the Product that is to be detached. For more information, see Scope Input XML Tags.

vendor_code

Bytes that contain the Vendor Code

recipient

For Detach

Definition in XML format of the recipient machine to which the detached license will be attached. Use either the GetInfo or GetSessionInfo function, together with the HASP_RECIPIENT predefined format template, to retrieve the recipient information.

For Cancel

Ignored (set to Null).

info

Pointer to the information that is retrieved as XML text. This information is a:

>H2R file (for the Detach action), which can then be installed on the recipient machine

>R2H file (for the Cancel action), which can then be installed on the host machine

The file can be installed using the Update function (or using the Admin Control Center or RUS utility). Use the Free function to release the pointer after use.

Return Values

HASP_STATUS_OK

HASP_INV_ACTION

HASP_INV_RECIPIENT

HASP_TOO_MANY_PRODUCTS

HASP_INV_PRODUCT

HASP_INSUF_MEM

HASP_DEVICE_ERR

HASP_LOCAL_COMM_ERR

HASP_REMOTE_COMM_ERR

HASP_EXTENSION_NOT_ALLOWED

Usage Notes

The required Vendor Codes are stored in a VendorCodes folder in your system. Without the correct Vendor Code, the function call cannot succeed.

This function only works with Sentinel SL protection keys; Sentinel HL protection keys are ignored.

This function can also be used on the recipient machine to cancel an attached license. In this case, the recipient parameter is ignored and should be set to NULL. For a cancel operation, the function returns an R2H file. This file must be applied on the host machine using the Update function or using Sentinel Admin Control Center. If the detached Product has already expired, no R2H file is returned.

Related Topics

GetInfo Function

GetSessionInfo Function

Scope Input XML Tags

Format XML Tags

hasp_detach XML Tags