Re: [Mono-dev] [PATCH] Adding hooks for BSTR Marshaling

2009-05-28 Thread Bill Holmes
Hi,

I have added and attached the work mentioned in my original dealing
with Marshal.AllocCoTaskMem and  Marshal.AllocHGlobal.

The problem I am trying to solve is the same as before.  Our
application expects to use its own allocator for these calls, not
g_malloc and g_free.

monomarshalhooks5.patch contains all the changes for BSTR, CoTaskMem
and HGlobal, but I will commit the BSTR fix first and then other
allocator changes second.

-bill

2009-05-28  Bill Holmes  

* marshal-hooks.h : Adding declaration for
  mono_install_alloc_hglobal_funcs and 
mono_install_alloc_cotaskmem_funcs.

* marshal.c : Adding mono_install_alloc_hglobal_funcs to override alloc,
  realloc and free functions for HGlobal

* marshal.c : Adding mono_install_alloc_cotaskmem_funcs to override 
alloc,
  realloc and free functions for CoTaskMem

Code is contributed under MIT/X11 license.

On Fri, May 22, 2009 at 12:15 PM, Bill Holmes  wrote:
> Hi,
>
> The attached patch allows hook functions to be registered with mono to
> use when marshaling BSTRs.  I need this functionality because the
> Win32 API emulator we use requires that the encoding is ucs4 and
> another allocator be used.
>
> This patch only correct part of my problem.  If this is approved I
> will be adding similar code for Marshal.AllocCoTaskMem and
> Marshal.AllocHGlobal, which will be a separate commit.
>
> 2009-05-22  Bill Holmes  
>
>        * cominterop.c : mono_string_to_bstr, mono_string_from_bstr and
>          mono_free_bstr changed to call external hooks if installed.
>          mono_install_bstr_funcs added to the set the hooks.
>
>        * marshal-hooks.h : Added to declare mono_install_bstr_funcs
>
>        * Makefile.am : Adding marshal-hooks.h to the list of public API
>          header files.
>
>        Code is contributed under MIT/X11 license.
>
> -bill
>


monocomstring_new4.patch
Description: Binary data


monomarshalhooks5.patch
Description: Binary data
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


[Mono-dev] [PATCH] Adding hooks for BSTR Marshaling

2009-05-22 Thread Bill Holmes
Hi,

The attached patch allows hook functions to be registered with mono to
use when marshaling BSTRs.  I need this functionality because the
Win32 API emulator we use requires that the encoding is ucs4 and
another allocator be used.

This patch only correct part of my problem.  If this is approved I
will be adding similar code for Marshal.AllocCoTaskMem and
Marshal.AllocHGlobal, which will be a separate commit.

2009-05-22  Bill Holmes  

* cominterop.c : mono_string_to_bstr, mono_string_from_bstr and
  mono_free_bstr changed to call external hooks if installed.
  mono_install_bstr_funcs added to the set the hooks.

* marshal-hooks.h : Added to declare mono_install_bstr_funcs

* Makefile.am : Adding marshal-hooks.h to the list of public API
  header files.

Code is contributed under MIT/X11 license.

-bill


monocomstring_new4.patch
Description: Binary data
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list