Package com.sun.jna.ptr

Examples of com.sun.jna.ptr.PointerByReference


   * @param sid
   *            SID bytes.
   * @return String SID.
   */
  public static String convertSidToStringSid(PSID sid) {
    PointerByReference stringSid = new PointerByReference();
    if (!Advapi32.INSTANCE.ConvertSidToStringSid(sid, stringSid)) {
      throw new Win32Exception(Kernel32.INSTANCE.GetLastError());
    }
    String result = stringSid.getValue().getWideString(0);
    Kernel32.INSTANCE.LocalFree(stringSid.getValue());
    return result;
  }
View Full Code Here


     * Gets the type attr.
     *
     * @return the type attr
     */
    public TYPEATTR getTypeAttr() {
        PointerByReference ppTypeAttr = new PointerByReference();
        HRESULT hr = this.typeInfo.GetTypeAttr(ppTypeAttr);
        COMUtils.checkRC(hr);

        return new TYPEATTR(ppTypeAttr.getValue());
    }
View Full Code Here

     * Gets the type comp.
     *
     * @return the type comp
     */
    public TypeComp getTypeComp() {
        PointerByReference ppTypeAttr = new PointerByReference();
        HRESULT hr = this.typeInfo.GetTypeComp(ppTypeAttr);
        COMUtils.checkRC(hr);

        return new TypeComp(ppTypeAttr.getValue());
    }
View Full Code Here

     * @param index
     *            the index
     * @return the func desc
     */
    public FUNCDESC getFuncDesc(int index) {
        PointerByReference ppFuncDesc = new PointerByReference();
        HRESULT hr = this.typeInfo.GetFuncDesc(new UINT(index), ppFuncDesc);
        COMUtils.checkRC(hr);

        return new FUNCDESC(ppFuncDesc.getValue());
    }
View Full Code Here

     * @param index
     *            the index
     * @return the var desc
     */
    public VARDESC getVarDesc(int index) {
        PointerByReference ppVarDesc = new PointerByReference();
        HRESULT hr = this.typeInfo.GetVarDesc(new UINT(index), ppVarDesc);
        COMUtils.checkRC(hr);

        return new VARDESC(ppVarDesc.getValue());
    }
View Full Code Here

     * @param hreftype
     *            the hreftype
     * @return the ref type info
     */
    public ITypeInfo getRefTypeInfo(HREFTYPE hreftype) {
        PointerByReference ppTInfo = new PointerByReference();
        HRESULT hr = this.typeInfo.GetRefTypeInfo(hreftype, ppTInfo);
        COMUtils.checkRC(hr);

        return new TypeInfo(ppTInfo.getValue());
    }
View Full Code Here

     * @param invKind
     *            the inv kind
     * @return the pointer by reference
     */
    public PointerByReference AddressOfMember(MEMBERID memid, INVOKEKIND invKind) {
        PointerByReference ppv = new PointerByReference();
        HRESULT hr = this.typeInfo.AddressOfMember(memid, invKind, ppv);
        COMUtils.checkRC(hr);

        return ppv;
    }
View Full Code Here

     * @param riid
     *            the riid
     * @return the pointer by reference
     */
    public PointerByReference CreateInstance(IUnknown pUnkOuter, REFIID riid) {
        PointerByReference ppvObj = new PointerByReference();
        HRESULT hr = this.typeInfo.CreateInstance(pUnkOuter, riid, ppvObj);
        COMUtils.checkRC(hr);

        return ppvObj;
    }
View Full Code Here

     *
     * @return the containing type lib
     */
    public ContainingTypeLib GetContainingTypeLib() {

        PointerByReference ppTLib = new PointerByReference();
        UINTByReference pIndex = new UINTByReference();

        HRESULT hr = this.typeInfo.GetContainingTypeLib(ppTLib, pIndex);
        COMUtils.checkRC(hr);

        return new ContainingTypeLib(new TypeLib(ppTLib.getValue()), pIndex
                .getValue().intValue());
    }
View Full Code Here

        assertEquals(0, hr.intValue());

        // get user default lcid
        LCID lcid = Kernel32.INSTANCE.GetUserDefaultLCID();
        // create a IUnknown pointer
        PointerByReference pShellTypeLib = new PointerByReference();
        // load typelib
        hr = OleAuto.INSTANCE.LoadRegTypeLib(clsid, 1, 0, lcid, pShellTypeLib);
        COMUtils.checkRC(hr);
        assertEquals(0, hr.intValue());

        return new TypeLib(pShellTypeLib.getValue());
    }
View Full Code Here

TOP

Related Classes of com.sun.jna.ptr.PointerByReference

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.