c# Programming Glossary: openprocesstoken
Detect if running as Administrator with or without elevated privileges? http://stackoverflow.com/questions/1220213/detect-if-running-as-administrator-with-or-without-elevated-privileges return MarshalAs UnmanagedType.Bool static extern bool OpenProcessToken IntPtr ProcessHandle UInt32 DesiredAccess out IntPtr TokenHandle.. get if IsUacEnabled IntPtr tokenHandle if OpenProcessToken Process.GetCurrentProcess .Handle TOKEN_READ out tokenHandle..
Process.Start with different credentials with UAC on http://stackoverflow.com/questions/2313553/process-start-with-different-credentials-with-uac-on static extern Boolean OpenProcessToken IntPtr ProcessHandle handle to process Int32 DesiredAccess.. false UInt32 userAppProcessId IntPtr hPToken IntPtr.Zero OpenProcessToken hProcess TOKEN_ADJUST_PRIVILEGES TOKEN_QUERY TOKEN_DUPLICATE.. if hPToken IntPtr.Zero output.AppendLine String.Format OpenProcessToken OK Token 0 hPToken LUID luid new LUID if LookupPrivilegeValue..
Possible to launch a process in a user's session from a service? http://stackoverflow.com/questions/3128017/possible-to-launch-a-process-in-a-users-session-from-a-service dwSessionId sizeof DWORD cbReturnLength bSuccess OpenProcessToken GetCurrentProcess MAXIMUM_ALLOWED hProcessToken bSuccess DuplicateTokenEx..
Set System Time Zone from .NET http://stackoverflow.com/questions/808736/set-system-time-zone-from-net true CharSet CharSet.Auto private static extern int OpenProcessToken int ProcessHandle int DesiredAccess out IntPtr tokenhandle DllImport.. SetTimeZoneInformation will fail IntPtr token int retval OpenProcessToken GetCurrentProcess TOKEN_ADJUST_PRIVILEGES TOKEN_QUERY out token.. TOKEN_QUERY out token Assert.IsTrue retval 0 String.Format OpenProcessToken failed. GetLastError 0 Marshal.GetLastWin32Error LUID luid new..
|