Communication problem when using everything32.dll

Plug-in and third party software discussion.
Post Reply
vfatica
Posts: 50
Joined: Thu May 21, 2015 7:06 pm

Communication problem when using everything32.dll

Post by vfatica »

I have a console app that uses everything32.dll to do queries (notably Everything_Query() and Everything_GetResult*()). My normal set-up is: service running, client started unelevated. The app works fine unelevated. But if I try it elevated, queries just hang. Should I expect this to work?

I could create a window, allow WM_COPY data, and use WM_COPYDATA to do the search (would that fix it?). But the DLL functions are much easier.

Does the DLL (elevated) create a window (briefly) to get the results of the search? If so, does that window allow WM_COPYDATA and if not, can I get it to do so?

Thanks.

- Vince
void
Developer
Posts: 16680
Joined: Fri Oct 16, 2009 11:31 pm

Re: Communication problem when using everything32.dll

Post by void »

I have a console app that uses everything32.dll to do queries (notably Everything_Query() and Everything_GetResult*()). My normal set-up is: service running, client started unelevated. The app works fine unelevated. But if I try it elevated, queries just hang. Should I expect this to work?
In your app, call ChangeWindowMessageFilterEx and allow WM_COPYDATA.
Does the DLL (elevated) create a window (briefly) to get the results of the search?
If bWait is set to true, then yes, Everything_Query will block and create a window to receive the results.
If so, does that window allow WM_COPYDATA and if not, can I get it to do so?
Normally WM_COPYDATA will fail (access denied) and you will need to call ChangeWindowMessageFilterEx to allow it.
vfatica
Posts: 50
Joined: Thu May 21, 2015 7:06 pm

Re: Communication problem when using everything32.dll

Post by vfatica »

My app doesn't create any windows. I'm getting results with Everything_GetResultPath() and Everything_GetResultFileName().
vfatica
Posts: 50
Joined: Thu May 21, 2015 7:06 pm

Re: Communication problem when using everything32.dll

Post by vfatica »

Changing the behavior was easy enough (and it works).

Code: Select all

	// process-wide; will allow me to be elevated when service client is unelevated
	ChangeWindowMessageFilter(WM_COPYDATA, MSGFLT_ADD);
I don't understand why everything32/64.dll doesn't, by default, use the Ex version to allow WM_COPYDATA. It makes the SDK a bit more versatile.
void
Developer
Posts: 16680
Joined: Fri Oct 16, 2009 11:31 pm

Re: Communication problem when using everything32.dll

Post by void »

Added to my TODO list: Add ChangeWindowMessageFilterEx to the SDK for the next release.
vfatica
Posts: 50
Joined: Thu May 21, 2015 7:06 pm

Re: Communication problem when using everything32.dll

Post by vfatica »

Good! Thanks! I'm OK for now.

Maybe you'd consider always enabling WM_COMMAND. ... ?
void
Developer
Posts: 16680
Joined: Fri Oct 16, 2009 11:31 pm

Re: Communication problem when using everything32.dll

Post by void »

It might be dangerous, since files could be deleted/renamed/etc with WM_COMMAND.
I'll consider an ini option to allow WM_COMMAND.

For now WM_COPYDATA and WM_USER are allowed as they are harmless.
vfatica
Posts: 50
Joined: Thu May 21, 2015 7:06 pm

Re: Communication problem when using everything32.dll

Post by vfatica »

How does Everything use WM_USER?

Please explain how Everything handles volumes without drive letters that are mounted in several places. I have a volume mounted on a "plugins" directory inside the install directory of 10 versions of the same product. Those mount points, and their contents, have the same inodes. In the options, "NTFS" presents that volume 10 times, once for each of its mount points (I'm a little surprised but I don't know how it works).
void
Developer
Posts: 16680
Joined: Fri Oct 16, 2009 11:31 pm

Re: Communication problem when using everything32.dll

Post by void »

How does Everything use WM_USER?
You can send these messages to the Everything tray notification window:

Code: Select all


// WM_USER (send to the taskbar notification window)
// SendMessage(FindWindow(EVERYTHING_IPC_WNDCLASS,0),WM_USER,EVERYTHING_IPC_*,lParam)
// version format: major.minor.revision.build 
// example: 1.1.4.309
// int major_version = (int)SendMessage(hwnd,WM_USER,EVERYTHING_IPC_GET_MAJOR_VERSION,0);
#define EVERYTHING_IPC_GET_MAJOR_VERSION		0 

// int minor_version = (int)SendMessage(hwnd,WM_USER,EVERYTHING_IPC_GET_MINOR_VERSION,0);
#define EVERYTHING_IPC_GET_MINOR_VERSION		1 

// int revision = (int)SendMessage(hwnd,WM_USER,EVERYTHING_IPC_GET_REVISION,0);
#define EVERYTHING_IPC_GET_REVISION				2 

// int build = (int)SendMessage(hwnd,WM_USER,EVERYTHING_IPC_GET_BUILD,0);
#define EVERYTHING_IPC_GET_BUILD_NUMBER			3

 // returns nonzero if the program closes. 
#define EVERYTHING_IPC_EXIT						4

// uninstall options
// SendMessage(hwnd,WM_USER,EVERYTHING_IPC_DELETE_START_MENU_SHORTCUTS,0);
#define EVERYTHING_IPC_DELETE_START_MENU_SHORTCUTS		100 

// SendMessage(hwnd,WM_USER,EVERYTHING_IPC_DELETE_QUICK_LAUNCH_SHORTCUT,0);
#define EVERYTHING_IPC_DELETE_QUICK_LAUNCH_SHORTCUT		101 

// SendMessage(hwnd,WM_USER,EVERYTHING_IPC_DELETE_DESKTOP_SHORTCUT,0);
#define EVERYTHING_IPC_DELETE_DESKTOP_SHORTCUT			102

// SendMessage(hwnd,WM_USER,EVERYTHING_IPC_DELETE_FOLDER_CONTEXT_MENU,0); 
#define EVERYTHING_IPC_DELETE_FOLDER_CONTEXT_MENU		103

// SendMessage(hwnd,WM_USER,EVERYTHING_IPC_DELETE_RUN_ON_SYSTEM_STARTUP,0);
#define EVERYTHING_IPC_DELETE_RUN_ON_SYSTEM_STARTUP		104 

// SendMessage(hwnd,WM_USER,EVERYTHING_IPC_DELETE_URL_PROTOCOL,0);
#define EVERYTHING_IPC_DELETE_URL_PROTOCOL				105 

// install options
// SendMessage(hwnd,WM_USER,EVERYTHING_IPC_CREATE_START_MENU_SHORTCUTS,0);
#define EVERYTHING_IPC_CREATE_START_MENU_SHORTCUTS		200 

// SendMessage(hwnd,WM_USER,EVERYTHING_IPC_CREATE_QUICK_LAUNCH_SHORTCUT,0);
#define EVERYTHING_IPC_CREATE_QUICK_LAUNCH_SHORTCUT		201 

// SendMessage(hwnd,WM_USER,EVERYTHING_IPC_CREATE_DESKTOP_SHORTCUT,0);
#define EVERYTHING_IPC_CREATE_DESKTOP_SHORTCUT			202 

// SendMessage(hwnd,WM_USER,EVERYTHING_IPC_CREATE_FOLDER_CONTEXT_MENU,0);
#define EVERYTHING_IPC_CREATE_FOLDER_CONTEXT_MENU		203 

// SendMessage(hwnd,WM_USER,EVERYTHING_IPC_CREATE_RUN_ON_SYSTEM_STARTUP,0);
#define EVERYTHING_IPC_CREATE_RUN_ON_SYSTEM_STARTUP		204 

// SendMessage(hwnd,WM_USER,EVERYTHING_IPC_CREATE_URL_PROTOCOL,0);
#define EVERYTHING_IPC_CREATE_URL_PROTOCOL				205 

// get option status; 0 = no, 1 = yes, 2 = indeterminate (partially installed)
// int ret = (int)SendMessage(hwnd,WM_USER,EVERYTHING_IPC_IS_START_MENU_SHORTCUTS,0);
#define EVERYTHING_IPC_IS_START_MENU_SHORTCUTS			300 

// int ret = (int)SendMessage(hwnd,WM_USER,EVERYTHING_IPC_IS_QUICK_LAUNCH_SHORTCUT,0);
#define EVERYTHING_IPC_IS_QUICK_LAUNCH_SHORTCUT			301 

// int ret = (int)SendMessage(hwnd,WM_USER,EVERYTHING_IPC_IS_DESKTOP_SHORTCUT,0);
#define EVERYTHING_IPC_IS_DESKTOP_SHORTCUT				302 

// int ret = (int)SendMessage(hwnd,WM_USER,EVERYTHING_IPC_IS_FOLDER_CONTEXT_MENU,0);
#define EVERYTHING_IPC_IS_FOLDER_CONTEXT_MENU			303 

// int ret = (int)SendMessage(hwnd,WM_USER,EVERYTHING_IPC_IS_RUN_ON_SYSTEM_STARTUP,0);
#define EVERYTHING_IPC_IS_RUN_ON_SYSTEM_STARTUP			304 

// int ret = (int)SendMessage(hwnd,WM_USER,EVERYTHING_IPC_IS_URL_PROTOCOL,0);
#define EVERYTHING_IPC_IS_URL_PROTOCOL					305 

// int ret = (int)SendMessage(hwnd,WM_USER,EVERYTHING_IPC_IS_SERVICE,0);
#define EVERYTHING_IPC_IS_SERVICE						306 
Please explain how Everything handles volumes without drive letters that are mounted in several places. I have a volume mounted on a "plugins" directory inside the install directory of 10 versions of the same product. Those mount points, and their contents, have the same inodes. In the options, "NTFS" presents that volume 10 times, once for each of its mount points (I'm a little surprised but I don't know how it works).
Everything uses FindFirstVolume to enumerate volumes by guids.
Everything identifies a volume by GUID internally.

Then Everything uses GetVolumePathNamesForVolumeName to find path mount locations.
So one volume may have multiple paths.

You can exclude the duplicated paths in Tools -> Options -> NTFS.
Select the volume you do not wish to include and uncheck Include in database.
vfatica
Posts: 50
Joined: Thu May 21, 2015 7:06 pm

Re: Communication problem when using everything32.dll

Post by vfatica »

Actually, it's 13 mount points, but they share only 3 GUIDs. Does that make sense?

Code: Select all

v:\> (do x in /p es attributes:l regex:plugins ( echo %@truename[%x] )) | sort
Volume{53c5ee55-6a1a-11e1-b966-806e6f6e6963}\
Volume{53c5ee55-6a1a-11e1-b966-806e6f6e6963}\
Volume{53c5ee55-6a1a-11e1-b966-806e6f6e6963}\
Volume{53c5ee55-6a1a-11e1-b966-806e6f6e6963}\
Volume{53c5ee55-6a1a-11e1-b966-806e6f6e6963}\
Volume{53c5ee55-6a1a-11e1-b966-806e6f6e6963}\
Volume{6f9fb6a5-ba54-11e0-872e-806e6f6e6963}\
Volume{c5d272cf-d8fd-11dd-bb5a-0010183a9526}\
Volume{c5d272cf-d8fd-11dd-bb5a-0010183a9526}\
Volume{c5d272cf-d8fd-11dd-bb5a-0010183a9526}\
Volume{c5d272cf-d8fd-11dd-bb5a-0010183a9526}\
Volume{c5d272cf-d8fd-11dd-bb5a-0010183a9526}\
Volume{c5d272cf-d8fd-11dd-bb5a-0010183a9526}\
void
Developer
Posts: 16680
Joined: Fri Oct 16, 2009 11:31 pm

Re: Communication problem when using everything32.dll

Post by void »

The folders that are reparse points for volumes are empty internally to Everything and NTFS.
Everything does not follow reparse points.
The entire volume must be indexed with the root folder specifying the full path to the mounted location.

Search for root: to find the root folders in Everything.
Post Reply