Esempio n. 1
0
 public string[] Directory(string path)
 {
     string[] contents;
     using (XenStoreStringArray xenStoreDirectory = XenStoreFunctions.xs2_directory(this.xenStoreHandle, path))
     {
         contents = xenStoreDirectory.Value;
     }
     return contents;
 }
Esempio n. 2
0
 public byte[] Read(string path)
 {
     byte[] read;
     using (XenStoreMemoryHandle mem = XenStoreFunctions.xs2_read(this.xenStoreHandle, path))
     {
         read = mem.Value;
     }
     return read;
 }
Esempio n. 3
0
 protected override bool ReleaseHandle()
 {
     bool released = false;
     if (!this.IsInvalid)
     {
         System.IntPtr release = this.handle;
         this.handle = System.IntPtr.Zero;
         XenStoreFunctions.xs2_free(release);
         released = true;
     }
     return released;
 }
Esempio n. 4
0
        protected override bool ReleaseHandle()
        {
            // Seems like when disposing, IsClosed is true, even though we're in the middle of releasing...
            bool released = this.IsInvalid;
            if (!released) // If valid handle
            {
                System.IntPtr release = this.handle;
                this.handle = System.IntPtr.Zero;
                XenStoreFunctions.xs2_free(release);
                released = true;

            } // Ends if valid handle

            return released;
        }
Esempio n. 5
0
 public Microsoft.Win32.SafeHandles.SafeHandleMinusOneIsInvalid Watch(string path, Microsoft.Win32.SafeHandles.SafeWaitHandle event_)
 {
     XenStoreWatchHandle watch = XenStoreFunctions.xs2_watch(this.xenStoreHandle, path, event_);
     return watch;
 }
Esempio n. 6
0
 public bool Remove(string path)
 {
     return XenStoreFunctions.xs2_remove(this.xenStoreHandle, path);
 }
Esempio n. 7
0
        // Binary write path has been depricated
//        public bool Write(string path, byte[] data)
//        {
//            return XenStoreFunctions.xs2_write_bin(this.xenStoreHandle, path, data);
//        }

        public bool Write(string path, string data)
        {
            return XenStoreFunctions.xs2_write(this.xenStoreHandle, path, data);
        }
Esempio n. 8
0
 public bool Write(string path, byte[] data)
 {
     return(XenStoreFunctions.xs2_write_bin(this.xenStoreHandle, path, data));
 }