代理/存根是否公开接口? [英] Does proxy/stub expose the interface?

查看:98
本文介绍了代理/存根是否公开接口?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设我我需要实现IMarshal或提供一个typelib或提供一个代理/存根.

Suppose I introduced a COM interface and don't want any third party to use it. I have full control over the sources of the COM component and the IDL file that holds the interface definition. My COM component will need marshalling stuff fro that interface, so I'll need to either implement IMarshal or provide a typelib or provide a proxy/stub.

很明显,如果我提供了一个typelib,那么任何人都可以检查它,并找到我的接口以及如何使用它.那不是我想要的.

Obviously if I provide a typelib anyone can inspect it and find what my interface is and how it can be used. That's not what I want.

如果我使用代理/存根怎么办?它会公开该界面并让任何人对其进行检查吗?还是会保留该界面的详细信息?

What if I use proxy/stub? Will it expose the interface and let anyone inspect it or will it keep the interface details covert?

推荐答案

不幸的是,这是不可能的. COM的想法是,客户端可以发现组件和接口.

Unfortunately this is not possible. The idea of COM is that clients can discover the components and the interfaces.

在上一份工作中,我从事具有数字版权保护功能的应用程序的工作,在那儿我们故意不使用COM只是为了使人们更难以使用我们的应用程序.我们必须构建自己的组件基础结构(除了其他安全措施之外).

In a previous job I worked on a digital rights equipped application and there we deliberately did NOT use COM just to make it more difficult for people to tap into our application. We had to build our own component infrastructure (in addition to other security measures).

这篇关于代理/存根是否公开接口?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆