Ejemplo n.º 1
0
        internal unsafe IntPtr ToNative(PinCollection pinCollection)
        {
            var nativeResult = new NativeTypes.PARTITION_RESTART_RESULT();

            if (this.SelectedPartition != null)
            {
                nativeResult.SelectedPartition = this.SelectedPartition.ToNative(pinCollection);
            }

            nativeResult.ErrorCode = this.ErrorCode;

            return(pinCollection.AddBlittable(nativeResult));
        }
Ejemplo n.º 2
0
 internal unsafe void CreateFromNative(IntPtr pointer)
 {
     NativeTypes.PARTITION_RESTART_RESULT nativeResult = *(NativeTypes.PARTITION_RESTART_RESULT *)pointer;
     this.SelectedPartition = SelectedPartition.CreateFromNative(nativeResult.SelectedPartition);
     this.ErrorCode         = nativeResult.ErrorCode;
     try
     {
         this.Exception = InteropHelpers.TranslateError(this.ErrorCode);
     }
     catch (FabricException)
     {
         // Exception could not be translated.  To the user, it will look like whole FabricClient API itself failed,
         // instead of just the translation above, and they won't be able to determine what happened.  So
         // instead, suppress this.  The user will still have this.ErrorCode.  We will still
         // be able to catch and fix situations that hit this case in test automation because
         // there be a check on this.Exception there.
     }
 }