All of the functions have significantly improved in TA 4.0. There are too many bug fixes to list. Get it, it's our best version yet. https://wyday.com/limelm/api/ta-changes/
Regarding returning TA_FAIL instead of TA_OK, in the next version we've updated the documentation to explain this better:
/* Checks and saves the product key.
Note: If you pass in the TA_SYSTEM flag and you don't have "admin" or "elevated" permission then the call will fail.
If you call this function once in the past with the flag TA_SYSTEM and the calling process was an admin process then subsequent calls with the TA_SYSTEM flag will succeed even if the calling process is *not* admin/elevated.
If you want to take advantage of this behavior from an admin process (e.g. an installer) but the user hasn't entered a product key then you can call this function with a null string:
TA_CheckAndSavePKey(yourHandle, 0, TA_SYSTEM);
This will set everything up so that subsequent calls with the TA_SYSTEM flag will succeed even if from non-admin processes.
Note: Calling TA_CheckAndSavePKey(yourHandle, 0, TA_SYSTEM) will return TA_FAIL if the system files were correctly setup. It will return TA_E_PERMISSION if the system files were not setup due to lack of permissions. The reason it returns TA_FAIL instead of TA_OK is because passing in a "NULL" product key is not valid.
Returns: TA_OK on success. Handle all other return codes as failures.
Possible return codes: TA_OK, TA_FAIL, TA_E_PERMISSION, TA_E_INVALID_FLAGS TA_E_ALREADY_ACTIVATED*/TURBOACTIVATE_API HRESULT TA_CC TA_CheckAndSavePKey(uint32_t handle, STRCTYPE productKey, uint32_t flags);