如何注册UPnP服务
How to register a UPnP service
我有一个适用于Windows Mobile 6 ARMV4I的Visual Studio 2008 C++项目,我想在其中注册UPnP服务。
我正在使用Windows CE 6 SDK中的Microsoft示例作为UPnP服务的实现。WINCE600\PUBLIC\SERVERS\SDK\SAMPLES\UPNP\DEVICE
不幸的是,RegisterRunningDevice
调用失败,返回错误E_HANDLE。
#include "upnpdevice_i.c"
#import "upnpdevice.dll" named_guids
int main()
{
::CoInitializeEx( NULL, COINIT_MULTITHREADED );
using namespace UPnPHostLib;
IUPnPDeviceControlPtr device_ctrl( CLSID_Device );
IUPnPRegistrarPtr registrar( CLSID_UPnPRegistrar );
bstr_t device_descr = /* contents of the device.xml file from the sample */
// throws a _com_error exception where hr = E_HANDLE
bstr_t device_id = registrar->RegisterRunningDevice( device_descr,
device_ctrl,
L"foo",
L"/windows/upnp",
0 );
/* ... */
::CoUninitialize();
return 0;
}
我看到其他人在我的网络搜索中提到了这个错误,但我没有看到任何结果。
- 我已注册upnpdevice.dll
- 我已经安装了"可选Windows移动服务器组件"upnpctrl、upnphost和httpd
- 可执行文件、upnpdevice.dll、device.xml和service.xml都在
/windows/upnp
目录中
有人有什么建议吗?
我已经解决了。问题是可选的Windows Mobile Server组件没有签名。当device.exe试图在启动时将它们作为流驱动程序加载时,它们被拒绝了。
-PaulH
相关文章:
- Active Directory:从网络服务帐户下运行的Windows服务调用ADsOpenObject时失败
- 检测win32服务创建和删除的最佳方法
- 使用 mod_gsoap 部署服务时,如何在 Gsoap 中更改 soap 上下文的模式?
- 当服务中的事件被触发时,如何将响应从服务发送回客户端?
- gRPC 生成的代码缺少服务实现
- C# DLL 从C++应用程序调用 SOAP Web 服务
- 在 Winrt/C++ 中使用应用服务
- 将第二个 GATT 服务添加到 Movesense 容器
- 从运行服务的应用程序代码中提取窗口句柄
- 对于使用高级服务的分钟数和应付金额,我不断得到相同的数字
- 通过 Tor 服务C++ socket.io 客户端
- 创建服务失败0x6f7存根收到错误数据
- Windows 后台服务(系统配置文件)无法使用 C++ 访问 win 10 上的用户 appData 文件夹?
- 打开 Docker 撰写文件中每个服务的外壳选项卡
- 在 Linux 上C++:在作为 systemd 服务运行时侦听键盘输入
- 在使用 gSoap 链接多个 SOAP 服务时启用保持活动状态
- 如何使用 sd-bus 获取服务的状态?
- 查找蓝牙设备的服务的 uuid
- 如何访问UPnP设备的服务
- 如何注册UPnP服务