Jump to content


Photo

possible to disable a DLL? (soundstream)


  • Please log in to reply
1 reply to this topic

#1 guenseli

guenseli

    Advanced Member

  • Members
  • PipPipPip
  • 468 posts
  • LocationBerlin

Posted 08 August 2012 - 12:40 PM

Hello Pete,

maybe a bit of uncommon question:

is there a way to disable an DLL?


Background is, I use Flight1 Soundstream (what I find absolut brilliant - If you don't know it, it plays FSX sound even when FSX window is not in focus. I have two monitors.)

Unfortunately I have two addons which let FSX crash, or better said, Soundstream crashes FSX when I use these plane-addons.
Windows error log shows clearly soundstream.dll to be the cause.

Unfortunately #2, the Soundstream support (if there is any?) has no solution.


Soundstream is a DLL located in D:\Flight One Software\Flight1 SoundStream\Flight1SoundStreamFSX.dll and has entry in the DLL.xml. Disabling this entry solves the crashes of course.
Soundstream has no process in the taskmanager.


Could it now be possible in any way to disable this DLL when one of these planes gets loaded? via LUA/LINDA?
Or any other idea about this?

I fear, that there is no solution, but I just wanted to ask.
Or do you have an idea how to make play FSX sounds when window is not active?



Many thanks for any suggestions?
  • 0

#2 Pete Dowson

Pete Dowson

    Advanced Member

  • Moderators
  • 26,942 posts
  • LocationNear Stoke-on-Trent, UK

Posted 08 August 2012 - 01:18 PM

is there a way to disable an DLL?


If it is already loaded and therefore running, no, not really without its cooperation. If you forcibly unloaded it whilst it was running and had links into things it would simply cause a crash. I doubt that forced unloading would work when a program is actually running in any case.

If it has a Windows procedure of its own and is processing messages then you might be able to get it to close up shop by sending it a WM_CLOSE or WM_QUIT message, but it is most unlikely that it would have its own (it will simply hook onto the main FS Windows Procedure0, and even if it did it may not act on such a message anyway, or may forward it on to FS so closing everything.

Or do you have an idea how to make play FSX sounds when window is not active?


This is only a "cooperative level" flag in one or other of the DirectSound calls FSX is making to Windows. You will notice that the Lua sound library I implemented has an option to play sounds whilst the focus is lost. it is not hard. To make FSX sounds operate so there would be two ways possible i think:

1. Find where, in the code, it makes the calls and patch the data it is sending to set the options correctly, or
2. Hook the calls to DirectSound and modify the parameters on-the-fly

The latter would be relatively easy for 'normal' function calls into Windows DLLs, but the sounds are using a COM type interface, where these's only the one function call directly hookable (the one to create the COM object. The call to play a sound, and which features the flag (DSBCAPS_GLOBALFOCUS) which causes it to be focus-bound, is a virtual function call, using the table of functions provided via the object pointer. So it gets very complicated.

The former would involve trying to analyse the code (maybe all in FSX's "SOUND.DLL"?) to see where the parameter for the call is formed and patching that. It's actually removing a bit that's needed -- the 2^31 bit, 0r 0x00008000, in the Flags for the DSBUFFERDESC structure passed to the object's IDirectSound_CreateSoundBuffer function.

Analysing code using these indirect methods is no fun and can take many many hours with no guarantee of success.

Regards
Pete
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users


About simFlight - simflight.com - simflight.de - simflight.fr - simflight.nl - simflight.pt - simflight.es - simflight.it - simflight.jp - simrussia.com - simMarket