revert accidental injector changes

This commit is contained in:
goaaats 2025-04-13 20:48:31 +02:00
parent fe562e8cf3
commit b2fd7cc9e1

View file

@ -440,7 +440,7 @@ namespace Dalamud.Injector
#region Methods #region Methods
[DllImport("advapi32.dll", CharSet = CharSet.Auto)] [DllImport("advapi32.dll", SetLastError = true, CharSet = CharSet.Auto)]
public static extern void BuildExplicitAccessWithName( public static extern void BuildExplicitAccessWithName(
ref EXPLICIT_ACCESS pExplicitAccess, ref EXPLICIT_ACCESS pExplicitAccess,
string pTrusteeName, string pTrusteeName,
@ -448,26 +448,26 @@ namespace Dalamud.Injector
uint accessMode, uint accessMode,
uint inheritance); uint inheritance);
[DllImport("advapi32.dll", CharSet = CharSet.Auto)] [DllImport("advapi32.dll", SetLastError = true, CharSet = CharSet.Auto)]
public static extern int SetEntriesInAcl( public static extern int SetEntriesInAcl(
int cCountOfExplicitEntries, int cCountOfExplicitEntries,
ref EXPLICIT_ACCESS pListOfExplicitEntries, ref EXPLICIT_ACCESS pListOfExplicitEntries,
IntPtr oldAcl, IntPtr oldAcl,
out IntPtr newAcl); out IntPtr newAcl);
[DllImport("advapi32.dll")] [DllImport("advapi32.dll", SetLastError = true)]
public static extern bool InitializeSecurityDescriptor( public static extern bool InitializeSecurityDescriptor(
out SECURITY_DESCRIPTOR pSecurityDescriptor, out SECURITY_DESCRIPTOR pSecurityDescriptor,
uint dwRevision); uint dwRevision);
[DllImport("advapi32.dll")] [DllImport("advapi32.dll", SetLastError = true)]
public static extern bool SetSecurityDescriptorDacl( public static extern bool SetSecurityDescriptorDacl(
ref SECURITY_DESCRIPTOR pSecurityDescriptor, ref SECURITY_DESCRIPTOR pSecurityDescriptor,
bool bDaclPresent, bool bDaclPresent,
IntPtr pDacl, IntPtr pDacl,
bool bDaclDefaulted); bool bDaclDefaulted);
[DllImport("kernel32.dll", CharSet = CharSet.Auto)] [DllImport("kernel32.dll", SetLastError = true, CharSet = CharSet.Auto)]
public static extern bool CreateProcess( public static extern bool CreateProcess(
string lpApplicationName, string lpApplicationName,
string lpCommandLine, string lpCommandLine,
@ -480,39 +480,39 @@ namespace Dalamud.Injector
[In] ref STARTUPINFO lpStartupInfo, [In] ref STARTUPINFO lpStartupInfo,
out PROCESS_INFORMATION lpProcessInformation); out PROCESS_INFORMATION lpProcessInformation);
[DllImport("kernel32.dll")] [DllImport("kernel32.dll", SetLastError = true)]
public static extern bool CloseHandle(IntPtr hObject); public static extern bool CloseHandle(IntPtr hObject);
[DllImport("kernel32.dll")] [DllImport("kernel32.dll", SetLastError = true)]
public static extern uint ResumeThread(IntPtr hThread); public static extern uint ResumeThread(IntPtr hThread);
[DllImport("advapi32.dll")] [DllImport("advapi32.dll", SetLastError = true)]
public static extern bool ImpersonateSelf( public static extern bool ImpersonateSelf(
SECURITY_IMPERSONATION_LEVEL impersonationLevel); SECURITY_IMPERSONATION_LEVEL impersonationLevel);
[DllImport("advapi32.dll")] [DllImport("advapi32.dll", SetLastError = true)]
public static extern bool OpenProcessToken( public static extern bool OpenProcessToken(
IntPtr processHandle, IntPtr processHandle,
UInt32 desiredAccess, UInt32 desiredAccess,
out IntPtr tokenHandle); out IntPtr tokenHandle);
[DllImport("advapi32.dll")] [DllImport("advapi32.dll", SetLastError = true)]
public static extern bool OpenThreadToken( public static extern bool OpenThreadToken(
IntPtr threadHandle, IntPtr threadHandle,
uint desiredAccess, uint desiredAccess,
bool openAsSelf, bool openAsSelf,
out IntPtr tokenHandle); out IntPtr tokenHandle);
[DllImport("advapi32.dll")] [DllImport("advapi32.dll", SetLastError = true)]
public static extern bool LookupPrivilegeValue(string lpSystemName, string lpName, ref LUID lpLuid); public static extern bool LookupPrivilegeValue(string lpSystemName, string lpName, ref LUID lpLuid);
[DllImport("advapi32.dll")] [DllImport("advapi32.dll", SetLastError = true)]
public static extern bool PrivilegeCheck( public static extern bool PrivilegeCheck(
IntPtr clientToken, IntPtr clientToken,
ref PRIVILEGE_SET requiredPrivileges, ref PRIVILEGE_SET requiredPrivileges,
out bool pfResult); out bool pfResult);
[DllImport("advapi32.dll")] [DllImport("advapi32.dll", SetLastError = true)]
public static extern bool AdjustTokenPrivileges( public static extern bool AdjustTokenPrivileges(
IntPtr tokenHandle, IntPtr tokenHandle,
bool disableAllPrivileges, bool disableAllPrivileges,
@ -521,7 +521,7 @@ namespace Dalamud.Injector
IntPtr previousState, IntPtr previousState,
IntPtr cbOutPreviousState); IntPtr cbOutPreviousState);
[DllImport("advapi32.dll")] [DllImport("advapi32.dll", SetLastError = true)]
public static extern uint GetSecurityInfo( public static extern uint GetSecurityInfo(
IntPtr handle, IntPtr handle,
SE_OBJECT_TYPE objectType, SE_OBJECT_TYPE objectType,
@ -532,7 +532,7 @@ namespace Dalamud.Injector
IntPtr pSacl, IntPtr pSacl,
IntPtr pSecurityDescriptor); IntPtr pSecurityDescriptor);
[DllImport("advapi32.dll")] [DllImport("advapi32.dll", SetLastError = true)]
public static extern uint SetSecurityInfo( public static extern uint SetSecurityInfo(
IntPtr handle, IntPtr handle,
SE_OBJECT_TYPE objectType, SE_OBJECT_TYPE objectType,
@ -542,16 +542,16 @@ namespace Dalamud.Injector
IntPtr pDacl, IntPtr pDacl,
IntPtr pSacl); IntPtr pSacl);
[DllImport("kernel32.dll")] [DllImport("kernel32.dll", SetLastError = true)]
public static extern IntPtr GetCurrentProcess(); public static extern IntPtr GetCurrentProcess();
[DllImport("kernel32.dll")] [DllImport("kernel32.dll", SetLastError = true)]
public static extern IntPtr GetCurrentThread(); public static extern IntPtr GetCurrentThread();
[DllImport("user32.dll")] [DllImport("user32.dll", SetLastError = true)]
public static extern IntPtr FindWindowEx(IntPtr parentHandle, IntPtr hWndChildAfter, string className, IntPtr windowTitle); public static extern IntPtr FindWindowEx(IntPtr parentHandle, IntPtr hWndChildAfter, string className, IntPtr windowTitle);
[DllImport("user32.dll")] [DllImport("user32.dll", SetLastError = true)]
public static extern uint GetWindowThreadProcessId(IntPtr hWnd, out uint lpdwProcessId); public static extern uint GetWindowThreadProcessId(IntPtr hWnd, out uint lpdwProcessId);
[DllImport("user32.dll")] [DllImport("user32.dll")]