Example #1
0
 public string[] Directory(string path)
 {
     string[] contents;
     using (XenStoreStringArray xenStoreDirectory = XenStoreFunctions.xs2_directory(this.xenStoreHandle, path))
     {
         contents = xenStoreDirectory.Value;
     }
     return contents;
 }
Example #2
0
 public byte[] Read(string path)
 {
     byte[] read;
     using (XenStoreMemoryHandle mem = XenStoreFunctions.xs2_read(this.xenStoreHandle, path))
     {
         read = mem.Value;
     }
     return read;
 }
Example #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;
 }
Example #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;
        }
Example #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;
 }
Example #6
0
 public bool Remove(string path)
 {
     return XenStoreFunctions.xs2_remove(this.xenStoreHandle, path);
 }
Example #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);
        }
Example #8
0
 public bool Write(string path, byte[] data)
 {
     return(XenStoreFunctions.xs2_write_bin(this.xenStoreHandle, path, data));
 }