strcpy question

Is it OK to use strcpy in drivers ?

It’s legal but a very Bad Idea since it could easily cause buffer overruns.
Use the Safe String functions like RtlStringCbCopy (and associated
variants), or better yet RtlCopyString and RtlCopyUnicodeString.

Ken

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Abhijit
Sent: Monday, March 29, 2004 6:54 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] strcpy question

Is it OK to use strcpy in drivers ?


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@comcast.net
To unsubscribe send a blank email to xxxxx@lists.osr.com

No.

Loren

----- Original Message -----
From: “Abhijit”
Newsgroups: ntdev
To: “Windows System Software Devs Interest List”
Sent: Monday, March 29, 2004 3:53 AM
Subject: [ntdev] strcpy question

> Is it OK to use strcpy in drivers ?
>
>
>
> —
> Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: xxxxx@earthlink.net
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>

You can, but it is by far better to use routines from NtStrSafe.h.

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

----- Original Message -----
From: “Abhijit”
Newsgroups: ntdev
To: “Windows System Software Devs Interest List”
Sent: Monday, March 29, 2004 3:53 PM
Subject: [ntdev] strcpy question

> Is it OK to use strcpy in drivers ?
>
>
>
> —
> Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: xxxxx@storagecraft.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com