"Erich E. Hoover" ehoover@mymail.mines.edu writes:
/* Test using GetSecurityInfo to obtain security information */
SetLastError(0xdeadbeef);
retval = pGetSecurityInfo(svc_handle, SE_SERVICE, DACL_SECURITY_INFORMATION, &sidOwner,
&sidGroup, &dacl, &sacl, &pSD);
error = GetLastError();
LocalFree(pSD);
ok(retval == ERROR_SUCCESS, "Expected GetSecurityInfo to succeed: result %d\n", retval);
todo_wine ok(error == ERROR_INSUFFICIENT_BUFFER || broken(error == ERROR_SUCCESS) /* W2K3 */
|| broken(error == ERROR_IO_PENDING) /* W2K */ || broken(error == ERROR_NONE_MAPPED) /* NT4 */,
"Expected ERROR_INSUFFICIENT_BUFFER, got %d\n", error);
Testing last error on success is not useful.