Beispiel #1
0
        // public class MissingFileResult
        // {
        //  public byte[] data;
        //  public bool writable;
        // }

        /// <summary>
        /// Can be set by the frontend and will be called if the core attempts to open a missing file.
        /// The callee returns a result object, either null to indicate that the file should be reported as missing,
        /// or data and writable status for a file to be just in time mounted.
        /// Do not call anything on the waterbox things during this callback.
        /// Can be called at any time by the core, so you may want to remove your callback entirely after init
        /// if it was for firmware only.
        /// writable == false is equivalent to AddReadonlyFile, writable == true is equivalent to AddTransientFile
        /// </summary>
        // public Func<string, MissingFileResult> MissingFileCallback
        // {
        //  set
        //  {
        //      // TODO
        //      using (this.EnterExit())
        //      {
        //          var mfc_o = value == null ? null : new WaterboxHostNative.MissingFileCallback
        //          {
        //              callback = (_unused, name) =>
        //              {
        //                  var res = value(name);
        //              }
        //          };

        //          NativeImpl.wbx_set_missing_file_callback(_activatedNativeHost, value == null
        //              ? null
        //              : )
        //      }
        //  }
        //  get => _syscalls.MissingFileCallback;
        //  set => _syscalls.MissingFileCallback = value;
        // }

        public void SaveStateBinary(BinaryWriter bw)
        {
            var retobj = new ReturnData();

            NativeImpl.wbx_save_state(_nativeHost, Writer(bw.BaseStream), IntPtr.Zero, retobj);
            retobj.GetDataOrThrow();
        }
Beispiel #2
0
        // public class MissingFileResult
        // {
        //  public byte[] data;
        //  public bool writable;
        // }

        /// <summary>
        /// Can be set by the frontend and will be called if the core attempts to open a missing file.
        /// The callee returns a result object, either null to indicate that the file should be reported as missing,
        /// or data and writable status for a file to be just in time mounted.
        /// Do not call anything on the waterbox things during this callback.
        /// Can be called at any time by the core, so you may want to remove your callback entirely after init
        /// if it was for firmware only.
        /// writable == false is equivalent to AddReadonlyFile, writable == true is equivalent to AddTransientFile
        /// </summary>
        // public Func<string, MissingFileResult> MissingFileCallback
        // {
        //  set
        //  {
        //      // TODO
        //      using (this.EnterExit())
        //      {
        //          var mfc_o = value == null ? null : new WaterboxHostNative.MissingFileCallback
        //          {
        //              callback = (_unused, name) =>
        //              {
        //                  var res = value(name);
        //              }
        //          };

        //          NativeImpl.wbx_set_missing_file_callback(_activatedNativeHost, value == null
        //              ? null
        //              : )
        //      }
        //  }
        //  get => _syscalls.MissingFileCallback;
        //  set => _syscalls.MissingFileCallback = value;
        // }

        public void SaveStateBinary(BinaryWriter bw)
        {
            using (this.EnterExit())
            {
                var retobj = new ReturnData();
                NativeImpl.wbx_save_state(_activatedNativeHost, Writer(bw.BaseStream), IntPtr.Zero, retobj);
                retobj.GetDataOrThrow();
            }
        }