コード例 #1
0
 internal static cef_write_handler_t* Alloc()
 {
     var ptr = (cef_write_handler_t*)Marshal.AllocHGlobal(_sizeof);
     *ptr = new cef_write_handler_t();
     ptr->_base._size = (UIntPtr)_sizeof;
     return ptr;
 }
コード例 #2
0
        internal static cef_write_handler_t *Alloc()
        {
            var ptr = (cef_write_handler_t *)Marshal.AllocHGlobal(_sizeof);

            *ptr = new cef_write_handler_t();
            ptr->_base._size = (UIntPtr)_sizeof;
            return(ptr);
        }
コード例 #3
0
        private UIntPtr write(cef_write_handler_t* self, void* ptr, UIntPtr size, UIntPtr n)
        {
            CheckSelf(self);

            var length = (long)size * (long)n;
            using (var stream = new UnmanagedMemoryStream((byte*)ptr, length, length, FileAccess.Write))
            {
                return (UIntPtr)Write(stream, length);
            }
        }
コード例 #4
0
 private int release(cef_write_handler_t* self)
 {
     lock (SyncRoot)
     {
         var result = --_refct;
         if (result == 0)
         {
             lock (_roots) { _roots.Remove((IntPtr)_self); }
         }
         return result;
     }
 }
コード例 #5
0
 private int add_ref(cef_write_handler_t* self)
 {
     lock (SyncRoot)
     {
         var result = ++_refct;
         if (result == 1)
         {
             lock (_roots) { _roots.Add((IntPtr)_self, this); }
         }
         return result;
     }
 }
コード例 #6
0
 internal static void Free(cef_write_handler_t* ptr)
 {
     Marshal.FreeHGlobal((IntPtr)ptr);
 }
コード例 #7
0
        private int flush(cef_write_handler_t* self)
        {
            CheckSelf(self);

            return Flush() ? 0 : -1;
        }
コード例 #8
0
        private long tell(cef_write_handler_t* self)
        {
            CheckSelf(self);

            return Tell();
        }
コード例 #9
0
        private int seek(cef_write_handler_t* self, long offset, int whence)
        {
            CheckSelf(self);

            return Seek(offset, (SeekOrigin)whence) ? 0 : -1;
        }
コード例 #10
0
 private int get_refct(cef_write_handler_t* self)
 {
     return _refct;
 }
コード例 #11
0
 private void CheckSelf(cef_write_handler_t* self)
 {
     if (_self != self) throw ExceptionBuilder.InvalidSelfReference();
 }
コード例 #12
0
 public static extern cef_stream_writer_t* create_for_handler(cef_write_handler_t* handler);