Thread View: comp.os.ms-windows.programmer.win32
4 messages
4 total messages
Started by Ran
Mon, 26 Apr 2004 14:15
Running a PIF file using CreateProcess in an allocated console window
Author: Ran
Date: Mon, 26 Apr 2004 14:15
Date: Mon, 26 Apr 2004 14:15
39 lines
2344 bytes
2344 bytes
Hello, I am trying to find a way to execute a pif file within the context of my own application's console using AllocConsole. My basic need is to have the console in my context so I can use the console API's AND I must use the pif parameters for EMS, XMS, and a few other parameters. Is there a way to do this ? Is there a way around ? For example, try running "start /b XX.pif" I am getting an error message The NTVDM CPU has encountered an illegal instruction. and get the Close Ignore buttons. This is not related to any problems in the DOS application. If I use CREATE_NEW_CONSOLE in the creation flags, ofcourse everything works, but it is open in a new window. in the allocated console window I always get this GPF. Is there a way to get the console window in my context after the OS created it ? I can change _default.pif and just execute cmd.exe but I do not want to be dependant on _default.pif because of multiple executions issue. _default.pif is is hardcoded into ntvdm.exe. How can I allocconsole, run CMD with PIF settings ? and no _default.pif? Help ? Thanks for your time, Ran.
Re: Running a PIF file using CreateProcess in an allocated console window
Author: Olof Lagerkvist
Date: Mon, 26 Apr 2004 15:27
Date: Mon, 26 Apr 2004 15:27
52 lines
3378 bytes
3378 bytes
Ran wrote:
> Hello,
>
> I am trying to find a way to execute a pif file within the context of
> my own application's console using AllocConsole.
>
> My basic need is to have the console in my context so I can use the
> console API's AND I must use the pif parameters for EMS, XMS, and a
> few other parameters.
>
> Is there a way to do this ? Is there a way around ?
>
> For example, try running "start /b XX.pif"
>
> I am getting an error message
>
> The NTVDM CPU has encountered an illegal instruction.
> and get the Close Ignore buttons.
>
> This is not related to any problems in the DOS application.
>
> If I use CREATE_NEW_CONSOLE in the creation flags, ofcourse everything
> works,
> but it is open in a new window. in the allocated console window I
> always get this GPF.
>
> Is there a way to get the console window in my context after the OS
> created it ?
>
> I can change _default.pif and just execute cmd.exe but I do not want
> to be dependant on _default.pif because of multiple executions issue.
> _default.pif is is hardcoded into ntvdm.exe.
> How can I allocconsole, run CMD with PIF settings ? and no
> _default.pif?
After AllocConsole() you need to get the handles to the console I/O and
set them as standard input/output/error so that the new process can
inherit the console I/O handles.
Use CreateFile("conin$", ...) and CreateFile("conout$", ...) as
described in CreateFile() documentation. Make sure the handles get
inheritable. Then pass the handles you get to SetStdHandle().
As an alternative you can skip the three SetStdHandle() calls and
instead pass the handles to the new process in the STARTUPINFO structure
passed to CreateProcess().
--
Olof Lagerkvist
ICQ: 724451
Web page: http://here.is/olof
Re: Running a PIF file using CreateProcess in an allocated console window
Author: Bob Masta
Date: Tue, 27 Apr 2004 12:33
Date: Tue, 27 Apr 2004 12:33
23 lines
1931 bytes
1931 bytes
On 26 Apr 2004 07:15:18 -0700, ran_tao@netvision.net.il (Ran) wrote:
>Hello,
>
>I am trying to find a way to execute a pif file within the context of
>my own application's console using AllocConsole.
>
>My basic need is to have the console in my context so I can use the
>console API's AND I must use the pif parameters for EMS, XMS, and a
>few other parameters.
>
Are there still such things as EMS and XMS still lurking under
Windows? I always thought they were just for 16-bit DOS
applications. (Or are you trying to run DOS applications?)
Bob Masta
dqatechATdaqartaDOTcom
D A Q A R T A
Data AcQuisition And Real-Time Analysis
www.daqarta.com
Re: Running a PIF file using CreateProcess in an allocated console window
Author: Olof Lagerkvist
Date: Tue, 27 Apr 2004 13:00
Date: Tue, 27 Apr 2004 13:00
31 lines
2558 bytes
2558 bytes
Bob Masta wrote: > On 26 Apr 2004 07:15:18 -0700, ran_tao@netvision.net.il (Ran) wrote: > > >>Hello, >> >>I am trying to find a way to execute a pif file within the context of >>my own application's console using AllocConsole. >> >>My basic need is to have the console in my context so I can use the >>console API's AND I must use the pif parameters for EMS, XMS, and a >>few other parameters. >> > > > Are there still such things as EMS and XMS still lurking under > Windows? I always thought they were just for 16-bit DOS > applications. (Or are you trying to run DOS applications?) He is talking about PIF files and such files are only used to run DOS applications... There is nothing like EMS and XMS in 32-bit Windows but it is emulating this to 16-bit DOS applications. The settings for the emulations are stored in PIF files. -- Olof Lagerkvist ICQ: 724451 Web page: http://here.is/olof
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads