Breaking the monolithic Filter dll.

An issue came up recently where the architecture of one of our filters had to be changed. The change involved making the filter dll dependent on a few other dlls dropped during the installation process.

 As with all revolutionary changes, the Search Daemon revolted when we tried to index contents using this new incarnation of the filter.After few hours of breaking my head with windbg, it came to light that while the filter dll was made dependent on some other dll’s (in the same folder) , we still used the old COM : LoadLibrary call to load the filter.Now since the installation folder of the filter dll was not included in the system path, when the filter dll made calls to the other dll’s, the system crashed as it had no idea how to locate these dependent dlls.

If you find yourself running into the same situation, the workaround is simple: Just add the directory of installation (where the filter and dependent dlls reside) to your system path.Ideally, your installer should do this to prevent revolting actions by the software. 

The other alternative is to use WINAPI <SetDllDirectory> function call which adds a SearchPath used to locate DLLs for the application. For details, please refer to: 

Comments (5)

  1. Marc Brooks says:

    Please make it clear that you should be doing this PATH setting only inside the process. We do NOT need yet another program adding itself to our PATH environment variable for the once-in-a-million time it might be needed.

  2. Deb says:

    I agree that the second alternative is preferred to adding a new entry in the PATH variable.

  3. Dmitry Kuzmenko says:

    If you have control over your filter DLLs, I think, the best work around would be to make the first DLL know the location of another and use explicit linking (with LoadLibrary and full path). In this case there would be no need to modify %PATH%.

  4. Ever since I started dealing with filters, I’ve seen numerous questions regarding "What does the proper

  5. 話題の小向美奈子ストリップを隠し撮り!入念なボディチェックをすり抜けて超小型カメラで撮影した神動画がアップ中!期間限定配信の衝撃的映像を見逃すな