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 »

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
Developer
Posts: 16770
Joined: Fri Oct 16, 2009 11:31 pm

Re: SDK error When using Everything Service mode

Post 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.
kaifuzi
Posts: 19
Joined: Thu May 30, 2019 12:53 am

Re: SDK error When using Everything Service mode

Post 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".
kaifuzi
Posts: 19
Joined: Thu May 30, 2019 12:53 am

Re: SDK error When using Everything Service mode

Post by kaifuzi »

After test, the Everything_Query returns success.
void
Developer
Posts: 16770
Joined: Fri Oct 16, 2009 11:31 pm

Re: SDK error When using Everything Service mode

Post 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
NotNull
Posts: 5461
Joined: Wed May 24, 2017 9:22 pm

Re: SDK error When using Everything Service mode

Post 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 .." )
kaifuzi
Posts: 19
Joined: Thu May 30, 2019 12:53 am

Re: SDK error When using Everything Service mode

Post 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.
void
Developer
Posts: 16770
Joined: Fri Oct 16, 2009 11:31 pm

Re: SDK error When using Everything Service mode

Post 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.
NotNull
Posts: 5461
Joined: Wed May 24, 2017 9:22 pm

Re: SDK error When using Everything Service mode

Post by NotNull »

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 »

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
Developer
Posts: 16770
Joined: Fri Oct 16, 2009 11:31 pm

Re: SDK error When using Everything Service mode

Post 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.
kaifuzi
Posts: 19
Joined: Thu May 30, 2019 12:53 am

Re: SDK error When using Everything Service mode

Post by kaifuzi »

It works now, thanks very much!!!
Post Reply