Discussion:
What header files should be included in SCSI miniport driver?
(too old to reply)
flyingfly
2010-07-19 05:58:30 UTC
Permalink
Hi:

I am writing a simple SCSI miniport driver for Windows XP, and I have the
header files <SCSI.h> and <miniport.h>.
But there are errors in <srb.h> during compilitation

such as:
srb.h(63): error C2061 : syntax error : identifier 'SCSI_PHISYCAL_ADDRESS'
srb.h(63): error C2059 : syntax error : ';'
srb.h(63): error C2059 : syntax error : ','
srb.h(66): error C2061 : C requires that a struct or union has at least one
member

And there are huge amount of error, so that the last error i can see is :
error C10003 : error count exceeds 100; stopping compilation

I am so confused with these errors, can anyone help me to solve them?

Much appreciate!

PS: why there is no SCSI miniport sample drive in WDK, and my version is
7600.16385.1. it it really difficult to develop a SCSI miniport driver with
just the documentaions.
Burkhardt Braun
2010-07-19 10:53:07 UTC
Permalink
Hello,
I made a quick-shot and I introduced the headers
#include <scsi.h>
#include <miniport.h>
#include <srb.h>

in an existing project.
I was able to compile with no errors, but ONLY if I placed these files
above
#include "precomp"
#pragma hdrstop

I assume there is something wrong with your build environment.
I used 7600 Checked Buid for XP

Good luck
Burkhardt Braun
Post by flyingfly
I am writing a simple SCSI miniport driver for Windows XP, and I have the
header files <SCSI.h> and <miniport.h>.
But there are errors in <srb.h> during compilitation
srb.h(63): error C2061 : syntax error : identifier 'SCSI_PHISYCAL_ADDRESS'
srb.h(63): error C2059 : syntax error : ';'
srb.h(63): error C2059 : syntax error : ','
srb.h(66): error C2061 : C requires that a struct or union has at least one
member
error C10003 : error count exceeds 100; stopping compilation
I am so confused with these errors, can anyone help me to solve them?
Much appreciate!
PS: why there is no SCSI miniport sample drive in WDK, and my version is
7600.16385.1. it it really difficult to develop a SCSI miniport driver with
just the documentaions.
flyingfly
2010-07-20 02:35:05 UTC
Permalink
Hi:
Thanks for your help, your method helped to solve the previous problem,but
there are still some other errors

in my "private.h" :

private.h(26) : error C2061 : syntax error : identifier 'DriverEntry'
private.h(26) : error C2056 : syntax error : ';'
private.h(34) : error C2148 : syntax error : missing ')' before identifier
'ConfigInfo'
private.h(34) : error C2081 : 'PPORT_CONFIGURATION_INFORMATION' : name in
formal parameter list illegal
private.h(34) : error C2061 : syntax error : identifier 'ConfigInfo'

the corresponding code in private.h is shown here:

21: typedef struct _XX_DEVICE_EXTENSION{
22: XX_REGS Regs;
23: PUCHAR RegsBase;
24: }XX_DEVICE_EXTENSION, *PXX_DEVICE_EXTENSION;
25:
26 : DRIVER_INITIALIZE DriverEntry;
27:
28: ULONG
29: xxFindAdapter(
30: IN PVOID DeviceExtension,
31: IN PVOID HwContext,
32: IN PVOID BusInformation,
33: IN PCHAR ArgumentString,
34: IN OUT PPORT_CONFIGURATION_INFORMATION ConfigInfo,
35: OUT PBOOLEAN Again
36 );

and also errors about 'PSCSI_REQUEST_BLOCK'

have i missed some header files that have defined the structs above?

Thanks again!





And there are some other mistakes at ..\inc\api\e
Post by Burkhardt Braun
Hello,
I made a quick-shot and I introduced the headers
#include <scsi.h>
#include <miniport.h>
#include <srb.h>
in an existing project.
I was able to compile with no errors, but ONLY if I placed these files
above
#include "precomp"
#pragma hdrstop
I assume there is something wrong with your build environment.
I used 7600 Checked Buid for XP
Good luck
Burkhardt Braun
Post by flyingfly
I am writing a simple SCSI miniport driver for Windows XP, and I have the
header files <SCSI.h> and <miniport.h>.
But there are errors in <srb.h> during compilitation
srb.h(63): error C2061 : syntax error : identifier 'SCSI_PHISYCAL_ADDRESS'
srb.h(63): error C2059 : syntax error : ';'
srb.h(63): error C2059 : syntax error : ','
srb.h(66): error C2061 : C requires that a struct or union has at least one
member
error C10003 : error count exceeds 100; stopping compilation
I am so confused with these errors, can anyone help me to solve them?
Much appreciate!
PS: why there is no SCSI miniport sample drive in WDK, and my version is
7600.16385.1. it it really difficult to develop a SCSI miniport driver with
just the documentaions.
.
Scott Noone
2010-07-19 13:49:56 UTC
Permalink
"flyingfly" <***@discussions.microsoft.com> wrote in message
news:76AE6EE2-6988-4D1C-A20C-
Post by flyingfly
srb.h(63): error C2061 : syntax error : identifier 'SCSI_PHISYCAL_ADDRESS'
Did you type that or copy/paste it? Note that "physical" is spelled wrong,
if you did a copy/paste of that then your header is trashed somehow.

-scott
--
Scott Noone
Consulting Associate
OSR Open Systems Resources, Inc.
http://www.osronline.com
Post by flyingfly
I am writing a simple SCSI miniport driver for Windows XP, and I have the
header files <SCSI.h> and <miniport.h>.
But there are errors in <srb.h> during compilitation
srb.h(63): error C2061 : syntax error : identifier 'SCSI_PHISYCAL_ADDRESS'
srb.h(63): error C2059 : syntax error : ';'
srb.h(63): error C2059 : syntax error : ','
srb.h(66): error C2061 : C requires that a struct or union has at least one
member
error C10003 : error count exceeds 100; stopping compilation
I am so confused with these errors, can anyone help me to solve them?
Much appreciate!
PS: why there is no SCSI miniport sample drive in WDK, and my version is
7600.16385.1. it it really difficult to develop a SCSI miniport driver with
just the documentaions.
flyingfly
2010-07-20 02:35:00 UTC
Permalink
sorry i just typed it wrong, it should be SCSI_PHYSICAL_ADDRESS
Post by Scott Noone
news:76AE6EE2-6988-4D1C-A20C-
Post by flyingfly
srb.h(63): error C2061 : syntax error : identifier 'SCSI_PHISYCAL_ADDRESS'
Did you type that or copy/paste it? Note that "physical" is spelled wrong,
if you did a copy/paste of that then your header is trashed somehow.
-scott
--
Scott Noone
Consulting Associate
OSR Open Systems Resources, Inc.
http://www.osronline.com
Post by flyingfly
I am writing a simple SCSI miniport driver for Windows XP, and I have the
header files <SCSI.h> and <miniport.h>.
But there are errors in <srb.h> during compilitation
srb.h(63): error C2061 : syntax error : identifier 'SCSI_PHISYCAL_ADDRESS'
srb.h(63): error C2059 : syntax error : ';'
srb.h(63): error C2059 : syntax error : ','
srb.h(66): error C2061 : C requires that a struct or union has at least one
member
error C10003 : error count exceeds 100; stopping compilation
I am so confused with these errors, can anyone help me to solve them?
Much appreciate!
PS: why there is no SCSI miniport sample drive in WDK, and my version is
7600.16385.1. it it really difficult to develop a SCSI miniport driver with
just the documentaions.
flyingfly
2010-07-20 09:50:06 UTC
Permalink
I tried to minimize my project size to figure out the problem.
Now I have these files in my project folder:
XX.c, makefile, sources, XX.inf

sources file is:
TARGETNAME = XX
TARGETTYPE = MINIPORT

TARGETLIBS = $(DDK_LIB_PATH)\scsiport.lib

SOURCES = XX.c


the XX.c file is constructed as follows:

#include <scsi.h>
#include <miniport.h>
#include <srb.h>

// some macro definition
...

tpyedef struct _XX_REGS_{
// the contents of the PCI regs
...
}XX_REGS, *PXX_REGS;

typedef struct _XX_DEVICE_EXTENSION{
PXX_REGS Regs;
PUCHAR RegsBase;
}XX_DEVICE_EXTENSION, *PXX_DEVICE_EXTSION;

// function prototypes
ULONG DriverEntry( ...);
ULONG XXFindAdapter(...);
BOLEAN XXInitialize(...);
BOOLEAN XXStartIo(...);
BOOLEAN XXResetBus(...);
SCSI_ADAPTER_CONTROL_STATUS XXAdapterControl(...);
VOID XXRTimer(...);

//the implementation of the above functions
...


Now after my compilation, the previous errors accur again:
srb.h(63): error C2061 : syntax error : identifier 'SCSI_PHISYCAL_ADDRESS'
srb.h(63): error C2059 : syntax error : ';'
srb.h(63): error C2059 : syntax error : ','
srb.h(66): error C2061 : C requires that a struct or union has at least one
member

along with huge number of similiar errors.

My building enviroment is 7600.16385.1 and I am using XP SP3.

What can the actual problem be?

Thanks very much!! I'm so confused..
Burkhardt Braun
2010-07-20 16:04:32 UTC
Permalink
Hello!
Post by flyingfly
I tried to minimize my project size to figure out the problem.
That is a good idea.
Post by flyingfly
srb.h(63): error C2061 : syntax error : identifier 'SCSI_PHISYCAL_ADDRESS'
srb.h(63): error C2059 : syntax error : ';'
srb.h(63): error C2059 : syntax error : ','
srb.h(66): error C2061 : C requires that a struct or union has at least one
member
along with huge number of similiar errors.
My building enviroment is 7600.16385.1 and I am using XP SP3.
What can the actual problem be?
Seemingly a wrong configuration / build environment.
( Or a wrong header. PHISYCAL again is strange )
Post by flyingfly
 Thanks very much!!   I'm so confused..
You can try what I did:
Take a working example and introduce the headers.
That works for me in an arbitrary example ( see above ).
From that point adapt the working example to your needs step by step.

Kind regards and good luck
Burkhardt Braun
flyingfly
2010-07-21 05:44:33 UTC
Permalink
Post by Burkhardt Braun
Hello!
Post by flyingfly
I tried to minimize my project size to figure out the problem.
That is a good idea.
Post by flyingfly
srb.h(63): error C2061 : syntax error : identifier 'SCSI_PHISYCAL_ADDRESS'
srb.h(63): error C2059 : syntax error : ';'
srb.h(63): error C2059 : syntax error : ','
srb.h(66): error C2061 : C requires that a struct or union has at least one
member
along with huge number of similiar errors.
My building enviroment is 7600.16385.1 and I am using XP SP3.
What can the actual problem be?
Seemingly a wrong configuration / build environment.
( Or a wrong header. PHISYCAL again is strange )
sorry, i wrote the code by myself without copy(and not able to copy..)and i
am really used to spell PHYSICAL into PHISYCAL, that's a historic problem for
me..
Post by Burkhardt Braun
Post by flyingfly
Thanks very much!! I'm so confused..
Take a working example and introduce the headers.
That works for me in an arbitrary example ( see above ).
From that point adapt the working example to your needs step by step.
Thanks again, I'll try this and hope it will work.
Post by Burkhardt Braun
Kind regards and good luck
Burkhardt Braun
.
eagersh
2010-07-22 20:54:53 UTC
Permalink
Post by flyingfly
I am writing a simple SCSI miniport driver for Windows XP, and I have the
header files <SCSI.h> and <miniport.h>.
But there are errors in <srb.h> during compilitation
srb.h(63): error C2061 : syntax error : identifier 'SCSI_PHISYCAL_ADDRESS'
srb.h(63): error C2059 : syntax error : ';'
srb.h(63): error C2059 : syntax error : ','
srb.h(66): error C2061 : C requires that a struct or union has at least one
member
error C10003 : error count exceeds 100; stopping compilation
I am so confused with these errors, can anyone help me to solve them?
Much appreciate!
PS: why there is no SCSI miniport sample drive in WDK, and my version is
7600.16385.1. it it really difficult to develop a SCSI miniport driver with
just the documentaions.
You should load an older version of DDK which contains a miniport SCSI
driver sample. For example, you still could download DDK for 2003
through Microsoft Connect.
This DDK contains sample of miniport SCSI -
\WinDDK\3790.1830\src\storage\miniport\aha154x
The sample build perfectly and you could use as a source to build your
project.

Igor Sharovar
flyingfly
2010-07-23 09:40:36 UTC
Permalink
Thanks a lot!
I find the sample and modify its code to generate my project ,and it works!
Post by eagersh
Post by flyingfly
I am writing a simple SCSI miniport driver for Windows XP, and I have the
header files <SCSI.h> and <miniport.h>.
But there are errors in <srb.h> during compilitation
srb.h(63): error C2061 : syntax error : identifier 'SCSI_PHISYCAL_ADDRESS'
srb.h(63): error C2059 : syntax error : ';'
srb.h(63): error C2059 : syntax error : ','
srb.h(66): error C2061 : C requires that a struct or union has at least one
member
error C10003 : error count exceeds 100; stopping compilation
I am so confused with these errors, can anyone help me to solve them?
Much appreciate!
PS: why there is no SCSI miniport sample drive in WDK, and my version is
7600.16385.1. it it really difficult to develop a SCSI miniport driver with
just the documentaions.
You should load an older version of DDK which contains a miniport SCSI
driver sample. For example, you still could download DDK for 2003
through Microsoft Connect.
This DDK contains sample of miniport SCSI -
\WinDDK\3790.1830\src\storage\miniport\aha154x
The sample build perfectly and you could use as a source to build your
project.
Igor Sharovar
.
Loading...