Re: Using malloc() with driver code ?!

From: A.Ilamparithi (ilamparithi_at_msn.com)
Date: 08/03/04


Date: Mon, 2 Aug 2004 23:03:33 -0700

Thanks for u r answer. I am using memcpy inside my driver. But malloc i am
not able to. is memcpy is not in C runtime library ? Can you tell me the
difference between malloc() and memcpy () ?

With Thankz,
A. Ilamparithi.

"Walter Oney" <waltoney@oneysoft.com> wrote in message
news:410E64CD.D9BFD85@oneysoft.com...
> "A.Ilamparithi" wrote:
> > Is it is possible to use malloc() in the driver code?
>
> Short answer: no, use ExAllocatePoolWithTag instead.
>
> Longer answer: not unless you write your own implementation, since you
> must not link with the standard C runtime library that defines this
> function.
>
> --
> Walter Oney, Consulting and Training
> Basic and Advanced Driver Programming Seminars
> Check out our schedule at http://www.oneysoft.com



Relevant Pages

  • Re: Cached file read performance
    ... 50000 malloc in 0.5367s ... 50000 memcpy of 8192 byte blocks in 1.0887s ... printf("out of memory initializing destination array!\n"); ... numblocks, blocksz, elapsed); ...
    (freebsd-performance)
  • Re: malloc : just to be sure
    ... so just to be sure and not waste more hours on this: ... can i use malloc in a driver like in a normal user-process? ... but I notice that you are posting using Google Groups. ...
    (comp.os.minix)
  • Re: IS this a proper way of freeing memory with free()
    ... It's not pointless if you are using C++ for hardware simulations to ... Fine, in which case it isn't C++, so you don't need the cast on malloc. ... The driver code in question is compiled as C for the embedded ...
    (comp.lang.c)
  • missing ANSI functions in memory.h
    ... malloc is defined, calloc is defined, free is defined. ... The documentation I saw in MSDN said it was an ANSI function. ... 124.ccError: error: 'memcpy' was not declared in this scope ...
    (comp.os.msdos.djgpp)
  • Re: Linking Libraries to Drivers.
    ... you cannot have any dependencies on mscrt in your driver. ... > to install the driver with the new .sys file, it says, ... And xyz.lib uses malloc() and free. ... I really dont know what ...
    (microsoft.public.development.device.drivers)