Announcement

Collapse
No announcement yet.

about unmanaged code in ntdsapi.dll

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • about unmanaged code in ntdsapi.dll

    I have the following function in ntdsapi.dll:

    DWORD DsBindByInstance(
    LPCTSTR ServerName,
    LPCTSTR Annotation,
    GUID* InstanceGuid,
    LPCTSTR DnsDomainName,
    RPC_AUTH_IDENTITY_HANDLE AuthIdentity,
    LPCTSTR ServicePrincipalName,
    DWORD BindFlags,
    HANDLE* phDS
    );

    url:http://msdn.microsoft.com/library/de...byinstance.asp

    I used the following code to extract it:

    [DllImport("ntdsapi.dll")]
    static extern uint DsBindByInstance(
    string ServerName,
    string Annotation,
    string InstanceGuid,
    string DnsDomainName,
    out IntPtr phDS
    );

    However when i invoked the function, i did not execute it successfully.
    code:

    IntPtr phDsDc=IntPtr.Zero;
    uint uResult =DsBindByInstance("capia1.capd.com","389",null,nul l,out phDsDc);

    Did i declare the function wrongly?
    Please advice.
    Any help will be appreciated.
Working...
X