Querying Registry Settings by Using the Registry Configuration Service Provider

4/8/2010

You can use the Registry configuration service provider to determine what the current registry settings are on the device. The following examples illustrate how to query the Registry configuration service provider to obtain the current state of a registry setting.

The examples provided can be used as templates to query the Registry configuration service provider. To use an example, you must replace the values as appropriate. To use an OMA DM example, you must also add the node as a child of the SyncBody node in an OMA DM provisioning file. For more information about the syntax of the provisioning file, see OMA DM Provisioning files.

Note

When using OMA DM to add a registry key, a child registry value must also be added in the XML code.

For examples of how to change registry settings using the Registry configuration service provider, see Changing Registry Settings by Using the Registry Configuration Service Provider.

OMA DM Code Example

The following example queries the device for the current value of the home screen TimeOut setting. You use the <Get> element to retrieve the current value of a Registry setting.

<Get>
  <CmdID>1</CmdID>
  <Item>
    <Target>
         <LocURI>./Vendor/MSFT/Registry/HKCU/ControlPanel/Home/Timeout</LocURI>
    </Target>
  </Item>
</Get>

The device will return the following result in response to the query.

Note

This return XML contains a <Data> element which holds the current value of home screen TimeOut setting.

<Results>
  <MsgRef>1</MsgRef>
  <CmdRef>1</CmdRef>
  <CmdID>2</CmdID>
  <Item>
    <Target>
      <LocURI>./Vendor/MSFT/Registry/HKCU/ControlPanel/Home/Timeout</LocURI>
    </Target>
    
    <Data>10000</Data>
  </Item>
</Results>

One provisioning XML file typically contains configuration information for multiple configuration service providers. To use this example, you must replace the values as appropriate, and add the node as a child of the SyncBody node in an OMA DM provisioning file. For more information about the syntax of the provisioning file, see OMA DM Provisioning Files.

OMA Client Provisioning Code Example

The following example queries the device for the home screen TimeOut setting. You use the <parm-query> element to obtain the current value of the setting.

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

The device will return XML similar to the following example.

Note

This return XML contains a <parm> element rather than a <parm-query> element. The current value of home screen TimeOut setting is returned in the Value attribute of the <parm> element.

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

One provisioning XML file typically contains configuration information for multiple configuration service providers. To use this example, you must replace the values as appropriate, and add the node as a child of the SyncBody node in an OMA DM provisioning file. For more information about the syntax of the provisioning file, see OMA DM Provisioning Files.

See Also

Tasks

Registry Configuration Service Provider Examples for OMA Client Provisioning

Reference

Registry Configuration Service Provider

Other Resources

Registry Configuration Service Provider Examples for OMA DM