Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ internal static UInt32 GetRid(this SecurityIdentifier sid)
byte[] sidBinary = new byte[sid.BinaryLength];
sid.GetBinaryForm(sidBinary, 0);

return System.BitConverter.ToUInt32(sidBinary, sidBinary.Length-4);
return System.BitConverter.ToUInt32(sidBinary, sidBinary.Length - 4);
}

/// <summary>
Expand All @@ -130,12 +130,13 @@ internal static long GetIdentifierAuthority(this SecurityIdentifier sid)

// The Identifier Authority is six bytes wide,
// in big-endian format, starting at the third byte
long authority = (long) (((long)sidBinary[2]) << 40) +
(((long)sidBinary[3]) << 32) +
(((long)sidBinary[4]) << 24) +
(((long)sidBinary[5]) << 16) +
(((long)sidBinary[6]) << 8) +
(((long)sidBinary[7]) );
long authority =
(((long)sidBinary[2]) << 40) +
(((long)sidBinary[3]) << 32) +
(((long)sidBinary[4]) << 24) +
(((long)sidBinary[5]) << 16) +
(((long)sidBinary[6]) << 8) +
(((long)sidBinary[7]));

return authority;
}
Expand Down
4 changes: 2 additions & 2 deletions src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Sam.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1247,7 +1247,7 @@ private LocalUser CreateUser(LocalUser userInfo, System.Security.SecureString pa

status = SamApi.SamCreateUser2InDomain(domainHandle,
ref str,
(int) SamApi.USER_NORMAL_ACCOUNT,
(int)SamApi.USER_NORMAL_ACCOUNT,
Win32.MAXIMUM_ALLOWED,
out userHandle,
out grantedAccess,
Expand Down Expand Up @@ -1473,7 +1473,7 @@ private IEnumerable<LocalPrincipal> GetGroupMembers(SecurityIdentifier groupSid)

Marshal.Copy(memberIds, idArray, 0, (int)memberCount);

for (int i=0; i < memberCount; i++)
for (int i = 0; i < memberCount; i++)
{
var sid = new SecurityIdentifier(idArray[i]);
yield return MakeLocalPrincipalObject(LookupAccountInfo(sid));
Expand Down