IsGenuineEx return codes

When IsGenuineEx is called from my app, but the user's product key has been deactivated (not revoked) by me through the LimeLM web site, what is the return code supposed to be? Right now I'm getting TA_FAIL, which makes it difficult to distinguish this situation from the app never having been activated in the first place.

I'd like to make sure I can print a message that specifically says "Your product key has been deactivated", rather than just "Activation required" or something.

Call IsActivated() before IsGenuineEx() and you can use that information to know whether the user was remotely deactivated.

Does that make sense?

That doesn't seem to work for me. Can you please tell me what's wrong with the code below? This is basically what my app is doing now, but I've simplified it a bit for this example.

bool initiallyActivated = (IsActivated(guid) == TA_OK);

HRESULT hr = IsGenuineEx(guid, &opts);

if (hr == TA_OK || hr == TA_E_FEATURES_CHANGED || hr == TA_E_INET || hr == TA_E_INET_DELAYED) { if (hr == TA_E_INET) { MessageBox(... "Warning: failed to verify key with server. We'll check again in 5 hours."); } else if (hr == TA_E_INET_DELAYED) { MessageBox(... "Warning: key is still not verified. Make sure you are connected to the internet as soon as possible so we can re-check when the 5-hour grace period expires."); }}else { if (initiallyActivated) { MessageBox(... "Product key is not genuine. App has been deactivated."); }

// ... now allow user to activate (reactivate)}

// now launch app (or exit if not activated or if activation failed)

The issue I'm having is that no matter what I do to intentionally cause problems, I can't get to the "Warning: failed to verify key with server" case, or the "Product key is not genuine case". I want to have specific messages for all of these cases. Can you tell me exactly what I need to do to test each of my conditions?

Ok, so I finally did get it to hit the "Product key is not genuine case".

So I guess my main question can be rephrased as this: when specifically will IsGenuineEx return TA_E_INET vs TA_E_INET_DELAYED? What are the different situations that will trigger one vs. the other?

Unplug your network cards and you'll get TA_E_INET. Or, if you recently got TA_E_INET then you'll get TA_E_INET_DELAYED for the next 5 hours.

The internet error just means TA couldn't talk to LimeLM. Either because you're not connected to the internet or because something is blocking the connection (it could be a thousand things).

So am I *guaranteed* to get TA_E_INET the first time IsGenuineEx does a validation check after the network card has been unplugged? This is what seems to not be happening for me.

On subsequent runs, I do get TA_E_INET_DELAYED though, so that aspect does seem to be working.

So am I *guaranteed* to get TA_E_INET the first time IsGenuineEx does a validation check after the network card has been unplugged?

Yes.