Solved

How to read MSDOS-SCREEN under WinNT4 - W32 APP ?

Posted on 1997-03-26
5
274 Views
Last Modified: 2013-12-03
I am trying to read the screen of an MS-DOS session ( 80x25 textmode ) under WINDOWS NT4 from a WIN32 application..

I took a look at the MSDN library for several hours and figured out the
following way:

1. start a little program in the MS-DOS session. This Program generates an GP-failure due to an unauthorized hardware access.

2. This GP-failure is handeled by a self-written VDD - dll.
The handler routine of the VDD knows the address of the MSDOS session and forwards this address to a ´normal´ kernel mode driver via DeviceIOControl.

3. Now a normal windows - application can use the kernel-mode driver to access the memory of the MS-DOS session (also via DeviceIOControl), because the kernel-mode driver knows the address of the MS-DOS session an has got full access to this memory-area (?).

I have got 2 questions:

  1) Is there an easier way to access the MSDOS-Session via      a WIN32 programm ?

  2) If not - what do you think about my solution ? Can this      work ?
0
Comment
Question by:fmenne
  • 2
  • 2
5 Comments
 

Author Comment

by:fmenne
ID: 1334230
Adjusted points to 100
0
 
LVL 1

Expert Comment

by:ptan
ID: 1334231
There has got to be an easier way than this!!

I've been looking into the console functions, and they seem to have the hooks to be able to do this.  I haven't had the time to pursue this further though.  

However, in the NT4.0 resource kit, there is a RCONSOLE command service, which basically DOES everything we've been trying to do (but it's purpose is to do a remote console).

Therefore, it MUST be possible to do this easily, but the docs are just lacking.

Let me know if you go any further with this.

Paul Tan.
MCSE, MCSD, MCT.
ptan@compudyn.com

0
 
LVL 2

Accepted Solution

by:
mnguyen021997 earned 100 total points
ID: 1334232
if you are looking to peek at the msdos text memory (ie b800 or whatever it is) then the VDD is probably the only way to go, however you don't necessarily need to write a kernel mode driver to get the message to the other window app. you could just use a sendmessage in conjunction with shared memory (mmf  to exchange info between the msdos and the win app). or some other blocking mechanism (mutex, event, semaphore, etc).

if you just want to obtain the output from the dos app, then you can fill the start information structure in CreateProcess with the stdout and/or stdin parameter with your own pipe handles and use peekpipe and read/write pipe to get at the info you need.
0
 
LVL 2

Expert Comment

by:mnguyen021997
ID: 1334234
I already developed such a solution with a Kernel Driver.
Works fine so far, but I cannot addess the video memory....

I use the getVDMpointer to translate the address but I cannot
access the video memory ( normal memory is accessibe ).
I tried the address 0xB8000000 as parameter for getVDMpointer
maybe I should place a memoryaccess-hook on the video memory and
hold my on screen-contents-table.....?
0
 

Author Comment

by:fmenne
ID: 1334235
when you say that you cannot access the b800 what do you mean?  does getvdmpointer return false or does the data at the return memory address contain invalid info??  if the later is the case, then you might check to make sure you are setting the real/protected mode flag of getvdmpointer correctly (does your app run in protected mode?).

placing a memory hook on the address will work but is a pain in the ass to decrypt the assembly instruction to figure out what its trying to put at that address..  i started down that avenue for another project and found it to be both tedious and difficult to debug.  if you've questions then drop me an email at matthew.nguyen@aig.com
0

Featured Post

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article shows how to make a Windows 7 gadget that extends its U/I with a flyout panel -- a window that pops out next to the gadget.  The example gadget shows several additional techniques:  How to automatically resize a gadget or flyout panel t…
Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question