4157|7

77

帖子

0

TA的资源

一粒金砂(初级)

楼主
 

CeRapiInvoke调用总是返回"无效签名" [复制链接]

调用CeRapiInvoke时总是返回"无效签名"
源代码都ms支持中心的例子,可是它上面没有写用什么环境编译的.
断点提示:        hr        0x80090006 无效签名。         HRESULT

手机端dll代码:(vs2008 VC++ win32智能设备dll)
  1. #include
  2. #include

  3. extern "C"
  4. {
  5.         __declspec(dllexport) int CallMyFunction(DWORD cbInput,
  6.                 BYTE* pInput, DWORD* pcbOutput, BYTE** ppOutput,
  7.                 IRAPIStream* pStream);
  8. }

  9. int CallMyFunction(DWORD cbInput, BYTE* pInput,
  10.                                    DWORD* pcbOutput, BYTE** ppOutput,
  11.                                    IRAPIStream* pStream)
  12. {
  13.         MEMORYSTATUS structMemStatus;
  14.         DWORD dwMemAvailPhys;
  15.         char        szFree[10];
  16.         //Initialize buffer to all NULLs
  17.         ZeroMemory(szFree, 10);
  18.         GlobalMemoryStatus(&structMemStatus);
  19.         dwMemAvailPhys = structMemStatus.dwAvailPhys;
  20.         sprintf(szFree, "%d", dwMemAvailPhys/1024);
  21.         //Provide extra char for NULL
  22.         *ppOutput = (BYTE*)LocalAlloc(LPTR, strlen(szFree)+1);
  23.         if(*ppOutput)
  24.         {
  25.                 //Copy along with NULL
  26.                 strncpy((char*)*ppOutput, szFree, strlen(szFree)+1);
  27.                 *pcbOutput = strlen(szFree) + 1;
  28.         }
  29.         else
  30.                 *pcbOutput = 0;
  31.         return 0;
  32. }
复制代码


调用代码:(vs2008 VC++ win32智能设备控制台)
  1. DWORD        cbOut;
  2.         BYTE*        pOut;
  3.         HRESULT        hr;

  4.         //Initialize Windows CE RAPI
  5.         hr = CeRapiInit();
  6.         //Invoke CallMyFunction routine in MyRapi DLL in the \Windows directory.
  7.         hr = CeRapiInvoke(L"RapiServ", L"CallMyFunction",
  8.                 0, NULL, &cbOut, &pOut, NULL, 0);
  9.         if(cbOut)
  10.                 printf("Your device got %s KB of Physical Memory available", pOut);
  11.         else
  12.                 printf("No memory available in the device");

  13.         //Uninitialize Windows CE RAPI
  14.         hr = CeRapiUninit();
  15.         //Free the DLL allocated memory.
  16.         if(pOut)
  17.                 LocalFree(pOut);
复制代码

最新回复

是在Mobile6帮助文档中 Windows Mobile Powered Device Security Model > Certificate Management in Windows Mobile Powered Devices > Certificate Management and Application Signing for Application Developers > To sign a C or C++ application这一章节中找到  详情 回复 发表于 2010-1-18 16:46
点赞 关注

回复
举报

68

帖子

0

TA的资源

一粒金砂(初级)

沙发
 
自己搞定拉~~~
Go to the project properties under the "Authenticode Signing" and set:

Authenticode signature: Yes
Certificate: TEST USE ONLY - Sample Privileged... (you may have to import it from the SDK dir)
Provision device: Privileged certificate store

Also, please check if your device has RAPI policy enabled (Tools / Device security manager in VS 2008).
 
 

回复

80

帖子

0

TA的资源

一粒金砂(初级)

板凳
 
LZ不错啊,学习
 
 
 

回复

80

帖子

0

TA的资源

一粒金砂(初级)

4
 
这是mobile上的吧?
 
 
 

回复

88

帖子

0

TA的资源

一粒金砂(初级)

5
 
哦,又查了一下,确实应该是mobile上的
================
1.        On the Project menu, click Properties.
2.        Click Authenticode Signing.
3.        For the Authenticode Signature property, click Yes.
4.        For the Certificate property, click the Ellipses (...) button.
In the Select Certificate dialog box, do one of the following:
>> If the certificate you want appears in the list, select it, and then click OK.
>> If the certificate you want does not appear in the list, click Manage Certificates to open the Manage Certificates dialog box. Use this dialog box to import one of the SDK certificates (or import the certificate an OEM or mobile operator gave you as part of its developer program).

Note:  
Be sure to use the *.pfx file, not the *.cer file.  

On the Authenticode Signing page, click OK.
 
 
 

回复

84

帖子

0

TA的资源

一粒金砂(初级)

6
 
引用 4 楼 guopeixin 的回复:
哦,又查了一下,确实应该是mobile上的
================
1. On the Project menu, click Properties.
2. Click Authenticode Signing.
3. For the Authenticode Signature property, click Yes.
4. For the Certificate property, click the Ellipses (...) button.
In the Select Certificate dialog box, do one of the following:
>> If the certificate you want appears in the list, select it, and then click OK.
>> If the certificate you want does not appear in the list, click Manage Certificates to open the Manage Certificates dialog box. Use this dialog box to import one of the SDK certificates (or import the certificate an OEM or mobile operator gave you as part of its developer program).

Note:?
Be sure to use the *.pfx file, not the *.cer file.?

On the Authenticode Signing page, click OK.



你这个在哪里找到的?
 
 
 

回复

49

帖子

0

TA的资源

一粒金砂(初级)

7
 
学习
 
 
 

回复

57

帖子

0

TA的资源

一粒金砂(初级)

8
 
引用 5 楼 cbj6655 的回复:
引用 4 楼 guopeixin 的回复:
哦,又查了一下,确实应该是mobile上的
================
1. On the Project menu, click Properties.
2. Click Authenticode Signing.
3. For the Authenticode Signature property, click Yes.
4. For the Certificate property, click the Ellipses (...) button.
In the Select Certificate dialog box, do one of the following:
>> If the certificate you want appears in the list, select it, and then click OK.
>> If the certificate you want does not appear in the list, click Manage Certificates to open the Manage Certificates dialog box. Use this dialog box to import one of the SDK certificates (or import the certificate an OEM or mobile operator gave you as part of its developer program).

Note:?
Be sure to use the *.pfx file, not the *.cer file.?

On the Authenticode Signing page, click OK.



你这个在哪里找到的?

是在Mobile6帮助文档中
Windows Mobile Powered Device Security Model > Certificate Management in Windows Mobile Powered Devices > Certificate Management and Application Signing for Application Developers > To sign a C or C++ application这一章节中找到
 
 
 

回复
您需要登录后才可以回帖 登录 | 注册

随便看看
查找数据手册?

EEWorld Datasheet 技术支持

相关文章 更多>>
关闭
站长推荐上一条 1/7 下一条

 
EEWorld订阅号

 
EEWorld服务号

 
汽车开发圈

About Us 关于我们 客户服务 联系方式 器件索引 网站地图 最新更新 手机版

站点相关: 国产芯 安防电子 汽车电子 手机便携 工业控制 家用电子 医疗电子 测试测量 网络通信 物联网

北京市海淀区中关村大街18号B座15层1530室 电话:(010)82350740 邮编:100190

电子工程世界版权所有 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号 Copyright © 2005-2025 EEWORLD.com.cn, Inc. All rights reserved
快速回复 返回顶部 返回列表