Package com.sun.jna

Examples of com.sun.jna.WString


    return new InternetExplorerElement(lib, parent, rawElement.getValue());
  }

  public List<WebElement> findElementsByTagName(String using) {
    PointerByReference elements = new PointerByReference();
    int result = lib.wdFindElementsByTagName(driver, element, new WString(using), elements);

    handleErrorCode("tag name", using, result);

    return new ElementCollection(lib, parent, elements.getValue()).toList();
  }
View Full Code Here


    return new ElementCollection(lib, parent, elements.getValue()).toList();
  }

  public WebElement findElementByXPath(String using) {
    PointerByReference rawElement = new PointerByReference();
    int result = lib.wdFindElementByXPath(driver, element, new WString(using), rawElement);

    try {
      handleErrorCode("xpath", using, result);
    } catch (UnexpectedJavascriptExecutionException e) {
      // Looks like the page was reloading. Fine. We didn't find the element
View Full Code Here

    return new InternetExplorerElement(lib, parent, rawElement.getValue());
  }

  public List<WebElement> findElementsByXPath(String using) {
    PointerByReference elements = new PointerByReference();
    int result = lib.wdFindElementsByXPath(driver, element, new WString(using), elements);

    try {
      handleErrorCode("xpath", using, result);
    } catch (UnexpectedJavascriptExecutionException e) {
      // Looks like the page was reloading. Fine. We didn't find the element
View Full Code Here

    if (Config.getValueAsBoolean(Config.SWAP_MUSIC_NAME_ARTIST_)) {
      displayFormat = "{0} - {1}";
    } else {
      displayFormat = "{1} - {0}";
    }
    WString message = new WString("\\0" + category + "\\0" + (isVisible ? "1" : "0") + "\\0" + displayFormat
        + "\\0" + title + "\\0" + artist + "\\0" + album + "\\0\\0\0");
    DataStructure.ByReference data = new DataStructure.ByReference();
    data.dwData = 0x0547;
    data.lpData = message;
    data.cbData = (message.length() * 2) + 2;
    user32Lib.SendMessageA(getWindowHandler(), WM_COPYDATA, 0, data);
  }
View Full Code Here

        } catch (ServletException e) {
            fail(e.getMessage());
        }

        this.userInfo = new LMAccess.USER_INFO_1();
        this.userInfo.usri1_name = new WString(MockWindowsAccount.TEST_USER_NAME);
        this.userInfo.usri1_password = new WString(MockWindowsAccount.TEST_PASSWORD);
        this.userInfo.usri1_priv = LMAccess.USER_PRIV_USER;

        this.resultOfNetAddUser = Netapi32.INSTANCE.NetUserAdd(null, 1, this.userInfo, null);
        // ignore test if not able to add user (need to be administrator to do this).
        assumeTrue(LMErr.NERR_Success == this.resultOfNetAddUser);
View Full Code Here

    }

    @Test
    public void testLogonUser() {
        LMAccess.USER_INFO_1 userInfo = new LMAccess.USER_INFO_1();
        userInfo.usri1_name = new WString("WaffleTestUser");
        userInfo.usri1_password = new WString("!WAFFLEP$$Wrd0");
        userInfo.usri1_priv = LMAccess.USER_PRIV_USER;
        // ignore test if not able to add user (need to be administrator to do this).
        assumeTrue(LMErr.NERR_Success == Netapi32.INSTANCE.NetUserAdd(null, 1, userInfo, null));
        try {
            IWindowsAuthProvider prov = new WindowsAuthProviderImpl();
View Full Code Here

    }

    @Test
    public void testImpersonateLoggedOnUser() {
        LMAccess.USER_INFO_1 userInfo = new LMAccess.USER_INFO_1();
        userInfo.usri1_name = new WString(MockWindowsAccount.TEST_USER_NAME);
        userInfo.usri1_password = new WString(MockWindowsAccount.TEST_PASSWORD);
        userInfo.usri1_priv = LMAccess.USER_PRIV_USER;
        // ignore test if not able to add user (need to be administrator to do this).
        assumeTrue(LMErr.NERR_Success == Netapi32.INSTANCE.NetUserAdd(null, 1, userInfo, null));
        try {
            IWindowsAuthProvider prov = new WindowsAuthProviderImpl();
View Full Code Here

        SEC_WINNT_AUTH_IDENTITY authIdentity = null;
        if (user != null || password != null || domain != null) {
            authIdentity = new SEC_WINNT_AUTH_IDENTITY();
            if (user != null) {
                authIdentity.User = new WString(user);
                authIdentity.UserLength = new NativeLong(user.length());
            }
           
            if (password != null) {
                authIdentity.Password = new WString(password);
                authIdentity.PasswordLength = new NativeLong(password.length());
            }
           
            if (domain != null) {
                authIdentity.Domain = new WString(domain);
                authIdentity.DomainLength = new NativeLong(domain.length());
            }
            authIdentity.Flags = new NativeLong(ISVNSecurityLibrary.SEC_WINNT_AUTH_IDENTITY_UNICODE);
            authIdentity.write();
        }
       
        SecHandle pCred = new SecHandle();
        pCred.dwLower = new NativeLong(0);
        pCred.dwUpper = new NativeLong(0);
        pCred.write();

        ISVNSecurityLibrary.TimeStamp ltime = new ISVNSecurityLibrary.TimeStamp();
        ltime.HighPart = new NativeLong(0);
        ltime.LowPart = new NativeLong(0);
        ltime.write();
       
        int securityStatus = library.AcquireCredentialsHandleW(null, new WString("NTLM"),
                new NativeLong(ISVNSecurityLibrary.SECPKG_CRED_OUTBOUND), Pointer.NULL,
                authIdentity != null ? authIdentity.getPointer() : Pointer.NULL,
                        Pointer.NULL, Pointer.NULL, pCred.getPointer(), ltime.getPointer());
        if (securityStatus == 0) {
            pCred.read();
View Full Code Here

            // use ugly way.
            return false;
        }
        synchronized (library) {
            try {
                int rc = library.SetFileAttributesW(new WString(file.getAbsolutePath()), new NativeLong(ISVNKernel32Library.FILE_ATTRIBUTE_NORMAL));
                return rc != 0;
            } catch (Throwable th) {
            }
        }
        return false;
View Full Code Here

            // use ugly way.
            return false;
        }
        synchronized (library) {
            try {
                int rc = library.SetFileAttributesW(new WString(file.getAbsolutePath()),
                        new NativeLong(ISVNKernel32Library.FILE_ATTRIBUTE_HIDDEN));
                return rc != 0;
            } catch (Throwable th) {
            }
            return false;
View Full Code Here

TOP

Related Classes of com.sun.jna.WString

Copyright © 2018 www.massapicom. 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.