getting the security configuration of winMobile RRS feed

  • Question

  • Hi, I wanted to know if there is any API to get the Security configuration of the smartphone / PPC (one-tire or two-tire etc.) programmatically. if so, please give me a set of API's used for the same?

    language to use : vc++
    Windows OS     : WinMobile 6
    Friday, January 25, 2008 6:35 AM


  • Hi,

    To my knowledge there is no simple way such as a function you can call which will return the security model as an enum value etc. However you can query for the individual security policies (such as "can execute unsigned code", "prompt for unsigned code" etc) and by comparing which policies are enabled/disabled determine which configuration the current device is using.

    These security policies are directly accessible via the registry. However the documented way to access them is via the SecurityPolicy Configuration Service Provider (CSP) which can be accessed via the DMProcessConfigXML API (documentation available at http://msdn2.microsoft.com/en-us/library/ms852998.aspx with example queries available at http://msdn2.microsoft.com/en-us/library/aa456189.aspx)

    Perhaps the best example of how to do this is actually a C# sample application within the Windows Mobile 5.0 SDK. It is called SecurityViewer and you can find details about it on MSDN at http://msdn2.microsoft.com/en-us/library/ms881533.aspx.

    The method Form1_Load within Form1.cs should hopefully be fairly understandable even if you don't know C# and demonstrates how to use the DMProcessConfigXML API to query for the required security policies and then determine which security model is in use. 

    A list of the different security policies can be found at http://msdn2.microsoft.com/en-us/library/bb416355.aspx

    Hope this helps,
    Christopher Fairbairn
    Friday, January 25, 2008 9:30 AM