HalGetAdapter leaking adapter objects?

HalGetAdapter() creates and returns an adapter object describing the dma
channel requested, but as far as I can tell, there is no corresponding
function to FREE the adapter object. Isn’t this a memory leak? Am I just
missing the free function?

–>Phillip Susi
xxxxx@iag.net


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

It just returns a pointer to the requested adapter object, the adapter
object is already there you are not allocating any memory when you call
HalGetAdapter(). you are just asking the pointer to the adapter object to be
able to use the adapter when it is free.

----- Original Message -----
From: “Phillip Susi”
To: “NT Developers Interest List”
Sent: Tuesday, January 16, 2001 10:15 AM
Subject: [ntdev] HalGetAdapter leaking adapter objects?

> HalGetAdapter() creates and returns an adapter object describing the dma
> channel requested, but as far as I can tell, there is no corresponding
> function to FREE the adapter object. Isn’t this a memory leak? Am I just
> missing the free function?
>
> –>Phillip Susi
> xxxxx@iag.net
>
>
> —
> You are currently subscribed to ntdev as: xxxxx@ipaxess.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

may be HalPutDmaAdapter(PADAPTER_OBJECT)

-----Original Message-----
From: xxxxx@csie.nsys.by [mailto:xxxxx@csie.nsys.by]On Behalf
Of Phillip Susi
Sent: Tuesday, January 16, 2001 6:15
To: NT Developers Interest List
Subject: [ntdev] HalGetAdapter leaking adapter objects?

HalGetAdapter() creates and returns an adapter object describing the dma
channel requested, but as far as I can tell, there is no corresponding
function to FREE the adapter object. Isn’t this a memory leak?
Am I just
missing the free function?

–>Phillip Susi
xxxxx@iag.net


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

I thought of that possibility, but it can not be. When you call
HalGetAdapter, you give it a lot of information in the device description
structure regarding how you want the dma channel programmed. This
information has to be stored in the adapter object for later use when you
call IoMapTransfer() so that it knows how to program the dma channel. If
there is only one preallocated adapter object for each possible channel,
for each possible way the channel can be programmed, and HalGetAdapter just
returns a pointer to the predefined adapter for that channel and method you
selected, there would have to be 141 different adapter object structures
for each dma channel, even if the MaximumLength field of the device
description structure is ignored. I can’t see this as being the case. It
HAS to create a new adapter object and store all of the parameters in it,
yet there is apparently no way to free that object later.

At 11:06 AM 1/16/01 -0600, you wrote:

It just returns a pointer to the requested adapter object, the adapter
object is already there you are not allocating any memory when you call
HalGetAdapter(). you are just asking the pointer to the adapter object to be
able to use the adapter when it is free.

–>Phillip Susi
xxxxx@iag.net


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

There is no such function. At least not in NT4, I don’t know about 2k.

At 07:10 PM 1/16/01 +0200, you wrote:

may be HalPutDmaAdapter(PADAPTER_OBJECT)

> -----Original Message-----
> From: xxxxx@csie.nsys.by [mailto:xxxxx@csie.nsys.by]On Behalf
> Of Phillip Susi
> Sent: Tuesday, January 16, 2001 6:15
> To: NT Developers Interest List
> Subject: [ntdev] HalGetAdapter leaking adapter objects?
>
>
> HalGetAdapter() creates and returns an adapter object describing the dma
> channel requested, but as far as I can tell, there is no corresponding
> function to FREE the adapter object. Isn’t this a memory leak?
> Am I just
> missing the free function?
>
> –>Phillip Susi
> xxxxx@iag.net
>
>
> —
> You are currently subscribed to ntdev as: xxxxx@csie.nsys.by
> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
>


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

–>Phillip Susi
xxxxx@iag.net


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

Sure there is. IoDeleteDeviceObject. Each DAM (oops, I mean DMA) adapter
object is associated with one device queue, or device object. This is why if
you get smart and define a receive DMA object and a send DMA object and then
try to start a send before a receive completes, you can corrupt the send
device queue and associated data buffers you so painstakingly locked in
place. It’s not too difficult for IoDeleteDeviceObject to test and free any
DMA adapter structures that it may have.

(Pure speculation here, since I’m not one of the privileged with access to
the source.)

-----Original Message-----
From: Phillip Susi [mailto:xxxxx@iag.net]
Sent: Tuesday, January 16, 2001 10:44 AM
To: NT Developers Interest List
Subject: [ntdev] Re: HalGetAdapter leaking adapter
objects?

I thought of that possibility, but it can not be. When you
call
HalGetAdapter, you give it a lot of information in the
device description
structure regarding how you want the dma channel programmed.
This
information has to be stored in the adapter object for later
use when you
call IoMapTransfer() so that it knows how to program the dma
channel. If
there is only one preallocated adapter object for each
possible channel,
for each possible way the channel can be programmed, and
HalGetAdapter just
returns a pointer to the predefined adapter for that channel
and method you
selected, there would have to be 141 different adapter
object structures
for each dma channel, even if the MaximumLength field of the
device
description structure is ignored. I can’t see this as being
the case. It
HAS to create a new adapter object and store all of the
parameters in it,
yet there is apparently no way to free that object later.

At 11:06 AM 1/16/01 -0600, you wrote:
>It just returns a pointer to the requested adapter object,
the adapter
>object is already there you are not allocating any memory
when you call
>HalGetAdapter(). you are just asking the pointer to the
adapter object to be
>able to use the adapter when it is free.

–>Phillip Susi
xxxxx@iag.net


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

Adapter objects can’t be associated with a device object. HalGetAdapter()
does not take a device object as a parameter, so how could it associate the
device with the adapter?

At 11:05 AM 1/16/01 -0800, you wrote:

Sure there is. IoDeleteDeviceObject. Each DAM (oops, I mean DMA) adapter
object is associated with one device queue, or device object. This is why if
you get smart and define a receive DMA object and a send DMA object and then
try to start a send before a receive completes, you can corrupt the send
device queue and associated data buffers you so painstakingly locked in
place. It’s not too difficult for IoDeleteDeviceObject to test and free any
DMA adapter structures that it may have.

(Pure speculation here, since I’m not one of the privileged with access to
the source.)

–>Phillip Susi
xxxxx@iag.net


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

Ok so I misspelled it. IoDeleteDevice.

Gary

-----Original Message-----
From: Phillip Susi [mailto:xxxxx@iag.net]
Sent: Tuesday, January 16, 2001 10:45 AM
To: NT Developers Interest List
Subject: [ntdev] Re: HalGetAdapter leaking adapter
objects?

There is no such function. At least not in NT4, I don’t
know about 2k.

At 07:10 PM 1/16/01 +0200, you wrote:
>may be HalPutDmaAdapter(PADAPTER_OBJECT)
>
> > -----Original Message-----
> > From: xxxxx@csie.nsys.by
[mailto:xxxxx@csie.nsys.by]On Behalf
> > Of Phillip Susi
> > Sent: Tuesday, January 16, 2001 6:15
> > To: NT Developers Interest List
> > Subject: [ntdev] HalGetAdapter leaking adapter objects?
> >
> >
> > HalGetAdapter() creates and returns an adapter object
describing the dma
> > channel requested, but as far as I can tell, there is no
corresponding
> > function to FREE the adapter object. Isn’t this a
memory leak?
> > Am I just
> > missing the free function?
> >
> > –>Phillip Susi
> > xxxxx@iag.net
> >
> >
> > —
> > You are currently subscribed to ntdev as:
xxxxx@csie.nsys.by
> > To unsubscribe send a blank email to
leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
> >
>
>
>—
>You are currently subscribed to ntdev as: xxxxx@iag.net
>To unsubscribe send a blank email to
leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

–>Phillip Susi
xxxxx@iag.net


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

That’s not true. The system creates an adapter object using ObjectManager
function when you call HalGetAdapter. Since there is no documented function
to free the object, all you need to do is dereference the object to free it.
We will fix the doc to say so.

On Win2K and above, you should use the PutDmaAdapter function to free it.

-Eliyas

-----Original Message-----
From: Sanjeev Tiwari [mailto:xxxxx@ipaxess.com]
Sent: Tuesday, January 16, 2001 9:07 AM
To: NT Developers Interest List
Subject: [ntdev] Re: HalGetAdapter leaking adapter objects?

It just returns a pointer to the requested adapter object, the adapter
object is already there you are not allocating any memory when you call
HalGetAdapter(). you are just asking the pointer to the adapter object to be
able to use the adapter when it is free.

----- Original Message -----
From: “Phillip Susi”
To: “NT Developers Interest List”
Sent: Tuesday, January 16, 2001 10:15 AM
Subject: [ntdev] HalGetAdapter leaking adapter objects?

> HalGetAdapter() creates and returns an adapter object describing the dma
> channel requested, but as far as I can tell, there is no corresponding
> function to FREE the adapter object. Isn’t this a memory leak? Am I just
> missing the free function?
>
> –>Phillip Susi
> xxxxx@iag.net
>
>
> —
> You are currently subscribed to ntdev as: xxxxx@ipaxess.com
> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


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

Better be careful how you document this, as I suspect that not all adapter
objects should be freed this way. I think that for example ISA or EISA or
MCA or system DMA adapter objects are not really ‘objects’ and an attempt to
dereference them will have the usual sordid results. But it has been quite a
while since I looked at this stuff so I could be wrong.

Mark Roddy
xxxxx@hollistech.com
www.hollistech.com
WindowsNT Windows 2000 Consulting Services

-----Original Message-----
From: Eliyas Yakub [mailto:xxxxx@microsoft.com]
Sent: Tuesday, January 16, 2001 2:16 PM
To: NT Developers Interest List
Subject: [ntdev] Re: HalGetAdapter leaking adapter objects?

That’s not true. The system creates an adapter object using
ObjectManager
function when you call HalGetAdapter. Since there is no
documented function
to free the object, all you need to do is dereference the
object to free it.
We will fix the doc to say so.

On Win2K and above, you should use the PutDmaAdapter function
to free it.

-Eliyas

-----Original Message-----
From: Sanjeev Tiwari [mailto:xxxxx@ipaxess.com]
Sent: Tuesday, January 16, 2001 9:07 AM
To: NT Developers Interest List
Subject: [ntdev] Re: HalGetAdapter leaking adapter objects?

It just returns a pointer to the requested adapter object, the adapter
object is already there you are not allocating any memory
when you call
HalGetAdapter(). you are just asking the pointer to the
adapter object to be
able to use the adapter when it is free.

----- Original Message -----
From: “Phillip Susi”
> To: “NT Developers Interest List”
> Sent: Tuesday, January 16, 2001 10:15 AM
> Subject: [ntdev] HalGetAdapter leaking adapter objects?
>
>
> > HalGetAdapter() creates and returns an adapter object
> describing the dma
> > channel requested, but as far as I can tell, there is no
> corresponding
> > function to FREE the adapter object. Isn’t this a memory
> leak? Am I just
> > missing the free function?
> >
> > –>Phillip Susi
> > xxxxx@iag.net
> >
> >
> > —
> > You are currently subscribed to ntdev as: xxxxx@ipaxess.com
> > To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
>
>
> —
> You are currently subscribed to ntdev as: xxxxx@microsoft.com
> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
>
> —
> 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: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

> HalGetAdapter() creates and returns an adapter object describing the dma

channel requested, but as far as I can tell, there is no corresponding
function to FREE the adapter object. Isn’t this a memory leak? Am I just
missing the free function?

IIRC the new WDM interface with method tables had the free adapter method.

Also - HalGetAdapter does not allocate anything, it returns a pointer to
the object pre-allocated at HAL init time.

Max


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 thought of that possibility, but it can not be. When you call

HalGetAdapter, you give it a lot of information in the device description
structure regarding how you want the dma channel programmed. This
information has to be stored in the adapter object for later use when you
call IoMapTransfer() so that it knows how to program the dma channel.

No, this information is used to search the appropriate adapter object in a
“relaxed” way similar to how LOGFONT is used by GDI - the best possible
match. This of DEVICE_DESCRIPTION as LOGFONT and the adapter object as
TEXTMETRIC of the selected font.
I think HAL maintains a single adapter object for all PCI devices and an
adapter object for each ISA slave DMA channel (they are 7 IIRC).

Max


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

> That’s not true. The system creates an adapter object using ObjectManager

function when you call HalGetAdapter.

Thanks for correcting us.

Max


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 take that back. I just found out from developers that for ISA devices
(slave DMA mode), these objects indeed come out of a pre-allocated list. So
dereferencing the object is not the right way to free. It seems there never
was a way to get rid of the adapter in NT 4.0 and earlier. This was not much
of an issue since it did not support PNP so hardware and drivers did not
come and go very often.

-----Original Message-----
From: Eliyas Yakub [mailto:xxxxx@microsoft.com]
Sent: Tuesday, January 16, 2001 11:16 AM
To: NT Developers Interest List
Subject: [ntdev] Re: HalGetAdapter leaking adapter objects?

That’s not true. The system creates an adapter object using ObjectManager
function when you call HalGetAdapter. Since there is no documented function
to free the object, all you need to do is dereference the object to free it.
We will fix the doc to say so.

On Win2K and above, you should use the PutDmaAdapter function to free it.

-Eliyas

-----Original Message-----
From: Sanjeev Tiwari [mailto:xxxxx@ipaxess.com]
Sent: Tuesday, January 16, 2001 9:07 AM
To: NT Developers Interest List
Subject: [ntdev] Re: HalGetAdapter leaking adapter objects?

It just returns a pointer to the requested adapter object, the adapter
object is already there you are not allocating any memory when you call
HalGetAdapter(). you are just asking the pointer to the adapter object to be
able to use the adapter when it is free.

----- Original Message -----
From: “Phillip Susi”
To: “NT Developers Interest List”
Sent: Tuesday, January 16, 2001 10:15 AM
Subject: [ntdev] HalGetAdapter leaking adapter objects?

> HalGetAdapter() creates and returns an adapter object describing the dma
> channel requested, but as far as I can tell, there is no corresponding
> function to FREE the adapter object. Isn’t this a memory leak? Am I just
> missing the free function?
>
> –>Phillip Susi
> xxxxx@iag.net
>
>
> —
> You are currently subscribed to ntdev as: xxxxx@ipaxess.com
> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


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


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

I do not see how it is possible for them to come from a pre allocated list,
one per channel, as information such as maximum transfer length, and auto
reinitializemode, transfer width, etc have to be stored in the adapter
object so that IoMapTransfer() can program the DMA controller using that
information. Also, there is an AdapterType type of kernel mode object, is
that not the same as this adapter object, and therefore you can just de
reference it?

At 01:32 PM 1/16/01 -0800, you wrote:

I take that back. I just found out from developers that for ISA devices
(slave DMA mode), these objects indeed come out of a pre-allocated list. So
dereferencing the object is not the right way to free. It seems there never
was a way to get rid of the adapter in NT 4.0 and earlier. This was not much
of an issue since it did not support PNP so hardware and drivers did not
come and go very often.

–>Phillip Susi
xxxxx@iag.net


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

The ISA, EISA, system, and if I recall correctly MCA adapter objects all
come from pre-allocated lists. The non-system DMA objects indeed have to be
setup by the caller but they each come from a pre-ordained slot. 32-bit
Busmaster dma adapters however are indeed kernel objects that can be
referenced and dereferenced and presumably disappear when dereferenced for
the last time.

But as Eliyas correctly corrected himself, this all was just a big old leak
in NT4 (and 3.5 and 3.) I guess the theory was that the general life-cycle
of a hardware driver that used adapter objects was: start during system
init, run until system reset. Not actually a terrible theory for most
systems.

For NT4 and earlier, ignore what happens to adapter objects, but don’t
expect to be able to load/unload your pci device driver forever. For W2K and
later, this whole interface is obsolete, don’t use it.

Mark Roddy
Windows 2000/NT Consultant
Hollis Technology Solutions
www.hollistech.com

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of Phillip Susi
Sent: Tuesday, January 16, 2001 6:22 PM
To: NT Developers Interest List
Subject: [ntdev] Re: HalGetAdapter leaking adapter objects?

I do not see how it is possible for them to come from a pre
allocated list,
one per channel, as information such as maximum transfer length, and auto
reinitializemode, transfer width, etc have to be stored in the adapter
object so that IoMapTransfer() can program the DMA controller using that
information. Also, there is an AdapterType type of kernel mode
object, is
that not the same as this adapter object, and therefore you can just de
reference it?

At 01:32 PM 1/16/01 -0800, you wrote:
>I take that back. I just found out from developers that for ISA devices
>(slave DMA mode), these objects indeed come out of a
pre-allocated list. So
>dereferencing the object is not the right way to free. It seems
there never
>was a way to get rid of the adapter in NT 4.0 and earlier. This
was not much
>of an issue since it did not support PNP so hardware and drivers did not
>come and go very often.

–>Phillip Susi
xxxxx@iag.net


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

Interesting, but still, how is it possible to use a precreated adapter
object? The adapter object has to store the parameters passed in to
HalGetAdapter() for later use by IoMapTransfer() to program the controller
doesn’t it? Well, if more than one caller calls HalGetAdapter() on the
same channel, they’d each get the same adapter object, and so the second
caller would trash the parameters in the adapter object that the first
caller specified. This would not be good.

At 09:28 PM 1/16/01 -0500, you wrote:

The ISA, EISA, system, and if I recall correctly MCA adapter objects all
come from pre-allocated lists. The non-system DMA objects indeed have to be
setup by the caller but they each come from a pre-ordained slot. 32-bit
Busmaster dma adapters however are indeed kernel objects that can be
referenced and dereferenced and presumably disappear when dereferenced for
the last time.

But as Eliyas correctly corrected himself, this all was just a big old leak
in NT4 (and 3.5 and 3.) I guess the theory was that the general life-cycle
of a hardware driver that used adapter objects was: start during system
init, run until system reset. Not actually a terrible theory for most
systems.

For NT4 and earlier, ignore what happens to adapter objects, but don’t
expect to be able to load/unload your pci device driver forever. For W2K and
later, this whole interface is obsolete, don’t use it.

Mark Roddy
Windows 2000/NT Consultant
Hollis Technology Solutions
www.hollistech.com

> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com]On Behalf Of Phillip Susi
> Sent: Tuesday, January 16, 2001 6:22 PM
> To: NT Developers Interest List
> Subject: [ntdev] Re: HalGetAdapter leaking adapter objects?
>
>
> I do not see how it is possible for them to come from a pre
> allocated list,
> one per channel, as information such as maximum transfer length, and auto
> reinitializemode, transfer width, etc have to be stored in the adapter
> object so that IoMapTransfer() can program the DMA controller using that
> information. Also, there is an AdapterType type of kernel mode
> object, is
> that not the same as this adapter object, and therefore you can just de
> reference it?

–>Phillip Susi
xxxxx@iag.net


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 take that back. I just found out from developers that for ISA devices

(slave DMA mode), these objects indeed come out of a pre-allocated list.
So

:-)))))
The function name reminds this - HalGetAdapter, not HalAllocateAdapter.

Max


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

> Interesting, but still, how is it possible to use a precreated adapter

object? The adapter object has to store the parameters passed in to
HalGetAdapter() for later use by IoMapTransfer() to program the controller
doesn’t it?

You can try to read the documentation on the old slave ISA DMA chip - 8237
IIRC - to determine that a good deal of HalGetAdapter’s parameters are
irrelevant for it.

Well, if more than one caller calls HalGetAdapter() on the same channel,

This is a serious hardware conflict. You cannot put 2 cards on the same
hardware DRQ wire (I mean ISA cards - PCI ones do not use any numbered
“channels”).
I don’t know for sure, but maybe HalGetAdapter will fail in this case.

Max


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