Solved

migrate VXD driver to W2000/NT/XP

Posted on 2002-06-15
8
274 Views
Last Modified: 2013-12-03
I have inherited some code which uses CreateFile on
a *.vxd file and then does a bunch of DeviceIOControl calls.  This is to read a compact flash card that is in an adaptor in a PCMCIA slot.  Works on W98.

Since *.vxd is not supported on W2000/NT/XP I need to find a way to get this going.  How, in general, do people migrate from *.vxd technology to the modern OS's?
I guess now one needs a 'kernel mode driver'?  

I'm not a driver writer, so am I looking at a nightmare?

0
Comment
Question by:tullhead
  • 3
  • 3
8 Comments
 
LVL 32

Accepted Solution

by:
jhance earned 50 total points
ID: 7080817
VxDs are specifically a Windows 95/98/ME thing and they are NOT portable to NT/2000/XP in any way, shape, or form.

You must start over and build a WDM (Windows Driver Model) for your W2K and XP systems and a NT4 (.sys) driver if you plan on supporting NT4.  Yes, this is a real pain but that's Microsoft for you.

Indeed, this entire subject is literally a nightmare.  There is absolutely no way to get by with fewer than 3 different drivers if you need to support the entire spectrum of WIN32 platforms.

My advice would be to scrap NT4 support and focus on 2000 and XP.  The WDM model supports these (as well as Win98/ME in a slightly modified form) so in theory you can probably write one source file and two builds (2000/XP and 98/ME) for your WDM driver and cover the range of currently supported (by MS) Windows versions.  To get Win95 you actually should still be able to use your VxD and that leaves NT4 as the "odd man".  It has it's own driver model and doesn't support WDM or VxDs.

You may want to consider Walter Oney's fine book, Programming the Windows Driver Model.  Even if you don't plan on doing this work yourself, it will give you a good background on what you need to know to farm it out.

Good luck.  This is a nasty problem.
0
 

Author Comment

by:tullhead
ID: 7080935
In the existing code a *.vxd driver is loaded up (with a CreateFile command) and then is talked to with DeviceIOControl commands.  I believe its also the case that a WDM driver might be handled the same way?  That is, and application using the driver would use a CreateFile command on the driver, and then "talk to it" with DeviceIOControl commands -- is that correct?

I don't want to write the WDM driver -- it must exist -- I want to talk to it, somehow similar to how the applciation talked to the *.vxd driver.

Is there any chance that the nature of communication with a modern WDM driver would take the same shape as the with the old *.vxd driver?

0
 
LVL 32

Expert Comment

by:jhance
ID: 7081503
DeviceIoControl() is the typical way in which an application talks to a driver.  

So it seems possible that you could implement a NEW driver for your new version of Windows that would behave essentially like your old VxD and could minimize the changes required in your application.

I'm confused by your statement:

"I don't want to write the WDM driver -- it must exist -- I want to talk to it, somehow similar to how
the applciation talked to the *.vxd driver."

Why MUST it exist?  Who has written such a thing?  And if they have, why don't you get from THEM the information on how to talk to it?  If this is a 3rd party driver there is NO guarantee that backward compatibility was among their priorities and so you could well be out of luck.

BTW, generally CF cards do not need to be talked to as generic devices.  Usually the vendor supplied driver implements them as a removable disk I/O device.  And since that interface is relatively standardized you may be in good shape here.  What I don't understand is what this VxD you're talking about does.  I understood from the question that this VxD was your (or your company's) doing.  But it seems that this is not the case.

Why don't you contact the manufacturer and get information on how to interface with their driver?  
0
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 

Author Comment

by:tullhead
ID: 7081960
Thanks jhance for the time you've already spent on this...

The eixsting driver talks to a CF card, so I think perhaps some company like sandsik wrote it (but not sure - sorry I "inherited" this code a project without much data -- I'm trying to get in contact with a former developer -- my company bought the assets of a former company and this landed on my desk).  

Now I just bought a sandisk card reader (USB) and plugged it into my XP system.  How can I find out about the driver that must have just been installed with that device?  I guess it must be WDM.  Will sandisk tell me how to talk to it?  Then I could adapt the application to talk to this driver.  Looking on sandisk's website didn't get me too far.  Perhaps I'll send them an e-mail in hopes of finding some tech help...  What do you think?
0
 
LVL 32

Expert Comment

by:jhance
ID: 7082030
The SanDisk USB card interfact unit is most certainly a WDM driver.  The issue is whether or not the card you HAVE will work with the way the SanDisk is expecting it to work.

This is a bit like putting a MacOS floppy in a Windows box.  Yes, the disks themselves are identical but the filesystem is radically different and Windows does NOT understand the MacOS floppy format without a 3rd party driver that does understand it.

You might be lucky but I'm afraid that the "standards" for storing data on CompactFlash and similar devices are somewhat loose.
0
 

Author Comment

by:tullhead
ID: 7082195
Here's a clue.  I have a CF card which the old applciation will read just fine (if its in an adaptor and stuck in a PCMCIA slot on a W95/W98 laptop).  I take that CF card and plug it into my sandisk CF card reader and read off the file.  It is some big *.PIB file -- some proprietary format it seems.  Windows says the CF is formated as FAT, but who knows if it is, or if Windows just assumes this, or is confused.  But in any case, I seem to be able to move the fileoff of it and onto my sytem.

Now I copy that file onto another CF card.  Now I put that card into the adaptor and into the PCMCIA slot and plug into the W98 machine.  Now the app can't read it.

What does this tell us?  I guess it tells us that the data on the CF gets garbled when windows copies it around, treating it as a windows FAT style file?  And that is also why my other experiments to read thru this file looking for 'eVS' (which is supposed to be on there) fail.

So, now my guess is that the data on the card is in some truly bizzare format, and a custom driver is needed to extract the data.
0
 
LVL 2

Expert Comment

by:ivi
ID: 7127009
As far as you are not driver writer, then only way to solve your problem is:

- find the driver writer
- provide your VxD source code

In this case (I'm sure) the driver write can write the WDM driver which will allow to keep your application (almost) unchanged.
0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
how to bring to back always mid parent image form 21 81
Messagebox for a Web Site Application 4 71
Problem to file 3 75
Microsoft C++ code failing in executable that worked 9 99
This article surveys and compares options for encoding and decoding base64 data.  It includes source code in C++ as well as examples of how to use standard Windows API functions for these tasks. We'll look at the algorithms — how encoding and decodi…
After several hours of googling I could not gather any information on this topic. There are several ways of controlling the USB port connected to any storage device. The best example of that is by changing the registry value of "HKEY_LOCAL_MACHINE\S…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
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…

777 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