Everything 1.5 SDK

Discussion related to "Everything" 1.5 Alpha.
Post Reply
void
Developer
Posts: 17814
Joined: Fri Oct 16, 2009 11:31 pm

Everything 1.5 SDK

Post by void »

The Everything SDK for Everything 1.5

Download
Example Usage



Download

Everything-SDK-3.0.0.4.zip
GitHub



The Everything 1.5 SDK is version 3 of the Everything SDK.
Version 2 is for Everything 1.4.
version 1 is for Everything 1.3.

Previous versions are compatible with Everything 1.5.

The Everything 1.5 SDK now uses named pipes.

The name of the pipe is:
\\.\PIPE\Everything IPC

If Everything is running in an instance, the pipe name is:
\\.\PIPE\Everything IPC (instance-name)

Everything 1.5 alpha runs in a 1.5a instance.

Pipe connections can be kept open if you wish to monitor result list changes.

Everything hosts 8 pipe servers by default.
pipe servers are recreated as soon as a client connects.
Note: it's possible (but unlikely) for 8 clients to connect at the same time and the 9th client will fail before a new pipe server is created.

To set the number of IPC pipe servers:
  • In Everything 1.5, from the Tools menu, click Options.
  • Click the Advanced tab on the left.
  • To the right of Show settings containing, search for:
    menu
  • Select: ipc_pipe_count
  • Set the value to: 8
    (where 8 is the number of IPC pipe servers)
  • Click OK.


Example Usage
#include "Everything3.h"

void simple_example(void)
{
	EVERYTHING3_CLIENT *client;

	// connect to Everything.. Try the default unnamed instance first.
	client = Everything3_ConnectW(NULL);
	if (!client)
	{
		// connect to Everything.. Try the 1.5a instance.
		client = Everything3_ConnectW(L"1.5a");
	}

	if (client)
	{
		EVERYTHING3_SEARCH_STATE *search_state;

		// Connected..
		
		// Create an empty search state.
		search_state = Everything3_CreateSearchState();
		if (search_state)
		{
			EVERYTHING3_RESULT_LIST *result_list;

			// Set the search text.
			Everything3_SetSearchTextW(search_state,L"ABC 123");
			
			// Execute the search.
			result_list = Everything3_Search(client,search_state);
			if (result_list)
			{
				SIZE_T viewport_count;
				SIZE_T result_index;
				
				// Search successful.

				// Get the number of results.
				viewport_count = Everything3_GetResultListViewportCount(result_list);
				
				// loop through the results.
				for(result_index=0;result_index<viewport_count;result_index++)
				{
					wchar_t filename[MAX_PATH];

					// Get the filename
					Everything3_GetResultFullPathNameW(result_list,result_index,filename,MAX_PATH);
					
					// Display the filename.
					printf("%S\n",filename);
				}
				
				// Destroy the result list.
				Everything3_DestroyResultList(result_list);
			}

			// Destroy the search state.
			Everything3_DestroySearchState(search_state);
		}
		
		// Disconnect and free the client.
		Everything3_DestroyClient(client);
	}
}
void
Developer
Posts: 17814
Joined: Fri Oct 16, 2009 11:31 pm

Re: Everything 1.5 SDK

Post by void »

Everything 1.5.0.1388a adds the following API calls:
EVERYTHING3_USERAPI EVERYTHING3_BOOL EVERYTHING3_API Everything3_GetFileAttributesExW(EVERYTHING3_CLIENT *client,const EVERYTHING3_WCHAR *lpFilename,WIN32_FIND_DATAW *pfd);
EVERYTHING3_USERAPI EVERYTHING3_BOOL EVERYTHING3_API Everything3_GetFileAttributesExA(EVERYTHING3_CLIENT *client,const EVERYTHING3_CHAR *lpFilename,WIN32_FIND_DATAA *pfd);
EVERYTHING3_USERAPI EVERYTHING3_DWORD EVERYTHING3_API Everything3_GetFileAttributesUTF8(EVERYTHING3_CLIENT *client,const EVERYTHING3_UTF8 *lpFilename);
EVERYTHING3_USERAPI EVERYTHING3_DWORD EVERYTHING3_API Everything3_GetFileAttributesW(EVERYTHING3_CLIENT *client,const EVERYTHING3_WCHAR *lpFilename);
EVERYTHING3_USERAPI EVERYTHING3_DWORD EVERYTHING3_API Everything3_GetFileAttributesA(EVERYTHING3_CLIENT *client,const EVERYTHING3_CHAR *lpFilename);
shihonglei
Posts: 2
Joined: Mon Dec 16, 2024 3:56 pm

Re: Everything 1.5 SDK

Post by shihonglei »

Master, when will the SDK3 DLL be built and released? We've been eagerly waiting and looking forward to it!
void
Developer
Posts: 17814
Joined: Fri Oct 16, 2009 11:31 pm

Re: Everything 1.5 SDK

Post by void »

Added DLL and static LIBs to SDK.


To build with the static LIB please define EVERYTHING3_USERAPI:
#define EVERYTHING3_USERAPI



Everything 1.5.0.1390a adds the following API calls:
EVERYTHING3_USERAPI EVERYTHING3_FIND_HANDLE *EVERYTHING3_API Everything3_FindFirstFileW(EVERYTHING3_CLIENT *client,const EVERYTHING3_WCHAR *lpFilename,WIN32_FIND_DATAW *pfd);
EVERYTHING3_USERAPI EVERYTHING3_FIND_HANDLE *EVERYTHING3_API Everything3_FindFirstFileA(EVERYTHING3_CLIENT *client,const EVERYTHING3_CHAR *lpFilename,WIN32_FIND_DATAA *pfd);
EVERYTHING3_USERAPI EVERYTHING3_BOOL EVERYTHING3_API Everything3_FindNextFileW(EVERYTHING3_FIND_HANDLE *find_handle,WIN32_FIND_DATAW *pfd);
EVERYTHING3_USERAPI EVERYTHING3_BOOL EVERYTHING3_API Everything3_FindNextFileA(EVERYTHING3_FIND_HANDLE *find_handle,WIN32_FIND_DATAA *pfd);
EVERYTHING3_USERAPI EVERYTHING3_BOOL EVERYTHING3_API Everything3_FindClose(EVERYTHING3_FIND_HANDLE *find_handle);

EVERYTHING3_USERAPI EVERYTHING3_RESULT_LIST *EVERYTHING3_API Everything3_GetResults(EVERYTHING3_CLIENT *client,EVERYTHING3_SEARCH_STATE *search_state);
EVERYTHING3_USERAPI EVERYTHING3_RESULT_LIST *EVERYTHING3_API Everything3_Sort(EVERYTHING3_CLIENT *client,EVERYTHING3_SEARCH_STATE *search_state);
EVERYTHING3_USERAPI EVERYTHING3_BOOL EVERYTHING3_API Everything3_WaitForResultListChange(EVERYTHING3_CLIENT *client);


Added EVERYTHING3_PROPERTY_ID_CONTENT property ID.
shihonglei
Posts: 2
Joined: Mon Dec 16, 2024 3:56 pm

Re: Everything 1.5 SDK

Post by shihonglei »

I have tried for a long time, and the DLL is loaded correctly, but I still cannot connect to the IPC channel of Everything 1.5a through SDK3. However, I can see "Everything IPC (1.5a)" in my IPC list. I’m not sure what the reason could be.
#include <stdio.h>
#define WIN32_LEAN_AND_MEAN
#define EVERYTHING3_USERAPI

#include <windows.h>
#include "..\include\Everything3.h"

int main(int argc, char** argv) {
EVERYTHING3_CLIENT* client;

printf("SDK test\n");
HMODULE hDll = LoadLibrary(L"Everything3_x64.dll");
if (hDll == NULL) {
DWORD lastError = GetLastError();
printf("Failed to load DLL. Error code: %lu\n", lastError);
return -1;
}
printf("DLL loaded successfully.\n");

printf("Attempting to connect to Everything service...\n");
client = Everything3_Connect(NULL); // 尝试默认管道
if (!client) {
printf("Failed to connect to Everything service.\n");

DWORD last_error = GetLastError();
printf("GetLastError returned: %lu\n", last_error);

printf("Possible causes:\n");
printf("1. Everything is not running.\n");
printf("2. IPC is not enabled in Everything settings.\n");
printf("3. DLL or pipe configuration mismatch.\n");
printf("4. Insufficient permissions.\n");

// 显式指定管道名称重试
printf("Retrying with explicit pipe name...\n");
client = Everything3_Connect(L"Everything IPC (1.5a)");
if (!client) {
printf("Failed to connect to Everything IPC (1.5a).\n");
return -1;
}
}

printf("Successfully connected to Everything service.\n");

DWORD ipc_pipe_version = Everything3_GetIPCPipeVersion(client);
printf("IPC pipe version: %d\n", ipc_pipe_version);

Everything3_DestroyClient(client);

return 0;
}
void
Developer
Posts: 17814
Joined: Fri Oct 16, 2009 11:31 pm

Re: Everything 1.5 SDK

Post by void »

Please try connecting to the 1.5a instance:

Code: Select all

client = Everything3_Connect(L"1.5a");
Laus
Posts: 19
Joined: Sun Jul 04, 2021 11:44 am

Python Wrapper

Post by Laus »

Hi!

I've just published a new python wrapper for the Everything 1.5 SDK version 3 on Github:
https://github.com/git-emil/pyEverything3

It's not yet full fledged, but it it already satisfies my needs in most cases.

Yours, Laus
cuiliang
Posts: 1
Joined: Thu Dec 12, 2024 3:01 pm

Re: Everything 1.5 SDK

Post by cuiliang »

May I ask if there is a documentation for the communication protocol?
If such documentation exists, it would be more convenient to communicate directly using various programming languages without relying on SDK calls.
Thank you!
NotNull
Posts: 5826
Joined: Wed May 24, 2017 9:22 pm

Re: Everything 1.5 SDK

Post by NotNull »

You can interact with the GUI using Command IDs, but that gives very limited access to information in the database.

Alternatively, look at the source code of the command-line utility ES.exe as ES largely bypasses the API calls defined in the SDK.
lin-ycv
Posts: 13
Joined: Fri Mar 11, 2022 2:25 am

Re: Everything 1.5 SDK

Post by lin-ycv »

does the SDK v3 not have the equivalent of

Code: Select all

Everything_SetMax
?
void
Developer
Posts: 17814
Joined: Fri Oct 16, 2009 11:31 pm

Re: Everything 1.5 SDK

Post by void »

Everything3_SetSearchViewportCount
lin-ycv
Posts: 13
Joined: Fri Mar 11, 2022 2:25 am

Re: Everything 1.5 SDK

Post by lin-ycv »

void wrote: Tue Jan 28, 2025 10:21 pm
Everything3_SetSearchViewportCount
I could be understanding things wrong, but what i see from testing is that
Everything_SetMax
limits the number of results returned by the api, meaning if there's 100 results that match, it'll only find 10 then stop, but with
Everything3_SetSearchViewportCount
the api still returns all 100 results, just doesn't display all of them?
NotNull
Posts: 5826
Joined: Wed May 24, 2017 9:22 pm

Re: Everything 1.5 SDK

Post by NotNull »

Not a developer, but the way I interpreted the example from void's openingspost:

(To minimize confusion: Client = application that uses the SDK; Server = Everything program + database )
  • The client asks the server for a unique connection and does some initializing when granted.
  • The client sends a search query to the server ("abc 123")
  • Server processes the query and returns a "link" to the resultlist where all matching results are stored.
    (this resultlist is server-sided)
    CAfter asking the server if there are any results and how many, the results can be "downloaded" from the server to the client in "batches" that each are the size of "Viewport".
  • Typically one would define the size of the viewport to be the amount of results that fits on the screen, but if you need just 10 results:
    define the viewport size as 10 and download only the first "batch".


An alternative would be to add count:10 to your search query, like
abc 123 count:10

(untested)
Kilmatead
Posts: 37
Joined: Thu Nov 07, 2024 1:22 pm

Re: Everything 1.5 SDK

Post by Kilmatead »

Regarding the SDK of 19-Dec-24:

The Everything3_Search() function fails (or, rather, blocks indefinitely) if targeting (via SetSearchTextW) a deep-path. The same call to "normal" paths produces a valid EVERYTHING3_RESULT_LIST (to target a specific folder to get its DESCENDANT_FOLDER_COUNT property, etc).

Returned result lists which merely contain deep-paths work fine, this only happens if the search itself is issued with a deep-path initially.

Curiously, the functions Everything3_FindFirstFileW and Everything3_GetFolderSizeFromFilenameW have no difficulty when targeting deep-paths, only Everything3_Search blocks indefinitely.

I tested with both the DLL version and compiled source, and both behave the same. (To get the code to compile with LLVM I had to make a few minor adjustments, so I tested the release DLL just to make sure it wasn't my modifications which caused it.)
void
Developer
Posts: 17814
Joined: Fri Oct 16, 2009 11:31 pm

Re: Everything 1.5 SDK

Post by void »

Thank you for the issue report Kilmatead,

There's an issue with sending the results over IPC from Everything.
I will have this fixed in the next alpha update.
Kilmatead
Posts: 37
Joined: Thu Nov 07, 2024 1:22 pm

Re: Everything 1.5 SDK

Post by Kilmatead »

Another issue:

Everything3_FindFirstFileW() will terminate any program it's executed within if the target folder is empty.

That is to say, something as simple as:

Code: Select all

Everything3_FindFirstFileW(client, L"C:\\EmptyFolder\\*", &fd);
Will crash to desktop whenever the initial starting folder contains no objects.

***** Edit *****

Ok, actually upon retesting this is user-error: I was thinking I could use the function as a direct drop-in replacement for WinAPI FindFirstFileW, but that function returns INVALID_HANDLE_VALUE on failure whereas the Everything3 function returns NULL, so it's actually Everything3_FindNextFileW which causes the crash (I had proceeded with != INVALID_HANDLE_VALUE instead of != NULL).

I'm leaving this post up simply to suggest that maybe Everything3_FindNextFileW should have a more graceful death if submitted a NULL handle, just so someone else doesn't encounter the same thing.

A failing function call is one thing, catastrophic programme failure is another.

Sorry for my mistake - that's what happens when alpha API's are more or less "undocumented". :D
void
Developer
Posts: 17814
Joined: Fri Oct 16, 2009 11:31 pm

Re: Everything 1.5 SDK

Post by void »

I have put on my TODO list to improve handling of invalid parameters.

Thanks for bringing the issue to my attention.



Everything3_FindFirstFileW returns NULL if no results are found.
Everything3_FindFirstFileW will never return INVALID_HANDLE_VALUE as a valid return value.
Please feel free to create a wrapper that returns INVALID_HANDLE_VALUE instead of NULL.
void
Developer
Posts: 17814
Joined: Fri Oct 16, 2009 11:31 pm

Re: Everything 1.5 SDK

Post by void »

Everything-SDK3.zip

Tuesday 10 June 2025 Version 1.0.0.2
  • added new code signing certificate: voidtools PTY LTD
  • improved handling of invalid parameters.
  • improved handling of invalid pipe names.
  • fixed an issue with calculating the size of ANSI buffers.
void
Developer
Posts: 17814
Joined: Fri Oct 16, 2009 11:31 pm

Re: Everything 1.5 SDK

Post by void »

Everything 1.5.0.1394a fixes an issue with sending results over named pipes.

Please let me know if the issue persists with this version.
Kilmatead
Posts: 37
Joined: Thu Nov 07, 2024 1:22 pm

Re: Everything 1.5 SDK

Post by Kilmatead »

Unfortunately 1394 continues to block indefinitely on an initial deep path.
void
Developer
Posts: 17814
Joined: Fri Oct 16, 2009 11:31 pm

Re: Everything 1.5 SDK

Post by void »

Thank you for checking 1394.

What is your search and what properties are you requesting?

Everything will block to gather any unindexed properties.
Kilmatead
Posts: 37
Joined: Thu Nov 07, 2024 1:22 pm

Re: Everything 1.5 SDK

Post by Kilmatead »

Code: Select all

LPWSTR lpSearch = L"F:\\Etrangere\\" \
L"--------10--------20--------30--------40--------50\\" \
L"--------60--------70--------80--------90-------100\\" \
L"-------110-------120-------130-------140-------150\\" \
L"-------160-------170-------180-------190-------200\\" \
L"-------210-------220-------230" \
L"-------260-------270-------280-------290-------300"; //\\New Folder\\x2Scrap.txt";

Everything3_AddSearchPropertyRequest(lpState, EVERYTHING3_PROPERTY_ID_DESCENDANT_FOLDER_COUNT);
Everything3_AddSearchPropertyRequest(lpState, EVERYTHING3_PROPERTY_ID_NAME);
Everything3_AddSearchPropertyRequest(lpState, EVERYTHING3_PROPERTY_ID_SIZE);
As a test I use the component ending in 230 (a non-deep path), and that returns correctly (with properties). Switching to the 300 mark blocks.

Are Descendant folder properties index-able? (They do return correct results from deep paths found in the result list.)
void
Developer
Posts: 17814
Joined: Fri Oct 16, 2009 11:31 pm

Re: Everything 1.5 SDK

Post by void »

Oh, I am not encoding my VLQs correctly on the SDK side..

Everything-SDK3.zip

Tuesday 10 June 2025 Version 1.0.0.3
  • fixed an issue with encoding vlqs.


Does the issue persist with this SDK update?
Kilmatead
Posts: 37
Joined: Thu Nov 07, 2024 1:22 pm

Re: Everything 1.5 SDK

Post by Kilmatead »

That appears to have solved it. :D

Thank you.
Kilmatead
Posts: 37
Joined: Thu Nov 07, 2024 1:22 pm

Re: Everything 1.5 SDK

Post by Kilmatead »

Small suggestion: Maybe add that version number (1.0.0.3) to a resource for the DLL, so it's more obvious which SDK3 revision/build is being used. God knows how many people might be distributing the DLL's themselves instead of compiling source, Just saying "the latest" doesn't have a lot of context outside of the file date. Just a thought.
void
Developer
Posts: 17814
Joined: Fri Oct 16, 2009 11:31 pm

Re: Everything 1.5 SDK

Post by void »

Thanks for testing.

Yes, I will add version information.
void
Developer
Posts: 17814
Joined: Fri Oct 16, 2009 11:31 pm

Re: Everything 1.5 SDK

Post by void »

Everything-SDK-3.0.0.4.zip

Tuesday 10 June 2025 Version 3.0.0.4
  • added version information.
Post Reply