IsGenuineEx() does not return TA_E_INTET when suposed to

I am calling IsGenuineEx with TA_SKIP_OFFLINE flag, but when internet connection is not available the return code is TA_E_ACTIVATE, instead of TA_E_INET. How come do i receive correct return value ? I need to process TA_E_INET in order to enter the grace period and warn the users.

TA_E_ACTIVATE means you're not activated. You have to activate first. This is a type of error. The grace period isn't about trials, it's about customers that are already activated and you want them to re-verify every X days (with a Y day grace period).

Make sense?

Yes it does. But in my case i have already made a successful call to Activate. Here is a sample code:

m_GenuineOptions.nLength = sizeof(GENUINE_OPTIONS);

m_GenuineOptions.nDaysBetweenChecks = 0; // this is 0 for debug purposes - i want to check data on every //run until i am sure that everything is tested properly

m_GenuineOptions.nGraceDaysOnInetErr = 1;

m_GenuineOptions.flags = TA_USER;

hr = IsGenuineEx(TA_GUID, &m_GenuineOptions);

if (hr == TA_OK || hr == TA_E_FEATURES_CHANGED || hr == TA_E_INET || hr == TA_E_INET_DELAYED) { ... }

else { uint32_t utrialDays = 0;

hr = UseTrial(TA_SYSTEM);

if (hr == TA_OK) { hr = TrialDaysRemaining(TA_GUID, &utrialDays);

i... }

else printf("Failed to UseTrial: hr = %d\n", hr);

if (hr == TA_OK) { // try to activate hr = Activate();

if (hr == TA_OK) { ... } } }

And one more thing remained to be asked. As far as i read, after successful activation the custom fields of my license will be saved on the current PC, so i can get their values even if the license is expired and non-Genuine.Is this correct?

Forgot to mention that the registration key have been saved successfully.

so i can get their values even if the license is expired and non-Genuine.

No.

m_GenuineOptions.nDaysBetweenChecks = 0; // this is 0 for debug purposes - i want to check data on every //run until i am sure that everything is tested properly

Don't do that. Set it to 1 or above.

m_GenuineOptions.flags = TA_USER;

That's not a correct flag. See TurboActivate.h for the correct flags;

  • 0 (for no flags)
  • TA_SKIP_OFFLINE
  • TA_OFFLINE_SHOW_INET_ERR

I have corrected these mistakes.But there is still trouble.After Activate() is called successful, on the next launch of my application if no internet connection is present IsGenuineEx() still returns TA_E_ACTIVATE.

Because you set nDaysBetweenChecks to 0, you've effectively forced the user to always be connected to the internet. That's why you shouldn't do that (and a dozen other reasons).

Also, IsGenuineEx() will only return TA_E_ACTIVATE if you're not actually activated. So, first make sure you solve that first. My guess is either you're not activated (hence TA_E_ACTIVATE), or you are activated and you're really getting another error code.