dlls/ddraw/tests/ddraw2.c
/* Set the wndproc back to what ddraw expects it to be, and release the ddraw
 * interface. This prevents subsequent SetCooperativeLevel() calls on a
 * different window from failing with DDERR_HWNDALREADYSET. */
Set the wndproc back to what ddraw expects it to be, and release the ddraw
interface. This prevents subsequent SetCooperativeLevel() calls on a
different window from failing with DDERR_HWNDALREADYSET.
Set the wndproc back to what ddraw expects it to be and release the ddraw interface . This prevents subsequent SetCooperativeLevel () calls on a different window from failing with DDERR_HWNDALREADYSET .
static void fix_wndproc(HWND window, LONG_PTR proc)
{
    IDirectDraw2 *ddraw;
    HRESULT hr;
    if (!(ddraw = create_ddraw()))
        return;
    SetWindowLongPtrA(window, GWLP_WNDPROC, proc);
    hr = IDirectDraw2_SetCooperativeLevel(ddraw, window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN);
    ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#x.\n", hr);
    hr = IDirectDraw2_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL);
    ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#x.\n", hr);
    IDirectDraw2_Release(ddraw);
}
static void fix_wndproc ( HWND window , LONG_PTR proc ) { IDirectDraw2 * ddraw ; HRESULT hr ; if ( ! ( ddraw = create_ddraw ( ) ) ) return ; SetWindowLongPtrA ( window , GWLP_WNDPROC , proc ) ; hr = IDirectDraw2_SetCooperativeLevel ( ddraw , window , DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN ) ; ok ( SUCCEEDED ( hr ) , " \n " , hr ) ; hr = IDirectDraw2_SetCooperativeLevel ( ddraw , window , DDSCL_NORMAL ) ; ok ( SUCCEEDED ( hr ) , " \n " , hr ) ; IDirectDraw2_Release ( ddraw ) ; }
Set the wndproc back to what ddraw expects it to be, and release the ddraw
 interface.
Set the wndproc back to what ddraw expects it to be and release the ddraw interface .