Page 1 of 1

SDK error When using Everything Service mode

Posted: Tue Jan 19, 2021 9:47 pm
by kaifuzi
In Win10, we need to run Everything as admin, otherwise we need to check the option Everything Service, and uncheck Run as administrator.
When I use admin mode, I search by SDK, it works well.
But when I use Everything Service mode, there will be error "Arithmetic operation resulted in an overflow". For example, search string is ".xml test".
Does anyone how to solve this issue if I want to use Everything Service mode? Thanks very much!

Re: SDK error When using Everything Service mode

Posted: Tue Jan 19, 2021 10:37 pm
by void
The SDK requires the Everything Search Client is also running.

The SDK does not communicate with the Everything Service.
The SDK communicates with the Everything Search Client.
The Everything Search Client communicates with the Everything Service.

Can you please confirm the issue occurs when the Everything Search Client is running.

I recommend running the Everything Search Client as a standard user with the Everything Service installed.

Please make sure Everything_Query returns success and if it doesn't, please check the last error with Everything_GetLastError.
Everything_Query should fail with EVERYTHING_ERROR_IPC if the EVerything Search Client is not running.

Re: SDK error When using Everything Service mode

Posted: Wed Jan 20, 2021 12:01 am
by kaifuzi
The issue occurs when the Everything Search Client is running.
And I'm running the Everything Search Client as a standard user with the Everything Service installed.
This issue doesn't always happen. It happens for some search, e.g. ".xml test".

Re: SDK error When using Everything Service mode

Posted: Wed Jan 20, 2021 12:08 am
by kaifuzi
After test, the Everything_Query returns success.

Re: SDK error When using Everything Service mode

Posted: Wed Jan 20, 2021 12:15 am
by void
Thank you for your reply.

Could you please share your result processing code?

The Everything SDK does not throw exceptions.
This exception sounds like a c# / Visual Basic integer overflow exception.

You might be casting a 64bit Intptr to a 32bit Intptr?
Please make sure you are using the x64 version of Everything and the x64 Everything64.dll

Re: SDK error When using Everything Service mode

Posted: Wed Jan 20, 2021 12:26 am
by NotNull
void wrote: Wed Jan 20, 2021 12:15 am [...] and the x64 Everything64.dll
Is there a difference with using Everything32.dll? I thought all IPC communication is 32-bit? Or is that completely irrelevant here?

(a new episode in the serie "One idiot can ask more questions than 100 wise men can answer .." )

Re: SDK error When using Everything Service mode

Posted: Wed Jan 20, 2021 12:32 am
by kaifuzi
After debug, I found the reason, but I don't know why it happened.
Here is the code which have issue, it's VB.net:
Dim fs, ftdm As UInt64
Everything_GetResultDateCreated(i, ftdm)
DateCreated = System.DateTime.FromFileTime(ftdm) 'Here is the probelm code. But in Everything admin mode, it's fine.

Re: SDK error When using Everything Service mode

Posted: Wed Jan 20, 2021 12:35 am
by void
Correct, Everything communication over IPC is 32bit.

The Everything64.dll and Everything32.dll will work with both the x64 and x86 version of Everything.

If you are compiling your app as x64, please use the Everything64.dll.

Re: SDK error When using Everything Service mode

Posted: Wed Jan 20, 2021 12:47 am
by NotNull
Thank you, 100 wise men ;)

Re: SDK error When using Everything Service mode

Posted: Wed Jan 20, 2021 12:50 am
by kaifuzi
After several tests, I think the problem is because of admin right.
Dim fs, ftdm As UInt64
Everything_GetResultDateCreated(i, ftdm)
DateCreated = System.DateTime.FromFileTime(ftdm) 'Here is the probelm code. But in Everything admin mode, it's fine.
System.DateTime.FromFileTime(ftdm) can't get the correct result when the file need admin access right.
Do you have any idea to solve it? Thanks!

Re: SDK error When using Everything Service mode

Posted: Wed Jan 20, 2021 12:51 am
by void
Everything uses the value &HFFFFFFFFFFFFFFFFUL for unknown dates.

And vb.net does not like &HFFFFFFFFFFFFFFFFUL being passed to System.DateTime.FromFileTime

Please try the following fix:

Code: Select all

                Everything_GetResultDateModified(i, ftdm)

                If ftdm = &HFFFFFFFFFFFFFFFFUL Then
                    DateModified = Nothing
                Else
                    DateModified = System.DateTime.FromFileTime(ftdm)
                End If
I have updated the SDK example.

Re: SDK error When using Everything Service mode

Posted: Wed Jan 20, 2021 1:01 am
by kaifuzi
It works now, thanks very much!!!