win_lm_logout

Log out a previously logged in license

WSupported on Windows

 

 

NSupported in Synergy .NET
int WINAPI win_lm_logout(char *producer, char *app_code, int seat, int token,
           int *syserr)

producer

The producer code for your company. This is a null-terminated 8-bit ANSI string. (This code was assigned to your company by Synergex when you requested the License Key Generator.)

app_code

The code that you created to refer to the application or application component. This is a null-terminated 8-bit ANSI string and can be up to six characters long.

seat

An int32 set to the value that was passed in the seat argument to win_lm_login.

token

The token obtained from win_lm_login and used here to log out.

syserr

An int32 pointer returned with a system error code if the call fails.

The win_lm_logout function is used only when you have called win_lm_login with check set to 0 or 3 and the returned token was non-zero.

The win_lm_logout function doesn’t log out a process in the usual sense (that is, it does not prevent the application from continuing). Instead it requests that License Manager release the “slot” for the specified license so that another user can log in and use the available slot.

If the token returned by win_lm_login is non-zero, it should be saved by your application and passed to win_lm_logout. The token ensures that the process that is logging out is authorized to do so. 

If you passed a non-zero value for seat to win_lm_login, pass the same value for seat to win_lm_logout. The seat, in combination with the token, ensures that the correct license is logged out in a server environment. If you pass seat to win_lm_login and fail to pass the same seat value to win_lm_logout, the results could be unpredictable.

You must call win_lm_logout as part of your exit procedure. If you do not, the license will remain in use until License Manager logs it out, which could take as long as 20 minutes. For another way to release licenses see win_lm_cleanup.

The win_lm_logout function returns a status value. The most common values are listed below; see Licensing Toolkit error messages for additional values that can be returned.

0 = Success

3 = Invalid token

These status values are for your information only; they have no effect on your application. You must write code to handle the returned status.

See lmdltest.c in Licensing_TK_Examples, available from Synergy CodeExchange in the Synergex Resource Center.