Re: stop sounds of a different process
- From: Oded <Oded@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Sun, 22 Jun 2008 05:43:01 -0700
Hi (sorry for the long thread)...
I have another small issue which i can't seem to resolve.
using detour library i managed to cause the application i'm hooking not to
use dsound.dll (direct sound) and force it to use waveout API (i hooked the
LoadLibrary and return NULL when i received the LoadLibrary("dsound.dll")
request).
Anyway i know the application is using the fmod library (for sounds API)
which supports both (waveOut and direct sound) so it works fine (this is just
a temporary hook for testing).
the problem is - although i get waveOutOpen/Write/Close calls in my hooks,
these are only called once the application is initialized. Afterward during
its run, and when sound for example is played when user press button /
animation starts, i do not see any waveOutWrite calls (which one would
expect) but i can hear the sound.
I also see that if in the original waveOutWrite calls which i received (in
my hook) i do not perform the actual write and just return MMSYSERR_NOERROR,
there is no sound in the game at all (which does make sense...).
i couldn't find any other API (checked also waveOutRestart) which might be
used instead.
Any ideas?
10x.
"Oded" wrote:
i'm now using the detour library which seems to do the job..
thanks for the tip.
"Alessandro Angeli" wrote:
From: "Oded"
Thanks for the quick response. it took me a while but i
managed to make the hooking work (i'm using some
HookImportFunction which was written by codeproject
http://www.codeproject.com/KB/DLL/hookimport.aspx ).
however, i'm trying to hook some of the winmm.dll
functions, and while i can hook the waveOutOpen, i'm
unable to hook the PlaySound.
When i look at the "dll API" using "dependecy walker"
(going from the exe which i try to hook, not directly
from the dll winmm.dll) i see that i can only get access
to functions of winmm.dll with a "green C" box next to
them and which do not have a bounded entry point. while
all the rest (including among them PlaySound) are not
accesiable.
anyway idea what's the difference between the 2 function
groups?
The code you are using patches the DLL's IAT, which is
tricky and, not knowing the details on how and when you hook
what and where, it is hard to say. A safer hooking technique
works by patching the function itself (see my FAQ). In any
case, PlaySound() itself should only be an high-level
function that uses waveOut or DirectSound underneath, which
means that hooking those will automatically take care of
PlaySound and other high-level functions as well.
--
// Alessandro Angeli
// MVP :: DirectShow / MediaFoundation
// mvpnews at riseoftheants dot com
// http://www.riseoftheants.com/mmx/faq.htm
- Follow-Ups:
- Re: stop sounds of a different process
- From: Alessandro Angeli
- Re: stop sounds of a different process
- References:
- Re: stop sounds of a different process
- From: Alessandro Angeli
- Re: stop sounds of a different process
- From: Oded
- Re: stop sounds of a different process
- From: Alessandro Angeli
- Re: stop sounds of a different process
- Prev by Date: It's any menthod to detect microphone plugin ?
- Next by Date: Re: stop sounds of a different process
- Previous by thread: Re: stop sounds of a different process
- Next by thread: Re: stop sounds of a different process
- Index(es):
Relevant Pages
|