¡@

Home 

c# Programming Glossary: htoken

Run Powershell-Script from C# Application

http://stackoverflow.com/questions/11120452/run-powershell-script-from-c-sharp-application

int dwLogonType int dwLogonProvider ref IntPtr phToken DllImport advapi32.dll CharSet CharSet.Auto SetLastError true.. true private static extern int DuplicateToken IntPtr hToken int impersonationLevel ref IntPtr hNewToken DllImport advapi32.dll..

How do you impersonate an Active Directory user in Powershell?

http://stackoverflow.com/questions/11806/how-do-you-impersonate-an-active-directory-user-in-powershell

int dwLogonType int dwLogonProvider ref IntPtr phToken DllImport advapi32.dll CharSet CharSet.Auto SetLastError true.. true private static extern int DuplicateToken IntPtr hToken int impersonationLevel ref IntPtr hNewToken DllImport advapi32.dll..

How to resolve a .lnk in c#

http://stackoverflow.com/questions/139010/how-to-resolve-a-lnk-in-c-sharp

int SHGetFolderPath IntPtr hwndOwner int nFolder IntPtr hToken int dwFlags StringBuilder lpszPath Flags enum SLGP_FLAGS summary..

How can I tell that a directory is the recycle bin in C#?

http://stackoverflow.com/questions/1585295/how-can-i-tell-that-a-directory-is-the-recycle-bin-in-c

UnmanagedType.LPStruct Guid rfid uint dwFlags IntPtr hToken out IntPtr pszPath known folder GUID declarations public static..

How to change folders permission to the current user by using admin credentials?

http://stackoverflow.com/questions/18580419/how-to-change-folders-permission-to-the-current-user-by-using-admin-credentials

dwLogOnProvider The dw log on provider. param param name phToken The ph token. param returns returns DllImport advapi32.dll CharSet.. int dwLogOnType int dwLogOnProvider ref IntPtr phToken summary Duplicates the token. summary param name hToken The.. phToken summary Duplicates the token. summary param name hToken The h token. param param name impersonationLevel The impersonation..

Process.Start with different credentials with UAC on

http://stackoverflow.com/questions/2313553/process-start-with-different-credentials-with-uac-on

UInt32 WTSQueryUserToken UInt32 SessionId ref IntPtr phToken DllImport advapi32.dll SetLastError true static extern Boolean.. extern static Boolean CreateProcessAsUser IntPtr hToken String lpApplicationName String lpCommandLine ref SECURITY_ATTRIBUTES.. CreateEnvironmentBlock ref IntPtr lpEnvironment IntPtr hToken Boolean bInherit #endregion #region Methods summary Method returns..

Using Process.Start() to start a process as a different user from within a Windows Service

http://stackoverflow.com/questions/362419/using-process-start-to-start-a-process-as-a-different-user-from-within-a-windo

int dwLogonType int dwLogonProvider out IntPtr phToken #region GetTokenInformation BOOL WINAPI GetTokenInformation.. BOOL WINAPI CreateProcessAsUser __in_opt HANDLE hToken __in_opt LPCTSTR lpApplicationName __inout_opt LPTSTR lpCommandLine..

Start a windows service and launch cmd

http://stackoverflow.com/questions/4147821/start-a-windows-service-and-launch-cmd

CharSet.Auto static extern bool CreateProcessAsUser IntPtr hToken string lpApplicationName string lpCommandLine IntPtr lpProcessAttributes..

How to get a Unique ID for the current user's logon session in windows - c#

http://stackoverflow.com/questions/6061143/how-to-get-a-unique-id-for-the-current-users-logon-session-in-windows-c-sharp

IntPtr tokenInfo bool result int infoSize IntPtr hToken System.Security.Principal.WindowsIdentity.GetCurrent .Token.. .Token result GetTokenInformation hToken TokenInformationClass.TokenStatistics IntPtr.Zero 0 out infoSize.. Marshal.AllocHGlobal infoSize result GetTokenInformation hToken TokenInformationClass.TokenStatistics tokenInfo infoSize out..

Calling CreateProcessAsUser from C#

http://stackoverflow.com/questions/668389/calling-createprocessasuser-from-c-sharp

with the following retValue WinApi.CreateProcessWithTokenW hUserToken LogonFlags.WithProfile null this.CommandLine CreationFlags.CREATE_NEW_CONSOLE.. for both the CreateProcessWithLogonW and CreateProcessWithTokenW functions. I guess it finally just hit me that the W suffix.. true public static extern bool CreateProcessWithTokenW IntPtr hToken LogonFlags dwLogonFlags string lpApplicationName..