简体   繁体   English

如何授予对我的 COM+ 应用程序的访问权限?

[英]How do I grant access to my COM+ application?

I've created a COM+ server application and the caller can't access it - when it tries to instantiate a COM object ( CoCreateInstance() ) from that application the following appears in system log:我创建了一个 COM+ 服务器应用程序,但调用者无法访问它 - 当它尝试从该应用程序实例化 COM object ( CoCreateInstance() ) 时,系统日志中会显示以下内容:

The application-specific permission settings do not grant Local Activation permission for the COM Server application with CLSID {class id of COM object here} and APPID {app id of the COM+ application here} to the user MACHINENAME\administrator SID (SID here) from address LocalHost (Using LRPC). The application-specific permission settings do not grant Local Activation permission for the COM Server application with CLSID {class id of COM object here} and APPID {app id of the COM+ application here} to the user MACHINENAME\administrator SID (SID here) from地址 LocalHost(使用 LRPC)。 This security permission can be modified using the Component Services administrative tool.可以使用组件服务管理工具修改此安全权限。

The only way to tweak COM+ access seems to be using roles but the application has "enforce access checks" unchecked so it looks like there should be no restrictions.调整 COM+ 访问的唯一方法似乎是使用角色,但应用程序未选中“强制访问检查”,因此看起来应该没有限制。 Yet the object won't instantiate.然而 object 不会实例化。

How do I allow a certain user access a specific COM+ application so that he can instantiate objects from there?如何允许某个用户访问特定的 COM+ 应用程序,以便他可以从那里实例化对象?

The first thing you should do is check to see if you can create this object outside of the application.您应该做的第一件事是检查您是否可以在应用程序之外创建此 object。 I am using vbscript here;我在这里使用 vbscript;

dim vvv
set vvv= CreateObject ("CoCreateInstance()")

if isnull(vvv) then
            msgbox "null"
else
            msgbox "not null"
end if

If you cannot create the object, then there is probably an issue with the.dll and you might be best served just wiping the component out of the registry and completely reinstalling/reimplementing it.如果您无法创建 object,那么 .dll 可能存在问题,您最好将组件从注册表中擦除并完全重新安装/重新实现它。

If you can create the object, there is an issue with the application accessing the component.如果您可以创建 object,则说明应用程序访问组件时存在问题。 This is usually due to one of the following reasons;这通常是由于以下原因之一;

  1. Component Security settings组件安全设置

    • For the purposes of finding the issue, you are right to uncheck "enforce access checks".为了找到问题,您有权取消选中“强制访问检查”。 Make sure you uncheck the box at both the application (package) level AND the component level.确保取消选中应用程序(包)级别和组件级别的框。
  2. User settings用户设置

    • Check out this link .看看这个链接 In addition to their advice, try adding IUSR_servername as a member of Administrators.除了他们的建议之外,尝试将 IUSR_servername 添加为管理员成员。
  3. Mismatch between Component services and the registry组件服务和注册表不匹配

    • We need to make sure the CLSID's in Component services match the registry.我们需要确保组件服务中的 CLSID 与注册表匹配。 In component services, look for the component (not the application) and look at the properties.在组件服务中,查找组件(而不是应用程序)并查看属性。 If the component is in there, it is definetely registered.如果该组件在那里,则它已明确注册。 While you are here we might as well double check some settings.当您在这里时,我们不妨仔细检查一些设置。 Is the DLL address valid? DLL 地址是否有效? Are security, transactions and activation settings correct?安全、交易和激活设置是否正确? OK, now notice the CLSID in the general tab.好的,现在注意常规选项卡中的 CLSID。 Go into the registry editor and find the CLSID in HKEY_CLASSES_ROOT (it should be there). Go 进入注册表编辑器并在 HKEY_CLASSES_ROOT 中找到 CLSID(它应该在那里)。 Make sure the dll address and the ProgID are correct.确保 dll 地址和 ProgID 正确。 Also verify the key and subkeys are structured in a similar way to your other components.还要验证键和子键的结构与您的其他组件类似。

If none of this works, search the registry for the component's name and wipe it out.如果这些都不起作用,请在注册表中搜索组件的名称并将其清除。 then reinstall.然后重新安装。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何获得com +应用程序的所有com +组件的列表? - How can I get a list of all the com+ components of a com+ application? 我应该选择哪种方法在单独的进程(COM +或DCOM)中托管进程内服务器? - Which do I choose for hosting my in-proc server in a separate process - COM+ or DCOM? 未设置COM +应用程序标识 - COM+ Application Identity is not set 将COM对象导入COM +应用程序,同时保留直接访问COM对象的权限吗? - Import COM object into COM+ application while retaining access to the COM object directly? 如何使用Delphi跟踪COM +事件调用? - How can i track COM+ events call with Delphi? 将COM服务器添加到COM +服务器应用程序后,无法再在过程中实例化它-为什么? - Once I add a COM server into a COM+ server application I can no longer instantiate it in-proc - why? 我如何知道我的 MFC 应用程序是否使用 COM/OLE? - How do I know if my MFC Application use COM / OLE? 获取Identity Windows Com +应用程序? - Get Identity Windows Com+ Application? 我可以设置一个COM +应用程序来创建“一次性”外发服务器吗? - Can I set up a COM+ application to create “single-use” out-proc servers? 是否有任何理由不在COM +应用程序中托管COM服务器? - Are there any reasons not to host a COM server in a COM+ application?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM