Jna -

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • pavan anumula
    New Member
    • Oct 2008
    • 5

    Jna -

    I am new to JNA, I want to convert DsGetDcName method to JNA.
    Code:
    DWORD [B]DsGetDcName[/B]( __in LPCTSTR ComputerName,
     __in LPCTSTR DomainName,
     __in GUID *DomainGuid, 
    __in LPCTSTR SiteName, 
    __in ULONG Flags,
     __out PDOMAIN_CONTROLLER_INFO *DomainControllerInfo 
    );
    I have converted the above function to JNA I replaced above parameters as follows
    Code:
    public static class [B]GUID [/B]extends Structure
    { 
     public int Data1; public short Data2; public short Data3; public byte Data4[]= new byte[8]; } 
     public static class DOMAIN_CONTROLLER_INFO extends Structure { 
     public String DomainControllerName; 
     public String DomainControllerAddress;
     public int DomainControllerAddressType;
     public GUID DomainGuid; // created Structure above 
     public String DomainName; 
     public String DnsForestName; 
     public int Flags; 
     public String DcSiteName; 
     public String ClientSiteName; 
    }
    JNA:
    Code:
    int [B]DsGetDCName[/B]( String strComputerName, 
    String strDomainName,
    GUID DomainGuid, // static class created extending with structure 
    String strSiteName,
     int iFlags, 
    DOMAIN_CONTROLLER_INFO DomainControllerInfo // static class created extending with structure
     );
    The above function returns 997 Error (ERROR IO PENDING).
    The method declaration is correct or not ?
    Please can any one help on this issue?

    Thanks in Advance.

    Regards
    Pavan Kumar A.
    Last edited by Frinavale; Jan 5 '10, 03:03 PM. Reason: Please post code in [code] ... [/code] tags. Added code tags.
  • RedSon
    Recognized Expert Expert
    • Jan 2007
    • 4980

    #2
    Please enclose your posted code in [code] tags (See How to Ask a Question).

    This makes it easier for our Experts to read and understand it. Failing to do so creates extra work for the moderators, thus wasting resources, otherwise available to answer the members' questions.

    Please use [code] tags in future.

    MODERATOR

    Comment

    Working...