Well, the way I see it it's not a design discussion (although I agree that the Delphi (Safecall) solution is elegant) but what's happening here is that Delphi put's 2 pointers on stack while the
dll expects only one. Another example where this happens is
SHOpenRegStream2.