Calling Everything64.dll from windows service returns null - Help

If you are experiencing problems with "Everything", post here for assistance.
Post Reply
mrkozma
Posts: 6
Joined: Fri Dec 03, 2021 3:19 pm

Calling Everything64.dll from windows service returns null - Help

Post by mrkozma »

Hello,

I created a web API in .net5 that is querying Everything’s database for the existence of files.
When I run the application in debug or release mode in Visual Studio it is working flawlessly, but once I install the app as a service after publishing it, the web API always returns null for each and every file queried.

I implemented logging, and I can follow the request in the service up until it calls the Everything64.dll library API from the EverythingSearch.cs file.
Things are looking good till that point, then the Everything64.dll returns null.

I tried to run the service under different usernames, but to no avail.

Have you experienced this, do you have any advice how to solve this?

Thank you!

Update: I called Everything_GetLastError that returned value 2: EVERYTHING_ERROR_IPC - IPC is not available
NotNull
Posts: 5461
Joined: Wed May 24, 2017 9:22 pm

Re: Calling Everything64.dll from windows service returns null - Help

Post by NotNull »

Is Everything running in the background? Everything64.dll tries to establish an IPC connection with a running Everything as Everything will handle all requests.

Also: are you using an named instance of Everything? It's name will be shown in the window title/caption.
mrkozma
Posts: 6
Joined: Fri Dec 03, 2021 3:19 pm

Re: Calling Everything64.dll from windows service returns null - Help

Post by mrkozma »

Hi NotNull, thanks for your reply.

Everything is running as a service. This is the path to the executable on the service's properties window "C:\Program Files (x86)\Everything\Everything.exe" -svc

The Everything Windows app is running from here: "C:\Program Files (x86)\Everything\Everything.exe"

"Everything" is shown as the window title. Image
void
Developer
Posts: 16841
Joined: Fri Oct 16, 2009 11:31 pm

Re: Calling Everything64.dll from windows service returns null - Help

Post by void »

Your app will be unable to communicate with Everything when it is running as a service.

The Everything SDK uses WM_COPYDATA for IPC.

Everything normally runs in Session 1 and services run in session 0.
Windows Session 0 Isolation will prevent your service from communicating with Everything in session 1.


A work around is to run Everything in session 0 (or run the Everything client as a service)
mrkozma
Posts: 6
Joined: Fri Dec 03, 2021 3:19 pm

Re: Calling Everything64.dll from windows service returns null - Help

Post by mrkozma »

I learned more than one thing today.
That worked.

Thanks!
Post Reply