Module: wine Branch: stable Commit: 2007dcf8696998488eacc1c9670699011d4dd4d6 URL: http://source.winehq.org/git/wine.git/?a=commit;h=2007dcf8696998488eacc1c967...
Author: Nikolay Sivov nsivov@codeweavers.com Date: Mon Dec 2 09:38:09 2013 +0400
ntdll: Allow NULL return length argument in NtAdjustPrivilegesToken().
(cherry picked from commit fd65b0a1c3f5f981cc110ca9e6a0edb6323e1296)
---
dlls/advapi32/security.c | 5 +++-- dlls/ntdll/nt.c | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/dlls/advapi32/security.c b/dlls/advapi32/security.c index 359b1e2..a77bad4 100644 --- a/dlls/advapi32/security.c +++ b/dlls/advapi32/security.c @@ -611,8 +611,9 @@ AdjustTokenPrivileges( HANDLE TokenHandle, BOOL DisableAllPrivileges, { NTSTATUS status;
- TRACE("\n"); - + TRACE("(%p %d %p %d %p %p)\n", TokenHandle, DisableAllPrivileges, NewState, BufferLength, + PreviousState, ReturnLength); + status = NtAdjustPrivilegesToken(TokenHandle, DisableAllPrivileges, NewState, BufferLength, PreviousState, ReturnLength); diff --git a/dlls/ntdll/nt.c b/dlls/ntdll/nt.c index 1eff375..39139c9 100644 --- a/dlls/ntdll/nt.c +++ b/dlls/ntdll/nt.c @@ -223,7 +223,7 @@ NTSTATUS WINAPI NtAdjustPrivilegesToken( ret = wine_server_call( req ); if (PreviousState) { - *ReturnLength = reply->len + FIELD_OFFSET( TOKEN_PRIVILEGES, Privileges ); + if (ReturnLength) *ReturnLength = reply->len + FIELD_OFFSET( TOKEN_PRIVILEGES, Privileges ); PreviousState->PrivilegeCount = reply->len / sizeof(LUID_AND_ATTRIBUTES); } }