On 01/07/2010 03:33 AM, Peter Dons Tychsen wrote:
/* check that SetCapture fails for another window and that it does not touch the error code */
set_cap_wnd = SetCapture(hWnd);
err = GetLastError();
ok(!set_cap_wnd, "ReleaseCapture should have failed!\n");
ok(err == ERROR_SUCCESS, "Bad error-code from SetCapture. got %08X expected %08X\n", err, 0);
/* check that ReleaseCapture fails and does not touch the error code */
status = ReleaseCapture();
err = GetLastError();
ok(!status, "ReleaseCapture should have failed!\n");
ok(err == ERROR_SUCCESS, "Bad error-code from ReleaseCapture. got %08X expected %08X\n", err, 0);
Hi Peter,
The comment says 'does not touch the error code' but the tests don't actually prove this. In general when we try to get a true hold of the last error to see if it changed we set it first, f.e. "SetLastError(0xdeadbeef)".