commit d278629910422efd2ed8540a55d913b022c7c3ab
Author: Arnaud <arnaud.champion@devatom.fr>
Date:   Wed Oct 6 15:47:23 2010 +0200

    Signed-off-by: Arnaud <arnaud.champion@devatom.fr>

diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..96a9b41
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,11 @@
+
+_ReSharper*
+*.obj
+*.pdb
+Thumbs.db
+*.dll
+obj/
+[Bb]in/
+[Dd]ebug
+*.suo
+[Rr]elease/
\ No newline at end of file
diff --git a/Libvirt.cs b/Libvirt.cs
new file mode 100644
index 0000000..287a953
--- /dev/null
+++ b/Libvirt.cs
@@ -0,0 +1,2149 @@
+﻿/*
+ * Copyright (C)
+ *   Arnaud Champion <arnaud.champion@devatom.fr>
+ *   Jaromír Červenka <cervajz@cervajz.com>
+ *
+ * See COPYING.LIB for the License of this software
+ */
+
+using System;
+using System.Runtime.InteropServices;
+
+namespace LibvirtBindings
+{
+    /// <summary>
+    /// Libvirt Binding class
+    /// </summary>
+    public class libVirt
+    {
+        private const int MaxStringLength = 1024;
+
+        #region Connect
+        /// <summary>
+        /// This function closes the connection to the Hypervisor. This should not be called if further interaction with the Hypervisor are needed especially if there is running domain which need further monitoring by the application.
+        /// </summary>
+        /// <param name="conn">pointer to the hypervisor connection</param>
+        /// <returns>0 in case of success or -1 in case of error.</returns>
+        [DllImport("libvirt-0.dll")]
+        public static extern int virConnectClose(IntPtr conn);
+        /// <summary>
+        /// Provides capabilities of the hypervisor / driver.
+        /// </summary>
+        /// <param name="conn">pointer to the hypervisor connection</param>
+        /// <returns>NULL in case of error, or an XML string defining the capabilities. The client must free the returned string after use.</returns>
+        [DllImport("libvirt-0.dll")]
+        [return: MarshalAs(UnmanagedType.AnsiBStr)]
+        public static extern string virConnectGetCapabilities(IntPtr conn);
+        /// <summary>
+        /// This returns the system hostname on which the hypervisor is running (the result of the gethostname system call). If we are connected to a remote system, then this returns the hostname of the remote system.
+        /// </summary>
+        /// <param name="conn">pointer to a hypervisor connection</param>
+        /// <returns>the hostname which must be freed by the caller, or NULL if there was an error.</returns>
+        [DllImport("libvirt-0.dll")]
+        [return: MarshalAs(UnmanagedType.AnsiBStr)]
+        public static extern string virConnectGetHostname(IntPtr conn);
+        /// <summary>
+        /// Provides @libVer, which is the version of libvirt used by the daemon running on the @conn host
+        /// </summary>
+        /// <param name="conn">pointer to the hypervisor connection</param>
+        /// <param name="libVer">returns the libvirt library version used on the connection (OUT)</param>
+        /// <returns>-1 in case of failure, 0 otherwise, and values for @libVer have the format major * 1,000,000 + minor * 1,000 + release.</returns>
+        [DllImport("libvirt-0.dll")]
+        public static extern int virConnectGetLibVersion(IntPtr conn, ref ulong libVer);
+        /// <summary>
+        /// Provides the maximum number of virtual CPUs supported for a guest VM of a specific type. The 'type' parameter here corresponds to the 'type' attribute in the domain element of the XML.
+        /// </summary>
+        /// <param name="conn">pointer to the hypervisor connection</param>
+        /// <param name="type">value of the 'type' attribute in the domain element</param>
+        /// <returns>the maximum of virtual CPU or -1 in case of error.</returns>
+        [DllImport("libvirt-0.dll")]
+        public static extern int virConnectGetMaxVcpus(IntPtr conn, string type);
+        /// <summary>
+        /// Get the name of the Hypervisor software used.
+        /// </summary>
+        /// <param name="conn">pointer to the hypervisor connection</param>
+        /// <returns>NULL in case of error, a static zero terminated string otherwise. See also: http://www.redhat.com/archives/libvir-list/2007-February/msg00096.html</returns>
+        [DllImport("libvirt-0.dll")]
+        [return: MarshalAs(UnmanagedType.AnsiBStr)]
+        public static extern string virConnectGetType(IntPtr conn);
+        /// <summary>
+        /// This returns the Uri (name) of the hypervisor connection. Normally this is the same as or similar to the string passed to the virConnectOpen/virConnectOpenReadOnly call, but the driver may make the Uri canonical. If name == NULL was passed to virConnectOpen, then the driver will return a non-NULL Uri which can be used to connect to the same hypervisor later.
+        /// </summary>
+        /// <param name="conn">pointer to a hypervisor connection</param>
+        /// <returns>the Uri string which must be freed by the caller, or NULL if there was an error.</returns>
+        [DllImport("libvirt-0.dll")]
+        [return: MarshalAs(UnmanagedType.AnsiBStr)]
+        public static extern string virConnectGetURI(IntPtr conn);
+        /// <summary>
+        /// Get the version level of the Hypervisor running. This may work only with hypervisor call, i.e. with privileged access to the hypervisor, not with a Read-Only connection.
+        /// </summary>
+        /// <param name="conn">pointer to the hypervisor connection</param>
+        /// <param name="hvVer">return value for the version of the running hypervisor (OUT)</param>
+        /// <returns>-1 in case of error, 0 otherwise. if the version can't be extracted by lack of capacities returns 0 and @hvVer is 0, otherwise @hvVer value is major * 1,000,000 + minor * 1,000 + release</returns>
+        [DllImport("libvirt-0.dll")]
+        public static extern int virConnectGetVersion(IntPtr conn, ref ulong hvVer);
+        /// <summary>
+        /// Determine if the connection to the hypervisor is encrypted
+        /// </summary>
+        /// <param name="conn">pointer to the connection object</param>
+        /// <returns>1 if encrypted, 0 if not encrypted, -1 on error</returns>
+        [DllImport("libvirt-0.dll")]
+        public static extern int virConnectIsEncrypted(IntPtr conn);
+        /// <summary>
+        /// Determine if the connection to the hypervisor is secure A connection will be classed as secure if it is either encrypted, or running over a channel which is not exposed to eavesdropping (eg a UNIX domain socket, or pipe)
+        /// </summary>
+        /// <param name="conn">pointer to the connection object</param>
+        /// <returns>1 if secure, 0 if secure, -1 on error</returns>
+        [DllImport("libvirt-0.dll")]
+        public static extern int virConnectIsSecure(IntPtr conn);
+        /// <summary>
+        /// list the defined but inactive domains, stores the pointers to the names in @names
+        /// </summary>
+        /// <param name="conn">pointer to the hypervisor connection</param>
+        /// <param name="names">pointer to an array to store the names</param>
+        /// <param name="maxnames">size of the array</param>
+        /// <returns>the number of names provided in the array or -1 in case of error</returns>
+        [DllImport("libvirt-0.dll")]
+        private static extern int virConnectListDefinedDomains(IntPtr conn, IntPtr names, int maxnames);
+        /// <summary>
+        /// list the defined but inactive domains, stores the pointers to the names in @names
+        /// </summary>
+        /// <param name="conn">pointer to the hypervisor connection</param>
+        /// <param name="names">pointer to an array to store the names</param>
+        /// <param name="maxnames">size of the array</param>
+        /// <returns>the number of names provided in the array or -1 in case of error</returns>
+        public static int virConnectListDefinedDomains(IntPtr conn, ref string[] names, int maxnames)
+        {
+            IntPtr namesPtr = Marshal.AllocHGlobal(MaxStringLength);
+            int count = virConnectListDefinedDomains(conn, namesPtr, maxnames);
+            if (count > 0)
+                names = ptrToStringArray(namesPtr, count);
+            Marshal.FreeHGlobal(namesPtr);
+            return count;
+        }
+        /// <summary>
+        /// Collect the list of defined (inactive) physical host interfaces, and store their names in @names.
+        /// </summary>
+        /// <param name="conn">pointer to the hypervisor connection</param>
+        /// <param name="names">array to collect the list of names of interfaces</param>
+        /// <param name="maxnames">size of @names</param>
+        /// <returns>the number of interfaces found or -1 in case of error </returns>
+        [DllImport("libvirt-0.dll")]
+        private static extern int virConnectListDefinedInterfaces(IntPtr conn, IntPtr names, int maxnames);
+        ///<summary>
+        /// Collect the list of defined (inactive) physical host interfaces, and store their names in @names.
+        ///</summary>
+        ///<param name="conn">pointer to the hypervisor connection</param>
+        ///<param name="names">array to collect the list of names of interfaces</param>
+        ///<param name="maxnames">size of @names</param>
+        ///<returns>the number of interfaces found or -1 in case of error </returns>
+        public static int virConnectListDefinedInterfaces(IntPtr conn, ref string[] names, int maxnames)
+        {
+            IntPtr namesPtr = Marshal.AllocHGlobal(MaxStringLength);
+            int count = virConnectListDefinedInterfaces(conn, namesPtr, maxnames);
+            if (count > 0)
+                names = ptrToStringArray(namesPtr, count);
+            Marshal.FreeHGlobal(namesPtr);
+            return count;
+        }
+        /// <summary>
+        /// list the inactive networks, stores the pointers to the names in @names
+        /// </summary>
+        /// <param name="conn">pointer to the hypervisor connection</param>
+        /// <param name="names">pointer to an array to store the names</param>
+        /// <param name="maxnames">size of the array</param>
+        /// <returns>the number of names provided in the array or -1 in case of error</returns>
+        [DllImport("libvirt-0.dll")]
+        private static extern int virConnectListDefinedNetworks(IntPtr conn, IntPtr names, int maxnames);
+        /// <summary>
+        /// list the inactive networks, stores the pointers to the names in @names
+        /// </summary>
+        /// <param name="conn">pointer to the hypervisor connection</param>
+        /// <param name="names">pointer to an array to store the names</param>
+        /// <param name="maxnames">size of the array</param>
+        /// <returns>the number of names provided in the array or -1 in case of error</returns>
+        public static int virConnectListDefinedNetworks(IntPtr conn, ref string[] names, int maxnames)
+        {
+            IntPtr namesPtr = Marshal.AllocHGlobal(MaxStringLength);
+            int count = virConnectListDefinedNetworks(conn, namesPtr, maxnames);
+            if (count > 0)
+                names = ptrToStringArray(namesPtr, count);
+            Marshal.FreeHGlobal(namesPtr);
+            return count;
+        }
+        /// <summary>
+        /// Provides the list of names of inactive storage pools upto maxnames. If there are more than maxnames, the remaining names will be silently ignored.
+        /// </summary>
+        /// <param name="conn">pointer to hypervisor connection</param>
+        /// <param name="names">array of char * to fill with pool names (allocated by caller)</param>
+        /// <param name="maxnames">size of the names array</param>
+        /// <returns>0 on success, -1 on error</returns>
+        [DllImport("libvirt-0.dll")]
+        private static extern int virConnectListDefinedStoragePools(IntPtr conn, IntPtr names, int maxnames);
+        /// <summary>
+        /// Provides the list of names of inactive storage pools upto maxnames. If there are more than maxnames, the remaining names will be silently ignored.
+        /// </summary>
+        /// <param name="conn">pointer to hypervisor connection</param>
+        /// <param name="names">array of char * to fill with pool names (allocated by caller)</param>
+        /// <param name="maxnames">size of the names array</param>
+        /// <returns>0 on success, -1 on error</returns>
+        public static int virConnectListDefinedStoragePools(IntPtr conn, ref string[] names, int maxnames)
+        {
+            IntPtr namesPtr = Marshal.AllocHGlobal(MaxStringLength);
+            int count = virConnectListDefinedStoragePools(conn, namesPtr, maxnames);
+            if (count > 0)
+                names = ptrToStringArray(namesPtr, count);
+            Marshal.FreeHGlobal(namesPtr);
+            return count;
+        }
+        /// <summary>
+        /// Collect the list of active domains, and store their ID in @maxids
+        /// </summary>
+        /// <param name="conn">pointer to the hypervisor connection</param>
+        /// <param name="ids">array to collect the list of IDs of active domains</param>
+        /// <param name="maxids">size of @ids</param>
+        /// <returns>the number of domain found or -1 in case of error</returns>
+        [DllImport("libvirt-0.dll")]
+        public static extern int virConnectListDomains(IntPtr conn, int[] ids, int maxids);
+        /// <summary>
+        /// Collect the list of active physical host interfaces, and store their names in @names
+        /// </summary>
+        /// <param name="conn">pointer to the hypervisor connection</param>
+        /// <param name="names">array to collect the list of names of interfaces</param>
+        /// <param name="maxnames">size of @names</param>
+        /// <returns>the number of interfaces found or -1 in case of error</returns>
+        [DllImport("libvirt-0.dll")]
+        private static extern int virConnectListInterfaces(IntPtr conn, IntPtr names, int maxnames);
+        /// <summary>
+        /// Collect the list of active physical host interfaces, and store their names in @names
+        /// </summary>
+        /// <param name="conn">pointer to the hypervisor connection</param>
+        /// <param name="names">array to collect the list of names of interfaces</param>
+        /// <param name="maxnames">size of @names</param>
+        /// <returns>the number of interfaces found or -1 in case of error</returns>
+        public static int virConnectListInterfaces(IntPtr conn, ref string[] names, int maxnames)
+        {
+            IntPtr namesPtr = Marshal.AllocHGlobal(MaxStringLength);
+            int count = virConnectListInterfaces(conn, namesPtr, maxnames);
+            if (count > 0)
+                names = ptrToStringArray(namesPtr, count);
+            Marshal.FreeHGlobal(namesPtr);
+            return count;
+        }
+        /// <summary>
+        /// Collect the list of active networks, and store their names in @names
+        /// </summary>
+        /// <param name="conn">pointer to the hypervisor connection</param>
+        /// <param name="names">array to collect the list of names of active networks</param>
+        /// <param name="maxnames">size of @names</param>
+        /// <returns>the number of networks found or -1 in case of error</returns>
+        [DllImport("libvirt-0.dll")]
+        private static extern int virConnectListNetworks(IntPtr conn, IntPtr names, int maxnames);
+        /// <summary>
+        /// Collect the list of active networks, and store their names in @names
+        /// </summary>
+        /// <param name="conn">pointer to the hypervisor connection</param>
+        /// <param name="names">array to collect the list of names of active networks</param>
+        /// <param name="maxnames">size of @names</param>
+        /// <returns>the number of networks found or -1 in case of error</returns>
+        public static int virConnectListNetworks(IntPtr conn, ref string[] names, int maxnames)
+        {
+            IntPtr namesPtr = Marshal.AllocHGlobal(MaxStringLength);
+            int count = virConnectListNetworks(conn, namesPtr, maxnames);
+            if (count > 0)
+                names = ptrToStringArray(namesPtr, count);
+            Marshal.FreeHGlobal(namesPtr);
+            return count;
+        }
+        /// <summary>
+        /// List UUIDs of defined secrets, store pointers to names in uuids.
+        /// </summary>
+        /// <param name="conn">virConnect connection</param>
+        /// <param name="uuids">Pointer to an array to store the UUIDs</param>
+        /// <param name="maxuuids">size of the array.</param>
+        /// <returns>the number of UUIDs provided in the array, or -1 on failure.</returns>
+        [DllImport("libvirt-0.dll")]
+        private static extern int virConnectListSecrets(IntPtr conn, IntPtr uuids, int maxuuids);
+        /// <summary>
+        /// List UUIDs of defined secrets, store pointers to names in uuids.
+        /// </summary>
+        /// <param name="conn">virConnect connection</param>
+        /// <param name="uuids">Pointer to an array to store the UUIDs</param>
+        /// <param name="maxuuids">size of the array.</param>
+        /// <returns>the number of UUIDs provided in the array, or -1 on failure.</returns>
+        public static int virConnectListSecrets(IntPtr conn, ref string[] uuids, int maxuuids)
+        {
+            IntPtr namesPtr = Marshal.AllocHGlobal(MaxStringLength);
+            int count = virConnectListSecrets(conn, namesPtr, maxuuids);
+            if (count > 0)
+                uuids = ptrToStringArray(namesPtr, count);
+            Marshal.FreeHGlobal(namesPtr);
+            return count;
+        }
+        /// <summary>
+        /// Provides the list of names of active storage pools upto maxnames. If there are more than maxnames, the remaining names will be silently ignored.
+        /// </summary>
+        /// <param name="conn">pointer to hypervisor connection</param>
+        /// <param name="names">array of char * to fill with pool names (allocated by caller)</param>
+        /// <param name="maxnames">size of the names array</param>
+        /// <returns>0 on success, -1 on error</returns>
+        [DllImport("libvirt-0.dll")]
+        private static extern int virConnectListStoragePools(IntPtr conn, IntPtr names, int maxnames);
+        /// <summary>
+        /// Provides the list of names of active storage pools upto maxnames. If there are more than maxnames, the remaining names will be silently ignored.
+        /// </summary>
+        /// <param name="conn">pointer to hypervisor connection</param>
+        /// <param name="names">array of char * to fill with pool names (allocated by caller)</param>
+        /// <param name="maxnames">size of the names array</param>
+        /// <returns>0 on success, -1 on error</returns>
+        public static int virConnectListStoragePools(IntPtr conn, ref string[] names, int maxnames)
+        {
+            IntPtr namesPtr = Marshal.AllocHGlobal(MaxStringLength);
+            int count = virConnectListStoragePools(conn, namesPtr, maxnames);
+            if (count > 0)
+                names = ptrToStringArray(namesPtr, count);
+            Marshal.FreeHGlobal(namesPtr);
+            return count;
+        }
+        /// <summary>
+        /// Provides the number of defined but inactive domains.
+        /// </summary>
+        /// <param name="conn">pointer to the hypervisor connection</param>
+        /// <returns>the number of domain found or -1 in case of error</returns>
+        [DllImport("libvirt-0.dll")]
+        public static extern int virConnectNumOfDefinedDomains(IntPtr conn);
+        /// <summary>
+        /// Provides the number of defined (inactive) interfaces on the physical host.
+        /// </summary>
+        /// <param name="conn">pointer to the hypervisor connection</param>
+        /// <returns>the number of defined interface found or -1 in case of error</returns>
+        [DllImport("libvirt-0.dll")]
+        public static extern int virConnectNumOfDefinedInterfaces(IntPtr conn);
+        /// <summary>
+        /// Provides the number of inactive networks.
+        /// </summary>
+        /// <param name="conn">pointer to the hypervisor connection</param>
+        /// <returns>the number of networks found or -1 in case of error</returns>
+        [DllImport("libvirt-0.dll")]
+        public static extern int virConnectNumOfDefinedNetworks(IntPtr conn);
+        /// <summary>
+        /// Provides the number of inactive storage pools
+        /// </summary>
+        /// <param name="conn">pointer to hypervisor connection</param>
+        /// <returns>the number of pools found, or -1 on error</returns>
+        [DllImport("libvirt-0.dll")]
+        public static extern int virConnectNumOfDefinedStoragePools(IntPtr conn);
+        /// <summary>
+        /// Provides the number of active domains.
+        /// </summary>
+        /// <param name="conn">pointer to the hypervisor connection</param>
+        /// <returns>the number of domain found or -1 in case of error</returns>
+        [DllImport("libvirt-0.dll")]
+        public static extern int virConnectNumOfDomains(IntPtr conn);
+        /// <summary>
+        /// Provides the number of active interfaces on the physical host.
+        /// </summary>
+        /// <param name="conn">pointer to the hypervisor connection</param>
+        /// <returns>the number of active interfaces found or -1 in case of error</returns>
+        [DllImport("libvirt-0.dll")]
+        public static extern int virConnectNumOfInterfaces(IntPtr conn);
+        /// <summary>
+        /// Provides the number of active networks.
+        /// </summary>
+        /// <param name="conn">pointer to the hypervisor connection</param>
+        /// <returns>the number of network found or -1 in case of error</returns>
+        [DllImport("libvirt-0.dll")]
+        public static extern int virConnectNumOfNetworks(IntPtr conn);
+        /// <summary>
+        /// Fetch number of currently defined secrets.
+        /// </summary>
+        /// <param name="conn">virConnect connection</param>
+        /// <returns>the number currently defined secrets.</returns>
+        [DllImport("libvirt-0.dll")]
+        public static extern int virConnectNumOfSecrets(IntPtr conn);
+        /// <summary>
+        /// Provides the number of active storage pools
+        /// </summary>
+        /// <param name="conn">pointer to hypervisor connection</param>
+        /// <returns>the number of pools found, or -1 on error</returns>
+        [DllImport("libvirt-0.dll")]
+        public static extern int virConnectNumOfStoragePools(IntPtr conn);
+        /// <summary>
+        /// This function should be called first to get a connection to the Hypervisor and xen store
+        /// </summary>
+        /// <param name="name">Uri of the hypervisor</param>
+        /// <returns>pointer to the connection</returns>
+        [DllImport("libvirt-0.dll")]
+        public static extern IntPtr virConnectOpen(string name);
+
+        ///<summary>
+        /// This function should be called first to get a connection to the Hypervisor. If necessary, authentication will be performed fetching credentials via the callback See virConnectOpen for notes about environment variables which can have an effect on opening drivers
+        ///</summary>
+        ///<param name="name">URI of the hypervisor</param>
+        ///<param name="auth">Authenticate callback parameters</param>
+        ///<param name="flags">Open flags</param>
+        ///<returns>a pointer to the hypervisor connection or NULL in case of error URIs are documented at http://libvirt.org/uri.html </returns>
+        [DllImport("libvirt-0.dll")]
+        public static extern IntPtr virConnectOpenAuth(string name, [In] ref virConnectAuth auth, int flags);
+
+        /// <summary>
+        /// This function should be called first to get a restricted connection to the library functionalities. The set of APIs usable are then restricted on the available methods to control the domains. See virConnectOpen for notes about environment variables which can have an effect on opening drivers
+        /// </summary>
+        /// <param name="name">Uri of the hypervisor</param>
+        /// <returns>a pointer to the hypervisor connection or NULL in case of error URIs are documented at http://libvirt.org/uri.html </returns>
+        [DllImport("libvirt-0.dll")]
+        public static extern IntPtr virConnectOpenReadOnly(string name);
+        /// <summary>
+        /// Increment the reference count on the connection. For each additional call to this method, there shall be a corresponding call to virConnectClose to release the reference count, once the caller no longer needs the reference to this object. This method is typically useful for applications where multiple threads are using a connection, and it is required that the connection remain open until all threads have finished using it. ie, each new thread using a connection would increment the reference count.
+        /// </summary>
+        /// <param name="conn">the connection to hold a reference on</param>
+        /// <returns>0 in case of success, -1 in case of failure</returns>
+        [DllImport("libvirt-0.dll")]
+        public static extern int virConnectRef(IntPtr conn);
+        #endregion
+
+        #region Domain
+        /// <summary>
+        /// Create a virtual device attachment to backend. This function, having hotplug semantics, is only allowed on an active domain.
+        /// </summary>
+        /// <param name="domain">pointer to domain object</param>
+        /// <param name="xml">pointer to XML description of one device</param>
+        /// <returns>0 in case of success, -1 in case of failure.</returns>
+        [DllImport("libvirt-0.dll")]
+        public static extern int virDomainAttachDevice(IntPtr domain, string xml);
+        /// <summary>
+        /// Attach a virtual device to a domain, using the flags parameter to control how the device is attached. VIR_DOMAIN_DEVICE_MODIFY_CURRENT specifies that the device allocation is made based on current domain state. VIR_DOMAIN_DEVICE_MODIFY_LIVE specifies that the device shall be allocated to the active domain instance only and is not added to the persisted domain configuration. VIR_DOMAIN_DEVICE_MODIFY_CONFIG specifies that the device shall be allocated to the persisted domain configuration only. Note that the target hypervisor must return an error if unable to satisfy flags. E.g. the hypervisor driver will return failure if LIVE is specified but it only supports modifying the persisted device allocation.
+        /// </summary>
+        /// <param name="domain">pointer to domain object</param>
+        /// <param name="xml">pointer to XML description of one device</param>
+        /// <param name="flags">an OR'ed set of virDomainDeviceModifyFlags</param>
+        /// <returns>0 in case of success, -1 in case of failure.</returns>
+        [DllImport("libvirt-0.dll")]
+        public static extern int virDomainAttachDeviceFlags(IntPtr domain, string xml, uint flags);
+
+        // TODO virDomainBlockPeek
+
+        /// <summary>
+        /// This function returns block device (disk) stats for block devices attached to the domain. The path parameter is the name of the block device. Get this by calling virDomainGetXMLDesc and finding the target dev='...' attribute within //domain/devices/disk. (For example, "xvda"). Domains may have more than one block device. To get stats for each you should make multiple calls to this function. Individual fields within the stats structure may be returned as -1, which indicates that the hypervisor does not support that particular statistic.
+        /// </summary>
+        /// <param name="dom">pointer to the domain object</param>
+        /// <param name="path">path to the block device</param>
+        /// <param name="stats">block device stats (returned)</param>
+        /// <param name="size">size of stats structure</param>
+        /// <returns>0 in case of success or -1 in case of failure.</returns>
+        [DllImport("libvirt-0.dll")]
+        public static extern int virDomainBlockStats(IntPtr dom, string path, virDomainBlockStatsStruct stats, int size);
+        /// <summary>
+        /// This method will dump the core of a domain on a given file for analysis. Note that for remote Xen Daemon the file path will be interpreted in the remote host.
+        /// </summary>
+        /// <param name="domain">a domain object</param>
+        /// <param name="to">path for the core file</param>
+        /// <param name="flags">extra flags, currently unused</param>
+        /// <returns>0 in case of success and -1 in case of failure.</returns>
+        [DllImport("libvirt-0.dll")]
+        public static extern int virDomainCoreDump(IntPtr domain, string to, int flags);
+        /// <summary>
+        /// Launch a defined domain. If the call succeed the domain moves from the defined to the running domains pools.
+        /// </summary>
+        /// <param name="domain">
+        /// A <see cref="IntPtr"/> pointer to a defined domain.
+        /// </param>
+        /// <returns>
+        /// 0 in case of success, -1 in case of error.
+        /// </returns>
+        [DllImport("libvirt-0.dll")]
+        public static extern int virDomainCreate(IntPtr domain);
+        /// <summary>
+        /// Launch a new guest domain, based on an XML description similar to the one returned by virDomainGetXMLDesc().
+        /// This function may requires privileged access to the hypervisor. The domain is not persistent, 
+        /// so its definition will disappear when it is destroyed, or if the host is restarted (see virDomainDefineXML() to define persistent domains).
+        /// </summary>
+        /// <param name="conn">
+        /// A <see cref="IntPtr"/> pointer to the hypervisor connection.
+        /// </param>
+        /// <param name="xmlDesc">
+        /// A string containing an XML description of the domain.
+        /// </param>
+        /// <param name="flags">
+        /// Callers should always pass 0.
+        /// </param>
+        /// <returns>
+        /// A new domain object or NULL in case of failure.
+        /// </returns>
+        [DllImport("libvirt-0.dll")]
+        public static extern IntPtr virDomainCreateXML(IntPtr conn, string xmlDesc, uint flags);
+        /// <summary>
+        /// Define a domain, but does not start it. This definition is persistent, until explicitly undefined with virDomainUndefine(). 
+        /// A previous definition for this domain would be overriden if it already exists.
+        /// </summary>
+        /// <param name="conn">
+        /// A <see cref="IntPtr"/>pointer to the hypervisor connection.
+        /// </param>
+        /// <param name="xml">
+        /// The XML description for the domain, preferably in UTF-8.
+        /// </param>
+        /// <returns>
+        /// NULL in case of error, a pointer to the domain otherwise.
+        /// </returns>
+        [DllImport("libvirt-0.dll")]
+        public static extern IntPtr virDomainDefineXML(IntPtr conn, string xml);
+        /// <summary>
+        /// Destroy the domain object. The running instance is shutdown if not down already 
+        /// and all resources used by it are given back to the hypervisor. 
+        /// This does not free the associated virDomainPtr object. This function may require privileged access
+        /// </summary>
+        /// <param name="domain">
+        /// A <see cref="IntPtr"/>domain object.
+        /// </param>
+        /// <returns>
+        /// 0 in case of success and -1 in case of failure.
+        /// </returns>
+        [DllImport("libvirt-0.dll")]
+        public static extern int virDomainDestroy(IntPtr domain);
+        /// <summary>
+        /// Destroy a virtual device attachment to backend.
+        /// </summary>
+        /// <param name="domain">
+        /// A <see cref="IntPtr"/>pointer to domain object.
+        /// </param>
+        /// <param name="xml">
+        /// Pointer to XML description of one device.
+        /// </param>
+        /// <returns>
+        /// 0 in case of success, -1 in case of failure.
+        /// </returns>
+        [DllImport("libvirt-0.dll")]
+        public static extern int virDomainDetachDevice(IntPtr domain, string xml);
+        /// <summary>
+        /// Detach a virtual device from a domain, using the flags parameter to control how the device is detached. VIR_DOMAIN_DEVICE_MODIFY_CURRENT specifies that the device allocation is removed based on current domain state. VIR_DOMAIN_DEVICE_MODIFY_LIVE specifies that the device shall be deallocated from the active domain instance only and is not from the persisted domain configuration. VIR_DOMAIN_DEVICE_MODIFY_CONFIG specifies that the device shall be deallocated from the persisted domain configuration only. Note that the target hypervisor must return an error if unable to satisfy flags. E.g. the hypervisor driver will return failure if LIVE is specified but it only supports removing the persisted device allocation.
+        /// </summary>
+        /// <param name="domain">pointer to domain object</param>
+        /// <param name="xml">pointer to XML description of one device</param>
+        /// <param name="flags">an OR'ed set of virDomainDeviceModifyFlags</param>
+        /// <returns>0 in case of success, -1 in case of failure.</returns>
+        [DllImport("libvirt-0.dll")]
+        public static extern int virDomainDetachDeviceFlags(IntPtr domain, string xml, uint flags);
+        /// <summary>
+        /// Free the domain object. The running instance is kept alive. The data structure is freed and should not be used thereafter.
+        /// </summary>
+        /// <param name="domain">
+        /// A <see cref="IntPtr"/>domain object.
+        /// </param>
+        /// <returns>
+        /// 0 in case of success and -1 in case of failure.
+        /// </returns>
+        [DllImport("libvirt-0.dll")]
+        public static extern int virDomainFree(IntPtr domain);
+        /// <summary>
+        /// Provides a boolean value indicating whether the domain configured to be automatically started when the host machine boots.
+        /// </summary>
+        /// <param name="domain">
+        /// A <see cref="IntPtr"/>domain object.
+        /// </param>
+        /// <param name="autostart">
+        /// The value returned.
+        /// </param>
+        /// <returns>
+        /// -1 in case of error, 0 in case of success.
+        /// </returns>
+        [DllImport("libvirt-0.dll")]
+        public static extern int virDomainGetAutostart(IntPtr domain, out int autostart);
+        /// <summary>
+        /// Provides the connection pointer associated with a domain. 
+        /// The reference counter on the connection is not increased by this call. 
+        /// WARNING: When writing libvirt bindings in other languages, do not use this function. 
+        /// Instead, store the connection and the domain object together.
+        /// </summary>
+        /// <param name="dom">
+        /// A <see cref="IntPtr"/>pointer to a domain.
+        /// </param>
+        /// <returns>
+        /// The <see cref="IntPtr"/>or NULL in case of failure.
+        /// </returns>
+        [DllImport("libvirt-0.dll")]
+        public static extern IntPtr virDomainGetConnect(IntPtr dom);
+        /// <summary>
+        /// Get the hypervisor ID number for the domain.
+        /// </summary>
+        /// <param name="domain">
+        /// A <see cref="IntPtr"/>domain object.
+        /// </param>
+        /// <returns>
+        /// The domain ID number or (unsigned int) -1 in case of error.
+        /// </returns>
+        [DllImport("libvirt-0.dll")]
+        public static extern int virDomainGetID(IntPtr domain);
+        /// <summary>
+        /// Extract information about a domain. Note that if the connection used to get the domain is limited only a 
+        /// partial set of the information can be extracted.
+        /// </summary>
+        /// <param name="domain">
+        /// A <see cref="IntPtr"/>domain object.
+        /// </param>
+        /// <param name="info">
+        /// Pointer to a virDomainInfo structure allocated by the user.
+        /// </param>
+        /// <returns>
+        /// 0 in case of success and -1 in case of failure.
+        /// </returns>
+        [DllImport("libvirt-0.dll")]
+        public static extern int virDomainGetInfo(IntPtr domain, [Out] virDomainInfo info);
+        /// <summary>
+        /// Retrieve the maximum amount of physical memory allocated to a domain. 
+        /// If domain is NULL, then this get the amount of memory reserved to Domain0 i.e. the domain where the application runs.
+        /// </summary>
+        /// <param name="domain">
+        /// A <see cref="IntPtr"/>domain object or NULL.
+        /// </param>
+        /// <returns>
+        /// the memory size in kilobytes or 0 in case of error.
+        /// </returns>
+        [DllImport("libvirt-0.dll")]
+        public static extern ulong virDomainGetMaxMemory(IntPtr domain);
+        /// <summary>
+        /// Provides the maximum number of virtual CPUs supported for the guest VM. 
+        /// If the guest is inactive, this is basically the same as virConnectGetMaxVcpus. 
+        /// If the guest is running this will reflect the maximum number of virtual CPUs the guest was booted with.
+        /// </summary>
+        /// <param name="domain">
+        /// A <see cref="IntPtr"/>pointer to domain object.
+        /// </param>
+        /// <returns>
+        /// The maximum of virtual CPU or -1 in case of error.
+        /// </returns>
+        [DllImport("libvirt-0.dll")]
+        public static extern int virDomainGetMaxVcpus(IntPtr domain);
+        /// <summary>
+        /// Get the public name for that domain.
+        /// </summary>
+        /// <param name="domain">
+        /// A <see cref="IntPtr"/>domain object.
+        /// </param>
+        /// <returns>
+        /// Pointer to the name or NULL, the string need not be deallocated its lifetime will be the same as the domain object.
+        /// </returns>
+        [DllImport("libvirt-0.dll")]
+        [return: MarshalAs(UnmanagedType.AnsiBStr)]
+        public static extern string virDomainGetName(IntPtr domain);
+        /// <summary>
+        /// Get the type of domain operation system.
+        /// </summary>
+        /// <param name="domain">
+        /// A <see cref="IntPtr"/>domain object.
+        /// </param>
+        /// <returns>
+        /// The new string or NULL in case of error, the string must be freed by the caller.
+        /// </returns>
+        [DllImport("libvirt-0.dll")]
+        [return: MarshalAs(UnmanagedType.AnsiBStr)]
+        public static extern string virDomainGetOSType(IntPtr domain);
+
+        // TODO virDomainGetSchedulerParameters
+
+        // TODO virDomainGetSchedulerType
+
+        // TODO virDomainGetSecurityLabel
+
+        /// <summary>
+        /// Get the UUID for a domain.
+        /// </summary>
+        /// <param name="domain">
+        /// A <see cref="IntPtr"/>a domain object.
+        /// </param>
+        /// <param name="uuid">
+        /// A <see cref="System.Char"/>pointer to a VIR_UUID_BUFLEN bytes array.
+        /// </param>
+        /// <returns>
+        /// A <see cref="System.Int32"/>-1 in case of error, 0 in case of success.
+        /// </returns>
+        [DllImport("libvirt-0.dll")]
+        public static extern int virDomainGetUUID(IntPtr domain, [Out] char[] uuid);
+        /// <summary>
+        /// Get the UUID for a domain as string. For more information about UUID see RFC4122.
+        /// </summary>
+        /// <param name="domain">
+        /// A <see cref="IntPtr"/>domain object.
+        /// </param>
+        /// <param name="buf">
+        /// Pointer to a VIR_UUID_STRING_BUFLEN bytes array.
+        /// </param>
+        /// <returns>
+        /// -1 in case of error, 0 in case of success.
+        /// </returns>
+        [DllImport("libvirt-0.dll")]
+        public static extern int virDomainGetUUIDString(IntPtr domain, [Out] IntPtr buf);
+
+        // TODO virDomainGetVcpus
+
+        /// <summary>
+        /// Provide an XML description of the domain. The description may be reused later to relaunch the domain with virDomainCreateXML().
+        /// </summary>
+        /// <param name="domain">
+        /// A <see cref="IntPtr"/>a domain object.
+        /// </param>
+        /// <param name="flags">
+        /// An OR'ed set of virDomainXMLFlags.
+        /// </param>
+        /// <returns>
+        /// A 0 terminated UTF-8 encoded XML instance, or NULL in case of error. the caller must free() the returned value.
+        /// </returns>
+        [DllImport("libvirt-0.dll")]
+        [return: MarshalAs(UnmanagedType.AnsiBStr)]
+        public static extern string virDomainGetXMLDesc(IntPtr domain, int flags);
+        /// <summary>
+        /// This function returns network interface stats for interfaces attached to the domain. 
+        /// The path parameter is the name of the network interface. Domains may have more than one network interface. 
+        /// To get stats for each you should make multiple calls to this function. 
+        /// Individual fields within the stats structure may be returned as -1, 
+        /// which indicates that the hypervisor does not support that particular statistic.
+        /// </summary>
+        /// <param name="dom">
+        /// A <see cref="IntPtr"/>pointer to the domain object.
+        /// </param>
+        /// <param name="path">
+        /// Path to the interface.
+        /// </param>
+        /// <param name="stats">
+        /// A <see cref="virDomainInterfaceStatsStruct"/>network interface stats (returned).
+        /// </param>
+        /// <param name="size">
+        /// Size of stats structure.
+        /// </param>
+        /// <returns>
+        /// 0 in case of success or -1 in case of failure.
+        /// </returns>
+        [DllImport("libvirt-0.dll")]
+        public static extern int virDomainInterfaceStats(IntPtr dom, string path, virDomainInterfaceStatsStruct stats, int size);
+        /// <summary>
+        /// Determine if the domain is currently running.
+        /// </summary>
+        /// <param name="dom">
+        /// A <see cref="IntPtr"/>pointer to the domain object.
+        /// </param>
+        /// <returns>
+        /// 1 if running, 0 if inactive, -1 on error.
+        /// </returns>
+        [DllImport("libvirt-0.dll")]
+        public static extern int virDomainIsActive(IntPtr dom);
+
+        /// <summary>
+        /// Determine if the domain has a persistent configuration which means it will still exist after shutting down.
+        /// </summary>
+        /// <param name="dom">
+        /// A <see cref="IntPtr"/>pointer to the domain object.
+        /// </param>
+        /// <returns>
+        /// 1 if persistent, 0 if transient, -1 on error.
+        /// </returns>
+        [DllImport("libvirt-0.dll")]
+        public static extern int virDomainIsPersistent(IntPtr dom);
+
+        /// <summary>
+        /// Try to find a domain based on the hypervisor ID number.
+        /// Note that this won't work for inactive domains which have an ID of -1, 
+        /// in that case a lookup based on the Name or UUId need to be done instead.
+        /// </summary>
+        /// <param name="conn">
+        /// A <see cref="IntPtr"/>pointer to the hypervisor connection.
+        /// </param>
+        /// <param name="id">
+        /// The domain ID number.
+        /// </param>
+        /// <returns>
+        /// A new domain object or NULL in case of failure. If the domain cannot be found, then VIR_ERR_NO_DOMAIN error is raised.
+        /// </returns>
+        [DllImport("libvirt-0.dll")]
+        public static extern IntPtr virDomainLookupByID(IntPtr conn, int id);
+
+        /// <summary>
+        /// Try to lookup a domain on the given hypervisor based on its name.
+        /// </summary>
+        /// <param name="conn">
+        /// A <see cref="IntPtr"/>pointer to the hypervisor connection.
+        /// </param>
+        /// <param name="name">
+        /// A <see cref="System.String"/>name for the domain.
+        /// </param>
+        /// <returns>
+        /// A new domain object or NULL in case of failure. If the domain cannot be found, then VIR_ERR_NO_DOMAIN error is raised.
+        /// </returns>
+        [DllImport("libvirt-0.dll")]
+        public static extern IntPtr virDomainLookupByName(IntPtr conn, string name);
+
+        /// <summary>
+        /// Try to lookup a domain on the given hypervisor based on its UUID.
+        /// </summary>
+        /// <param name="conn">
+        /// A <see cref="IntPtr"/>pointer to the hypervisor connection.
+        /// </param>
+        /// <param name="uuid">
+        /// A <see cref="System.Char"/>the raw UUID for the domain.
+        /// </param>
+        /// <returns>
+        /// A new domain object or NULL in case of failure. If the domain cannot be found, then VIR_ERR_NO_DOMAIN error is raised.
+        /// </returns>
+        [DllImport("libvirt-0.dll")]
+        public static extern IntPtr virDomainLookupByUUID(IntPtr conn, char[] uuid);
+
+        /// <summary>
+        /// Try to lookup a domain on the given hypervisor based on its UUID.
+        /// </summary>
+        /// <param name="conn">
+        /// A <see cref="IntPtr"/>pointer to the hypervisor connection.
+        /// </param>
+        /// <param name="uuidstr">
+        /// The string UUID for the domain.
+        /// </param>
+        /// <returns>
+        /// A new domain object or NULL in case of failure. If the domain cannot be found, then VIR_ERR_NO_DOMAIN error is raised.
+        /// </returns>
+        [DllImport("libvirt-0.dll")]
+        public static extern IntPtr virDomainLookupByUUIDString(IntPtr conn, string uuidstr);
+
+        // TODO virDomainMemoryPeek
+
+        // TODO virDomainMigrate
+
+        // TODO virDomainMigrateToURI
+
+        // TODO virDomainPinVcpu
+
+        // TODO virDomainMemoryStats
+
+        /// <summary>
+        /// Reboot a domain, the domain object is still usable there after but the domain OS is being stopped for a restart. 
+        /// Note that the guest OS may ignore the request.
+        /// </summary>
+        /// <param name="domain">
+        /// A <see cref="IntPtr"/>domain object.
+        /// </param>
+        /// <param name="flags">
+        /// Extra flags for the reboot operation, not used yet.
+        /// </param>
+        /// <returns>
+        /// 0 in case of success and -1 in case of failure.
+        /// </returns>
+        [DllImport("libvirt-0.dll")]
+        public static extern int virDomainReboot(IntPtr domain, uint flags);
+
+        /// <summary>
+        /// Increment the reference count on the domain. For each additional call to this method, 
+        /// there shall be a corresponding call to virDomainFree to release the reference count, 
+        /// once the caller no longer needs the reference to this object. 
+        /// This method is typically useful for applications where multiple threads are using a connection, 
+        /// and it is required that the connection remain open until all threads have finished using it. ie, 
+        /// each new thread using a domain would increment the reference count.
+        /// </summary>
+        /// <param name="domain">
+        /// A <see cref="IntPtr"/>the domain to hold a reference on.
+        /// </param>
+        /// <returns>
+        /// 0 in case of success and -1 in case of failure.
+        /// </returns>
+        [DllImport("libvirt-0.dll")]
+        public static extern int virDomainRef(IntPtr domain);
+
+        /// <summary>
+        /// This method will restore a domain saved to disk by virDomainSave().
+        /// </summary>
+        /// <param name="conn">
+        /// A <see cref="IntPtr"/>pointer to the hypervisor connection.
+        /// </param>
+        /// <param name="from">
+        /// Path to the file with saved domain.
+        /// </param>
+        /// <returns>
+        /// 0 in case of success and -1 in case of failure.
+        /// </returns>
+        [DllImport("libvirt-0.dll")]
+        public static extern int virDomainRestore(IntPtr conn, string from);
+
+        /// <summary>
+        /// Resume a suspended domain, the process is restarted from the state where it was frozen by calling virSuspendDomain(). 
+        /// This function may requires privileged access
+        /// </summary>
+        /// <param name="domain">
+        /// A <see cref="IntPtr"/>domain object.
+        /// </param>
+        /// <returns>
+        /// 0 in case of success and -1 in case of failure.
+        /// </returns>
+        [DllImport("libvirt-0.dll")]
+        public static extern int virDomainResume(IntPtr domain);
+
+        /// <summary>
+        /// This method will suspend a domain and save its memory contents to a file on disk. After the call, if successful, 
+        /// the domain is not listed as running anymore (this may be a problem). Use virDomainRestore() to restore a domain after saving.
+        /// </summary>
+        /// <param name="domain">
+        /// A <see cref="IntPtr"/>domain object.
+        /// </param>
+        /// <param name="to">
+        /// Path for the output file.
+        /// </param>
+        /// <returns>
+        /// 0 in case of success and -1 in case of failure.
+        /// </returns>
+        [DllImport("libvirt-0.dll")]
+        public static extern int virDomainSave(IntPtr domain, string to);
+
+        /// <summary>
+        /// Configure the domain to be automatically started when the host machine boots.
+        /// </summary>
+        /// <param name="domain">
+        /// A <see cref="IntPtr"/>domain object.
+        /// </param>
+        /// <param name="autostart">
+        /// Whether the domain should be automatically started 0 or 1.
+        /// </param>
+        /// <returns>
+        /// -1 in case of error, 0 in case of success.
+        /// </returns>
+        [DllImport("libvirt-0.dll")]
+        public static extern int virDomainSetAutostart(IntPtr domain, int autostart);
+
+        /// <summary>
+        /// Dynamically change the maximum amount of physical memory allocated to a domain. 
+        /// If domain is NULL, then this change the amount of memory reserved to Domain0 i.e. 
+        /// the domain where the application runs. This function requires privileged access to the hypervisor.
+        /// </summary>
+        /// <param name="domain">
+        /// A <see cref="IntPtr"/>domain object or NULL.
+        /// </param>
+        /// <param name="memory">
+        /// The memory size in kilobytes.
+        /// </param>
+        /// <returns>
+        /// 0 in case of success and -1 in case of failure.
+        /// </returns>
+        [DllImport("libvirt-0.dll")]
+        public static extern int virDomainSetMaxMemory(IntPtr domain, ulong memory);
+
+        /// <summary>
+        /// Dynamically change the target amount of physical memory allocated to a domain. 
+        /// If domain is NULL, then this change the amount of memory reserved to Domain0 i.e. 
+        /// the domain where the application runs. This function may requires privileged access to the hypervisor.
+        /// </summary>
+        /// <param name="domain">
+        /// A <see cref="IntPtr"/>domain object or NULL.
+        /// </param>
+        /// <param name="memory">
+        /// The memory size in kilobytes.
+        /// </param>
+        /// <returns>
+        /// 0 in case of success and -1 in case of failure.
+        /// </returns>
+        [DllImport("libvirt-0.dll")]
+        public static extern int virDomainSetMemory(IntPtr domain, ulong memory);
+
+        // TODO virDomainSetSchedulerParameters
+
+        /// <summary>
+        /// Dynamically change the number of virtual CPUs used by the domain. 
+        /// Note that this call may fail if the underlying virtualization hypervisor does not support it 
+        /// or if growing the number is arbitrary limited. This function requires privileged access to the hypervisor.
+        /// </summary>
+        /// <param name="domain">
+        /// Pointer to domain object, or NULL for Domain0
+        /// </param>
+        /// <param name="nvcpus">
+        /// The new number of virtual CPUs for this domain.
+        /// </param>
+        /// <returns>
+        /// 0 in case of success, -1 in case of failure.
+        /// </returns>
+        [DllImport("libvirt-0.dll")]
+        public static extern int virDomainSetVcpus(IntPtr domain, uint nvcpus);
+
+        /// <summary>
+        /// Shutdown a domain, the domain object is still usable there after but the domain OS is being stopped. 
+        /// Note that the guest OS may ignore the request. 
+        /// </summary>
+        /// <param name="domain">
+        /// A <see cref="IntPtr"/>domain object.
+        /// </param>
+        /// <returns>
+        /// 0 in case of success and -1 in case of failure.
+        /// </returns>
+        [DllImport("libvirt-0.dll")]
+        public static extern int virDomainShutdown(IntPtr domain);
+
+        /// <summary>
+        /// Suspends an active domain, the process is frozen without further access to CPU resources and I/O 
+        /// but the memory used by the domain at the hypervisor level will stay allocated. 
+        /// Use virDomainResume() to reactivate the domain. This function may requires privileged access.
+        /// </summary>
+        /// <param name="domain">
+        /// A <see cref="IntPtr"/>domain object.
+        /// </param>
+        /// <returns>
+        /// 0 in case of success and -1 in case of failure.
+        /// </returns>
+        [DllImport("libvirt-0.dll")]
+        public static extern int virDomainSuspend(IntPtr domain);
+
+        /// <summary>
+        /// Undefine a domain but does not stop it if it is running.
+        /// </summary>
+        /// <param name="domain">
+        /// A <see cref="IntPtr"/>pointer to a defined domain.
+        /// </param>
+        /// <returns>
+        /// 0 in case of success, -1 in case of error.
+        /// </returns>
+        [DllImport("libvirt-0.dll")]
+        public static extern int virDomainUndefine(IntPtr domain);
+        #endregion
+
+        #region Events
+
+        ///<summary>
+        /// Function to install callbacks
+        ///</summary>
+        ///<param name="addHandle">the virEventAddHandleFunc which will be called (a delegate)</param>
+        ///<param name="updateHandle">the virEventUpdateHandleFunc which will be called (a delegate)</param>
+        ///<param name="removeHandle">the virEventRemoveHandleFunc which will be called (a delegate)</param>
+        ///<param name="addTimeout">the virEventAddTimeoutFunc which will be called (a delegate)</param>
+        ///<param name="updateTimeout">the virEventUpdateTimeoutFunc which will be called (a delegate)</param>
+        ///<param name="removeTimeout">the virEventRemoveTimeoutFunc which will be called (a delegate)</param>
+        [DllImport("libvirt-0.dll")]
+        public static extern void virEventRegisterImpl([MarshalAs(UnmanagedType.FunctionPtr)]virEventAddHandleFunc addHandle,
+                                                       [MarshalAs(UnmanagedType.FunctionPtr)]virEventUpdateHandleFunc updateHandle,
+                                                       [MarshalAs(UnmanagedType.FunctionPtr)]virEventRemoveHandleFunc removeHandle,
+                                                       [MarshalAs(UnmanagedType.FunctionPtr)]virEventAddTimeoutFunc addTimeout,
+                                                       [MarshalAs(UnmanagedType.FunctionPtr)]virEventUpdateTimeoutFunc updateTimeout,
+                                                       [MarshalAs(UnmanagedType.FunctionPtr)]virEventRemoveTimeoutFunc removeTimeout);
+        #endregion
+
+        #region Library
+        /// <summary>
+        /// Provides two information back, @libVer is the version of the library while @typeVer will be the version of the hypervisor 
+        /// type @type against which the library was compiled. If @type is NULL, "Xen" is assumed, 
+        /// if @type is unknown or not available, an error code will be returned and @typeVer will be 0.
+        /// </summary>
+        /// <param name="libVer">
+        /// A <see cref="System.UInt64"/>return value for the library version (OUT).
+        /// </param>
+        /// <param name="type">
+        /// A <see cref="System.String"/>the type of connection/driver looked at.
+        /// </param>
+        /// <param name="typeVer">
+        /// A <see cref="System.UInt64"/>return value for the version of the hypervisor (OUT).
+        /// </param>
+        /// <returns>
+        /// -1 in case of failure, 0 otherwise, and values for @libVer and @typeVer have the format major * 1,000,000 + minor * 1,000 + release.
+        /// </returns>
+        [DllImport("libvirt-0.dll")]
+        public static extern int virGetVersion([Out] out ulong libVer, [In] string type, [Out] out ulong typeVer);
+        /// <summary>
+        /// Initialize the library. It's better to call this routine at startup in multithreaded applications to avoid 
+        /// potential race when initializing the library.
+        /// </summary>
+        /// <returns>
+        /// 0 in case of success, -1 in case of error.
+        /// </returns>
+        [DllImport("libvirt-0.dll")]
+        public static extern int virInitialize();
+        #endregion
+
+        #region Interface
+
+        // TODO virInterfaceCreate
+
+        // TODO virInterfaceDefineXML
+
+        // TODO virInterfaceDestroy
+
+        // TODO virInterfaceFree
+
+        // TODO virInterfaceGetConnect
+
+        // TODO virInterfaceGetMACString
+
+        // TODO virInterfaceGetName
+
+        // TODO virInterfaceGetXMLDesc
+
+        // TODO virInterfaceIsActive
+
+        // TODO virInterfaceLookupByMACString
+
+        // TODO virInterfaceLookupByName
+
+        // TODO virInterfaceRef
+
+        // TODO virInterfaceUndefine
+
+        /// <summary>
+        /// Increment the reference count on the network. For each additional call to this method, 
+        /// there shall be a corresponding call to virNetworkFree to release the reference count, 
+        /// once the caller no longer needs the reference to this object. 
+        /// This method is typically useful for applications where multiple threads are using a connection, 
+        /// and it is required that the connection remain open until all threads have finished using it. ie, 
+        /// each new thread using a network would increment the reference count.
+        /// </summary>
+        /// <param name="network">
+        /// A <see cref="IntPtr"/>the network to hold a reference on.
+        /// </param>
+        /// <returns>
+        /// 0 in case of success, -1 in case of failure.
+        /// </returns>
+        [DllImport("libvirt-0.dll")]
+        public static extern int virNetworkRef(IntPtr network);
+
+        // TODO virNetworkSetAutostart
+
+        // TODO virNetworkUndefine
+        #endregion
+
+        #region Node
+
+        // TODO virNodeDeviceCreateXML
+
+        // TODO virNodeDeviceDestroy
+
+        // TODO virNodeDeviceDettach
+
+        // TODO virNodeDeviceFree
+
+        // TODO virNodeDeviceGetName
+
+        // TODO virNodeDeviceGetParent
+
+        /// <summary>
+        /// Fetch an XML document describing all aspects of the device.
+        /// </summary>
+        /// <param name="dev">pointer to the node device</param>
+        /// <param name="flags">flags for XML generation (unused, pass 0)</param>
+        /// <returns>the XML document, or NULL on error</returns>
+        [DllImport("libvirt-0.dll")]
+        [return: MarshalAs(UnmanagedType.AnsiBStr)]
+        public static extern string virNodeDeviceGetXMLDesc(IntPtr dev, uint flags);
+
+        // TODO virNodeDeviceListCaps
+
+        /// <summary>
+        /// Lookup a node device by its name.
+        /// </summary>
+        /// <param name="conn">pointer to the hypervisor connection</param>
+        /// <param name="name">unique device name</param>
+        /// <returns>a virNodeDevicePtr if found, NULL otherwise.</returns>
+        [DllImport("libvirt-0.dll")]
+        public static extern IntPtr virNodeDeviceLookupByName(IntPtr conn, string name);
+        // TODO virNodeDeviceNumOfCaps
+
+        // TODO virNodeDeviceReAttach
+
+        // TODO virNodeDeviceRef
+
+        // TODO virNodeDeviceReset
+
+        // TODO virNodeGetCellsFreeMemory
+
+        /// <summary>
+        /// Provides the free memory available on the Node Note: most libvirt APIs provide memory sizes in kilobytes, 
+        /// but in this function the returned value is in bytes. Divide by 1024 as necessary.
+        /// </summary>
+        /// <param name="conn">
+        /// A <see cref="IntPtr"/>pointer to the hypervisor connection.
+        /// </param>
+        /// <returns>
+        /// The available free memory in bytes or 0 in case of error.
+        /// </returns>
+        [DllImport("libvirt-0.dll")]
+        public static extern ulong virNodeGetFreeMemory(IntPtr conn);
+        /// <summary>
+        /// Extract hardware information about the node.
+        /// </summary>
+        /// <param name="h">
+        /// A <see cref="IntPtr"/>pointer to the hypervisor connection.
+        /// </param>
+        /// <param name="info">
+        /// Pointer to a virNodeInfo structure allocated by the user.
+        /// </param>
+        /// <returns>
+        /// 0 in case of success and -1 in case of failure.
+        /// </returns>
+        [DllImport("libvirt-0.dll")]
+        public static extern int virNodeGetInfo(IntPtr h, [Out] virNodeInfo info);
+
+        // TODO virNodeGetSecurityModel
+
+        /// <summary>
+        /// Collect the list of node devices, and store their names in @names.
+        /// If the optional 'cap' argument is non-NULL, then the count will be restricted to devices with the specified capability.
+        /// </summary>
+        /// <param name="conn">
+        /// A <see cref="IntPtr"/>pointer to the hypervisor connection.
+        /// </param>
+        /// <param name="cap">
+        /// Capability name.
+        /// </param>
+        /// <param name="names">
+        /// Array to collect the list of node device names.
+        /// </param>
+        /// <param name="maxnames">
+        /// Size of @names.
+        /// </param>
+        /// <param name="flags">
+        /// Flags (unused, pass 0).
+        /// </param>
+        /// <returns>
+        /// The number of node devices found or -1 in case of error.
+        /// </returns>
+        [DllImport("libvirt-0.dll")]
+        public static extern int virNodeListDevices(IntPtr conn, string cap, IntPtr names, int maxnames, uint flags);
+        /// <summary>
+        /// Collect the list of node devices, and store their names in @names.
+        /// If the optional 'cap' argument is non-NULL, then the count will be restricted to devices with the specified capability.
+        /// </summary>
+        /// <param name="conn">
+        /// A <see cref="IntPtr"/>pointer to the hypervisor connection.
+        /// </param>
+        /// <param name="cap">
+        /// Capability name.
+        /// </param>
+        /// <param name="names">
+        /// Array to collect the list of node device names.
+        /// </param>
+        /// <param name="maxnames">
+        /// Size of @names.
+        /// </param>
+        /// <param name="flags">
+        /// Flags (unused, pass 0).
+        /// </param>
+        /// <returns>
+        /// The number of node devices found or -1 in case of error.
+        /// </returns>
+        public static int virNodeListDevices(IntPtr conn, string cap, ref string[] names, int maxnames, uint flags)
+        {
+            IntPtr namesPtr = Marshal.AllocHGlobal(MaxStringLength);
+            int count = virNodeListDevices(conn, cap, namesPtr, maxnames, 0);
+            if (count > 0)
+                names = ptrToStringArray(namesPtr, count);
+            Marshal.FreeHGlobal(namesPtr);
+            return count;
+        }
+        /// <summary>
+        /// Provides the number of node devices. If the optional 'cap' argument is non-NULL, 
+        /// then the count will be restricted to devices with the specified capability.
+        /// </summary>
+        /// <param name="conn">
+        /// A <see cref="IntPtr"/>pointer to the hypervisor connection.
+        /// </param>
+        /// <param name="cap">
+        /// A <see cref="System.String"/>capability name.
+        /// </param>
+        /// <param name="flags">
+        /// A <see cref="System.UInt32"/>flags (unused, pass 0).
+        /// </param>
+        /// <returns>
+        /// The number of node devices or -1 in case of error.
+        /// </returns>
+        [DllImport("libvirt-0.dll")]
+        public static extern int virNodeNumOfDevices(IntPtr conn, string cap, uint flags);
+        #endregion
+
+        #region Secret
+
+        // TODO virSecretDefineXML
+
+        // TODO virSecretFree
+
+        // TODO virSecretGetConnect
+
+        // TODO virSecretGetUUID
+
+        // TODO virSecretGetUUIDString
+
+        // TODO virSecretGetUsageID
+
+        // TODO virSecretGetUsageType
+
+        // TODO virSecretGetValue
+
+        // TODO virSecretGetXMLDesc
+
+        // TODO virSecretLookupByUUID
+
+        // TODO virSecretLookupByUUIDString
+
+        // TODO virSecretLookupByUsage
+
+        // TODO virSecretRef
+
+        // TODO virSecretSetValue
+
+        // TODO virSecretUndefine
+        #endregion
+
+        #region Storage pool
+
+        /// <summary>
+        /// Build the underlying storage pool.
+        /// </summary>
+        /// <param name="pool">
+        /// A pointer to storage pool.
+        /// </param>
+        /// <param name="flags">
+        /// Future flags, use 0 for now.
+        /// </param>
+        /// <returns>
+        /// 0 on success, or -1 upon failure
+        /// </returns>
+        [DllImport("libvirt-0.dll")]
+        public static extern int virStoragePoolBuild(IntPtr pool, virStoragePoolBuildFlags flags);
+
+        /// <summary>
+        /// Starts an inactive storage pool.
+        /// </summary>
+        /// <param name="pool">
+        /// A <see cref="IntPtr"/>pointer to storage pool.
+        /// </param>
+        /// <param name="flags">
+        /// Future flags, use 0 for now.
+        /// </param>
+        /// <returns>
+        /// 0 on success, or -1 if it could not be started.
+        /// </returns>
+        [DllImport("libvirt-0.dll")]
+        public static extern int virStoragePoolCreate(IntPtr pool, uint flags);
+
+        /// <summary>
+        /// Create a new storage based on its XML description. The pool is not persistent, 
+        /// so its definition will disappear when it is destroyed, or if the host is restarted
+        /// </summary>
+        /// <param name="conn">
+        /// A <see cref="IntPtr"/>pointer to hypervisor connection.
+        /// </param>
+        /// <param name="xmlDesc">
+        /// A <see cref="System.String"/>XML description for new pool.
+        /// </param>
+        /// <param name="flags">
+        /// A <see cref="System.UInt32"/>future flags, use 0 for now.
+        /// </param>
+        /// <returns>
+        /// A virStoragePoolPtr object, or NULL if creation failed.
+        /// </returns>
+        [DllImport("libvirt-0.dll")]
+        public static extern IntPtr virStoragePoolCreateXML(IntPtr conn, string xmlDesc, uint flags);
+
+        /// <summary>
+        /// Define a new inactive storage pool based on its XML description. The pool is persistent, 
+        /// until explicitly undefined.
+        /// </summary>
+        /// <param name="conn">
+        /// A <see cref="IntPtr"/>pointer to hypervisor connection.
+        /// </param>
+        /// <param name="xml">
+        /// A <see cref="System.String"/>XML description for new pool.
+        /// </param>
+        /// <param name="flags">
+        /// A <see cref="System.UInt32"/>future flags, use 0 for now.
+        /// </param>
+        /// <returns>
+        /// A virStoragePoolPtr object, or NULL if creation failed.
+        /// </returns>
+        [DllImport("libvirt-0.dll")]
+        public static extern IntPtr virStoragePoolDefineXML(IntPtr conn, string xml, uint flags);
+
+        /// <summary>
+        /// Delete the underlying pool resources. This is a non-recoverable operation. The virStoragePoolPtr object itself is not free'd.
+        /// </summary>
+        /// <param name="pool">
+        /// A <see cref="IntPtr"/>pointer to storage pool.
+        /// </param>
+        /// <param name="flags">
+        /// A <see cref="virStoragePoolDeleteFlags"/>flags for obliteration process.
+        /// </param>
+        /// <returns>
+        /// 0 on success, or -1 if it could not be obliterate.
+        /// </returns>
+        [DllImport("libvirt-0.dll")]
+        public static extern int virStoragePoolDelete(IntPtr pool, virStoragePoolDeleteFlags flags);
+
+        /// <summary>
+        /// Destroy an active storage pool. This will deactivate the pool on the host, 
+        /// but keep any persistent config associated with it. 
+        /// If it has a persistent config it can later be restarted with virStoragePoolCreate(). 
+        /// This does not free the associated virStoragePoolPtr object.
+        /// </summary>
+        /// <param name="pool">
+        /// A <see cref="IntPtr"/>pointer to storage pool.
+        /// </param>
+        /// <returns>
+        /// 0 on success, or -1 if it could not be destroyed.
+        /// </returns>
+        [DllImport("libvirt-0.dll")]
+        public static extern int virStoragePoolDestroy(IntPtr pool);
+
+        /// <summary>
+        /// Free a storage pool object, releasing all memory associated with it. Does not change the state of the pool on the host.
+        /// </summary>
+        /// <param name="pool">
+        /// A <see cref="IntPtr"/>pointer to storage pool.
+        /// </param>
+        /// <returns>
+        /// 0 on success, or -1 if it could not be free'd.
+        /// </returns>
+        [DllImport("libvirt-0.dll")]
+        public static extern int virStoragePoolFree(IntPtr pool);
+
+        /// <summary>
+        /// Fetches the value of the autostart flag, which determines whether the pool is automatically started at boot time.
+        /// </summary>
+        /// <param name="pool">
+        /// A <see cref="IntPtr"/>pointer to storage pool.
+        /// </param>
+        /// <param name="autotart"></param>
+        /// <returns>
+        /// 0 on success, -1 on failure
+        /// </returns>
+        [DllImport("libvirt-0.dll")]
+        public static extern int virStoragePoolGetAutostart(IntPtr pool, out int autotart);
+
+        /// <summary>
+        /// Provides the connection pointer associated with a storage pool. The reference counter on the connection is not increased by this call. 
+        /// WARNING: When writing libvirt bindings in other languages, do not use this function. Instead, store the connection and the pool object together.
+        /// </summary>
+        /// <param name="pool">
+        /// A <see cref="IntPtr"/>pointer to a pool.
+        /// </param>
+        /// <returns>
+        /// A <see cref="IntPtr"/>the virConnectPtr or NULL in case of failure.
+        /// </returns>
+        [DllImport("libvirt-0.dll")]
+        public static extern IntPtr virStoragePoolGetConnect(IntPtr pool);
+
+        /// <summary>
+        /// Get volatile information about the storage pool such as free space / usage summary.
+        /// </summary>
+        /// <param name="pool">
+        /// A <see cref="IntPtr"/>pointer to storage pool.
+        /// </param>
+        /// <param name="info">
+        /// Pointer at which to store info.
+        /// </param>
+        /// <returns>
+        /// 0 on success, or -1 on failure.
+        /// </returns>
+        [DllImport("libvirt-0.dll")]
+        public static extern int virStoragePoolGetInfo(IntPtr pool, ref virStoragePoolInfo info);
+
+        /// <summary>
+        /// Fetch the locally unique name of the storage pool.
+        /// </summary>
+        /// <param name="pool">
+        /// A <see cref="IntPtr"/>pointer to storage pool.
+        /// </param>
+        /// <returns>
+        /// The name of the pool, or NULL on error.
+        /// </returns>
+        [DllImport("libvirt-0.dll")]
+        [return: MarshalAs(UnmanagedType.AnsiBStr)]
+        public static extern string virStoragePoolGetName(IntPtr pool);
+
+        /// <summary>
+        /// Fetch the globally unique ID of the storage pool.
+        /// </summary>
+        /// <param name="pool">
+        /// A <see cref="IntPtr"/>Pointer to storage pool.
+        /// </param>
+        /// <param name="uuid">
+        /// Buffer of VIR_UUID_BUFLEN bytes in size.
+        /// </param>
+        /// <returns>
+        /// 0 on success, or -1 on error
+        /// </returns>
+        [DllImport("libvirt-0.dll")]
+        public static extern int virStoragePoolGetUUID(IntPtr pool, [Out] char[] uuid);
+
+        /// <summary>
+        /// Fetch the globally unique ID of the storage pool as a string.
+        /// </summary>
+        /// <param name="pool">
+        /// A <see cref="IntPtr"/>pointer to storage pool.
+        /// </param>
+        /// <param name="uuid">
+        /// A <see cref="IntPtr"/>buffer of VIR_UUID_STRING_BUFLEN bytes in size.
+        /// </param>
+        /// <returns>
+        /// 0 on success, or -1 on error.
+        /// </returns>
+        [DllImport("libvirt-0.dll")]
+        private static extern int virStoragePoolGetUUIDString(IntPtr pool, [Out] char[] uuid);
+
+        ///<summary>
+        /// Fetch the globally unique ID of the storage pool as a string.
+        ///</summary>
+        /// <param name="pool">
+        /// A <see cref="IntPtr"/>pointer to storage pool.
+        /// </param>
+        ///<returns>the storage pool UUID</returns>
+        public static string virStoragePoolGetUUIDString(IntPtr pool)
+        {
+            char[] uuidArray = new char[36];
+            virStoragePoolGetUUIDString(pool, uuidArray);
+            return new string(uuidArray);
+        }
+        /// <summary>
+        /// Fetch an XML document describing all aspects of the storage pool. 
+        /// This is suitable for later feeding back into the virStoragePoolCreateXML method.
+        /// </summary>
+        /// <param name="pool">
+        /// A <see cref="IntPtr"/>pointer to storage pool.
+        /// </param>
+        /// <param name="flags">
+        /// Flags for XML format options (set of virDomainXMLFlags).
+        /// </param>
+        /// <returns>
+        /// A XML document, or NULL on error.
+        /// </returns>
+        [DllImport("libvirt-0.dll")]
+        [return: MarshalAs(UnmanagedType.AnsiBStr)]
+        public static extern string virStoragePoolGetXMLDesc(IntPtr pool, virDomainXMLFlags flags);
+
+        /// <summary>
+        /// Determine if the storage pool is currently running.
+        /// </summary>
+        /// <param name="pool">
+        /// A <see cref="IntPtr"/>pointer to the storage pool object.
+        /// </param>
+        /// <returns>
+        /// 1 if running, 0 if inactive, -1 on error.
+        /// </returns>
+        [DllImport("libvirt-0.dll")]
+        public static extern int virStoragePoolIsActive(IntPtr pool);
+
+        /// <summary>
+        /// Determine if the storage pool has a persistent configuration which means it will still exist after shutting down.
+        /// </summary>
+        /// <param name="pool">
+        /// A <see cref="IntPtr"/>pointer to the storage pool object.
+        /// </param>
+        /// <returns>
+        /// 1 if persistent, 0 if transient, -1 on error.
+        /// </returns>
+        [DllImport("libvirt-0.dll")]
+        public static extern int virStoragePoolIsPersistent(IntPtr pool);
+
+        /// <summary>
+        /// Fetch list of storage volume names, limiting to at most maxnames.
+        /// </summary>
+        /// <param name="pool">
+        /// A <see cref="IntPtr"/>pointer to storage pool.
+        /// </param>
+        /// <param name="names">
+        /// A <see cref="IntPtr"/>array in which to storage volume names.
+        /// </param>
+        /// <param name="maxnames">
+        /// A <see cref="System.Int32"/>size of names array.
+        /// </param>
+        /// <returns>
+        /// The number of names fetched, or -1 on error.
+        /// </returns>
+        [DllImport("libvirt-0.dll")]
+        private static extern int virStoragePoolListVolumes(IntPtr pool, IntPtr names, int maxnames);
+        /// <summary>
+        /// Fetch list of storage volume names, limiting to at most maxnames.
+        /// </summary>
+        /// <param name="pool">
+        /// A <see cref="IntPtr"/>pointer to storage pool.
+        /// </param>
+        /// <param name="names">
+        /// A <see cref="IntPtr"/>array in which to storage volume names.
+        /// </param>
+        /// <param name="maxnames">
+        /// A <see cref="System.Int32"/>size of names array.
+        /// </param>
+        /// <returns>
+        /// The number of names fetched, or -1 on error.
+        /// </returns>
+        public static int virStoragePoolListVolumes(IntPtr pool, ref string[] names, int maxnames)
+        {
+            IntPtr namesPtr = Marshal.AllocHGlobal(MaxStringLength);
+            int count = virStoragePoolListVolumes(pool, namesPtr, maxnames);
+            if (count > 0)
+                names = ptrToStringArray(namesPtr, count);
+            Marshal.FreeHGlobal(namesPtr);
+            return count;
+        }
+        /// <summary>
+        /// Fetch a storage pool based on its unique name.
+        /// </summary>
+        /// <param name="conn">
+        /// A <see cref="IntPtr"/>pointer to hypervisor connection.
+        /// </param>
+        /// <param name="name">
+        /// Name of pool to fetch.
+        /// </param>
+        /// <returns>
+        /// A <see cref="IntPtr"/>virStoragePoolPtr object, or NULL if no matching pool is found.
+        /// </returns>
+        [DllImport("libvirt-0.dll")]
+        public static extern IntPtr virStoragePoolLookupByName(IntPtr conn, string name);
+
+        /// <summary>
+        /// Fetch a storage pool based on its globally unique id.
+        /// </summary>
+        /// <param name="conn">
+        /// A <see cref="IntPtr"/>pointer to hypervisor connection.
+        /// </param>
+        /// <param name="uuid">
+        /// Globally unique id of pool to fetch.
+        /// </param>
+        /// <returns>
+        /// A virStoragePoolPtr object, or NULL if no matching pool is found
+        /// </returns>
+        [DllImport("libvirt-0.dll")]
+        public static extern IntPtr virStoragePoolLookupByUUID(IntPtr conn, char[] uuid);
+
+        /// <summary>
+        /// Fetch a storage pool based on its globally unique id.
+        /// </summary>
+        /// <param name="conn">
+        /// A <see cref="IntPtr"/>pointer to hypervisor connection.
+        /// </param>
+        /// <param name="uuidstr">
+        /// A <see cref="System.String"/>globally unique id of pool to fetch.
+        /// </param>
+        /// <returns>
+        /// A <see cref="IntPtr"/>object, or NULL if no matching pool is found.
+        /// </returns>
+        [DllImport("libvirt-0.dll")]
+        public static extern IntPtr virStoragePoolLookupByUUIDString(IntPtr conn, string uuidstr);
+
+        /// <summary>
+        /// Fetch a storage pool which contains a particular volume.
+        /// </summary>
+        /// <param name="vol">
+        /// A <see cref="IntPtr"/>pointer to storage volume.
+        /// </param>
+        /// <returns>
+        /// A <see cref="IntPtr"/>object, or NULL if no matching pool is found.
+        /// </returns>
+        [DllImport("libvirt-0.dll")]
+        public static extern IntPtr virStoragePoolLookupByVolume(IntPtr vol);
+
+        /// <summary>
+        /// Fetch the number of storage volumes within a pool.
+        /// </summary>
+        /// <param name="pool">
+        /// A <see cref="IntPtr"/>pointer to storage pool.
+        /// </param>
+        /// <returns>
+        /// A <see cref="System.Int32"/>the number of storage pools, or -1 on failure.
+        /// </returns>
+        [DllImport("libvirt-0.dll")]
+        public static extern int virStoragePoolNumOfVolumes(IntPtr pool);
+
+        /// <summary>
+        /// Increment the reference count on the pool. For each additional call to this method, 
+        /// there shall be a corresponding call to virStoragePoolFree to release the reference count, 
+        /// once the caller no longer needs the reference to this object. 
+        /// This method is typically useful for applications where multiple threads are using a connection, 
+        /// and it is required that the connection remain open until all threads have finished using it. ie, 
+        /// each new thread using a pool would increment the reference count.
+        /// </summary>
+        /// <param name="pool">
+        /// The pool to hold a reference on.
+        /// </param>
+        /// <returns>
+        /// 0 in case of success, -1 in case of failure.
+        /// </returns>
+        [DllImport("libvirt-0.dll")]
+        public static extern int virStoragePoolRef(IntPtr pool);
+
+        /// <summary>
+        /// Request that the pool refresh its list of volumes. This may involve communicating with a remote server, 
+        /// and/or initializing new devices at the OS layer.
+        /// </summary>
+        /// <param name="pool">
+        /// A <see cref="IntPtr"/>pointer to storage pool.
+        /// </param>
+        /// <param name="flags">
+        /// A <see cref="System.UInt32"/>flags to control refresh behaviour (currently unused, use 0).
+        /// </param>
+        /// <returns>
+        /// 0 if the volume list was refreshed, -1 on failure.
+        /// </returns>
+        [DllImport("virtlib-0.dll")]
+        public static extern int virStoragePoolRefresh(IntPtr pool, uint flags);
+
+        /// <summary>
+        /// Sets the autostart flag.
+        /// </summary>
+        /// <param name="pool">
+        /// A <see cref="IntPtr"/>pointer to storage pool.
+        /// </param>
+        /// <param name="autostart">
+        /// A <see cref="System.Int32"/>new flag setting.
+        /// </param>
+        /// <returns>
+        /// 0 on success, -1 on failure.
+        /// </returns>
+        [DllImport("libvirt-0.dll")]
+        public static extern int virStoragePoolSetAutostart(IntPtr pool, int autostart);
+
+        /// <summary>
+        /// Undefine an inactive storage pool.
+        /// </summary>
+        /// <param name="pool">
+        /// A <see cref="IntPtr"/>pointer to storage pool.
+        /// </param>
+        /// <returns>
+        /// 0 on success, -1 on failure.
+        /// </returns>
+        [DllImport("libvirt-0.dll")]
+        public static extern int virStoragePoolUndefine(IntPtr pool);
+        #endregion
+
+        #region Volumes
+
+        /// <summary>
+        /// Create a storage volume within a pool based on an XML description. Not all pools support creation of volumes.
+        /// </summary>
+        /// <param name="pool">
+        /// A <see cref="IntPtr"/>pointer to storage pool.
+        /// </param>
+        /// <param name="xmldesc">
+        /// A <see cref="System.String"/>description of volume to create.
+        /// </param>
+        /// <param name="flags">
+        /// A <see cref="System.UInt32"/>flags for creation (unused, pass 0).
+        /// </param>
+        /// <returns>
+        /// The storage volume, or NULL on error.
+        /// </returns>
+        [DllImport("libvirt-0.dll")]
+        public static extern IntPtr virStorageVolCreateXML(IntPtr pool, string xmldesc, uint flags);
+
+        /// <summary>
+        /// Create a storage volume in the parent pool, using the 'clonevol' volume as input. 
+        /// Information for the new volume (name, perms) are passed via a typical volume XML description.
+        /// </summary>
+        /// <param name="pool">
+        /// A <see cref="IntPtr"/>pointer to parent pool for the new volume.
+        /// </param>
+        /// <param name="xmldesc">
+        /// A <see cref="System.String"/>description of volume to create.
+        /// </param>
+        /// <param name="clonevol">
+        /// A <see cref="IntPtr"/>storage volume to use as input.
+        /// </param>
+        /// <param name="flags">
+        /// A <see cref="System.UInt32"/>flags for creation (unused, pass 0).
+        /// </param>
+        /// <returns>
+        /// A <see cref="IntPtr"/>the storage volume, or NULL on error.
+        /// </returns>
+        [DllImport("libvirt-0.dll")]
+        public static extern IntPtr virStorageVolCreateXMLFrom(IntPtr pool, string xmldesc, IntPtr clonevol, uint flags);
+
+        /// <summary>
+        /// Delete the storage volume from the pool.
+        /// </summary>
+        /// <param name="vol">
+        /// A <see cref="IntPtr"/>pointer to storage volume.
+        /// </param>
+        /// <param name="flags">
+        /// A <see cref="System.UInt32"/>future flags, use 0 for now.
+        /// </param>
+        /// <returns>
+        /// 0 on success, or -1 on error.
+        /// </returns>
+        [DllImport("libvirt-0.dll")]
+        public static extern int virStorageVolDelete(IntPtr vol, uint flags);
+
+        /// <summary>
+        /// Release the storage volume handle. The underlying storage volume continues to exist.
+        /// </summary>
+        /// <param name="vol">
+        /// A <see cref="IntPtr"/>pointer to storage volume.
+        /// </param>
+        /// <returns>
+        /// 0 on success, or -1 on error.
+        /// </returns>
+        [DllImport("libvirt-0.dll")]
+        public static extern int virStorageVolFree(IntPtr vol);
+
+        /// <summary>
+        /// Provides the connection pointer associated with a storage volume. 
+        /// The reference counter on the connection is not increased by this call. 
+        /// WARNING: When writing libvirt bindings in other languages, do not use this function. 
+        /// Instead, store the connection and the volume object together.
+        /// </summary>
+        /// <param name="vol">
+        /// A <see cref="IntPtr"/>
+        /// </param>
+        /// <returns>
+        /// A <see cref="IntPtr"/>
+        /// </returns>
+        [DllImport("libvirt-0.dll")]
+        public static extern IntPtr virStorageVolGetConnect(IntPtr vol);
+
+        /// <summary>
+        /// Fetches volatile information about the storage volume such as its current allocation.
+        /// </summary>
+        /// <param name="vol">
+        /// A <see cref="IntPtr"/>pointer to storage volume.
+        /// </param>
+        /// <param name="info">
+        /// A <see cref="virStorageVolInfo"/>pointer at which to store info.
+        /// </param>
+        /// <returns>
+        /// 0 on success, or -1 on failure.
+        /// </returns>
+        [DllImport("libvirt-0.dll")]
+        public static extern int virStorageVolGetInfo(IntPtr vol, ref virStorageVolInfo info);
+
+        /// <summary>
+        /// Fetch the storage volume key. 
+        /// This is globally unique, so the same volume will have the same key no matter what host it is accessed from
+        /// </summary>
+        /// <param name="vol">
+        /// A <see cref="IntPtr"/>pointer to storage volume.
+        /// </param>
+        /// <returns>
+        /// The volume key, or NULL on error.
+        /// </returns>
+        [DllImport("libvirt-0.dll")]
+        [return: MarshalAs(UnmanagedType.AnsiBStr)]
+        public static extern string virStorageVolGetKey(IntPtr vol);
+
+        /// <summary>
+        /// Fetch the storage volume name. This is unique within the scope of a pool.
+        /// </summary>
+        /// <param name="vol">
+        /// A <see cref="IntPtr"/>pointer to storage volume.
+        /// </param>
+        /// <returns>
+        /// The volume name, or NULL on error.
+        /// </returns>
+        [DllImport("libvirt-0.dll")]
+        [return: MarshalAs(UnmanagedType.AnsiBStr)]
+        public static extern string virStorageVolGetName(IntPtr vol);
+
+        /// <summary>
+        /// Fetch the storage volume path. 
+        /// Depending on the pool configuration this is either persistent across hosts, 
+        /// or dynamically assigned at pool startup. 
+        /// Consult pool documentation for information on getting the persistent naming.
+        /// </summary>
+        /// <param name="vol">
+        /// A <see cref="IntPtr"/>pointer to storage volume.
+        /// </param>
+        /// <returns>
+        /// The storage volume path, or NULL on error.
+        /// </returns>
+        [DllImport("libvirt-0.dll")]
+        [return: MarshalAs(UnmanagedType.AnsiBStr)]
+        public static extern string virStorageVolGetPath(IntPtr vol);
+
+        /// <summary>
+        /// Fetch an XML document describing all aspects of the storage volume.
+        /// </summary>
+        /// <param name="vol">
+        /// A <see cref="IntPtr"/>pointer to storage volume.
+        /// </param>
+        /// <param name="flags">
+        /// A <see cref="System.UInt32"/>flags for XML generation (unused, pass 0).
+        /// </param>
+        /// <returns>
+        /// The XML document, or NULL on error.
+        /// </returns>
+        [DllImport("libvirt-0.dll")]
+        [return: MarshalAs(UnmanagedType.AnsiBStr)]
+        public static extern string virStorageVolGetXMLDesc(IntPtr vol, uint flags);
+
+        /// <summary>
+        /// Fetch a pointer to a storage volume based on its globally unique key.
+        /// </summary>
+        /// <param name="conn">
+        /// A <see cref="IntPtr"/>pointer to hypervisor connection.
+        /// </param>
+        /// <param name="key">
+        /// A <see cref="System.String"/>globally unique key.
+        /// </param>
+        /// <returns>
+        /// A <see cref="IntPtr"/>storage volume, or NULL if not found / error.
+        /// </returns>
+        [DllImport("libvirt-0.dll")]
+        public static extern IntPtr virStorageVolLookupByKey(IntPtr conn, string key);
+
+        /// <summary>
+        /// Fetch a pointer to a storage volume based on its name within a pool.
+        /// </summary>
+        /// <param name="pool">
+        /// A <see cref="IntPtr"/>pointer to storage pool.
+        /// </param>
+        /// <param name="name">
+        /// A <see cref="System.String"/>name of storage volume.
+        /// </param>
+        /// <returns>
+        /// A <see cref="IntPtr"/>storage volume, or NULL if not found / error.
+        /// </returns>
+        [DllImport("libvirt-0.dll")]
+        public static extern IntPtr virStorageVolLookupByName(IntPtr pool, string name);
+
+        /// <summary>
+        /// Fetch a pointer to a storage volume based on its locally (host) unique path.
+        /// </summary>
+        /// <param name="conn">
+        /// A <see cref="IntPtr"/>pointer to hypervisor connection.
+        /// </param>
+        /// <param name="path">
+        /// A <see cref="System.String"/>locally unique path.
+        /// </param>
+        /// <returns>
+        /// A <see cref="IntPtr"/>storage volume, or NULL if not found / error.
+        /// </returns>
+        [DllImport("libvirt-0.dll")]
+        public static extern IntPtr virStorageVolLookupByPath(IntPtr conn, string path);
+
+        /// <summary>
+        /// Increment the reference count on the vol. For each additional call to this method, 
+        /// there shall be a corresponding call to virStorageVolFree to release the reference count, 
+        /// once the caller no longer needs the reference to this object. 
+        /// This method is typically useful for applications where multiple threads are using a connection, 
+        /// and it is required that the connection remain open until all threads have finished using it. ie, 
+        /// each new thread using a vol would increment the reference count.
+        /// </summary>
+        /// <param name="vol">
+        /// A <see cref="IntPtr"/>the vol to hold a reference on.
+        /// </param>
+        /// <returns>
+        /// A <see cref="System.Int32"/>0 in case of success, -1 in case of failure.
+        /// </returns>
+        [DllImport("libvirt-0.dll")]
+        public static extern int virStorageVolRef(IntPtr vol);
+
+        #endregion
+
+        #region Streams
+
+        // TODO virStreamAbort
+
+        // TODO virStreamEventAddCallback
+
+        // TODO virStreamEventCallback
+
+        // TODO virStreamEventRemoveCallback
+
+        // TODO virStreamEventUpdateCallback
+
+        // TODO virStreamFinish
+
+        // TODO virStreamFree
+
+        // TODO virStreamNew
+
+        // TODO virStreamRecv
+
+        // TODO virStreamRecvAll
+
+        // TODO virStreamRef
+
+        // TODO virStreamSend
+
+        // TODO virStreamSendAll
+
+        // TODO virStreamSinkFunc
+
+        // TODO virStreamSourceFunc
+
+        /// <summary>
+        /// A callback function to be registered, and called when a domain event occurs
+        /// </summary>
+        /// <param name="conn">virConnect connection </param>
+        /// <param name="dom">The domain on which the event occured</param>
+        /// <param name="evt">The specfic virDomainEventType which occured</param>
+        /// <param name="detail">event specific detail information</param>
+        /// <param name="opaque">opaque user data</param>
+        [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+        public delegate void virConnectDomainEventCallback(IntPtr conn, IntPtr dom, virDomainEventType evt, int detail, IntPtr opaque);
+        /// <summary>
+        /// Adds a callback to receive notifications of domain lifecycle events occurring on a connection Use of this method is no longer recommended. Instead applications should try virConnectDomainEventRegisterAny which has a more flexible API contract The virDomainPtr object handle passed into the callback upon delivery of an event is only valid for the duration of execution of the callback. If the callback wishes to keep the domain object after the callback
+        /// </summary>
+        /// <param name="conn">pointer to the connection</param>
+        /// <param name="cb">callback to the function handling domain events</param>
+        /// <param name="opaque">opaque data to pass on to the callback</param>
+        /// <param name="ff">optional function to deallocate opaque when not used anymore</param>
+        /// <returns>t shall take a reference to it, by calling virDomainRef. The reference can be released once the object is no longer required by calling virDomainFree. Returns 0 on success, -1 on failure</returns>
+        [DllImport("libvirt-0.dll", CallingConvention = CallingConvention.Cdecl)]
+        public static extern int virConnectDomainEventRegister(IntPtr conn, [MarshalAs(UnmanagedType.FunctionPtr)] virConnectDomainEventCallback cb,
+                                                                IntPtr opaque, [MarshalAs(UnmanagedType.FunctionPtr)] virFreeCallback ff);
+
+        #endregion
+
+        #region Network
+
+        /// <summary>
+        /// Create and start a defined network. If the call succeed the network moves from the defined to the running networks pools.
+        /// </summary>
+        /// <param name="network">pointer to a defined network</param>
+        /// <returns>0 in case of success, -1 in case of error</returns>
+        [DllImport("libvirt-0.dll")]
+        public static extern int virNetworkCreate(IntPtr network);
+        /// <summary>
+        /// Create and start a new virtual network, based on an XML description similar to the one returned by virNetworkGetXMLDesc()
+        /// </summary>
+        /// <param name="conn">pointer to the hypervisor connection</param>
+        /// <param name="xmlDesc">an XML description of the network</param>
+        /// <returns>a new network object or NULL in case of failure</returns>
+        [DllImport("libvirt-0.dll")]
+        public static extern IntPtr virNetworkCreateXML(IntPtr conn, string xmlDesc);
+        /// <summary>
+        /// Define a network, but does not create it
+        /// </summary>
+        /// <param name="conn">pointer to the hypervisor connection</param>
+        /// <param name="xmlDesc">the XML description for the network, preferably in UTF-8</param>
+        /// <returns>NULL in case of error, a pointer to the network otherwise</returns>
+        [DllImport("libvirt-0.dll")]
+        public static extern IntPtr virNetworkDefineXML(IntPtr conn, string xmlDesc);
+        /// <summary>
+        /// Destroy the network object. The running instance is shutdown if not down already and all resources used by it are given back to the hypervisor. This does not free the associated virNetworkPtr object. This function may require privileged access
+        /// </summary>
+        /// <param name="network">a network object</param>
+        /// <returns>0 in case of success and -1 in case of failure.</returns>
+        [DllImport("libvirt-0.dll")]
+        public static extern int virNetworkDestroy(IntPtr network);
+        /// <summary>
+        /// Free the network object. The running instance is kept alive. The data structure is freed and should not be used thereafter.
+        /// </summary>
+        /// <param name="network">a network object</param>
+        /// <returns>0 in case of success and -1 in case of failure</returns>
+        [DllImport("libvirt-0.dll")]
+        public static extern int virNetworkFree(IntPtr network);
+        /// <summary>
+        /// Provides a boolean value indicating whether the network configured to be automatically started when the host machine boots.
+        /// </summary>
+        /// <param name="network">a network object</param>
+        /// <param name="autostart">the value returned</param>
+        /// <returns>-1 in case of error, 0 in case of success</returns>
+        [DllImport("libvirt-0.dll")]
+        public static extern int virNetworkGetAutostart(IntPtr network, int autostart);
+        /// <summary>
+        /// Provides a bridge interface name to which a domain may connect a network interface in order to join the network.
+        /// </summary>
+        /// <param name="network">a network object</param>
+        /// <returns>a 0 terminated interface name, or NULL in case of error. the caller must free() the returned value</returns>
+        [DllImport("libvirt-0.dll")]
+        [return: MarshalAs(UnmanagedType.AnsiBStr)]
+        public static extern string virNetworkGetBridgeName(IntPtr network);
+        /// <summary>
+        /// Provides the connection pointer associated with a network. The reference counter on the connection is not increased by this call. WARNING: When writing libvirt bindings in other languages, do not use this function. Instead, store the connection and the network object together
+        /// </summary>
+        /// <param name="network">pointer to a network</param>
+        /// <returns>the virConnectPtr or NULL in case of failure</returns>
+        [DllImport("libvirt-0.dll")]
+        public static extern IntPtr virNetworkGetConnect(IntPtr network);
+        /// <summary>
+        /// Get the public name for that network
+        /// </summary>
+        /// <param name="network">a network object</param>
+        /// <returns>a pointer to the name or NULL, the string need not be deallocated its lifetime will be the same as the network object</returns>
+        [DllImport("libvirt-0.dll")]
+        [return: MarshalAs(UnmanagedType.AnsiBStr)]
+        public static extern string virNetworkGetName(IntPtr network);
+        /// <summary>
+        /// Get the UUID for a network as string
+        /// </summary>
+        /// <param name="network">a network object</param>
+        /// <param name="uuid">string of the uuid</param>
+        /// <returns>-1 in case of error, 0 in case of success</returns>
+        [DllImport("libvirt-0.dll")]
+        private static extern int virNetworkGetUUIDString(IntPtr network, [Out] char[] uuid);
+
+        ///<summary>
+        /// Get the UUID for a network as string
+        ///</summary>
+        ///<param name="network">a network object, a netowrk IntPtr</param>
+        ///<returns>string of the uuid</returns>
+        public static string virNetworkGetUUIDString(IntPtr network)
+        {
+            char[] uuidArray = new char[36];
+            virNetworkGetUUIDString(network, uuidArray);
+            return new string(uuidArray);
+        }
+        /// <summary>
+        /// Provide an XML description of the network. The description may be reused later to relaunch the network with virNetworkCreateXML().
+        /// </summary>
+        /// <param name="network">a network object</param>
+        /// <param name="flags">an OR'ed set of extraction flags, not used yet</param>
+        /// <returns>a 0 terminated UTF-8 encoded XML instance, or NULL in case of error. the caller must free() the returned value</returns>
+        [DllImport("libvirt-0.dll")]
+        [return: MarshalAs(UnmanagedType.AnsiBStr)]
+        public static extern string virNetworkGetXMLDesc(IntPtr network, int flags);
+        /// <summary>
+        /// Determine if the network is currently running
+        /// </summary>
+        /// <param name="network">pointer to the network object</param>
+        /// <returns>1 if running, 0 if inactive, -1 on error</returns>
+        [DllImport("libvirt-0.dll")]
+        public static extern int virNetworkIsActive(IntPtr network);
+        /// <summary>
+        /// Determine if the network has a persistent configuration which means it will still exist after shutting down
+        /// </summary>
+        /// <param name="network">pointer to the network object</param>
+        /// <returns>x1 if persistent, 0 if transient, -1 on error</returns>
+        [DllImport("libvirt-0.dll")]
+        public static extern int virNetworkIsPersistent(IntPtr network);
+        /// <summary>
+        /// Try to lookup a network on the given hypervisor based on its name.
+        /// </summary>
+        /// <param name="conn">pointer to the hypervisor connection</param>
+        /// <param name="name">name for the network</param>
+        /// <returns>a new network object or NULL in case of failure. If the network cannot be found, then VIR_ERR_NO_NETWORK error is raised</returns>
+        [DllImport("libvirt-0.dll")]
+        public static extern IntPtr virNetworkLookupByName(IntPtr conn, string name);
+        /// <summary>
+        /// Try to lookup a network on the given hypervisor based on its UUID
+        /// </summary>
+        /// <param name="conn">pointer to the hypervisor connection</param>
+        /// <param name="uuidstr">the string UUID for the network</param>
+        /// <returns>a new network object or NULL in case of failure. If the network cannot be found, then VIR_ERR_NO_NETWORK error is raised</returns>
+        [DllImport("libvirt-0.dll")]
+        public static extern IntPtr virNetworkLookupByUUIDString(IntPtr conn, string uuidstr);
+        /// <summary>
+        /// Configure the network to be automatically started when the host machine boots
+        /// </summary>
+        /// <param name="network">a network object</param>
+        /// <param name="autostart">whether the network should be automatically started 0 or 1</param>
+        /// <returns>-1 in case of error, 0 in case of success</returns>
+        [DllImport("libvirt-0.dll")]
+        public static extern int virNetworkSetAutostart(IntPtr network, int autostart);
+        /// <summary>
+        /// Undefine a network but does not stop it if it is running
+        /// </summary>
+        /// <param name="network">pointer to a defined network</param>
+        /// <returns>0 in case of success, -1 in case of error</returns>
+        [DllImport("libvirt-0.dll")]
+        public static extern int virNetworkUndefine(IntPtr network);
+
+        #endregion
+
+        #region Helpers
+        
+        private static string[] ptrToStringArray(IntPtr stringPtr, int stringCount)
+        {
+            string[] members = new string[stringCount];
+            for (int i = 0; i < stringCount; ++i)
+            {
+                IntPtr s = Marshal.ReadIntPtr(stringPtr, i * IntPtr.Size);
+                members[i] = Marshal.PtrToStringAnsi(s);
+            }
+            return members;
+        }
+
+// ReSharper disable UnusedMember.Local
+        private static string ptrToString(IntPtr stringPtr)
+// ReSharper restore UnusedMember.Local
+        {
+            IntPtr s = Marshal.ReadIntPtr(stringPtr, IntPtr.Size);
+            return Marshal.PtrToStringAnsi(s);
+        }
+
+        #endregion
+    }
+}
diff --git a/LibvirtBindings.csproj b/LibvirtBindings.csproj
new file mode 100644
index 0000000..7ddaa82
--- /dev/null
+++ b/LibvirtBindings.csproj
@@ -0,0 +1,63 @@
+﻿<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProductVersion>8.0.30703</ProductVersion>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{61AF36A9-0D6C-4E02-9B9B-39908463A82E}</ProjectGuid>
+    <OutputType>Library</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>LibvirtBindings</RootNamespace>
+    <AssemblyName>LibvirtBindings</AssemblyName>
+    <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
+    <FileAlignment>512</FileAlignment>
+    <TargetFrameworkProfile />
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>bin\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <DocumentationFile>bin\Debug\LibvirtBindings.XML</DocumentationFile>
+    <PlatformTarget>AnyCPU</PlatformTarget>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="System" />
+    <Reference Include="System.Core" />
+    <Reference Include="System.Xml.Linq" />
+    <Reference Include="System.Data.DataSetExtensions" />
+    <Reference Include="System.Data" />
+    <Reference Include="System.Xml" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="Libvirt.cs" />
+    <Compile Include="LibvirtError.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="COPYING.LIB" />
+  </ItemGroup>
+  <ItemGroup>
+    <Content Include="COPYING.txt" />
+  </ItemGroup>
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
+       Other similar extension points exist, see Microsoft.Common.targets.
+  <Target Name="BeforeBuild">
+  </Target>
+  <Target Name="AfterBuild">
+  </Target>
+  -->
+</Project>
\ No newline at end of file
diff --git a/LibvirtBindings.sln b/LibvirtBindings.sln
new file mode 100644
index 0000000..cfa349c
--- /dev/null
+++ b/LibvirtBindings.sln
@@ -0,0 +1,20 @@
+﻿
+Microsoft Visual Studio Solution File, Format Version 11.00
+# Visual Studio 2010
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LibvirtBindings", "LibvirtBindings.csproj", "{61AF36A9-0D6C-4E02-9B9B-39908463A82E}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|Any CPU = Debug|Any CPU
+		Release|Any CPU = Release|Any CPU
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{61AF36A9-0D6C-4E02-9B9B-39908463A82E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{61AF36A9-0D6C-4E02-9B9B-39908463A82E}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{61AF36A9-0D6C-4E02-9B9B-39908463A82E}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{61AF36A9-0D6C-4E02-9B9B-39908463A82E}.Release|Any CPU.Build.0 = Release|Any CPU
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+EndGlobal
diff --git a/LibvirtError.cs b/LibvirtError.cs
new file mode 100644
index 0000000..eaab401
--- /dev/null
+++ b/LibvirtError.cs
@@ -0,0 +1,683 @@
+﻿/*
+ * Copyright (C)
+ *   Arnaud Champion <arnaud.champion@devatom.fr>
+ *   Jaromír Červenka <cervajz@cervajz.com>
+ *
+ * See COPYING.LIB for the License of this software
+ */
+
+
+using System;
+using System.Runtime.InteropServices;
+
+namespace LibvirtBindings
+{
+    ///<summary>
+    /// class for libvirt errors binding
+    ///</summary>
+    public class libvirtError
+    {
+        ///<summary>
+        /// Signature of a function to use when there is an error raised by the library.
+        ///</summary>
+        ///<param name="userData">user provided data for the error callback</param>
+        ///<param name="error">the error being raised.</param>
+        public delegate void virErrorFunc(IntPtr userData, virError error);
+
+        ///<summary>
+        /// Enumerate errors
+        ///</summary>
+        public enum virErrorNumber
+        {
+            /// <summary>
+            /// No error
+            /// </summary>
+            VIR_ERR_OK = 0,
+            /// <summary>
+            /// Internal error
+            /// </summary>
+            VIR_ERR_INTERNAL_ERROR = 1,
+            /// <summary>
+            /// Memory allocation failure
+            /// </summary>
+            VIR_ERR_NO_MEMORY = 2,
+            /// <summary>
+            /// No support for this function
+            /// </summary>
+            VIR_ERR_NO_SUPPORT = 3,
+            /// <summary>
+            /// Could not resolve hostname
+            /// </summary>
+            VIR_ERR_UNKNOWN_HOST = 4,
+            /// <summary>
+            /// Can't connect to hypervisor
+            /// </summary>
+            VIR_ERR_NO_CONNECT = 5,
+            /// <summary>
+            /// Invalid connection object
+            /// </summary>
+            VIR_ERR_INVALID_CONN = 6,
+            /// <summary>
+            /// Invalid domain object
+            /// </summary>
+            VIR_ERR_INVALID_DOMAIN = 7,
+            /// <summary>
+            /// Invalid function argument
+            /// </summary>
+            VIR_ERR_INVALID_ARG = 8,
+            /// <summary>
+            ///  A command to hypervisor failed
+            /// </summary>
+            VIR_ERR_OPERATION_FAILED = 9,
+            /// <summary>
+            /// A HTTP GET command to failed
+            /// </summary>
+            VIR_ERR_GET_FAILED = 10,
+            /// <summary>
+            /// A HTTP POST command to failed
+            /// </summary>
+            VIR_ERR_POST_FAILED = 11,
+            /// <summary>
+            /// Unexpected HTTP error code
+            /// </summary>
+            VIR_ERR_HTTP_ERROR = 12,
+            /// <summary>
+            /// Failure to serialize an S-Expr
+            /// </summary>
+            VIR_ERR_SEXPR_SERIAL = 13,
+            /// <summary>
+            /// Could not open Xen hypervisor control
+            /// </summary>
+            VIR_ERR_NO_XEN = 14,
+            /// <summary>
+            /// Failure doing an hypervisor call
+            /// </summary>
+            VIR_ERR_XEN_CALL = 15,
+            /// <summary>
+            /// Unknown OS type
+            /// </summary>
+            VIR_ERR_OS_TYPE = 16,
+            /// <summary>
+            /// Missing kernel information
+            /// </summary>
+            VIR_ERR_NO_KERNEL = 17,
+            /// <summary>
+            /// Missing root device information
+            /// </summary>
+            VIR_ERR_NO_ROOT = 18,
+            /// <summary>
+            /// Missing source device information
+            /// </summary>
+            VIR_ERR_NO_SOURCE = 19,
+            /// <summary>
+            /// Missing target device information
+            /// </summary>
+            VIR_ERR_NO_TARGET = 20,
+            /// <summary>
+            /// Missing domain name information
+            /// </summary>
+            VIR_ERR_NO_NAME = 21,
+            /// <summary>
+            /// Missing domain OS information
+            /// </summary>
+            VIR_ERR_NO_OS = 22,
+            /// <summary>
+            /// Missing domain devices information
+            /// </summary>
+            VIR_ERR_NO_DEVICE = 23,
+            /// <summary>
+            /// Could not open Xen Store control
+            /// </summary>
+            VIR_ERR_NO_XENSTORE = 24,
+            /// <summary>
+            /// Too many drivers registered
+            /// </summary>
+            VIR_ERR_DRIVER_FULL = 25,
+            /// <summary>
+            /// Not supported by the drivers (DEPRECATED)
+            /// </summary>
+            VIR_ERR_CALL_FAILED = 26,
+            /// <summary>
+            /// An XML description is not well formed or broken
+            /// </summary>
+            VIR_ERR_XML_ERROR = 27,
+            /// <summary>
+            /// The domain already exist
+            /// </summary>
+            VIR_ERR_DOM_EXIST = 28,
+            /// <summary>
+            /// Operation forbidden on read-only connections
+            /// </summary>
+            VIR_ERR_OPERATION_DENIED = 29,
+            /// <summary>
+            /// Failed to open a conf file
+            /// </summary>
+            VIR_ERR_OPEN_FAILED = 30,
+            /// <summary>
+            /// Failed to read a conf file
+            /// </summary>
+            VIR_ERR_READ_FAILED = 31,
+            /// <summary>
+            /// Failed to parse a conf file
+            /// </summary>
+            VIR_ERR_PARSE_FAILED = 32,
+            /// <summary>
+            /// Failed to parse the syntax of a conf file
+            /// </summary>
+            VIR_ERR_CONF_SYNTAX = 33,
+            /// <summary>
+            /// Failed to write a conf file
+            /// </summary>
+            VIR_ERR_WRITE_FAILED = 34,
+            /// <summary>
+            /// Detail of an XML error
+            /// </summary>
+            VIR_ERR_XML_DETAIL = 35,
+            /// <summary>
+            /// Invalid network object
+            /// </summary>
+            VIR_ERR_INVALID_NETWORK = 36,
+            /// <summary>
+            /// The network already exist
+            /// </summary>
+            VIR_ERR_NETWORK_EXIST = 37,
+            /// <summary>
+            /// General system call failure
+            /// </summary>
+            VIR_ERR_SYSTEM_ERROR = 38,
+            /// <summary>
+            /// Some sort of RPC error
+            /// </summary>
+            VIR_ERR_RPC = 39,
+            /// <summary>
+            /// Error from a GNUTLS call
+            /// </summary>
+            VIR_ERR_GNUTLS_ERROR = 40,
+            /// <summary>
+            /// Failed to start network
+            /// </summary>
+            VIR_WAR_NO_NETWORK = 41,
+            /// <summary>
+            /// Domain not found or unexpectedly disappeared
+            /// </summary>
+            VIR_ERR_NO_DOMAIN = 42,
+            /// <summary>
+            /// Network not found
+            /// </summary>
+            VIR_ERR_NO_NETWORK = 43,
+            /// <summary>
+            /// Invalid MAC address
+            /// </summary>
+            VIR_ERR_INVALID_MAC = 44,
+            /// <summary>
+            /// Authentication failed
+            /// </summary>
+            VIR_ERR_AUTH_FAILED = 45,
+            /// <summary>
+            /// Invalid storage pool object
+            /// </summary>
+            VIR_ERR_INVALID_STORAGE_POOL = 46,
+            /// <summary>
+            /// Invalid storage vol object
+            /// </summary>
+            VIR_ERR_INVALID_STORAGE_VOL = 47,
+            /// <summary>
+            /// Failed to start storage
+            /// </summary>
+            VIR_WAR_NO_STORAGE = 48,
+            /// <summary>
+            /// Storage pool not found
+            /// </summary>
+            VIR_ERR_NO_STORAGE_POOL = 49,
+            /// <summary>
+            /// Storage pool not found
+            /// </summary>
+            VIR_ERR_NO_STORAGE_VOL = 50,
+            /// <summary>
+            /// Failed to start node driver
+            /// </summary>
+            VIR_WAR_NO_NODE = 51,
+            /// <summary>
+            /// Invalid node device object
+            /// </summary>
+            VIR_ERR_INVALID_NODE_DEVICE = 52,
+            /// <summary>
+            /// Node device not found
+            /// </summary>
+            VIR_ERR_NO_NODE_DEVICE = 53,
+            /// <summary>
+            /// Security model not found
+            /// </summary>
+            VIR_ERR_NO_SECURITY_MODEL = 54,
+            /// <summary>
+            /// Operation is not applicable at this time
+            /// </summary>
+            VIR_ERR_OPERATION_INVALID = 55,
+            /// <summary>
+            /// Failed to start interface driver
+            /// </summary>
+            VIR_WAR_NO_INTERFACE = 56,
+            /// <summary>
+            /// Interface driver not running
+            /// </summary>
+            VIR_ERR_NO_INTERFACE = 57,
+            /// <summary>
+            /// Invalid interface object
+            /// </summary>
+            VIR_ERR_INVALID_INTERFACE = 58,
+            /// <summary>
+            /// More than one matching interface found
+            /// </summary>
+            VIR_ERR_MULTIPLE_INTERFACES = 59,
+            /// <summary>
+            /// Failed to start secret storage
+            /// </summary>
+            VIR_WAR_NO_SECRET = 60,
+            /// <summary>
+            /// Invalid secret
+            /// </summary>
+            VIR_ERR_INVALID_SECRET = 61,
+            /// <summary>
+            /// Secret not found
+            /// </summary>
+            VIR_ERR_NO_SECRET = 62,
+            /// <summary>
+            /// Unsupported configuration construct
+            /// </summary>
+            VIR_ERR_CONFIG_UNSUPPORTED = 63,
+            /// <summary>
+            /// Timeout occurred during operation
+            /// </summary>
+            VIR_ERR_OPERATION_TIMEOUT = 64,
+            /// <summary>
+            /// A migration worked, but making the VM persist on the dest host failed
+            /// </summary>
+            VIR_ERR_MIGRATE_PERSIST_FAILED = 65,
+        }
+
+        /// <summary>
+        /// Enumrate types of domain errors
+        /// </summary>
+        public enum virErrorDomain
+        {
+            /// <summary>
+            /// None
+            /// </summary>
+            VIR_FROM_NONE = 0,
+            /// <summary>
+            /// Error at Xen hypervisor layer
+            /// </summary>
+            VIR_FROM_XEN = 1,
+            /// <summary>
+            /// Error at connection with xend daemon
+            /// </summary>
+            VIR_FROM_XEND = 2,
+            /// <summary>
+            /// Error at connection with xen store
+            /// </summary>
+            VIR_FROM_XENSTORE = 3,
+            /// <summary>
+            /// Error in the S-Expression code
+            /// </summary>
+            VIR_FROM_SEXPR = 4,
+            /// <summary>
+            /// Error in the XML code
+            /// </summary>
+            VIR_FROM_XML = 5,
+            /// <summary>
+            /// Error when operating on a domain
+            /// </summary>
+            VIR_FROM_DOM = 6,
+            /// <summary>
+            /// Error in the XML-RPC code
+            /// </summary>
+            VIR_FROM_RPC = 7,
+            /// <summary>
+            /// Error in the proxy code
+            /// </summary>
+            VIR_FROM_PROXY = 8,
+            /// <summary>
+            /// Error in the configuration file handling
+            /// </summary>
+            VIR_FROM_CONF = 9,
+            /// <summary>
+            /// Error at the QEMU daemon
+            /// </summary>
+            VIR_FROM_QEMU = 10,
+            /// <summary>
+            /// Error when operating on a network
+            /// </summary>
+            VIR_FROM_NET = 11,
+            /// <summary>
+            /// Error from test driver
+            /// </summary>
+            VIR_FROM_TEST = 12,
+            /// <summary>
+            /// Error from remote driver
+            /// </summary>
+            VIR_FROM_REMOTE = 13,
+            /// <summary>
+            /// Error from OpenVZ driver
+            /// </summary>
+            VIR_FROM_OPENVZ = 14,
+            /// <summary>
+            /// Error at Xen XM layer
+            /// </summary>
+            VIR_FROM_XENXM = 15,
+            /// <summary>
+            /// Error in the Linux Stats code
+            /// </summary>
+            VIR_FROM_STATS_LINUX = 16,
+            /// <summary>
+            /// Error from Linux Container driver
+            /// </summary>
+            VIR_FROM_LXC = 17,
+            /// <summary>
+            /// Error from storage driver
+            /// </summary>
+            VIR_FROM_STORAGE = 18,
+            /// <summary>
+            /// Error from network config
+            /// </summary>
+            VIR_FROM_NETWORK = 19,
+            /// <summary>
+            /// Error from domain config
+            /// </summary>
+            VIR_FROM_DOMAIN = 20,
+            /// <summary>
+            /// Error at the UML driver
+            /// </summary>
+            VIR_FROM_UML = 21,
+            /// <summary>
+            /// Error from node device monitor
+            /// </summary>
+            VIR_FROM_NODEDEV = 22,
+            /// <summary>
+            /// Error from xen inotify layer
+            /// </summary>
+            VIR_FROM_XEN_INOTIFY = 23,
+            /// <summary>
+            /// Error from security framework
+            /// </summary>
+            VIR_FROM_SECURITY = 24,
+            /// <summary>
+            /// Error from VirtualBox driver
+            /// </summary>
+            VIR_FROM_VBOX = 25,
+            /// <summary>
+            /// Error when operating on an interface
+            /// </summary>
+            VIR_FROM_INTERFACE = 26,
+            /// <summary>
+            /// Error from OpenNebula driver
+            /// </summary>
+            VIR_FROM_ONE = 27,
+            /// <summary>
+            /// Error from ESX driver
+            /// </summary>
+            VIR_FROM_ESX = 28,
+            /// <summary>
+            /// Error from IBM power hypervisor
+            /// </summary>
+            VIR_FROM_PHYP = 29,
+            /// <summary>
+            /// Error from secret storage
+            /// </summary>
+            VIR_FROM_SECRET = 30,
+            /// <summary>
+            /// Error from CPU driver
+            /// </summary>
+            VIR_FROM_CPU = 31,
+            /// <summary>
+            /// Error from XenAPI
+            /// </summary>
+            VIR_FROM_XENAPI	 =	32,
+            /// <summary>
+            /// Error from network filter driver
+            /// </summary>
+            VIR_FROM_NWFILTER	 =	33,
+            /// <summary>
+            /// Error from Synchronous hooks
+            /// </summary>
+            VIR_FROM_HOOK	 =	34,
+            /// <summary>
+            /// Error from domain snapshot
+            /// </summary>
+            VIR_FROM_DOMAIN_SNAPSHOT =	35
+        }
+
+        /// <summary>
+        /// Enumerate the error levels
+        /// </summary>
+        public enum virErrorLevel
+        {
+            /// <summary>
+            /// No error
+            /// </summary>
+            VIR_ERR_NONE = 0,
+            /// <summary>
+            /// A simple warning.
+            /// </summary>
+            VIR_ERR_WARNING = 1,
+            /// <summary>
+            /// An error.
+            /// </summary>
+            VIR_ERR_ERROR = 2,
+        }
+
+        /// <summary>
+        /// the virError object
+        /// </summary>
+        [StructLayout(LayoutKind.Sequential)]
+        public class virError
+        {
+            /// <summary>
+            /// The error code, a virErrorNumber.
+            /// </summary>
+            [MarshalAs(UnmanagedType.I4)]
+            public virErrorNumber code;
+            /// <summary>
+            /// What part of the library raised this error.
+            /// </summary>
+            [MarshalAs(UnmanagedType.I4)]
+            public int domain;
+            /// <summary>
+            /// Human-readable informative error message.
+            /// </summary>
+            [MarshalAs(UnmanagedType.SysInt)]
+#pragma warning disable 649
+            private IntPtr message;
+#pragma warning restore 649
+            /// <summary>
+            /// Human-readable informative error message.
+            /// </summary>
+// ReSharper disable InconsistentNaming
+            public string Message
+// ReSharper restore InconsistentNaming
+            {
+                get { return Marshal.PtrToStringAnsi(message); }
+            }
+
+            /// <summary>
+            /// How consequent is the error.
+            /// </summary>
+            [MarshalAs(UnmanagedType.I4)]
+            public virErrorLevel level;
+            /// <summary>
+            /// Connection if available, deprecated see note above.
+            /// </summary>
+            [MarshalAs(UnmanagedType.SysInt)]
+            public IntPtr conn;
+            /// <summary>
+            /// Domain if available, deprecated see note above.
+            /// </summary>
+            [MarshalAs(UnmanagedType.SysInt)]
+            public IntPtr dom;
+            /// <summary>
+            /// Extra string information.
+            /// </summary>
+            [MarshalAs(UnmanagedType.SysInt)]
+#pragma warning disable 649
+            private IntPtr str1;
+#pragma warning restore 649
+            /// <summary>
+            /// Extra string information.
+            /// </summary>
+// ReSharper disable InconsistentNaming
+            public string Str1 { get { return Marshal.PtrToStringAnsi(str1); } }
+// ReSharper restore InconsistentNaming
+            /// <summary>
+            /// Extra string information.
+            /// </summary>
+            [MarshalAs(UnmanagedType.SysInt)]
+#pragma warning disable 649
+            private IntPtr str2;
+#pragma warning restore 649
+            /// <summary>
+            /// Extra string information.
+            /// </summary>
+// ReSharper disable InconsistentNaming
+            public string Str2 { get { return Marshal.PtrToStringAnsi(str2); } }
+// ReSharper restore InconsistentNaming
+            /// <summary>
+            /// Extra string information.
+            /// </summary>
+            [MarshalAs(UnmanagedType.SysInt)]
+#pragma warning disable 649
+            private IntPtr str3;
+#pragma warning restore 649
+            /// <summary>
+            /// Extra string information.
+            /// </summary>
+// ReSharper disable InconsistentNaming
+            public string Str3 { get { return Marshal.PtrToStringAnsi(str3); } }
+// ReSharper restore InconsistentNaming
+            /// <summary>
+            /// Extra number information.
+            /// </summary>
+            [MarshalAs(UnmanagedType.I4)]
+            public int int1;
+            /// <summary>
+            /// Extra number information.
+            /// </summary>
+            [MarshalAs(UnmanagedType.I4)]
+            public int int2;
+            /// <summary>
+            /// Network if available, deprecated see note above.
+            /// </summary>     
+            [MarshalAs(UnmanagedType.SysInt)]
+            public IntPtr net;
+        }
+
+
+        // virConnCopyLastError - Deprecated
+        // virConnGetLastError - Deprecated
+
+        /// <summary>
+        /// The error object is kept in thread local storage, so separate threads can safely access this concurrently. 
+        /// Reset the last error caught on that connection.
+        /// </summary>
+        /// <param name="conn">
+        /// A <see cref="IntPtr"/> pointer to the hypervisor connection.
+        /// </param>
+        [DllImport("libvirt-0.dll")]
+        public static extern void virConnResetLastError(IntPtr conn);
+
+        /// <summary>
+        /// Set a connection error handling function, if @handler is NULL it will reset to default 
+        /// which is to pass error back to the global library handler.
+        /// </summary>
+        /// <param name="conn">
+        /// A <see cref="IntPtr"/>pointer to the hypervisor connection.
+        /// </param>
+        /// <param name="userData">
+        /// A <see cref="IntPtr"/>pointer to the user data provided in the handler callback.
+        /// </param>
+        /// <param name="handler">
+        /// A <see cref="virErrorFunc"/>function to get called in case of error or NULL
+        /// </param>
+        [DllImport("libvirt-0.dll")]
+        public static extern void virConnSetErrorFunc(IntPtr conn, IntPtr userData, [MarshalAs(UnmanagedType.FunctionPtr)]virErrorFunc handler);
+
+        /// <summary>
+        /// Copy the content of the last error caught at the library level. 
+        /// The error object is kept in thread local storage, so separate threads can safely access this concurrently. 
+        /// One will need to free the result with virResetError().
+        /// </summary>
+        /// <param name="to">
+        /// A <see cref="virError"/> target to receive the copy.
+        /// </param>
+        /// <returns>
+        /// 0 if no error was found and the error code otherwise and -1 in case of parameter error.
+        /// </returns>
+        [DllImport("libvirt-0.dll")]
+        public static extern int virCopyLastError([Out] virError to);
+
+        /// <summary>
+        /// Default routine reporting an error to stderr.
+        /// </summary>
+        /// <param name="err">
+        /// A <see cref="virError"/> pointer to the error.
+        /// </param>
+        [DllImport("libvirt-0.dll")]
+        public static extern void virDefaultErrorFunc([In] virError err);
+
+        /// <summary>
+        /// Resets and frees the given error.
+        /// </summary>
+        /// <param name="err">
+        /// A <see cref="virError"/> error to free.
+        /// </param>
+        [DllImport("libvirt-0.dll")]
+        public static extern void virFreeError(virError err); // Does not work, anybody know why?
+
+        /// <summary>
+        /// Provide a pointer to the last error caught at the library level. 
+        /// The error object is kept in thread local storage, so separate threads can safely access this concurrently.
+        /// </summary>
+        /// <returns>
+        /// A pointer to the last error or NULL if none occurred.
+        /// </returns>
+        [DllImport("libvirt-0.dll")]
+        public static extern int virGetLastError();
+
+        /// <summary>
+        /// Reset the error being pointed to.
+        /// </summary>
+        /// <param name="err">
+        /// A <see cref="virError"/> pointer to the to clean up.
+        /// </param>
+        [DllImport("libvirt-0.dll")]
+        public static extern void virResetError(virError err);
+
+        /// <summary>
+        /// Reset the last error caught at the library level. The error object is kept in thread local storage, 
+        /// so separate threads can safely access this concurrently, only resetting their own error object.
+        /// </summary>
+        [DllImport("libvirt-0.dll")]
+        public static extern void virResetLastError();
+
+        /// <summary>
+        /// Save the last error into a new error object.
+        /// </summary>
+        /// <returns>
+        /// A <see cref="virError"/> pointer to the copied error or NULL if allocation failed. 
+        /// It is the caller's responsibility to free the error with virFreeError().
+        /// </returns>
+        [DllImport("libvirt-0.dll")]
+        public static extern virError virSaveLastError();
+
+        /// <summary>
+        /// Set a library global error handling function, if @handler is NULL, it will reset to default printing on stderr. 
+        /// The error raised there are those for which no handler at the connection level could caught.
+        /// </summary>
+        /// <param name="userData">
+        /// A <see cref="IntPtr"/>pointer to the user data provided in the handler callback.
+        /// </param>
+        /// <param name="handler">
+        /// A <see cref="virErrorFunc"/>function to get called in case of error or NULL.
+        /// </param>
+        [DllImport("libvirt-0.dll")]
+        public static extern void virSetErrorFunc(IntPtr userData, [MarshalAs(UnmanagedType.FunctionPtr)]virErrorFunc handler);
+    }
+}
diff --git a/LibvirtTypes.cs b/LibvirtTypes.cs
new file mode 100644
index 0000000..121c746
--- /dev/null
+++ b/LibvirtTypes.cs
@@ -0,0 +1,725 @@
+﻿/*
+ * Copyright (C)
+ *   Arnaud Champion <arnaud.champion@devatom.fr>
+ *   Jaromír Červenka <cervajz@cervajz.com>
+ *
+ * See COPYING.LIB for the License of this software
+ */
+
+using System;
+using System.Runtime.InteropServices;
+
+namespace LibvirtBindings
+{
+
+    #region delegates
+    ///<summary>
+    /// Callback for receiving file handle events. The callback will be invoked once for each event which is pending.
+    ///</summary>
+    ///<param name="watch">watch on which the event occurred</param>
+    ///<param name="fd">file handle on which the event occurred</param>
+    ///<param name="events">bitset of events from virEventHandleType constants</param>
+    ///<param name="opaque">user data registered with handle</param>
+    [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+    public delegate void virEventHandleCallback(int watch, int fd, int events, IntPtr opaque);
+    ///<summary>
+    /// Free callbacks
+    ///</summary>
+    ///<param name="opaque">user data registered with handle</param>
+    [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+    public delegate void virFreeCallback(IntPtr opaque);
+    ///<summary>
+    /// Part of the EventImpl, this callback Adds a file handle callback to listen for specific events. The same file handle can be registered multiple times provided the requested event sets are non-overlapping If the opaque user data requires free'ing when the handle is unregistered, then a 2nd callback can be supplied for this purpose.
+    ///</summary>
+    ///<param name="fd">file descriptor to listen on</param>
+    ///<param name="events">bitset of events on which to fire the callback</param>
+    ///<param name="cb">the callback to be called when an event occurrs</param>
+    ///<param name="opaque">user data to pass to the callback</param>
+    ///<param name="ff">the callback invoked to free opaque data blob</param>
+    ///<returns>a handle watch number to be used for updating and unregistering for events</returns>
+    [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+    public delegate int virEventAddHandleFunc(int fd, int events, virEventHandleCallback cb, IntPtr opaque, virFreeCallback ff);
+    ///<summary>
+    /// Part of the EventImpl, this user-provided callback is notified when events to listen on change
+    ///</summary>
+    ///<param name="watch">file descriptor watch to modify</param>
+    ///<param name="events">new events to listen on</param>
+    [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+    public delegate void virEventUpdateHandleFunc(int watch, int events);
+    ///<summary>
+    /// Part of the EventImpl, this user-provided callback is notified when an fd is no longer being listened on. If a virEventHandleFreeFunc was supplied when the handle was registered, it will be invoked some time during, or after this function call, when it is safe to release the user data.
+    ///</summary>
+    ///<param name="watch">file descriptor watch to stop listening on</param>
+    [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+    public delegate int virEventRemoveHandleFunc(int watch);
+    ///<summary>
+    /// callback for receiving timer events
+    ///</summary>
+    ///<param name="timer">timer id emitting the event</param>
+    ///<param name="opaque">user data registered with handle</param>
+    [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+    public delegate void virEventTimeoutCallback(int timer, IntPtr opaque);
+    ///<summary>
+    /// Part of the EventImpl, this user-defined callback handles adding an event timeout. If the opaque user data requires free'ing when the handle is unregistered, then a 2nd callback can be supplied for this purpose.
+    ///</summary>
+    ///<param name="timeout">The timeout to monitor</param>
+    ///<param name="cb">the callback to call when timeout has expired</param>
+    ///<param name="opaque">user data to pass to the callback</param>
+    ///<param name="ff">the callback invoked to free opaque data blob</param>
+    /// <returns>A timer value</returns>
+    [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+    public delegate int virEventAddTimeoutFunc(int timeout, virEventTimeoutCallback cb, IntPtr opaque, virFreeCallback ff);
+    ///<summary>
+    /// Part of the EventImpl, this user-defined callback updates an event timeout.
+    ///</summary>
+    ///<param name="timer">the timer to modify</param>
+    ///<param name="timeout">the new timeout value</param>
+    [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+    public delegate void virEventUpdateTimeoutFunc(int timer, int timeout);
+    ///<summary>
+    /// Part of the EventImpl, this user-defined callback removes a timer If a virEventTimeoutFreeFunc was supplied when the handle was registered, it will be invoked some time during, or after this function call, when it is safe to release the user data.
+    ///</summary>
+    ///<param name="timer">the timer to remove</param>
+    /// <returns>0 on success, -1 on failure</returns>
+    [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+    public delegate int virEventRemoveTimeoutFunc(int timer);
+    ///<summary>
+    /// Authentication callback
+    ///</summary>
+    ///<param name="cred">Pointer to a virConnectCredential array</param>
+    ///<param name="ncred">number of virConnectCredential in cred</param>
+    ///<param name="cbdata">user data passed to callback</param>
+    [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+    public delegate int virConnectAuthCallbackPtr([In, Out] IntPtr cred, uint ncred, IntPtr cbdata);
+    #endregion
+
+    #region structs
+    ///<summary>
+    /// Blocks domain statistics
+    ///</summary>
+    [StructLayout(LayoutKind.Sequential)]
+    public struct virDomainBlockStatsStruct
+    {
+        /// <summary>
+        /// Number of read requests.
+        /// </summary>
+        public long rd_req;
+        /// <summary>
+        /// Number of read bytes.
+        /// </summary>
+        public long rd_bytes;
+        /// <summary>
+        /// Number of write requests.
+        /// </summary>
+        public long wr_req;
+        /// <summary>
+        /// Number of written bytes.
+        /// </summary>
+        public long wr_bytes;
+        /// <summary>
+        /// In Xen this returns the mysterious 'oo_req'.
+        /// </summary>
+        public long errs;
+    }
+
+    ///<summary>
+    /// Domain interface statistics
+    ///</summary>
+    [StructLayout(LayoutKind.Sequential)]
+    public struct virDomainInterfaceStatsStruct
+    {
+        ///<summary>
+        /// Bytes received
+        ///</summary>
+        public long rx_bytes;
+        /// <summary>
+        /// Packets received
+        /// </summary>
+        public long rx_packets;
+        /// <summary>
+        /// Errors received
+        /// </summary>
+        public long rx_errs;
+        /// <summary>
+        /// Drops received
+        /// </summary>
+        public long rx_drop;
+        /// <summary>
+        /// Bytes sended
+        /// </summary>
+        public long tx_bytes;
+        /// <summary>
+        /// Packets sended
+        /// </summary>
+        public long tx_packets;
+        /// <summary>
+        /// Errors sended
+        /// </summary>
+        public long tx_errs;
+        /// <summary>
+        /// Drops sended
+        /// </summary>
+        public long tx_drop;
+    }
+
+    ///<summary>
+    /// Structure to handle connection authentication
+    ///</summary>
+    [StructLayout(LayoutKind.Sequential)]
+    public struct virConnectAuth
+    {
+        /// <summary>
+        /// List of supported virConnectCredentialType values, should be a IntPtr to an int array or to a virConnectCredentialType array
+        /// </summary>
+        public IntPtr credtypes;
+        ///<summary>
+        /// Number of virConnectCredentialType in credtypes
+        ///</summary>
+        [MarshalAs(UnmanagedType.I4)]
+        public int ncredtype;
+        ///<summary>
+        /// Callback used to collect credentials, a virConnectAuthCallback delegate in bindings
+        ///</summary>
+        [MarshalAs(UnmanagedType.FunctionPtr)]
+        public virConnectAuthCallbackPtr cb;
+        ///<summary>
+        /// Data transported with callback, should be a IntPtr on what you want
+        ///</summary>
+        public IntPtr cbdata;
+    }
+
+    ///<summary>
+    /// Credential structure
+    ///</summary>
+    [StructLayout(LayoutKind.Sequential, Pack = 4)]
+    public struct virConnectCredential
+    {
+        ///<summary>
+        /// One of virConnectCredentialType constants
+        ///</summary>
+        [MarshalAs(UnmanagedType.I4)]
+        public virConnectCredentialType type;
+        ///<summary>
+        /// Prompt to show to user
+        ///</summary>
+        [MarshalAs(UnmanagedType.LPStr)]
+        public string prompt;
+        ///<summary>
+        /// Additional challenge to show
+        ///</summary>
+        [MarshalAs(UnmanagedType.LPStr)]
+        public string challenge;
+        ///<summary>
+        /// Optional default result
+        ///</summary>
+        [MarshalAs(UnmanagedType.LPStr)]
+        public string defresult;
+        ///<summary>
+        /// Result to be filled with user response (or defresult). An IntPtr to a marshalled allocated string
+        ///</summary>
+        public IntPtr result;
+        ///<summary>
+        /// Length of the result
+        ///</summary>
+        [MarshalAs(UnmanagedType.U4)]
+        public uint resultlen;
+    }
+
+    ///<summary>
+    /// Structure for domain memory statistics
+    ///</summary>
+    [StructLayout(LayoutKind.Sequential)]
+    public struct virDomainMemoryStat
+    {
+        /// <summary>
+        /// Tag
+        /// </summary>
+        [MarshalAs(UnmanagedType.I4)]
+        public virDomainMemoryStatTags tag;
+        /// <summary>
+        /// Value
+        /// </summary>
+        [MarshalAs(UnmanagedType.I8)]
+        public ulong val;
+    }
+
+    ///<summary>
+    /// Structure to handle volume informations
+    ///</summary>
+    [StructLayout(LayoutKind.Sequential)]
+    public struct virStorageVolInfo
+    {
+        /// <summary>
+        /// virStorageVolType flags.
+        /// </summary>
+        [MarshalAs(UnmanagedType.I4)]
+        public virStorageVolType type;
+        /// <summary>
+        /// Logical size bytes.
+        /// </summary>
+        [MarshalAs(UnmanagedType.U8)]
+        public ulong capacity;
+        /// <summary>
+        /// Current allocation bytes.
+        /// </summary>
+        [MarshalAs(UnmanagedType.U8)]
+        public ulong allocation;
+    }
+
+    /// <summary>
+    /// Structure to handle storage pool informations
+    /// </summary>
+    [StructLayout(LayoutKind.Sequential)]
+    public struct virStoragePoolInfo
+    {
+        /// <summary>
+        /// virStoragePoolState flags
+        /// </summary>
+        [MarshalAs(UnmanagedType.I4)]
+        public virStoragePoolState state;
+        /// <summary>
+        /// Logical size bytes
+        /// </summary>
+        [MarshalAs(UnmanagedType.U8)]
+        public ulong capacity;
+        /// <summary>
+        /// Current allocation bytes.
+        /// </summary>
+        [MarshalAs(UnmanagedType.U8)]
+        public ulong allocation;
+        /// <summary>
+        /// Remaining free space bytes.
+        /// </summary>
+        [MarshalAs(UnmanagedType.U8)]
+        public ulong available;
+    }
+
+    /// <summary>
+    /// Structure to handle node informations
+    /// </summary>
+    public struct virNodeInfo
+    {
+        /// <summary>
+        /// String indicating the CPU model.
+        /// </summary>
+        [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)]
+        public string model;
+        /// <summary>
+        /// Memory size in kilobytes
+        /// </summary>
+        public ulong memory;
+        /// <summary>
+        /// The number of active CPUs.
+        /// </summary>
+        public uint cpus;
+        /// <summary>
+        /// Expected CPU frequency.
+        /// </summary>
+        public uint mhz;
+        /// <summary>
+        /// The number of NUMA cell, 1 for uniform mem access.
+        /// </summary>
+        public uint nodes;
+        /// <summary>
+        /// Number of CPU socket per node.
+        /// </summary>
+        public uint sockets;
+        /// <summary>
+        /// Number of core per socket.
+        /// </summary>
+        public uint cores;
+        /// <summary>
+        /// Number of threads per core.
+        /// </summary>
+        public uint threads;
+    }
+    /// <summary>
+    /// Structure tu handle domain informations
+    /// </summary>
+    [StructLayout(LayoutKind.Sequential)]
+    public struct virDomainInfo
+    {
+        /// <summary>
+        /// The running state, one of virDomainState.
+        /// </summary>
+        public virDomainState state;
+        /// <summary>
+        /// The maximum memory in KBytes allowed.
+        /// </summary>
+        public ulong maxMem;
+        /// <summary>
+        /// The memory in KBytes used by the domain.
+        /// </summary>
+        public ulong memory;
+        /// <summary>
+        /// The number of virtual CPUs for the domain.
+        /// </summary>
+        public ushort nrVirtCpu;
+        /// <summary>
+        /// The CPU time used in nanoseconds.
+        /// </summary>
+        public ulong cpuTime;
+    }
+    #endregion
+
+    #region enums
+    ///<summary>
+    /// Type of handles for callback
+    ///</summary>
+    [Flags]
+    public enum virEventHandleType
+    {
+        /// <summary>
+        /// None
+        /// </summary>
+        NONE = 0,
+        /// <summary>
+        /// Readable handle
+        /// </summary>
+        VIR_EVENT_HANDLE_READABLE = 1,
+        /// <summary>
+        /// Writable handle
+        /// </summary>
+        VIR_EVENT_HANDLE_WRITABLE = 2,
+        /// <summary>
+        /// Error handle
+        /// </summary>
+        VIR_EVENT_HANDLE_ERROR = 4,
+        /// <summary>
+        /// Hangup handle
+        /// </summary>
+        VIR_EVENT_HANDLE_HANGUP = 8
+    }
+
+    ///<summary>
+    /// Memory statistics tags
+    ///</summary>
+    [Flags]
+    public enum virDomainMemoryStatTags
+    {
+        /// <summary>
+        ///  The total amount of memory written out to swap space (in kB).
+        /// </summary>
+        VIR_DOMAIN_MEMORY_STAT_SWAP_IN = 0,
+        /// <summary>
+        /// * Page faults occur when a process makes a valid access to virtual memory * that is not available. When servicing the page fault, if disk IO is * required, it is considered a major fault. If not, it is a minor fault. * These are expressed as the number of faults that have occurred. * 
+        /// </summary>
+        VIR_DOMAIN_MEMORY_STAT_SWAP_OUT = 1,
+#pragma warning disable 1591
+        VIR_DOMAIN_MEMORY_STAT_MAJOR_FAULT = 2,
+#pragma warning restore 1591
+        /// <summary>
+        /// * The amount of memory left completely unused by the system. Memory that * is available but used for reclaimable caches should NOT be reported as * free. This value is expressed in kB. * 
+        /// </summary>
+        VIR_DOMAIN_MEMORY_STAT_MINOR_FAULT = 3,
+        /// <summary>
+        /// * The total amount of usable memory as seen by the domain. This value * may be less than the amount of memory assigned to the domain if a * balloon driver is in use or if the guest OS does not initialize all * assigned pages. This value is expressed in kB. * 
+        /// </summary>
+        VIR_DOMAIN_MEMORY_STAT_UNUSED = 4,
+        /// <summary>
+        /// * The number of statistics supported by this version of the interface. * To add new statistics, add them to the enum and increase this value. * 
+        /// </summary>
+        VIR_DOMAIN_MEMORY_STAT_AVAILABLE = 5,
+#pragma warning disable 1591
+        VIR_DOMAIN_MEMORY_STAT_NR = 6
+#pragma warning restore 1591
+    }
+
+    ///<summary>
+    /// Types of storage volume
+    ///</summary>
+    public enum virStorageVolType
+    {
+        /// <summary>
+        /// Regular file based volumes.
+        /// </summary>
+        VIR_STORAGE_VOL_FILE = 0,
+        /// <summary>
+        /// Block based volumes.
+        /// </summary>
+        VIR_STORAGE_VOL_BLOCK = 1
+    }
+
+    /// <summary>
+    /// States of storage pool
+    /// </summary>
+    public enum virStoragePoolState
+    {
+        /// <summary>
+        /// Not running.
+        /// </summary>
+        VIR_STORAGE_POOL_INACTIVE = 0,
+        /// <summary>
+        /// Initializing pool, not available.
+        /// </summary>
+        VIR_STORAGE_POOL_BUILDING = 1,
+        /// <summary>
+        /// Running normally.
+        /// </summary>
+        VIR_STORAGE_POOL_RUNNING = 2,
+        /// <summary>
+        /// Running degraded.
+        /// </summary>
+        VIR_STORAGE_POOL_DEGRADED = 3,
+    }
+    /// <summary>
+    /// Flasg for XML domain rendering
+    /// </summary>
+    [Flags]
+    public enum virDomainXMLFlags
+    {
+        /// <summary>
+        /// Dump security sensitive information too.
+        /// </summary>
+        VIR_DOMAIN_XML_SECURE = 1,
+        /// <summary>
+        /// Dump inactive domain information.
+        /// </summary>
+        VIR_DOMAIN_XML_INACTIVE = 2
+    }
+
+    /// <summary>
+    /// Details on the caused of the 'defined' lifecycle event
+    /// </summary>
+    public enum virDomainEventDefinedDetailType
+    {
+        /// <summary>
+        /// Newly created config file
+        /// </summary>
+        VIR_DOMAIN_EVENT_DEFINED_ADDED = 0,
+        /// <summary>
+        /// Changed config file
+        /// </summary>
+        VIR_DOMAIN_EVENT_DEFINED_UPDATED = 1
+    }
+
+    /// <summary>
+    /// Details on the caused of the 'undefined' lifecycle event
+    /// </summary>
+    public enum virDomainEventUndefinedDetailType
+    {
+        /// <summary>
+        /// Deleted the config file
+        /// </summary>
+        VIR_DOMAIN_EVENT_UNDEFINED_REMOVED = 0
+    }
+    /// <summary>
+    /// Details on the caused of the 'started' lifecycle event
+    /// </summary>
+    public enum virDomainEventStartedDetailType
+    {
+        /// <summary>
+        /// Normal startup from boot
+        /// </summary>
+        VIR_DOMAIN_EVENT_STARTED_BOOTED = 0,
+        /// <summary>
+        /// Incoming migration from another host
+        /// </summary>
+        VIR_DOMAIN_EVENT_STARTED_MIGRATED = 1,
+        /// <summary>
+        /// Restored from a state file
+        /// </summary>
+        VIR_DOMAIN_EVENT_STARTED_RESTORED = 2
+    }
+    /// <summary>
+    /// Details on the caused of the 'suspended' lifecycle event
+    /// </summary>
+    public enum virDomainEventSuspendedDetailType
+    {
+        /// <summary>
+        /// Normal suspend due to admin pause
+        /// </summary>
+        VIR_DOMAIN_EVENT_SUSPENDED_PAUSED = 0,
+        /// <summary>
+        /// Suspended for offline migration
+        /// </summary>
+        VIR_DOMAIN_EVENT_SUSPENDED_MIGRATED = 1
+    }
+    /// <summary>
+    /// Details on the caused of the 'resumed' lifecycle event
+    /// </summary>
+    public enum virDomainEventResumedDetailType
+    {
+        /// <summary>
+        /// Normal resume due to admin unpause
+        /// </summary>
+        VIR_DOMAIN_EVENT_RESUMED_UNPAUSED = 0,
+        /// <summary>
+        /// Resumed for completion of migration
+        /// </summary>
+        VIR_DOMAIN_EVENT_RESUMED_MIGRATED = 1
+    }
+    /// <summary>
+    /// Details on the caused of the 'stopped' lifecycle event
+    /// </summary>
+    public enum virDomainEventStoppedDetailType
+    {
+        /// <summary>
+        /// Normal shutdown
+        /// </summary>
+        VIR_DOMAIN_EVENT_STOPPED_SHUTDOWN = 0,
+        /// <summary>
+        /// Forced poweroff from host
+        /// </summary>
+        VIR_DOMAIN_EVENT_STOPPED_DESTROYED = 1,
+        /// <summary>
+        /// Guest crashed
+        /// </summary>
+        VIR_DOMAIN_EVENT_STOPPED_CRASHED = 2,
+        /// <summary>
+        /// Migrated off to another host
+        /// </summary>
+        VIR_DOMAIN_EVENT_STOPPED_MIGRATED = 3,
+        /// <summary>
+        /// Saved to a state file
+        /// </summary>
+        VIR_DOMAIN_EVENT_STOPPED_SAVED = 4,
+        /// <summary>
+        /// Host emulator/mgmt failed
+        /// </summary>
+        VIR_DOMAIN_EVENT_STOPPED_FAILED = 5
+    }
+
+    /// <summary>
+    /// Types of domain events
+    /// </summary>
+    public enum virDomainEventType
+    {
+        /// <summary>
+        /// Domain defined
+        /// </summary>
+        VIR_DOMAIN_EVENT_DEFINED = 0,
+        /// <summary>
+        /// Domain undefined
+        /// </summary>
+        VIR_DOMAIN_EVENT_UNDEFINED = 1,
+        /// <summary>
+        /// Domain started
+        /// </summary>
+        VIR_DOMAIN_EVENT_STARTED = 2,
+        /// <summary>
+        /// Domain suspended
+        /// </summary>
+        VIR_DOMAIN_EVENT_SUSPENDED = 3,
+        /// <summary>
+        /// Domain resumed
+        /// </summary>
+        VIR_DOMAIN_EVENT_RESUMED = 4,
+        /// <summary>
+        /// Domain stopped
+        /// </summary>
+        VIR_DOMAIN_EVENT_STOPPED = 5
+    }
+
+    /// <summary>
+    /// Flags for storage pool building
+    /// </summary>
+    public enum virStoragePoolBuildFlags
+    {
+        /// <summary>
+        /// Regular build from scratch.
+        /// </summary>
+        VIR_STORAGE_POOL_BUILD_NEW = 0,
+        /// <summary>
+        /// Repair / reinitialize.
+        /// </summary>
+        VIR_STORAGE_POOL_BUILD_REPAIR = 1,
+        /// <summary>
+        /// Extend existing pool.
+        /// </summary>
+        VIR_STORAGE_POOL_BUILD_RESIZE = 2
+    }
+
+    ///<summary>
+    /// Flags for storage pool deletion
+    ///</summary>
+    public enum virStoragePoolDeleteFlags
+    {
+        /// <summary>
+        /// Delete metadata only (fast).
+        /// </summary>
+        VIR_STORAGE_POOL_DELETE_NORMAL = 0,
+        /// <summary>
+        /// Clear all data to zeros (slow).
+        /// </summary>
+        VIR_STORAGE_POOL_DELETE_ZEROED = 1
+    }
+    ///<summary>
+    /// Types of credentials
+    ///</summary>
+    public enum virConnectCredentialType
+    {
+        ///<summary>
+        /// Identity to act as
+        ///</summary>
+        VIR_CRED_USERNAME = 1,
+        ///<summary>
+        /// Identify to authorize as
+        ///</summary>
+        VIR_CRED_AUTHNAME = 2,
+        ///<summary>
+        /// RFC 1766 languages, comma separated
+        ///</summary>
+        VIR_CRED_LANGUAGE = 3,
+        ///<summary>
+        /// client supplies a nonce
+        ///</summary>
+        VIR_CRED_CNONCE = 4,
+        /// <summary>
+        /// Passphrase secret
+        /// </summary>
+        VIR_CRED_PASSPHRASE = 5,
+        /// <summary>
+        /// Challenge response
+        /// </summary>
+        VIR_CRED_ECHOPROMPT = 6,
+        /// <summary>
+        /// Challenge response
+        /// </summary>
+        VIR_CRED_NOECHOPROMPT = 7,
+        /// <summary>
+        /// Authentication realm
+        /// </summary>
+        VIR_CRED_REALM = 8,
+        /// <summary>
+        /// Externally managed credential More may be added - expect the unexpected
+        /// </summary>
+        VIR_CRED_EXTERNAL = 9
+    }
+
+    /// <summary>
+    /// States of a domain
+    /// </summary>
+    public enum virDomainState
+    {
+        /// <summary>
+        /// No state.
+        /// </summary>
+        VIR_DOMAIN_NOSTATE = 0,
+        /// <summary>
+        /// The domain is running.
+        /// </summary>
+        VIR_DOMAIN_RUNNING = 1,
+        /// <summary>
+        /// The domain is blocked on resource.
+        /// </summary>
+        VIR_DOMAIN_BLOCKED = 2,
+        /// <summary>
+        /// The domain is paused by user.
+        /// </summary>
+        VIR_DOMAIN_PAUSED = 3,
+        /// <summary>
+        /// The domain is being shut down.
+        /// </summary>
+        VIR_DOMAIN_SHUTDOWN = 4,
+        /// <summary>
+        /// The domain is shut off.
+        /// </summary>
+        VIR_DOMAIN_SHUTOFF = 5,
+        /// <summary>
+        /// The domain is crashed.
+        /// </summary>
+        VIR_DOMAIN_CRASHED = 6
+    }
+    #endregion
+}
diff --git a/Properties/AssemblyInfo.cs b/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..025692b
--- /dev/null
+++ b/Properties/AssemblyInfo.cs
@@ -0,0 +1,36 @@
+﻿using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// Les informations générales relatives à un assembly dépendent de 
+// l'ensemble d'attributs suivant. Changez les valeurs de ces attributs pour modifier les informations
+// associées à un assembly.
+[assembly: AssemblyTitle("LibvirtBindings")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("Microsoft")]
+[assembly: AssemblyProduct("LibvirtBindings")]
+[assembly: AssemblyCopyright("Copyright © Microsoft 2010")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// L'affectation de la valeur false à ComVisible rend les types invisibles dans cet assembly 
+// aux composants COM. Si vous devez accéder à un type dans cet assembly à partir de 
+// COM, affectez la valeur true à l'attribut ComVisible sur ce type.
+[assembly: ComVisible(false)]
+
+// Le GUID suivant est pour l'ID de la typelib si ce projet est exposé à COM
+[assembly: Guid("16f4aacb-8e02-4c2d-902f-e83f0a7c0570")]
+
+// Les informations de version pour un assembly se composent des quatre valeurs suivantes :
+//
+//      Version principale
+//      Version secondaire 
+//      Numéro de build
+//      Révision
+//
+// Vous pouvez spécifier toutes les valeurs ou indiquer les numéros de build et de révision par défaut 
+// en utilisant '*', comme indiqué ci-dessous :
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
