Solved

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

Posted on 1997-03-26
5
267 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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

This article describes a technique for converting RTF (Rich Text Format) data to HTML and provides C++ source that does it all in just a few lines of code. Although RTF is coming to be considered a "legacy" format, it is still in common use... po…
What my article will show is if you ever had to do processing to a listbox without being able to just select all the items in it. My software Visual Studio 2008 crystal report v11 My issue was I wanted to add crystal report to a form and show…
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…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

762 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now