chevron-thin-right chevron-thin-left brand cancel-circle search youtube-icon google-plus-icon linkedin-icon facebook-icon twitter-icon toolbox download check linkedin phone twitter-old google-plus facebook profile-male chat calendar profile-male
+1 vote
asked by IlanG (4.8k points)

1 Answer

0 votes

FAKE_GLOBAL API is not supported with overloaded global functions. 

But you don't have to use it to fake a global function as you can use the WHEN_CALLED API to control its behavior by passing the overload argument type:

  • WHEN_CALLED(AfxMessageBox(ANY_VAL(LPCTSTR))).Return(1);
  • WHEN_CALLED(AfxMessageBox(ANY_VAL(UINT))).Return(1);

Now after doing this we encountered another problem which is: "Cannot find PDB for: c:windowssystem32mfc140ud.dll".

Isolator++ needs the PDB file to find and fake the function.

Now we've had success before with setting the env var: set _NT_SYMBOL_PATH=srv*c:symbols*https://msdl.microsoft.com/download/symbols to prompt the MS EULA to download the necessary PDB files.

For some environmental reason, it didn't work for me. 

So I used a PDBDownloader to download the PDB and placed the PDB directly in the build output directory: "$(TargetDir)".

And then it worked fine.

answered by David (1.9k points)
...