Creating a World SID

Article translations Article translations
Article ID: 111543 - View products that this article applies to.
This article was previously published under Q111543
This article has been archived. It is offered "as is" and will no longer be updated.
The sample code below demonstrates how to create a World Security Identifier (SID). The World SID (S-1-1-0) is a group that includes all users. To determine if a SID (perhaps in an Access Control Entry) is the World SID, you must first create a World SID to compare it to. Once you have created a World SID, you can use the EqualSid() API (application programming interface) to determine equality.

Sample Code

PSID psidWorldSid;
SID_IDENTIFIER_AUTHORITY siaWorldSidAuthority =
     SECURITY_WORLD_SID_AUTHORITY;

psidWorldSid = (PSID)LocalAlloc(LPTR,GetSidLengthRequired( 1 ));

InitializeSid( psidWorldSid, &siaWorldSidAuthority, 1);
*(GetSidSubAuthority( psidWorldSid, 0)) = SECURITY_WORLD_RID;
		
Expand all | Collapse all

Properties

Article ID: 111543 - Last Review: February 28, 2014 - Revision: 3.1
APPLIES TO
  • Microsoft Win32 Application Programming Interface, when used with:
    • Microsoft Windows NT Advanced Server 3.1
    • Microsoft Windows NT 4.0
    • Microsoft Windows 2000 Standard Edition
    • the operating system: Microsoft Windows XP
Keywords: 
kbnosurvey kbarchive kbprogramming kbkernbase kbsecurity KB111543

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com