本文整理汇总了C++中HookData::Unhook方法的典型用法代码示例。如果您正苦于以下问题:C++ HookData::Unhook方法的具体用法?C++ HookData::Unhook怎么用?C++ HookData::Unhook使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HookData
的用法示例。
在下文中一共展示了HookData::Unhook方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: UnhookAll
void UnhookAll()
{
ddrawSurfaceCreate.Unhook();
ddrawSurfaceRestore.Unhook();
ddrawSurfaceRelease.Unhook();
ddrawSurfaceSetPalette.Unhook();
ddrawPaletteSetEntries.Unhook();
}
示例2: FreeGLCapture
void FreeGLCapture()
{
glHookSwapBuffers.Unhook();
glHookSwapLayerBuffers.Unhook();
glHookwglSwapBuffers.Unhook();
glHookDeleteContext.Unhook();
ClearGLData();
}
示例3: CreateSurface
HRESULT STDMETHODCALLTYPE CreateSurface(IDirectDraw7* ddInterface, LPDDSURFACEDESC2 lpDDSurfaceDesc, LPDIRECTDRAWSURFACE7 *lplpDDSurface, IUnknown *pUnkOuter)
{
//logOutput << CurrentTimeString() << "Hooked CreateSurface()" << endl;
if (!g_ddInterface)
{
if (ddInterface->QueryInterface(IID_IDirectDraw, (LPVOID*)&g_ddInterface) == S_OK)
{
logOutput << CurrentTimeString() << "IDirectDraw::CreateSurface: got DDInterface pointer" << endl;
}
else
{
logOutput << CurrentTimeString() << "IDirectDraw::CreateSurface: could not query DirectDraw interface" << endl;
}
}
ddrawSurfaceCreate.Unhook();
HRESULT hRes = ddInterface->CreateSurface(lpDDSurfaceDesc, lplpDDSurface, pUnkOuter);
ddrawSurfaceCreate.Rehook();
if (hRes == DD_OK)
{
if (lpDDSurfaceDesc->ddsCaps.dwCaps & DDSCAPS_PRIMARYSURFACE)
{
logOutput << CurrentTimeString() << "IDirectDraw::CreateSurface: Primary surface created at 0x" << *lplpDDSurface << endl;
getFrontSurface(*lplpDDSurface);
}
}
else
printDDrawError(hRes, "CreateSurface");
return hRes;
}
示例4: Blt
HRESULT STDMETHODCALLTYPE Blt(LPDIRECTDRAWSURFACE7 surface, LPRECT lpDestRect, LPDIRECTDRAWSURFACE7 lpDDSrcSurface, LPRECT lpSrcRect, DWORD dwFlags, LPDDBLTFX lpDDBltFx)
{
//logOutput << CurrentTimeString() << "Hooked Blt()" << endl;
EnterCriticalSection(&ddrawMutex);
ddrawSurfaceBlt.Unhook();
HRESULT hr = surface->Blt(lpDestRect, lpDDSrcSurface, lpSrcRect, dwFlags, lpDDBltFx);
ddrawSurfaceBlt.Rehook();
if (SUCCEEDED(hr))
{
if (!g_bUseFlipMethod)
{
if (getFrontSurface(surface))
{
CaptureDDraw();
}
}
}
LeaveCriticalSection(&ddrawMutex);
return hr;
}
示例5: wglSwapLayerBuffersHook
BOOL WINAPI wglSwapLayerBuffersHook(HDC hDC, UINT fuPlanes)
{
HandleGLSceneUpdate(hDC);
glHookSwapLayerBuffers.Unhook();
BOOL bResult = jimglSwapLayerBuffers(hDC, fuPlanes);
glHookSwapLayerBuffers.Rehook();
return bResult;
}
示例6: SwapBuffersHook
BOOL WINAPI SwapBuffersHook(HDC hDC)
{
HandleGLSceneUpdate(hDC);
glHookSwapBuffers.Unhook();
BOOL bResult = SwapBuffers(hDC);
glHookSwapBuffers.Rehook();
return bResult;
}
示例7: wglDeleteContextHook
BOOL WINAPI wglDeleteContextHook(HGLRC hRC)
{
HandleGLSceneDestroy();
glHookDeleteContext.Unhook();
BOOL bResult = jimglDeleteContext(hRC);
glHookDeleteContext.Rehook();
return bResult;
}
示例8: UnlockSurface
inline HRESULT STDMETHODCALLTYPE UnlockSurface(LPDIRECTDRAWSURFACE7 surface, LPRECT data)
{
//logOutput << CurrentTimeString() << "Called UnlockSurface" << endl;
// standard handler
if (!bTargetAcquired)
{
ddrawSurfaceUnlock.Unhook();
HRESULT hr = surface->Unlock(data);
ddrawSurfaceUnlock.Rehook();
return hr;
}
// use mutex lock to prevent memory corruption when calling Unhook/Rehook from multiple threads
HANDLE mutex = OpenMutex(SYNCHRONIZE, FALSE, mutexName);
if (!mutex)
{
logOutput << CurrentTimeString() << "Could not open mutex - Error(" << GetLastError() << ')' << endl;
return DDERR_GENERIC;
}
DWORD ret = WaitForSingleObject(mutex, INFINITE);
if (ret == WAIT_OBJECT_0)
{
ddrawSurfaceUnlock.Unhook();
HRESULT hr = surface->Unlock(data);
ddrawSurfaceUnlock.Rehook();
ReleaseMutex(mutex);
CloseHandle(mutex);
return hr;
}
else
{
logOutput << CurrentTimeString() << "error while waiting for unlock-mutex to get signaled" << endl;
logOutput << CurrentTimeString() << "GetLastError: " << GetLastError() << endl;
CloseHandle(mutex);
return DDERR_GENERIC;
}
}
示例9: ReloadPrimarySurfacePaletteEntries
void ReloadPrimarySurfacePaletteEntries()
{
if (!primary_surface_palette_ref)
return;
HRESULT err;
ddrawPaletteSetEntries.Unhook();
if (FAILED(err = primary_surface_palette_ref->SetEntries(0, 0, numEntries, entries)))
{
logOutput << CurrentTimeString() << "ReloadPrimarySurfacePaletteEntries(): could not set entires" << endl;
printDDrawError(err);
}
ddrawPaletteSetEntries.Rehook();
}
示例10: SetPalette
HRESULT STDMETHODCALLTYPE SetPalette(LPDIRECTDRAWSURFACE7 surface, LPDIRECTDRAWPALETTE lpDDPalette)
{
//logOutput << CurrentTimeString() << "Hooked SetPalette()" << endl;
ddrawSurfaceSetPalette.Unhook();
HRESULT hr = surface->SetPalette(lpDDPalette);
ddrawSurfaceSetPalette.Rehook();
if (getFrontSurface(surface))
{
if (lpDDPalette)
lpDDPalette->AddRef();
SetupPalette(lpDDPalette);
}
return hr;
}
示例11: SwapResizeBuffersHook
HRESULT STDMETHODCALLTYPE SwapResizeBuffersHook(UINT bufferCount, UINT width, UINT height, DXGI_FORMAT giFormat, UINT flags)
{
IDXGISwapChain *swap = (IDXGISwapChain*)this;
gi11swapResizeBuffers.Unhook();
HRESULT hRes = swap->ResizeBuffers(bufferCount, width, height, giFormat, flags);
gi11swapResizeBuffers.Rehook();
if(lpCurrentSwap == NULL && !bTargetAcquired)
{
lpCurrentSwap = swap;
bTargetAcquired = true;
}
if(lpCurrentSwap == swap)
SetupD3D11(swap);
return hRes;
}
示例12: PaletteSetEntries
HRESULT STDMETHODCALLTYPE PaletteSetEntries(LPDIRECTDRAWPALETTE palette, DWORD dwFlags, DWORD dwStartingEntry, DWORD dwCount, LPPALETTEENTRY lpEntries)
{
//logOutput << CurrentTimeString() << "Hooked SetEntries()" << endl;
ddrawPaletteSetEntries.Unhook();
HRESULT hr = palette->SetEntries(dwFlags, dwStartingEntry, dwCount, lpEntries);
ddrawPaletteSetEntries.Rehook();
// update buffer palette
if (SUCCEEDED(hr))
{
if (g_CurrentPalette.bInitialized)
{
memcpy(g_CurrentPalette.entries + dwStartingEntry, lpEntries, 4 * dwCount); // each entry is 4 bytes if DDCAPS_8BITENTRIES flag is not set
}
}
return hr;
}
示例13:
HRESULT STDMETHODCALLTYPE D3D11SwapResizeBuffersHook(IDXGISwapChain *swap, UINT bufferCount, UINT width, UINT height, DXGI_FORMAT giFormat, UINT flags)
{
ClearD3D11Data();
lpCurrentSwap = NULL;
lpCurrentDevice = NULL;
bTargetAcquired = false;
gi11swapResizeBuffers.Unhook();
HRESULT hRes = swap->ResizeBuffers(bufferCount, width, height, giFormat, flags);
gi11swapResizeBuffers.Rehook();
/*if(lpCurrentSwap == NULL && !bTargetAcquired)
{
lpCurrentSwap = swap;
bTargetAcquired = true;
}
if(lpCurrentSwap == swap)
SetupD3D11(swap);*/
return hRes;
}
示例14: Restore
HRESULT STDMETHODCALLTYPE Restore(LPDIRECTDRAWSURFACE7 surface)
{
//logOutput << CurrentTimeString() << "Hooked Restore()" << endl;
ddrawSurfaceRestore.Unhook();
HRESULT hr = surface->Restore();
if (bHasTextures)
{
if (surface == g_frontSurface)
{
logOutput << CurrentTimeString() << "SurfaceRestore: restoring offscreen buffers" << endl;
bool success = true;
for (UINT i = 0; i < NUM_BUFFERS; i++)
{
HRESULT err;
if (FAILED(err = ddCaptures[i]->Restore()))
{
logOutput << CurrentTimeString() << "SurfaceRestore: error restoring offscreen buffer" << endl;
printDDrawError(err, "Restore");
success = false;
}
}
if (!success)
{
CleanUpDDraw();
}
}
}
ddrawSurfaceRestore.Rehook();
if (!bHasTextures)
{
getFrontSurface(surface);
}
return hr;
}
示例15: Flip
HRESULT STDMETHODCALLTYPE Flip(LPDIRECTDRAWSURFACE7 surface, LPDIRECTDRAWSURFACE7 lpDDSurface, DWORD flags)
{
//logOutput << CurrentTimeString() << "Hooked Flip()" << endl;
HRESULT hr;
EnterCriticalSection(&ddrawMutex);
ddrawSurfaceFlip.Unhook();
hr = surface->Flip(lpDDSurface, flags);
ddrawSurfaceFlip.Rehook();
g_bUseFlipMethod = true;
if (getFrontSurface(surface))
{
CaptureDDraw();
}
LeaveCriticalSection(&ddrawMutex);
return hr;
}