<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content=text/html;charset=iso-8859-1 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><FONT face=Calibri>Oops, I have made a little mistake that make the example
not compiling. This patch make it works, sorry :S</FONT></DIV>
<DIV style="FONT: 10pt Tahoma">
<DIV><BR></DIV>
<DIV style="BACKGROUND: #f5f5f5">
<DIV style="font-color: black"><B>From:</B> <A title=arnaud.champion@devatom.fr
href="mailto:arnaud.champion@devatom.fr">arnaud.champion@devatom.fr</A> </DIV>
<DIV><B>Sent:</B> Wednesday, October 27, 2010 1:50 PM</DIV>
<DIV><B>To:</B> <A title=libvir-list@redhat.com
href="mailto:libvir-list@redhat.com">libvir-list@redhat.com</A> </DIV>
<DIV><B>Subject:</B> [libvirt] [libvirt-csharp][PATCH] Make examples works on
monocompiled in 64 bits, simply the ConnectOpenAuth process,and finalise
renaming</DIV></DIV></DIV>
<DIV><BR></DIV>
<DIV><FONT face=Calibri>Hi,</FONT></DIV>
<DIV><FONT face=Calibri></FONT> </DIV>
<DIV><FONT face=Calibri>I have finally find the problem with examples on mono
compiled in 64 bits. The problem was the "ToInt32" method of an IntPtr which
failed on mono 64 bits (have to use ToInt64 instead).</FONT></DIV>
<DIV><FONT face=Calibri>This path solve this problem.</FONT></DIV>
<DIV><FONT face=Calibri>Also, I have put marshaling complexity of the
ConnectOpenAuth callback in bindings, this make the callback of ConnectOpenAuth
more simple to achieve the authentification. In the example, the callback is
treated like this :</FONT></DIV>
<DIV><FONT face=Calibri></FONT> </DIV>
<DIV><FONT face=Calibri>private static int AuthCallback(ref ConnectCredential[]
creds, IntPtr cbdata)<BR>
{<BR> AuthData
authData = (AuthData)Marshal.PtrToStructure(cbdata,
typeof(AuthData));<BR>
foreach (ConnectCredential cred in
creds)<BR>
{<BR>
switch
(cred.type)<BR>
{<BR>
case
ConnectCredentialType.VIR_CRED_AUTHNAME:<BR>
// Fill the user
name<BR>
cred.Result =
authData.user_name;<BR>
break;<BR>
case
ConnectCredentialType.VIR_CRED_PASSPHRASE:<BR>
// Fill the
password<BR>
cred.Result =
authData.password;<BR>
break;<BR>
default:<BR>
return
-1;<BR>
}<BR>
}<BR> return
0;<BR> }</FONT></DIV>
<DIV><FONT face=Calibri></FONT> </DIV>
<DIV><FONT face=Calibri>The bindings user has no marshaling to do, and believe
me, it's simpler.</FONT></DIV>
<DIV><FONT face=Calibri></FONT> </DIV>
<DIV><FONT face=Calibri>Finally, this patch finalize renaming.</FONT></DIV>
<DIV><FONT face=Calibri></FONT> </DIV>
<DIV><FONT face=Calibri>Best regards,</FONT></DIV>
<DIV><FONT face=Calibri></FONT> </DIV>
<DIV><FONT face=Calibri>Arnaud Champion</FONT></DIV>
<P>
<HR>
<P></P>--<BR>libvir-list mailing
list<BR>libvir-list@redhat.com<BR>https://www.redhat.com/mailman/listinfo/libvir-list</BODY></HTML>