Skip to content

The friendly overload for AdjustTokenPrivileges() is inconsistent. #1558

@mjr4077au

Description

@mjr4077au

Actual behavior

The friendly overload for AdjustTokenPrivileges() requires a pointer to TOKEN_PRIVILEGES for NewState, but uses Span<byte> for PreviousState.

internal static unsafe winmdroot.Foundation.BOOL AdjustTokenPrivileges(SafeHandle TokenHandle, winmdroot.Foundation.BOOL DisableAllPrivileges, winmdroot.Security.TOKEN_PRIVILEGES* NewState, Span<byte> PreviousState, out uint ReturnLength)
{
}

Expected behavior

Consistent parameters for each type. Ideally in winmdroot.Security.TOKEN_PRIVILEGES NewState/out winmdroot.Security.TOKEN_PRIVILEGES* PreviousState.

Repro steps

N/A

  1. NativeMethods.txt content:
AdjustTokenPrivileges
  1. NativeMethods.json content (if present):
    N/A

  2. Any of your own code that should be shared?
    N/A

Context

  • CsWin32 version: 0.3.253
  • Win32Metadata version (if explicitly set by project): N/A
  • Target Framework: net472
  • LangVersion (if explicitly set by project): N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions