ReactOS  0.4.12-dev-916-gffc4e30
sddl.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define SDDL_REVISION_1   1
 
#define SDDL_REVISION   SDDL_REVISION_1
 
#define SDDL_OWNER   TEXT("O")
 
#define SDDL_GROUP   TEXT("G")
 
#define SDDL_DACL   TEXT("D")
 
#define SDDL_SACL   TEXT("S")
 
#define SDDL_PROTECTED   TEXT("P")
 
#define SDDL_AUTO_INHERIT_REQ   TEXT("AR")
 
#define SDDL_AUTO_INHERITED   TEXT("AI")
 
#define SDDL_READ_PROPERTY   TEXT("RP")
 
#define SDDL_WRITE_PROPERTY   TEXT("WP")
 
#define SDDL_CREATE_CHILD   TEXT("CC")
 
#define SDDL_DELETE_CHILD   TEXT("DC")
 
#define SDDL_LIST_CHILDREN   TEXT("LC")
 
#define SDDL_SELF_WRITE   TEXT("SW")
 
#define SDDL_LIST_OBJECT   TEXT("LO")
 
#define SDDL_DELETE_TREE   TEXT("DT")
 
#define SDDL_CONTROL_ACCESS   TEXT("CR")
 
#define SDDL_READ_CONTROL   TEXT("RC")
 
#define SDDL_WRITE_DAC   TEXT("WD")
 
#define SDDL_WRITE_OWNER   TEXT("WO")
 
#define SDDL_STANDARD_DELETE   TEXT("SD")
 
#define SDDL_GENERIC_ALL   TEXT("GA")
 
#define SDDL_GENERIC_READ   TEXT("GR")
 
#define SDDL_GENERIC_WRITE   TEXT("GW")
 
#define SDDL_GENERIC_EXECUTE   TEXT("GX")
 
#define SDDL_FILE_ALL   TEXT("FA")
 
#define SDDL_FILE_READ   TEXT("FR")
 
#define SDDL_FILE_WRITE   TEXT("FW")
 
#define SDDL_FILE_EXECUTE   TEXT("FX")
 
#define SDDL_KEY_ALL   TEXT("KA")
 
#define SDDL_KEY_READ   TEXT("KR")
 
#define SDDL_KEY_WRITE   TEXT("KW")
 
#define SDDL_KEY_EXECUTE   TEXT("KX")
 
#define SDDL_ALIAS_SIZE   2
 
#define SDDL_DOMAIN_ADMINISTRATORS   TEXT("DA")
 
#define SDDL_DOMAIN_GUESTS   TEXT("DG")
 
#define SDDL_DOMAIN_USERS   TEXT("DU")
 
#define SDDL_ENTERPRISE_DOMAIN_CONTROLLERS   TEXT("ED")
 
#define SDDL_DOMAIN_DOMAIN_CONTROLLERS   TEXT("DD")
 
#define SDDL_DOMAIN_COMPUTERS   TEXT("DC")
 
#define SDDL_BUILTIN_ADMINISTRATORS   TEXT("BA")
 
#define SDDL_BUILTIN_GUESTS   TEXT("BG")
 
#define SDDL_BUILTIN_USERS   TEXT("BU")
 
#define SDDL_LOCAL_ADMIN   TEXT("LA")
 
#define SDDL_LOCAL_GUEST   TEXT("LG")
 
#define SDDL_ACCOUNT_OPERATORS   TEXT("AO")
 
#define SDDL_BACKUP_OPERATORS   TEXT("BO")
 
#define SDDL_PRINTER_OPERATORS   TEXT("PO")
 
#define SDDL_SERVER_OPERATORS   TEXT("SO")
 
#define SDDL_AUTHENTICATED_USERS   TEXT("AU")
 
#define SDDL_PERSONAL_SELF   TEXT("PS")
 
#define SDDL_CREATOR_OWNER   TEXT("CO")
 
#define SDDL_CREATOR_GROUP   TEXT("CG")
 
#define SDDL_LOCAL_SYSTEM   TEXT("SY")
 
#define SDDL_POWER_USERS   TEXT("PU")
 
#define SDDL_EVERYONE   TEXT("WD")
 
#define SDDL_REPLICATOR   TEXT("RE")
 
#define SDDL_INTERACTIVE   TEXT("IU")
 
#define SDDL_NETWORK   TEXT("NU")
 
#define SDDL_SERVICE   TEXT("SU")
 
#define SDDL_RESTRICTED_CODE   TEXT("RC")
 
#define SDDL_ANONYMOUS   TEXT("AN")
 
#define SDDL_SCHEMA_ADMINISTRATORS   TEXT("SA")
 
#define SDDL_CERT_SERV_ADMINISTRATORS   TEXT("CA")
 
#define SDDL_RAS_SERVERS   TEXT("RS")
 
#define SDDL_ENTERPRISE_ADMINS   TEXT("EA")
 
#define SDDL_GROUP_POLICY_ADMINS   TEXT("PA")
 
#define SDDL_ALIAS_PREW2KCOMPACC   TEXT("RU")
 
#define SDDL_LOCAL_SERVICE   TEXT("LS")
 
#define SDDL_NETWORK_SERVICE   TEXT("NS")
 
#define SDDL_REMOTE_DESKTOP   TEXT("RD")
 
#define SDDL_NETWORK_CONFIGURATION_OPS   TEXT("NO")
 
#define SDDL_PERFMON_USERS   TEXT("MU")
 
#define SDDL_PERFLOG_USERS   TEXT("LU")
 
#define SDDL_SEPERATORC   TEXT(';')
 
#define SDDL_DELIMINATORC   TEXT(':')
 
#define SDDL_ACE_BEGINC   TEXT('(')
 
#define SDDL_ACE_ENDC   TEXT(')')
 
#define SDDL_SEPERATOR   TEXT(";")
 
#define SDDL_DELIMINATOR   TEXT(":")
 
#define SDDL_ACE_BEGIN   TEXT("(")
 
#define SDDL_ACE_END   TEXT(")")
 
#define ConvertSidToStringSid   ConvertSidToStringSidA
 
#define ConvertStringSidToSid   ConvertStringSidToSidA
 
#define ConvertStringSecurityDescriptorToSecurityDescriptor   ConvertStringSecurityDescriptorToSecurityDescriptorA
 
#define ConvertSecurityDescriptorToStringSecurityDescriptor   ConvertSecurityDescriptorToStringSecurityDescriptorA
 

Functions

BOOL WINAPI ConvertSidToStringSidA (PSID, LPSTR *)
 
BOOL WINAPI ConvertSidToStringSidW (PSID, LPWSTR *)
 
BOOL WINAPI ConvertStringSidToSidA (LPCSTR, PSID *)
 
BOOL WINAPI ConvertStringSidToSidW (LPCWSTR, PSID *)
 
BOOL WINAPI ConvertStringSecurityDescriptorToSecurityDescriptorA (LPCSTR, DWORD, PSECURITY_DESCRIPTOR *, PULONG)
 
BOOL WINAPI ConvertStringSecurityDescriptorToSecurityDescriptorW (LPCWSTR, DWORD, PSECURITY_DESCRIPTOR *, PULONG)
 
BOOL WINAPI ConvertSecurityDescriptorToStringSecurityDescriptorA (PSECURITY_DESCRIPTOR, DWORD, SECURITY_INFORMATION, LPSTR *, PULONG)
 
BOOL WINAPI ConvertSecurityDescriptorToStringSecurityDescriptorW (PSECURITY_DESCRIPTOR, DWORD, SECURITY_INFORMATION, LPWSTR *, PULONG)
 

Macro Definition Documentation

◆ ConvertSecurityDescriptorToStringSecurityDescriptor

#define ConvertSecurityDescriptorToStringSecurityDescriptor   ConvertSecurityDescriptorToStringSecurityDescriptorA

Definition at line 164 of file sddl.h.

◆ ConvertSidToStringSid

#define ConvertSidToStringSid   ConvertSidToStringSidA

Definition at line 160 of file sddl.h.

◆ ConvertStringSecurityDescriptorToSecurityDescriptor

#define ConvertStringSecurityDescriptorToSecurityDescriptor   ConvertStringSecurityDescriptorToSecurityDescriptorA

Definition at line 162 of file sddl.h.

◆ ConvertStringSidToSid

#define ConvertStringSidToSid   ConvertStringSidToSidA

Definition at line 161 of file sddl.h.

◆ SDDL_ACCOUNT_OPERATORS

#define SDDL_ACCOUNT_OPERATORS   TEXT("AO")

Definition at line 93 of file sddl.h.

◆ SDDL_ACE_BEGIN

#define SDDL_ACE_BEGIN   TEXT("(")

Definition at line 136 of file sddl.h.

◆ SDDL_ACE_BEGINC

#define SDDL_ACE_BEGINC   TEXT('(')

Definition at line 128 of file sddl.h.

◆ SDDL_ACE_END

#define SDDL_ACE_END   TEXT(")")

Definition at line 137 of file sddl.h.

◆ SDDL_ACE_ENDC

#define SDDL_ACE_ENDC   TEXT(')')

Definition at line 129 of file sddl.h.

◆ SDDL_ALIAS_PREW2KCOMPACC

#define SDDL_ALIAS_PREW2KCOMPACC   TEXT("RU")

Definition at line 115 of file sddl.h.

◆ SDDL_ALIAS_SIZE

#define SDDL_ALIAS_SIZE   2

Definition at line 77 of file sddl.h.

◆ SDDL_ANONYMOUS

#define SDDL_ANONYMOUS   TEXT("AN")

Definition at line 109 of file sddl.h.

◆ SDDL_AUTHENTICATED_USERS

#define SDDL_AUTHENTICATED_USERS   TEXT("AU")

Definition at line 97 of file sddl.h.

◆ SDDL_AUTO_INHERIT_REQ

#define SDDL_AUTO_INHERIT_REQ   TEXT("AR")

Definition at line 45 of file sddl.h.

◆ SDDL_AUTO_INHERITED

#define SDDL_AUTO_INHERITED   TEXT("AI")

Definition at line 46 of file sddl.h.

◆ SDDL_BACKUP_OPERATORS

#define SDDL_BACKUP_OPERATORS   TEXT("BO")

Definition at line 94 of file sddl.h.

◆ SDDL_BUILTIN_ADMINISTRATORS

#define SDDL_BUILTIN_ADMINISTRATORS   TEXT("BA")

Definition at line 88 of file sddl.h.

◆ SDDL_BUILTIN_GUESTS

#define SDDL_BUILTIN_GUESTS   TEXT("BG")

Definition at line 89 of file sddl.h.

◆ SDDL_BUILTIN_USERS

#define SDDL_BUILTIN_USERS   TEXT("BU")

Definition at line 90 of file sddl.h.

◆ SDDL_CERT_SERV_ADMINISTRATORS

#define SDDL_CERT_SERV_ADMINISTRATORS   TEXT("CA")

Definition at line 111 of file sddl.h.

◆ SDDL_CONTROL_ACCESS

#define SDDL_CONTROL_ACCESS   TEXT("CR")

Definition at line 59 of file sddl.h.

◆ SDDL_CREATE_CHILD

#define SDDL_CREATE_CHILD   TEXT("CC")

Definition at line 53 of file sddl.h.

◆ SDDL_CREATOR_GROUP

#define SDDL_CREATOR_GROUP   TEXT("CG")

Definition at line 100 of file sddl.h.

◆ SDDL_CREATOR_OWNER

#define SDDL_CREATOR_OWNER   TEXT("CO")

Definition at line 99 of file sddl.h.

◆ SDDL_DACL

#define SDDL_DACL   TEXT("D")

Definition at line 38 of file sddl.h.

◆ SDDL_DELETE_CHILD

#define SDDL_DELETE_CHILD   TEXT("DC")

Definition at line 54 of file sddl.h.

◆ SDDL_DELETE_TREE

#define SDDL_DELETE_TREE   TEXT("DT")

Definition at line 58 of file sddl.h.

◆ SDDL_DELIMINATOR

#define SDDL_DELIMINATOR   TEXT(":")

Definition at line 135 of file sddl.h.

◆ SDDL_DELIMINATORC

#define SDDL_DELIMINATORC   TEXT(':')

Definition at line 127 of file sddl.h.

◆ SDDL_DOMAIN_ADMINISTRATORS

#define SDDL_DOMAIN_ADMINISTRATORS   TEXT("DA")

Definition at line 82 of file sddl.h.

◆ SDDL_DOMAIN_COMPUTERS

#define SDDL_DOMAIN_COMPUTERS   TEXT("DC")

Definition at line 87 of file sddl.h.

◆ SDDL_DOMAIN_DOMAIN_CONTROLLERS

#define SDDL_DOMAIN_DOMAIN_CONTROLLERS   TEXT("DD")

Definition at line 86 of file sddl.h.

◆ SDDL_DOMAIN_GUESTS

#define SDDL_DOMAIN_GUESTS   TEXT("DG")

Definition at line 83 of file sddl.h.

◆ SDDL_DOMAIN_USERS

#define SDDL_DOMAIN_USERS   TEXT("DU")

Definition at line 84 of file sddl.h.

◆ SDDL_ENTERPRISE_ADMINS

#define SDDL_ENTERPRISE_ADMINS   TEXT("EA")

Definition at line 113 of file sddl.h.

◆ SDDL_ENTERPRISE_DOMAIN_CONTROLLERS

#define SDDL_ENTERPRISE_DOMAIN_CONTROLLERS   TEXT("ED")

Definition at line 85 of file sddl.h.

◆ SDDL_EVERYONE

#define SDDL_EVERYONE   TEXT("WD")

Definition at line 103 of file sddl.h.

◆ SDDL_FILE_ALL

#define SDDL_FILE_ALL   TEXT("FA")

Definition at line 68 of file sddl.h.

◆ SDDL_FILE_EXECUTE

#define SDDL_FILE_EXECUTE   TEXT("FX")

Definition at line 71 of file sddl.h.

◆ SDDL_FILE_READ

#define SDDL_FILE_READ   TEXT("FR")

Definition at line 69 of file sddl.h.

◆ SDDL_FILE_WRITE

#define SDDL_FILE_WRITE   TEXT("FW")

Definition at line 70 of file sddl.h.

◆ SDDL_GENERIC_ALL

#define SDDL_GENERIC_ALL   TEXT("GA")

Definition at line 64 of file sddl.h.

◆ SDDL_GENERIC_EXECUTE

#define SDDL_GENERIC_EXECUTE   TEXT("GX")

Definition at line 67 of file sddl.h.

◆ SDDL_GENERIC_READ

#define SDDL_GENERIC_READ   TEXT("GR")

Definition at line 65 of file sddl.h.

◆ SDDL_GENERIC_WRITE

#define SDDL_GENERIC_WRITE   TEXT("GW")

Definition at line 66 of file sddl.h.

◆ SDDL_GROUP

#define SDDL_GROUP   TEXT("G")

Definition at line 37 of file sddl.h.

◆ SDDL_GROUP_POLICY_ADMINS

#define SDDL_GROUP_POLICY_ADMINS   TEXT("PA")

Definition at line 114 of file sddl.h.

◆ SDDL_INTERACTIVE

#define SDDL_INTERACTIVE   TEXT("IU")

Definition at line 105 of file sddl.h.

◆ SDDL_KEY_ALL

#define SDDL_KEY_ALL   TEXT("KA")

Definition at line 72 of file sddl.h.

◆ SDDL_KEY_EXECUTE

#define SDDL_KEY_EXECUTE   TEXT("KX")

Definition at line 75 of file sddl.h.

◆ SDDL_KEY_READ

#define SDDL_KEY_READ   TEXT("KR")

Definition at line 73 of file sddl.h.

◆ SDDL_KEY_WRITE

#define SDDL_KEY_WRITE   TEXT("KW")

Definition at line 74 of file sddl.h.

◆ SDDL_LIST_CHILDREN

#define SDDL_LIST_CHILDREN   TEXT("LC")

Definition at line 55 of file sddl.h.

◆ SDDL_LIST_OBJECT

#define SDDL_LIST_OBJECT   TEXT("LO")

Definition at line 57 of file sddl.h.

◆ SDDL_LOCAL_ADMIN

#define SDDL_LOCAL_ADMIN   TEXT("LA")

Definition at line 91 of file sddl.h.

◆ SDDL_LOCAL_GUEST

#define SDDL_LOCAL_GUEST   TEXT("LG")

Definition at line 92 of file sddl.h.

◆ SDDL_LOCAL_SERVICE

#define SDDL_LOCAL_SERVICE   TEXT("LS")

Definition at line 116 of file sddl.h.

◆ SDDL_LOCAL_SYSTEM

#define SDDL_LOCAL_SYSTEM   TEXT("SY")

Definition at line 101 of file sddl.h.

◆ SDDL_NETWORK

#define SDDL_NETWORK   TEXT("NU")

Definition at line 106 of file sddl.h.

◆ SDDL_NETWORK_CONFIGURATION_OPS

#define SDDL_NETWORK_CONFIGURATION_OPS   TEXT("NO")

Definition at line 119 of file sddl.h.

◆ SDDL_NETWORK_SERVICE

#define SDDL_NETWORK_SERVICE   TEXT("NS")

Definition at line 117 of file sddl.h.

◆ SDDL_OWNER

#define SDDL_OWNER   TEXT("O")

Definition at line 36 of file sddl.h.

◆ SDDL_PERFLOG_USERS

#define SDDL_PERFLOG_USERS   TEXT("LU")

Definition at line 121 of file sddl.h.

◆ SDDL_PERFMON_USERS

#define SDDL_PERFMON_USERS   TEXT("MU")

Definition at line 120 of file sddl.h.

◆ SDDL_PERSONAL_SELF

#define SDDL_PERSONAL_SELF   TEXT("PS")

Definition at line 98 of file sddl.h.

◆ SDDL_POWER_USERS

#define SDDL_POWER_USERS   TEXT("PU")

Definition at line 102 of file sddl.h.

◆ SDDL_PRINTER_OPERATORS

#define SDDL_PRINTER_OPERATORS   TEXT("PO")

Definition at line 95 of file sddl.h.

◆ SDDL_PROTECTED

#define SDDL_PROTECTED   TEXT("P")

Definition at line 44 of file sddl.h.

◆ SDDL_RAS_SERVERS

#define SDDL_RAS_SERVERS   TEXT("RS")

Definition at line 112 of file sddl.h.

◆ SDDL_READ_CONTROL

#define SDDL_READ_CONTROL   TEXT("RC")

Definition at line 60 of file sddl.h.

◆ SDDL_READ_PROPERTY

#define SDDL_READ_PROPERTY   TEXT("RP")

Definition at line 51 of file sddl.h.

◆ SDDL_REMOTE_DESKTOP

#define SDDL_REMOTE_DESKTOP   TEXT("RD")

Definition at line 118 of file sddl.h.

◆ SDDL_REPLICATOR

#define SDDL_REPLICATOR   TEXT("RE")

Definition at line 104 of file sddl.h.

◆ SDDL_RESTRICTED_CODE

#define SDDL_RESTRICTED_CODE   TEXT("RC")

Definition at line 108 of file sddl.h.

◆ SDDL_REVISION

#define SDDL_REVISION   SDDL_REVISION_1

Definition at line 31 of file sddl.h.

◆ SDDL_REVISION_1

#define SDDL_REVISION_1   1

Definition at line 30 of file sddl.h.

◆ SDDL_SACL

#define SDDL_SACL   TEXT("S")

Definition at line 39 of file sddl.h.

◆ SDDL_SCHEMA_ADMINISTRATORS

#define SDDL_SCHEMA_ADMINISTRATORS   TEXT("SA")

Definition at line 110 of file sddl.h.

◆ SDDL_SELF_WRITE

#define SDDL_SELF_WRITE   TEXT("SW")

Definition at line 56 of file sddl.h.

◆ SDDL_SEPERATOR

#define SDDL_SEPERATOR   TEXT(";")

Definition at line 134 of file sddl.h.

◆ SDDL_SEPERATORC

#define SDDL_SEPERATORC   TEXT(';')

Definition at line 126 of file sddl.h.

◆ SDDL_SERVER_OPERATORS

#define SDDL_SERVER_OPERATORS   TEXT("SO")

Definition at line 96 of file sddl.h.

◆ SDDL_SERVICE

#define SDDL_SERVICE   TEXT("SU")

Definition at line 107 of file sddl.h.

◆ SDDL_STANDARD_DELETE

#define SDDL_STANDARD_DELETE   TEXT("SD")

Definition at line 63 of file sddl.h.

◆ SDDL_WRITE_DAC

#define SDDL_WRITE_DAC   TEXT("WD")

Definition at line 61 of file sddl.h.

◆ SDDL_WRITE_OWNER

#define SDDL_WRITE_OWNER   TEXT("WO")

Definition at line 62 of file sddl.h.

◆ SDDL_WRITE_PROPERTY

#define SDDL_WRITE_PROPERTY   TEXT("WP")

Definition at line 52 of file sddl.h.

Function Documentation

◆ ConvertSecurityDescriptorToStringSecurityDescriptorA()

BOOL WINAPI ConvertSecurityDescriptorToStringSecurityDescriptorA ( PSECURITY_DESCRIPTOR  ,
DWORD  ,
SECURITY_INFORMATION  ,
LPSTR ,
PULONG   
)

Definition at line 3175 of file security.c.

3176 {
3177  LPWSTR wstr;
3178  ULONG len;
3180  {
3181  int lenA;
3182 
3183  lenA = WideCharToMultiByte(CP_ACP, 0, wstr, len, NULL, 0, NULL, NULL);
3184  *OutputString = heap_alloc(lenA);
3185 #ifdef __REACTOS__
3186  if (*OutputString == NULL)
3187  {
3188  LocalFree(wstr);
3189  *OutputLen = 0;
3190  return FALSE;
3191  }
3192 #endif
3193  WideCharToMultiByte(CP_ACP, 0, wstr, len, *OutputString, lenA, NULL, NULL);
3194  LocalFree(wstr);
3195 
3196  if (OutputLen != NULL)
3197  *OutputLen = lenA;
3198  return TRUE;
3199  }
3200  else
3201  {
3202  *OutputString = NULL;
3203  if (OutputLen)
3204  *OutputLen = 0;
3205  return FALSE;
3206  }
3207 }
#define TRUE
Definition: types.h:120
#define WideCharToMultiByte
Definition: compat.h:101
_In_ USHORT _In_ ULONG _In_ PSOCKADDR _In_ PSOCKADDR _Reserved_ ULONG _In_opt_ PVOID _In_opt_ const WSK_CLIENT_CONNECTION_DISPATCH _In_opt_ PEPROCESS _In_opt_ PETHREAD _In_opt_ PSECURITY_DESCRIPTOR SecurityDescriptor
Definition: wsk.h:182
#define CP_ACP
Definition: compat.h:99
BOOL WINAPI ConvertSecurityDescriptorToStringSecurityDescriptorW(PSECURITY_DESCRIPTOR SecurityDescriptor, DWORD SDRevision, SECURITY_INFORMATION RequestedInformation, LPWSTR *OutputString, PULONG OutputLen)
Definition: security.c:3111
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
smooth NULL
Definition: ftsmooth.c:416
GLenum GLsizei len
Definition: glext.h:6722
HLOCAL NTAPI LocalFree(HLOCAL hMem)
Definition: heapmem.c:1577
unsigned int ULONG
Definition: retypes.h:1
WCHAR * LPWSTR
Definition: xmlstorage.h:184
Iosb Information
Definition: create.c:4377

◆ ConvertSecurityDescriptorToStringSecurityDescriptorW()

BOOL WINAPI ConvertSecurityDescriptorToStringSecurityDescriptorW ( PSECURITY_DESCRIPTOR  ,
DWORD  ,
SECURITY_INFORMATION  ,
LPWSTR ,
PULONG   
)

Definition at line 3111 of file security.c.

3112 {
3113  ULONG len;
3114  WCHAR *wptr, *wstr;
3115 
3116  if (SDRevision != SDDL_REVISION_1)
3117  {
3118  ERR("Program requested unknown SDDL revision %d\n", SDRevision);
3120  return FALSE;
3121  }
3122 
3123  len = 0;
3124  if (RequestedInformation & OWNER_SECURITY_INFORMATION)
3126  return FALSE;
3127  if (RequestedInformation & GROUP_SECURITY_INFORMATION)
3129  return FALSE;
3130  if (RequestedInformation & DACL_SECURITY_INFORMATION)
3132  return FALSE;
3133  if (RequestedInformation & SACL_SECURITY_INFORMATION)
3135  return FALSE;
3136 
3137  wstr = wptr = LocalAlloc(0, (len + 1)*sizeof(WCHAR));
3138 #ifdef __REACTOS__
3139  if (wstr == NULL)
3140  return FALSE;
3141 #endif
3142 
3143  if (RequestedInformation & OWNER_SECURITY_INFORMATION)
3144  if (!DumpOwner(SecurityDescriptor, &wptr, NULL)) {
3145  LocalFree (wstr);
3146  return FALSE;
3147  }
3148  if (RequestedInformation & GROUP_SECURITY_INFORMATION)
3149  if (!DumpGroup(SecurityDescriptor, &wptr, NULL)) {
3150  LocalFree (wstr);
3151  return FALSE;
3152  }
3153  if (RequestedInformation & DACL_SECURITY_INFORMATION)
3154  if (!DumpDacl(SecurityDescriptor, &wptr, NULL)) {
3155  LocalFree (wstr);
3156  return FALSE;
3157  }
3158  if (RequestedInformation & SACL_SECURITY_INFORMATION)
3159  if (!DumpSacl(SecurityDescriptor, &wptr, NULL)) {
3160  LocalFree (wstr);
3161  return FALSE;
3162  }
3163  *wptr = 0;
3164 
3165  TRACE("ret: %s, %d\n", wine_dbgstr_w(wstr), len);
3166  *OutputString = wstr;
3167  if (OutputLen)
3168  *OutputLen = strlenW(*OutputString)+1;
3169  return TRUE;
3170 }
#define TRUE
Definition: types.h:120
WINE_UNICODE_INLINE unsigned int strlenW(const WCHAR *str)
Definition: unicode.h:212
static BOOL DumpOwner(PSECURITY_DESCRIPTOR SecurityDescriptor, WCHAR **pwptr, ULONG *plen)
Definition: security.c:3026
_In_ USHORT _In_ ULONG _In_ PSOCKADDR _In_ PSOCKADDR _Reserved_ ULONG _In_opt_ PVOID _In_opt_ const WSK_CLIENT_CONNECTION_DISPATCH _In_opt_ PEPROCESS _In_opt_ PETHREAD _In_opt_ PSECURITY_DESCRIPTOR SecurityDescriptor
Definition: wsk.h:182
static BOOL DumpSacl(PSECURITY_DESCRIPTOR SecurityDescriptor, WCHAR **pwptr, ULONG *plen)
Definition: security.c:3085
#define GROUP_SECURITY_INFORMATION
Definition: setypes.h:124
char * wine_dbgstr_w(const wchar_t *wstr)
Definition: CString.cpp:62
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define SACL_SECURITY_INFORMATION
Definition: setypes.h:126
#define SetLastError(x)
Definition: compat.h:409
static BOOL DumpDacl(PSECURITY_DESCRIPTOR SecurityDescriptor, WCHAR **pwptr, ULONG *plen)
Definition: security.c:3062
GLenum GLsizei len
Definition: glext.h:6722
#define ERR(fmt,...)
Definition: debug.h:109
#define ERROR_UNKNOWN_REVISION
Definition: winerror.h:787
HLOCAL NTAPI LocalFree(HLOCAL hMem)
Definition: heapmem.c:1577
#define OWNER_SECURITY_INFORMATION
Definition: setypes.h:123
unsigned int ULONG
Definition: retypes.h:1
HLOCAL NTAPI LocalAlloc(UINT uFlags, SIZE_T dwBytes)
Definition: heapmem.c:1373
static BOOL DumpGroup(PSECURITY_DESCRIPTOR SecurityDescriptor, WCHAR **pwptr, ULONG *plen)
Definition: security.c:3044
#define DACL_SECURITY_INFORMATION
Definition: setypes.h:125
#define SDDL_REVISION_1
Definition: sddl.h:30

Referenced by ConvertSecurityDescriptorToStringSecurityDescriptorA().

◆ ConvertSidToStringSidA()

BOOL WINAPI ConvertSidToStringSidA ( PSID  ,
LPSTR  
)

Definition at line 3313 of file security.c.

3315 {
3316  LPWSTR StringSidW;
3317  int Len;
3318 
3319  if (!ConvertSidToStringSidW(Sid, &StringSidW))
3320  {
3321  return FALSE;
3322  }
3323 
3324  Len = WideCharToMultiByte(CP_ACP, 0, StringSidW, -1, NULL, 0, NULL, NULL);
3325  if (Len <= 0)
3326  {
3327  LocalFree(StringSidW);
3329  return FALSE;
3330  }
3331 
3332  *StringSid = LocalAlloc(LMEM_FIXED, Len);
3333  if (NULL == *StringSid)
3334  {
3335  LocalFree(StringSidW);
3337  return FALSE;
3338  }
3339 
3340  if (!WideCharToMultiByte(CP_ACP, 0, StringSidW, -1, *StringSid, Len, NULL, NULL))
3341  {
3342  LocalFree(StringSid);
3343  LocalFree(StringSidW);
3344  return FALSE;
3345  }
3346 
3347  LocalFree(StringSidW);
3348 
3349  return TRUE;
3350 }
#define TRUE
Definition: types.h:120
#define WideCharToMultiByte
Definition: compat.h:101
#define CP_ACP
Definition: compat.h:99
#define ERROR_NOT_ENOUGH_MEMORY
Definition: dderror.h:7
BOOL WINAPI ConvertSidToStringSidW(PSID Sid, LPWSTR *StringSid)
Definition: security.c:3259
smooth NULL
Definition: ftsmooth.c:416
_In_ ULONG _In_ ACCESS_MASK _In_ PSID Sid
Definition: rtlfuncs.h:1104
#define LMEM_FIXED
Definition: winbase.h:349
#define Len
Definition: deflate.h:82
#define SetLastError(x)
Definition: compat.h:409
HLOCAL NTAPI LocalFree(HLOCAL hMem)
Definition: heapmem.c:1577
HLOCAL NTAPI LocalAlloc(UINT uFlags, SIZE_T dwBytes)
Definition: heapmem.c:1373
WCHAR * LPWSTR
Definition: xmlstorage.h:184

Referenced by debugstr_sid(), init_functionpointers(), map_name_2_sid(), test_CreateWellKnownSid(), test_LookupAccountSid(), test_lsa(), test_sid(), test_sid_str(), test_token_attr(), and test_token_label().

◆ ConvertSidToStringSidW()

BOOL WINAPI ConvertSidToStringSidW ( PSID  ,
LPWSTR  
)

Definition at line 3259 of file security.c.

3261 {
3262  NTSTATUS Status;
3264  WCHAR FixedBuffer[64];
3265 
3266  if (!RtlValidSid(Sid))
3267  {
3269  return FALSE;
3270  }
3271 
3272  UnicodeString.Length = 0;
3273  UnicodeString.MaximumLength = sizeof(FixedBuffer);
3274  UnicodeString.Buffer = FixedBuffer;
3277  {
3279  }
3280 
3281  if (!NT_SUCCESS(Status))
3282  {
3284  return FALSE;
3285  }
3286 
3287  *StringSid = LocalAlloc(LMEM_FIXED, UnicodeString.Length + sizeof(WCHAR));
3288  if (NULL == *StringSid)
3289  {
3290  if (UnicodeString.Buffer != FixedBuffer)
3291  {
3293  }
3295  return FALSE;
3296  }
3297 
3298  MoveMemory(*StringSid, UnicodeString.Buffer, UnicodeString.Length);
3299  ZeroMemory((PCHAR) *StringSid + UnicodeString.Length, sizeof(WCHAR));
3300  if (UnicodeString.Buffer != FixedBuffer)
3301  {
3303  }
3304 
3305  return TRUE;
3306 }
signed char * PCHAR
Definition: retypes.h:7
#define TRUE
Definition: types.h:120
*BytesInUnicodeString PWCH UnicodeString
Definition: rtlfuncs.h:1980
#define ERROR_INVALID_SID
Definition: winerror.h:819
LONG NTSTATUS
Definition: precomp.h:26
#define ERROR_NOT_ENOUGH_MEMORY
Definition: dderror.h:7
#define ZeroMemory
Definition: winbase.h:1635
#define MoveMemory
Definition: winbase.h:1632
#define STATUS_BUFFER_TOO_SMALL
Definition: shellext.h:64
smooth NULL
Definition: ftsmooth.c:416
_In_ ULONG _In_ ACCESS_MASK _In_ PSID Sid
Definition: rtlfuncs.h:1104
NTSYSAPI BOOLEAN NTAPI RtlValidSid(IN PSID Sid)
Definition: sid.c:21
#define LMEM_FIXED
Definition: winbase.h:349
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
NTSYSAPI VOID NTAPI RtlFreeUnicodeString(PUNICODE_STRING UnicodeString)
#define SetLastError(x)
Definition: compat.h:409
NTSYSAPI NTSTATUS NTAPI RtlConvertSidToUnicodeString(OUT PUNICODE_STRING DestinationString, IN PVOID Sid, IN BOOLEAN AllocateDestinationString)
Status
Definition: gdiplustypes.h:24
NTSYSAPI ULONG WINAPI RtlNtStatusToDosError(NTSTATUS)
HLOCAL NTAPI LocalAlloc(UINT uFlags, SIZE_T dwBytes)
Definition: heapmem.c:1373

Referenced by _GetUserSidStringFromToken(), ConvertSidToStringSidA(), CreateUserProfileExW(), get_user_sid(), GetEventUserName(), GetPrincipalDisplayString(), LsapGetDomainInfo(), LsapLookupAccountDomainSids(), LsapLookupBuiltinDomainSids(), LsapLookupWellKnownSids(), MsiSourceListAddSourceW(), RecycleBin5_Constructor(), SampAddMemberToAlias(), SampRemoveMemberFromAlias(), SampRemoveMemberFromAllAliases(), SampSetupAddMemberToAlias(), set_user_sid_prop(), START_TEST(), UpdatePrincipalInfo(), WhoamiGroups(), WhoamiLogonId(), and WhoamiUser().

◆ ConvertStringSecurityDescriptorToSecurityDescriptorA()

BOOL WINAPI ConvertStringSecurityDescriptorToSecurityDescriptorA ( LPCSTR  ,
DWORD  ,
PSECURITY_DESCRIPTOR ,
PULONG   
)

Definition at line 2708 of file security.c.

2712 {
2713  UINT len;
2714  BOOL ret = FALSE;
2715  LPWSTR StringSecurityDescriptorW;
2716 
2717  len = MultiByteToWideChar(CP_ACP, 0, StringSecurityDescriptor, -1, NULL, 0);
2718  StringSecurityDescriptorW = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
2719 
2720  if (StringSecurityDescriptorW)
2721  {
2722  MultiByteToWideChar(CP_ACP, 0, StringSecurityDescriptor, -1, StringSecurityDescriptorW, len);
2723 
2724  ret = ConvertStringSecurityDescriptorToSecurityDescriptorW(StringSecurityDescriptorW,
2725  StringSDRevision, SecurityDescriptor,
2726  SecurityDescriptorSize);
2727  HeapFree(GetProcessHeap(), 0, StringSecurityDescriptorW);
2728  }
2729 
2730  return ret;
2731 }
_In_ USHORT _In_ ULONG _In_ PSOCKADDR _In_ PSOCKADDR _Reserved_ ULONG _In_opt_ PVOID _In_opt_ const WSK_CLIENT_CONNECTION_DISPATCH _In_opt_ PEPROCESS _In_opt_ PETHREAD _In_opt_ PSECURITY_DESCRIPTOR SecurityDescriptor
Definition: wsk.h:182
#define CP_ACP
Definition: compat.h:99
unsigned int BOOL
Definition: ntddk_ex.h:94
smooth NULL
Definition: ftsmooth.c:416
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
__wchar_t WCHAR
Definition: xmlstorage.h:180
int ret
GLenum GLsizei len
Definition: glext.h:6722
unsigned int UINT
Definition: ndis.h:50
#define MultiByteToWideChar
Definition: compat.h:100
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define HeapFree(x, y, z)
Definition: compat.h:394
BOOL WINAPI ConvertStringSecurityDescriptorToSecurityDescriptorW(LPCWSTR StringSecurityDescriptor, DWORD StringSDRevision, PSECURITY_DESCRIPTOR *SecurityDescriptor, PULONG SecurityDescriptorSize)
Definition: security.c:2738

Referenced by test_profile_directory_readonly().

◆ ConvertStringSecurityDescriptorToSecurityDescriptorW()

BOOL WINAPI ConvertStringSecurityDescriptorToSecurityDescriptorW ( LPCWSTR  ,
DWORD  ,
PSECURITY_DESCRIPTOR ,
PULONG   
)

Definition at line 2738 of file security.c.

2742 {
2743  DWORD cBytes;
2744  SECURITY_DESCRIPTOR* psd;
2745  BOOL bret = FALSE;
2746 
2747  TRACE("%s\n", debugstr_w(StringSecurityDescriptor));
2748 
2749  if (GetVersion() & 0x80000000)
2750  {
2752  goto lend;
2753  }
2754  else if (!StringSecurityDescriptor || !SecurityDescriptor)
2755  {
2757  goto lend;
2758  }
2759  else if (StringSDRevision != SID_REVISION)
2760  {
2762  goto lend;
2763  }
2764 
2765  /* Compute security descriptor length */
2766  if (!ParseStringSecurityDescriptorToSecurityDescriptor(StringSecurityDescriptor,
2767  NULL, &cBytes))
2768  goto lend;
2769 
2770  psd = *SecurityDescriptor = LocalAlloc(GMEM_ZEROINIT, cBytes);
2771  if (!psd) goto lend;
2772 
2773  psd->Revision = SID_REVISION;
2774  psd->Control |= SE_SELF_RELATIVE;
2775 
2776  if (!ParseStringSecurityDescriptorToSecurityDescriptor(StringSecurityDescriptor,
2777  (SECURITY_DESCRIPTOR_RELATIVE *)psd, &cBytes))
2778  {
2779  LocalFree(psd);
2780  goto lend;
2781  }
2782 
2783  if (SecurityDescriptorSize)
2784  *SecurityDescriptorSize = cBytes;
2785 
2786  bret = TRUE;
2787 
2788 lend:
2789  TRACE(" ret=%d\n", bret);
2790  return bret;
2791 }
#define ERROR_INVALID_PARAMETER
Definition: compat.h:91
static BOOL ParseStringSecurityDescriptorToSecurityDescriptor(LPCWSTR StringSecurityDescriptor, SECURITY_DESCRIPTOR_RELATIVE *SecurityDescriptor, LPDWORD cBytes)
Definition: security.c:2560
#define TRUE
Definition: types.h:120
#define SE_SELF_RELATIVE
Definition: setypes.h:780
_In_ USHORT _In_ ULONG _In_ PSOCKADDR _In_ PSOCKADDR _Reserved_ ULONG _In_opt_ PVOID _In_opt_ const WSK_CLIENT_CONNECTION_DISPATCH _In_opt_ PEPROCESS _In_opt_ PETHREAD _In_opt_ PSECURITY_DESCRIPTOR SecurityDescriptor
Definition: wsk.h:182
#define SID_REVISION
Definition: setypes.h:453
DWORD WINAPI GetVersion(VOID)
Definition: version.c:22
unsigned int BOOL
Definition: ntddk_ex.h:94
#define debugstr_w
Definition: kernel32.h:32
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
unsigned long DWORD
Definition: ntddk_ex.h:95
#define SetLastError(x)
Definition: compat.h:409
#define ERROR_UNKNOWN_REVISION
Definition: winerror.h:787
HLOCAL NTAPI LocalFree(HLOCAL hMem)
Definition: heapmem.c:1577
#define ERROR_CALL_NOT_IMPLEMENTED
Definition: compat.h:92
HLOCAL NTAPI LocalAlloc(UINT uFlags, SIZE_T dwBytes)
Definition: heapmem.c:1373
#define GMEM_ZEROINIT
Definition: winbase.h:303

Referenced by ConvertStringSecurityDescriptorToSecurityDescriptorA(), InstallOneService(), registry_callback(), and SetupQueueCopyIndirectW().

◆ ConvertStringSidToSidA()

BOOL WINAPI ConvertStringSidToSidA ( LPCSTR  ,
PSID  
)

Definition at line 3236 of file security.c.

3237 {
3238  BOOL bret = FALSE;
3239 
3240  TRACE("%s, %p\n", debugstr_a(StringSid), Sid);
3241  if (GetVersion() & 0x80000000)
3243  else if (!StringSid || !Sid)
3245  else
3246  {
3247  WCHAR *wStringSid = SERV_dup(StringSid);
3248  bret = ConvertStringSidToSidW(wStringSid, Sid);
3249  heap_free(wStringSid);
3250  }
3251  return bret;
3252 }
#define ERROR_INVALID_PARAMETER
Definition: compat.h:91
BOOL WINAPI ConvertStringSidToSidW(LPCWSTR StringSid, PSID *Sid)
Definition: security.c:3212
DWORD WINAPI GetVersion(VOID)
Definition: version.c:22
unsigned int BOOL
Definition: ntddk_ex.h:94
_In_ ULONG _In_ ACCESS_MASK _In_ PSID Sid
Definition: rtlfuncs.h:1104
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define debugstr_a
Definition: kernel32.h:31
#define SetLastError(x)
Definition: compat.h:409
static LPWSTR SERV_dup(LPCSTR str)
Definition: security.c:235
#define ERROR_CALL_NOT_IMPLEMENTED
Definition: compat.h:92
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

Referenced by test_LsaLookupSids().

◆ ConvertStringSidToSidW()

BOOL WINAPI ConvertStringSidToSidW ( LPCWSTR  ,
PSID  
)

Definition at line 3212 of file security.c.

3213 {
3214  BOOL bret = FALSE;
3215  DWORD cBytes;
3216 
3217  TRACE("%s, %p\n", debugstr_w(StringSid), Sid);
3218  if (GetVersion() & 0x80000000)
3220  else if (!StringSid || !Sid)
3222  else if (ParseStringSidToSid(StringSid, NULL, &cBytes))
3223  {
3224  PSID pSid = *Sid = LocalAlloc(0, cBytes);
3225 
3226  bret = ParseStringSidToSid(StringSid, pSid, &cBytes);
3227  if (!bret)
3228  LocalFree(*Sid);
3229  }
3230  return bret;
3231 }
#define ERROR_INVALID_PARAMETER
Definition: compat.h:91
DWORD WINAPI GetVersion(VOID)
Definition: version.c:22
unsigned int BOOL
Definition: ntddk_ex.h:94
#define debugstr_w
Definition: kernel32.h:32
smooth NULL
Definition: ftsmooth.c:416
_In_ ULONG _In_ ACCESS_MASK _In_ PSID Sid
Definition: rtlfuncs.h:1104
#define TRACE(s)
Definition: solgame.cpp:4
unsigned long DWORD
Definition: ntddk_ex.h:95
#define SetLastError(x)
Definition: compat.h:409
HLOCAL NTAPI LocalFree(HLOCAL hMem)
Definition: heapmem.c:1577
static PSID pSid
Definition: security.c:74
#define ERROR_CALL_NOT_IMPLEMENTED
Definition: compat.h:92
static BOOL ParseStringSidToSid(LPCWSTR StringSid, PSID pSid, LPDWORD cBytes)
Definition: security.c:3508
HLOCAL NTAPI LocalAlloc(UINT uFlags, SIZE_T dwBytes)
Definition: heapmem.c:1373

Referenced by ConvertStringSidToSidA(), and fill_sid().