#1639 SciLexer.dll unregisters window classes it did not register

Bug
closed-fixed
Neil Hodgson
5
2014-09-30
2014-08-08
Holger Stenger
No

When initialization of SciLexer.dll fails it will try to unregister the Scintilla and CallTip window classes. This happens even if it did not successfully register those window classes. This may result in the unregistration of window classes registered by another DLL. I observed this behaviour on Windows 8.1 (x64).

Background: I am working on a plugin for the foobar2000 audio player. There is also another plugin which uses Scintilla. If both plugins are installed each will try to load its copy of SciLexer.dll. This results in the aboce failure conditions where one copy of SciLexer.dll remains loaded but its window classes are unregistered.

The attached patch adds book-keeping to unregister only the window classes which were successfully registered.

1 Attachments

Discussion

  • Neil Hodgson
    Neil Hodgson
    2014-08-09

    This issue will be investigated after the 3.5.0 release which should occur August 13.

     
  • Neil Hodgson
    Neil Hodgson
    2014-08-09

    • status: open --> open-later
    • assigned_to: Neil Hodgson
     
  • Holger Stenger
    Holger Stenger
    2014-08-09

    Okay. To fix my original problem I built SciLexer.dll as a side-by-side assembly. This allows multiple copies/versions of Scintilla to co-exist in a process. I can provide a patch for this as well if you want.

     
    • Neil Hodgson
      Neil Hodgson
      2014-08-10

      I haven't looked into any of the issues involved in supporting multiple copies of Scintilla within a process. It would be worthwhile attaching a copy of the side-by-side code here so that anyone can use it even if it doesn't get committed to Scintilla.

       
  • Holger Stenger
    Holger Stenger
    2014-08-15

    The attached patch contains the necessary changes to build a 32 bit version of Scintilla as side-by-side assembly. It basically adds a manifest resource and defines the ISOLATION_AWARE_ENABLED macro in the preprocessor settings. The manifest has to be changed for a 64 bit build (see the processorArchitecture attribute).

    Using this version of Scintilla from an executable or another DLL works similar to using Common Controls 6. You have to add dependency in your manifest and define the ISOLATION_AWARE_ENABLED macro. If you let the linker generate the manifest the following pragma will do the trick:

    #pragma comment(linker,"\"/manifestdependency:type='win32' \
    name='SciLexer' version='3.4.4.0' \
    processorArchitecture='*' language='*'\"")
    
     
  • Neil Hodgson
    Neil Hodgson
    2014-08-18

    • status: open-later --> open-fixed
     
  • Neil Hodgson
    Neil Hodgson
    2014-08-18

    Committed the unregistration changes as [5bb1b4].

    Since the manifest has to be different for 32 and 64 bit builds it doesn't look like it should go in for now. Including the patch on this tracker does make it available to anyone needing it.

     

    Related

    Commit: [5bb1b4]

  • Neil Hodgson
    Neil Hodgson
    2014-09-30

    • status: open-fixed --> closed-fixed