Dezipaitor pointed me to this topic, although I didn't test your code I am sure the problem is the declaration in AdsHlp:
Delphi-Quellcode:
function ADsOpenObject(lpszPathName:WideString;
lpszUserName:WideString;
lpszPassword:WideString;
dwReserved:DWORD;
const riid:TGUID;
out ppObject):HRESULT; safecall;
which should be using PWideChar instead of WideString. The declaration in the
Jedi Apilib (JwaActiveDs) is correct btw:
Delphi-Quellcode:
function ADsOpenObject(lpszPathName, lpszUserName, lpszPassword: LPCWSTR;
dwReserved: DWORD; const riid: REFIID; out ppObject: Pointer): HRESULT; stdcall;