Skip to content

CsWin32 0.3.228 removes PSID implicit/explicit IntPtr operator overloads. #1507

@mjr4077au

Description

@mjr4077au

Actual behavior

The latest update removes these three operator overloads from the PSID class:

public static implicit operator IntPtr(PSID value) => new IntPtr(value.Value);
public static explicit operator PSID(IntPtr value) => new PSID((void*)value.ToPointer());
public static explicit operator PSID(UIntPtr value) => new PSID((void*)value.ToPointer());

It's now a lot harder to construct a SecurityIdentifier object from a PSID.

Expected behavior

PSID pSid = GetPSIDFromSomewhere();
SecurityIdentifier sid = new(pSid);

Repro steps

  1. NativeMethods.txt content:
    N/A

  2. NativeMethods.json content (if present):
    N/A

  3. Any of your own code that should be shared?

Context

  • CsWin32 version: 0.3.228
  • 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