[Mono-dev] mod_mono vs xsp

2005-12-07 Thread Carlos Solorzano
We are going to try switching from XSP to apache/mod_mono hoping to  
get around http://bugzilla.ximian.com/show_bug.cgi?id=76667


Is there anything I should know about mod_mono, how is it different  
from xsp? I am guessing everything will pretty much just work,  
without many changes?


Any comments will be appreciated.

--Carlos
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


[Mono-dev] [PATCH] Bug in X509Chain?

2005-12-07 Thread Vincent Cote-Roy

Hi,

I'm using the Ssl*Stream classes in Mono.Security for a custom tls 
client/server. I want to force the client to supply a cert and have the 
server validate it. From what I can gather, X509Chain will validate a 
certificate if (among other things) it finds its root cert among the 
TrustAnchors list, which is initialized with 
X509StoreManager.TrustedRootCertificates. So before starting the server 
I will add my root CA to this list with 
X509StoreManager.CurrentUser.TrustedRoot.Certificates.Add. But my client 
cert still fails validation with X509ChainStatusFlags.PartialChain. This 
is not supposed to happen, right?


When stepping into the X509Chain.Build method (as called by 
Mono.[bla].Server.TlsClientCertificate.checkCertificateUsage), I noticed 
that when:


_root = FindCertificateRoot (tmp);

is called, tmp is always null. I think that's wrong, no? When I run the 
code again with my patch (see attach.) applied, validation succeeds.



Cheers,

Vincent

Index: X509Chain.cs
===
--- X509Chain.cs(revision 54018)
+++ X509Chain.cs(working copy)
@@ -129,11 +129,9 @@
X509Certificate x = leaf;
X509Certificate tmp = x;
while ((x != null) && (!x.IsSelfSigned)) {
-   tmp = FindCertificateParent (x);
-   if (x != null) {
-   _chain.Add (x);
-   x = tmp;// last valid
-   }
+   tmp = x; // last valid
+   _chain.Add (x);
+   x = FindCertificateParent (x);
}
// find a trusted root
_root = FindCertificateRoot (tmp);
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


[Mono-dev] change console color in Unix

2005-12-07 Thread Anton Andreev

  Hi,

Do you know how can I change console color under Linux using Mono? Using
Mono.Unix?


___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] Calling .NET code from unmanaged C

2005-12-07 Thread Thomas Harning Jr.
A portable option for this is to have your C code compile into a
library and write a C# program that calls into your C library.

In order to give your C program access to C# functions, you would
want to send delegates into the unmanaged code. One option is to
send in all your delegates through registration functions, another
directly through the program startup function, and yet another loads
the delegates into structs.
(Loading them into structs could lead to near-direct object usage by
using a create_() function to load up a struct with function
pointers and accessors).

A short example.. which I've tested:

C# Program:

using System;
using System.Runtime.InteropServices;

class TestApp {
delegate int DoFooDelegate(string foo, int doo);

private int instVar = 0;
public int DoFoo(string foo, int doo) {
instVar += doo;
Console.WriteLine("{0} : {1}", foo, instVar);
return instVar;
}

[DllImport("./test.so")]
static extern int runProgram(DoFooDelegate doFoo);

public static int Main(string[] args)
{
TestApp appInstance = new TestApp();
return appInstance.RunApp();
// Use instance call to ensure DoFoo's delegation is tied to
//the instance... (Is that necessary, or is there a better way?)
}
int RunApp()
{
DoFooDelegate fooDelegate = new DoFooDelegate(DoFoo); // .Net 
1.1
syntax... portability in compilation
return runProgram(fooDelegate);
}
}

 END C#
compile any way..
 C Program/Library

typedef int (*DoFooFPtr)(const char*, int);

int runProgram(DoFooFPtr fPtr)
{
const int bufferSize = 128;
char buffer[bufferSize];
for(int x = 0; x < 20; x++) {
snprintf(buffer, bufferSize, "Bob counts: %i", x);
int ret = fPtr(buffer, x);
printf("Returned ((%i)) from fPtr(\"%s\", %i)\n", ret, buffer, 
x);
}
return 0;
}

 END C Library
Compile with:gcc -std=c99 -fPIC -shared test.c -o test.so

-- 
Thomas Harning Jr.


signature.asc
Description: OpenPGP digital signature
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] gmcs: 'Type.IsGenericInstance' property

2005-12-07 Thread Martin Baulig
On Wed, 2005-12-07 at 12:04 +, george moudry wrote:
> Dear Mono-devel,
> I would like to compile gmcs with Microsoft's DLLs (mscorlib.dll version 
> 2.0).
> (Reason: just downloaded Visual Studio Express, and created a tiny project 
> for gmcs to try both out)
> Compilation fails because gmcs uses a Mono-library-specific property, 
> 'Type.IsGenericInstance'.

Hi,

this is not supported and will not be supported in any near future.

> Two questions:
> 1) what is 'IsGenericInstance' equivalent to - is it .NET2.0 
> Type.IsGenericTypeDefinition, or is it Type.IsGenericType?
> 2) would gmcs accept a patch to replace IsGenericInstance with .NET2.0 
> properties?

No, I would not accept such a patch since it doesn't fix the problem -
there are a lot more issues.  GMCS only works on the Mono runtime.

Martin




___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] Calling .NET code from unmanaged C

2005-12-07 Thread Robert Jordan

Jean Carrive wrote:

I compiled the examples, but at run-time I get this error :
 
The assembly mscorlib.dll was not found or could not be loaded.

It should have been installed in the '/usr/lib/mono/1.0/mscorlib.dll'
directory.

Actually, when I installed Mono as a regular user, it installed itself under
my home directory, and when I installed Mono as root, it installed itself
under /opt/mono/-1.1.10

Did I miss some installation option ?


You have to call

mono_set_dirs ("/opt/mono-1.1.10/lib", "/opt/mono-1.1.10/etc");

before mono_jit_init ().

Robert

___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


RE: [Mono-dev] Calling .NET code from unmanaged C

2005-12-07 Thread Jean Carrive
I compiled the examples, but at run-time I get this error :
 
The assembly mscorlib.dll was not found or could not be loaded.
It should have been installed in the '/usr/lib/mono/1.0/mscorlib.dll'
directory.

Actually, when I installed Mono as a regular user, it installed itself under
my home directory, and when I installed Mono as root, it installed itself
under /opt/mono/-1.1.10

Did I miss some installation option ?

Thanks,
Jean




De : Mikkel Kruse Johnsen [mailto:[EMAIL PROTECTED] 
Envoyé : mercredi 7 décembre 2005 11:42
À : Jean Carrive
Cc : mono-devel-list@lists.ximian.com
Objet : Re: [Mono-dev] Calling .NET code from unmanaged C


On Wed, 2005-12-07 at 11:35 +0100, Jean Carrive wrote: 

Hi, 

I am quite new to mono and maybe my question is very
naive... 

I am looking for a way to call .NET code from "standard" C
code compiled with gcc and runing on Linux. Does Mono offer a way to do that
? I have tried SWIG but it seems that SWIG just allows to call gcc C code
from C#, and not the other way round. 

Best regards, 

Jean Carrive 

___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Hi

Yes it is possible, have a look at
http://www.mono-project.com/Embedding_Mono

/Mikkel 

___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


[Mono-dev] gmcs: 'Type.IsGenericInstance' property

2005-12-07 Thread george moudry

Dear Mono-devel,
I would like to compile gmcs with Microsoft's DLLs (mscorlib.dll version 
2.0).
(Reason: just downloaded Visual Studio Express, and created a tiny project 
for gmcs to try both out)
Compilation fails because gmcs uses a Mono-library-specific property, 
'Type.IsGenericInstance'.


Two questions:
1) what is 'IsGenericInstance' equivalent to - is it .NET2.0 
Type.IsGenericTypeDefinition, or is it Type.IsGenericType?
2) would gmcs accept a patch to replace IsGenericInstance with .NET2.0 
properties?

Thanks,
/george

Notes:
Microsoft's explanation:
Type.IsGenericTypeDefinition Property: Gets a value that indicates whether 
the current Type represents the definition of a generic type, or whether one 
or more of its type parameters has been specified.


Type.IsGenericType Property: Gets a value that indicates whether the current 
type is a generic type.

http://winfx.msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/P_System_Type_IsGenericTypeDefinition.asp

Mono's explanation from 'ChangeLog':
2003-09-25  Martin Baulig  <[EMAIL PROTECTED]>
* Type.cs (Type.IsGenericTypeDefinition): Removed this method
since it was identical to GetGenericTypeDefinition().
(Type.IsGenericInstance): New property.

Nice discussion of Type.IsGenericType vs IsGenericTypeDefinition:
Partho's Weblog http://blogs.msdn.com/parthopdas/archive/category/11155.aspx
(see also the 'references' section in this page)

_
Don’t just search. Find. Check out the new MSN Search! 
http://search.msn.click-url.com/go/onm00200636ave/direct/01/


___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] Calling .NET code from unmanaged C

2005-12-07 Thread Davide Morelli



yes, you can do it embedding mono in your C 
application.
have a look at the /samples/embed folder and its 
examples.
 
ciao,
davide.
 

  - Original Message - 
  From: 
  Jean Carrive 
  To: mono-devel-list@lists.ximian.com 
  
  Sent: Wednesday, December 07, 2005 11:35 
  AM
  Subject: [Mono-dev] Calling .NET code 
  from unmanaged C
  
   
      
  Hi,
   
  I am quite new to 
  mono and maybe my question is very naive...
   
  I am looking for a 
  way to call .NET code from "standard" C code compiled with gcc and runing on 
  Linux. Does Mono offer a way to do that ? I have tried SWIG but it seems that 
  SWIG just allows to call gcc C code from C#, and not the other way 
  round.
   
  Best 
  regards,
  Jean 
  Carrive
  
  

  ___Mono-devel-list 
  mailing 
  listMono-devel-list@lists.ximian.comhttp://lists.ximian.com/mailman/listinfo/mono-devel-list
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] Calling .NET code from unmanaged C

2005-12-07 Thread Mikkel Kruse Johnsen




On Wed, 2005-12-07 at 11:35 +0100, Jean Carrive wrote:

 


    Hi,


 


I am quite new to mono and maybe my question is very naive...


 


I am looking for a way to call .NET code from "standard" C code compiled with gcc and runing on Linux. Does Mono offer a way to do that ? I have tried SWIG but it seems that SWIG just allows to call gcc C code from C#, and not the other way round.


 


Best regards,


Jean Carrive



___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Hi

Yes it is possible, have a look at http://www.mono-project.com/Embedding_Mono

/Mikkel


___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] Calling .NET code from unmanaged C

2005-12-07 Thread Jb Evain

Hello Jean,

On Dec 7, 2005, at 11:35 AM, Jean Carrive wrote:
I am looking for a way to call .NET code from "standard" C code  
compiled with gcc and runing on Linux. Does Mono offer a way to do  
that ? I have tried SWIG but it seems that SWIG just allows to call  
gcc C code from C#, and not the other way round.


You will have to embed Mono:
http://www.mono-project.com/Embedding_Mono

Regards,

Jb

___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


[Mono-dev] Calling .NET code from unmanaged C

2005-12-07 Thread Jean Carrive



 
    
Hi,
 
I am quite new to 
mono and maybe my question is very naive...
 
I am looking for a 
way to call .NET code from "standard" C code compiled with gcc and runing on 
Linux. Does Mono offer a way to do that ? I have tried SWIG but it seems that 
SWIG just allows to call gcc C code from C#, and not the other way 
round.
 
Best 
regards,
Jean 
Carrive
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list