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

Examples of com.sun.jna.platform.win32.Sspi.CtxtHandle


            VARDESC varDesc = typeInfoUtil.getVarDesc(i);
            VARIANT constValue = varDesc._vardesc.lpvarValue;
            Object value = constValue.getValue();

            // Get the member ID
            MEMBERID memberID = varDesc.memid;

            // Get the name of the property
            TypeInfoDoc typeInfoDoc2 = typeInfoUtil.getDocumentation(memberID);
            this.content += TABTAB + "//" + typeInfoDoc2.getName() + CR;
            this.content += TABTAB + "public static final int "
View Full Code Here


        this.createClassName(this.name);
        this.setFilename(this.name);

        // Get the TypeAttributes
        TypeInfoUtil typeInfoUtil = typeLibUtil.getTypeInfoUtil(index);
        TYPEATTR typeAttr = typeInfoUtil.getTypeAttr();

        this.createJavaDocHeader(typeAttr.guid.toGuidString(), docString);

        int cFuncs = typeAttr.cFuncs.intValue();
        for (int i = 0; i < cFuncs; i++) {
View Full Code Here

        this.createClassName(this.name);
        this.setFilename(this.name);

        // Get the TypeAttributes
        TypeInfoUtil typeInfoUtil = typeLibUtil.getTypeInfoUtil(index);
        TYPEATTR typeAttr = typeInfoUtil.getTypeAttr();

        this.createJavaDocHeader(typeAttr.guid.toGuidString(), docString);

        int cVars = typeAttr.cVars.intValue();
        for (int i = 0; i < cVars; i++) {
View Full Code Here

        this.createJavaDocHeader(typeAttr.guid.toGuidString(), docString);

        int cVars = typeAttr.cVars.intValue();
        for (int i = 0; i < cVars; i++) {
            // Get the property description
            VARDESC varDesc = typeInfoUtil.getVarDesc(i);
            VARIANT constValue = varDesc._vardesc.lpvarValue;
            Object value = constValue.getValue();

            // Get the member ID
            MEMBERID memberID = varDesc.memid;
View Full Code Here

        assertFalse(Native.toString(pszPath).isEmpty());
    }

   
    private void newAppBar() {
        APPBARDATA data = new APPBARDATA.ByReference();
        data.cbSize.setValue(data.size());
        data.uCallbackMessage.setValue(WM_USER + 1);

        UINT_PTR result = Shell32.INSTANCE.SHAppBarMessage(new DWORD(ShellAPI.ABM_NEW), data);
        assertNotNull(result);
    }
View Full Code Here

        UINT_PTR result = Shell32.INSTANCE.SHAppBarMessage(new DWORD(ShellAPI.ABM_NEW), data);
        assertNotNull(result);
    }

    private void removeAppBar() {
        APPBARDATA data = new APPBARDATA.ByReference();
        data.cbSize.setValue(data.size());
        UINT_PTR result = Shell32.INSTANCE.SHAppBarMessage(new DWORD(ShellAPI.ABM_REMOVE), data);
        assertNotNull(result);

    }
View Full Code Here

    public void testResizeDesktopFromBottom() throws InterruptedException {

        newAppBar();

        APPBARDATA data = new APPBARDATA.ByReference();

        data.uEdge.setValue(ShellAPI.ABE_BOTTOM);
        data.rc.top = User32.INSTANCE.GetSystemMetrics(User32.SM_CYFULLSCREEN) - RESIZE_HEIGHT;
        data.rc.left = 0;
        data.rc.bottom = User32.INSTANCE.GetSystemMetrics(User32.SM_CYFULLSCREEN);
View Full Code Here

    public void testResizeDesktopFromTop() throws InterruptedException {
       
        newAppBar();

        APPBARDATA data = new APPBARDATA.ByReference();
        data.uEdge.setValue(ShellAPI.ABE_TOP);
        data.rc.top = 0;
        data.rc.left = 0;
        data.rc.bottom = RESIZE_HEIGHT;
        data.rc.right = User32.INSTANCE.GetSystemMetrics(User32.SM_CXFULLSCREEN);
View Full Code Here

      // acquire a credentials handle
      assertEquals(W32Errors.SEC_E_OK, Secur32.INSTANCE.AcquireCredentialsHandle(
          null, "Negotiate", Sspi.SECPKG_CRED_OUTBOUND, null, null, null,
          null, phCredential, ptsExpiry));
      // initialize security context
      CtxtHandle phNewContext = new CtxtHandle();
      SecBufferDesc pbToken = new SecBufferDesc(Sspi.SECBUFFER_TOKEN, Sspi.MAX_TOKEN_SIZE);
      IntByReference pfContextAttr = new IntByReference();
      int rc = Secur32.INSTANCE.InitializeSecurityContext(phCredential, null,
          Advapi32Util.getUserName(), Sspi.ISC_REQ_CONNECTION, 0,
          Sspi.SECURITY_NATIVE_DREP, null, 0, phNewContext, pbToken,
View Full Code Here

      TimeStamp ptsClientExpiry = new TimeStamp();
      assertEquals(W32Errors.SEC_E_OK, Secur32.INSTANCE.AcquireCredentialsHandle(
          null, "Negotiate", Sspi.SECPKG_CRED_OUTBOUND, null, null, null,
          null, phClientCredential, ptsClientExpiry));
      // client ----------- security context
      CtxtHandle phClientContext = new CtxtHandle();
      IntByReference pfClientContextAttr = new IntByReference();
    // server ----------- acquire inbound credential handle
      CredHandle phServerCredential = new CredHandle();
      TimeStamp ptsServerExpiry = new TimeStamp();
      assertEquals(W32Errors.SEC_E_OK, Secur32.INSTANCE.AcquireCredentialsHandle(
          null, "Negotiate", Sspi.SECPKG_CRED_INBOUND, null, null, null,
          null, phServerCredential, ptsServerExpiry));
      // server ----------- security context
    CtxtHandle phServerContext = new CtxtHandle();
      SecBufferDesc pbServerToken = null;
      IntByReference pfServerContextAttr = new IntByReference();
      int clientRc = W32Errors.SEC_I_CONTINUE_NEEDED;
      int serverRc = W32Errors.SEC_I_CONTINUE_NEEDED;
      do {
          // client ----------- initialize security context, produce a client token
        // client token returned is always new
          SecBufferDesc pbClientToken = new SecBufferDesc(Sspi.SECBUFFER_TOKEN, Sspi.MAX_TOKEN_SIZE);
          if (clientRc == W32Errors.SEC_I_CONTINUE_NEEDED) {
            // server token is empty the first time
            SecBufferDesc pbServerTokenCopy = pbServerToken == null
              ? null : new SecBufferDesc(Sspi.SECBUFFER_TOKEN, pbServerToken.getBytes());
            clientRc = Secur32.INSTANCE.InitializeSecurityContext(
              phClientCredential,
              phClientContext.isNull() ? null : phClientContext,
                Advapi32Util.getUserName(),
                Sspi.ISC_REQ_CONNECTION,
                0,
                Sspi.SECURITY_NATIVE_DREP,
                pbServerTokenCopy,
                0,
                phClientContext,
                pbClientToken,
                pfClientContextAttr,
                null);       
          assertTrue(clientRc == W32Errors.SEC_I_CONTINUE_NEEDED || clientRc == W32Errors.SEC_E_OK);
          }
          // server ----------- accept security context, produce a server token
        if (serverRc == W32Errors.SEC_I_CONTINUE_NEEDED) {
          pbServerToken = new SecBufferDesc(Sspi.SECBUFFER_TOKEN, Sspi.MAX_TOKEN_SIZE);
          SecBufferDesc pbClientTokenByValue = new SecBufferDesc(Sspi.SECBUFFER_TOKEN, pbClientToken.getBytes());
          serverRc = Secur32.INSTANCE.AcceptSecurityContext(phServerCredential,
              phServerContext.isNull() ? null : phServerContext,
              pbClientTokenByValue,
              Sspi.ISC_REQ_CONNECTION,
              Sspi.SECURITY_NATIVE_DREP,
              phServerContext,
              pbServerToken,
View Full Code Here

TOP

Related Classes of com.sun.jna.platform.win32.Sspi.CtxtHandle

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.