F
Francois Vanderseypen
I have a C-library API to the Tivoli LDAP allowing to manage users and
groups.
The user management is an ASP.Net application and this library should
update/synchronize the LDAP.
The C-lib signature is:
int SIT_Registry_Initialise( void ** _LdapSession ,
char* _szHost_Port,
char* _szAdmin_DN,
char* _szAdmin_Pwd);
I understand that the void** is a "byref" argument. The _LdapSession
is passed (as a connection object) to other calls thereafter. I guess
the _LdapSession is a C-structure.
How should I wrap this dll function?
At this moment it looks like:
[DllImport("SIT_UML.dll", EntryPoint="SIT_Registry_Initialise")]public
static extern int InitializeRegistry([MarshalAs(UnmanagedType.AsAny)]UIntPtr
LDAPSession,[MarshalAs(UnmanagedType.LPStr)]string
HostPort,[MarshalAs(UnmanagedType.LPStr)]string
AdminUserID,[MarshalAs(UnmanagedType.LPStr)]string AdminPassword);
and the actual call is:
UIntPtr LDAPSession=UIntPtr.Zero;
int ret=UML.InitializeRegistry(LDAPSession,"blabla","blabla","blabla");
Thanks for any help!
groups.
The user management is an ASP.Net application and this library should
update/synchronize the LDAP.
The C-lib signature is:
int SIT_Registry_Initialise( void ** _LdapSession ,
char* _szHost_Port,
char* _szAdmin_DN,
char* _szAdmin_Pwd);
I understand that the void** is a "byref" argument. The _LdapSession
is passed (as a connection object) to other calls thereafter. I guess
the _LdapSession is a C-structure.
How should I wrap this dll function?
At this moment it looks like:
[DllImport("SIT_UML.dll", EntryPoint="SIT_Registry_Initialise")]public
static extern int InitializeRegistry([MarshalAs(UnmanagedType.AsAny)]UIntPtr
LDAPSession,[MarshalAs(UnmanagedType.LPStr)]string
HostPort,[MarshalAs(UnmanagedType.LPStr)]string
AdminUserID,[MarshalAs(UnmanagedType.LPStr)]string AdminPassword);
and the actual call is:
UIntPtr LDAPSession=UIntPtr.Zero;
int ret=UML.InitializeRegistry(LDAPSession,"blabla","blabla","blabla");
Thanks for any help!