ReactOS 0.4.16-dev-226-g79f2289
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  SecurityDescriptor,
DWORD  SDRevision,
SECURITY_INFORMATION  Information,
LPSTR OutputString,
PULONG  OutputLen 
)

Definition at line 3499 of file security.c.

3500{
3501 LPWSTR wstr;
3502 ULONG len;
3504 {
3505 int lenA;
3506
3507 lenA = WideCharToMultiByte(CP_ACP, 0, wstr, len, NULL, 0, NULL, NULL);
3508 *OutputString = heap_alloc(lenA);
3509#ifdef __REACTOS__
3510 if (*OutputString == NULL)
3511 {
3512 LocalFree(wstr);
3513 *OutputLen = 0;
3514 return FALSE;
3515 }
3516#endif
3517 WideCharToMultiByte(CP_ACP, 0, wstr, len, *OutputString, lenA, NULL, NULL);
3518 LocalFree(wstr);
3519
3520 if (OutputLen != NULL)
3521 *OutputLen = lenA;
3522 return TRUE;
3523 }
3524 else
3525 {
3526 *OutputString = NULL;
3527 if (OutputLen)
3528 *OutputLen = 0;
3529 return FALSE;
3530 }
3531}
static void * heap_alloc(size_t len)
Definition: appwiz.h:66
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
BOOL WINAPI ConvertSecurityDescriptorToStringSecurityDescriptorW(PSECURITY_DESCRIPTOR SecurityDescriptor, DWORD SDRevision, SECURITY_INFORMATION RequestedInformation, LPWSTR *OutputString, PULONG OutputLen)
Definition: security.c:3435
#define CP_ACP
Definition: compat.h:109
#define WideCharToMultiByte
Definition: compat.h:111
GLenum GLsizei len
Definition: glext.h:6722
HLOCAL NTAPI LocalFree(HLOCAL hMem)
Definition: heapmem.c:1594
uint32_t ULONG
Definition: typedefs.h:59
_In_ WDFREQUEST _In_ NTSTATUS _In_ ULONG_PTR Information
Definition: wdfrequest.h:1049
_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:191
WCHAR * LPWSTR
Definition: xmlstorage.h:184

◆ ConvertSecurityDescriptorToStringSecurityDescriptorW()

BOOL WINAPI ConvertSecurityDescriptorToStringSecurityDescriptorW ( PSECURITY_DESCRIPTOR  SecurityDescriptor,
DWORD  SDRevision,
SECURITY_INFORMATION  RequestedInformation,
LPWSTR OutputString,
PULONG  OutputLen 
)

Definition at line 3435 of file security.c.

3436{
3437 ULONG len;
3438 WCHAR *wptr, *wstr;
3439
3440 if (SDRevision != SDDL_REVISION_1)
3441 {
3442 ERR("Program requested unknown SDDL revision %d\n", SDRevision);
3444 return FALSE;
3445 }
3446
3447 len = 0;
3448 if (RequestedInformation & OWNER_SECURITY_INFORMATION)
3450 return FALSE;
3451 if (RequestedInformation & GROUP_SECURITY_INFORMATION)
3453 return FALSE;
3454 if (RequestedInformation & DACL_SECURITY_INFORMATION)
3456 return FALSE;
3457 if (RequestedInformation & SACL_SECURITY_INFORMATION)
3459 return FALSE;
3460
3461 wstr = wptr = LocalAlloc(0, (len + 1)*sizeof(WCHAR));
3462#ifdef __REACTOS__
3463 if (wstr == NULL)
3464 return FALSE;
3465#endif
3466
3467 if (RequestedInformation & OWNER_SECURITY_INFORMATION)
3468 if (!DumpOwner(SecurityDescriptor, &wptr, NULL)) {
3469 LocalFree (wstr);
3470 return FALSE;
3471 }
3472 if (RequestedInformation & GROUP_SECURITY_INFORMATION)
3473 if (!DumpGroup(SecurityDescriptor, &wptr, NULL)) {
3474 LocalFree (wstr);
3475 return FALSE;
3476 }
3477 if (RequestedInformation & DACL_SECURITY_INFORMATION)
3478 if (!DumpDacl(SecurityDescriptor, &wptr, NULL)) {
3479 LocalFree (wstr);
3480 return FALSE;
3481 }
3482 if (RequestedInformation & SACL_SECURITY_INFORMATION)
3483 if (!DumpSacl(SecurityDescriptor, &wptr, NULL)) {
3484 LocalFree (wstr);
3485 return FALSE;
3486 }
3487 *wptr = 0;
3488
3489 TRACE("ret: %s, %d\n", wine_dbgstr_w(wstr), len);
3490 *OutputString = wstr;
3491 if (OutputLen)
3492 *OutputLen = strlenW(*OutputString)+1;
3493 return TRUE;
3494}
#define ERR(fmt,...)
Definition: precomp.h:57
static BOOL DumpSacl(PSECURITY_DESCRIPTOR SecurityDescriptor, WCHAR **pwptr, ULONG *plen)
Definition: security.c:3409
static BOOL DumpGroup(PSECURITY_DESCRIPTOR SecurityDescriptor, WCHAR **pwptr, ULONG *plen)
Definition: security.c:3368
static BOOL DumpOwner(PSECURITY_DESCRIPTOR SecurityDescriptor, WCHAR **pwptr, ULONG *plen)
Definition: security.c:3350
static BOOL DumpDacl(PSECURITY_DESCRIPTOR SecurityDescriptor, WCHAR **pwptr, ULONG *plen)
Definition: security.c:3386
#define SetLastError(x)
Definition: compat.h:752
HLOCAL NTAPI LocalAlloc(UINT uFlags, SIZE_T dwBytes)
Definition: heapmem.c:1390
#define wine_dbgstr_w
Definition: kernel32.h:34
#define strlenW(s)
Definition: unicode.h:34
#define SDDL_REVISION_1
Definition: sddl.h:30
#define TRACE(s)
Definition: solgame.cpp:4
#define ERROR_UNKNOWN_REVISION
Definition: winerror.h:787
#define DACL_SECURITY_INFORMATION
Definition: setypes.h:125
#define OWNER_SECURITY_INFORMATION
Definition: setypes.h:123
#define GROUP_SECURITY_INFORMATION
Definition: setypes.h:124
#define SACL_SECURITY_INFORMATION
Definition: setypes.h:126
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by ConvertSecurityDescriptorToStringSecurityDescriptorA().

◆ ConvertSidToStringSidA()

BOOL WINAPI ConvertSidToStringSidA ( PSID  Sid,
LPSTR StringSid 
)

Definition at line 3637 of file security.c.

3639{
3640 LPWSTR StringSidW;
3641 int Len;
3642
3643 if (!ConvertSidToStringSidW(Sid, &StringSidW))
3644 {
3645 return FALSE;
3646 }
3647
3648 Len = WideCharToMultiByte(CP_ACP, 0, StringSidW, -1, NULL, 0, NULL, NULL);
3649 if (Len <= 0)
3650 {
3651 LocalFree(StringSidW);
3653 return FALSE;
3654 }
3655
3656 *StringSid = LocalAlloc(LMEM_FIXED, Len);
3657 if (NULL == *StringSid)
3658 {
3659 LocalFree(StringSidW);
3661 return FALSE;
3662 }
3663
3664 if (!WideCharToMultiByte(CP_ACP, 0, StringSidW, -1, *StringSid, Len, NULL, NULL))
3665 {
3666 LocalFree(StringSid);
3667 LocalFree(StringSidW);
3668 return FALSE;
3669 }
3670
3671 LocalFree(StringSidW);
3672
3673 return TRUE;
3674}
#define ERROR_NOT_ENOUGH_MEMORY
Definition: dderror.h:7
#define Len
Definition: deflate.h:82
BOOL WINAPI ConvertSidToStringSidW(PSID Sid, LPWSTR *StringSid)
Definition: security.c:3583
_In_ ULONG _In_ ACCESS_MASK _In_ PSID Sid
Definition: rtlfuncs.h:1145
#define LMEM_FIXED
Definition: winbase.h:393

Referenced by debugstr_sid(), get_user_sid(), 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  Sid,
LPWSTR StringSid 
)

Definition at line 3583 of file security.c.

3585{
3588 WCHAR FixedBuffer[64];
3589
3590 if (!RtlValidSid(Sid))
3591 {
3593 return FALSE;
3594 }
3595
3596 UnicodeString.Length = 0;
3597 UnicodeString.MaximumLength = sizeof(FixedBuffer);
3598 UnicodeString.Buffer = FixedBuffer;
3601 {
3603 }
3604
3605 if (!NT_SUCCESS(Status))
3606 {
3608 return FALSE;
3609 }
3610
3611 *StringSid = LocalAlloc(LMEM_FIXED, UnicodeString.Length + sizeof(WCHAR));
3612 if (NULL == *StringSid)
3613 {
3614 if (UnicodeString.Buffer != FixedBuffer)
3615 {
3617 }
3619 return FALSE;
3620 }
3621
3622 MoveMemory(*StringSid, UnicodeString.Buffer, UnicodeString.Length);
3623 ZeroMemory((PCHAR) *StringSid + UnicodeString.Length, sizeof(WCHAR));
3624 if (UnicodeString.Buffer != FixedBuffer)
3625 {
3627 }
3628
3629 return TRUE;
3630}
LONG NTSTATUS
Definition: precomp.h:26
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:33
Status
Definition: gdiplustypes.h:25
NTSYSAPI ULONG WINAPI RtlNtStatusToDosError(NTSTATUS)
NTSYSAPI BOOLEAN NTAPI RtlValidSid(IN PSID Sid)
Definition: sid.c:21
NTSYSAPI VOID NTAPI RtlFreeUnicodeString(PUNICODE_STRING UnicodeString)
NTSYSAPI NTSTATUS NTAPI RtlConvertSidToUnicodeString(OUT PUNICODE_STRING DestinationString, IN PVOID Sid, IN BOOLEAN AllocateDestinationString)
#define STATUS_BUFFER_TOO_SMALL
Definition: shellext.h:69
char * PCHAR
Definition: typedefs.h:51
#define ZeroMemory
Definition: winbase.h:1736
#define MoveMemory
Definition: winbase.h:1733
#define ERROR_INVALID_SID
Definition: winerror.h:819

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

◆ ConvertStringSecurityDescriptorToSecurityDescriptorA()

BOOL WINAPI ConvertStringSecurityDescriptorToSecurityDescriptorA ( LPCSTR  StringSecurityDescriptor,
DWORD  StringSDRevision,
PSECURITY_DESCRIPTOR SecurityDescriptor,
PULONG  SecurityDescriptorSize 
)

Definition at line 3032 of file security.c.

3036{
3037 UINT len;
3038 BOOL ret = FALSE;
3039 LPWSTR StringSecurityDescriptorW;
3040
3041 len = MultiByteToWideChar(CP_ACP, 0, StringSecurityDescriptor, -1, NULL, 0);
3042 StringSecurityDescriptorW = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
3043
3044 if (StringSecurityDescriptorW)
3045 {
3046 MultiByteToWideChar(CP_ACP, 0, StringSecurityDescriptor, -1, StringSecurityDescriptorW, len);
3047
3049 StringSDRevision, SecurityDescriptor,
3050 SecurityDescriptorSize);
3051 HeapFree(GetProcessHeap(), 0, StringSecurityDescriptorW);
3052 }
3053
3054 return ret;
3055}
BOOL WINAPI ConvertStringSecurityDescriptorToSecurityDescriptorW(LPCWSTR StringSecurityDescriptor, DWORD StringSDRevision, PSECURITY_DESCRIPTOR *SecurityDescriptor, PULONG SecurityDescriptorSize)
Definition: security.c:3062
#define GetProcessHeap()
Definition: compat.h:736
#define HeapAlloc
Definition: compat.h:733
#define HeapFree(x, y, z)
Definition: compat.h:735
#define MultiByteToWideChar
Definition: compat.h:110
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned int UINT
Definition: ndis.h:50
int ret

Referenced by test_profile_directory_readonly().

◆ ConvertStringSecurityDescriptorToSecurityDescriptorW()

BOOL WINAPI ConvertStringSecurityDescriptorToSecurityDescriptorW ( LPCWSTR  StringSecurityDescriptor,
DWORD  StringSDRevision,
PSECURITY_DESCRIPTOR SecurityDescriptor,
PULONG  SecurityDescriptorSize 
)

Definition at line 3062 of file security.c.

3066{
3067 DWORD cBytes;
3069 BOOL bret = FALSE;
3070
3071 TRACE("%s\n", debugstr_w(StringSecurityDescriptor));
3072
3073 if (GetVersion() & 0x80000000)
3074 {
3076 goto lend;
3077 }
3078 else if (!StringSecurityDescriptor || !SecurityDescriptor)
3079 {
3081 goto lend;
3082 }
3083 else if (StringSDRevision != SID_REVISION)
3084 {
3086 goto lend;
3087 }
3088
3089 /* Compute security descriptor length */
3090 if (!ParseStringSecurityDescriptorToSecurityDescriptor(StringSecurityDescriptor,
3091 NULL, &cBytes))
3092 goto lend;
3093
3095 if (!psd) goto lend;
3096
3097 psd->Revision = SID_REVISION;
3098 psd->Control |= SE_SELF_RELATIVE;
3099
3100 if (!ParseStringSecurityDescriptorToSecurityDescriptor(StringSecurityDescriptor,
3101 (SECURITY_DESCRIPTOR_RELATIVE *)psd, &cBytes))
3102 {
3103 LocalFree(psd);
3104 goto lend;
3105 }
3106
3107 if (SecurityDescriptorSize)
3108 *SecurityDescriptorSize = cBytes;
3109
3110 bret = TRUE;
3111
3112lend:
3113 TRACE(" ret=%d\n", bret);
3114 return bret;
3115}
static BOOL ParseStringSecurityDescriptorToSecurityDescriptor(LPCWSTR StringSecurityDescriptor, SECURITY_DESCRIPTOR_RELATIVE *SecurityDescriptor, LPDWORD cBytes)
Definition: security.c:2884
#define ERROR_CALL_NOT_IMPLEMENTED
Definition: compat.h:102
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
unsigned long DWORD
Definition: ntddk_ex.h:95
#define debugstr_w
Definition: kernel32.h:32
DWORD WINAPI GetVersion()
Definition: redirtest.c:5
#define GMEM_ZEROINIT
Definition: winbase.h:331
#define SE_SELF_RELATIVE
Definition: setypes.h:834
#define SID_REVISION
Definition: setypes.h:481

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

◆ ConvertStringSidToSidA()

BOOL WINAPI ConvertStringSidToSidA ( LPCSTR  StringSid,
PSID Sid 
)

Definition at line 3560 of file security.c.

3561{
3562 BOOL bret = FALSE;
3563
3564 TRACE("%s, %p\n", debugstr_a(StringSid), Sid);
3565 if (GetVersion() & 0x80000000)
3567 else if (!StringSid || !Sid)
3569 else
3570 {
3571 WCHAR *wStringSid = SERV_dup(StringSid);
3572 bret = ConvertStringSidToSidW(wStringSid, Sid);
3573 heap_free(wStringSid);
3574 }
3575 return bret;
3576}
static BOOL heap_free(void *mem)
Definition: appwiz.h:76
BOOL WINAPI ConvertStringSidToSidW(LPCWSTR StringSid, PSID *Sid)
Definition: security.c:3536
static LPWSTR SERV_dup(LPCSTR str)
Definition: security.c:233
#define debugstr_a
Definition: kernel32.h:31

Referenced by test_LsaLookupSids().

◆ ConvertStringSidToSidW()

BOOL WINAPI ConvertStringSidToSidW ( LPCWSTR  StringSid,
PSID Sid 
)

Definition at line 3536 of file security.c.

3537{
3538 BOOL bret = FALSE;
3539 DWORD cBytes;
3540
3541 TRACE("%s, %p\n", debugstr_w(StringSid), Sid);
3542 if (GetVersion() & 0x80000000)
3544 else if (!StringSid || !Sid)
3546 else if (ParseStringSidToSid(StringSid, NULL, &cBytes))
3547 {
3548 PSID pSid = *Sid = LocalAlloc(0, cBytes);
3549
3550 bret = ParseStringSidToSid(StringSid, pSid, &cBytes);
3551 if (!bret)
3552 LocalFree(*Sid);
3553 }
3554 return bret;
3555}
static BOOL ParseStringSidToSid(LPCWSTR StringSid, PSID pSid, LPDWORD cBytes)
Definition: security.c:3973
static PSID pSid
Definition: security.c:74

Referenced by ConvertStringSidToSidA(), and fill_sid().