Re: NdisAllocateBufferPool by Jeff
Jeff
Tue Aug 30 19:34:04 CDT 2005
This is a multi-part message in MIME format.
------=_NextPart_000_004C_01C5AD89.04813AB0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
NdisAllocateBufferPool always returns success because it does not =
actually allocate anything in the current implemenation on CE, so it =
cannot fail.
However, I would recommend that all drivers check the returned value of =
"Status" and gracefully handle a non-zero value.
The documentation is incorrect in saying:
"Return Values
Always returns NDIS_STATUS_SUCCESS."
The return value is in fact VOID. While current implementations of this =
NDIS API on CE will always set Status =3D NDIS_STATUS_SUCCESS, drivers =
should not rely upon this behaviour in order to maintain portability to =
future versions of CE, and to desktop Windows OSes.
--=20
Jeff Kelley / Microsoft
This posting is provided "AS IS" with no warranties, and confers no =
rights.
"sajid" <sajid@discussions.microsoft.com> wrote in message =
news:eFXZq25qFHA.1204@TK2MSFTNGP15.phx.gbl...
Dear all,
How come NdisAllocateBufferPool() always returns success ?
I understand that NdisAllocateBufferPool() allocates certain amount of =
memory.
But, MSDN documentation states that this API always returns success.
Can someone clarify this.
warm regards,
Sajid
------=_NextPart_000_004C_01C5AD89.04813AB0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2900.2722" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>NdisAllocateBufferPool always returns =
success=20
because it does not actually allocate anything in the current =
implemenation on=20
CE, so it cannot fail.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>However, I would recommend =
that all=20
drivers check the returned value of "Status" and gracefully handle =
a=20
non-zero value.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>The documentation is incorrect in=20
saying:</FONT></DIV>
<DIV>
<P class=3Dlabel><B>"Return Values</B></P>
<P>Always returns NDIS_STATUS_SUCCESS."</P>
<P><FONT face=3DArial size=3D2>The return value is in fact VOID. While =
current=20
implementations of this NDIS API on CE will always set Status =3D=20
NDIS_STATUS_SUCCESS, drivers should not rely upon this behaviour in =
order to=20
maintain portability to future versions of CE, and to desktop Windows=20
OSes.</FONT></P>
<P><FONT face=3DArial size=3D2></FONT><BR>-- <BR>Jeff Kelley / =
Microsoft<BR>This=20
posting is provided "AS IS" with no warranties, and confers no =
rights.</P></DIV>
<DIV> </DIV>
<DIV> </DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV>"sajid" <<A=20
=
href=3D"mailto:sajid@discussions.microsoft.com">sajid@discussions.microso=
ft.com</A>>=20
wrote in message <A=20
=
href=3D"news:eFXZq25qFHA.1204@TK2MSFTNGP15.phx.gbl">news:eFXZq25qFHA.1204=
@TK2MSFTNGP15.phx.gbl</A>...</DIV>
<DIV><FONT size=3D2>Dear all,</FONT></DIV>
<DIV><FONT size=3D2></FONT> </DIV>
<DIV><FONT size=3D2></FONT> </DIV>
<DIV><FONT size=3D2>How come NdisAllocateBufferPool() always returns =
success=20
?</FONT></DIV>
<DIV><FONT size=3D2>I understand that NdisAllocateBufferPool() =
allocates certain=20
amount of memory.</FONT></DIV>
<DIV><FONT size=3D2>But, MSDN documentation states that this API =
always returns=20
success.</FONT></DIV>
<DIV><FONT size=3D2>Can someone clarify this.</FONT></DIV>
<DIV><FONT size=3D2></FONT> </DIV>
<DIV><FONT size=3D2></FONT> </DIV>
<DIV><FONT size=3D2>warm regards,</FONT></DIV>
<DIV><FONT size=3D2>Sajid</FONT></DIV></BLOCKQUOTE></BODY></HTML>
------=_NextPart_000_004C_01C5AD89.04813AB0--