Solved

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

Posted on 1997-03-26
5
282 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

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

In this article, I will show how to use the Ribbon IDs Tool Window to assign the built-in Office icons to a ribbon button.  This tool will help us to find the OfficeImageId that corresponds to our desired built-in Office icon. The tool is part of…
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…
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…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

623 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