OLE error in TAdvExplorerTreeview

Unfortunately we couldn't reproduce this and we did not get any similar problem report so far.

You did not reproduce, with Patch 1 of Delphi 11.1 this time ?

Do you have anything special / extra 3rd party tool installed in Windows?

No, I reproduce with the sample on a clean test PC without 3rd party tool installed. Maybe Onedrive but it is not a 3rd party; installed by defaut by windows now.

Moreover I did not reproduce with the sample you compiled on your side, without patch1. SO it seems to be more an issue at compilation time.

Nevertheless I can test again with windows sandbox to a completly clean install; wihtout anything installed

I confirm that I reproduce with SandBox (win10, nothing installed). As usual, it does not occurs every times, but very often. During tthe test, I get it during the 2nd attempt then 6 times in a row. I remind you that exe must be closed/restarted between each attempt.

You can find attached the compiled Exe I used to test. Previously I provided only the sample sources..

AdvExplorerTreeviewSample.zip (1.8 MB)

Hi Support,

As you did not reproduce we spent some times to analyze the sources. Here is our feedbacks.

---- OLE ERROR ----
In TCustomExplorerTreeview.LoadDirectoryStructure, you process "desktop" and "myComputer" cases.
For each case, there are 2 SHGetFileInfo calls:

  • 1st for getting display name
  • 2nd for getting icon

The issue occurs on first call where there are many flags used including SHGFI_EXETYPE and SHGFI_SYSICONINDEX.
According to Microsoft Doc, both flags modify the return value. So I suppose that when using these flags, the OleCheck should not be used as in these cases the result is not sucess/error but exetype or index.
By the way, you don't use OleCheck for the second call when really getting the icon.

In addition:

  • Is it really necessary to use SHGFI_EXETYPE, SHGFI_SYSICONINDEX, SHGFI_ICON, SHGFI_SMALLICON, ... for getting only the szDisplayName ?
  • In the Microsoft Doc, regarding SHGFI_EXETYPE : "This flag cannot be specified with any other flags."

---- Access violation when clicking "chevron" to navigate ----
It seems to happen where you use Tag to save TAdvTreeNode pointer ( AdvExplorerTreeview, lines 7428, 7445, 7457, ... ). Pointer is cast to Integer instead of NativeInt.
This is not correct and since Delphi 11.1, ASLR is enabled. As a consequence, it is more easy or even systematic to have pointer bigger than Max(Integer).

I hope this help.

Best regards,


In Addition to my last message:
SHGetFileInfo returns a NativeUInt (64b) while OleCheck take a HResult (32b). That's probably why it is not always reproduced. If SHGetFileInfo returns a result > Max(HResult), the result is misinterprated by OleCheck. Here also it seems to happen more frequently if ASLR is enabled as it is enable by default in 11.1.

We sent an incremental source update for your checks by DM.

I tested. Both issues are fixed.

Will the fixes be in the next release ? When is it planned ?

Best regards,


Next release where this fix will be included is expected for 1st week of July.