Dont set ERROR_SUCCESS generally

Turns out we should only be setting this in a select few cases.
This commit is contained in:
2025-10-06 00:03:08 -06:00
parent 01ed50c4b4
commit 166b9036fd
30 changed files with 61 additions and 325 deletions

View File

@@ -111,7 +111,6 @@ BOOL WIN_FUNC LookupAccountSidW(LPCWSTR lpSystemName, PSID Sid, LPWSTR Name, LPD
*peUse = SidTypeWellKnownGroup;
*cchName = requiredAccount;
*cchReferencedDomainName = requiredDomain;
wibo::lastError = ERROR_SUCCESS;
return TRUE;
}
@@ -127,7 +126,6 @@ BOOL WIN_FUNC LookupPrivilegeValueA(LPCSTR lpSystemName, LPCSTR lpName, PLUID lp
std::string normalized = normalizePrivilegeName(lpName);
LUID luid = lookupOrGeneratePrivilegeLuid(normalized);
*lpLuid = luid;
wibo::lastError = ERROR_SUCCESS;
return TRUE;
}
@@ -143,7 +141,6 @@ BOOL WIN_FUNC LookupPrivilegeValueW(LPCWSTR lpSystemName, LPCWSTR lpName, PLUID
std::string normalized = normalizePrivilegeName(ansiName);
LUID luid = lookupOrGeneratePrivilegeLuid(normalized);
*lpLuid = luid;
wibo::lastError = ERROR_SUCCESS;
return TRUE;
}
@@ -163,7 +160,6 @@ BOOL WIN_FUNC GetUserNameA(LPSTR lpBuffer, LPDWORD pcbBuffer) {
}
std::memcpy(lpBuffer, name, needed);
*pcbBuffer = static_cast<DWORD>(needed);
wibo::lastError = ERROR_SUCCESS;
return TRUE;
}
@@ -182,7 +178,6 @@ BOOL WIN_FUNC GetUserNameW(LPWSTR lpBuffer, LPDWORD pcbBuffer) {
}
std::memcpy(lpBuffer, kAccountSystem, needed * sizeof(WCHAR));
*pcbBuffer = static_cast<DWORD>(needed);
wibo::lastError = ERROR_SUCCESS;
return TRUE;
}