Share via


SecurityWin32Util.CreateProcessAsUser Method (IntPtr, String, StringBuilder, SecurityWin32Util., SecurityWin32Util., Boolean, UInt32, IntPtr, String, SecurityWin32Util., SecurityWin32Util.)

Namespace:  Microsoft.Office.Excel.Server.Addins.ComputeCluster.Security
Assembly:  Microsoft.Office.Excel.Server.Addins.ComputeCluster (in Microsoft.Office.Excel.Server.Addins.ComputeCluster.dll)

Syntax

'Declaration
Public Shared Function CreateProcessAsUser ( _
    hToken As IntPtr, _
    lpApplicationName As String, _
    lpCommandLine As StringBuilder, _
    ByRef lpProcessAttributes As SECURITY_ATTRIBUTES, _
    ByRef lpThreadAttributes As SECURITY_ATTRIBUTES, _
    bInheritHandles As Boolean, _
    dwCreationFlags As UInteger, _
    lpEnvironment As IntPtr, _
    lpCurrentDirectory As String, _
    ByRef lpStartupInfo As STARTUPINFO, _
    <OutAttribute> ByRef lpProcessInformation As PROCESS_INFORMATION _
) As Boolean
'Usage
Dim hToken As IntPtr
Dim lpApplicationName As String
Dim lpCommandLine As StringBuilder
Dim lpProcessAttributes As SECURITY_ATTRIBUTES
Dim lpThreadAttributes As SECURITY_ATTRIBUTES
Dim bInheritHandles As Boolean
Dim dwCreationFlags As UInteger
Dim lpEnvironment As IntPtr
Dim lpCurrentDirectory As String
Dim lpStartupInfo As STARTUPINFO
Dim lpProcessInformation As PROCESS_INFORMATION
Dim returnValue As Boolean

returnValue = SecurityWin32Util.CreateProcessAsUser(hToken, _
    lpApplicationName, lpCommandLine, _
    lpProcessAttributes, lpThreadAttributes, _
    bInheritHandles, dwCreationFlags, _
    lpEnvironment, lpCurrentDirectory, _
    lpStartupInfo, lpProcessInformation)
public static bool CreateProcessAsUser(
    IntPtr hToken,
    string lpApplicationName,
    StringBuilder lpCommandLine,
    ref SECURITY_ATTRIBUTES lpProcessAttributes,
    ref SECURITY_ATTRIBUTES lpThreadAttributes,
    bool bInheritHandles,
    uint dwCreationFlags,
    IntPtr lpEnvironment,
    string lpCurrentDirectory,
    ref STARTUPINFO lpStartupInfo,
    out PROCESS_INFORMATION lpProcessInformation
)

Parameters

  • lpProcessAttributes
    Type: SECURITY_ATTRIBUTES
  • lpThreadAttributes
    Type: SECURITY_ATTRIBUTES
  • lpStartupInfo
    Type: STARTUPINFO
  • lpProcessInformation
    Type: PROCESS_INFORMATION

Return Value

Type: System.Boolean

See Also

Reference

SecurityWin32Util Class

SecurityWin32Util Members

CreateProcessAsUser Overload

Microsoft.Office.Excel.Server.Addins.ComputeCluster.Security Namespace