I tried a simple three line hello world program, which tries to get the SID for Unix_User+1:
bash -c 'getent passwd "Unix_User+1"'
Unix_User+1:*:4278190081:4278190081:U-Unix_User\1,S-1-22-1-1:/:/sbin/nologin
But putting "S-1-22-1-1" into ConvertStringSidToSidA() fails with ERROR_INVALID_SID on Cygwin.
ConvertStringSidToSidA("S-1-22-1-1", &sid)
Why? I thought SMB had "S-1-22-1-*" reserved for its usage, and Cygwin uses Unix_User+1 in ls -l output.
How can I get ConvertStringSidToSidA() working in my program?
I solved this in our codebase (https://github.com/kofemann/ms-nfs41-client/blob/master/daemon/acl.c) like this: