(NT-)VDD blocks VDM: How to circumvent, and how to perform "secure" cleanup?

Discussion in 'Windows Vista Drivers' started by Spiro Trikaliotis, Jan 8, 2005.

  1. Hello,

    I'm writing a VDD (for NT/2K/XP) for the first time, and I found the
    documentation is not the verbose as I would like it to be.

    I'm using the mechanism via DISPATCHCALL (assembler bytes 0xc4, 0xc4,
    0x58, 0x02) emmitted into the source code, not via IN/OUT instruction
    (although, by testing, I found out the same applies for these, too).

    I faced the following problems:

    The DOS program in the DOS box calls a function of the VDD. Now, that
    function needs some time to perform the action. As long as the VDD
    function has not returned, the DOS box is completely blocked. I cannot
    even issue a Ctrl+C (or Ctrl+Break) to stop the program.

    This is very bad with programs which need to communicate very much with
    the VDD: I found out it is almost impossible to stop the DOS mode
    program at all (other than closing the whole DOS window).


    Another problem I faced is the following: I want to know when the DOS
    mode program quits, to close the "access handle" the DOS program
    obtained from me, that is, to do some cleanup if the DOS program forgot
    to do this itself (for example, if it unexpectedly crashed). Anyway, I'm
    not sure how to do this reliably.

    Currently, I use VDDInstallUserHook() to install a Block handler, that
    is, I am informed if the NTVDM is blocked. I found out that this happens
    if the DOS program quits.

    Anyway, is this really a reliable (and a recommended) way? First of all,
    I thought installing a create and a termination handler with the same
    function would be better, as I could find out if it is exactly the
    DOS program which obtained the handler which is quit. Anyway, as the VDD
    is started with RegisterModule (0xc4, 0xc4, 0x58, 0x00) from the DOS
    program, I do not "see" the creation of the DOS program, so I do not
    know for which PCB to wait for.

    Can anyone help me here?

    Thank you,
    Spiro.
     
    Spiro Trikaliotis, Jan 8, 2005
    #1
    1. Advertisements

  2. Spiro Trikaliotis

    Pavel A. Guest

    Could you please provide more details?
    How you run the dos program - thru it's own PIF or a generic PIF,
    what the VDD does and so on.

    Regards
    --PA
     
    Pavel A., Jan 9, 2005
    #2
    1. Advertisements

  3. Hello,

    sorry, just a late reply, I was not reading here because I was busy with
    other problems.

    The DOS program is run without any (specific) PIF. It is just compiled
    on a DOS machine, copied over, and started.

    The VDD does nothing more than just sitting there and wait. A test
    version of it just issues a Sleep(5), and the function is called from
    the DOS box over and over again. My only possibility to stop the DOS
    program is to kill the window.

    Regards,
    Spiro.
     
    Spiro Trikaliotis, Jan 15, 2005
    #3
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.