Get SID of current user as std::string. c++

282 Views Asked by At

Get SID of current user as string. c++

I've been thinking how to get sid in c# it's easy like this: System.Security.Principal.WindowsIdentity.GetCurrent().User.Value;

If someone can give me short solution to get SID as std::string i will be happy.

1

There are 1 best solutions below

0
On BEST ANSWER

See these WINAPI functions:

  • ConvertStringSidToSid(), to convert the account SID strings to a SID that is required as an argument to,
  • LookupAccountSid()