Esempio n. 1
0
        internal void CreateInstance(
            MI_OperationFlags flags,
            MI_OperationOptions options,
            string namespaceName,
            MI_Instance inboundInstance,
            MI_OperationCallbacks callbacks,
            out MI_Operation operation
            )
        {
            if (callbacks != null)
            {
                throw new NotImplementedException();
            }

            MI_Operation operationLocal = MI_Operation.NewDirectPtr();

            this.ft.CreateInstance(this,
                                   flags,
                                   options,
                                   namespaceName,
                                   inboundInstance,
                                   null,
                                   operationLocal);

            operation = operationLocal;
        }
Esempio n. 2
0
        internal void Subscribe(
            MI_OperationFlags flags,
            MI_OperationOptions options,
            string namespaceName,
            string queryDialect,
            string queryExpression,
            MI_SubscriptionDeliveryOptions deliverOptions,
            MI_OperationCallbacks callbacks,
            out MI_Operation operation
            )
        {
            if (callbacks != null)
            {
                throw new NotImplementedException();
            }

            MI_Operation operationLocal = MI_Operation.NewDirectPtr();

            this.ft.Subscribe(this,
                              flags,
                              options,
                              namespaceName,
                              queryDialect,
                              queryExpression,
                              deliverOptions,
                              null,
                              operationLocal);

            operation = operationLocal;
        }
Esempio n. 3
0
        internal void EnumerateClasses(
            MI_OperationFlags flags,
            MI_OperationOptions options,
            string namespaceName,
            string className,
            bool classNamesOnly,
            MI_OperationCallbacks callbacks,
            out MI_Operation operation
            )
        {
            if (callbacks != null)
            {
                throw new NotImplementedException();
            }

            MI_Operation operationLocal = MI_Operation.NewDirectPtr();

            this.ft.EnumerateClasses(this,
                                     flags,
                                     options,
                                     namespaceName,
                                     className,
                                     classNamesOnly,
                                     null,
                                     operationLocal);

            operation = operationLocal;
        }
Esempio n. 4
0
        internal void ReferenceInstances(
            MI_OperationFlags flags,
            MI_OperationOptions options,
            string namespaceName,
            MI_Instance instanceKeys,
            string resultClass,
            string role,
            bool keysOnly,
            MI_OperationCallbacks callbacks,
            out MI_Operation operation
            )
        {
            if (callbacks != null)
            {
                throw new NotImplementedException();
            }

            MI_Operation operationLocal = MI_Operation.NewDirectPtr();

            this.ft.ReferenceInstances(this,
                                       flags,
                                       options,
                                       namespaceName,
                                       instanceKeys,
                                       resultClass,
                                       role,
                                       keysOnly,
                                       null,
                                       operationLocal);

            operation = operationLocal;
        }
Esempio n. 5
0
        internal void QueryInstances(
            MI_OperationFlags flags,
            MI_OperationOptions options,
            string namespaceName,
            string queryDialect,
            string queryExpression,
            MI_OperationCallbacks callbacks,
            out MI_Operation operation
            )
        {
            if (callbacks != null)
            {
                throw new NotImplementedException();
            }

            MI_Operation operationLocal = MI_Operation.NewDirectPtr();

            this.ft.QueryInstances(this,
                                   flags,
                                   options,
                                   namespaceName,
                                   queryDialect,
                                   queryExpression,
                                   null,
                                   operationLocal);

            operation = operationLocal;
        }
Esempio n. 6
0
        internal MI_Result Clone(
            out MI_OperationOptions newOperationOptions
            )
        {
            MI_OperationOptions newOperationOptionsLocal =
                MI_OperationOptions.NewIndirectPtr();

            MI_Result resultLocal = this.ft.Clone(this,
                                                  newOperationOptionsLocal);

            newOperationOptions = newOperationOptionsLocal;
            return(resultLocal);
        }
Esempio n. 7
0
        internal MI_Result NewOperationOptions(
            bool customOptionsMustUnderstand,
            out MI_OperationOptions operationOptions
            )
        {
            MI_OperationOptions operationOptionsLocal = MI_OperationOptions.NewDirectPtr();

            MI_Result resultLocal = this.ft.NewOperationOptions(this,
                                                                customOptionsMustUnderstand,
                                                                operationOptionsLocal);

            operationOptions = operationOptionsLocal;
            return(resultLocal);
        }
Esempio n. 8
0
        internal MI_Result DeserializeClassArray(
            MI_SerializerFlags flags,
            MI_OperationOptions options,
            MI_DeserializerCallbacks deserializerCallbacks,
            IntPtr serializedBuffer,
            UInt32 serializedBufferLength,
            MI_Class[] classDefinitions,
            string serverName,
            string namespaceName,
            out UInt32 serializedBufferRead,
            out MI_ExtendedArray classes,
            out MI_Instance cimErrorDetails)
        {
            if (!MI_SerializationFormat.MOF.Equals(this.format, StringComparison.OrdinalIgnoreCase))
            {
                throw new NotImplementedException();
            }

            MI_Class.ArrayPtr classPtrs            = MI_Class.GetPointerArray(classDefinitions);
            MI_Instance       cimErrorDetailsLocal = MI_Instance.NewIndirectPtr();
            MI_ExtendedArray  classesLocal         = MI_ExtendedArray.NewIndirectPtr();
            MI_ExtendedArray  classDetailsArray    = MI_ExtendedArray.NewDirectPtr(classPtrs.Ptrs);

            MI_DeserializerCallbacks.MI_DeserializerCallbacksNative nativeCallbacks = deserializerCallbacks.GetNativeCallbacks(this.format);

            classes = null;

            var resLocal = this.ft.DeserializeClassArray_MOF(
                this,
                flags,
                options,
                nativeCallbacks,
                serializedBuffer,
                serializedBufferLength,
                classDetailsArray,
                serverName,
                namespaceName,
                out serializedBufferRead,
                classesLocal,
                cimErrorDetailsLocal);

            cimErrorDetails = cimErrorDetailsLocal;
            classes         = classesLocal;

            return(resLocal);
        }
Esempio n. 9
0
        internal MI_Result DeserializeClassArray(
            MI_SerializerFlags flags,
            MI_OperationOptions options,
            MI_DeserializerCallbacks deserializerCallbacks,
            byte[] serializedBuffer,
            MI_Class[] classDefinitions,
            string serverName,
            string namespaceName,
            out UInt32 serializedBufferRead,
            out MI_ExtendedArray classes,
            out MI_Instance cimErrorDetails)
        {
            if (!MI_SerializationFormat.MOF.Equals(this.format, StringComparison.OrdinalIgnoreCase))
            {
                throw new NotImplementedException();
            }

            if (serializedBuffer == null || serializedBuffer.Length == 0)
            {
                throw new InvalidOperationException();
            }

            IntPtr clientBuffer = Marshal.AllocHGlobal(serializedBuffer.Length);

            try
            {
                Marshal.Copy(serializedBuffer, 0, clientBuffer, serializedBuffer.Length);
                return(this.DeserializeClassArray(
                           flags,
                           options,
                           deserializerCallbacks,
                           clientBuffer,
                           (uint)serializedBuffer.Length,
                           classDefinitions,
                           serverName,
                           namespaceName,
                           out serializedBufferRead,
                           out classes,
                           out cimErrorDetails));
            }
            finally
            {
                Marshal.FreeHGlobal(clientBuffer);
            }
        }