dotgnu-pnet-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Dotgnu-pnet-commits] CVS: pnetlib/runtime/System/Runtime/InteropService


From: Rhys Weatherley <address@hidden>
Subject: [Dotgnu-pnet-commits] CVS: pnetlib/runtime/System/Runtime/InteropServices ICustomAdapter.cs,NONE,1.1 ICustomFactory.cs,NONE,1.1 ICustomMarshaler.cs,NONE,1.1
Date: Thu, 12 Dec 2002 22:45:59 -0500

Update of /cvsroot/dotgnu-pnet/pnetlib/runtime/System/Runtime/InteropServices
In directory 
subversions:/tmp/cvs-serv6803/runtime/System/Runtime/InteropServices

Added Files:
        ICustomAdapter.cs ICustomFactory.cs ICustomMarshaler.cs 
Log Message:


Add some classes to support custom marshaling.


--- NEW FILE ---
/*
 * ICustomAdapter.cs - Implementation of the
 *                      "System.Runtime.InteropServices.ICustomAdapter" class.
 *
 * Copyright (C) 2002  Southern Storm Software, Pty Ltd.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

namespace System.Runtime.InteropServices
{

public interface ICustomAdapter
{

        // Get the underlying object that was wrapped by a custom marshaler.
        Object GetUnderlyingObject();

}; // interface ICustomAdapter

}; // namespace System.Runtime.InteropServices

--- NEW FILE ---
/*
 * ICustomFactory.cs - Implementation of the
 *                      "System.Runtime.InteropServices.ICustomFactory" class.
 *
 * Copyright (C) 2002  Southern Storm Software, Pty Ltd.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

namespace System.Runtime.InteropServices
{

public interface ICustomFactory
{

        // Create a new instance of a "marshal by reference" type.
        MarshalByRefObject CreateInstance(Type serverType);

}; // interface ICustomFactory

}; // namespace System.Runtime.InteropServices

--- NEW FILE ---
/*
 * ICustomMarshaler.cs - Implementation of the
 *                      "System.Runtime.InteropServices.ICustomMarshaler" class.
 *
 * Copyright (C) 2002  Southern Storm Software, Pty Ltd.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

namespace System.Runtime.InteropServices
{

public interface ICustomMarshaler
{

        // Clean up the managed data used by NativeToManaged operation.
        void CleanUpManagedData(Object ManagedObj);

        // Clean up the native data used by ManagedToNative operation.
        void CleanUpNativeData(IntPtr pNativeData);

        // Get the native size of the data to be marshaled.
        int GetNativeDataSize();

        // Marshal a managed object to a native pointer.
        IntPtr MarshalManagedToNative(Object ManagedObj);

        // Marshal a native pointer to a managed object.
        Object MarshalNativeToManaged(IntPtr pNativeData);

        // Classes that implement this interface must also supply the
        // following static method to be called whenever the runtime
        // engine needs to get a custom marshaler of that class:
        //
        // static ICustomMarshaler GetInstance(String cookie);

}; // interface ICustomMarshaler

}; // namespace System.Runtime.InteropServices




reply via email to

[Prev in Thread] Current Thread [Next in Thread]