Tech Support > Microsoft Windows > Drivers > scsi miniports DriverEntry is called but on other function...
scsi miniports DriverEntry is called but on other function...
Posted by Mike on August 12th, 2004


Hi folks,

i am writing a scsi miniport driver for a pcmcia flashcard. The drivers
DriverEntry() function is called as soon as a pccard is plugged in. (Thats why
i assume the driver is installed correct.)
DriverEntry() return the value zero which is returned by ScsiPortInitialize().
After DriverEntry() has been called, no other function is called but the device
appears with the message " This device cannot start. (Code 10) " in the device
manager.

So the question is: Why does'nt the system call HwFindAdapter() after the
driver service has been started?
Please let me know if you have any ideas.
Thanks in advance,
Mike

Posted by Maxim S. Shatskih on August 12th, 2004


You must have 1 ScsiPortInitialize call for each INTERFACE_TYPE you
support. Be sure to specify the PCMCIA interface type at least once in these
calls.

Also read MSDN article of "Registry Entries for Plug and Play SCSI Miniport
Drivers". The miniport must have some registry stuff, and will be inoperable
without it in exactly the way you're observing.

If the registry is set up correctly - then HwScsiFindAdapter will be called
with non-NULL hardware resources, which were derived from PnP MN_START_DEVICE
and are the resources you need to save and use.

The old non-PnP style of HwScsiFindAdapter is - it is called with NULL
hardware resources, must do the scan for its hardware itself and fill the
resource descriptors. It must also support scanning for several possible
hardware "locations", thus the *Again parameter (not used for PnP).

--
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
maxim@storagecraft.com
http://www.storagecraft.com

"Mike" <xfire666@gmx.ch> wrote in message
news:c341f6b9.0408120133.36b7c22a@posting.google.c om...


Posted by Mike on August 13th, 2004


Hi Maxim,
thank you verry much for your advice!

I was not yet able to get the driver started, but i've discovered some
interresting debug messages that i can't find any information about:


01 UMPNPMGR: Processing DeviceInstallEvent for
PCMCIA\UNKNOWN_MANUFACTURER-0000\1
02 [Info][SdbGetDatabaseMatch ] Looking for
"\SystemRoot\System32\DRIVERS\myffs.sys"
03 [Info][SdbGetIndex ] index 0x7007(0x600b) was not found in
the index table
04 [Info][SdbpSearchDB ] SdbFindFirstStringIndexedTag failed to
locate exe: "myffs.sys".
05 [Info][SdbGetIndex ] index 0x7007(0x600b) was not found in
the index table
06 *** MyFFS MiniPort Driver - DriverEntry()
07 ScsiPort: SpAllocateDriverExtension: Allocating extension for
driver \Driver\myffs
08 ScsiPort: SpAllocateDriverExtension: Driver has 1 interface entries
09 ScsiPort: SpAllocateDriverExtension: Driver extension will be 64
bytes
10 ScsiPort: SpAllocateDriverExtension: Interface 8 has flags 0x000001
11 ScsiPort: SpQueryPnpInterfaceFlags: interface 8 has flags 0x000001
12 *** MyFFS MiniPort Driver - DriverEntry() exit with Status: 0x0


Some background info:
MyFFS.sys is the driver which should be used for devices with a device
identification string of PCMCIA\UNKNOWN_MANUFACTURER-0000.

The message in line 4 (SdbFindFirstStringIndexedTag failed to locate
exe)
is the most interresting because the drivers executeable file is
present
in \SystemRoot\System32\DRIVERS\myffs.sys and the messages in line 6
and
line 12 are outputs from DriverEntry at myffs.sys.


Please let me know if you have any advice why my miniport driver gets
loaded
but not startet.
Thanks in advance,
Mike.