Exemplo n.º 1
0
        internal MI_Result NewSession(
            string protocol,
            string destination,
            MI_DestinationOptions options,
            MI_SessionCreationCallbacks callbacks,
            out MI_Instance extendedError,
            out MI_Session session
            )
        {
            if (callbacks != null)
            {
                throw new NotImplementedException();
            }

            MI_Instance extendedErrorLocal = MI_Instance.NewIndirectPtr();
            MI_Session  sessionLocal       = MI_Session.NewDirectPtr();

            MI_Result resultLocal = this.ft.NewSession(this,
                                                       protocol,
                                                       destination,
                                                       options,
                                                       null,
                                                       extendedErrorLocal,
                                                       sessionLocal);

            extendedError = extendedErrorLocal;
            session       = sessionLocal;
            return(resultLocal);
        }
Exemplo n.º 2
0
        internal MI_Result GetIndication(
            out MI_Instance instance,
            out string bookmark,
            out string machineID,
            out bool moreResults,
            out MI_Result result,
            out string errorMessage,
            out MI_Instance completionDetails
            )
        {
            MI_Instance instanceLocal          = MI_Instance.NewIndirectPtr();
            MI_String   bookmarkLocal          = MI_String.NewIndirectPtr();
            MI_String   machineIDLocal         = MI_String.NewIndirectPtr();
            MI_String   errorMessageLocal      = MI_String.NewIndirectPtr();
            MI_Instance completionDetailsLocal = MI_Instance.NewIndirectPtr();

            MI_Result resultLocal = this.ft.GetIndication(this,
                                                          instanceLocal,
                                                          bookmarkLocal,
                                                          machineIDLocal,
                                                          out moreResults,
                                                          out result,
                                                          errorMessageLocal,
                                                          completionDetailsLocal);

            instance          = instanceLocal;
            bookmark          = bookmarkLocal.Value;
            machineID         = machineIDLocal.Value;
            errorMessage      = errorMessageLocal.Value;
            completionDetails = completionDetailsLocal;
            return(resultLocal);
        }
Exemplo n.º 3
0
        internal MI_Result DeserializeClass(
            MI_SerializerFlags flags,
            IntPtr serializedBuffer,
            UInt32 serializedBufferLength,
            MI_Class parentClass,
            string serverName,
            string namespaceName,
            IntPtr classObjectNeeded,
            IntPtr classObjectNeededContext,
            out UInt32 serializedBufferRead,
            out MI_Class classObject,
            out MI_Instance cimErrorDetails
            )
        {
            MI_Class    classObjectLocal     = MI_Class.NewIndirectPtr();
            MI_Instance cimErrorDetailsLocal = MI_Instance.NewIndirectPtr();

            MI_Result resultLocal = this.commonFT.DeserializeClass(this,
                                                                   flags,
                                                                   serializedBuffer,
                                                                   serializedBufferLength,
                                                                   parentClass,
                                                                   serverName,
                                                                   namespaceName,
                                                                   classObjectNeeded,
                                                                   classObjectNeededContext,
                                                                   out serializedBufferRead,
                                                                   classObjectLocal,
                                                                   cimErrorDetailsLocal);

            classObject     = classObjectLocal;
            cimErrorDetails = cimErrorDetailsLocal;
            return(resultLocal);
        }
Exemplo n.º 4
0
        internal static MI_Result Initialize(string applicationId, out MI_Instance extendedError, out MI_Application application)
        {
            MI_Application applicationLocal   = MI_Application.NewDirectPtr();
            MI_Instance    extendedErrorLocal = MI_Instance.NewIndirectPtr();

            MI_Result result = NativeMethods.MI_Application_InitializeV1(0, applicationId, extendedErrorLocal, applicationLocal);

            extendedError = extendedErrorLocal;
            application   = applicationLocal;
            return(result);
        }
Exemplo n.º 5
0
        internal MI_Result Clone(
            out MI_Instance newInstance
            )
        {
            MI_Instance newInstanceLocal = MI_Instance.NewIndirectPtr();

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

            newInstance = newInstanceLocal;
            return(resultLocal);
        }
Exemplo n.º 6
0
        internal MI_Result NewInstanceFromClass(
            string className,
            MI_Class classObject,
            out MI_Instance instance
            )
        {
            MI_Instance instanceLocal = MI_Instance.NewIndirectPtr();

            MI_Result resultLocal = this.ft.NewInstanceFromClass(this,
                                                                 className,
                                                                 classObject,
                                                                 instanceLocal);

            instance = instanceLocal;
            return(resultLocal);
        }
Exemplo n.º 7
0
        internal MI_Result NewInstance(
            string className,
            MI_ClassDecl classRTTI,
            out MI_Instance instance
            )
        {
            MI_Instance instanceLocal = MI_Instance.NewIndirectPtr();

            MI_Result resultLocal = this.ft.NewInstance(this,
                                                        className,
                                                        classRTTI,
                                                        instanceLocal);

            instance = instanceLocal;
            return(resultLocal);
        }
Exemplo 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);
        }
Exemplo n.º 9
0
        internal MI_Result NewHostedProvider(
            string namespaceName,
            string providerName,
            IntPtr mi_Main,
            out MI_Instance extendedError,
            IntPtr provider
            )
        {
            MI_Instance extendedErrorLocal = MI_Instance.NewIndirectPtr();

            MI_Result resultLocal = this.ft.NewHostedProvider(this,
                                                              namespaceName,
                                                              providerName,
                                                              mi_Main,
                                                              extendedErrorLocal,
                                                              provider);

            extendedError = extendedErrorLocal;
            return(resultLocal);
        }
Exemplo n.º 10
0
        internal MI_Result Instance_GetClassName(
            IntPtr serializedBuffer,
            UInt32 serializedBufferLength,
            string className,
            out UInt32 classNameLength,
            out MI_Instance cimErrorDetails
            )
        {
            MI_Instance cimErrorDetailsLocal = MI_Instance.NewIndirectPtr();

            MI_Result resultLocal = this.commonFT.Instance_GetClassName(this,
                                                                        serializedBuffer,
                                                                        serializedBufferLength,
                                                                        className,
                                                                        out classNameLength,
                                                                        cimErrorDetailsLocal);

            cimErrorDetails = cimErrorDetailsLocal;
            return(resultLocal);
        }
Exemplo n.º 11
0
        private MI_Result DeserializeInstance(
            MI_SerializerFlags flags,
            IntPtr serializedBuffer,
            UInt32 serializedBufferLength,
            MI_Class[] classObjects,
            MI_Deserializer_ClassObjectNeededNative classObjectNeeded,
            IntPtr classObjectNeededContext,
            out UInt32 serializedBufferRead,
            out MI_Instance instanceObject,
            out MI_Instance cimErrorDetails
            )
        {
            if (classObjectNeededContext != IntPtr.Zero)
            {
                throw new NotImplementedException();
            }

            MI_Instance instanceObjectLocal  = MI_Instance.NewIndirectPtr();
            MI_Instance cimErrorDetailsLocal = MI_Instance.NewIndirectPtr();

            MI_Class.ArrayPtr classArrayPtr = MI_Class.GetPointerArray(classObjects);

            MI_Result resultLocal = this.commonFT.DeserializeInstance(this,
                                                                      flags,
                                                                      serializedBuffer,
                                                                      serializedBufferLength,
                                                                      classArrayPtr.Ptrs,
                                                                      (uint)classObjects.Length,
                                                                      classObjectNeeded,
                                                                      IntPtr.Zero,
                                                                      out serializedBufferRead,
                                                                      instanceObjectLocal,
                                                                      cimErrorDetailsLocal);

            instanceObject  = instanceObjectLocal;
            cimErrorDetails = cimErrorDetailsLocal;
            return(resultLocal);
        }
Exemplo n.º 12
0
        internal MI_Result GetInstance(
            out MI_Instance instance,
            out bool moreResults,
            out MI_Result result,
            out string errorMessage,
            out MI_Instance completionDetails
            )
        {
            MI_Instance instanceLocal          = MI_Instance.NewIndirectPtr();
            MI_String   errorMessageLocal      = MI_String.NewIndirectPtr();
            MI_Instance completionDetailsLocal = MI_Instance.NewIndirectPtr();

            MI_Result resultLocal = this.ft.GetInstance(this,
                                                        instanceLocal,
                                                        out moreResults,
                                                        out result,
                                                        errorMessageLocal,
                                                        completionDetailsLocal);

            instance          = instanceLocal;
            errorMessage      = errorMessageLocal.Value;
            completionDetails = completionDetailsLocal;
            return(resultLocal);
        }