Actually, sorry. I just realized that it's a different problem.
CheckAndSavePKey() is what's failing for an invalid product key. I guess that's expected. But does TA_FAIL mean *only* that the product key is invalid? Or could it mean something else? I'm trying to create error messages to display to the user based on the return codes.