Replacing Characters within a TTY Printer Driver (W2003)
Posted on 2004-03-29
This is my first question here, and I'm not a C++ guy, but I've been asked to find a way to swap some characters out in a simple TTY printer driver. The idea is to replace some weird control codes coming from one application before they get to the printer and mess up the output.
For this problem, I'd be happy to have the capability to switch "The quick brown fox" to "The slow brown fox" inside the standard TTY driver, for example -- in other words, to always find and switch "slow" for "quick". In the real application, of course, it's more a string of relatively meaningless control characters.
I've been trying to modify the oemcom.cpp generic text driver provided with the Windows DDK, but I'm getting nowhere.
I tried modifying OutputCharStr in oemcom.cpp, for example:
// Hello World??
char* HelloWorld = "Hello World";
pMyStuff->aubSpoolBuf = (PBYTE) &HelloWorld;
and it at least doesn't crash, but just gives me funky characters before and after the main text is printed - presumably related to header and footer information for the document.
It seems like there ought to be a string somewhere that could be modified as required, but I'm not finding it.
Thanks for any help.