C# Class BelhardTraining.LessonMultithreading.ProccessIntegrityLevelHelper

Afficher le fichier Open project: bazile/Training

Méthodes publiques

Méthode Description
CreateLowIntegrityProcess ( string commandLine ) : void

The function launches an application at low integrity level.

To start a low-integrity process, 1) Duplicate the handle of the current process, which is at medium integrity level. 2) Use SetTokenInformation to set the integrity level in the access token to Low. 3) Use CreateProcessAsUser to create a new process using the handle to the low integrity access token.

GetCurrentProcessIntegrityLevel ( ) : IntegrityLevel
GetProcessIntegrityLevel ( IntPtr processHandle ) : IntegrityLevel

Method Details

CreateLowIntegrityProcess() public static méthode

The function launches an application at low integrity level.
To start a low-integrity process, 1) Duplicate the handle of the current process, which is at medium integrity level. 2) Use SetTokenInformation to set the integrity level in the access token to Low. 3) Use CreateProcessAsUser to create a new process using the handle to the low integrity access token.
public static CreateLowIntegrityProcess ( string commandLine ) : void
commandLine string /// The command line to be executed. The maximum length of this string is 32K /// characters. ///
Résultat void

GetCurrentProcessIntegrityLevel() public static méthode

public static GetCurrentProcessIntegrityLevel ( ) : IntegrityLevel
Résultat IntegrityLevel

GetProcessIntegrityLevel() public static méthode

public static GetProcessIntegrityLevel ( IntPtr processHandle ) : IntegrityLevel
processHandle System.IntPtr
Résultat IntegrityLevel