Search
Module:
Directory

   Desktop Functions:

   Smart Device Functions:


Show Recent Changes
Subscribe (RSS)
Misc. Pages
Comments
FAQ
Helpful Tools
Playground
Suggested Reading
Website TODO List
Support Forum
Download Visual Studio Add-In

Terms of Use
Privacy Policy

Search Results for "STARTUPINFO" in [All]

kernel32

.

   [In] ref STARTUPINFO lpStartupInfo,

.

    <[In]> ByRef lpStartupInfo As STARTUPINFO, _

.

STARTUPINFO, PROCESS_INFORMATION, SECURITY_ATTRIBUTES, STARTUPINFOEX

.

Replace STARTUPINFO with STARTUPINFOEX to use UpdateProcThreadAttribute and extend CreateProcess. Make sure you include the flag EXTENDED_STARTUPINFO_PRESENT (0x00080000)

.

     STARTUPINFO sInfo = new STARTUPINFO();

.

     Dim sInfo As STARTUPINFO = New STARTUPINFO()

.
Summary
.

static extern void GetStartupInfo(out STARTUPINFO lpStartupInfo);

.

Declare Sub GetStartupInfo Lib "kernel32.dll" (<Out> ByRef As STARTUPINFO)

.

STARTUPINFO

.

On my W10x64 my vshost.exe died by caling the GetStartupInfoW method.

.

So i changed it to GetStartupInfoA and also changed the 'STARTUPINFO's StructureLayout-Attribute to CharSet.Ansi instead of Unicode.

.

    public struct STARTUPINFO

.

     [DllImport("kernel32.dll", SetLastError = true, EntryPoint = "GetStartupInfoA")]

.

     public static extern void GetStartupInfo(out STARTUPINFO lpStartupInfo);

.
Documentation
[GetStartupInfo] on MSDN
.

Save the attribute list to the STARTUPINFOEX struct, use UpdateProcThreadAttribute to fill in the now-reserved attribute entries.

.

        flags = flags | EXTENDED_STARTUPINFO_PRESENT;

.

        startupInfoEx.lpAttributeList = InitializeProcThreadAttributeList(attributeCount);

.

    and [STARTUPINFOEX]

.

Call InitializeProcThreadAttributeList before adding attributes. Save the result to a STARTUPINFOEX struct.

.

private static void SetNewProcessParent(ref STARTUPINFOEX startupInfoEx, int parentProcessId)

.

        startupInfoEx.lpAttributeList,

.

    private static void SetInheritableHandles(ref STARTUPINFOEX startupInfoEx, ICollection<IntPtr> inheritableHandles)

.

        startupInfoEx.lpAttributeList,

advapi32

.

    ref STARTUPINFO lpStartupInfo,

.

    ByRef lpStartupInfo As STARTUPINFO, _

.

                           <[In]()> ByRef lpStartupInfo As StartupInfo, _

.

STARTUPINFO

.

STARTUPINFO si;

.

Dim si As STARTUPINFO

.

     ref  StartupInfo       startupInfo,

.

    Public Function CreateProcessWithLogonW(ByVal userName As String, ByVal domain As String, ByVal password As String, ByVal logonFlags As UInt32, ByVal applicationName As String, ByVal commandLine As String, ByVal creationFlags As UInt32, ByVal environment As UInt32, ByVal currentDirectory As String, ByRef startupInfo As StartupInfo, ByRef processInformation As ProcessInformation) As Boolean

.

    Public Structure StartupInfo

.

    End Structure 'StartupInfo

.

    Public Function CreateProcessWithLogonW(ByVal userName As String, ByVal domain As String, ByVal password As String, ByVal logonFlags As UInt32, ByVal applicationName As String, ByVal commandLine As String, ByVal creationFlags As UInt32, ByVal environment As UInt32, ByVal currentDirectory As String, ByRef startupInfo As StartupInfo, ByRef processInformation As ProcessInformation) As Boolean

.

    Dim startupInfo As New StartupInfo

.

    startupInfo.reserved = Nothing

.

    startupInfo.flags = startupInfo.flags And Startf_UseStdHandles

.

    startupInfo.stdOutput = MyPointer  

.

    startupInfo.stdError = MyErrorPointer    

.

        currentDirectory, startupInfo, processInfo)

.

STARTUPINFO, PROCESS_INFORMATION

.

        public struct StartupInfo

.

            ref   StartupInfo startupInfo,

.

            StartupInfo startupInfo = new StartupInfo();

.

            startupInfo.reserved = null;

.

            startupInfo.flags &= Startf_UseStdHandles;

.

            startupInfo.stdOutput = (IntPtr)StdOutputHandle;

.

            startupInfo.stdError = (IntPtr)StdErrorHandle;

.

                    ref startupInfo,

.

        EXTENDED_STARTUPINFO_PRESENT = 0x00080000,

.

        EXTENDED_STARTUPINFO_PRESENT    = 0x00080000,

.

    EXTENDED_STARTUPINFO_PRESENT = &H80000

coredll

.

    IntPtr lpStartupInfo,

.

public struct StartupInfo

.

StartupInfo si; // no new required since StartupInfo is a value type (struct) - StartupInfo not supported by the .NET Compact Framework

Structures

.

public static extern bool CreateProcessWithTokenW(IntPtr hToken, LogonFlags dwLogonFlags, string lpApplicationName, string lpCommandLine, CreationFlags dwCreationFlags, IntPtr lpEnvironment, string lpCurrentDirectory, [In] ref STARTUPINFO lpStartupInfo, out PROCESS_INFORMATION lpProcessInformation);

.

    Public Shared Function CreateProcessWithTokenW(hToken As IntPtr, dwLogonFlags As Integer, lpApplicationName As String, lpCommandLine As String, dwCreationFlags As Integer, lpEnvironment As IntPtr, lpCurrentDirectory As IntPtr, ByRef lpStartupInfo As STARTUPINFO, ByRef lpProcessInformation As PROCESS_INFORMATION) As Boolean

.

    ExtendedStartupInfoPresent = 0x00080000

.
Summary
.

public struct STARTUPINFOEX

.

     public STARTUPINFO StartupInfo;

.

struct STARTUPINFO

.

// If you are using this with [GetStartupInfo], this definition works without errors.

.

struct STARTUPINFO

.

Public Structure STARTUPINFOEX

.

   Public StartupInfo As STARTUPINFO

.

  Public Structure STARTUPINFO

.

        startupInfoEx.StartupInfo.cb = Marshal.SizeOf(startupInfoEx);

.
Documentation
[STARTUPINFOEX] on MSDN
.
Summary
.

public struct STARTUPINFOEX

.

     public STARTUPINFO StartupInfo;

.

Structure STARTUPINFOEX

.

        startupInfoEx.StartupInfo.cb = Marshal.SizeOf(startupInfoEx);

.
Documentation
[STARTUPINFOEX] on MSDN

Enums

.

    /// STARTUPINFO structure passed to the CreateProcess function by the

.

    ''' STARTUPINFO structure passed to the CreateProcess function by the

13: STARTF
. .
Summary

Constants

.

const uint EXTENDED_STARTUPINFO_PRESENT     = 0x00080000;


 
Access PInvoke.net directly from VS: