When the SoftLock plugin is *not* enabled, and you try
to configure it, the plugin doesn't get properly
initialized. Subsequently, the screen saver drop down
has no items and an ArgumentOutOfRangeException is
thrown when you try to do anything because asumptions
are made that there will always be items in the drop down.
-------------- Stack Trace ----------------
System.ArgumentOutOfRangeException:
InvalidArgument=Value of '0' is not valid for
'SelectedIndex'.
Parameter name: SelectedIndex
at
System.Windows.Forms.ComboBox.set_SelectedIndex(Int32
value)
at
SoftLock.ConfigureSoftLockPlugin.cancelBtn_Click(Object
sender, EventArgs e)
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at
System.Windows.Forms.Button.OnMouseUp(MouseEventArgs
mevent)
at System.Windows.Forms.Control.WmMouseUp(Message&
m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at
System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message&
m)
at
System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message&
m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr
hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
************** Loaded Assemblies **************
mscorlib
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase:
file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
----------------------------------------
UsbWirelessSecurity
Assembly Version: 2.1.2359.38073
Win32 Version: 2.1.2359.38073
CodeBase:
file:///C:/Program%20Files/PatchAdvisor%20Labs/USB%20Wireless%20Security/UsbWirelessSecurity.exe
----------------------------------------
System.Windows.Forms
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase:
file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase:
file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Drawing
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase:
file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
System.Configuration
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase:
file:///C:/WINDOWS/assembly/GAC_MSIL/System.Configuration/2.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
System.Xml
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase:
file:///C:/WINDOWS/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
UsbWirelessSecurity.Core
Assembly Version: 2.0.2359.38071
Win32 Version: 2.0.2359.38071
CodeBase:
file:///C:/Program%20Files/PatchAdvisor%20Labs/USB%20Wireless%20Security/UsbWirelessSecurity.Core.DLL
----------------------------------------
Default Plugins VB
Assembly Version: 0.0.0.0
Win32 Version: 0.0.0.0
CodeBase:
file:///C:/Program%20Files/PatchAdvisor%20Labs/USB%20Wireless%20Security/Default%20Plugins%20VB.DLL
----------------------------------------
Microsoft.VisualBasic
Assembly Version: 8.0.0.0
Win32 Version: 8.0.50727.42 (RTM.050727-4200)
CodeBase:
file:///C:/WINDOWS/assembly/GAC_MSIL/Microsoft.VisualBasic/8.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualBasic.dll
----------------------------------------
Interop.Messenger
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase:
file:///C:/Program%20Files/PatchAdvisor%20Labs/USB%20Wireless%20Security/Interop.Messenger.DLL
----------------------------------------
DefaultPlugins
Assembly Version: 2.0.2359.38073
Win32 Version: 2.0.2359.38073
CodeBase:
file:///C:/Program%20Files/PatchAdvisor%20Labs/USB%20Wireless%20Security/DefaultPlugins.DLL
----------------------------------------
Interop.MessengerAPI
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase:
file:///C:/Program%20Files/PatchAdvisor%20Labs/USB%20Wireless%20Security/Interop.MessengerAPI.DLL
----------------------------------------
MSNPlugin
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase:
file:///C:/Program%20Files/PatchAdvisor%20Labs/USB%20Wireless%20Security/MSNPlugin.DLL
----------------------------------------
SoftLockPlugin
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase:
file:///C:/Program%20Files/PatchAdvisor%20Labs/USB%20Wireless%20Security/SoftLockPlugin.DLL
----------------------------------------
************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config
file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.
For example:
<configuration>
<system.windows.forms jitDebugging="true" />
</configuration>
When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.
Logged In: YES
user_id=1453793
I noticed the same thing when running it myself, and I did
some digging. It appears the InitializeConfigurator
subroutine was only being run when the plugin was enabled.
I may have found the solution as well.
During the digging I was looking at the constructor for the
Plugin class (the one in the core library) and I noticed the
following line:
if (this.Enabled &&
!_initialized)
If it's not enabled and not initialized it Initializes both
the plugin and the configurator. Well, wouldn't they need
to be initialized anyway (granted maybe not the plugin, but
definitely the configurator).
I changed this on mine to:
if(!_initialized)
And replaced the resulting dll where the application was
running from - and viola, the Soft Lock configuration was
working even with the plugin disabled. The initialization of
the plugins was just fine as the plugin manager only ran
WorkstationLocked/WorkstationUnlocked on plugins that were
enabled.
Hope that helps out.