On 1/8/2013 16:34, Tatyana Fokina wrote:
- memset(a, 'a', sizeof(a));
- SetLastError(NO_ERROR);
- ret = CompareStringA(lcid, 0, a, sizeof(a), a, sizeof(a));
- error = GetLastError();
- ok(!error && ret == CSTR_EQUAL, "ret %d (expected %d), error %d\n", ret, CSTR_EQUAL, error);
It's better to set it to some value you don't expect to be ever used as error code, like 0xdeadbeef or 0xb19b00b5.
On Tue, Jan 08, 2013 at 05:40:44PM +0400, Nikolay Sivov wrote:
On 1/8/2013 16:34, Tatyana Fokina wrote:
- memset(a, 'a', sizeof(a));
- SetLastError(NO_ERROR);
- ret = CompareStringA(lcid, 0, a, sizeof(a), a, sizeof(a));
- error = GetLastError();
- ok(!error && ret == CSTR_EQUAL, "ret %d (expected %d), error %d\n", ret, CSTR_EQUAL, error);
It's better to set it to some value you don't expect to be ever used as error code, like 0xdeadbeef or 0xb19b00b5.
Maybe avoid that particular sequence of bits ;) http://lkml.org/lkml/2012/7/18/625
Andrew