creating a SID for the Everyone group.

 DWORD SidSize;
PSID TheSID;
LPTSTR p; SidSize = SECURITY_MAX_SID_SIZE;
// Allocate enough memory for the largest possible SID.
if(!(TheSID = LocalAlloc(LMEM_FIXED, SidSize)))
{
fprintf(stderr, "Could not allocate memory.\n");
exit();
}
// Create a SID for the Everyone group on the local computer.
if(!CreateWellKnownSid(WinWorldSid, NULL, TheSID, &SidSize))
{
fprintf(stderr,
"CreateWellKnownSid Error %u",
GetLastError());
}
else
{
// Get the string version of the SID (S-1-1-0).
if(!(ConvertSidToStringSid(TheSID, &p)))
{
fprintf(stderr,
"Error during ConvertSidToStringSid.\n");
exit();
} // Use the string SID as needed.
// ... // When done, free the memory used.
LocalFree(p);
LocalFree(TheSID);
}
 typedef enum {

     WinNullSid                                  = ,
WinWorldSid = ,
WinLocalSid = ,
WinCreatorOwnerSid = ,
WinCreatorGroupSid = ,
WinCreatorOwnerServerSid = ,
WinCreatorGroupServerSid = ,
WinNtAuthoritySid = ,
WinDialupSid = ,
WinNetworkSid = ,
WinBatchSid = ,
WinInteractiveSid = ,
WinServiceSid = ,
WinAnonymousSid = ,
WinProxySid = ,
WinEnterpriseControllersSid = ,
WinSelfSid = ,
WinAuthenticatedUserSid = ,
WinRestrictedCodeSid = ,
WinTerminalServerSid = ,
WinRemoteLogonIdSid = ,
WinLogonIdsSid = ,
WinLocalSystemSid = ,
WinLocalServiceSid = ,
WinNetworkServiceSid = ,
WinBuiltinDomainSid = ,
WinBuiltinAdministratorsSid = ,
WinBuiltinUsersSid = ,
WinBuiltinGuestsSid = ,
WinBuiltinPowerUsersSid = ,
WinBuiltinAccountOperatorsSid = ,
WinBuiltinSystemOperatorsSid = ,
WinBuiltinPrintOperatorsSid = ,
WinBuiltinBackupOperatorsSid = ,
WinBuiltinReplicatorSid = ,
WinBuiltinPreWindows2000CompatibleAccessSid = ,
WinBuiltinRemoteDesktopUsersSid = ,
WinBuiltinNetworkConfigurationOperatorsSid = ,
WinAccountAdministratorSid = ,
WinAccountGuestSid = ,
WinAccountKrbtgtSid = ,
WinAccountDomainAdminsSid = ,
WinAccountDomainUsersSid = ,
WinAccountDomainGuestsSid = ,
WinAccountComputersSid = ,
WinAccountControllersSid = ,
WinAccountCertAdminsSid = ,
WinAccountSchemaAdminsSid = ,
WinAccountEnterpriseAdminsSid = ,
WinAccountPolicyAdminsSid = ,
WinAccountRasAndIasServersSid = ,
WinNTLMAuthenticationSid = ,
WinDigestAuthenticationSid = ,
WinSChannelAuthenticationSid = ,
WinThisOrganizationSid = ,
WinOtherOrganizationSid = ,
WinBuiltinIncomingForestTrustBuildersSid = ,
WinBuiltinPerfMonitoringUsersSid = ,
WinBuiltinPerfLoggingUsersSid = ,
WinBuiltinAuthorizationAccessSid = ,
WinBuiltinTerminalServerLicenseServersSid = ,
WinBuiltinDCOMUsersSid = ,
WinBuiltinIUsersSid = ,
WinIUserSid = ,
WinBuiltinCryptoOperatorsSid = ,
WinUntrustedLabelSid = ,
WinLowLabelSid = ,
WinMediumLabelSid = ,
WinHighLabelSid = ,
WinSystemLabelSid = ,
WinWriteRestrictedCodeSid = ,
WinCreatorOwnerRightsSid = ,
WinCacheablePrincipalsGroupSid = ,
WinNonCacheablePrincipalsGroupSid = ,
WinEnterpriseReadonlyControllersSid = ,
WinAccountReadonlyControllersSid = ,
WinBuiltinEventLogReadersGroup = ,
WinNewEnterpriseReadonlyControllersSid = ,
WinBuiltinCertSvcDComAccessGroup = ,
WinMediumPlusLabelSid = ,
WinLocalLogonSid = ,
WinConsoleLogonSid = ,
WinThisOrganizationCertificateSid = ,
} WELL_KNOWN_SID_TYPE;

匹配一个SID与已知的SID是否匹配

 BOOL IsWellKnownSid(
PSID pSid,
WELL_KNOWN_SID_TYPE WellKnownSidType
);

SID(安全标识符)的更多相关文章

  1. Windows Server 2008更改SID

    参考:Windows Server 2012 克隆修改SID 前言 克隆(软克隆,硬克隆)虚拟机后,虚拟机不光名称一样,IP一样(设置静态IP情况下),连SID也一样 什么是SID SID 安全标识符 ...

  2. 从0开始搭建SQL Server AlwaysOn 第一篇(配置域控)

    从0开始搭建SQL Server AlwaysOn 第一篇(配置域控) 第一篇http://www.cnblogs.com/lyhabc/p/4678330.html第二篇http://www.cnb ...

  3. (转载) 从0开始搭建SQL Server AlwaysOn 第一篇(配置域控)

    安装完之后别忘了还需要安装SSMS,这是坑爹的地方之二,干嘛不集成到SQL Server安装包里还要用户自己单独下载 下载地址:https://msdn.microsoft.com/en-us/lib ...

  4. 安全标识符SID技术介绍及查看技巧

    说到安全标识符SID就要先说说安全主体(Security Principals),安全主体是一个能够对它分配权限的对象,例如,用户.组和计算机: 对于每一个Windows 200x域中的安全主体都有一 ...

  5. [转]在 Windows 操作系统中的已知安全标识符(Sid security identifiers)

    安全标识符 (SID) 是用于标识安全主体或安全组在 Windows 操作系统中的可变长度的唯一值.常用 Sid 的 Sid 标识普通用户的一组或通用组.跨所有操作系统,它们的值保持不变. 此信息可用 ...

  6. VBS脚本获取安全标识符SID(Security Identifiers)的方法

    一.SID简介       SID也就是安全标识符(Security Identifiers),是标识用户.组和计算机帐户的唯一的号码.在第一次创建该帐户时,将给网络上的每一个帐户发布一个唯一的 SI ...

  7. 【windows 访问控制】六、安全标识符(SID Security Identifiers)

    安全标识符(SID Security Identifiers) SID是用来标识安全主体.就是给安全主体一个唯一的ID.用户层面通过用户账户名识别,程序和资源之间通过SID识别. 什么是安全标识符? ...

  8. 解决服务器SID引起虚拟机不能加入AD域用户,无法远程登录的问题

    最近在公司搭建AD域控制器,发现无法在计算机真正添加域用户,也就是添加的用户虽然可以在本地登录,但是无法远程登录,尝试多种方法都无法解决,而最终原因居然是虚拟机导致的服务器的SID冲突.本文记录下该问 ...

  9. 【转】windows server 2012清除并重建SID

    windows server 2012清除并重建SID 2012-09-17 17:51:51 标签:SID windows server 2012 原创作品,允许转载,转载时请务必以超链接形式标明文 ...

随机推荐

  1. 跨越适配&性能那道坎,企鹅电竞Android weex优化

    WeTest 导读 企鹅电竞从17年6月接入weex,到现在已经有一年半的时间,这段时间里面,针对遇到的问题,企鹅电竞终端主要做了下面的优化: image组件 预加载 预渲染 Image组件 weex ...

  2. hdu2187悼念512汶川大地震遇难同胞——老人是真饿了(贪心 简单题)

    传送门 简单题 #include<bits/stdc++.h> using namespace std; struct node { double dan,weight; }a[]; bo ...

  3. ESP8266 station模式下建立client、server TCP连接

    程序实现内容: 1.在station模式下,ESP8266作为client.server进行TCP连接2.实现数据的发送.接收(同时回传)实现思路:TCP网络通信分层为:应用层.网络层.数据链路层.物 ...

  4. Java线程Run和Start的区别

    先上结论:run只是Thread里面的一个普通方法,start是启动线程的方法.何以见得呢?可以执行下面的代码看看run和start的区别: package com.basic.thread; /** ...

  5. fetch上传文件报错的问题(multipart: NextPart: EOF)

    技术栈 后台: gin(golang) 前端: react+antd+dva 问题 前端这边使用fetch发送http请求的时候,后端解析formData报错: multipart: NextPart ...

  6. cmake-index-3.11.4机翻

    index next | CMake » git-stage git-master latest release 3.13 3.12 3.11.4 3.10 3.9 3.8 3.7 3.6 3.5 3 ...

  7. dp算法之硬币找零问题

    题目:硬币找零 题目介绍:现在有面值1.3.5元三种硬币无限个,问组成n元的硬币的最小数目? 分析:现在假设n=10,画出状态分布图: 硬币编号 硬币面值p 1 1 2 3 3 5 编号i/n总数j ...

  8. Wacom发布Cintiq Companion 2

    全新的Cintiq Companion 2是一款强大的平板电脑,让创意专业人士获得最佳的屏幕笔触,让创意随时随地进行.用户还可以在家中或工作时连接到Mac或PC电脑获得无与伦比的灵活性! 2015年1 ...

  9. mysql常用语句入门整理

    这篇属于小白入门级别,如果你已经高手可以直接跳过 1.运行数据库mysqld.exe,客户端直接mysql -uroot(root是默认用户名) -p 2 showdatabases,showtabl ...

  10. 按照Right-BICEP要求设计的测试用例

    测试用例: 测试方法:Right-BICEP 测试要求: Right-结果是否正确? B-是否所有的边界条件都是正确的? P-是否满足性能要求? 题目是否有重复? 数量是否可定制? 数值范围是否可定制 ...