Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: set-permission-flag function #11

Merged
merged 3 commits into from
Aug 6, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@muneebkq Seems like LA_* have been added here by mistake please remove them.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done


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