mirror of
https://github.com/postgres/postgres.git
synced 2025-08-30 06:01:21 +03:00
Use consistent format for reporting GetLastError()
Use something like "error code %lu" for reporting GetLastError() values on Windows. Previously, a mix of different wordings and formats were in use.
This commit is contained in:
@@ -646,13 +646,13 @@ AddUserToTokenDacl(HANDLE hToken)
|
||||
|
||||
if (!GetTokenInformation(hToken, tic, (LPVOID) ptdd, dwSize, &dwSize))
|
||||
{
|
||||
log_error("could not get token information: %lu", GetLastError());
|
||||
log_error("could not get token information: error code %lu", GetLastError());
|
||||
goto cleanup;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
log_error("could not get token information buffer size: %lu", GetLastError());
|
||||
log_error("could not get token information buffer size: error code %lu", GetLastError());
|
||||
goto cleanup;
|
||||
}
|
||||
}
|
||||
@@ -662,7 +662,7 @@ AddUserToTokenDacl(HANDLE hToken)
|
||||
(DWORD) sizeof(ACL_SIZE_INFORMATION),
|
||||
AclSizeInformation))
|
||||
{
|
||||
log_error("could not get ACL information: %lu", GetLastError());
|
||||
log_error("could not get ACL information: error code %lu", GetLastError());
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
@@ -672,7 +672,7 @@ AddUserToTokenDacl(HANDLE hToken)
|
||||
*/
|
||||
if (!GetTokenUser(hToken, &pTokenUser))
|
||||
{
|
||||
log_error("could not get user token: %lu", GetLastError());
|
||||
log_error("could not get user token: error code %lu", GetLastError());
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
@@ -690,7 +690,7 @@ AddUserToTokenDacl(HANDLE hToken)
|
||||
|
||||
if (!InitializeAcl(pacl, dwNewAclSize, ACL_REVISION))
|
||||
{
|
||||
log_error("could not initialize ACL: %lu", GetLastError());
|
||||
log_error("could not initialize ACL: error code %lu", GetLastError());
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
@@ -699,13 +699,13 @@ AddUserToTokenDacl(HANDLE hToken)
|
||||
{
|
||||
if (!GetAce(ptdd->DefaultDacl, i, (LPVOID *) &pace))
|
||||
{
|
||||
log_error("could not get ACE: %lu", GetLastError());
|
||||
log_error("could not get ACE: error code %lu", GetLastError());
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (!AddAce(pacl, ACL_REVISION, MAXDWORD, pace, ((PACE_HEADER) pace)->AceSize))
|
||||
{
|
||||
log_error("could not add ACE: %lu", GetLastError());
|
||||
log_error("could not add ACE: error code %lu", GetLastError());
|
||||
goto cleanup;
|
||||
}
|
||||
}
|
||||
@@ -713,7 +713,7 @@ AddUserToTokenDacl(HANDLE hToken)
|
||||
/* Add the new ACE for the current user */
|
||||
if (!AddAccessAllowedAceEx(pacl, ACL_REVISION, OBJECT_INHERIT_ACE, GENERIC_ALL, pTokenUser->User.Sid))
|
||||
{
|
||||
log_error("could not add access allowed ACE: %lu", GetLastError());
|
||||
log_error("could not add access allowed ACE: error code %lu", GetLastError());
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
@@ -722,7 +722,7 @@ AddUserToTokenDacl(HANDLE hToken)
|
||||
|
||||
if (!SetTokenInformation(hToken, tic, (LPVOID) &tddNew, dwNewAclSize))
|
||||
{
|
||||
log_error("could not set token information: %lu", GetLastError());
|
||||
log_error("could not set token information: error code %lu", GetLastError());
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
@@ -774,7 +774,7 @@ GetTokenUser(HANDLE hToken, PTOKEN_USER *ppTokenUser)
|
||||
}
|
||||
else
|
||||
{
|
||||
log_error("could not get token information buffer size: %lu", GetLastError());
|
||||
log_error("could not get token information buffer size: error code %lu", GetLastError());
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
@@ -788,7 +788,7 @@ GetTokenUser(HANDLE hToken, PTOKEN_USER *ppTokenUser)
|
||||
LocalFree(*ppTokenUser);
|
||||
*ppTokenUser = NULL;
|
||||
|
||||
log_error("could not get token information: %lu", GetLastError());
|
||||
log_error("could not get token information: error code %lu", GetLastError());
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user