Package com.sun.jna.platform.win32.DsGetDC

Examples of com.sun.jna.platform.win32.DsGetDC.DS_DOMAIN_TRUSTS.toArray()


      if(W32Errors.NO_ERROR != rc) {
            throw new Win32Exception(rc);
      }
      try {
            DS_DOMAIN_TRUSTS domainTrustRefs = new DS_DOMAIN_TRUSTS(domainsPointerRef.getValue());
            DS_DOMAIN_TRUSTS[] domainTrusts = (DS_DOMAIN_TRUSTS[]) domainTrustRefs.toArray(new DS_DOMAIN_TRUSTS[domainTrustCount.getValue()]);
            ArrayList<DomainTrust> trusts = new ArrayList<DomainTrust>(domainTrustCount.getValue());
            for(DS_DOMAIN_TRUSTS domainTrust : domainTrusts) {
                DomainTrust t = new DomainTrust();
                if (domainTrust.DnsDomainName != null) {
                  t.DnsDomainName = domainTrust.DnsDomainName.toString();
View Full Code Here


        assertEquals(W32Errors.NO_ERROR, Netapi32.INSTANCE.DsEnumerateDomainTrusts(null,
                DsGetDC.DS_DOMAIN_VALID_FLAGS, domainsPointerRef, domainTrustCount));
      assertTrue(domainTrustCount.getValue() >= 0);
     
        DS_DOMAIN_TRUSTS domainTrustRefs = new DS_DOMAIN_TRUSTS(domainsPointerRef.getValue());
        DS_DOMAIN_TRUSTS[] domainTrusts = (DS_DOMAIN_TRUSTS[]) domainTrustRefs.toArray(new DS_DOMAIN_TRUSTS[domainTrustCount.getValue()]);

      for(DS_DOMAIN_TRUSTS trust : domainTrusts) {
      assertTrue(trust.DnsDomainName.length() > 0);
      assertTrue(Advapi32.INSTANCE.IsValidSid(trust.DomainSid));
      assertTrue(Advapi32Util.convertSidToStringSid(trust.DomainSid).startsWith("S-"));
View Full Code Here

      IntByReference entriesread = new IntByReference();
      IntByReference totalentries = new IntByReference();
      assertEquals(LMErr.NERR_Success, Netapi32.INSTANCE.NetGroupEnum(
          null, 2, bufptr, LMCons.MAX_PREFERRED_LENGTH, entriesread, totalentries, null));     
      GROUP_INFO_2 group = new GROUP_INFO_2(bufptr.getValue());     
      GROUP_INFO_2[] groups = (GROUP_INFO_2[]) group.toArray(entriesread.getValue());
        for (GROUP_INFO_2 grpi : groups) {
          assertTrue(grpi.grpi2_name.length() > 0);
        }
      assertEquals(LMErr.NERR_Success, Netapi32.INSTANCE.NetApiBufferFree(bufptr.getValue()));
    }
View Full Code Here

      IntByReference entriesread = new IntByReference();
      IntByReference totalentries = new IntByReference();
      assertEquals(LMErr.NERR_Success, Netapi32.INSTANCE.NetGroupEnum(
          null, 2, bufptr, LMCons.MAX_PREFERRED_LENGTH, entriesread, totalentries, null));     
      GROUP_INFO_2 group = new GROUP_INFO_2(bufptr.getValue());     
      GROUP_INFO_2[] groups = (GROUP_INFO_2[]) group.toArray(entriesread.getValue());
        for (GROUP_INFO_2 grpi : groups) {
          assertTrue(grpi.grpi2_name.length() > 0);
        }
      assertEquals(LMErr.NERR_Success, Netapi32.INSTANCE.NetApiBufferFree(bufptr.getValue()));
    }
View Full Code Here

                    0, bufptr, LMCons.MAX_PREFERRED_LENGTH, entriesread, totalentries);
            if (rc != LMErr.NERR_Success) {
                throw new Win32Exception(rc);
            }
            GROUP_USERS_INFO_0 lgroup = new GROUP_USERS_INFO_0(bufptr.getValue());     
            GROUP_USERS_INFO_0[] lgroups = (GROUP_USERS_INFO_0[]) lgroup.toArray(entriesread.getValue());
            ArrayList<Group> result = new ArrayList<Group>();
            for (GROUP_USERS_INFO_0 lgpi : lgroups) {
                Group lgp = new Group();
                if (lgpi.grui0_name != null) {
                  lgp.name = lgpi.grui0_name.toString();
View Full Code Here

      IntByReference totalentries = new IntByReference();
      assertEquals(LMErr.NERR_Success, Netapi32.INSTANCE.NetUserGetGroups(
          null, users[0].name, 0, bufptr, LMCons.MAX_PREFERRED_LENGTH,
          entriesread, totalentries));
      GROUP_USERS_INFO_0 lgroup = new GROUP_USERS_INFO_0(bufptr.getValue());     
      GROUP_USERS_INFO_0[] lgroups = (GROUP_USERS_INFO_0[]) lgroup.toArray(entriesread.getValue());
        for (GROUP_USERS_INFO_0 localGroupInfo : lgroups) {
          assertTrue(localGroupInfo.grui0_name.length() > 0);
        }
      assertEquals(LMErr.NERR_Success, Netapi32.INSTANCE.NetApiBufferFree(bufptr.getValue()));
    }
View Full Code Here

            0, bufptr, LMCons.MAX_PREFERRED_LENGTH, entriesread, totalentries);
        if (rc != LMErr.NERR_Success) {
          throw new Win32Exception(rc);
        }
        GROUP_USERS_INFO_0 lgroup = new GROUP_USERS_INFO_0(bufptr.getValue());     
        GROUP_USERS_INFO_0[] lgroups = (GROUP_USERS_INFO_0[]) lgroup.toArray(entriesread.getValue());
      ArrayList<Group> result = new ArrayList<Group>();
          for (GROUP_USERS_INFO_0 lgpi : lgroups) {
        Group lgp = new Group();
        lgp.name = lgpi.grui0_name.toString();
        result.add(lgp);
View Full Code Here

      IntByReference totalentries = new IntByReference();
      assertEquals(LMErr.NERR_Success, Netapi32.INSTANCE.NetUserGetGroups(
          null, users[0].name, 0, bufptr, LMCons.MAX_PREFERRED_LENGTH,
          entriesread, totalentries));
      GROUP_USERS_INFO_0 lgroup = new GROUP_USERS_INFO_0(bufptr.getValue());     
      GROUP_USERS_INFO_0[] lgroups = (GROUP_USERS_INFO_0[]) lgroup.toArray(entriesread.getValue());
        for (GROUP_USERS_INFO_0 localGroupInfo : lgroups) {
          assertTrue(localGroupInfo.grui0_name.length() > 0);
        }
      assertEquals(LMErr.NERR_Success, Netapi32.INSTANCE.NetApiBufferFree(bufptr.getValue()));
    }
View Full Code Here

                    0, 0, bufptr, LMCons.MAX_PREFERRED_LENGTH, entriesread, totalentries);
            if (rc != LMErr.NERR_Success) {
                throw new Win32Exception(rc);
            }
            LOCALGROUP_USERS_INFO_0 lgroup = new LOCALGROUP_USERS_INFO_0(bufptr.getValue());     
            LOCALGROUP_USERS_INFO_0[] lgroups = (LOCALGROUP_USERS_INFO_0[]) lgroup.toArray(entriesread.getValue());
            ArrayList<Group> result = new ArrayList<Group>();
            for (LOCALGROUP_USERS_INFO_0 lgpi : lgroups) {
                LocalGroup lgp = new LocalGroup();
                if (lgpi.lgrui0_name != null) {
                  lgp.name = lgpi.lgrui0_name.toString();
View Full Code Here

      IntByReference totalentries = new IntByReference();
      assertEquals(LMErr.NERR_Success, Netapi32.INSTANCE.NetUserGetLocalGroups(
          null, currentUser, 0, 0, bufptr, LMCons.MAX_PREFERRED_LENGTH,
          entriesread, totalentries));
      LOCALGROUP_USERS_INFO_0 lgroup = new LOCALGROUP_USERS_INFO_0(bufptr.getValue());     
      LOCALGROUP_USERS_INFO_0[] lgroups = (LOCALGROUP_USERS_INFO_0[]) lgroup.toArray(entriesread.getValue());
        for (LOCALGROUP_USERS_INFO_0 localGroupInfo : lgroups) {
          assertTrue(localGroupInfo.lgrui0_name.length() > 0);
        }
      assertEquals(LMErr.NERR_Success, Netapi32.INSTANCE.NetApiBufferFree(bufptr.getValue()));
    }   
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.