2 using System.Runtime.InteropServices;
20 AllowUnprivilegedCreate = 2
26 [DllImport(
"user32.dll")]
27 public static extern int GetWindowThreadProcessId(IntPtr hWnd, out
int lpdwProcessId);
32 [DllImport(
"user32.dll", CharSet = CharSet.Unicode)]
33 public static extern IntPtr FindWindow(
string lpClassName,
string lpWindowName);
38 [DllImport(
"user32.dll")]
39 public static extern int SendMessage(IntPtr hWnd,
int wMsg, IntPtr wParam, IntPtr lParam);
44 public delegate
bool EnumWindowProc(IntPtr hwnd, IntPtr lParam);
49 [DllImport(
"user32.dll")]
50 public static extern bool EnumChildWindows(IntPtr window, EnumWindowProc callback, IntPtr lParam);
55 [DllImport(
"user32.dll", CharSet = CharSet.Unicode, SetLastError =
true)]
56 public static extern int GetWindowText(IntPtr hWnd, StringBuilder lpString,
int nMaxCount);
61 [DllImport(
"advapi32.dll", SetLastError =
true, CharSet = CharSet.Unicode)]
62 public static extern bool LogonUser(
string lpszUsername,
string lpszDomain,
string lpszPassword,
int dwLogonType,
int dwLogonProvider, out IntPtr phToken);
67 [DllImport(
"kernel32.dll", SetLastError =
true, CharSet = CharSet.Unicode)]
68 public static extern bool CreateSymbolicLink(
string lpSymlinkFileName,
string lpTargetFileName,
CreateSymbolicLinkFlags dwFlags);
Use server authentication
CreateSymbolicLinkFlags
See https://docs.microsoft.com/en-us/windows/desktop/api/winbase/nf-winbase-createsymboliclinka#param...
Native methods used by the code