Export (0) Print
Expand All
Expand Minimize

CopySid function

The CopySid function copies a security identifier (SID) to a buffer.

Syntax


BOOL WINAPI CopySid(
  _In_   DWORD nDestinationSidLength,
  _Out_  PSID pDestinationSid,
  _In_   PSID pSourceSid
);

Parameters

nDestinationSidLength [in]

Specifies the length, in bytes, of the buffer receiving the copy of the SID.

pDestinationSid [out]

A pointer to a buffer that receives a copy of the source SID structure.

pSourceSid [in]

A pointer to a SID structure that the function copies to the buffer pointed to by the pDestinationSid parameter.

Return value

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero. To get extended error information, call GetLastError.

Remarks

An application can use the CopySid function to make a copy of a SID in an access token (for example, in a TOKEN_GROUPS structure) to use in an access control entry (ACE).

Examples

For an example that uses this function, see Getting the Logon SID.

Requirements

Minimum supported client

Windows XP [desktop apps only]

Minimum supported server

Windows Server 2003 [desktop apps only]

Header

Winbase.h (include Windows.h)

Library

Advapi32.lib

DLL

Advapi32.dll

See also

Access Control Overview
Basic Access Control Functions
AllocateAndInitializeSid
EqualSid
GetLengthSid
GetSidIdentifierAuthority
GetSidLengthRequired
GetSidSubAuthority
GetSidSubAuthorityCount
InitializeSid
IsValidSid
SID

 

 

Community Additions

ADD
Show:
© 2014 Microsoft