From 380c8732c6c032f4961cd67dffee13d1f630b12d Mon Sep 17 00:00:00 2001 From: Mino Date: Wed, 8 Apr 2020 23:54:35 +0900 Subject: [PATCH] I fucking hate C# now --- Dalamud.Bootstrap/GameProcess.cs | 0 .../OS/Windows/ProcessCreationOptions.cs | 2 +- Dalamud.Bootstrap/OS/Windows/Raw/Advapi32.cs | 3 +++ .../OS/Windows/Raw/Structures.cs | 20 +++++++++++++++++++ 4 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 Dalamud.Bootstrap/GameProcess.cs diff --git a/Dalamud.Bootstrap/GameProcess.cs b/Dalamud.Bootstrap/GameProcess.cs new file mode 100644 index 000000000..e69de29bb diff --git a/Dalamud.Bootstrap/OS/Windows/ProcessCreationOptions.cs b/Dalamud.Bootstrap/OS/Windows/ProcessCreationOptions.cs index db013b58f..8993dcb87 100644 --- a/Dalamud.Bootstrap/OS/Windows/ProcessCreationOptions.cs +++ b/Dalamud.Bootstrap/OS/Windows/ProcessCreationOptions.cs @@ -8,7 +8,7 @@ namespace Dalamud.Bootstrap.Windows public string? CommandLine { get; set; } = null; - public IEnumerable>? Environments { get; set; } = null; + public IDictionary? 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 index 167a763c7..dad373722 100644 --- a/Dalamud.Bootstrap/OS/Windows/Raw/Advapi32.cs +++ b/Dalamud.Bootstrap/OS/Windows/Raw/Advapi32.cs @@ -9,5 +9,8 @@ namespace Dalamud.Bootstrap.OS.Windows.Raw [DllImport(Name, CallingConvention = CallingConvention.Winapi, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] public static extern bool InitializeSecurityDescriptor(out SECURITY_DESCRIPTOR pSecurityDescriptor, uint revision); + + [DllImport(Name, CallingConvention = CallingConvention.Winapi)] + public static extern uint SetEntriesInAclA(ulong cCountOfExplicitEntries, ref ACL oldAcl, out ACL* NewAcl); } } diff --git a/Dalamud.Bootstrap/OS/Windows/Raw/Structures.cs b/Dalamud.Bootstrap/OS/Windows/Raw/Structures.cs index eab990fbc..08bdd73fa 100644 --- a/Dalamud.Bootstrap/OS/Windows/Raw/Structures.cs +++ b/Dalamud.Bootstrap/OS/Windows/Raw/Structures.cs @@ -130,4 +130,24 @@ namespace Dalamud.Bootstrap.OS.Windows.Raw public IntPtr Sacl; public IntPtr Dacl; } + + [StructLayout(LayoutKind.Sequential)] + internal struct EXPLICIT_ACCESS_A + { + // TODO + uint grfAccessPermissions; + ACCESS_MODE grfAccessMode; + uint grfInheritance; + TRUSTEE_A Trustee; + } + + [StructLayout(LayoutKind.Sequential)] + internal struct ACL + { + byte AclRevision; + byte Sbz1; + ushort AclSize; + ushort AceCount; + ushort Sbz2; + } }