wbemLocator.callMethodA( "ConnectServer", new Object[] { new JIString( host ), new JIString( WMI_DEFAULT_NAMESPACE ), JIVariant.OPTIONAL_PARAM(), JIVariant.OPTIONAL_PARAM(), JIVariant.OPTIONAL_PARAM(), JIVariant.OPTIONAL_PARAM(), new Integer( 0 ), JIVariant.OPTIONAL_PARAM() } ); wbemServices.callMethodA( "ExecNotificationQuery", new Object[] { new JIString( QUERY_FOR_ALL_LOG_EVENTS ), new JIString( "WQL" ), new JIVariant( new Integer( RETURN_IMMEDIATE + FORWARD_ONLY ) ) } ); IJIDispatch wbemEventSource = (IJIDispatch) JIObjectFactory.narrowObject( ( eventSourceSet[ 0 ] ).getObjectAsComObject() );
public void Execute(JIString str) { System.out.println(str.getString()); } /**
public int getLengthInBytes(Object value,int FLAG) { int length = 4; if (((JIString)value).getString() == null) { return length; } //for LPWSTR and BSTR adding 2 for the null character. length = length + (((JIString)value).getType() == JIFlags.FLAG_REPRESENTATION_STRING_LPCTSTR ? 0 : 2); //Pointer referentId --> USER return length + JIMarshalUnMarshalHelper.getLengthInBytes(String.class,((JIString)value).getString(),((JIString)value).getType() | FLAG); }
public String getErrorString ( final int errorCode, final int localeID ) throws JIException { JICallBuilder callObject = new JICallBuilder ( true ); callObject.setOpnum ( 3 ); callObject.addInParamAsInt ( errorCode, JIFlags.FLAG_NULL ); callObject.addInParamAsInt ( localeID, JIFlags.FLAG_NULL ); callObject.addOutParamAsObject ( new JIPointer ( new JIString ( JIFlags.FLAG_REPRESENTATION_STRING_LPWSTR ) ), JIFlags.FLAG_NULL ); Object[] result = getCOMObject ().call ( callObject ); return ( (JIString) ( (JIPointer)result[0] ).getReferent () ).getString (); }
public Object[] findName(JIString nameBuf,int hashValue,short found) throws JIException { JICallBuilder callObject = new JICallBuilder(true); callObject.setOpnum(8); callObject.addInParamAsString((nameBuf).getString(),nameBuf.getType()); callObject.addInParamAsInt(hashValue,JIFlags.FLAG_NULL); callObject.addInParamAsShort(found,JIFlags.FLAG_NULL); callObject.addOutParamAsObject(new JIArray(IJIComObject.class,null,1,true,true),JIFlags.FLAG_NULL); callObject.addOutParamAsObject(new JIArray(Integer.class,null,1,true,true),JIFlags.FLAG_NULL); callObject.addOutParamAsType(Short.class,JIFlags.FLAG_NULL); callObject.addOutParamAsObject(new JIString(JIFlags.FLAG_REPRESENTATION_STRING_BSTR),JIFlags.FLAG_NULL); return comObject.call(callObject); } }
if (member.getClass().equals(JIString.class)) ((JIString)member).setDeffered(true);
if (obj instanceof JIString && ((JIString)obj).getType() != JIFlags.FLAG_REPRESENTATION_STRING_BSTR)
JIString retVal = ((JIString)obj).decode(ndr,defferedPointers,FLAG,additionalData); return retVal;
((JIString)value).encode(ndr,defferedPointers,FLAG); return;
/** * Get the complete item id from an item at the local position. * * Browsing a hierarchical namespace the browse method will return items based on the * local level in the namespace. So actually only the last part of the item ID hierarchy * is returned. In order to convert this to the full item ID one can use this method. It * will only work if the browser is still at the position in question. * * @param item the local item * @return the complete item ID * @throws JIException */ public String getItemID ( final String item ) throws JIException { JICallBuilder callObject = new JICallBuilder ( true ); callObject.setOpnum ( 3 ); callObject.addInParamAsString ( item, JIFlags.FLAG_REPRESENTATION_STRING_LPWSTR ); callObject.addOutParamAsObject ( new JIPointer ( new JIString ( JIFlags.FLAG_REPRESENTATION_STRING_LPWSTR ) ), JIFlags.FLAG_NULL ); Object[] result = getCOMObject ().call ( callObject ); return ( (JIString) ( (JIPointer)result[0] ).getReferent () ).getString (); } }
public Object[] findName(JIString nameBuf,int hashValue,short found) throws JIException { JICallBuilder callObject = new JICallBuilder(true); callObject.setOpnum(8); callObject.addInParamAsString((nameBuf).getString(),nameBuf.getType()); callObject.addInParamAsInt(hashValue,JIFlags.FLAG_NULL); callObject.addInParamAsShort(found,JIFlags.FLAG_NULL); callObject.addOutParamAsObject(new JIArray(IJIComObject.class,null,1,true,true),JIFlags.FLAG_NULL); callObject.addOutParamAsObject(new JIArray(Integer.class,null,1,true,true),JIFlags.FLAG_NULL); callObject.addOutParamAsType(Short.class,JIFlags.FLAG_NULL); callObject.addOutParamAsObject(new JIString(JIFlags.FLAG_REPRESENTATION_STRING_BSTR),JIFlags.FLAG_NULL); return comObject.call(callObject); } }
/** Adds a member to this Union. The <code>member</code> is distinguished using the <code>discriminant</code>. <br> * * @param discriminant * @param member * @throws JIException * @throws IllegalArgumentException if any parameter is <code>null</code> */ public void addMember(Object discriminant, Object member) throws JIException { if (discriminant == null || member == null) { throw new IllegalArgumentException(JISystem.getLocalizedMessage(JIErrorCodes.JI_UNION_NULL_DISCRMINANT)); } if (!discriminant.getClass().equals(discriminantClass)) { throw new JIException(JIErrorCodes.JI_UNION_DISCRMINANT_MISMATCH); } if (member.getClass().equals(JIPointer.class) && !((JIPointer)member).isReference()) { ((JIPointer)member).setDeffered(true); } else if (member.getClass().equals(JIString.class)) { ((JIString)member).setDeffered(true); } dsVsMember.put(discriminant,member); }
if ( this.obj instanceof JIString && ( (JIString)this.obj ).getType () != JIFlags.FLAG_REPRESENTATION_STRING_BSTR )
JIString retVal = ((JIString)obj).decode(ndr,defferedPointers,FLAG,additionalData); return retVal;
((JIString)value).encode(ndr,defferedPointers,FLAG); return;
/**Setting up a <code>VARIANT</code> with a <code>String</code>. Used via serializing the <code>VARIANT</code>. Internally a * <code>JIString</code> is formed with it's default type <code>BSTR</code>. * * @param value */ public JIVariant(String value) { this(new JIString(value)); }
public void Execute(JIString str) { System.out.println(str.getString()); } /**
public int next ( final List<String> list, final int num ) throws JIException { if ( num <= 0 ) { return 0; } JICallBuilder callObject = new JICallBuilder ( true ); callObject.setOpnum ( 0 ); callObject.addInParamAsInt ( num, JIFlags.FLAG_NULL ); //callObject.addInParamAsInt ( num, JIFlags.FLAG_NULL ); //callObject.addOutParamAsObject ( new JIArray ( new JIPointer ( new JIString ( // JIFlags.FLAG_REPRESENTATION_STRING_LPWSTR ) ), null, 1, true, true ), JIFlags.FLAG_NULL ); callObject.addOutParamAsObject ( new JIArray ( new JIString ( JIFlags.FLAG_REPRESENTATION_STRING_LPWSTR ), null, 1, true, true ), JIFlags.FLAG_NULL ); callObject.addOutParamAsType ( Integer.class, JIFlags.FLAG_NULL ); Object[] result = Helper.callRespectSFALSE ( getCOMObject (), callObject ); //JIPointer[] resultData = (JIPointer[]) ( (JIArray) ( result[0] ) ).getArrayInstance (); JIString[] resultData = (JIString[]) ( (JIArray)result[0] ).getArrayInstance (); Integer cnt = (Integer)result[1]; for ( int i = 0; i < cnt; i++ ) { //list.add ( ( (JIString)resultData[i].getReferent () ).getString () ); list.add ( resultData[i].getString () ); } return cnt; }