TA_SYSTEM flag with Ruby Fiddle

Hi,My app is in Ruby, and I'm trying to make a call to CheckAndSavePKey using Fiddle (docs here: http://ruby-doc.org/stdlib-2.0.0/libdoc/fiddle/rdoc/Fiddle.html).

I've had success calling IsActivated and IsGenuine by encoding the GUID as UTF-16LE, but I'm running into issues with passing the TA_SYSTEM/TA_USER flag in CheckAndSavePKey. I get an error code 16 (TA_E_PERMISSION) which means that last flag (either TA_SYSTEM or TA_USER) is invalid.

I've tried encoding the string "TA_SYSTEM" as UTF-16LE, but something tells me that's not correct.

Any help would be much appreciated! Thanks!

On non-Windows systems, calling either TA_CheckAndSavePKey() or TA_UseTrial() with TA_SYSTEM requires admin permission the first time you make that call. So, the solution to the "TA_E_PERMISSION" error is to either call it the first time with admin permissions (e.g. with something like an installer) or use TA_USER.

>> "I've tried encoding the string "TA_SYSTEM" as UTF-16LE, but something tells me that's not correct."

No, those flags are unsigned integers.

What are the integer values of TA_SYSTEM and TA_USER?

They're in TurboActivate.h (including all constants, functions, and error code -- as well as full documentation for each function).

/* Flags for the TA_UseTrial() and TA_CheckAndSavePKey() functions. */#define TA_SYSTEM ((uint32_t)1)#define TA_USER ((uint32_t)2)

OK...I saw those (1 & 2)...but am still having issues passing them as integers through Fiddle. I'll keep at it...thanks.