| Previous | Next |
| ERROR_INVALID_LABEL | ERROR_SOME_NOT_MAPPED |
ERROR_NOT_ALL_ASSIGNED
ERROR_NOT_ALL_ASSIGNED (1300, 0x00000514) is a special success-with-warning result from AdjustTokenPrivileges: the call returned success, but the token did not contain one or more requested privileges.
Why the Boolean return value is not enough
AdjustTokenPrivileges can enable or disable privileges already present in an access token. It cannot grant a privilege that is absent. Windows may adjust the privileges that do exist and still set the last error to ERROR_NOT_ALL_ASSIGNED; in some cases none of the requested privileges were changed.
Correct handling
- Call
GetLastErrorimmediately after a successfulAdjustTokenPrivilegescall. - Fail the operation, or use a deliberately designed reduced-capability path, when the required privilege was not assigned.
- Inspect the actual token with
GetTokenInformation; a thread impersonation token can be the effective token rather than the process token. - Do not assume that running elevated can add every privilege to a token. Assignment is controlled by the account and system policy.
See Microsoft documentation for AdjustTokenPrivileges and changing privileges in a token.
Looking for a different code? Search another status or error code.