OK, show me the call to load_datfile(), because what that code is showing me (specifically the fact that PDetsFromPath(datfile) is failing and this is succeeding when it should fail: fprintf(stderr,"datfile = %s\n", datfile);, is that you're still passing in a char* string instead of a wchar_t* string.)
fprintf() with a wide-character string will output garbage. The fact that you're not seeing garbage means that you're using char* strings. See: https://msdn.microsoft.com/en-us/library/xkh07fe2.aspx
Does that make sense?
To put it more clearly. This will succeed:
HRESULT hr = PDetsFromPath(L"c:\\Users\\me\\Turboactivate.dat");
This will not:
HRESULT hr = PDetsFromPath("c:\\Users\\me\\Turboactivate.dat");
Do you see why? Notice the unicode string literal L that precedes the quotes?
See: https://msdn.microsoft.com/en-us/library/69ze775t.aspx