Package com.sun.jna.platform.win32.Sspi

Examples of com.sun.jna.platform.win32.Sspi.PSecPkgInfo.toArray()


            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();
        lgp.name = lgpi.lgrui0_name.toString();
        result.add(lgp);
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

      IntByReference entriesread = new IntByReference();
      IntByReference totalentries = new IntByReference();
      assertEquals(LMErr.NERR_Success, Netapi32.INSTANCE.NetUserEnum(         
          null, 1, 0, bufptr, LMCons.MAX_PREFERRED_LENGTH, entriesread, totalentries, null));     
      USER_INFO_1 userinfo = new USER_INFO_1(bufptr.getValue());     
      USER_INFO_1[] userinfos = (USER_INFO_1[]) userinfo.toArray(entriesread.getValue());
        for (USER_INFO_1 ui : userinfos) {
          assertTrue(ui.usri1_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.NetUserEnum(         
          null, 1, 0, bufptr, LMCons.MAX_PREFERRED_LENGTH, entriesread, totalentries, null));     
      USER_INFO_1 userinfo = new USER_INFO_1(bufptr.getValue());     
      USER_INFO_1[] userinfos = (USER_INFO_1[]) userinfo.toArray(entriesread.getValue());
        for (USER_INFO_1 ui : userinfos) {
          assertTrue(ui.usri1_name.length() > 0);
        }
      assertEquals(LMErr.NERR_Success, Netapi32.INSTANCE.NetApiBufferFree(bufptr.getValue()));
    }   
View Full Code Here

      PSecPkgInfo pPackageInfo = new PSecPkgInfo();
      int rc = Secur32.INSTANCE.EnumerateSecurityPackages(pcPackages, pPackageInfo);
      if(W32Errors.SEC_E_OK != rc) {
        throw new Win32Exception(rc);
      }
      SecPkgInfo[] packagesInfo = pPackageInfo.toArray(pcPackages.getValue());
      ArrayList<SecurityPackage> packages = new ArrayList<SecurityPackage>(pcPackages.getValue());
      for(SecPkgInfo packageInfo : packagesInfo) {
        SecurityPackage securityPackage = new SecurityPackage();
        securityPackage.name = packageInfo.Name.toString();
        securityPackage.comment = packageInfo.Comment.toString();
View Full Code Here

            throw new Win32Exception(Kernel32.INSTANCE.GetLastError());
        }

        pJobEnum.read();

        return (JOB_INFO_1[]) pJobEnum.toArray(pcReturned.getValue());
    }

}
View Full Code Here

            throw new Win32Exception(Kernel32.INSTANCE.GetLastError());
        }

        pPrinterEnum.read();

        return (PRINTER_INFO_1[]) pPrinterEnum.toArray(pcReturned.getValue());
    }

    public static PRINTER_INFO_4[] getPrinterInfo4() {
        IntByReference pcbNeeded = new IntByReference();
        IntByReference pcReturned = new IntByReference();
View Full Code Here

            throw new Win32Exception(Kernel32.INSTANCE.GetLastError());
        }

        pPrinterEnum.read();

        return (PRINTER_INFO_1[]) pPrinterEnum.toArray(pcReturned.getValue());
    }

    public static PRINTER_INFO_4[] getPrinterInfo4() {
        IntByReference pcbNeeded = new IntByReference();
        IntByReference pcReturned = new IntByReference();
View Full Code Here

      if(! Winspool.INSTANCE.EnumPrinters(Winspool.PRINTER_ENUM_LOCAL,
          null, 1, pPrinterEnum.getPointer(), pcbNeeded.getValue(), pcbNeeded, pcReturned)) {
        throw new Win32Exception(Kernel32.INSTANCE.GetLastError());
      }
     
      return (PRINTER_INFO_1[]) pPrinterEnum.toArray(pcReturned.getValue());
  }
 
  public static PRINTER_INFO_4[] getPrinterInfo4() {
      IntByReference pcbNeeded = new IntByReference();
      IntByReference pcReturned = new IntByReference();
View Full Code Here

      if (pcbNeeded.getValue() > 0) {
        PRINTER_INFO_1 pPrinterEnum = new PRINTER_INFO_1(pcbNeeded.getValue());
        assertTrue(Winspool.INSTANCE.EnumPrinters(Winspool.PRINTER_ENUM_LOCAL,
            null, 1, pPrinterEnum.getPointer(), pcbNeeded.getValue(), pcbNeeded, pcReturned));
        assertTrue(pcReturned.getValue() >= 0);
        PRINTER_INFO_1[] printerInfo = (PRINTER_INFO_1[]) pPrinterEnum.toArray(pcReturned.getValue());
        for(PRINTER_INFO_1 pi : printerInfo) {
          assertTrue(pi.pName == null || pi.pName.length() >= 0);
          // System.out.println(pi.pName);
        }
      }
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.