-
January 16th, 2010, 02:44 AM
#1
Detours?
I want to know what the difference of this detour would be
Code:
DWORD WINAPI MYFUNCTION (int num1, file *filename, DWORD size)
{
originalMYFUNCTION(num1, filename, size);
num1 = NULL;
filename = NULL;
size = NULL;
return NULL;
}
DWORD WINAPI MYFUNCTION (int num1, file *filename, DWORD size)
{
return NULL;
}
Basically I want the function to return NULL and return null pointers and any values passed back to the main program as NULL. Which of these detoured functions is accomplishing that?
-
January 16th, 2010, 09:13 AM
#2
Re: Detours?
Parameters are not "passed back to the main program" unless they are passed by reference. All the assignment you are doing in the first function is done on copies of those parameters passed to the function.
-
January 16th, 2010, 01:51 PM
#3
Re: Detours?
Originally Posted by hoxsiew
Parameters are not "passed back to the main program" unless they are passed by reference. All the assignment you are doing in the first function is done on copies of those parameters passed to the function.
But say its pass by reference, in the first function would they receive NULL, or would they receive whatever is passed back from the orig function
-
January 16th, 2010, 02:04 PM
#4
Re: Detours?
hello
essetially you have over written the values what the Oginal function has returned. so you will receives NULL only.
regards
deepak
-
January 16th, 2010, 02:04 PM
#5
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|