EVERYTHING_ERROR_INVALIDCALL from Everything_GetResultSize?

Plug-in and third party software discussion.
Post Reply
vefatica
Posts: 36
Joined: Sun Jun 11, 2023 6:27 pm

EVERYTHING_ERROR_INVALIDCALL from Everything_GetResultSize?

Post by vefatica »

I'm using the alpha everything64.exe, a recent download of the SDK, and linking dynamically with the SDK's Everything64.dll via the SDK's Everything64.lib. I have these (under development).

Code: Select all

VOID ShowSize(DWORD index)
{
	LARGE_INTEGER li_size = {0};
	BOOL b = Everything_GetResultSize(index, &li_size);
	Printf(L"%lu - %d - %lu - %-12I64u", index, b, Everything_GetLastError(),  li_size.QuadPart);
}

if ( bFile ) // print path\file
{
	if ( show_size ) ShowSize(index);
	Printf(L"%s\\%s\r\n", Everything_GetResultPathW(index), Everything_GetResultFileNameW(index));
}
I get this (7 = EVERYTHING_ERROR_INVALIDCALL).
d:\tc30> es /+S v:\z*
0 - 0 - 7 - 0 V:\zscore.btm
1 - 0 - 7 - 0 V:\zscorem.btm
Any ideas? Thanks.
void
Developer
Posts: 17149
Joined: Fri Oct 16, 2009 11:31 pm

Re: EVERYTHING_ERROR_INVALIDCALL from Everything_GetResultSize?

Post by void »

Please make sure you are requesting size information.

Before calling Everything_Query, please call Everything_SetRequestFlags:

Code: Select all

// request filename, path, size and date modified result data.
Everything_SetRequestFlags(EVERYTHING_REQUEST_FILE_NAME | EVERYTHING_REQUEST_PATH | EVERYTHING_REQUEST_SIZE | EVERYTHING_REQUEST_DATE_MODIFIED);

// execute the query
Everything_Query(TRUE);
vefatica
Posts: 36
Joined: Sun Jun 11, 2023 6:27 pm

Re: EVERYTHING_ERROR_INVALIDCALL from Everything_GetResultSize?

Post by vefatica »

I had looked for something like that and didn't find it. That works. Thanks.

Not requesting EVERYTHING_REQUEST_FILE_NAME | EVERYTHING_REQUEST_PATH and trying to use them led to an access violation ... expected?
void
Developer
Posts: 17149
Joined: Fri Oct 16, 2009 11:31 pm

Re: EVERYTHING_ERROR_INVALIDCALL from Everything_GetResultSize?

Post by void »

Everything_GetResultPathW() and Everything_GetResultFileNameW() will return NULL when EVERYTHING_REQUEST_PATH | EVERYTHING_REQUEST_FILE_NAME are omitted.

Maybe you are dereferencing these NULL pointers somewhere? -What is shown in the call stack?
vefatica
Posts: 36
Joined: Sun Jun 11, 2023 6:27 pm

Re: EVERYTHING_ERROR_INVALIDCALL from Everything_GetResultSize?

Post by vefatica »

Exactly! My fault. :D
vefatica
Posts: 36
Joined: Sun Jun 11, 2023 6:27 pm

Re: EVERYTHING_ERROR_INVALIDCALL from Everything_GetResultSize?

Post by vefatica »

I'm also having trouble with Everything_GetNumFolderResults() and Everything_GetNumFileResults(). They just return 0. Do I have to request that information before I can get it?

Code: Select all

	if ( !Everything_QueryW(TRUE) )
	{
		Qprintf(STD_ERR, L"Everything_Query error: %lu\r\n", Everything_GetLastError());
		goto exit;
	}
	rv = 0; // looks like success
	DWORD	dwDirs = Everything_GetNumFolderResults(),	dwFiles = Everything_GetNumFileResults(),
		dwNResults	= Everything_GetNumResults(),	dwPrintCount = min(num, dwNResults);
	Printf(L"files = %lu\r\ndirs = %lu\r\nresults = %lu\r\n", dwFiles, dwDirs, dwNResults);
files = 0
dirs = 0
results = 115
void
Developer
Posts: 17149
Joined: Fri Oct 16, 2009 11:31 pm

Re: EVERYTHING_ERROR_INVALIDCALL from Everything_GetResultSize?

Post by void »

From the SDK documentation:
Everything_GetNumFolderResults is not supported when using Everything_SetRequestFlags


Basically, IPC version 2 doesn't know the individual total number of files and folders.
Only the total number of "items".

I recommend enumerating over each item and checking if the item is a folder with Everything_IsFolderResult

IPC version 2 can return mixed file/folder results.
For example:
folder
file
folder
file
Post Reply