Skip to content

Commit

Permalink
feat: add set-permission-flag function
Browse files Browse the repository at this point in the history
  • Loading branch information
muneebkq committed Jul 9, 2024
1 parent 2781d3c commit 661e16d
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 0 deletions.
27 changes: 27 additions & 0 deletions lexfloatclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ const (
LA_USER uint = 0
LA_SYSTEM uint = 1
LA_IN_MEMORY uint = 2
LF_USER uint = 10
LF_ALL_USERS uint = 11
)

var floatingLicenseCallbackFunction callbackType
Expand All @@ -32,6 +34,31 @@ func floatingLicenseCallbackWrapper(status int) {
floatingLicenseCallbackFunction(status)
}
}
/*
FUNCTION: SetPermissionFlag()
PURPOSE: Sets the permission flag.
This function must be called on every start of your program after SetHostProductId()
function in case the application allows borrowing of licenses or system wide activation.
PARAMETERS:
* flags - depending on your application's requirements, choose one of
the following values: LF_USER, LF_ALL_USERS.
- LF_USER: This flag indicates that the application does not require
admin or root permissions to run.
- LF_ALL_USERS: This flag is specifically designed for Windows and should be used
for system-wide activations.
RETURN CODES: LF_OK, LF_E_PRODUCT_ID
*/
func SetPermissionFlag(flags uint) int {
cFlags := (C.uint)(flags)
status := C.SetPermissionFlag(cFlags)
return int(status)
}

/*
FUNCTION: SetHostProductId()
Expand Down
22 changes: 22 additions & 0 deletions lexfloatclient/LexFloatClient.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,28 @@
#endif
typedef void (LF_CC *CallbackType)(uint32_t);

/*
FUNCTION: SetPermissionFlag()
PURPOSE: Sets the permission flag.
This function must be called on every start of your program after SetHostProductId()
function in case the application allows borrowing of licenses or system wide activation.
PARAMETERS:
* flags - depending on your application's requirements, choose one of
the following values: LF_USER, LF_ALL_USERS.
- LF_USER: This flag indicates that the application does not require
admin or root permissions to run.
- LF_ALL_USERS: This flag is specifically designed for Windows and should be used
for system-wide activations.
RETURN CODES: LF_OK, LF_E_PRODUCT_ID
*/
LEXFLOATCLIENT_API int LF_CC SetPermissionFlag(uint32_t flags);

/*
FUNCTION: SetHostProductId()
Expand Down

0 comments on commit 661e16d

Please sign in to comment.