Skip to content

Commit 580ce1d

Browse files
tyranidtyranid
authored andcommitted
Added machine type.
1 parent 012d1ee commit 580ce1d

2 files changed

Lines changed: 16 additions & 0 deletions

File tree

NtApiDotNet/Win32/Win32ProcessConfig.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,10 @@ public bool NoTokenFallback
235235
/// Specify component filter flags.
236236
/// </summary>
237237
public ProcessComponentFilterFlags ComponentFilter { get; set; }
238+
/// <summary>
239+
/// Specify the machine type for the new process.
240+
/// </summary>
241+
public DllMachineType? MachineType { get; set; }
238242

239243
/// <summary>
240244
/// Add an object's handle to the list of inherited handles.
@@ -401,6 +405,11 @@ private int GetAttributeCount()
401405
count++;
402406
}
403407

408+
if (MachineType.HasValue)
409+
{
410+
count++;
411+
}
412+
404413
return count;
405414
}
406415

@@ -516,6 +525,11 @@ private SafeHGlobalBuffer GetAttributes(DisposableList resources)
516525
attr_list.AddAttribute(Win32ProcessAttributes.ProcThreadAttributeComponentFilter, (int)ComponentFilter);
517526
}
518527

528+
if (MachineType.HasValue)
529+
{
530+
attr_list.AddAttribute(Win32ProcessAttributes.ProcThreadAttributeMachineType, (ushort)MachineType.Value);
531+
}
532+
519533
return attr_list;
520534
}
521535

NtApiDotNet/Win32/Win32ProcessNative.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -462,6 +462,8 @@ enum PROC_THREAD_ATTRIBUTE_NUM
462462
public static IntPtr ProcThreadAttributeMitigationAuditPolicy => GetValue(PROC_THREAD_ATTRIBUTE_NUM.ProcThreadAttributeMitigationAuditPolicy, false, true, false);
463463

464464
public static IntPtr ProcThreadAttributeComponentFilter => GetValue(PROC_THREAD_ATTRIBUTE_NUM.ProcThreadAttributeComponentFilter, false, true, false);
465+
466+
public static IntPtr ProcThreadAttributeMachineType => GetValue(PROC_THREAD_ATTRIBUTE_NUM.ProcThreadAttributeMachineType, false, true, false);
465467
}
466468

467469
class SafeProcThreadAttributeListBuffer : SafeHGlobalBuffer

0 commit comments

Comments
 (0)