[Migrated content. Thread originally posted on 20 September 2006]
In short I am interested in calling the DLL (Advapi32.dll) and calling subroutine (logonuser). Reason being I am trying to impersonate another user to avoid an active directory conflict while trying connect to our sql server. I have no exceptions while calling Advapi32 (CALL"Advapi32.dll@WINAPI" ON EXCEPTION GO TO 9999-INITIALIZE-ERR) but when I call 'logonuser' I get an exception. I have no problems calling sub routines 'getusernameA' or 'GetCurrentProcessId' because the parameters passed are easier understood. As for 'logonuser' I am not sure how to set up the passing parameters and the return value any help on getting this to work would be greatly appreciated.thanks
jp
BOOL LogonUser(
LPTSTR lpszUsername,
LPTSTR lpszDomain,
LPTSTR lpszPassword,
DWORD dwLogonType,
DWORD dwLogonProvider,
PHANDLE phToken
);



