Click here to Skip to main content
15,905,316 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: RaceX - A 2D Racing Game using DirectDraw by Mauricio Ritter Pin
joshfl23-Oct-03 10:10
joshfl23-Oct-03 10:10 
GeneralThe Invasion Game Pin
ypo_cnihtmarcher21-Oct-03 10:55
ypo_cnihtmarcher21-Oct-03 10:55 
GeneralRe: The Invasion Game Pin
David Crow21-Oct-03 11:03
David Crow21-Oct-03 11:03 
GeneralRe: The Invasion Game Pin
Rafael Fernández López21-Oct-03 11:49
Rafael Fernández López21-Oct-03 11:49 
GeneralDebugging an ATL Dll using a manged application Pin
Rainer Mangold21-Oct-03 10:31
Rainer Mangold21-Oct-03 10:31 
GeneralRe: Debugging an ATL Dll using a manged application Pin
igor196021-Oct-03 11:21
igor196021-Oct-03 11:21 
GeneralRe: Debugging an ATL Dll using a manged application Pin
Rainer Mangold21-Oct-03 11:39
Rainer Mangold21-Oct-03 11:39 
GeneralDynamically creating variable length argument list Pin
Kentamanos21-Oct-03 9:47
Kentamanos21-Oct-03 9:47 
I hate variable length argument functions in C++, but for what I'm doing, I have no choice using it Smile | :) .

I'm trying to insert a DLL Hook for a DLL that contains a function that has a variable length argument list (it has ... as a parameter). I want to do some processing with what they pass in, and then forward the call to the original function (the one in the DLL that was hooked). My question is how can I forward this function call? How do I dynamically create the parameters for this function call?

To help with my explantaion, imagine I'm hooking wsprintf. This function takes two parameters and then a variable number of arguments after this. I know how to read the arguments they've passed in (obviously the first 2 are easy, and then you have to pull out the variable length remaining parameters). Once I have this information, how do I then create a new call with the first two parameters as normal, and then tag on the variable length arguments after them? If I want to hook wsprintf in this example, do some processing on that function, and then pass it thru to the original, I've got to be able to do this.

Anyone have any ideas? Please let me know if you don't understand my problem too.

Thanks,
Kentamanos
GeneralRe: Dynamically creating variable length argument list Pin
David Crow21-Oct-03 10:01
David Crow21-Oct-03 10:01 
GeneralRe: Dynamically creating variable length argument list Pin
21-Oct-03 10:12
suss21-Oct-03 10:12 
GeneralRe: Dynamically creating variable length argument list Pin
David Crow21-Oct-03 11:02
David Crow21-Oct-03 11:02 
GeneralRe: Dynamically creating variable length argument list Pin
Kentamanos21-Oct-03 11:27
Kentamanos21-Oct-03 11:27 
GeneralRe: Dynamically creating variable length argument list Pin
David Crow21-Oct-03 17:06
David Crow21-Oct-03 17:06 
GeneralRe: Dynamically creating variable length argument list Pin
Kentamanos22-Oct-03 6:38
Kentamanos22-Oct-03 6:38 
GeneralRe: Dynamically creating variable length argument list Pin
David Crow22-Oct-03 7:34
David Crow22-Oct-03 7:34 
GeneralRe: Dynamically creating variable length argument list Pin
WREY21-Oct-03 11:26
WREY21-Oct-03 11:26 
GeneralRe: Dynamically creating variable length argument list Pin
Kentamanos21-Oct-03 11:47
Kentamanos21-Oct-03 11:47 
GeneralRe: Dynamically creating variable length argument list Pin
WREY21-Oct-03 12:58
WREY21-Oct-03 12:58 
GeneralRe: Dynamically creating variable length argument list Pin
Kentamanos21-Oct-03 13:19
Kentamanos21-Oct-03 13:19 
GeneralRe: Dynamically creating variable length argument list Pin
WREY21-Oct-03 14:23
WREY21-Oct-03 14:23 
GeneralRe: Dynamically creating variable length argument list Pin
Kentamanos22-Oct-03 6:41
Kentamanos22-Oct-03 6:41 
GeneralRe: Dynamically creating variable length argument list Pin
John R. Shaw21-Oct-03 15:21
John R. Shaw21-Oct-03 15:21 
GeneralC++ Question. Pin
WREY21-Oct-03 9:41
WREY21-Oct-03 9:41 
GeneralRe: C++ Question. Pin
David Crow21-Oct-03 9:46
David Crow21-Oct-03 9:46 
GeneralRe: C++ Question. Pin
WREY21-Oct-03 10:30
WREY21-Oct-03 10:30 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.