It's very simple. If have have an exe MyApp.Exe, then do this:
exehdr /V MyApp.exe | find "imp"
It will list all the imports. If you find something like this:
REL OFF(32) 0014 imp DOSCALLS.286
then you know that this exe uses DosBeep.
You then run:
dllrname /N /Q MyApp.exe DOSCALLS=NEWCALLS
You then rerun:
exehdr /V MyApp.exe | find "imp"
Now it will show this:
REL OFF(32) 0014 imp NEWCALLS.286
and you will know that from now on, the new DosBeep Implementation will be called. It works the very same way to patch a DLL.
I have written this simple app, file bla.c:
#define INCL_BASE
#include <os2.h>
int main(int argc,char *argv[])
{
DosBeep(1000,1000);
return 0;
}
and build it with:
icc -Gm+ -Gd+ -Ge+ bla.c
dllrname /N /Q bla.exe DOSCALLS=NEWCALLS /* this does the interesting part */
When I now run bla.exe, I can hear the Beep via my Speakers driven by Uniaud or via the Speakers connected via Audio USB, whatever device I choose as the default WAV device (the default WAV device will be used to play the sound).
By the way: use my USBAUDIO.ZIP package to have everything to work with USB audio. And it also comes with a DLL that extends the Multimedia Setup Object to allow you to simply switch the default WAV device with a mouse click. Of course that works across the board, not only for the USB audio device but also for the UNIAUD device.
Lars