Hi,

I am writing a NDIM IM driver. In order to communicate with user land
application, I allocate 3 buffers on nonpaged memory 10 MB each.

My driver gets success to allocate memory in first time only for all buffers.
Next time on wards, driver gets fail to allocate memory. I am very much
sure that there is no any memory leak which I have tested.

Please suggest me what should I do??

Configuration OS:: XP SP2
Ram:: 504 MB (8 MB shared)
Processor:: 2.8 GHz Pentium
--
With regards
thanks
Anand Choubey

Re: NDIS Allocate memory fail??? by Doron

Doron
Thu Oct 11 09:07:54 PDT 2007

make the buffers smaller or hold onto the memory once you have it

d

--
Please do not send e-mail directly to this alias. this alias is for
newsgroup purposes only.
This posting is provided "AS IS" with no warranties, and confers no rights.


"Anand Choubey" <AnandChoubey@discussions.microsoft.com> wrote in message
news:0E88A603-DC60-4C04-8FA1-ACCFA83AAE57@microsoft.com...
> Hi,
>
> I am writing a NDIM IM driver. In order to communicate with user land
> application, I allocate 3 buffers on nonpaged memory 10 MB each.
>
> My driver gets success to allocate memory in first time only for all
> buffers.
> Next time on wards, driver gets fail to allocate memory. I am very much
> sure that there is no any memory leak which I have tested.
>
> Please suggest me what should I do??
>
> Configuration OS:: XP SP2
> Ram:: 504 MB (8 MB shared)
> Processor:: 2.8 GHz Pentium
> --
> With regards
> thanks
> Anand Choubey


Re: NDIS Allocate memory fail??? by Maxim

Maxim
Thu Oct 11 13:13:16 PDT 2007

Why not allocate them in the app?

--
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
maxim@storagecraft.com
http://www.storagecraft.com

"Anand Choubey" <AnandChoubey@discussions.microsoft.com> wrote in message
news:0E88A603-DC60-4C04-8FA1-ACCFA83AAE57@microsoft.com...
> Hi,
>
> I am writing a NDIM IM driver. In order to communicate with user land
> application, I allocate 3 buffers on nonpaged memory 10 MB each.
>
> My driver gets success to allocate memory in first time only for all buffers.
> Next time on wards, driver gets fail to allocate memory. I am very much
> sure that there is no any memory leak which I have tested.
>
> Please suggest me what should I do??
>
> Configuration OS:: XP SP2
> Ram:: 504 MB (8 MB shared)
> Processor:: 2.8 GHz Pentium
> --
> With regards
> thanks
> Anand Choubey


Re: NDIS Allocate memory fail??? by AnandChoubey

AnandChoubey
Fri Oct 12 06:42:02 PDT 2007

Hi

Thank for your suggestion.

If I allocate memory at user land then is it possible to access userland
memory in DPCs????
Please let me know.
--
With regards
thanks
Anand Choubey


"Maxim S. Shatskih" wrote:

> Why not allocate them in the app?
>
> --
> Maxim Shatskih, Windows DDK MVP
> StorageCraft Corporation
> maxim@storagecraft.com
> http://www.storagecraft.com
>
> "Anand Choubey" <AnandChoubey@discussions.microsoft.com> wrote in message
> news:0E88A603-DC60-4C04-8FA1-ACCFA83AAE57@microsoft.com...
> > Hi,
> >
> > I am writing a NDIM IM driver. In order to communicate with user land
> > application, I allocate 3 buffers on nonpaged memory 10 MB each.
> >
> > My driver gets success to allocate memory in first time only for all buffers.
> > Next time on wards, driver gets fail to allocate memory. I am very much
> > sure that there is no any memory leak which I have tested.
> >
> > Please suggest me what should I do??
> >
> > Configuration OS:: XP SP2
> > Ram:: 504 MB (8 MB shared)
> > Processor:: 2.8 GHz Pentium
> > --
> > With regards
> > thanks
> > Anand Choubey
>
>

Re: NDIS Allocate memory fail??? by Maxim

Maxim
Sun Oct 14 06:41:12 PDT 2007

Yes. In kernel land, call MmGetSystemAddressForMdlSafe on the MDL which
describes this user memory.

--
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
maxim@storagecraft.com
http://www.storagecraft.com

"Anand Choubey" <AnandChoubey@discussions.microsoft.com> wrote in message
news:F84C7761-FE7E-48F0-B9A2-E2853B41CE87@microsoft.com...
> Hi
>
> Thank for your suggestion.
>
> If I allocate memory at user land then is it possible to access userland
> memory in DPCs????
> Please let me know.
> --
> With regards
> thanks
> Anand Choubey
>
>
> "Maxim S. Shatskih" wrote:
>
> > Why not allocate them in the app?
> >
> > --
> > Maxim Shatskih, Windows DDK MVP
> > StorageCraft Corporation
> > maxim@storagecraft.com
> > http://www.storagecraft.com
> >
> > "Anand Choubey" <AnandChoubey@discussions.microsoft.com> wrote in message
> > news:0E88A603-DC60-4C04-8FA1-ACCFA83AAE57@microsoft.com...
> > > Hi,
> > >
> > > I am writing a NDIM IM driver. In order to communicate with user land
> > > application, I allocate 3 buffers on nonpaged memory 10 MB each.
> > >
> > > My driver gets success to allocate memory in first time only for all
buffers.
> > > Next time on wards, driver gets fail to allocate memory. I am very much
> > > sure that there is no any memory leak which I have tested.
> > >
> > > Please suggest me what should I do??
> > >
> > > Configuration OS:: XP SP2
> > > Ram:: 504 MB (8 MB shared)
> > > Processor:: 2.8 GHz Pentium
> > > --
> > > With regards
> > > thanks
> > > Anand Choubey
> >
> >


Re: NDIS Allocate memory fail??? by Alireza

Alireza
Wed Oct 17 02:19:11 PDT 2007

what exact NDIS API do you call to allocate memory?

Also as somebody else suggested, since application should have access to
this memory, it is better to have application allocate the memory, probe and
lock the memory in your driver (to make it non pageable and mapped to system
address space) and use system address in your driver.

You need to lock the memory if you may access it at dispatch level which is
very likely the case.

-ali
This posting is provided "AS IS" with no warranties, and confers no rights
"Anand Choubey" <AnandChoubey@discussions.microsoft.com> wrote in message
news:0E88A603-DC60-4C04-8FA1-ACCFA83AAE57@microsoft.com...
> Hi,
>
> I am writing a NDIM IM driver. In order to communicate with user land
> application, I allocate 3 buffers on nonpaged memory 10 MB each.
>
> My driver gets success to allocate memory in first time only for all
> buffers.
> Next time on wards, driver gets fail to allocate memory. I am very much
> sure that there is no any memory leak which I have tested.
>
> Please suggest me what should I do??
>
> Configuration OS:: XP SP2
> Ram:: 504 MB (8 MB shared)
> Processor:: 2.8 GHz Pentium
> --
> With regards
> thanks
> Anand Choubey