Hi,
Is it is possible to use malloc() in the driver code?
With Regards,
A.Ilamparithi.
Hi,
Is it is possible to use malloc() in the driver code?
With Regards,
A.Ilamparithi.
reply in ntfsd
“A.Ilamparithi” wrote in message news:xxxxx@ntdev…
> Hi,
>
> Is it is possible to use malloc() in the driver code?
>
> With Regards,
> A.Ilamparithi.
>
>
>
Welcome to Windows driver development! Read on about ExAllocatePool and
ExAllocatePoolWithTag
Mat
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of A.Ilamparithi
Sent: Tuesday, August 03, 2004 12:04 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] using malloc() in driver code !?!
Hi,
Is it is possible to use malloc() in the driver code?
With Regards,
A.Ilamparithi.
Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
You are currently subscribed to ntdev as: xxxxx@encentrus.com
To unsubscribe send a blank email to xxxxx@lists.osr.com
Hi,
I am able to use memcpy inside my driver. But malloc i am
not able to. Can you tell me the
difference between using malloc() and memcpy () ?
With Thanks,
A. Ilamparithi.
“Mathieu Routhier” wrote in message
news:xxxxx@ntdev…
> Welcome to Windows driver development! Read on about ExAllocatePool and
> ExAllocatePoolWithTag
>
> Mat
>
> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com] On Behalf Of A.Ilamparithi
> Sent: Tuesday, August 03, 2004 12:04 AM
> To: Windows System Software Devs Interest List
> Subject: [ntdev] using malloc() in driver code !?!
>
> Hi,
>
> Is it is possible to use malloc() in the driver code?
>
> With Regards,
> A.Ilamparithi.
>
>
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: xxxxx@encentrus.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>
>
Memcpy is an intrinsic that the compiler will inline generate. Malloc
requires support, you have to understand the kernel environment before using
it.
–
Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting
“A.Ilamparithi” wrote in message news:xxxxx@ntdev…
> Hi,
>
> I am able to use memcpy inside my driver. But malloc i am
> not able to. Can you tell me the
> difference between using malloc() and memcpy () ?
>
> With Thanks,
> A. Ilamparithi.
>
>
> “Mathieu Routhier” wrote in message
> news:xxxxx@ntdev…
> > Welcome to Windows driver development! Read on about ExAllocatePool and
> > ExAllocatePoolWithTag
> >
> > Mat
> >
> > -----Original Message-----
> > From: xxxxx@lists.osr.com
> > [mailto:xxxxx@lists.osr.com] On Behalf Of A.Ilamparithi
> > Sent: Tuesday, August 03, 2004 12:04 AM
> > To: Windows System Software Devs Interest List
> > Subject: [ntdev] using malloc() in driver code !?!
> >
> > Hi,
> >
> > Is it is possible to use malloc() in the driver code?
> >
> > With Regards,
> > A.Ilamparithi.
> >
> >
> >
> > —
> > Questions? First check the Kernel Driver FAQ at
> > http://www.osronline.com/article.cfm?id=256
> >
> > You are currently subscribed to ntdev as: xxxxx@encentrus.com
> > To unsubscribe send a blank email to xxxxx@lists.osr.com
> >
> >
>
>
>
Why? It is so much easier to just ask every question here.
=====================
Mark Roddy
-----Original Message-----
From: Don Burn [mailto:xxxxx@acm.org]
Sent: Monday, August 02, 2004 1:43 PM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] using malloc() in driver code !?!
Memcpy is an intrinsic that the compiler will inline generate. Malloc
requires support, you have to understand the kernel environment before using
it.
–
Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting
“A.Ilamparithi” wrote in message news:xxxxx@ntdev…
> Hi,
>
> I am able to use memcpy inside my driver. But malloc i am
> not able to. Can you tell me the
> difference between using malloc() and memcpy () ?
>
> With Thanks,
> A. Ilamparithi.
>
>
> “Mathieu Routhier” wrote in message
> news:xxxxx@ntdev…
> > Welcome to Windows driver development! Read on about ExAllocatePool and
> > ExAllocatePoolWithTag
> >
> > Mat
> >
> > -----Original Message-----
> > From: xxxxx@lists.osr.com
> > [mailto:xxxxx@lists.osr.com] On Behalf Of A.Ilamparithi
> > Sent: Tuesday, August 03, 2004 12:04 AM
> > To: Windows System Software Devs Interest List
> > Subject: [ntdev] using malloc() in driver code !?!
> >
> > Hi,
> >
> > Is it is possible to use malloc() in the driver code?
> >
> > With Regards,
> > A.Ilamparithi.
> >
> >
> >
> > —
> > Questions? First check the Kernel Driver FAQ at
> > http://www.osronline.com/article.cfm?id=256
> >
> > You are currently subscribed to ntdev as: xxxxx@encentrus.com
> > To unsubscribe send a blank email to xxxxx@lists.osr.com
> >
> >
>
>
>
—
Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
You are currently subscribed to ntdev as: xxxxx@stratus.com
To unsubscribe send a blank email to xxxxx@lists.osr.com
memcpy copies memory from one address to another while
malloc allocates pageable memory at user mode. at kernel mode
you must allocate memory form various pools and using various options
not available in malloc. short answer: malloc is not available because
you shouldn’t use it in kernel mode.
From: “A.Ilamparithi”
>Reply-To: “Windows System Software Devs Interest List”
>
>To: “Windows System Software Devs Interest List”
>Subject: Re:[ntdev] using malloc() in driver code !?!
>Date: Mon, 2 Aug 2004 23:09:09 -0700
>
>Hi,
>
>I am able to use memcpy inside my driver. But malloc i am
>not able to. Can you tell me the
>difference between using malloc() and memcpy () ?
>
>With Thanks,
>A. Ilamparithi.
>
>
>“Mathieu Routhier” wrote in message
>news:xxxxx@ntdev…
> > Welcome to Windows driver development! Read on about ExAllocatePool and
> > ExAllocatePoolWithTag
> >
> > Mat
> >
> > -----Original Message-----
> > From: xxxxx@lists.osr.com
> > [mailto:xxxxx@lists.osr.com] On Behalf Of A.Ilamparithi
> > Sent: Tuesday, August 03, 2004 12:04 AM
> > To: Windows System Software Devs Interest List
> > Subject: [ntdev] using malloc() in driver code !?!
> >
> > Hi,
> >
> > Is it is possible to use malloc() in the driver code?
> >
> > With Regards,
> > A.Ilamparithi.
> >
> >
> >
> > —
> > Questions? First check the Kernel Driver FAQ at
> > http://www.osronline.com/article.cfm?id=256
> >
> > You are currently subscribed to ntdev as: xxxxx@encentrus.com
> > To unsubscribe send a blank email to xxxxx@lists.osr.com
> >
> >
>
>
>
>—
>Questions? First check the Kernel Driver FAQ at
>http://www.osronline.com/article.cfm?id=256
>
>You are currently subscribed to ntdev as: xxxxx@hotmail.com
>To unsubscribe send a blank email to xxxxx@lists.osr.com
-------------------
Greg Jacklin
Email: xxxxx@hotmail.com
CELL: 503.504.7220
-------------------
In fact you ought not to be using memcpy either. The kernel runtime is
defined by the Rtl… Api. Some of the standard C runtime intrinsics are
available, however for the most part they are superseded by either the
equivalent Rtl memory operations or ‘string-safe’ string operations.
=====================
Mark Roddy
-----Original Message-----
From: greg jacklin [mailto:xxxxx@hotmail.com]
Sent: Monday, August 02, 2004 3:20 PM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] using malloc() in driver code !?!
memcpy copies memory from one address to another while malloc allocates
pageable memory at user mode. at kernel mode you must allocate memory form
various pools and using various options not available in malloc. short
answer: malloc is not available because you shouldn’t use it in kernel mode.
From: “A.Ilamparithi”
>Reply-To: “Windows System Software Devs Interest List”
>
>To: “Windows System Software Devs Interest List”
>Subject: Re:[ntdev] using malloc() in driver code !?!
>Date: Mon, 2 Aug 2004 23:09:09 -0700
>
>Hi,
>
>I am able to use memcpy inside my driver. But malloc i am not able to.
>Can you tell me the difference between using malloc() and memcpy () ?
>
>With Thanks,
>A. Ilamparithi.
>
>
>“Mathieu Routhier” wrote in message
>news:xxxxx@ntdev…
> > Welcome to Windows driver development! Read on about ExAllocatePool
> > and ExAllocatePoolWithTag
> >
> > Mat
> >
> > -----Original Message-----
> > From: xxxxx@lists.osr.com
> > [mailto:xxxxx@lists.osr.com] On Behalf Of
> > A.Ilamparithi
> > Sent: Tuesday, August 03, 2004 12:04 AM
> > To: Windows System Software Devs Interest List
> > Subject: [ntdev] using malloc() in driver code !?!
> >
> > Hi,
> >
> > Is it is possible to use malloc() in the driver code?
> >
> > With Regards,
> > A.Ilamparithi.
> >
> >
> >
> > —
> > Questions? First check the Kernel Driver FAQ at
> > http://www.osronline.com/article.cfm?id=256
> >
> > You are currently subscribed to ntdev as: xxxxx@encentrus.com To
> > unsubscribe send a blank email to xxxxx@lists.osr.com
> >
> >
>
>
>
>—
>Questions? First check the Kernel Driver FAQ at
>http://www.osronline.com/article.cfm?id=256
>
>You are currently subscribed to ntdev as: xxxxx@hotmail.com To
>unsubscribe send a blank email to xxxxx@lists.osr.com
-------------------
Greg Jacklin
Email: xxxxx@hotmail.com
CELL: 503.504.7220
-------------------
—
Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
You are currently subscribed to ntdev as: xxxxx@stratus.com To
unsubscribe send a blank email to xxxxx@lists.osr.com
In fact … unless defined(_M_AXP64) || defined(_M_IA64) …
#define RtlEqualMemory(Destination,Source,Length)
(!memcmp((Destination),(Source),(Length)))
#define RtlMoveMemory(Destination,Source,Length)
memmove((Destination),(Source),(Length))
#define RtlCopyMemory(Destination,Source,Length)
memcpy((Destination),(Source),(Length))
#define RtlFillMemory(Destination,Length,Fill)
memset((Destination),(Fill),(Length))
#define RtlZeroMemory(Destination,Length) memset((Destination),0,(Length))
… which is nice.
“Roddy, Mark” wrote in message news:xxxxx@ntdev…
> In fact you ought not to be using memcpy either. The kernel runtime is
> defined by the Rtl… Api. Some of the standard C runtime intrinsics are
> available, however for the most part they are superseded by either the
> equivalent Rtl memory operations or ‘string-safe’ string operations.
>
>
>
> =====================
> Mark Roddy
>
> -----Original Message-----
> From: greg jacklin [mailto:xxxxx@hotmail.com]
> Sent: Monday, August 02, 2004 3:20 PM
> To: Windows System Software Devs Interest List
> Subject: Re:[ntdev] using malloc() in driver code !?!
>
> memcpy copies memory from one address to another while malloc allocates
> pageable memory at user mode. at kernel mode you must allocate memory
form
> various pools and using various options not available in malloc. short
> answer: malloc is not available because you shouldn’t use it in kernel
mode.
>
>
> >From: “A.Ilamparithi”
> >Reply-To: “Windows System Software Devs Interest List”
> >
> >To: “Windows System Software Devs Interest List”
> >Subject: Re:[ntdev] using malloc() in driver code !?!
> >Date: Mon, 2 Aug 2004 23:09:09 -0700
> >
> >Hi,
> >
> >I am able to use memcpy inside my driver. But malloc i am not able to.
> >Can you tell me the difference between using malloc() and memcpy () ?
> >
> >With Thanks,
> >A. Ilamparithi.
> >
> >
> >“Mathieu Routhier” wrote in message
> >news:xxxxx@ntdev…
> > > Welcome to Windows driver development! Read on about ExAllocatePool
> > > and ExAllocatePoolWithTag
> > >
> > > Mat
> > >
> > > -----Original Message-----
> > > From: xxxxx@lists.osr.com
> > > [mailto:xxxxx@lists.osr.com] On Behalf Of
> > > A.Ilamparithi
> > > Sent: Tuesday, August 03, 2004 12:04 AM
> > > To: Windows System Software Devs Interest List
> > > Subject: [ntdev] using malloc() in driver code !?!
> > >
> > > Hi,
> > >
> > > Is it is possible to use malloc() in the driver code?
> > >
> > > With Regards,
> > > A.Ilamparithi.
> > >
> > >
> > >
> > > —
> > > Questions? First check the Kernel Driver FAQ at
> > > http://www.osronline.com/article.cfm?id=256
> > >
> > > You are currently subscribed to ntdev as: xxxxx@encentrus.com To
> > > unsubscribe send a blank email to xxxxx@lists.osr.com
> > >
> > >
> >
> >
> >
> >—
> >Questions? First check the Kernel Driver FAQ at
> >http://www.osronline.com/article.cfm?id=256
> >
> >You are currently subscribed to ntdev as: xxxxx@hotmail.com To
> >unsubscribe send a blank email to xxxxx@lists.osr.com
>
>
> -------------------
> Greg Jacklin
> Email: xxxxx@hotmail.com
> CELL: 503.504.7220
> -------------------
>
>
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: xxxxx@stratus.com To
> unsubscribe send a blank email to xxxxx@lists.osr.com
>
Yes we know they are defined that way today, can you be sure tommorrow.
That’s why you should use, the Rtl… functions and not the mem…
functions.
–
Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting
“Lyndon J Clarke” wrote in message
news:xxxxx@ntdev…
> In fact … unless defined(_M_AXP64) || defined(_M_IA64) …
>
> #define RtlEqualMemory(Destination,Source,Length)
> (!memcmp((Destination),(Source),(Length)))
> #define RtlMoveMemory(Destination,Source,Length)
> memmove((Destination),(Source),(Length))
> #define RtlCopyMemory(Destination,Source,Length)
> memcpy((Destination),(Source),(Length))
> #define RtlFillMemory(Destination,Length,Fill)
> memset((Destination),(Fill),(Length))
> #define RtlZeroMemory(Destination,Length) memset((Destination),0,(Length))
>
> … which is nice.
>
> “Roddy, Mark” wrote in message
news:xxxxx@ntdev…
> > In fact you ought not to be using memcpy either. The kernel runtime is
> > defined by the Rtl… Api. Some of the standard C runtime intrinsics are
> > available, however for the most part they are superseded by either the
> > equivalent Rtl memory operations or ‘string-safe’ string operations.
> >
> >
> >
> > =====================
> > Mark Roddy
> >
> > -----Original Message-----
> > From: greg jacklin [mailto:xxxxx@hotmail.com]
> > Sent: Monday, August 02, 2004 3:20 PM
> > To: Windows System Software Devs Interest List
> > Subject: Re:[ntdev] using malloc() in driver code !?!
> >
> > memcpy copies memory from one address to another while malloc allocates
> > pageable memory at user mode. at kernel mode you must allocate memory
> form
> > various pools and using various options not available in malloc. short
> > answer: malloc is not available because you shouldn’t use it in kernel
> mode.
> >
> >
> > >From: “A.Ilamparithi”
> > >Reply-To: “Windows System Software Devs Interest List”
> > >
> > >To: “Windows System Software Devs Interest List”
> > >Subject: Re:[ntdev] using malloc() in driver code !?!
> > >Date: Mon, 2 Aug 2004 23:09:09 -0700
> > >
> > >Hi,
> > >
> > >I am able to use memcpy inside my driver. But malloc i am not able to.
> > >Can you tell me the difference between using malloc() and memcpy () ?
> > >
> > >With Thanks,
> > >A. Ilamparithi.
> > >
> > >
> > >“Mathieu Routhier” wrote in message
> > >news:xxxxx@ntdev…
> > > > Welcome to Windows driver development! Read on about ExAllocatePool
> > > > and ExAllocatePoolWithTag
> > > >
> > > > Mat
> > > >
> > > > -----Original Message-----
> > > > From: xxxxx@lists.osr.com
> > > > [mailto:xxxxx@lists.osr.com] On Behalf Of
> > > > A.Ilamparithi
> > > > Sent: Tuesday, August 03, 2004 12:04 AM
> > > > To: Windows System Software Devs Interest List
> > > > Subject: [ntdev] using malloc() in driver code !?!
> > > >
> > > > Hi,
> > > >
> > > > Is it is possible to use malloc() in the driver code?
> > > >
> > > > With Regards,
> > > > A.Ilamparithi.
> > > >
> > > >
> > > >
> > > > —
> > > > Questions? First check the Kernel Driver FAQ at
> > > > http://www.osronline.com/article.cfm?id=256
> > > >
> > > > You are currently subscribed to ntdev as: xxxxx@encentrus.com To
> > > > unsubscribe send a blank email to xxxxx@lists.osr.com
> > > >
> > > >
> > >
> > >
> > >
> > >—
> > >Questions? First check the Kernel Driver FAQ at
> > >http://www.osronline.com/article.cfm?id=256
> > >
> > >You are currently subscribed to ntdev as: xxxxx@hotmail.com To
> > >unsubscribe send a blank email to xxxxx@lists.osr.com
> >
> >
> > -------------------
> > Greg Jacklin
> > Email: xxxxx@hotmail.com
> > CELL: 503.504.7220
> > -------------------
> >
> >
> >
> > —
> > Questions? First check the Kernel Driver FAQ at
> > http://www.osronline.com/article.cfm?id=256
> >
> > You are currently subscribed to ntdev as: xxxxx@stratus.com To
> > unsubscribe send a blank email to xxxxx@lists.osr.com
> >
>
>
>
that is reassuring…
----- Original Message -----
From: “Don Burn”
Newsgroups: ntdev
To: “Windows System Software Devs Interest List”
Sent: Monday, August 02, 2004 1:54 PM
Subject: Re:[ntdev] using malloc() in driver code !?!
> Yes we know they are defined that way today, can you be sure tommorrow.
> That’s why you should use, the Rtl… functions and not the mem…
> functions.
>
>
>
> –
> Don Burn (MVP, Windows DDK)
> Windows 2k/XP/2k3 Filesystem and Driver Consulting
>
>
> “Lyndon J Clarke” wrote in message
> news:xxxxx@ntdev…
> > In fact … unless defined(_M_AXP64) || defined(_M_IA64) …
> >
> > #define RtlEqualMemory(Destination,Source,Length)
> > (!memcmp((Destination),(Source),(Length)))
> > #define RtlMoveMemory(Destination,Source,Length)
> > memmove((Destination),(Source),(Length))
> > #define RtlCopyMemory(Destination,Source,Length)
> > memcpy((Destination),(Source),(Length))
> > #define RtlFillMemory(Destination,Length,Fill)
> > memset((Destination),(Fill),(Length))
> > #define RtlZeroMemory(Destination,Length)
memset((Destination),0,(Length))
> >
> > … which is nice.
> >
> > “Roddy, Mark” wrote in message
> news:xxxxx@ntdev…
> > > In fact you ought not to be using memcpy either. The kernel runtime is
> > > defined by the Rtl… Api. Some of the standard C runtime intrinsics
are
> > > available, however for the most part they are superseded by either the
> > > equivalent Rtl memory operations or ‘string-safe’ string operations.
> > >
> > >
> > >
> > > =====================
> > > Mark Roddy
> > >
> > > -----Original Message-----
> > > From: greg jacklin [mailto:xxxxx@hotmail.com]
> > > Sent: Monday, August 02, 2004 3:20 PM
> > > To: Windows System Software Devs Interest List
> > > Subject: Re:[ntdev] using malloc() in driver code !?!
> > >
> > > memcpy copies memory from one address to another while malloc
allocates
> > > pageable memory at user mode. at kernel mode you must allocate memory
> > form
> > > various pools and using various options not available in malloc. short
> > > answer: malloc is not available because you shouldn’t use it in kernel
> > mode.
> > >
> > >
> > > >From: “A.Ilamparithi”
> > > >Reply-To: “Windows System Software Devs Interest List”
> > > >
> > > >To: “Windows System Software Devs Interest List”
> > > >Subject: Re:[ntdev] using malloc() in driver code !?!
> > > >Date: Mon, 2 Aug 2004 23:09:09 -0700
> > > >
> > > >Hi,
> > > >
> > > >I am able to use memcpy inside my driver. But malloc i am not able
to.
> > > >Can you tell me the difference between using malloc() and memcpy () ?
> > > >
> > > >With Thanks,
> > > >A. Ilamparithi.
> > > >
> > > >
> > > >“Mathieu Routhier” wrote in message
> > > >news:xxxxx@ntdev…
> > > > > Welcome to Windows driver development! Read on about
ExAllocatePool
> > > > > and ExAllocatePoolWithTag
> > > > >
> > > > > Mat
> > > > >
> > > > > -----Original Message-----
> > > > > From: xxxxx@lists.osr.com
> > > > > [mailto:xxxxx@lists.osr.com] On Behalf Of
> > > > > A.Ilamparithi
> > > > > Sent: Tuesday, August 03, 2004 12:04 AM
> > > > > To: Windows System Software Devs Interest List
> > > > > Subject: [ntdev] using malloc() in driver code !?!
> > > > >
> > > > > Hi,
> > > > >
> > > > > Is it is possible to use malloc() in the driver code?
> > > > >
> > > > > With Regards,
> > > > > A.Ilamparithi.
> > > > >
> > > > >
> > > > >
> > > > > —
> > > > > Questions? First check the Kernel Driver FAQ at
> > > > > http://www.osronline.com/article.cfm?id=256
> > > > >
> > > > > You are currently subscribed to ntdev as: xxxxx@encentrus.com
To
> > > > > unsubscribe send a blank email to xxxxx@lists.osr.com
> > > > >
> > > > >
> > > >
> > > >
> > > >
> > > >—
> > > >Questions? First check the Kernel Driver FAQ at
> > > >http://www.osronline.com/article.cfm?id=256
> > > >
> > > >You are currently subscribed to ntdev as: xxxxx@hotmail.com To
> > > >unsubscribe send a blank email to xxxxx@lists.osr.com
> > >
> > >
> > > -------------------
> > > Greg Jacklin
> > > Email: xxxxx@hotmail.com
> > > CELL: 503.504.7220
> > > -------------------
> > >
> > >
> > >
> > > —
> > > Questions? First check the Kernel Driver FAQ at
> > > http://www.osronline.com/article.cfm?id=256
> > >
> > > You are currently subscribed to ntdev as: xxxxx@stratus.com To
> > > unsubscribe send a blank email to xxxxx@lists.osr.com
> > >
> >
> >
> >
>
>
>
> —
> Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: xxxxx@hotmail.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>
Not to mention the fact they may be defined differently for different
platforms.
Chuck
----- Original Message -----
From: “Don Burn”
Newsgroups: ntdev
To: “Windows System Software Devs Interest List”
Sent: Tuesday, August 03, 2004 3:54 AM
Subject: Re:[ntdev] using malloc() in driver code !?!
> Yes we know they are defined that way today, can you be sure
tommorrow.
> That’s why you should use, the Rtl… functions and not the mem…
> functions.
>
>
>
> –
> Don Burn (MVP, Windows DDK)
> Windows 2k/XP/2k3 Filesystem and Driver Consulting
>
>
> “Lyndon J Clarke” wrote in message
> news:xxxxx@ntdev…
> > In fact … unless defined(_M_AXP64) || defined(_M_IA64) …
> >
> > #define RtlEqualMemory(Destination,Source,Length)
> > (!memcmp((Destination),(Source),(Length)))
> > #define RtlMoveMemory(Destination,Source,Length)
> > memmove((Destination),(Source),(Length))
> > #define RtlCopyMemory(Destination,Source,Length)
> > memcpy((Destination),(Source),(Length))
> > #define RtlFillMemory(Destination,Length,Fill)
> > memset((Destination),(Fill),(Length))
> > #define RtlZeroMemory(Destination,Length)
memset((Destination),0,(Length))
> >
> > … which is nice.
> >
> > “Roddy, Mark” wrote in message
> news:xxxxx@ntdev…
> > > In fact you ought not to be using memcpy either. The kernel
runtime is
> > > defined by the Rtl… Api. Some of the standard C runtime
intrinsics are
> > > available, however for the most part they are superseded by either
the
> > > equivalent Rtl memory operations or ‘string-safe’ string
operations.
> > >
> > >
> > >
> > > =====================
> > > Mark Roddy
> > >
> > > -----Original Message-----
> > > From: greg jacklin [mailto:xxxxx@hotmail.com]
> > > Sent: Monday, August 02, 2004 3:20 PM
> > > To: Windows System Software Devs Interest List
> > > Subject: Re:[ntdev] using malloc() in driver code !?!
> > >
> > > memcpy copies memory from one address to another while malloc
allocates
> > > pageable memory at user mode. at kernel mode you must allocate
memory
> > form
> > > various pools and using various options not available in malloc.
short
> > > answer: malloc is not available because you shouldn’t use it in
kernel
> > mode.
> > >
> > >
> > > >From: “A.Ilamparithi”
> > > >Reply-To: “Windows System Software Devs Interest List”
> > > >
> > > >To: “Windows System Software Devs Interest List”
> > > >Subject: Re:[ntdev] using malloc() in driver code !?!
> > > >Date: Mon, 2 Aug 2004 23:09:09 -0700
> > > >
> > > >Hi,
> > > >
> > > >I am able to use memcpy inside my driver. But malloc i am not
able to.
> > > >Can you tell me the difference between using malloc() and memcpy
() ?
> > > >
> > > >With Thanks,
> > > >A. Ilamparithi.
> > > >
> > > >
> > > >“Mathieu Routhier” wrote in message
> > > >news:xxxxx@ntdev…
> > > > > Welcome to Windows driver development! Read on about
ExAllocatePool
> > > > > and ExAllocatePoolWithTag
> > > > >
> > > > > Mat
> > > > >
> > > > > -----Original Message-----
> > > > > From: xxxxx@lists.osr.com
> > > > > [mailto:xxxxx@lists.osr.com] On Behalf Of
> > > > > A.Ilamparithi
> > > > > Sent: Tuesday, August 03, 2004 12:04 AM
> > > > > To: Windows System Software Devs Interest List
> > > > > Subject: [ntdev] using malloc() in driver code !?!
> > > > >
> > > > > Hi,
> > > > >
> > > > > Is it is possible to use malloc() in the driver code?
> > > > >
> > > > > With Regards,
> > > > > A.Ilamparithi.
Hi A. Ilamparithi,
Are you writing this driver for a course?
Regards, V. Galchin
— Chuck Batson wrote:
> Not to mention the fact they may be defined
> differently for different
> platforms.
>
> Chuck
>
> ----- Original Message -----
> From: “Don Burn”
> Newsgroups: ntdev
> To: “Windows System Software Devs Interest List”
>
> Sent: Tuesday, August 03, 2004 3:54 AM
> Subject: Re:[ntdev] using malloc() in driver code
> !?!
>
>
> > Yes we know they are defined that way today, can
> you be sure
> tommorrow.
> > That’s why you should use, the Rtl… functions
> and not the mem…
> > functions.
> >
> >
> >
> > –
> > Don Burn (MVP, Windows DDK)
> > Windows 2k/XP/2k3 Filesystem and Driver Consulting
> >
> >
> > “Lyndon J Clarke”
> wrote in message
> > news:xxxxx@ntdev…
> > > In fact … unless defined(_M_AXP64) ||
> defined(_M_IA64) …
> > >
> > > #define
> RtlEqualMemory(Destination,Source,Length)
> > > (!memcmp((Destination),(Source),(Length)))
> > > #define RtlMoveMemory(Destination,Source,Length)
> > > memmove((Destination),(Source),(Length))
> > > #define RtlCopyMemory(Destination,Source,Length)
> > > memcpy((Destination),(Source),(Length))
> > > #define RtlFillMemory(Destination,Length,Fill)
> > > memset((Destination),(Fill),(Length))
> > > #define RtlZeroMemory(Destination,Length)
> memset((Destination),0,(Length))
> > >
> > > … which is nice.
> > >
> > > “Roddy, Mark” wrote in
> message
> > news:xxxxx@ntdev…
> > > > In fact you ought not to be using memcpy
> either. The kernel
> runtime is
> > > > defined by the Rtl… Api. Some of the
> standard C runtime
> intrinsics are
> > > > available, however for the most part they are
> superseded by either
> the
> > > > equivalent Rtl memory operations or
> ‘string-safe’ string
> operations.
> > > >
> > > >
> > > >
> > > > =====================
> > > > Mark Roddy
> > > >
> > > > -----Original Message-----
> > > > From: greg jacklin
> [mailto:xxxxx@hotmail.com]
> > > > Sent: Monday, August 02, 2004 3:20 PM
> > > > To: Windows System Software Devs Interest List
> > > > Subject: Re:[ntdev] using malloc() in driver
> code !?!
> > > >
> > > > memcpy copies memory from one address to
> another while malloc
> allocates
> > > > pageable memory at user mode. at kernel mode
> you must allocate
> memory
> > > form
> > > > various pools and using various options not
> available in malloc.
> short
> > > > answer: malloc is not available because you
> shouldn’t use it in
> kernel
> > > mode.
> > > >
> > > >
> > > > >From: “A.Ilamparithi”
> > > > >Reply-To: “Windows System Software Devs
> Interest List”
> > > > >
> > > > >To: “Windows System Software Devs Interest
> List”
>
> > > > >Subject: Re:[ntdev] using malloc() in driver
> code !?!
> > > > >Date: Mon, 2 Aug 2004 23:09:09 -0700
> > > > >
> > > > >Hi,
> > > > >
> > > > >I am able to use memcpy inside my driver. But
> malloc i am not
> able to.
> > > > >Can you tell me the difference between using
> malloc() and memcpy
> () ?
> > > > >
> > > > >With Thanks,
> > > > >A. Ilamparithi.
> > > > >
> > > > >
> > > > >“Mathieu Routhier”
> wrote in message
> > > > >news:xxxxx@ntdev…
> > > > > > Welcome to Windows driver development!
> Read on about
> ExAllocatePool
> > > > > > and ExAllocatePoolWithTag
> > > > > >
> > > > > > Mat
> > > > > >
> > > > > > -----Original Message-----
> > > > > > From: xxxxx@lists.osr.com
> > > > > > [mailto:xxxxx@lists.osr.com]
> On Behalf Of
> > > > > > A.Ilamparithi
> > > > > > Sent: Tuesday, August 03, 2004 12:04 AM
> > > > > > To: Windows System Software Devs Interest
> List
> > > > > > Subject: [ntdev] using malloc() in driver
> code !?!
> > > > > >
> > > > > > Hi,
> > > > > >
> > > > > > Is it is possible to use malloc() in the
> driver code?
> > > > > >
> > > > > > With Regards,
> > > > > > A.Ilamparithi.
>
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as:
> xxxxx@yahoo.com
> To unsubscribe send a blank email to
> xxxxx@lists.osr.com
>
__________________________________
Do you Yahoo!?
Yahoo! Mail - 50x more storage than other providers!
http://promotions.yahoo.com/new_mail
No matter where and how it is defined, can you imagine memcpy not doing a
copy of a buffer to a buffer?
If the buffers overlap, yeah I can see the problem depending on how memcpy
is implemented. But then you should use memmove instead. Anyways, it’s the
same thing with RtlCopyMemory, it does not support overlapping buffers.
I can’t see how using memcpy instead of RtlCopyMemory could do something
that the programmer did not intend. Can you give an example?
Mat
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Chuck Batson
Sent: Monday, August 02, 2004 11:46 PM
To: Windows System Software Devs Interest List
Subject: Re: Re:[ntdev] using malloc() in driver code !?!
Not to mention the fact they may be defined differently for different
platforms.
Chuck
----- Original Message -----
From: “Don Burn”
Newsgroups: ntdev
To: “Windows System Software Devs Interest List”
Sent: Tuesday, August 03, 2004 3:54 AM
Subject: Re:[ntdev] using malloc() in driver code !?!
> Yes we know they are defined that way today, can you be sure
tommorrow.
> That’s why you should use, the Rtl… functions and not the mem…
> functions.
>
>
>
> –
> Don Burn (MVP, Windows DDK)
> Windows 2k/XP/2k3 Filesystem and Driver Consulting
>
>
> “Lyndon J Clarke” wrote in message
> news:xxxxx@ntdev…
> > In fact … unless defined(_M_AXP64) || defined(_M_IA64) …
> >
> > #define RtlEqualMemory(Destination,Source,Length)
> > (!memcmp((Destination),(Source),(Length)))
> > #define RtlMoveMemory(Destination,Source,Length)
> > memmove((Destination),(Source),(Length))
> > #define RtlCopyMemory(Destination,Source,Length)
> > memcpy((Destination),(Source),(Length))
> > #define RtlFillMemory(Destination,Length,Fill)
> > memset((Destination),(Fill),(Length))
> > #define RtlZeroMemory(Destination,Length)
memset((Destination),0,(Length))
> >
> > … which is nice.
> >
> > “Roddy, Mark” wrote in message
> news:xxxxx@ntdev…
> > > In fact you ought not to be using memcpy either. The kernel
runtime is
> > > defined by the Rtl… Api. Some of the standard C runtime
intrinsics are
> > > available, however for the most part they are superseded by either
the
> > > equivalent Rtl memory operations or ‘string-safe’ string
operations.
> > >
> > >
> > >
> > > =====================
> > > Mark Roddy
> > >
> > > -----Original Message-----
> > > From: greg jacklin [mailto:xxxxx@hotmail.com]
> > > Sent: Monday, August 02, 2004 3:20 PM
> > > To: Windows System Software Devs Interest List
> > > Subject: Re:[ntdev] using malloc() in driver code !?!
> > >
> > > memcpy copies memory from one address to another while malloc
allocates
> > > pageable memory at user mode. at kernel mode you must allocate
memory
> > form
> > > various pools and using various options not available in malloc.
short
> > > answer: malloc is not available because you shouldn’t use it in
kernel
> > mode.
> > >
> > >
> > > >From: “A.Ilamparithi”
> > > >Reply-To: “Windows System Software Devs Interest List”
> > > >
> > > >To: “Windows System Software Devs Interest List”
> > > >Subject: Re:[ntdev] using malloc() in driver code !?!
> > > >Date: Mon, 2 Aug 2004 23:09:09 -0700
> > > >
> > > >Hi,
> > > >
> > > >I am able to use memcpy inside my driver. But malloc i am not
able to.
> > > >Can you tell me the difference between using malloc() and memcpy
() ?
> > > >
> > > >With Thanks,
> > > >A. Ilamparithi.
> > > >
> > > >
> > > >“Mathieu Routhier” wrote in message
> > > >news:xxxxx@ntdev…
> > > > > Welcome to Windows driver development! Read on about
ExAllocatePool
> > > > > and ExAllocatePoolWithTag
> > > > >
> > > > > Mat
> > > > >
> > > > > -----Original Message-----
> > > > > From: xxxxx@lists.osr.com
> > > > > [mailto:xxxxx@lists.osr.com] On Behalf Of
> > > > > A.Ilamparithi
> > > > > Sent: Tuesday, August 03, 2004 12:04 AM
> > > > > To: Windows System Software Devs Interest List
> > > > > Subject: [ntdev] using malloc() in driver code !?!
> > > > >
> > > > > Hi,
> > > > >
> > > > > Is it is possible to use malloc() in the driver code?
> > > > >
> > > > > With Regards,
> > > > > A.Ilamparithi.
—
Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
You are currently subscribed to ntdev as: xxxxx@encentrus.com
To unsubscribe send a blank email to xxxxx@lists.osr.com
Well, since you cannot guarantee that memcpy will be in the kernel, since it
isn’t documented, it could cause a driver in the future not to load. You
discussed memcpy and memmove, this is a good example of the problem of using
standard calls, memcpy was around a lot longer than memmove, until the
problem of overlap bit too many folks. In the kernel, the last thing you
want are calls you cannot trust.
–
Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting
“Mathieu Routhier” wrote in message
news:xxxxx@ntdev…
> No matter where and how it is defined, can you imagine memcpy not doing a
> copy of a buffer to a buffer?
>
> If the buffers overlap, yeah I can see the problem depending on how memcpy
> is implemented. But then you should use memmove instead. Anyways, it’s
the
> same thing with RtlCopyMemory, it does not support overlapping buffers.
>
> I can’t see how using memcpy instead of RtlCopyMemory could do something
> that the programmer did not intend. Can you give an example?
>
> Mat
>
> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com] On Behalf Of Chuck Batson
> Sent: Monday, August 02, 2004 11:46 PM
> To: Windows System Software Devs Interest List
> Subject: Re: Re:[ntdev] using malloc() in driver code !?!
>
> Not to mention the fact they may be defined differently for different
> platforms.
>
> Chuck
>
> ----- Original Message -----
> From: “Don Burn”
> Newsgroups: ntdev
> To: “Windows System Software Devs Interest List”
> Sent: Tuesday, August 03, 2004 3:54 AM
> Subject: Re:[ntdev] using malloc() in driver code !?!
>
>
> > Yes we know they are defined that way today, can you be sure
> tommorrow.
> > That’s why you should use, the Rtl… functions and not the mem…
> > functions.
> >
> >
> >
> > –
> > Don Burn (MVP, Windows DDK)
> > Windows 2k/XP/2k3 Filesystem and Driver Consulting
> >
> >
> > “Lyndon J Clarke” wrote in message
> > news:xxxxx@ntdev…
> > > In fact … unless defined(_M_AXP64) || defined(_M_IA64) …
> > >
> > > #define RtlEqualMemory(Destination,Source,Length)
> > > (!memcmp((Destination),(Source),(Length)))
> > > #define RtlMoveMemory(Destination,Source,Length)
> > > memmove((Destination),(Source),(Length))
> > > #define RtlCopyMemory(Destination,Source,Length)
> > > memcpy((Destination),(Source),(Length))
> > > #define RtlFillMemory(Destination,Length,Fill)
> > > memset((Destination),(Fill),(Length))
> > > #define RtlZeroMemory(Destination,Length)
> memset((Destination),0,(Length))
> > >
> > > … which is nice.
> > >
> > > “Roddy, Mark” wrote in message
> > news:xxxxx@ntdev…
> > > > In fact you ought not to be using memcpy either. The kernel
> runtime is
> > > > defined by the Rtl… Api. Some of the standard C runtime
> intrinsics are
> > > > available, however for the most part they are superseded by either
> the
> > > > equivalent Rtl memory operations or ‘string-safe’ string
> operations.
> > > >
> > > >
> > > >
> > > > =====================
> > > > Mark Roddy
> > > >
> > > > -----Original Message-----
> > > > From: greg jacklin [mailto:xxxxx@hotmail.com]
> > > > Sent: Monday, August 02, 2004 3:20 PM
> > > > To: Windows System Software Devs Interest List
> > > > Subject: Re:[ntdev] using malloc() in driver code !?!
> > > >
> > > > memcpy copies memory from one address to another while malloc
> allocates
> > > > pageable memory at user mode. at kernel mode you must allocate
> memory
> > > form
> > > > various pools and using various options not available in malloc.
> short
> > > > answer: malloc is not available because you shouldn’t use it in
> kernel
> > > mode.
> > > >
> > > >
> > > > >From: “A.Ilamparithi”
> > > > >Reply-To: “Windows System Software Devs Interest List”
> > > > >
> > > > >To: “Windows System Software Devs Interest List”
>
> > > > >Subject: Re:[ntdev] using malloc() in driver code !?!
> > > > >Date: Mon, 2 Aug 2004 23:09:09 -0700
> > > > >
> > > > >Hi,
> > > > >
> > > > >I am able to use memcpy inside my driver. But malloc i am not
> able to.
> > > > >Can you tell me the difference between using malloc() and memcpy
> () ?
> > > > >
> > > > >With Thanks,
> > > > >A. Ilamparithi.
> > > > >
> > > > >
> > > > >“Mathieu Routhier” wrote in message
> > > > >news:xxxxx@ntdev…
> > > > > > Welcome to Windows driver development! Read on about
> ExAllocatePool
> > > > > > and ExAllocatePoolWithTag
> > > > > >
> > > > > > Mat
> > > > > >
> > > > > > -----Original Message-----
> > > > > > From: xxxxx@lists.osr.com
> > > > > > [mailto:xxxxx@lists.osr.com] On Behalf Of
> > > > > > A.Ilamparithi
> > > > > > Sent: Tuesday, August 03, 2004 12:04 AM
> > > > > > To: Windows System Software Devs Interest List
> > > > > > Subject: [ntdev] using malloc() in driver code !?!
> > > > > >
> > > > > > Hi,
> > > > > >
> > > > > > Is it is possible to use malloc() in the driver code?
> > > > > >
> > > > > > With Regards,
> > > > > > A.Ilamparithi.
>
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: xxxxx@encentrus.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>
>
And yet ntddk.h explicitly does not use memcpy or memmove or memset for
AMD64. My guess is that the kernel rtl functions are platform/processor
optimized.
Regardless, the best practice is to use the DDK defined API first, and then
if that falls short - as in the function isn’t defined, rather that
re-writing standard c runtime functions use the available c runtime
intrinsics.
=====================
Mark Roddy
-----Original Message-----
From: Mathieu Routhier [mailto:xxxxx@encentrus.com]
Sent: Tuesday, August 03, 2004 10:08 AM
To: Windows System Software Devs Interest List
Subject: RE: Re:[ntdev] using malloc() in driver code !?!
No matter where and how it is defined, can you imagine memcpy not doing a
copy of a buffer to a buffer?
If the buffers overlap, yeah I can see the problem depending on how memcpy
is implemented. But then you should use memmove instead. Anyways, it’s the
same thing with RtlCopyMemory, it does not support overlapping buffers.
I can’t see how using memcpy instead of RtlCopyMemory could do something
that the programmer did not intend. Can you give an example?
Mat
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Chuck Batson
Sent: Monday, August 02, 2004 11:46 PM
To: Windows System Software Devs Interest List
Subject: Re: Re:[ntdev] using malloc() in driver code !?!
Not to mention the fact they may be defined differently for different
platforms.
Chuck
----- Original Message -----
From: “Don Burn”
Newsgroups: ntdev
To: “Windows System Software Devs Interest List”
Sent: Tuesday, August 03, 2004 3:54 AM
Subject: Re:[ntdev] using malloc() in driver code !?!
> Yes we know they are defined that way today, can you be sure
tommorrow.
> That’s why you should use, the Rtl… functions and not the mem…
> functions.
>
>
>
> –
> Don Burn (MVP, Windows DDK)
> Windows 2k/XP/2k3 Filesystem and Driver Consulting
>
>
> “Lyndon J Clarke” wrote in message
> news:xxxxx@ntdev…
> > In fact … unless defined(_M_AXP64) || defined(_M_IA64) …
> >
> > #define RtlEqualMemory(Destination,Source,Length)
> > (!memcmp((Destination),(Source),(Length)))
> > #define RtlMoveMemory(Destination,Source,Length)
> > memmove((Destination),(Source),(Length))
> > #define RtlCopyMemory(Destination,Source,Length)
> > memcpy((Destination),(Source),(Length))
> > #define RtlFillMemory(Destination,Length,Fill)
> > memset((Destination),(Fill),(Length))
> > #define RtlZeroMemory(Destination,Length)
memset((Destination),0,(Length))
> >
> > … which is nice.
> >
> > “Roddy, Mark” wrote in message
> news:xxxxx@ntdev…
> > > In fact you ought not to be using memcpy either. The kernel
runtime is
> > > defined by the Rtl… Api. Some of the standard C runtime
intrinsics are
> > > available, however for the most part they are superseded by either
the
> > > equivalent Rtl memory operations or ‘string-safe’ string
operations.
> > >
> > >
> > >
> > > =====================
> > > Mark Roddy
> > >
> > > -----Original Message-----
> > > From: greg jacklin [mailto:xxxxx@hotmail.com]
> > > Sent: Monday, August 02, 2004 3:20 PM
> > > To: Windows System Software Devs Interest List
> > > Subject: Re:[ntdev] using malloc() in driver code !?!
> > >
> > > memcpy copies memory from one address to another while malloc
allocates
> > > pageable memory at user mode. at kernel mode you must allocate
memory
> > form
> > > various pools and using various options not available in malloc.
short
> > > answer: malloc is not available because you shouldn’t use it in
kernel
> > mode.
> > >
> > >
> > > >From: “A.Ilamparithi”
> > > >Reply-To: “Windows System Software Devs Interest List”
> > > >
> > > >To: “Windows System Software Devs Interest List”
> > > >Subject: Re:[ntdev] using malloc() in driver code !?!
> > > >Date: Mon, 2 Aug 2004 23:09:09 -0700
> > > >
> > > >Hi,
> > > >
> > > >I am able to use memcpy inside my driver. But malloc i am not
able to.
> > > >Can you tell me the difference between using malloc() and memcpy
() ?
> > > >
> > > >With Thanks,
> > > >A. Ilamparithi.
> > > >
> > > >
> > > >“Mathieu Routhier” wrote in message
> > > >news:xxxxx@ntdev…
> > > > > Welcome to Windows driver development! Read on about
ExAllocatePool
> > > > > and ExAllocatePoolWithTag
> > > > >
> > > > > Mat
> > > > >
> > > > > -----Original Message-----
> > > > > From: xxxxx@lists.osr.com
> > > > > [mailto:xxxxx@lists.osr.com] On Behalf Of
> > > > > A.Ilamparithi
> > > > > Sent: Tuesday, August 03, 2004 12:04 AM
> > > > > To: Windows System Software Devs Interest List
> > > > > Subject: [ntdev] using malloc() in driver code !?!
> > > > >
> > > > > Hi,
> > > > >
> > > > > Is it is possible to use malloc() in the driver code?
> > > > >
> > > > > With Regards,
> > > > > A.Ilamparithi.
—
Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
You are currently subscribed to ntdev as: xxxxx@encentrus.com
To unsubscribe send a blank email to xxxxx@lists.osr.com
—
Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
You are currently subscribed to ntdev as: xxxxx@stratus.com
To unsubscribe send a blank email to xxxxx@lists.osr.com
On Tue, 3 Aug 2004 10:07:57 -0400, you wrote:
No matter where and how it is defined, can you imagine memcpy not doing a
copy of a buffer to a buffer?
I can certainly imagine it compiling memcpy() into a code sequence
which causes problems in kernel mode. On some x86 processors it’s
faster to copy using the floating point registers, for example…
I can’t see how using memcpy instead of RtlCopyMemory could do something
that the programmer did not intend. Can you give an example?
It’s entirely possible for memcpy to make assumptions which don’t hold
in kernel mode; trying to use the floating point unit would be one.
James.
The only way it could be useful is if ( and remotely if ) when I linked my
driver with , the linker should copy only those function to my module space,
and that
does not happen ( so the codes stays there in userspace )… Even it happens
then
all the driver would have its own copy, and that is not necessarily good !
On the otherhand, if the loader does not catch the privilage level of the
segments it is
or some of its ancilliary trying to create then the whole business of
protection is
gone, I CAN HAVE A LIST USING malloc() that would have elements all over the
user and
kernel space… Now no one needs write a virus, its all infected
Finally providing a few solid kernel sharable runtime library routines serve
both purpose
I suppose ( no redundant kernel codes, and protection between usr/krnl ) !!!
CPL/DPL …
-pro
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of James
Sent: Tuesday, August 03, 2004 8:33 AM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] using malloc() in driver code !?!
On Tue, 3 Aug 2004 10:07:57 -0400, you wrote:
No matter where and how it is defined, can you imagine memcpy not doing a
copy of a buffer to a buffer?
I can certainly imagine it compiling memcpy() into a code sequence
which causes problems in kernel mode. On some x86 processors it’s
faster to copy using the floating point registers, for example…
I can’t see how using memcpy instead of RtlCopyMemory could do something
that the programmer did not intend. Can you give an example?
It’s entirely possible for memcpy to make assumptions which don’t hold
in kernel mode; trying to use the floating point unit would be one.
James.
Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
You are currently subscribed to ntdev as: xxxxx@garlic.com
To unsubscribe send a blank email to xxxxx@lists.osr.com