0

Im reading in an address from user-space and using RtlCopyMemory() to copy data over to my output buffer and although I have it working, it lacks any safe guarding against invalid addresses being read which will throw a bug check in my face.

I know that I need to use SEH to do this but I am not sure what exceptions I need to be handling or if RtlCopyMemory even throws any exceptions. If not, how can I check that the address is valid before I pass it into RtlCopyMemory()?

1 Answers1

0

Read about ProbeForRead and ProbeForWrite, additionally I suggest you the following reading:

http://download.microsoft.com/download/d/1/d/d1dd7745-426b-4cc3-a269-abbbe427c0ef/sys-t774_ddc08.pptx

and

http://www.codeproject.com/Articles/9575/Driver-Development-Part-Introduction-to-Implemen