⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sddl.pas

📁 详细Windows API大全有关知识以及相关问题
💻 PAS
📖 第 1 页 / 共 2 页
字号:
  {$EXTERNALSYM SDDL_DOMAIN_GUESTS}
  SDDL_DOMAIN_USERS                  = 'DU'; // Domain users
  {$EXTERNALSYM SDDL_DOMAIN_USERS}
  SDDL_ENTERPRISE_DOMAIN_CONTROLLERS = 'ED'; // Enterprise domain controllers
  {$EXTERNALSYM SDDL_ENTERPRISE_DOMAIN_CONTROLLERS}
  SDDL_DOMAIN_DOMAIN_CONTROLLERS     = 'DD'; // Domain domain controllers
  {$EXTERNALSYM SDDL_DOMAIN_DOMAIN_CONTROLLERS}
  SDDL_DOMAIN_COMPUTERS              = 'DC'; // Domain computers
  {$EXTERNALSYM SDDL_DOMAIN_COMPUTERS}
  SDDL_BUILTIN_ADMINISTRATORS        = 'BA'; // Builtin (local ) administrators
  {$EXTERNALSYM SDDL_BUILTIN_ADMINISTRATORS}
  SDDL_BUILTIN_GUESTS                = 'BG'; // Builtin (local ) guests
  {$EXTERNALSYM SDDL_BUILTIN_GUESTS}
  SDDL_BUILTIN_USERS                 = 'BU'; // Builtin (local ) users
  {$EXTERNALSYM SDDL_BUILTIN_USERS}
  SDDL_LOCAL_ADMIN                   = 'LA'; // Local administrator account
  {$EXTERNALSYM SDDL_LOCAL_ADMIN}
  SDDL_LOCAL_GUEST                   = 'LG'; // Local group account
  {$EXTERNALSYM SDDL_LOCAL_GUEST}
  SDDL_ACCOUNT_OPERATORS             = 'AO'; // Account operators
  {$EXTERNALSYM SDDL_ACCOUNT_OPERATORS}
  SDDL_BACKUP_OPERATORS              = 'BO'; // Backup operators
  {$EXTERNALSYM SDDL_BACKUP_OPERATORS}
  SDDL_PRINTER_OPERATORS             = 'PO'; // Printer operators
  {$EXTERNALSYM SDDL_PRINTER_OPERATORS}
  SDDL_SERVER_OPERATORS              = 'SO'; // Server operators
  {$EXTERNALSYM SDDL_SERVER_OPERATORS}
  SDDL_AUTHENTICATED_USERS           = 'AU'; // Authenticated users
  {$EXTERNALSYM SDDL_AUTHENTICATED_USERS}
  SDDL_PERSONAL_SELF                 = 'PS'; // Personal self
  {$EXTERNALSYM SDDL_PERSONAL_SELF}
  SDDL_CREATOR_OWNER                 = 'CO'; // Creator owner
  {$EXTERNALSYM SDDL_CREATOR_OWNER}
  SDDL_CREATOR_GROUP                 = 'CG'; // Creator group
  {$EXTERNALSYM SDDL_CREATOR_GROUP}
  SDDL_LOCAL_SYSTEM                  = 'SY'; // Local system
  {$EXTERNALSYM SDDL_LOCAL_SYSTEM}
  SDDL_POWER_USERS                   = 'PU'; // Power users
  {$EXTERNALSYM SDDL_POWER_USERS}
  SDDL_EVERYONE                      = 'WD'; // Everyone ( World )
  {$EXTERNALSYM SDDL_EVERYONE}
  SDDL_REPLICATOR                    = 'RE'; // Replicator
  {$EXTERNALSYM SDDL_REPLICATOR}
  SDDL_INTERACTIVE                   = 'IU'; // Interactive logon user
  {$EXTERNALSYM SDDL_INTERACTIVE}
  SDDL_NETWORK                       = 'NU'; // Nework logon user
  {$EXTERNALSYM SDDL_NETWORK}
  SDDL_SERVICE                       = 'SU'; // Service logon user
  {$EXTERNALSYM SDDL_SERVICE}
  SDDL_RESTRICTED_CODE               = 'RC'; // Restricted code
  {$EXTERNALSYM SDDL_RESTRICTED_CODE}
  SDDL_SCHEMA_ADMINISTRATORS         = 'SA'; // Schema Administrators
  {$EXTERNALSYM SDDL_SCHEMA_ADMINISTRATORS}
  SDDL_CERT_SERV_ADMINISTRATORS      = 'CA'; // Certificate Server Administrators
  {$EXTERNALSYM SDDL_CERT_SERV_ADMINISTRATORS}
  SDDL_RAS_SERVERS                   = 'RS'; // RAS servers group
  {$EXTERNALSYM SDDL_RAS_SERVERS}
  SDDL_ENTERPRISE_ADMINS             = 'EA'; // Enterprise administrators
  {$EXTERNALSYM SDDL_ENTERPRISE_ADMINS}
  SDDL_GROUP_POLICY_ADMINS           = 'PA'; // Group Policy administrators
  {$EXTERNALSYM SDDL_GROUP_POLICY_ADMINS}
  SDDL_ALIAS_PREW2KCOMPACC           = 'RU'; // alias to allow previous windows 2000
  {$EXTERNALSYM SDDL_ALIAS_PREW2KCOMPACC}

//
// SDDL Seperators
//

  SDDL_SEPERATORC   = ';';
  {$EXTERNALSYM SDDL_SEPERATORC}
  SDDL_DELIMINATORC = ':';
  {$EXTERNALSYM SDDL_DELIMINATORC}
  SDDL_ACE_BEGINC   = '(';
  {$EXTERNALSYM SDDL_ACE_BEGINC}
  SDDL_ACE_ENDC     = ')';
  {$EXTERNALSYM SDDL_ACE_ENDC}


function ConvertSidToStringSidA(Sid: PSID; var StringSid: LPSTR): BOOL; stdcall;
{$EXTERNALSYM ConvertSidToStringSidA}
function ConvertSidToStringSidW(Sid: PSID; var StringSid: LPWSTR): BOOL; stdcall;
{$EXTERNALSYM ConvertSidToStringSidW}

{$IFDEF UNICODE}
function ConvertSidToStringSid(Sid: PSID; var StringSid: LPWSTR): BOOL; stdcall;
{$EXTERNALSYM ConvertSidToStringSid}
{$ELSE}
function ConvertSidToStringSid(Sid: PSID; var StringSid: LPSTR): BOOL; stdcall;
{$EXTERNALSYM ConvertSidToStringSid}
{$ENDIF}

function ConvertStringSidToSidA(StringSid: LPCSTR; var Sid: PSID): BOOL; stdcall;
{$EXTERNALSYM ConvertStringSidToSidA}
function ConvertStringSidToSidW(StringSid: LPCWSTR; var Sid: PSID): BOOL; stdcall;
{$EXTERNALSYM ConvertStringSidToSidW}

{$IFDEF UNICODE}
function ConvertStringSidToSid(StringSid: LPCWSTR; var Sid: PSID): BOOL; stdcall;
{$EXTERNALSYM ConvertStringSidToSid}
{$ELSE}
function ConvertStringSidToSid(StringSid: LPCSTR; var Sid: PSID): BOOL; stdcall;
{$EXTERNALSYM ConvertStringSidToSid}
{$ENDIF}

function ConvertStringSecurityDescriptorToSecurityDescriptorA(StringSecurityDescriptor: LPCSTR;
  StringSDRevision: DWORD; var SecurityDescriptor: PSECURITY_DESCRIPTOR;
  SecurityDescriptorSize: PULONG): BOOL; stdcall;
{$EXTERNALSYM ConvertStringSecurityDescriptorToSecurityDescriptorA}
function ConvertStringSecurityDescriptorToSecurityDescriptorW(StringSecurityDescriptor: LPCWSTR;
  StringSDRevision: DWORD; var SecurityDescriptor: PSECURITY_DESCRIPTOR;
  SecurityDescriptorSize: PULONG): BOOL; stdcall;
{$EXTERNALSYM ConvertStringSecurityDescriptorToSecurityDescriptorW}

{$IFDEF UNICODE}
function ConvertStringSecurityDescriptorToSecurityDescriptor(StringSecurityDescriptor: LPCWSTR;
  StringSDRevision: DWORD; var SecurityDescriptor: PSECURITY_DESCRIPTOR;
  SecurityDescriptorSize: PULONG): BOOL; stdcall;
{$EXTERNALSYM ConvertStringSecurityDescriptorToSecurityDescriptor}
{$ELSE}
function ConvertStringSecurityDescriptorToSecurityDescriptor(StringSecurityDescriptor: LPCSTR;
  StringSDRevision: DWORD; var SecurityDescriptor: PSECURITY_DESCRIPTOR;
  SecurityDescriptorSize: PULONG): BOOL; stdcall;
{$EXTERNALSYM ConvertStringSecurityDescriptorToSecurityDescriptor}
{$ENDIF}

function ConvertSecurityDescriptorToStringSecurityDescriptorA(
  SecurityDescriptor: PSECURITY_DESCRIPTOR; RequestedStringSDRevision: DWORD;
  SecurityInformation: SECURITY_INFORMATION; var StringSecurityDescriptor: LPSTR;
  StringSecurityDescriptorLen: PULONG): BOOL; stdcall;
{$EXTERNALSYM ConvertSecurityDescriptorToStringSecurityDescriptorA}
function ConvertSecurityDescriptorToStringSecurityDescriptorW(
  SecurityDescriptor: PSECURITY_DESCRIPTOR; RequestedStringSDRevision: DWORD;
  SecurityInformation: SECURITY_INFORMATION; var StringSecurityDescriptor: LPWSTR;
  StringSecurityDescriptorLen: PULONG): BOOL; stdcall;
{$EXTERNALSYM ConvertSecurityDescriptorToStringSecurityDescriptorW}

{$IFDEF UNICODE}
function ConvertSecurityDescriptorToStringSecurityDescriptor(
  SecurityDescriptor: PSECURITY_DESCRIPTOR; RequestedStringSDRevision: DWORD;
  SecurityInformation: SECURITY_INFORMATION; var StringSecurityDescriptor: LPWSTR;
  StringSecurityDescriptorLen: PULONG): BOOL; stdcall;
{$EXTERNALSYM ConvertSecurityDescriptorToStringSecurityDescriptor}
{$ELSE}
function ConvertSecurityDescriptorToStringSecurityDescriptor(
  SecurityDescriptor: PSECURITY_DESCRIPTOR; RequestedStringSDRevision: DWORD;
  SecurityInformation: SECURITY_INFORMATION; var StringSecurityDescriptor: LPSTR;
  StringSecurityDescriptorLen: PULONG): BOOL; stdcall;
{$EXTERNALSYM ConvertSecurityDescriptorToStringSecurityDescriptor}
{$ENDIF}

implementation

const
  advapi32 = 'advapi32.dll';

function ConvertSidToStringSidA; external advapi32 name 'ConvertSidToStringSidA';
function ConvertSidToStringSidW; external advapi32 name 'ConvertSidToStringSidW';
{$IFDEF UNICODE}
function ConvertSidToStringSid; external advapi32 name 'ConvertSidToStringSidW';
{$ELSE}
function ConvertSidToStringSid; external advapi32 name 'ConvertSidToStringSidA';
{$ENDIF}
function ConvertStringSidToSidA; external advapi32 name 'ConvertStringSidToSidA';
function ConvertStringSidToSidW; external advapi32 name 'ConvertStringSidToSidW';
{$IFDEF UNICODE}
function ConvertStringSidToSid; external advapi32 name 'ConvertStringSidToSidW';
{$ELSE}
function ConvertStringSidToSid; external advapi32 name 'ConvertStringSidToSidA';
{$ENDIF}
function ConvertStringSecurityDescriptorToSecurityDescriptorA; external advapi32 name 'ConvertStringSecurityDescriptorToSecurityDescriptorA';
function ConvertStringSecurityDescriptorToSecurityDescriptorW; external advapi32 name 'ConvertStringSecurityDescriptorToSecurityDescriptorW';
{$IFDEF UNICODE}
function ConvertStringSecurityDescriptorToSecurityDescriptor; external advapi32 name 'ConvertStringSecurityDescriptorToSecurityDescriptorW';
{$ELSE}
function ConvertStringSecurityDescriptorToSecurityDescriptor; external advapi32 name 'ConvertStringSecurityDescriptorToSecurityDescriptorA';
{$ENDIF}
function ConvertSecurityDescriptorToStringSecurityDescriptorA; external advapi32 name 'ConvertSecurityDescriptorToStringSecurityDescriptorA';
function ConvertSecurityDescriptorToStringSecurityDescriptorW; external advapi32 name 'ConvertSecurityDescriptorToStringSecurityDescriptorW';
{$IFDEF UNICODE}
function ConvertSecurityDescriptorToStringSecurityDescriptor; external advapi32 name 'ConvertSecurityDescriptorToStringSecurityDescriptorW';
{$ELSE}
function ConvertSecurityDescriptorToStringSecurityDescriptor; external advapi32 name 'ConvertSecurityDescriptorToStringSecurityDescriptorA';
{$ENDIF}

end.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -