Page 2 of 6

Re: Service Explorer Plugin

Posted: 02 Sep 2009, 06:59
by MartinS
svyr wrote:Salamander 2.5.2
errr, seems like it's broken. (all columns display boot and or nonsense)
furthermore, all of the rh mouse button context menu is grayed out
Maybe you are not running as Admin? Reported in some previous post...

Re: Service Explorer Plugin

Posted: 02 Sep 2009, 07:58
by svyr
I'm running windows XP, and yes, not under an admin account.
However, the services manager (services.msc) does display all of the information as the plugin should...
Are admin privileges a pre-requisite because of the way the plugin requests the information, or is this a bug? :?

Re: Service Explorer Plugin

Posted: 02 Sep 2009, 08:20
by Mike12345
Thank you for reporting.

This is actually a bug. :shock:
The servicemanager is currently opened by the plugin with the 'SC_MANAGER_ALL_ACCESS' parameters which needs admin rights.
For listing services only this is not really neccessary. I will change this behaviour in the next update.

Re: Service Explorer Plugin

Posted: 02 Sep 2009, 08:45
by svyr
Hello Mike,

I see, thanks!

I currently run everything on a restricted account, only using the admin account when really necessary.

Out of interest, is it possible to have an 'admin' mode in the plugin? (i.e. say we press an 'admin' button in the plugin, then we're prompted for admin credentials for full access, without having to re-run salamander under an admin account?)

I.e. in normal mode, the plugin tries to access the services manager with the highest privileges that salamander's process currently has (if this makes sense), but on switching to admin mode (e.g. via a button), the user is prompted to enter an admin account name and password, and then the plugin attempts to get full access?

Again, not sure if this is compatible with the design of the plugin or the way it gains access to the services, but it would be very nice for people who normally use their computers under a limited account like me.

Re: Service Explorer Plugin

Posted: 02 Sep 2009, 09:34
by Mike12345
Hello svyr,

nice idea - thank you. :D
This might be possible by "impersonating" the current thread/process.
Although i had to do a little research on this idea before i can make promises. 8)

Re: Service Explorer Plugin

Posted: 02 Sep 2009, 10:21
by Petr Solin
Finally I have tested your plugin. Nice, I cannot believe you did it without understanding Czech language. ;-)

I have Vista 32-bit, so here is already mentioned problem with admin access rights. I suggest to display some empty value (e.g. "") in column Status (when such error occurs).

Please hide Ext column because it has no sence in service name. The easiest way how to hide all standard columns (you are not using them) is to set valid data in CPluginFSInterface::ListCurrentPath method to VALID_DATA_NONE (call dir->SetValidData(VALID_DATA_NONE)). It means that only Name + NameLen in CFileData structure is valid and so only Name column should be displayed (keep adding of your custom columns in CPluginFSDataInterface::SetupView).

I have got a lot of TRACE_I messages "Unable to get icon from FS item: ???", solution:
Return only TRUE from CPluginFSDataInterface::HasSimplePluginIcon if all icons are simple (not extracted directly from items). I believe your CPluginFSDataInterface::GetPluginIcon always returns NULL.

I have got a lot of TRACE_E messages "charOffset + charLen >= len":
CPluginFSDataInterface::GetInfoLineContent can return hot-texts (when you move mouse over text in Infoline (below panel), these hot-texts are visible and can be copied to clipboard). Each hot-text is defined by position and length in one DWORD value (lo-word is position, hi-word is length). All hot-texts are in 'hotTexts' array (up to 100). Count is returned in 'hotTextsCount'. And this is the problem here, you return 100 in 'hotTextsCount' instead of 0 (you probably do not define any hot-text now). Easiest way how to return hot-texts is to place them to angle brackets ('<' and '>') and call SalamanderGeneral->LookForSubTexts (see it in DemoPlugin) to fill 'hotTexts' array -- but it expects no other '<' and '>' characters in text (they cannot be in filenames, I don't know what about in service names). And if you want to be perfect, use SalamanderGeneral->ExpandPluralString to show "1 selected service" and "2 selected services", English comment for this method is attached (will be in 2.52 SDK). Your string should be "{!}%d selected service{|1|s}" (I expect you are passing it to sprintf). See ExpandPluralString also in DemoPlugin.

To see TRACE messages run your plugin in SDK version of salamand.exe and open Trace Server application, all is in SDK package (see our Download page). We will release SDK for 2.52 soon, but I believe 2.51 (or maybe also 2.5) should be enough for your plugin (if you use 2.5 SDK, advantage is that your plugin will run in 2.5, 2.51, and 2.52 versions).

Re: Service Explorer Plugin

Posted: 02 Sep 2009, 12:01
by Petr Solin
Mike12345 wrote:This might be possible by "impersonating" the current thread/process.
Although i had to do a little research on this idea before i can make promises. 8)
I believe the only way is to start new process with Admin rights (with UAC prompt).

Re: Service Explorer Plugin

Posted: 03 Sep 2009, 20:02
by Mike12345
@Petr:
Thank you for the kind words and comprehensive informations/SDK translation - it helped a lot. :D

I accidently haven't used the trace server until now :? - although i was able to track down those (and other) bugs and a new version is on the way.

Re: Service Explorer Plugin

Posted: 07 Sep 2009, 14:15
by Mike12345

Code: Select all

Version 0.0.5 (07.09.2009)
-------------------------
+ new "Info dialog"
+ moved all strings to the lanugage dll
* removed the extension column
* doesn't need admin privileges anymore (at least for listing) 
- numerous smaller bugfixes (icons, infolinecontent,..)
Download from first post. 8)

Re: Service Explorer Plugin

Posted: 07 Sep 2009, 16:01
by vld
How do you install this? I can't get it to load via Plugin Manager in both 2.51 & 2.52

Re: Service Explorer Plugin

Posted: 07 Sep 2009, 16:06
by MartinS
vld wrote:How do you install this? I can't get it to load via Plugin Manager in both 2.51 & 2.52
If installed correctly (Plugins manager - Add...), it should appear in the drive selection, not plug-ins menu...
Maybe try to save your configuration?

Re: Service Explorer Plugin

Posted: 07 Sep 2009, 16:09
by Jan Rysavy
Does it display some error message?
What Windows version are you using?

Re: Service Explorer Plugin

Posted: 07 Sep 2009, 16:17
by vld
Plug In Mananger...Add...

Unable to load plugin (C:\Program Files\Altap Salamander 2.52\plugins\svcexp.spl) or some of it's componets.
Error: (14001) This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix the problem

I'm on Server 2003 and I just fired up a VMWare session with WXP and gave the same error.

Re: Service Explorer Plugin

Posted: 07 Sep 2009, 16:22
by Jan Rysavy
When you open svcexp.spl using F3 from Salamander, you will find:

Code: Select all

Import Table:
...
  MSVCR90.dll
...
So you need to install Microsoft Visual C++ 2008 SP1 Redistributable Package (x86) to run this plugin.

Other plugins are dependent on salrtl.dll -- runtime library distributed with Salamander.

Re: Service Explorer Plugin

Posted: 07 Sep 2009, 16:38
by Mike12345
Whoops, soory. :roll:
I will try to change the rtl in the next update.