Re: Allocating console
From: Slava M. Usov (stripit.slough_at_gmx.net)
Date: 03/01/04
- Next message: V.V.Gatt_at_nospam.com: "Re: Writing a correct MBRfrom User Mode"
- Previous message: Slava M. Usov: "Re: VirtualLock Question / MTRRs"
- In reply to: qfel: "Allocating console"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 1 Mar 2004 14:55:39 +0100
"qfel" <as_in_nick@astercity.net> wrote in message
news:c1v8i4$2v84$1@mamut.aster.pl...
> I'm injecting my DLL which uses console into some process, which runs in
> GUI subsystem. I can use AllocConsole in DLL, but CRTL's stdin/out/err and
> STL's cin/cout/cerr aren't reinitialized, so I cannot use them. I thought
> I could inject the DLL, alloc console, free the DLL and inject it again,
> but it should work only with static linked libraries (target process can
> use msvcr70 etc so initialization won't be performed each time my DLL is
> loaded). Or is there any way to re-init cin/cout/cerr?
stdin, stdout and stderr are simply pointers to the FILE structure that
represents the standard streams. So you can simply overwrite that structure
with whatever other stream you have. Notice you cannot just overwrite the
pointers, because they may be cached somewhere.
So: *stdout = *fopen();
S
- Next message: V.V.Gatt_at_nospam.com: "Re: Writing a correct MBRfrom User Mode"
- Previous message: Slava M. Usov: "Re: VirtualLock Question / MTRRs"
- In reply to: qfel: "Allocating console"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|