Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Wrong parameter ADsOpenObject activeds.dll

355 views
Skip to first unread message

Rafael Rocha

unread,
Jun 30, 2011, 1:15:14 PM6/30/11
to
Hi guys!
Below there is a try to use LDAP. When it execute the function return
a wrong. I did the same thing in Delphi and it works. I guess that the
problem is the last two parameters.

If someone can help, I will be very happy!

type guid from structure
long data1
integer data2
integer data3
character data4[4]
end type

type prototypes
function long ADsOpenObject(string path, string userName, string
password, long flags, ref GUID iid, ref long ppObject) library
"activeds.dll"
end prototypes

public function long of_is_authenticated (string as_domain, string
as_user_name, string as_password)
/*
Authenticates against Active directory
as_domain = Domain to connect to. exp. "yourplace.com"
as_user_name = User name to authenticate.
as_password = Password for user.

Returns Values:
0 = Authenticated
-1 = Unknown username or bad password
-2 = Password expired
-3 = Account disabled
-4 = Domain not found
-5 = Logon ID already in use
-6 = Unknown Error
*/

GUID ls_iid
//oleobject la_pp //sometimes this causes an issue..
long la_pp
long ll_ret


// IUnknown interface = 00000000-0000-0000-C000-000000000046
ls_iid.data4[1] = char(192)
ls_iid.data4[4] = char(17920) //LittleEndian

ll_ret = ADsOpenObject("LDAP://" + as_domain, as_user_name,
as_password, 1, ref ls_iid, ref la_pp)

//la_pp.disconnectobject( ) //How do we clean up?
//destroy la_pp

Choose Case ll_ret
case 0
//Success
case -2147023570
//Unknown username or bad password
ll_ret = -1
case -2147943730
//Password expired
ll_ret = -2
case -2147943731
//Account disabled
ll_ret = -3
case -2147943755
//Domain not found
ll_ret = -4
case -2147943763
//Logon ID already in use
ll_ret = -5
case else
//Unknown Error
ll_ret = -6
End Choose

return ll_ret
end function


--
Regards,
Rafael Rocha
Analista de sistemas
MSN, GTalk: raf...@gmail.com
Twitter: @rafael_orocha
https://rafaelti.wordpress.com/
https://divulgacaoufmg.wordpress.com
http://br.linkedin.com/pub/rafael-rocha/26/742/129

Rafael Rocha

unread,
Jun 30, 2011, 1:16:31 PM6/30/11
to

bruce.a...@yahoo.com

unread,
Jul 7, 2011, 10:49:45 AM7/7/11
to
This group is no longer active on the Sybase server. In addition, the feed between Google and the Sybase server is not currently working. If you post
through Goolge the post will never show up on the Sybase server, and most
people who answer questions in that group will never see it.
Instead, you may want to access the Sybase newsgroups directly at:

http://www.sybase.com/detail_list?id=11507&pageNum=1&multi=true&show=1248

0 new messages