Examples of Pointer


Examples of com.sun.jna.Pointer

      {
        Memory pTokenUser = new Memory(dwSize.getValue());
        if (MyAdvapi.INSTANCE.GetTokenInformation(hToken.getValue(), MyAdvapi.TokenUser, pTokenUser, dwSize.getValue(), dwSize))
        {
          MyAdvapi.TOKEN_USER tokenUser = new MyAdvapi.TOKEN_USER(pTokenUser);
          Pointer lpSid = tokenUser.User.Sid;
          Memory lpName = new Memory(256);
          IntByReference cchName = new IntByReference();
          cchName.setValue(256);
          Memory lpReferencedDomainName = new Memory(256);
          IntByReference cchReferencedDomainName = new IntByReference();
View Full Code Here

Examples of com.sun.jna.Pointer

    Map processMap = new HashMap();
    Map childrenMap = new MultiHashMap();
    Map[] result = new Map[]
    { processMap, childrenMap };

    Pointer processes = MyKernel32.INSTANCE.CreateToolhelp32Snapshot(MyKernel32.TH32CS_SNAPPROCESS, 0);
    if (processes == null)
    {
      System.out.println("note: task list is empty ");
      return result;
    }
View Full Code Here

Examples of com.sun.jna.Pointer

   *
   * @return the int
   */
  public static int processIdOfActiveWindow()
  {
    Pointer w = MyUser32.INSTANCE.GetForegroundWindow();
    IntByReference result = new IntByReference();
    MyUser32.INSTANCE.GetWindowThreadProcessId(w, result);
    return result.getValue();
  }
View Full Code Here

Examples of com.sun.jna.Pointer

  {
    String activeNode = null;

    try
    {
      Pointer cluster = Clusapi.INSTANCE.OpenCluster(null);
      Pointer hEnum = Clusapi.INSTANCE.ClusterOpenEnum(cluster, Clusapi.CLUSTER_ENUM_GROUP);
      int dwIndex = 0;
      IntByReference lpdwType = new IntByReference();
      IntByReference lpcchName = new IntByReference();
      Memory lpszName = new Memory(256);
      lpszName.clear();
View Full Code Here

Examples of com.sun.jna.Pointer

  private ClusterGroupInfo getGroupNodeInfo(Pointer cluster, String groupName)
  {
    ClusterGroupInfo result = null;
    try
    {
      Pointer hGroup = Clusapi.INSTANCE.OpenClusterGroup(cluster, new WString(groupName));

      if (hGroup == null)
        throw new RuntimeException("Clusapi call to OpenClusterGroup returned err code " + MyKernel32.INSTANCE.GetLastError());

      IntByReference lpcchNodeName = new IntByReference();
View Full Code Here

Examples of com.sun.jna.Pointer

    return result;
  }

  public Set<ClusterGroupInfo> getGroupInfo()
  {
    Pointer hCluster = Clusapi.INSTANCE.OpenCluster(null);
    if (hCluster == null)
      throw new RuntimeException("Clusapi call to OpenClusterGroup returned err code " + MyKernel32.INSTANCE.GetLastError());

    Pointer hEnum = Clusapi.INSTANCE.ClusterOpenEnum(hCluster, Clusapi.CLUSTER_ENUM_GROUP);
    if (hEnum == null)
      throw new RuntimeException("Clusapi call to ClusterOpenEnum returned err code " + MyKernel32.INSTANCE.GetLastError());

    Set<ClusterGroupInfo> result = new LinkedHashSet<ClusterGroupInfo>();
View Full Code Here

Examples of com.sun.jna.Pointer

            IntByReference lpdwNotifyKey = new IntByReference();
            IntByReference lpdwFilterType = new IntByReference();
            IntByReference lpcchName = new IntByReference();
            IntByReference dwNotifyKey = new IntByReference();
            Memory lpszName = new Memory(256);
            Pointer minusOne = Pointer.createConstant(-1);
            int dwMilliseconds = 300 * 1000;
            final int dwFilter = Clusapi.CLUSTER_CHANGE_GROUP_STATE | Clusapi.CLUSTER_CHANGE_HANDLE_CLOSE
                | Clusapi.CLUSTER_CHANGE_GROUP_DELETED | Clusapi.CLUSTER_CHANGE_CLUSTER_STATE
                | Clusapi.CLUSTER_CHANGE_CLUSTER_RECONNECT | Clusapi.CLUSTER_CHANGE_GROUP_ADDED;

            while (!_stopped)
            {
              Pointer hCluster = null;
              Pointer hChange = null;

              long started = System.currentTimeMillis();

              try
              {
View Full Code Here

Examples of com.sun.jna.Pointer

  }

  public static String currentUser()
  {
    int euid = CLibrary.INSTANCE.geteuid();
    Pointer p = CLibrary.INSTANCE.getpwuid(euid);
    if (p == null)
      System.out.println("could not get current user");
    return new CLibrary.passwd(p).getName();

  }
View Full Code Here

Examples of com.sun.jna.Pointer

      return;
    String current = currentUser();
    System.out.println("current user" + current);
    if (current != null && !current.equals(name))
    {
      Pointer p = CLibrary.INSTANCE.getpwnam(name);
      int newUid = new CLibrary.passwd(p).getUid();
      if (newUid == 0)
        System.out.println("could not get user " + name);
      int res = CLibrary.INSTANCE.setreuid(newUid, newUid);
      if (res != 0)
View Full Code Here

Examples of com.sun.jna.Pointer

    public String  lpDisplayName;

    public String[] getDependencies()
    {
      List<String> result = new ArrayList<String>();
      Pointer ptr = lpDependencies;
      int offset = 0;
      String s = "";
      if (ptr != null)
        do
        {
          s = ptr.getString(offset, true);
          if (s != null && !"".equals(s))
          {
            result.add(s);
            offset += s.getBytes().length * 2 + 2;
          }
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.