Jump to content
The simFlight Network Forums

possible to disable a DLL? (soundstream)

Recommended Posts

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?

Link to comment
Share on other sites

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.



Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.