Skip to content

Commit e3175d5

Browse files
committed
Use object initializer.
1 parent 49922bb commit e3175d5

File tree

2 files changed

+14
-7
lines changed

2 files changed

+14
-7
lines changed

Debugger/RemoteDebugger.Thread.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,10 @@ public bool StartDebuggerIfNeeded(Func<bool> queryAttach)
3333

3434
if (queryAttach())
3535
{
36-
thread = new Thread(Run);
37-
thread.IsBackground = true;
36+
thread = new Thread(Run)
37+
{
38+
IsBackground = true
39+
};
3840
thread.Start();
3941

4042
return true;

Native/NativeMethods.Windows.cs

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -118,11 +118,16 @@ public void EnableDebugPrivileges()
118118
IntPtr token;
119119
if (OpenProcessToken(System.Diagnostics.Process.GetCurrentProcess().Handle, TokenAccessLevels.AllAccess, out token))
120120
{
121-
var privileges = new TOKEN_PRIVILEGES();
122-
privileges.PrivilegeCount = 1;
123-
privileges.Luid.LowPart = 0x14;
124-
privileges.Luid.HighPart = 0;
125-
privileges.Attributes = 2;
121+
var privileges = new TOKEN_PRIVILEGES
122+
{
123+
PrivilegeCount = 1,
124+
Luid =
125+
{
126+
LowPart = 0x14,
127+
HighPart = 0
128+
},
129+
Attributes = 2
130+
};
126131

127132
AdjustTokenPrivileges(token, false, ref privileges, 0, IntPtr.Zero, IntPtr.Zero);
128133

0 commit comments

Comments
 (0)