Re: Selectively disallowing PInvoke
From: Geoff Schwab [MSFT] (a-geosch_at_online.microsoft.com)
Date: 11/17/03
- Next message: Nandakumar Sankaran: "Re: Selectively disallowing PInvoke"
- Previous message: Steven Grayson [MSFT]: "Re: .NET 1.0 and 1.1"
- In reply to: Nandakumar Sankaran: "Selectively disallowing PInvoke"
- Next in thread: Nandakumar Sankaran: "Re: Selectively disallowing PInvoke"
- Reply: Nandakumar Sankaran: "Re: Selectively disallowing PInvoke"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Date: Mon, 17 Nov 2003 11:24:51 -0800
Hi Nandakumar,
I assume you want this control from the managed side of the code. Can you
get enough control by using namespaces combined with internal? I do
something similar in a graphics engine by doing the following...
namespace GXGraphicsLibrary
{
// This is only available internal to GXGraphicsLibrary
internal class GAPI
{
[DllImport("gx.dll", EntryPoint="#1")]
extern public static IntPtr GxBeginDraw();
}
// This is visible to anyone accessing GXGraphicsLibrary
public class Windows
{
[DllImport("coredll.dll")]
extern public static IntPtr GetCapture();
}
}
You should also be able to control each P/Invoke individually using internal
where I have the declarations as public, though I have not tried this...
namespace GXGraphicsLibrary
{
public class Imports
{
// This is only available internal to GXGraphicsLibrary
[DllImport("gx.dll", EntryPoint="#1")]
extern internal static IntPtr GxBeginDraw();
// This is visible to anyone accessing GXGraphicsLibrary
[DllImport("coredll.dll")]
extern public static IntPtr GetCapture();
}
}
-- Geoff Schwab Program Manager Excell Data Corporation http://msdn.com/mobility http://msdn.microsoft.com/mobility/prodtechinfo/devtools/netcf/FAQ/default.aspx This posting is provided "AS IS" with no warranties, and confers no rights. "Nandakumar Sankaran" <Nandakumar@bsquare.com> wrote in message news:uA0k5WwqDHA.2244@TK2MSFTNGP12.phx.gbl... > Hi, I'm wondering if there is a way in a Windows CE.Net environment to > selectively permit managed applications to call into native DLLs (through > PInvoke). In other words, I want to allow certain applications to be able to > call into native DLLs and disallow other apps from doing the same. > > Thanks for any suggestions. > Nandakumar > >
- Next message: Nandakumar Sankaran: "Re: Selectively disallowing PInvoke"
- Previous message: Steven Grayson [MSFT]: "Re: .NET 1.0 and 1.1"
- In reply to: Nandakumar Sankaran: "Selectively disallowing PInvoke"
- Next in thread: Nandakumar Sankaran: "Re: Selectively disallowing PInvoke"
- Reply: Nandakumar Sankaran: "Re: Selectively disallowing PInvoke"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|