예제 #1
0
        internal MI_Instance DeserializeInstanceHandle(byte[] serializedData, ref uint offset, IEnumerable <CimClass> cimClasses)
        {
            if (serializedData == null)
            {
                throw new ArgumentNullException("serializedData");
            }
            if (offset >= serializedData.Length)
            {
                throw new ArgumentOutOfRangeException("offset");
            }
            this.AssertNotDisposed();

            MI_Class[] nativeClassHandles = null;
            if (cimClasses != null)
            {
                nativeClassHandles = cimClasses.Select(cimClass => cimClass.ClassHandle).ToArray();
            }

            // TODO: Implement this next function

            /*
             *  UInt32 inputBufferUsed;
             *  MI_Instance deserializedInstance;
             *  MI_Instance cimError;
             *  MI_Result result = this._myHandle.DeserializeInstance(
             *      0,
             *      serializedData,
             *      offset,
             *      nativeClassHandles,
             *      out deserializedInstance,
             *      out inputBufferUsed,
             *      out cimError);
             *  CimException.ThrowIfMiResultFailure(result, cimError);
             *  offset += inputBufferUsed;
             *
             *  return deserializedInstance;
             */

            // TODO: remove this next line once above is fixed
            return(MI_Instance.NewIndirectPtr());
        }
예제 #2
0
 public void IndirectInstanceTableAccessesThrowWhenNotInitialized()
 {
     Assert.Throws <InvalidOperationException>(() => MI_Instance.NewIndirectPtr().Delete());
 }