setupapi/tests: Avoid side-effect in an assert.

This commit is contained in:
Thomas Faber 2015-04-03 07:55:50 +02:00 committed by Alexandre Julliard
parent 5d85f57814
commit 655e7f98db

View File

@ -63,10 +63,12 @@ static BOOL (WINAPI *pSetupGetInfFileListW)(PCWSTR, DWORD, PWSTR, DWORD, PDWORD)
static void create_inf_file(LPCSTR filename, const char *data)
{
DWORD res;
BOOL ret;
HANDLE handle = CreateFileA(filename, GENERIC_WRITE, 0, NULL,
CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
assert(handle != INVALID_HANDLE_VALUE);
assert(WriteFile(handle, data, strlen(data), &res, NULL));
ret = WriteFile(handle, data, strlen(data), &res, NULL);
assert(ret != 0);
CloseHandle(handle);
}