Hi forks,
Is there any doc from MS or others to tell me how to port a scsi
miniport driver to stor miniport driver? I want to read some docs and
schedule a plan to port my scsi miniport driver to stor miniport driver.
Another thing wants to confirm is that does windows XP SP3 also doesn’t
support stor miniport driver?
Thanks
Wayne
Have you checked the WDK/DDK?
–
The personal opinion of
Gary G. Little
“Wayne Gong” wrote in message news:xxxxx@ntdev…
> Hi forks,
>
> Is there any doc from MS or others to tell me how to port a scsi
> miniport driver to stor miniport driver? I want to read some docs and
> schedule a plan to port my scsi miniport driver to stor miniport driver.
>
> Another thing wants to confirm is that does windows XP SP3 also doesn’t
> support stor miniport driver?
>
> Thanks
> Wayne
>
Gary G. Little wrote:
Have you checked the WDK/DDK?
I know WDK doc has lots of content about stor miniport and scsi
miniport. But what I want to get is a doc like ‘how to port scsi
miniport to stor miniport’ to guide me step by step. Otherwise, I will
write a new stor miniport driver based on my scsi miniport driver and
WDK doc.
Thanks
Wayne
Wayne - I started by changing everything in my code that said ScsiPort to StorPort and modifying the sources file to link to storport.lib. Plenty of things won’t work right afterward, but at that point you’ll have a better idea what to look for in the documentation.
Note that if you’re going to write a Virtual StorPort miniport, it will not work on XP - just 2k3 and beyond.
If you attended the DDC last year, they covered this topic and there is a
porting document. If you didn’t attend I guess you may be out of luck
unless it is available in the WDK or from some public documents that were
presented at WinHec. This type of question may get a better chance of an
answer if you post in one of the managed newsgroups hosted by Microsoft
using your MSDN special email address.
“Wayne Gong” wrote in message news:xxxxx@ntdev…
> Gary G. Little wrote:
>> Have you checked the WDK/DDK?
>>
> I know WDK doc has lots of content about stor miniport and scsi miniport.
> But what I want to get is a doc like ‘how to port scsi miniport to stor
> miniport’ to guide me step by step. Otherwise, I will write a new stor
> miniport driver based on my scsi miniport driver and WDK doc.
>
> Thanks
> Wayne
>
Did you look on http://www.microsoft.com/whdc?
d
Sent from my phone with no t9, all spilling mistakes are not intentional.
-----Original Message-----
From: David Craig
Sent: Sunday, February 08, 2009 9:04 PM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] Any doc for how to port scsi miniport to stor miniport
If you attended the DDC last year, they covered this topic and there is a
porting document. If you didn’t attend I guess you may be out of luck
unless it is available in the WDK or from some public documents that were
presented at WinHec. This type of question may get a better chance of an
answer if you post in one of the managed newsgroups hosted by Microsoft
using your MSDN special email address.
“Wayne Gong” wrote in message news:xxxxx@ntdev…
> Gary G. Little wrote:
>> Have you checked the WDK/DDK?
>>
> I know WDK doc has lots of content about stor miniport and scsi miniport.
> But what I want to get is a doc like ‘how to port scsi miniport to stor
> miniport’ to guide me step by step. Otherwise, I will write a new stor
> miniport driver based on my scsi miniport driver and WDK doc.
>
> Thanks
> Wayne
>
—
NTDEV is sponsored by OSR
For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars
To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer
>
Wayne - I started by changing everything in my code that said ScsiPort
to
StorPort and modifying the sources file to link to storport.lib.
Plenty
of things won’t work right afterward, but at that point you’ll have a
better idea what to look for in the documentation.
I did the same for my storport driver, and then changed it back again
afterwards. It really didn’t require many changes at all, you just need
to get your head around the fact that storport will literally keep
throwing srb’s at you until you tell it to stop - NextRequest is a
no-op.
Note that if you’re going to write a Virtual StorPort miniport, it
will
not work on XP - just 2k3 and beyond.
Storport isn’t supported under XP at all is it?
James
Were it my task, what has been suggested here is what I would have done.
Refactoring is failry easy with VS, even easier with SlickEdit, to change
every repetition of a name or lable in your project to agree with the
STORPORT equivalent. Then compile and compile and compile and compile making
changes as needed till you get a clean compile.
And did you check the WDK, possibly the beta 7 version, for the doc
mentioned by David Craig?
–
The personal opinion of
Gary G. Little
“Wayne Gong” wrote in message news:xxxxx@ntdev…
> Gary G. Little wrote:
>> Have you checked the WDK/DDK?
>>
> I know WDK doc has lots of content about stor miniport and scsi miniport.
> But what I want to get is a doc like ‘how to port scsi miniport to stor
> miniport’ to guide me step by step. Otherwise, I will write a new stor
> miniport driver based on my scsi miniport driver and WDK doc.
>
> Thanks
> Wayne
>
There’s also STOR_USE_SCSI_ALIASES, which generally lets you magically
compile your SCSIPort miniport into a StorPort one. This only gets you
through the compile though and doesn’t help at all with the differences in
execution environment.
-scott
–
Scott Noone
Software Engineer
OSR Open Systems Resources, Inc.
http://www.osronline.com
“Gary G. Little” wrote in message news:xxxxx@ntdev…
> Were it my task, what has been suggested here is what I would have done.
> Refactoring is failry easy with VS, even easier with SlickEdit, to change
> every repetition of a name or lable in your project to agree with the
> STORPORT equivalent. Then compile and compile and compile and compile
> making changes as needed till you get a clean compile.
>
> And did you check the WDK, possibly the beta 7 version, for the doc
> mentioned by David Craig?
>
> –
> The personal opinion of
> Gary G. Little
>
> “Wayne Gong” wrote in message news:xxxxx@ntdev…
>> Gary G. Little wrote:
>>> Have you checked the WDK/DDK?
>>>
>> I know WDK doc has lots of content about stor miniport and scsi miniport.
>> But what I want to get is a doc like ‘how to port scsi miniport to stor
>> miniport’ to guide me step by step. Otherwise, I will write a new stor
>> miniport driver based on my scsi miniport driver and WDK doc.
>>
>> Thanks
>> Wayne
>>
>
>
Changing code until it compiles is the worst way to do this port. Your code will then be full of compliance problems, setting things that should not be touched and not setting things that must be set to meet spec. From the INF file to your C code, it will be one big mess, somewhere between a scsiport & storport but compliant with neither model. It will be left to a future set of Windows updates to break your adapter and start the blue screening.
Just because you can get rid of the compile errors in 5 minutes and it works on your machine is no way to write a driver. Storport is not that large a section in the docs. Go through point by point, field by field, and get it right.
Sven,
There is a given, that the engineer does indeed have an opposable thumb, can
read, and has the ability to do a diff on structures, either with a
differencing engine or two windows in a VS session. But a lot of the sheer
grunt work of porting is simply that … change instances of SCSIPORT to
STORPORT.
–
The personal opinion of
Gary G. Little
wrote in message news:xxxxx@ntdev…
> Changing code until it compiles is the worst way to do this port. Your
> code will then be full of compliance problems, setting things that should
> not be touched and not setting things that must be set to meet spec. From
> the INF file to your C code, it will be one big mess, somewhere between a
> scsiport & storport but compliant with neither model. It will be left to a
> future set of Windows updates to break your adapter and start the blue
> screening.
>
> Just because you can get rid of the compile errors in 5 minutes and it
> works on your machine is no way to write a driver. Storport is not that
> large a section in the docs. Go through point by point, field by field,
> and get it right.
>
>
Diffing the structure won’t work. Take for instance the Master field. scsiport says to set it. storport says don’t touch it. If you diff the structure you will have no idea about this. If you blindly port your code it will be a clean compile.
I partially blame Microsoft for problems of this sort because all they had to do was rename fields that storport drivers should not touch to something like ReservedDoNotUse (if not delete the field entirely) as well as remove them from the docs. The way it is now just invites people to do it wrong. That’s probably why the i2o sample is full of spec violations where they set about every field that the docs say not to, but hey it compiles so someone must have thought they were done…
>
Diffing the structure won’t work. Take for instance the Master field.
scsiport says to set it. storport says don’t touch it. If you diff the
structure you will have no idea about this. If you blindly port your
code
it will be a clean compile.
I partially blame Microsoft for problems of this sort because all they
had
to do was rename fields that storport drivers should not touch to
something like ReservedDoNotUse (if not delete the field entirely) as
well
as remove them from the docs. The way it is now just invites people to
do
it wrong. That’s probably why the i2o sample is full of spec
violations
where they set about every field that the docs say not to, but hey it
compiles so someone must have thought they were done…
It’s worse than that - some of the fields documented as ‘set to X by
storport, do not touch’ are actually not set to X, and you have to set
them to X yourself to make it work.
James
The point is that "port"ing anything is not a simple task. It’s a task that
must be weighed against simply writing new or salvaging. Too many times I
have seen porting efforts get so wound up in saving code that the best
course would have been to start fresh anyway. It takes more than just
changing lables or adding or subtacting fields. It involves sublte field
definitions and a veritable cornucopia of hidden pratfalls and slapstick
humorous “ahhh shits” when it comes right down to it.
Tain’t easy and tain’t funny McGee.
–
The personal opinion of
Gary G. Little
“James Harper” wrote in message
news:xxxxx@ntdev…
>
> Diffing the structure won’t work. Take for instance the Master field.
> scsiport says to set it. storport says don’t touch it. If you diff the
> structure you will have no idea about this. If you blindly port your
code
> it will be a clean compile.
>
> I partially blame Microsoft for problems of this sort because all they
had
> to do was rename fields that storport drivers should not touch to
> something like ReservedDoNotUse (if not delete the field entirely) as
well
> as remove them from the docs. The way it is now just invites people to
do
> it wrong. That’s probably why the i2o sample is full of spec
violations
> where they set about every field that the docs say not to, but hey it
> compiles so someone must have thought they were done…
>
It’s worse than that - some of the fields documented as ‘set to X by
storport, do not touch’ are actually not set to X, and you have to set
them to X yourself to make it work.
James