Service Explorer Plugin

Support for developers of new plugins, third-party plugin announcements and discussions.
User avatar
MartinS
Posts: 114
Joined: 04 May 2006, 19:48
Location: Brno, Moravia

Re: Service Explorer Plugin

Post 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...
svyr
Posts: 10
Joined: 26 Aug 2009, 11:59

Re: Service Explorer Plugin

Post 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? :?
Mike12345
Plugin Developer
Plugin Developer
Posts: 43
Joined: 03 May 2006, 00:11
Location: Germany

Re: Service Explorer Plugin

Post 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.
svyr
Posts: 10
Joined: 26 Aug 2009, 11:59

Re: Service Explorer Plugin

Post 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.
Mike12345
Plugin Developer
Plugin Developer
Posts: 43
Joined: 03 May 2006, 00:11
Location: Germany

Re: Service Explorer Plugin

Post 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)
Petr Solin
ALTAP Staff
ALTAP Staff
Posts: 1112
Joined: 08 Dec 2005, 09:13
Location: Novy Bor, Czech Republic
Contact:

Re: Service Explorer Plugin

Post 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).
Attachments
ExpandPluralString.rar
(1.02 KiB) Downloaded 678 times
Petr Solin
ALTAP Staff
ALTAP Staff
Posts: 1112
Joined: 08 Dec 2005, 09:13
Location: Novy Bor, Czech Republic
Contact:

Re: Service Explorer Plugin

Post 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).
Mike12345
Plugin Developer
Plugin Developer
Posts: 43
Joined: 03 May 2006, 00:11
Location: Germany

Re: Service Explorer Plugin

Post 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.
Mike12345
Plugin Developer
Plugin Developer
Posts: 43
Joined: 03 May 2006, 00:11
Location: Germany

Re: Service Explorer Plugin

Post 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)
User avatar
vld
Posts: 174
Joined: 06 Feb 2009, 21:21

Re: Service Explorer Plugin

Post by vld »

How do you install this? I can't get it to load via Plugin Manager in both 2.51 & 2.52
User avatar
MartinS
Posts: 114
Joined: 04 May 2006, 19:48
Location: Brno, Moravia

Re: Service Explorer Plugin

Post 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?
Last edited by MartinS on 07 Sep 2009, 16:12, edited 1 time in total.
Jan Rysavy
ALTAP Staff
ALTAP Staff
Posts: 5229
Joined: 08 Dec 2005, 06:34
Location: Novy Bor, Czech Republic
Contact:

Re: Service Explorer Plugin

Post by Jan Rysavy »

Does it display some error message?
What Windows version are you using?
User avatar
vld
Posts: 174
Joined: 06 Feb 2009, 21:21

Re: Service Explorer Plugin

Post 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.
Jan Rysavy
ALTAP Staff
ALTAP Staff
Posts: 5229
Joined: 08 Dec 2005, 06:34
Location: Novy Bor, Czech Republic
Contact:

Re: Service Explorer Plugin

Post 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.
Mike12345
Plugin Developer
Plugin Developer
Posts: 43
Joined: 03 May 2006, 00:11
Location: Germany

Re: Service Explorer Plugin

Post by Mike12345 »

Whoops, soory. :roll:
I will try to change the rtl in the next update.
Post Reply