I'm trying to mock some WinAPI
functions via hippomocks
. How can I call the original/mocked WinAPI
, from within the mock?
For example, if I mock CreateFile
, the logic I would like to implement inside the mock which I register via:
MockRepository mocks;
mocks.OnCallFunc(::CreateFile).Do(MyCreateFileMock);
is to call the original API, and then log its output, before returning the result.
I tried to retrieve CreateFile
address before calling the mock, and storing it in a global. When I call that global from within the mock I end up calling the mock again.