Пример #1
0
        /// <summary>
        /// Output messages are stored in GsMessage buffer. Normally
        /// not used here
        /// /// </summary>
        /// <param name="handle">Instance handle</param>
        /// <param name="pointer">Pointer to the message</param>
        /// <param name="count">Total length of the string</param>
        /// <returns>Total length of the string</returns>
        protected int OnStdIoOutput(IntPtr handle, IntPtr pointer, int count)
        {
            lock (GsMessage)
            {
                string output = Marshal.PtrToStringAnsi(pointer, count);
                GsMessage += output;
            }
            _stdOut?.Invoke(handle, pointer, count);

            return(count);
        }
Пример #2
0
        /// <summary>
        /// Error messages are stored in GsErrMessage buffer. Normally
        /// not used here
        /// </summary>
        /// <param name="handle">Instance handle</param>
        /// <param name="pointer">Pointer to the message</param>
        /// <param name="count">Total length of the string</param>
        /// <returns>Total length of the string</returns>
        protected int OnStdIoError(IntPtr handle, IntPtr pointer, int count)
        {
            lock (GsErrMessage)
            {
                string message = Marshal.PtrToStringAnsi(pointer);
                GsErrMessage += message;
            }

            _stdErr?.Invoke(handle, pointer, count);

            return(count);
        }
Пример #3
0
 /// <summary>
 /// Not implemented.
 /// </summary>
 /// <param name="input"></param>
 /// <param name="count"></param>
 protected int OnStdIoInput(IntPtr handle, IntPtr pointer, int count)
 {
     _stdIn?.Invoke(handle, pointer, count);
     return(count);
 }