Windows System Software -- Consulting, Training, Development -- Unique Expertise, Guaranteed Results

Home NTDEV

Before Posting...

Please check out the Community Guidelines in the Announcements and Administration Category.

More Info on Driver Writing and Debugging


The free OSR Learning Library has more than 50 articles on a wide variety of topics about writing and debugging device drivers and Minifilters. From introductory level to advanced. All the articles have been recently reviewed and updated, and are written using the clear and definitive style you've come to expect from OSR over the years.


Check out The OSR Learning Library at: https://www.osr.com/osr-learning-library/


CreateProcess and consoles

OSR_Community_UserOSR_Community_User Member Posts: 110,217
What is the difference between using CREATE_NEW_CONSOLE and
DETACHED_PROCESS flags to CreateProcess?

Comments

  • OSR_Community_UserOSR_Community_User Member Posts: 110,217
    CREATE_NEW_CONSOLE creates a process with a new console, instead of
    inheriting the parent console. DETACHED_PROCESS creates a new process that
    does not have access to the parent process console - AllocConsole can be
    called later to create a new console.

    Jim

    -----Original Message-----
    From: [email protected]
    [mailto:[email protected]]On Behalf Of Phillip Susi
    Sent: Thursday, April 20, 2000 4:50 PM
    To: NT Developers Interest List
    Subject: [ntdev] CreateProcess and consoles


    What is the difference between using CREATE_NEW_CONSOLE and
    DETACHED_PROCESS flags to CreateProcess?


    ---
    You are currently subscribed to ntdev as: [email protected]
    To unsubscribe send a blank email to $subst('Email.Unsub')
  • OSR_Community_UserOSR_Community_User Member Posts: 110,217
    Right, but how does the effect differ? If you create a detached process,
    the new process is going to allocate a console anyway ( assuming it is a
    win32 console process ) so why would you use one instead of another?

    At 09:09 PM 4/20/00 -0700, you wrote:
    >CREATE_NEW_CONSOLE creates a process with a new console, instead of
    >inheriting the parent console. DETACHED_PROCESS creates a new process that
    >does not have access to the parent process console - AllocConsole can be
    >called later to create a new console.
    >
    >Jim
    >
    >-----Original Message-----
    >From: [email protected]
    >[mailto:[email protected]]On Behalf Of Phillip Susi
    >Sent: Thursday, April 20, 2000 4:50 PM
    >To: NT Developers Interest List
    >Subject: [ntdev] CreateProcess and consoles
    >
    >
    >What is the difference between using CREATE_NEW_CONSOLE and
    >DETACHED_PROCESS flags to CreateProcess?
    >
    >
    >---
    >You are currently subscribed to ntdev as: [email protected]
    >To unsubscribe send a blank email to $subst('Email.Unsub')
    >
    >
    >
    >---
    >You are currently subscribed to ntdev as: [email protected]
    >To unsubscribe send a blank email to $subst('Email.Unsub')
  • OSR_Community_UserOSR_Community_User Member Posts: 110,217
    DETACHED_PROCESS does not automatically create a new console,
    CREATE_NEW_CONSOLE does. One may want to create a process without a console.

    Jim

    -----Original Message-----
    From: [email protected]
    [mailto:[email protected]]On Behalf Of Phillip Susi
    Sent: Thursday, April 20, 2000 9:16 PM
    To: NT Developers Interest List
    Subject: [ntdev] RE: CreateProcess and consoles


    Right, but how does the effect differ? If you create a detached process,
    the new process is going to allocate a console anyway ( assuming it is a
    win32 console process ) so why would you use one instead of another?

    At 09:09 PM 4/20/00 -0700, you wrote:
    >CREATE_NEW_CONSOLE creates a process with a new console, instead of
    >inheriting the parent console. DETACHED_PROCESS creates a new process that
    >does not have access to the parent process console - AllocConsole can be
    >called later to create a new console.
    >
    >Jim
    >
    >-----Original Message-----
    >From: [email protected]
    >[mailto:[email protected]]On Behalf Of Phillip Susi
    >Sent: Thursday, April 20, 2000 4:50 PM
    >To: NT Developers Interest List
    >Subject: [ntdev] CreateProcess and consoles
    >
    >
    >What is the difference between using CREATE_NEW_CONSOLE and
    >DETACHED_PROCESS flags to CreateProcess?
    >
    >
    >---
    >You are currently subscribed to ntdev as: [email protected]
    >To unsubscribe send a blank email to $subst('Email.Unsub')
    >
    >
    >
    >---
    >You are currently subscribed to ntdev as: [email protected]
    >To unsubscribe send a blank email to $subst('Email.Unsub')


    ---
    You are currently subscribed to ntdev as: [email protected]
    To unsubscribe send a blank email to $subst('Email.Unsub')
  • OSR_Community_UserOSR_Community_User Member Posts: 110,217
    Once again,I understand this, but it seems like it is only a semantic
    diference, as if you create a process with no console, it is likely to
    create one anyway. If the process does not create a console ( i.e. it is a
    win32 gui app ) then what happens to the one that was created with
    CREATE_NEW_CONSOLE?


    At 09:39 PM 4/20/00 -0700, you wrote:
    >DETACHED_PROCESS does not automatically create a new console,
    >CREATE_NEW_CONSOLE does. One may want to create a process without a console.
    >
    >Jim
    >
    >-----Original Message-----
    >From: [email protected]
    >[mailto:[email protected]]On Behalf Of Phillip Susi
    >Sent: Thursday, April 20, 2000 9:16 PM
    >To: NT Developers Interest List
    >Subject: [ntdev] RE: CreateProcess and consoles
    >
    >
    >Right, but how does the effect differ? If you create a detached process,
    >the new process is going to allocate a console anyway ( assuming it is a
    >win32 console process ) so why would you use one instead of another?
    >
    >At 09:09 PM 4/20/00 -0700, you wrote:
    > >CREATE_NEW_CONSOLE creates a process with a new console, instead of
    > >inheriting the parent console. DETACHED_PROCESS creates a new process that
    > >does not have access to the parent process console - AllocConsole can be
    > >called later to create a new console.
    > >
    > >Jim
    > >
    > >-----Original Message-----
    > >From: [email protected]
    > >[mailto:[email protected]]On Behalf Of Phillip Susi
    > >Sent: Thursday, April 20, 2000 4:50 PM
    > >To: NT Developers Interest List
    > >Subject: [ntdev] CreateProcess and consoles
    > >
    > >
    > >What is the difference between using CREATE_NEW_CONSOLE and
    > >DETACHED_PROCESS flags to CreateProcess?
    > >
    > >
    > >---
    > >You are currently subscribed to ntdev as: [email protected]
    > >To unsubscribe send a blank email to $subst('Email.Unsub')
    > >
    > >
    > >
    > >---
    > >You are currently subscribed to ntdev as: [email protected]
    > >To unsubscribe send a blank email to $subst('Email.Unsub')
    >
    >
    >---
    >You are currently subscribed to ntdev as: [email protected]
    >To unsubscribe send a blank email to $subst('Email.Unsub')
    >
    >
    >---
    >You are currently subscribed to ntdev as: [email protected]
    >To unsubscribe send a blank email to $subst('Email.Unsub')
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. Sign in or register to get started.

Upcoming OSR Seminars
OSR has suspended in-person seminars due to the Covid-19 outbreak. But, don't miss your training! Attend via the internet instead!
Writing WDF Drivers 12 September 2022 Live, Online
Internals & Software Drivers 23 October 2022 Live, Online
Kernel Debugging 14 November 2022 Live, Online
Developing Minifilters 5 December 2022 Live, Online