Sure, as I said, you cannot naively translate from/to C++. But SHOpenRegStream2 poses the very same
exception problem I described above - I regard this as a bug. By forcing you to think about untyped pointers and reference counting, Delphi doesn't hide this bug. Delphi's interfaces are made to be fail-safe with the automatic reference counting - but this safety simply cannot be provided in the case of SHOpenRegStream2 et al., and Delphi doesn't give any illusions about this.