Inheritance: System.Runtime.InteropServices.SafeHandle
Esempio n. 1
0
        public string NextCommand()
        {
            SafeCommandHandle command = null;

            try
            {
                uint   length;
                IntPtr ptr;

                ErrorCode result = NativeMethods.windower_next_command(this.handle, out command);
                if (result == ErrorCode.OutOfRange)
                {
                    return(null);
                }

                WindowerException.Check(result);
                WindowerException.Check(NativeMethods.windower_command_length(command, out length));
                WindowerException.Check(NativeMethods.windower_command_string(command, out ptr));

                byte[] buffer = new byte[length];
                Marshal.Copy(ptr, buffer, 0, (int)length);
                return(UTF8.GetString(buffer));
            }
            finally
            {
                if (command != null)
                {
                    command.Dispose();
                }
            }
        }
Esempio n. 2
0
 internal static extern ErrorCode windower_command_length(SafeCommandHandle handle, out uint result);
Esempio n. 3
0
 internal static extern ErrorCode windower_command_string(SafeCommandHandle handle, out IntPtr result);
Esempio n. 4
0
 internal static extern ErrorCode windower_next_command(SafeInstanceHandle handle, out SafeCommandHandle result);