SDK error When using Everything Service mode

Plug-in and third party software discussion.
Post Reply
kaifuzi
Posts: 19
Joined: Thu May 30, 2019 12:53 am

SDK error When using Everything Service mode

Post by kaifuzi » Tue Jan 19, 2021 9:47 pm

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!

void
Site Admin
Posts: 6077
Joined: Fri Oct 16, 2009 11:31 pm

Re: SDK error When using Everything Service mode

Post by void » Tue Jan 19, 2021 10:37 pm

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.

kaifuzi
Posts: 19
Joined: Thu May 30, 2019 12:53 am

Re: SDK error When using Everything Service mode

Post by kaifuzi » Wed Jan 20, 2021 12:01 am

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".

kaifuzi
Posts: 19
Joined: Thu May 30, 2019 12:53 am

Re: SDK error When using Everything Service mode

Post by kaifuzi » Wed Jan 20, 2021 12:08 am

After test, the Everything_Query returns success.

void
Site Admin
Posts: 6077
Joined: Fri Oct 16, 2009 11:31 pm

Re: SDK error When using Everything Service mode

Post by void » Wed Jan 20, 2021 12:15 am

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

NotNull
Posts: 2693
Joined: Wed May 24, 2017 9:22 pm

Re: SDK error When using Everything Service mode

Post by NotNull » Wed Jan 20, 2021 12:26 am

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 .." )

kaifuzi
Posts: 19
Joined: Thu May 30, 2019 12:53 am

Re: SDK error When using Everything Service mode

Post by kaifuzi » Wed Jan 20, 2021 12:32 am

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.

void
Site Admin
Posts: 6077
Joined: Fri Oct 16, 2009 11:31 pm

Re: SDK error When using Everything Service mode

Post by void » Wed Jan 20, 2021 12:35 am

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.

NotNull
Posts: 2693
Joined: Wed May 24, 2017 9:22 pm

Re: SDK error When using Everything Service mode

Post by NotNull » Wed Jan 20, 2021 12:47 am

Thank you, 100 wise men ;)

kaifuzi
Posts: 19
Joined: Thu May 30, 2019 12:53 am

Re: SDK error When using Everything Service mode

Post by kaifuzi » Wed Jan 20, 2021 12:50 am

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!

void
Site Admin
Posts: 6077
Joined: Fri Oct 16, 2009 11:31 pm

Re: SDK error When using Everything Service mode

Post by void » Wed Jan 20, 2021 12:51 am

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.

kaifuzi
Posts: 19
Joined: Thu May 30, 2019 12:53 am

Re: SDK error When using Everything Service mode

Post by kaifuzi » Wed Jan 20, 2021 1:01 am

It works now, thanks very much!!!

Post Reply