Page 1 of 1
EVERYTHING_ERROR_INVALIDCALL from Everything_GetResultSize?
Posted: Thu Jun 15, 2023 7:34 pm
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.
Re: EVERYTHING_ERROR_INVALIDCALL from Everything_GetResultSize?
Posted: Thu Jun 15, 2023 10:53 pm
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);
Re: EVERYTHING_ERROR_INVALIDCALL from Everything_GetResultSize?
Posted: Thu Jun 15, 2023 11:21 pm
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?
Re: EVERYTHING_ERROR_INVALIDCALL from Everything_GetResultSize?
Posted: Thu Jun 15, 2023 11:34 pm
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?
Re: EVERYTHING_ERROR_INVALIDCALL from Everything_GetResultSize?
Posted: Thu Jun 15, 2023 11:36 pm
by vefatica
Exactly! My fault.
Re: EVERYTHING_ERROR_INVALIDCALL from Everything_GetResultSize?
Posted: Sat Jun 17, 2023 4:14 am
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
Re: EVERYTHING_ERROR_INVALIDCALL from Everything_GetResultSize?
Posted: Sat Jun 17, 2023 4:34 am
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