- Device to be opened from a DOS program (i.e., NTVDM)
- Posted by Spiro Trikaliotis on June 21st, 2004
Hello,
currently, I'm trying to modify a driver to be able to be opened from a
legacy DOS program (compiled with Turbo Pascal, if this matters).
Anyway, I can't find a way to do it.
There is a Symbolic Link created, and opening it from a Win32
application works like a charm.
Anyway, if the DOS based program opens the device (with a call to
LongOpenFile('\\.\giveio', F, fmReadOnly)), the call always fails.
Anyway, I can see from the debugger that the device is opened and
immediately closed.
And: Yes, I always return STATUS_SUCESS in response to IRP_MJ_CREATE:
Irp->IoStatus.Information = 0;
Irp->IoStatus.Status = STATUS_SUCCESS;
IoCompleteRequest(Irp, IO_NO_INCREMENT);
return STATUS_SUCCESS;
There is no other return path. I don't have a clue what to do. I thought
that the symbolic link might need to be created somewhere else than in
\DosDevices\, but since the IRP_MJ_CREATE routine is called (as well as
the IRP_MJ_CLOSE routine), I don't know where to search.
I already had a look at how LPTx are created, as they are accessible to
NTVDM programs, too, but I could not find a hint what I am doing wrong.
Any ideas?
Regards,
Spiro.
--
Spiro R. Trikaliotis
http://www.trikaliotis.net/
- Posted by Maxim S. Shatskih on June 21st, 2004
Is your CREATE path at least hit?
--
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
maxim@storagecraft.com
http://www.storagecraft.com
"Spiro Trikaliotis" <news+200406@trikaliotis.net> wrote in message
news:slrncde67q.uds.news+200406@news.trikaliotis.n et...
- Posted by Spiro Trikaliotis on June 21st, 2004
Hello Maxim,
Maxim S. Shatskih <maxim@storagecraft.com> wrote:
you mean the IRP_MJ_CREATE path? Yes, that's what I meant when I said I
can see in the debugger that it is opened and immediately closed. I put
breakpoints in the functions for IRP_MJ_CREATE and IRP_MJ_CLOSE, and I
can see that both are called.
Regards,
Spiro.
--
Spiro R. Trikaliotis
http://www.trikaliotis.net/
- Posted by Maxim S. Shatskih on June 21st, 2004
Maybe the DOS code calls something like GetDriveType or such?
--
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
maxim@storagecraft.com
http://www.storagecraft.com
"Spiro Trikaliotis" <news+200406@trikaliotis.net> wrote in message
news:slrncde8jj.uds.news+200406@news.trikaliotis.n et...
- Posted by Spiro Trikaliotis on June 21st, 2004
Hello,
Maxim S. Shatskih <maxim@storagecraft.com> schrieb:
So, you're telling me that the way to open the driver is correct in
principle?
I don't know what Turbo Pascal calls itself, so I'll try to call it from
C in DOS.
Regards,
Spiro.
--
Spiro R. Trikaliotis
http://www.trikaliotis.net/
- Posted by Maxim S. Shatskih on June 21st, 2004
\\.\name should be correct.
Anyway, if NTVDM will not be able of opening this name - then a VDD is a
solution.
--
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
maxim@storagecraft.com
http://www.storagecraft.com
- Posted by Spiro Trikaliotis on June 22nd, 2004
Hello Maxim,
Maxim S. Shatskih <maxim@storagecraft.com> schrieb:
Thanks for your help!
I did not have control on the DOS site, but someone reported to me that
the open failed.
After debuggin the code myself, I found out that this was not true, it
worked, but the code interpreted the return code wrong and thought it
would have failed.
So, no need to worry, it works as it should work.
Thank you,
Spiro.
--
Spiro R. Trikaliotis
http://www.trikaliotis.net/
http://www.viceteam.org/