diff --git a/Dalamud.Bootstrap/OS/Windows/Process.cs b/Dalamud.Bootstrap/OS/Windows/Process.cs index 668e6c0be..533d67118 100644 --- a/Dalamud.Bootstrap/OS/Windows/Process.cs +++ b/Dalamud.Bootstrap/OS/Windows/Process.cs @@ -29,6 +29,11 @@ namespace Dalamud.Bootstrap.OS m_handle = null!; } + public static Process Create(ProcessCreationOptions options) + { + + } + public static Process Open(uint pid, PROCESS_ACCESS_RIGHTS access) { var handle = OpenHandle(pid, access); diff --git a/Dalamud.Bootstrap/OS/Windows/ProcessCreationOptions.cs b/Dalamud.Bootstrap/OS/Windows/ProcessCreationOptions.cs index e4092f179..db013b58f 100644 --- a/Dalamud.Bootstrap/OS/Windows/ProcessCreationOptions.cs +++ b/Dalamud.Bootstrap/OS/Windows/ProcessCreationOptions.cs @@ -1,3 +1,5 @@ +using System.Collections.Generic; + namespace Dalamud.Bootstrap.Windows { internal sealed class ProcessCreationOptions @@ -6,6 +8,8 @@ namespace Dalamud.Bootstrap.Windows public string? CommandLine { get; set; } = null; + public IEnumerable>? Environments { get; set; } = null; + public bool CreateSuspended { get; set; } } } diff --git a/Dalamud.Bootstrap/OS/Windows/Raw/Advapi32.cs b/Dalamud.Bootstrap/OS/Windows/Raw/Advapi32.cs new file mode 100644 index 000000000..167a763c7 --- /dev/null +++ b/Dalamud.Bootstrap/OS/Windows/Raw/Advapi32.cs @@ -0,0 +1,13 @@ +using System.Runtime.InteropServices; + +namespace Dalamud.Bootstrap.OS.Windows.Raw +{ + internal static unsafe class Advapi32 + { + private const string Name = "Advapi32"; + + [DllImport(Name, CallingConvention = CallingConvention.Winapi, SetLastError = true)] + [return: MarshalAs(UnmanagedType.Bool)] + public static extern bool InitializeSecurityDescriptor(out SECURITY_DESCRIPTOR pSecurityDescriptor, uint revision); + } +} diff --git a/Dalamud.Bootstrap/OS/Windows/Raw/Constants.cs b/Dalamud.Bootstrap/OS/Windows/Raw/Constants.cs index e181f276b..2b05fbc65 100644 --- a/Dalamud.Bootstrap/OS/Windows/Raw/Constants.cs +++ b/Dalamud.Bootstrap/OS/Windows/Raw/Constants.cs @@ -48,4 +48,22 @@ namespace Dalamud.Bootstrap.OS.Windows.Raw EXTENDED_STARTUPINFO_PRESENT = 0x00080000, INHERIT_PARENT_AFFINITY = 0x00010000, } + + internal enum SECURITY_DESCRIPTOR_CONTROL : ushort + { + SE_DACL_AUTO_INHERIT_REQ = 0x0100, + SE_DACL_AUTO_INHERITED = 0x0400, + SE_DACL_DEFAULTED = 0x0008, + SE_DACL_PRESENT = 0x0004, + SE_DACL_PROTECTED = 0x1000, + SE_GROUP_DEFAULTED = 0x0002, + SE_OWNER_DEFAULTED = 0x0001, + SE_RM_CONTROL_VALID = 0x4000, + SE_SACL_AUTO_INHERIT_REQ = 0x0200, + SE_SACL_AUTO_INHERITED = 0x0800, + SE_SACL_DEFAULTED = 0x0008, + SE_SACL_PRESENT = 0x0010, + SE_SACL_PROTECTED = 0x2000, + SE_SELF_RELATIVE = 0x8000, + } } diff --git a/Dalamud.Bootstrap/OS/Windows/Raw/Structures.cs b/Dalamud.Bootstrap/OS/Windows/Raw/Structures.cs index d2b1f2bc9..eab990fbc 100644 --- a/Dalamud.Bootstrap/OS/Windows/Raw/Structures.cs +++ b/Dalamud.Bootstrap/OS/Windows/Raw/Structures.cs @@ -122,6 +122,12 @@ namespace Dalamud.Bootstrap.OS.Windows.Raw [StructLayout(LayoutKind.Sequential)] internal struct SECURITY_DESCRIPTOR { - + public byte Revision; + public byte Sbz1; + public SECURITY_DESCRIPTOR_CONTROL Control; + public IntPtr Owner; + public IntPtr Group; + public IntPtr Sacl; + public IntPtr Dacl; } }