Hi folks,
my (first attempt of a) pcmcia scsi miniport driver is driving me insane...
The driver consists of only a DriverEntry() - which initializes a
HW_INITIALIZATION_DATA structure - and a few (empty) functions for the
drivers entry points. (As seen at MSDN->SCSI Miniport Drivers).
Here's how the initialization of the HW_INITIALIZATION_DATA structure
looks like:
ULONG DriverEntry(IN PVOID DriverObject, IN PVOID Argument2)
{
HW_INITIALIZATION_DATA InitData;
ULONG Status;
ULONG i;
for (i=0; i<sizeof(HW_INITIALIZATION_DATA); i++)
((PUCHAR)&InitData)[i] = 0;
InitData.HwInitializationDataSize = sizeof(HW_INITIALIZATION_DATA);
InitData.AdapterInterfaceType = PCMCIABus;
InitData.DeviceExtensionSize = sizeof(MY_DEV_EXT);
InitData.NumberOfAccessRanges = 2;
InitData.HwFindAdapter = FFS_FindAdapter;
InitData.HwInitialize = FFS_HwInitialize;
InitData.HwStartIo = FFS_StartIo;
InitData.HwResetBus = FFS_ResetBus;
InitData.HwAdapterControl = FFS_AdapterControl;
InitData.HwInterrupt = FFS_Interrupt;
InitData.HwAdapterState = FFS_AdapterState;
InitData.HwDmaStarted = NULL;
Status = ScsiPortInitialize(DriverObject, Argument2,
&InitData, NULL);
__asm int 3
return(Status);
}
The bare minimum inf file to install my bare minimum driver looks like
this:
[Version]
Signature="$WINDOWS NT$"
Class=MTD
ClassGuid={4D36E970-E325-11CE-BFC1-08002BE10318}
Provider="Mike"
DriverVer=08/14/2004
[DestinationDirs]
DefaultDestDir=12
[Manufacturer]
"Flashcard"=DeviceList
[DeviceList]
"PCMCIA Flashcard"=DriverInstall,PCMCIA\UNKNOWN_MANUFACTURER-0000
[DriverInstall.NTx86]
CopyFiles=@ffs.sys
[DriverInstall.NTx86.Services]
AddService=ffs, 2, ServiceInstallSettings
[ServiceInstallSettings]
DisplayName = "PCMCIA Flashcard"
ServiceType = 1
StartType = 3
ErrorControl = 1
ServiceBinary = %12%\ffs.sys
LoadOrderGroup = SCSI Miniport
Dependencies = PCMCIA
AddReg = ServiceRegistryEntries
[ServiceRegistryEntries]
HKR, "Parameters\PnpInterface", "8", 0x00010001, 0x00000001
The driver is ment to be pnp compliant as the PnpInterface registry key
and the presence of the HwAdapterState-function indicate.
After the driver is installed and a memory card is pluged in, the drivers
DriverEntry() function is called and ScsiPortInitialize() returnes a value
of zero. (Which seems to be ok). But after that, no other function will be
called!
The main question is: Why is no other function than DriverEntry() called?
Acording to MSDN this may happen if PnpInterface is present but the driver
is not installed as a service for the device. Which leads directly to the
question:
The above inf file should install the driver ffs.sys as service (with
the name 'ffs') for devices of type PCMCIA\UNKNOWN_MANUFACTURER-0000.
Is this the case? Or do you see any mistakes?
(I used msdn and Oneys WDM book to 'tinker' the above inf file together,
but it's well possible that i've missed something... ?!?)
I have no idea why my driver does not initialize proper. Maybe a legacy
driver would be a better idea than a pnp driver...
Please let me know if you have any advice.
Thanks in advance,
Mike