locked
Call CeRapiInvoke and Return E_ACCESSDENIED, How to set the System attribute on the *.DLL file indicated by MSDN ? RRS feed

  • Question

  • I have developed a dll which will run as server on the mobile device .  I will call the routines of this dll remotely by calling CeRapiInvoke.

    Though I have signed the dll with privileged certificate installed on the device, CeRapiInvoke retured E_ACCESSDENIED under restricted model.  And I got stuck by this issue. I don't know how to set the System attribute on the *.DLL file indicated by MSDN:

    1. Modify your CAB install to call DMProcessConfigXML. Pass in a setup.xml file to the Metabase Configuration Service Provider that adds the new node "RAPI" to the metabase. This node must include the absolute path to the *.DLL file. For more information, see Metabase Settings. The following code example shows the contents of a typical setup.xml file.
      <wap-provisioningdoc>
        <characteristic type="Metabase">
         <characteristic type="RAPI\Program Files\Green Sky\recaller.dll\*">
         <parm name="rw-access" value="3"/>
         <parm name="access-role" value="152"/> <!-- 152 maps to "CARRIER_TPS | USER_AUTH | MANAGER" -->
         </characteristic>
        </characteristic>
      </wap-provisioningdoc>
    2. Set the System attribute on the *.DLL file.

    And I am not sure this issue will be fixed by going through these steps. Any input on this issue will be highly appreciated !

    Thanks,

    -Alvin Hu

    Sunday, August 8, 2010 3:37 PM

Answers

  • channel 9 has a detailed list of steps: http://channel9.msdn.com/wiki/MobileDeveloper/CeRapiInvoke/

    Set the System attribute on the RapiInvoke DLL file. After the CAB runs and has copied the app DLL over, set the file system attribute. The Setup DLL's after event should be sufficient:

    codeINSTALLINIT InstallExit(hwndParent, pszInstallDir, ....)
    {		  
      // concatentate [pszInstallDir] with the DLL name
      ...
      [SetFileAttributes(lpFileName,] FILE_ATTRIBUTE_SYSTEM);
      ...
    

    -PaulH

    • Marked as answer by Alvin-Hu Tuesday, August 24, 2010 3:53 AM
    Tuesday, August 17, 2010 1:40 PM

All replies

  • Hi Alvin,

    Firstly your steps is right to resolve the issue, please check it.

    If above is not the case, I guess you didn't sign the certificate successfully, if you sign the SDK certificate, do you install it on the device first? Please check it. If this is not the case, please provide more information about your certificate.

    You can also have a test it on WM professional emulator, since its security configuration is low, we can run it without any certificate. If your application run successfully without certificate, which will confirm it is certificate issue.

    Best regards,
    Guang-Ming Bian - MSFT


    Please remember to mark the replies as answers if they help and unmark them if they provide no help
    Tuesday, August 10, 2010 7:46 AM
  • 1. I have installed the certificate used to sign my dll and .cab on the mobile device. The certificate I used is for Window Mobile 6.5, which was downloaded from 

    http://windowsteamblog.com/windows_phone/b/wmdev/archive/2010/01/12/new-windows-mobile-developer-certificates.aspx

    2. The _setup.xml I used was as following:

    <wap-provisioningdoc>
       <characteristic type="Metabase">
          <characteristic type="RAPI\CEInvokeProxy.dll\*">
          <parm name="rw-access" value="3"/>
          <parm name="access-role" value="152"/> <!-- 152 maps to "CARRIER_TPS | USER_AUTH | MANAGER" -->
          </characteristic>
       </characteristic>
    </wap-provisioningdoc>

    I put it into the cab by: cabwiz.exe MyAPP.inf /postxml _setup.xml, then sign it with the certificate. I am going to depoly the dll under the root directory.

    But I don't know how to set the "System" attribute of the dll ?

     

    Friday, August 13, 2010 6:58 AM
  • Hi,

    Can you explain following statement:
    >>I don't know how to set the "System" attribute of the dll ?

     

     

    Best regards,
    Guang-Ming Bian - MSFT


    Please remember to mark the replies as answers if they help and unmark them if they provide no help
    Friday, August 13, 2010 10:49 AM
  • Thanks a lot for your reply !

    "Set the System attribute on the *.DLL file" is the second step demanded by MSDN to enable CeRapiInvoke a function exported by a remote dll.  you can find this sentence at the remark section of the CeRapiInvoke API on MSDN.

    I am confused by the "Set the System attribute on the *.DLL file" and don't know how to achieve that. so I started up this thread.

    Tuesday, August 17, 2010 10:16 AM
  • channel 9 has a detailed list of steps: http://channel9.msdn.com/wiki/MobileDeveloper/CeRapiInvoke/

    Set the System attribute on the RapiInvoke DLL file. After the CAB runs and has copied the app DLL over, set the file system attribute. The Setup DLL's after event should be sufficient:

    codeINSTALLINIT InstallExit(hwndParent, pszInstallDir, ....)
    {		  
      // concatentate [pszInstallDir] with the DLL name
      ...
      [SetFileAttributes(lpFileName,] FILE_ATTRIBUTE_SYSTEM);
      ...
    

    -PaulH

    • Marked as answer by Alvin-Hu Tuesday, August 24, 2010 3:53 AM
    Tuesday, August 17, 2010 1:40 PM
  • Also, here's another forum thread by somebody else who had a similiar problem and what they did to fix it:

    http://social.msdn.microsoft.com/forums/en-US/vssmartdevicesnative/thread/eb38113a-ad31-4792-bb18-71ffc62caa00/

     

    -PaulH

    Tuesday, August 17, 2010 1:41 PM