How do I use DMProcessConfigXML to install my Windows Mobile device?

I want to create a C # program to provision Windows Mobile devices. I found MSDN documentation on the DMProcessConfigXML function , but there are no instructions on how to use this function.

How can I use this feature in my Windows Mobile app? I suspect it has something to do with using pinvoke.

Thanks
Paul

0


source to share


3 answers


From managed code, you can call the ConfigurationManager.ProcessConfiguration found in Microsoft.WindowsMobile.Configuration Namespace. msdn Here's some sample code:

XmlDocument configDoc = new XmlDocument();
configDoc.LoadXml(
    "<wap-provisioningdoc>"+
    "<characteristic type=\"BrowserFavorite\">"+
    "<characteristic type=\"Microsoft\">"+
    "<parm name=\"URL\" value=\"http://www.microsoft.com\"/>"+
    "</characteristic>"+
    "</characteristic>"+
    "</wap-provisioningdoc>"
    );
ConfigurationManager.ProcessConfiguration(configDoc, false);

      



No P / Invoke needed.

+7


source


I looked at MSDN and there really is very little information. I did a google search and found example . Also, this is a blog post about open source CF software.



Most of the examples available are in C ++. If you want to call it from C # you need to use pinvoke. One great resource is pinvoke.net . Here you can find the signatures you need.

+1


source


The answers for what to send to DMProcessConfigXML are on MSDN, but not very easy to understand. You need to look into the Configuration Provider Providers documentation .

Basically you give it XML which will either ask for or set some kind of system parameter and as a result it returns XML to you. There are service providers on the device for pretty much everything. You have to be specific about what you want, then I can point you to the documentation and samples you want.

For example, you can use it to query the registry value

You give it XML:

<wap-provisioningdoc>
   <characteristic type="Registry">
      <characteristic type="HKCU\ControlPanel\Home">
         <parm-query name="Timeout"/>
      </characteristic>
   </characteristic>
</wap-provisioningdoc>

      

The XML output should look something like this:

<wap-provisioningdoc>
   <characteristic type="Registry">
      <characteristic type="HKCU\ControlPanel\Home">
         <parm name="Timeout" value="10000"/>
      </characteristic>
   </characteristic>
</wap-provisioningdoc>

      

This is a simple example, you can do a lot of other things like configuring network settings, configuring mail accounts, etc. etc.

In addition, newer WM versions add more CSPs. For example, WM6.1 adds a Device Encryption Configuration Service Provider to request / enable / disable / disable full device encryption on a WM6.1 device.

Update: I copied the wrong example! DMProcessConfigXml uses OMA Client Provisioning XML, not OMA DM Provisioning XML.

+1


source







All Articles