Welcome to WinForumz.com!
FAQFAQ      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

Memory allocation in windows kernel driver

 
   Windows XP (Home) -> XP Device Driver RSS
Next:  Xp oem image activation  
Author Message
chiara

External


Since: May 05, 2007
Posts: 1



(Msg. 1) Posted: Sat May 05, 2007 4:06 am
Post subject: Memory allocation in windows kernel driver
Archived from groups: microsoft>public>windowsxp>device_driver>dev (more info?)

Hi all, I'm approaching in the development of windows drivers and I'm
trying to modify the passthru driver provided in the Windows Driver
Development Kit.

In particular I have some problems in memory allocation. I have to
memorize into the passthru driver packets received from driver
Tcpip.sys before sending them through the NIC. Once I have memorized
the bytes of the packets I can send them, but I have also to operate
into the allocated zone of memory modifying its content.

I don't know if I can use the function malloc() to allocate a zone of
memory into the driver because I try to use it but when I build the
driver I have the error unresoved external symbol _imp_malloc
It is possible to create a pointer to an array of pointers to memorize
the packets before sending it? If yes, can I use the function malloc()
to allocate memory?

I read also that the routine ExAllocatePool() is used to allocate pool
memory in windows drivers. Can I use it to memorize a large quantity
of bytes before sending it through the NIC? If yes, what is the
type of pool memory I have to allocate, non paged or paged? I read
that the system can only allocate buffers larger than PAGE_SIZE from
nonpaged pool in multiples of PAGE_SIZE but I don't understand what is
the value of PAGE_SIZE.

Is there anyone that can help me?

Thank you,

Chiara

 >> Stay informed about: Memory allocation in windows kernel driver 
Back to top
Login to vote
Doron Holan [MSFT]

External


Since: Jul 02, 2007
Posts: 6



(Msg. 2) Posted: Mon Jul 02, 2007 11:45 pm
Post subject: Re: Memory allocation in windows kernel driver [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

the equivalent of malloc is ExAllocatePool. I would guess you will need
NonPagedPool. As for what you can allocate, you can do wahtever you want, it
is just C after all. You can allocate any size pointer you want from
NonPagedPool. If you don't know what a page is or what PAGE_SIZE means, you
really should educate yourself before you ever step foot into kernel mode.

d

"chiara" <tchiara81.RemoveThis@libero.it> wrote in message
news:1178363212.228710.118120@w5g2000hsg.googlegroups.com...
> Hi all, I'm approaching in the development of windows drivers and I'm
> trying to modify the passthru driver provided in the Windows Driver
> Development Kit.
>
> In particular I have some problems in memory allocation. I have to
> memorize into the passthru driver packets received from driver
> Tcpip.sys before sending them through the NIC. Once I have memorized
> the bytes of the packets I can send them, but I have also to operate
> into the allocated zone of memory modifying its content.
>
> I don't know if I can use the function malloc() to allocate a zone of
> memory into the driver because I try to use it but when I build the
> driver I have the error unresoved external symbol _imp_malloc
> It is possible to create a pointer to an array of pointers to memorize
> the packets before sending it? If yes, can I use the function malloc()
> to allocate memory?
>
> I read also that the routine ExAllocatePool() is used to allocate pool
> memory in windows drivers. Can I use it to memorize a large quantity
> of bytes before sending it through the NIC? If yes, what is the
> type of pool memory I have to allocate, non paged or paged? I read
> that the system can only allocate buffers larger than PAGE_SIZE from
> nonpaged pool in multiples of PAGE_SIZE but I don't understand what is
> the value of PAGE_SIZE.
>
> Is there anyone that can help me?
>
> Thank you,
>
> Chiara
>

 >> Stay informed about: Memory allocation in windows kernel driver 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
USB HUB Driver - Hi All. I want to obtained information about power on USB HUB (current in mA) like it presented in MS Device Manager. I'll try to use CreateFile() DeviceIoControl() But I dont know, that Controls Codes I need to obtain this information. TMOK.

Old DirectCD Driver - Basically I put an old Cd that was formatted using an old DirectCd Program and I needed to download a driver to view the Cd on my XP, i did, however the DirectCD driver was way too outdated and according to that little balloon thing that shows up each...

HID mini or USB function driver? - Hello, I have some USB HID devices (presenters/laserpointers with buttons) that I need to read the buttons in a specific application only (to map the buttons to specific actions defined in that application). The problem is that some devices pretend t...

LTO3 driver for XP PRO to allow using ntbackup? - Hi. A couple of brief questions regarding LTO-3 Ultrium 400GB tape on XP Pro that I hope some brainy person can help me with. My DLT7000 and SCSI works fine with my XP Pro Intel. A new IBM LTO3 Ultrium drive runs fine in NovaBackup, but doesn't run..

bluetooth device driver - I'm familiar with how to do a WDM device driver but Bluetooth. I have a change for a side job but I'm not familiar with Bluetooth This is the AD I saw, "We are a biomedical startup with a device scheduled to be fabbed for prototype next week. The de...
   Windows XP (Home) -> XP Device Driver All times are: Eastern Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum

Categories:
  Windows XP
 Windows Vista!
 Win 2000/NT/98/ME


[ Contact us | Terms of Service/Privacy Policy ]