Is it possible to use ExAllocatePool in SCSI miniport driver

Hi,
I am writing a SCSI miniport driver in which I am using TDI client to talk to a remote machine. In this dirver I am using some user defined structures and pointers for which I am allocating the memory using ExAllocatePool but when I am building the driver with target as a DRIVER it is not giving any probelm but when I am building with Target as a MINIPORT it is giving errors.
My doubt is whether I can use ExAllocatePool for memory Allocation or not in a SCSI miniport driver. If not How do I allocate memory in SCSI miniport Driver.

regards
sreenivas


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

I forgot to mention that you should compile the ddk module separately as
type DRIVER_LIBRARY and link your MINIPORT to the resultant .lib file.

The association with scsiport is a dll client->dll relationship. For
example here is a TARGETLIBS line from one of my miniport drivers:
TARGETLIBS=$(DDK_LIB_PATH)\scsiport.lib \
$(DDK_LIB_PATH)\scsiwmi.lib \
$(GLOBALLIBS)*\mplib.lib \
$(DDK_LIB_PATH)\ntoskrnl.lib \
$(DDK_LIB_PATH)\hal.lib

Including scsiport, and calling ScsiportXXX routines, associates my
driver with the scsiport.sys kernel dll.

Note also that I am linking with ntoskrnl and hal in order to resolve
the (illegal) ddk calls in my private library, mplib.

=====================
Mark Roddy
Windows XP/2000/NT Consulting
Hollis Technology Solutions 603-321-1032
www.hollistech.com
xxxxx@hollistech.com
For Windows Device Driver Training: see www.azius.com

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of konanki
sreenivaskumar
Sent: Monday, February 11, 2002 12:28 AM
To: NT Developers Interest List
Cc: Roddy,Mark
Subject: [ntdev] RE: Is it possible to use ExAllocatePool in SCSI
miniport driver

Hi Mark,
This certainly is a lot of help and I tried to implement the DDK
functions writing them in a seperate source file.
But I am facing a small problem. The driver doesnt build if
TARGETTYPE=MINIPORT. It gives the linking errors for all the DDK APIs.
However if I give TARGETTYPE=DRIVER, it builds successfully.

Is this behaviour normal or am I missing something?

Moreso, if it is not build as MINIPORT, how would it get registered with
the system as SCSI miniport driver?

Regards
Srini

On Fri, 08 Feb 2002 Roddy, Mark wrote :

Technically you are restricted to the scsiport defined
API, which is of
course missing a heap allocation function. The
interface does provide
per-device, per-lun and per-srb allocations for you, if
you specify them on
initialization, which generally covers most situations.
It probably does not
cover the scsi-over-tdi case, and you will shortly hear
from the
scsiport-replacement folks here that you should do it
their way.

You can write a separate source module that includes
ntddk.h or wdm.h rather
than miniport.h, and that module can call ddk
functions. However you have to
also be aware that your IRQL level is going to be
DISPATCH_LEVEL or greater
in almost all of your HwXXX miniport functions, which
could be a problem.

> -----Original Message-----
> From: konanki sreenivaskumar
[mailto:xxxxx@rediffmail.com]
> Sent: Friday, February 08, 2002 6:35 AM
> To: NT Developers Interest List
> Subject: [ntdev] Is it possible to use ExAllocatePool
in SCSI
> miniport driver
>
>
>
> Hi,
> I am writing a SCSI miniport driver in which I am
using
> TDI client to talk to a remote machine. In this
dirver I am
> using some user defined structures and pointers for
which I
> am allocating the memory using ExAllocatePool but
when I am
> building the driver with target as a DRIVER it is not
giving
> any probelm but when I am building with Target as a
MINIPORT
> it is giving errors.
> My doubt is whether I can use ExAllocatePool for
memory
> Allocation or not in a SCSI miniport driver. If not
How do I
> allocate memory in SCSI miniport Driver.
>
> regards
> sreenivas
>
>
> —
> You are currently subscribed to ntdev as:
> xxxxx@stratus.com To unsubscribe send a blank
email to
> leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
>


You are currently subscribed to ntdev as:
xxxxx@rediffmail.com
To unsubscribe send a blank email to
leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: xxxxx@hollistech.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