GetSessionInfo Function

Description

Retrieves information regarding a session context.

Syntax

hasp_status_t HASP_CALLCONV hasp_get_sessioninfo(
        hasp_handle_t handle,
        const char * format,
        char ** info
        )

Parameters

handle

Handle for the session

format

Definition of the data to be returned by the function, in XML format.

info

Pointer to the information that is retrieved as XML text.

Return Values

HASP_STATUS_OK

HASP_INV_HND

HASP_INV_FORMAT

HASP_INSUF_MEM

HASP_BROKEN_SESSION

HASP_LOCAL_COMM_ERR

HASP_REMOTE_COMM_ERR

HASP_DEVICE_ERR

HASP_TIME_ERR

Usage Notes

When using the Create C2V parameter, the Sentinel protection key must be accessible by the local machine.

The retrieved session information applies to:

>A deployed Sentinel protection key

>The current or a specific login session

>Various updates, including license updates, firmware updates, and memory updates.

This function allocates memory for the information it retrieves. To release allocated memory resources, use the Free function. To convert a returned time value to the current date and time, use the HaspTimeToDateTime function.

NOTE   To defeat a protection key emulator attempting to bypass software protection, you can check periodically that the protection key is available and that a session for the key exists. This should not be done using GetSessionInfo (this function does not detect a remote broken session). Instead, use one of the following functions: Encrypt, Decrypt, Read, Write. These functions will return HASP_BROKEN_SESSION if a session for the protection key does not exist.

Related Topics

Format XML Tags

Free Function

GetInfo Function