Home > Back-end >  AdjustTokenPrivileges function USES the problem
AdjustTokenPrivileges function USES the problem

Time:09-23

Why am I in the use of AdjustTokenPrivileges the return value is zero, use GetLastError returns value is 0, namely ERROR_SUCCESS,,
This do not agree with the MSDN said,

MSDN says:
If the function succeeds, the return value is nonzero. To determine been the function adjusted all of the specified privileges, call GetLastError, which returns one of the following values when the function succeeds:
ERROR_SUCCESS The function adjusted all specified privileges.
ERROR_NOT_ALL_ASSIGNED The token does not have one or more of The privileges specified in The NewState because parameter. The function may succeed with this error value even if no privileges were adjusted. The PreviousState parameter are The privileges that were adjusted.

If the function fails, the return value is zero. To get extended error information, call GetLastError.
  • Related