<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content=text/html;charset=utf-8 http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 9.00.7930.16406"></HEAD>
<BODY style="PADDING-LEFT: 10px; PADDING-RIGHT: 10px; PADDING-TOP: 15px"
id=MailContainerBody leftMargin=0 topMargin=0 CanvasTabStop="true"
name="Compose message area">
<DIV>Hi,</DIV>
<DIV> </DIV>
<DIV><FONT face=Calibri>here are 2 patches for C# libvirt bindings.</FONT></DIV>
<DIV><FONT face=Calibri></FONT> </DIV>
<DIV><FONT face=Calibri>These patches create a new solution/project couple for
Visual Studio 2010 with also a sample code and a solution/project couple for
MonoDevelop with a sample code also.</FONT></DIV>
<DIV><FONT face=Calibri></FONT> </DIV>
<DIV><FONT face=Calibri>The sample code have been tested under .Net/Windows,
Mono/Windows and Mono/Linux. And it works, the sample code consist of the using
au virConnectOpenAuth and callback handling. It connect to a URI (I have made my
tests with ESX hypervisor only) and list domains in a listbox.</FONT></DIV>
<DIV><FONT face=Calibri></FONT> </DIV>
<DIV><FONT face=Calibri>So, to summarize, code work under linux or windows, the
binary library name depends of a project directive (a kind of pragma). When the
directive WINDOWS is declared, DllImport will try to find "libvirt-0.dll" (for
windows) otherwise it looks for "libvirt.so.0" (for linux). For now, in the same
manner, when the directive WINDOWS is declared, we find _strdup in "msvcrt.dll"
otherwise we look in "libc.so.6". </FONT></DIV>
<DIV><FONT face=Calibri></FONT> </DIV>
<DIV><FONT face=Calibri>I'm currently trying to remove strdup call by Custom
Marshaling but it seems that .Net (or Mono anyway) doesn't allow to use custom
marshaler with structure (and we need it for virConnectCredential structure). If
anyone had an idea...</FONT></DIV>
<DIV><FONT face=Calibri></FONT> </DIV>
<DIV><FONT face=Calibri>Arnaud</FONT></DIV></BODY></HTML>