Alright, here’s were I’m at with my SCSIPORT driver. One instance of the
SCSIPORT driver is enumerated by the parent driver. WinXP sees it and loads
my SCSIPORT driver. I do the following piece of code in my AddDevice
routine to create the Device. I get device 1. Device 0 is assigned to the
onboard PCI/IDE controller.
do
{
swprintf(wcBuffer, L"\Device\ScsiPort%d", ulDeviceCount);
RtlInitUnicodeString(&UniDevName, wcBuffer);
Status = IoCreateDevice(pDriverObject,
sizeof(EMDISK_CONTROLLER_EXTENSION),
&UniDevName, FILE_DEVICE_CONTROLLER,
0, FALSE, &pNewDeviceObject);
ulDeviceCount++;
}while((Status == STATUS_OBJECT_NAME_COLLISION) || (Status ==
STATUS_OBJECT_NAME_EXISTS));
if(Status == STATUS_SUCCESS)
{
ulDeviceCount–;
later on in my AddDevice routine I create the symbolic link name by doing
the following piece of code.
//
// create the symbolic link
//
swprintf(pEmDiskCntrlExt->wcName, L"\??\scsi%d:", ulDeviceCount);
RtlInitUnicodeString(&pEmDiskCntrlExt->UniDevSymbolicName,
pEmDiskCntrlExt->wcName);
Status = IoCreateSymbolicLink(&pEmDiskCntrlExt->UniDevSymbolicName,
&UniDevName);
My Major Functions that I support are
//
// Fill in all the dispatch entry points with the pass through function
// and the explicitly fill in the functions we are going to intercept
//
for(i = 0; i < IRP_MJ_MAXIMUM_FUNCTION; i++)
{
pDriverObject->MajorFunction[i] = PnpDefaultHandler;
}
pDriverObject->DriverUnload = DriverUnload;
pDriverObject->DriverExtension->AddDevice = EmDiskAddDevice;
pDriverObject->MajorFunction[IRP_MJ_CLEANUP] = DriverCleanupIO;
pDriverObject->MajorFunction[IRP_MJ_CREATE] = DriverCreateIO;
pDriverObject->MajorFunction[IRP_MJ_CLOSE] = DriverCloseIO;
pDriverObject->MajorFunction[IRP_MJ_INTERNAL_DEVICE_CONTROL] =
DriverInternalDeviceIO;
pDriverObject->MajorFunction[IRP_MJ_DEVICE_CONTROL] =
DriverDeviceControlIO;
pDriverObject->MajorFunction[IRP_MJ_READ] = DriverReadWriteIO;
pDriverObject->MajorFunction[IRP_MJ_WRITE] = DriverReadWriteIO;
pDriverObject->MajorFunction[IRP_MJ_PNP] = DriverPnPControlIO;
pDriverObject->MajorFunction[IRP_MJ_POWER] = DriverPowerControlIO;
pDriverObject->MajorFunction[IRP_MJ_SYSTEM_CONTROL] =
DriverSystemControlIO;
pDriverObject->MajorFunction[IRP_MJ_FLUSH_BUFFERS] =
DriverFlushBuffersIO;
pDriverObject->MajorFunction[IRP_MJ_SHUTDOWN] = DriverShutdownIO;
After all the PnP operations are sent to my SCSIPORT driver, I get an
Inaccessible Boot Device BSOD. I have set a breakpoint in each of my Major
function routines. None of them get hit. The only one that gets called is
the PnP major function for starting up the device.
The following is my INF file that loads the SCSIPORT driver.
[Version]
Signature = “$Windows NT$”
Class = System
ClassGUID = {4D36E97D-E325-11CE-BFC1-08002BE10318}
DriverVer = 08/22/2001, 5.2.2.0
Provider = %SUN_MFG%
[Strings]
SUN_MFG = “Sun Microsystems”
SUNEMDK.DESC = “Sun Emulated Disk Controller”
REG_DWORD = 0x00010001
REG_EXPAND_SZ = 0x00020000
REG_MULTI_SZ = 0x00010000
SPSVCINST_ASSOCSERVICE = 0x00000002
[DestinationDirs]
SunEmDk.Driver.Copy = 12
[SunEmDk.Driver.Copy]
sunemdk.sys
[ControlFlags]
ExcludeFromSelect = BRIDGE\EmulatedDiskCntrl
[Manufacturer]
%SUN_MFG% = SunDevices
[SunDevices]
%SUNEMDK.DESC% = SunEmDkDriver, BRIDGE\EmulatedDiskCntrl
[SunEmDkDriver]
CopyFiles = SunEmDk.Driver.Copy
[SunEmDkDriver.Services]
AddService = sunemdk, %SPSVCINST_ASSOCSERVICE%, SunEmDk.Service,
SunEmDk.Eventlog.Inst
[SunEmDk.Service]
DisplayName = %SUNEMDK.DESC%
ServiceType = 1
StartType = 0
ErrorControl = 1
ServiceBinary = %12%\sunemdk.sys
LoadOrderGroup = port
AddReg = SunEmDk.Reg
[SunEmDk.Eventlog.Inst]
AddReg = SunEmDk.AddEventLog
[SunEmDk.AddEventLog]
HKR, , EventMessageFile, %REG_EXPAND_SZ%,
“%%SystemRoot%%\System32\iologmsg.dll”
HKR, , TypesSupported, %REG_DWORD%, 7
[SunEmDk.Reg]
HKLM, “System\CurrentControlSet\Services\sunemdk\parameters”,
“DiskVolumeKey”, %REG_DWORD%, 0x01
Any ideas of why this is not being recognized by WinXP that it’s not a SCSI
port driver?
Thanks,
Joe
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of Joe Moriarty
Sent: Wednesday, September 26, 2001 6:57 AM
To: NT Developers Interest List
Subject: [ntdev] Re: SCSI port driver
I’m going to give it a shot because my SCSIPORT driver is enumerated by a
parent driver (I’m a PNP driver model). It’s probably only used for all
their WMI crap, but if it doesn’t hurt to bad why not do it.
Joe
> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com]On Behalf Of
> xxxxx@hotmail.com
> Sent: Wednesday, September 26, 2001 6:16 AM
> To: NT Developers Interest List
> Subject: [ntdev] Re: SCSI port driver
>
>
> You’re confused. If somebody writes a monolithis SCSI port driver
> (for own
> IDE RAID contoller, for own FC controller for example) he does not need
> complete repleacement of SCSIPORT from Microsoft. If you wrote
the driver
> that replaces SCSIPORT (I think that’s what you did) my congratulations!
> But not a lot of people need this… Monolithic SCSI port != Microsoft
> SCSIPORT.
>
> > From your neglectance of such issues, I can conclude that your
> code is not
> > 100% compatible with SCSIPORT.
>
> —
> You are currently subscribed to ntdev as: xxxxx@east.sun.com
> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
>
You are currently subscribed to ntdev as: xxxxx@east.sun.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com