Is it safe to use memcpy or memmove functions in the kernel or is it better to use the Rtl equivalents?
Thanks
-Johnny
Join the world’s largest e-mail service with MSN Hotmail. Click Here
Is it safe to use memcpy or memmove functions in the kernel or is it better to use the Rtl equivalents?
Thanks
-Johnny
Join the world’s largest e-mail service with MSN Hotmail. Click Here
I have used both without any problems, but prefer to use Rtlxxx functions.
Johnny
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of Johnny D
Sent: Dienstag, 14. Mai 2002 20:43
To: NT Developers Interest List
Subject: [ntdev] usage of memcpy in kernel
Is it safe to use memcpy or memmove functions in the kernel or is it
better to use the Rtl equivalents?
Thanks
-Johnny
You are currently subscribed to ntdev as: xxxxx@yahoo.de
To unsubscribe send a blank email to %%email.unsub%%
from wdm.h:
#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))
-----Original Message-----
From: Johnny [mailto:xxxxx@yahoo.de]
Sent: Wednesday, May 15, 2002 2:40 AM
To: NT Developers Interest List
Subject: [ntdev] RE: usage of memcpy in kernel
I have used both without any problems, but prefer to use Rtlxxx functions.
Johnny
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of Johnny D
Sent: Dienstag, 14. Mai 2002 20:43
To: NT Developers Interest List
Subject: [ntdev] usage of memcpy in kernel
Is it safe to use memcpy or memmove functions in the kernel or is it better
to use the Rtl equivalents?
Thanks
-Johnny
Join the world’s largest e-mail service with MSN Hotmail. Click Here
http:
—
You are currently subscribed to ntdev as: xxxxx@yahoo.de
To unsubscribe send a blank email to %%email.unsub%%
—
You are currently subscribed to ntdev as: xxxxx@setengineering.com
To unsubscribe send a blank email to %%email.unsub%%</http:>
You will find that the RtlXxx functions call memcpy.
–
Gary G. Little
xxxxx@broadstor.com
xxxxx@inland.net
“Johnny D” wrote in message news:xxxxx@ntdev…
Is it safe to use memcpy or memmove functions in the kernel or is it better to use the Rtl equivalents?
Thanks
-Johnny
------------------------------------------------------------------------------
Join the world’s largest e-mail service with MSN Hotmail. Click Here
So much for those Rtl equivalents!. Wonder if these should be deprecated?. Maybe the reason they were introduced (alignment issues on Alpha??) disappeared somewhere along the line.
Thanks
-Johnny
From: Gera Kazakov
>Reply-To: “NT Developers Interest List”
>To: “NT Developers Interest List”
>Subject: [ntdev] RE: usage of memcpy in kernel
>Date: Wed, 15 May 2002 06:53:34 -0700
>
>from wdm.h:
>
>#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))
>
>
>
>-----Original Message-----
>From: Johnny [mailto:xxxxx@yahoo.de]
>Sent: Wednesday, May 15, 2002 2:40 AM
>To: NT Developers Interest List
>Subject: [ntdev] RE: usage of memcpy in kernel
>
>
>I have used both without any problems, but prefer to use Rtlxxx functions.
>
>
>Johnny
>
>
>-----Original Message-----
>From: xxxxx@lists.osr.com
>[mailto:xxxxx@lists.osr.com]On Behalf Of Johnny D
>Sent: Dienstag, 14. Mai 2002 20:43
>To: NT Developers Interest List
>Subject: [ntdev] usage of memcpy in kernel
>
>
>Is it safe to use memcpy or memmove functions in the kernel or is it better
>to use the Rtl equivalents?
>
>
>Thanks
>-Johnny
>
> _____
>
>Join the world’s largest e-mail service with MSN Hotmail. Click Here
><http: g.msn.com>
>—
>You are currently subscribed to ntdev as: xxxxx@yahoo.de
>To unsubscribe send a blank email to %%email.unsub%%
>
>—
>You are currently subscribed to ntdev as: xxxxx@setengineering.com
>To unsubscribe send a blank email to %%email.unsub%%
>
>
>
>—
>You are currently subscribed to ntdev as: xxxxx@hotmail.com
>To unsubscribe send a blank email to %%email.unsub%%
</http:>
Chat with friends online, try MSN Messenger: Click Here
Not so … using the RtlXxxx functions keeps you within the bounds of the DDK. Suppose someone at MS has a cranial infarction and comes up with a better way of doing things than memcpy, and they remove the memXxx functions from the build libs? Now you are up the proverbial poopy creek without a paddle until you resolve the memcpy undefined yourself.
–
Gary G. Little
xxxxx@broadstor.com
xxxxx@inland.net
“Johnny D” wrote in message news:xxxxx@ntdev…
So much for those Rtl equivalents!. Wonder if these should be deprecated?. Maybe the reason they were introduced (alignment issues on Alpha??) disappeared somewhere along the line.
Thanks
-Johnny
>From: Gera Kazakov
>Reply-To: “NT Developers Interest List”
>To: “NT Developers Interest List”
>Subject: [ntdev] RE: usage of memcpy in kernel
>Date: Wed, 15 May 2002 06:53:34 -0700
>
>from wdm.h:
>
>#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))
>
>
>
>-----Original Message-----
>From: Johnny [mailto:xxxxx@yahoo.de]
>Sent: Wednesday, May 15, 2002 2:40 AM
>To: NT Developers Interest List
>Subject: [ntdev] RE: usage of memcpy in kernel
>
>
>I have used both without any problems, but prefer to use Rtlxxx functions.
>
>
>Johnny
>
>
>-----Original Message-----
>From: xxxxx@lists.osr.com
>[mailto:xxxxx@lists.osr.com]On Behalf Of Johnny D
>Sent: Dienstag, 14. Mai 2002 20:43
>To: NT Developers Interest List
>Subject: [ntdev] usage of memcpy in kernel
>
>
>Is it safe to use memcpy or memmove functions in the kernel or is it better
>to use the Rtl equivalents?
>
>
>Thanks
>-Johnny
>
> _____
>
>Join the world’s largest e-mail service with MSN Hotmail. Click Here
>
>—
>You are currently subscribed to ntdev as: xxxxx@yahoo.de
>To unsubscribe send a blank email to %%email.unsub%%
>
>—
>You are currently subscribed to ntdev as: xxxxx@setengineering.com
>To unsubscribe send a blank email to %%email.unsub%%
>
>
>
>—
>You are currently subscribed to ntdev as: xxxxx@hotmail.com
>To unsubscribe send a blank email to %%email.unsub%%
------------------------------------------------------------------------------
Chat with friends online, try MSN Messenger: Click Here
| Norbert Kawulski | mailto:xxxxx@stollmann.de |
| Stollmann E+V GmbH, Development | http://www.stollmann.de |
–If it’s ISDN or Bluetooth, make sure it’s driven by Stollmann–
"Those who expect to reap the blessings of Freedom must undergo the
fatigue of supporting it. - Thomas Paine "
Not so … using the RtlXxxx functions keeps you within the bounds
of the DDK. Suppose someone at MS has a cranial infarction and comes
up with a better way of doing things than memcpy, and they remove
the memXxx functions from the build libs? Now you are up the
proverbial poopy creek without a paddle until you resolve the memcpy
undefined yourself.
Hmmm … and if memcpy ain’t in any kernel lib that you can link with,
you’re back in that smelly river and you still need that paddle. The point
is that RtlMemCopy is the “proper” way of doing things, where as memcpy sets
you up for failure.
–
Gary G. Little
xxxxx@broadstor.com
xxxxx@inland.net
“Norbert Kawulski” wrote in message news:xxxxx@ntdev…
>
>
> Yeah, in that case you have to
> #define memcpy(a,b,c) RtlMemCopy(a,b,c)
> You do not need a paddle here. The creek flows to your destination
> -----------------------------------------------------------------
> | Norbert Kawulski | mailto:xxxxx@stollmann.de |
> | Stollmann E+V GmbH, Development | http://www.stollmann.de |
> --If it’s ISDN or Bluetooth, make sure it’s driven by Stollmann–
>
> "Those who expect to reap the blessings of Freedom must undergo the
> fatigue of supporting it. - Thomas Paine "
>
> > Not so … using the RtlXxxx functions keeps you within the bounds
> > of the DDK. Suppose someone at MS has a cranial infarction and comes
> > up with a better way of doing things than memcpy, and they remove
> > the memXxx functions from the build libs? Now you are up the
> > proverbial poopy creek without a paddle until you resolve the memcpy
> > undefined yourself.
>
>
>
It is easy to accidentally use something from string.h, as I found when
ported-over code compiled and linked without error, even though it
referenced memcpy() and I link without standard libs. When I noticed the
source was calling memcpy(), I was suprised. I found that the memcpy() was
inlined, and wondering why the compiler did not complain, I found that the
NT4 DDK includes string.h, via ntddk.h:
//
// for move macros
//
#include <string.h>
Bart.
Johnny D wrote in message news:xxxxx@ntdev…
Is it safe to use memcpy or memmove functions in the kernel or is it better
to use the Rtl equivalents?
Thanks
-Johnny
Join the world’s largest e-mail service with MSN Hotmail. Click Here</string.h>