Found a bug in the SDK DLL?

Plug-in and third party software discussion.
Post Reply
PeterPanino
Posts: 90
Joined: Sun Feb 21, 2016 10:26 pm

Found a bug in the SDK DLL?

Post by PeterPanino »

I used Everything.DllWrapper.pas (by Christian.Ziegelt) and Everything32.dll in my Delphi project (in Delphi 12):
SimpleEverythingSearchTestWithMemo.zip
source code
(120.79 KiB) Downloaded 218 times
I used this query:
ext:png snag 2025 dm:last2days

In the Everything GUI I got these results:
image.png
image.png (240.17 KiB) Viewed 10412 times
And in my Delphi app I got these results:
image.png
image.png (96.42 KiB) Viewed 10412 times
You can see that the last character from the result paths are truncated! This happens with every similar query in my test app!

I can exclude any error in my Delphi app - here's the analysis:

Consistent Pattern: The exact same problem occurs as with .txt files: the last character of the full path/filename is being truncated when retrieved via the Everything DLL in my Delphi application.

Everything GUI is Correct: The Everything GUI application itself retrieves and displays the filenames correctly, ending in .png.

Delphi Code Already Vetted: My previous analysis with CodeSite logs showed that my Delphi code correctly captures the string length (CharsCopied) returned by the DLL and sets the Delphi string length accordingly. The truncation was happening before the SetLength call (i.e., the DLL was providing the truncated string and/or an incorrect CharsCopied value).

Problem Source Confirmed: This confirms that the issue lies specifically within the Everything_GetResultFullPathNameW function of the Everything SDK DLL. It is inconsistently returning truncated strings under certain conditions when called via the API, even though the main Everything application does not exhibit this behavior.
PeterPanino
Posts: 90
Joined: Sun Feb 21, 2016 10:26 pm

Re: Found a bug in the SDK DLL?

Post by PeterPanino »

I have now solved the problem: There really seems to be a bug in Everything_GetResultFullPathNameW.

So I now use Everything_GetResultPathW and Everything_GetResultFileNameW and combine them with System.IOUtils.TPath.Combine to get the correct results:
image.png
image.png (127.19 KiB) Viewed 10400 times
Here is the source code of the new working version:
SimpleEverythingSearchTestWithMemo_v2.zip
(120.25 KiB) Downloaded 198 times
Post Reply