ReactOS 0.4.15-dev-6669-g8227c5d
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 3501 of file security.c.

3502{
3503 LPWSTR wstr;
3504 ULONG len;
3506 {
3507 int lenA;
3508
3509 lenA = WideCharToMultiByte(CP_ACP, 0, wstr, len, NULL, 0, NULL, NULL);
3510 *OutputString = heap_alloc(lenA);
3511#ifdef __REACTOS__
3512 if (*OutputString == NULL)
3513 {
3514 LocalFree(wstr);
3515 *OutputLen = 0;
3516 return FALSE;
3517 }
3518#endif
3519 WideCharToMultiByte(CP_ACP, 0, wstr, len, *OutputString, lenA, NULL, NULL);
3520 LocalFree(wstr);
3521
3522 if (OutputLen != NULL)
3523 *OutputLen = lenA;
3524 return TRUE;
3525 }
3526 else
3527 {
3528 *OutputString = NULL;
3529 if (OutputLen)
3530 *OutputLen = 0;
3531 return FALSE;
3532 }
3533}
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:3437
#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 3437 of file security.c.

3438{
3439 ULONG len;
3440 WCHAR *wptr, *wstr;
3441
3442 if (SDRevision != SDDL_REVISION_1)
3443 {
3444 ERR("Program requested unknown SDDL revision %d\n", SDRevision);
3446 return FALSE;
3447 }
3448
3449 len = 0;
3450 if (RequestedInformation & OWNER_SECURITY_INFORMATION)
3452 return FALSE;
3453 if (RequestedInformation & GROUP_SECURITY_INFORMATION)
3455 return FALSE;
3456 if (RequestedInformation & DACL_SECURITY_INFORMATION)
3458 return FALSE;
3459 if (RequestedInformation & SACL_SECURITY_INFORMATION)
3461 return FALSE;
3462
3463 wstr = wptr = LocalAlloc(0, (len + 1)*sizeof(WCHAR));
3464#ifdef __REACTOS__
3465 if (wstr == NULL)
3466 return FALSE;
3467#endif
3468
3469 if (RequestedInformation & OWNER_SECURITY_INFORMATION)
3470 if (!DumpOwner(SecurityDescriptor, &wptr, NULL)) {
3471 LocalFree (wstr);
3472 return FALSE;
3473 }
3474 if (RequestedInformation & GROUP_SECURITY_INFORMATION)
3475 if (!DumpGroup(SecurityDescriptor, &wptr, NULL)) {
3476 LocalFree (wstr);
3477 return FALSE;
3478 }
3479 if (RequestedInformation & DACL_SECURITY_INFORMATION)
3480 if (!DumpDacl(SecurityDescriptor, &wptr, NULL)) {
3481 LocalFree (wstr);
3482 return FALSE;
3483 }
3484 if (RequestedInformation & SACL_SECURITY_INFORMATION)
3485 if (!DumpSacl(SecurityDescriptor, &wptr, NULL)) {
3486 LocalFree (wstr);
3487 return FALSE;
3488 }
3489 *wptr = 0;
3490
3491 TRACE("ret: %s, %d\n", wine_dbgstr_w(wstr), len);
3492 *OutputString = wstr;
3493 if (OutputLen)
3494 *OutputLen = strlenW(*OutputString)+1;
3495 return TRUE;
3496}
#define ERR(fmt,...)
Definition: debug.h:110
static BOOL DumpSacl(PSECURITY_DESCRIPTOR SecurityDescriptor, WCHAR **pwptr, ULONG *plen)
Definition: security.c:3411
static BOOL DumpGroup(PSECURITY_DESCRIPTOR SecurityDescriptor, WCHAR **pwptr, ULONG *plen)
Definition: security.c:3370
static BOOL DumpOwner(PSECURITY_DESCRIPTOR SecurityDescriptor, WCHAR **pwptr, ULONG *plen)
Definition: security.c:3352
static BOOL DumpDacl(PSECURITY_DESCRIPTOR SecurityDescriptor, WCHAR **pwptr, ULONG *plen)
Definition: security.c:3388
#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:28
#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 3639 of file security.c.

3641{
3642 LPWSTR StringSidW;
3643 int Len;
3644
3645 if (!ConvertSidToStringSidW(Sid, &StringSidW))
3646 {
3647 return FALSE;
3648 }
3649
3650 Len = WideCharToMultiByte(CP_ACP, 0, StringSidW, -1, NULL, 0, NULL, NULL);
3651 if (Len <= 0)
3652 {
3653 LocalFree(StringSidW);
3655 return FALSE;
3656 }
3657
3658 *StringSid = LocalAlloc(LMEM_FIXED, Len);
3659 if (NULL == *StringSid)
3660 {
3661 LocalFree(StringSidW);
3663 return FALSE;
3664 }
3665
3666 if (!WideCharToMultiByte(CP_ACP, 0, StringSidW, -1, *StringSid, Len, NULL, NULL))
3667 {
3668 LocalFree(StringSid);
3669 LocalFree(StringSidW);
3670 return FALSE;
3671 }
3672
3673 LocalFree(StringSidW);
3674
3675 return TRUE;
3676}
#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:3585
_In_ ULONG _In_ ACCESS_MASK _In_ PSID Sid
Definition: rtlfuncs.h:1133
#define LMEM_FIXED
Definition: winbase.h:368

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 3585 of file security.c.

3587{
3590 WCHAR FixedBuffer[64];
3591
3592 if (!RtlValidSid(Sid))
3593 {
3595 return FALSE;
3596 }
3597
3598 UnicodeString.Length = 0;
3599 UnicodeString.MaximumLength = sizeof(FixedBuffer);
3600 UnicodeString.Buffer = FixedBuffer;
3603 {
3605 }
3606
3607 if (!NT_SUCCESS(Status))
3608 {
3610 return FALSE;
3611 }
3612
3613 *StringSid = LocalAlloc(LMEM_FIXED, UnicodeString.Length + sizeof(WCHAR));
3614 if (NULL == *StringSid)
3615 {
3616 if (UnicodeString.Buffer != FixedBuffer)
3617 {
3619 }
3621 return FALSE;
3622 }
3623
3624 MoveMemory(*StringSid, UnicodeString.Buffer, UnicodeString.Length);
3625 ZeroMemory((PCHAR) *StringSid + UnicodeString.Length, sizeof(WCHAR));
3626 if (UnicodeString.Buffer != FixedBuffer)
3627 {
3629 }
3630
3631 return TRUE;
3632}
LONG NTSTATUS
Definition: precomp.h:26
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
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:1700
#define MoveMemory
Definition: winbase.h:1697
#define ERROR_INVALID_SID
Definition: winerror.h:819

Referenced by _GetUserSidStringFromToken(), AddUserProfiles(), 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  StringSecurityDescriptor,
DWORD  StringSDRevision,
PSECURITY_DESCRIPTOR SecurityDescriptor,
PULONG  SecurityDescriptorSize 
)

Definition at line 3034 of file security.c.

3038{
3039 UINT len;
3040 BOOL ret = FALSE;
3041 LPWSTR StringSecurityDescriptorW;
3042
3043 len = MultiByteToWideChar(CP_ACP, 0, StringSecurityDescriptor, -1, NULL, 0);
3044 StringSecurityDescriptorW = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
3045
3046 if (StringSecurityDescriptorW)
3047 {
3048 MultiByteToWideChar(CP_ACP, 0, StringSecurityDescriptor, -1, StringSecurityDescriptorW, len);
3049
3051 StringSDRevision, SecurityDescriptor,
3052 SecurityDescriptorSize);
3053 HeapFree(GetProcessHeap(), 0, StringSecurityDescriptorW);
3054 }
3055
3056 return ret;
3057}
BOOL WINAPI ConvertStringSecurityDescriptorToSecurityDescriptorW(LPCWSTR StringSecurityDescriptor, DWORD StringSDRevision, PSECURITY_DESCRIPTOR *SecurityDescriptor, PULONG SecurityDescriptorSize)
Definition: security.c:3064
#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 3064 of file security.c.

3068{
3069 DWORD cBytes;
3071 BOOL bret = FALSE;
3072
3073 TRACE("%s\n", debugstr_w(StringSecurityDescriptor));
3074
3075 if (GetVersion() & 0x80000000)
3076 {
3078 goto lend;
3079 }
3080 else if (!StringSecurityDescriptor || !SecurityDescriptor)
3081 {
3083 goto lend;
3084 }
3085 else if (StringSDRevision != SID_REVISION)
3086 {
3088 goto lend;
3089 }
3090
3091 /* Compute security descriptor length */
3092 if (!ParseStringSecurityDescriptorToSecurityDescriptor(StringSecurityDescriptor,
3093 NULL, &cBytes))
3094 goto lend;
3095
3097 if (!psd) goto lend;
3098
3099 psd->Revision = SID_REVISION;
3100 psd->Control |= SE_SELF_RELATIVE;
3101
3102 if (!ParseStringSecurityDescriptorToSecurityDescriptor(StringSecurityDescriptor,
3103 (SECURITY_DESCRIPTOR_RELATIVE *)psd, &cBytes))
3104 {
3105 LocalFree(psd);
3106 goto lend;
3107 }
3108
3109 if (SecurityDescriptorSize)
3110 *SecurityDescriptorSize = cBytes;
3111
3112 bret = TRUE;
3113
3114lend:
3115 TRACE(" ret=%d\n", bret);
3116 return bret;
3117}
static BOOL ParseStringSecurityDescriptorToSecurityDescriptor(LPCWSTR StringSecurityDescriptor, SECURITY_DESCRIPTOR_RELATIVE *SecurityDescriptor, LPDWORD cBytes)
Definition: security.c:2886
#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:306
#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 3562 of file security.c.

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

Referenced by test_LsaLookupSids().

◆ ConvertStringSidToSidW()

BOOL WINAPI ConvertStringSidToSidW ( LPCWSTR  StringSid,
PSID Sid 
)

Definition at line 3538 of file security.c.

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

Referenced by ConvertStringSidToSidA(), and fill_sid().