Beispiel #1
0
        internal static int WritePropertyValue(int vFunc, IntPtr pWbemClassObject, int lHandle, int lNumBytes, string str)
        {
            UnixWbemClassObject obj = UnixWbemClassObject.ToManaged(pWbemClassObject);

            /** TODO: How to do this !!! */
            return(0);
        }
Beispiel #2
0
        internal static int Delete(int vFunc, IntPtr pWbemClassObject, string wszName)
        {
            UnixWbemClassObject obj = UnixWbemClassObject.ToManaged(pWbemClassObject);

            obj.Delete_(wszName);
            return(0);
        }
Beispiel #3
0
        internal static int CompareTo(int vFunc, IntPtr pWbemClassObject, int lFlags, IntPtr pCompareTo)
        {
            UnixWbemClassObject obj  = UnixWbemClassObject.ToManaged(pWbemClassObject);
            UnixWbemClassObject obj2 = UnixWbemClassObject.ToManaged(pCompareTo);

            return(obj.CompareTo_(lFlags, obj2));
        }
Beispiel #4
0
        internal static int PutMethod(int vFunc, IntPtr pWbemClassObject, string wszName, int lFlags, IntPtr pInSignature, IntPtr pOutSignature)
        {
            UnixWbemClassObject obj     = UnixWbemClassObject.ToManaged(pWbemClassObject);
            UnixWbemClassObject inSign  = UnixWbemClassObject.ToManaged(pInSignature);
            UnixWbemClassObject outSign = UnixWbemClassObject.ToManaged(pOutSignature);

            return(obj.PutMethod_(wszName, lFlags, inSign, outSign));
        }
Beispiel #5
0
        internal static int Clone(int vFunc, IntPtr pWbemClassObject, out IntPtr ppCopy)
        {
            UnixWbemClassObject           obj    = UnixWbemClassObject.ToManaged(pWbemClassObject);
            IWbemClassObject_DoNotMarshal result = null;
            int ret = obj.Clone_(out result);

            ppCopy = UnixWbemClassObject.ToPointer(result);
            return(ret);
        }
Beispiel #6
0
        internal static int GetPropertyQualifierSet(int vFunc, IntPtr pWbemClassObject, string wszProperty, out IntPtr ppQualSet)
        {
            UnixWbemClassObject            obj    = UnixWbemClassObject.ToManaged(pWbemClassObject);
            IWbemQualifierSet_DoNotMarshal result = null;

            obj.GetPropertyQualifierSet_(wszProperty, out result);
            ppQualSet = UnixWbemObjectQualifierSet.ToPointer(result);
            return(0);
        }
Beispiel #7
0
        internal static int GetQualifierSet(int vFunc, IntPtr pWbemClassObject, out IntPtr ppQualSet)
        {
            UnixWbemClassObject            obj           = UnixWbemClassObject.ToManaged(pWbemClassObject);
            IWbemQualifierSet_DoNotMarshal qualifiersObj = null;
            int ret = obj.GetQualifierSet_(out qualifiersObj);

            ppQualSet = UnixWbemObjectQualifierSet.ToPointer(qualifiersObj);
            return(ret);
        }
Beispiel #8
0
        internal static int GetMethod(int vFunc, IntPtr pWbemClassObject, string wszName, int lFlags, out IntPtr ppInSignature, out IntPtr ppOutSignature)
        {
            UnixWbemClassObject           obj     = UnixWbemClassObject.ToManaged(pWbemClassObject);
            IWbemClassObject_DoNotMarshal inSign  = null;
            IWbemClassObject_DoNotMarshal outSign = null;
            int ret = obj.GetMethod_(wszName, lFlags, out inSign, out outSign);

            ppInSignature  = UnixWbemClassObject.ToPointer(inSign);
            ppOutSignature = UnixWbemClassObject.ToPointer(outSign);
            return(ret);
        }
        public virtual int ExecuteMethod_(string wszMethodName, object ppInSignature, out object ppOutSignature)
        {
            var inSign = ppInSignature as UnixWbemClassObject;
            UnixWbemClassObject outSign = null;
            var outHandler = _handler.InvokeMethod(wszMethodName, inSign._handler);

            if (outHandler != null)
            {
                outSign = new UnixWbemClassObject(outHandler);
            }
            ppOutSignature = outSign;
            return(0);
        }
        /// <summary>
        /// Creates the signature.
        /// </summary>
        /// <param name='info'>
        /// Info.
        /// </param>
        /// <param name='ppInSignature'>
        /// Pp in signature.
        /// </param>
        /// <param name='ppOutSignature'>
        /// Pp out signature.
        /// </param>
        public static void CreateSignature(UnixCimMethodInfo info, out IWbemClassObject_DoNotMarshal ppInSignature, out IWbemClassObject_DoNotMarshal ppOutSignature)
        {
            Type inType  = null;
            Type outType = null;

            if (string.IsNullOrEmpty(info.InSignatureType))
            {
                inType = typeof(UNIX_MethodParameterClass);
            }
            else
            {
                inType = Type.GetType(info.InSignatureType, false, true);
            }

            if (string.IsNullOrEmpty(info.OutSignatureType))
            {
                outType = typeof(UNIX_MethodParameterClass);
            }
            else
            {
                outType = Type.GetType(info.OutSignatureType, false, true);
            }

            var inClass  = (UNIX_MethodParameterClass)WMIDatabaseFactory.GetHandler(inType).Get((object)null);
            var outClass = (UNIX_MethodParameterClass)WMIDatabaseFactory.GetHandler(outType).Get((object)null);

            if (info.InProperties != null)
            {
                foreach (var property in info.InProperties)
                {
                    inClass.RegisterProperty(property);
                }
            }

            outClass.RegisterProperty(new UnixWbemPropertyInfo {
                Name = "ReturnValue", Type = CimType.UInt32, Flavor = 0
            });

            if (info.OutProperties != null)
            {
                foreach (var property in info.OutProperties)
                {
                    outClass.RegisterProperty(property);
                }
            }

            ppInSignature  = new UnixWbemClassObject(inClass);
            ppOutSignature = new UnixWbemClassObject(outClass);
        }
Beispiel #11
0
        internal static int Get(int vFunc, IntPtr pWbemClassObject, string wszName, int lFlags, out object pVal, out int pType, out int plFlavor)
        {
            UnixWbemClassObject target = UnixWbemClassObject.ToManaged(pWbemClassObject);

            pVal     = null;
            pType    = (int)CimType.Object;
            plFlavor = 0;
            int ret = 0;

            if (target != null)
            {
                ret = target.Get_(wszName, lFlags, out pVal, out pType, out plFlavor);
            }
            return(ret);
        }
Beispiel #12
0
        internal static int NextMethod(int vFunc, IntPtr pWbemClassObject, int lFlags, out string pstrName, out IntPtr ppInSignature, out IntPtr ppOutSignature)
        {
            UnixWbemClassObject           obj     = UnixWbemClassObject.ToManaged(pWbemClassObject);
            IWbemClassObject_DoNotMarshal inSign  = null;
            IWbemClassObject_DoNotMarshal outSign = null;
            int ret = obj.NextMethod_(lFlags, out pstrName, out inSign, out outSign);

            if (ret >= 0 && inSign != null && outSign != null)
            {
                ppInSignature  = UnixWbemClassObject.ToPointer(inSign);
                ppOutSignature = UnixWbemClassObject.ToPointer(outSign);
            }
            else
            {
                ppInSignature  = IntPtr.Zero;
                ppOutSignature = IntPtr.Zero;
            }
            return(ret);
        }
Beispiel #13
0
		/// <summary>
		/// Creates the signature.
		/// </summary>
		/// <param name='info'>
		/// Info.
		/// </param>
		/// <param name='ppInSignature'>
		/// Pp in signature.
		/// </param>
		/// <param name='ppOutSignature'>
		/// Pp out signature.
		/// </param>
		public static void CreateSignature (UnixCimMethodInfo info, out IWbemClassObject_DoNotMarshal ppInSignature, out IWbemClassObject_DoNotMarshal ppOutSignature)
		{
			Type inType = null;
			Type outType = null; 
			if (string.IsNullOrEmpty (info.InSignatureType)) {
				inType = typeof(UNIX_MethodParameterClass);
			} else {
				inType = Type.GetType (info.InSignatureType, false, true);
			}

			if (string.IsNullOrEmpty (info.OutSignatureType)) {
				outType = typeof(UNIX_MethodParameterClass);
			} else {
				outType = Type.GetType (info.OutSignatureType, false, true);
			}

			var inClass = (UNIX_MethodParameterClass)WMIDatabaseFactory.GetHandler (inType).Get ((object)null);
			var outClass = (UNIX_MethodParameterClass)WMIDatabaseFactory.GetHandler (outType).Get ((object)null);
			
			if (info.InProperties != null) {
				foreach (var property in info.InProperties) {
					inClass.RegisterProperty (property);
				}
			}

			outClass.RegisterProperty (new UnixWbemPropertyInfo { Name = "ReturnValue", Type = CimType.UInt32, Flavor = 0  });

			if (info.OutProperties != null) 
			{
				foreach (var property in info.OutProperties) {
					outClass.RegisterProperty (property);
				}
			}

			ppInSignature = new UnixWbemClassObject(inClass);
			ppOutSignature = new UnixWbemClassObject(outClass);
		}
Beispiel #14
0
        internal static int BeginEnumeration(int vFunc, IntPtr pWbemClassObject, int lEnumFlags)
        {
            UnixWbemClassObject obj = UnixWbemClassObject.ToManaged(pWbemClassObject);

            return(obj.BeginEnumeration_(lEnumFlags));
        }
Beispiel #15
0
		public virtual int ExecuteMethod_ (string wszMethodName, object ppInSignature, out object ppOutSignature)
		{
			var inSign = ppInSignature as UnixWbemClassObject;
			UnixWbemClassObject outSign = null;
			var outHandler = _handler.InvokeMethod (wszMethodName, inSign._handler);
			if (outHandler != null) {
				outSign = new UnixWbemClassObject (outHandler);
			}
			ppOutSignature = outSign;
			return 0;
		}
Beispiel #16
0
        internal static int GetNames(int vFunc, IntPtr pWbemClassObject, string wszQualifierName, int lFlags, ref object pQualifierVal, out string[] pNames)
        {
            UnixWbemClassObject obj = UnixWbemClassObject.ToManaged(pWbemClassObject);

            return(obj.GetNames_(wszQualifierName, lFlags, ref pQualifierVal, out pNames));
        }
Beispiel #17
0
        internal static int Put(int vFunc, IntPtr pWbemClassObject, string wszName, int lFlags, ref object pVal, int Type)
        {
            UnixWbemClassObject obj = UnixWbemClassObject.ToManaged(pWbemClassObject);

            return(obj.Put_(wszName, lFlags, ref pVal, Type));
        }
Beispiel #18
0
        internal static int Next(int vFunc, IntPtr pWbemClassObject, int lFlags, out string strName, out object pVal, out int pType, out int plFlavor)
        {
            UnixWbemClassObject obj = UnixWbemClassObject.ToManaged(pWbemClassObject);

            return(obj.Next_(lFlags, out strName, out pVal, out pType, out plFlavor));
        }
Beispiel #19
0
        internal static int GetObjectText(int vFunc, IntPtr pWbemClassObject, int lFlags, out string pstrObjectText)
        {
            UnixWbemClassObject obj = UnixWbemClassObject.ToManaged(pWbemClassObject);

            return(obj.GetObjectText_(lFlags, out pstrObjectText));
        }
Beispiel #20
0
        internal static int GetPropertyOrigin(int vFunc, IntPtr pWbemClassObject, string wszName, out string pstrClassName)
        {
            UnixWbemClassObject obj = UnixWbemClassObject.ToManaged(pWbemClassObject);

            return(obj.GetPropertyOrigin_(wszName, out pstrClassName));
        }
Beispiel #21
0
        internal static int EndEnumeration(int vFunc, IntPtr pWbemClassObject)
        {
            UnixWbemClassObject obj = UnixWbemClassObject.ToManaged(pWbemClassObject);

            return(obj.EndEnumeration_());
        }
Beispiel #22
0
        internal static int InheritsFrom(int vFunc, IntPtr pWbemClassObject, string strAncestor)
        {
            UnixWbemClassObject obj = UnixWbemClassObject.ToManaged(pWbemClassObject);

            return(obj.InheritsFrom_(strAncestor));
        }