Hello friends,
I'm working on PB Screenshot Cleaner and it goes pretty well. I intercept DirectDrawCreate in pbcl.dll and make my screenshots clean BUT: when I hop into game without PBSS Cleaner and do /pb_getss my game refreshes (vid_restart ?) and after that I can't no longer detour DirectDrawCreate. Why is that ?

Here is what I do:

1. I hook pbcll.dll in DLL_PROCESS_ATTACH;
Code:
hWnd = FindWindow(0, L"Call of Duty 4");
GetWindowThreadProcessId(hWnd, &proccess_ID);
hProcess = OpenProcess(PROCESS_ALL_ACCESS, TRUE, proccess_ID);
DWORD dwPbclBase = (DWORD)GetModuleHandle(L"pbcl.dll");
pPBScreenshotSetup = (PBScreenshotSetup_t)DetourFunction((BYTE *)(dwPbclBase + 0x4C010), (BYTE *)_PBScreenshotSetup);
2. Then I intercept DirectDrawCreate:
[HTML]HRESULT WINAPI _PBScreenshotSetup(GUID FAR* lpGUID, LPDIRECTDRAW FAR* lplpDD, IUnknown FAR* pUnkOuter)
{
reset(); // CLEAN SCENE
HRESULT WINAPI iReturn = pPBScreenshotSetup(lpGUID, lplpDD, pUnkOuter);
return iReturn;
}[/HTML]

So why is taht ?