PRB: System Properties Are Unavailable After You Install the Data Synchronization Update (303934)



The information in this article applies to:

  • Microsoft Windows CE Platform Builder 3.0

This article was previously published under Q303934

Notice

SYMPTOMS

After you install the data synchronization update for Microsoft Windows CE Platform Builder 3.0, you cannot open the System Properties dialog box in a MAXALL-based configuration. Specifically, when you right-click the My Computer icon and then click Properties, nothing happens.

For more information about the data synchronization update, see the "References" section of this article.

CAUSE

There are two important contributors to this problem:
  • Control Panel items are started by Ctlpnl.exe.
  • Active Sync requires that all applications be closed during backup and restore.
First, the items in Control Panel are started by the Ctlpnl.exe executable. The process for loading the standard items (such as Network, Comm, Main, Password, Power, System, Screen, Sounds, Sipcpl and Clock) is to load the specified .cpl file if one is available. If the specified .cpl file is not available, Ctlpnl.exe uses the appropriate item that is included in the Cplmain.cpl file. This mechanism provides an easy way for an OEM to replace the default items: the OEM just writes new ones.

This mechanism is implemented in the Ctlpnl.cpp source file that is located in the following file:

\Wince300\Public\Wceshellfe\Oak\Ctlpnl\Ctlpnl\


Second, the Active Sync Backup and Restore features make sure that no data files are open in a Microsoft Windows CE-based device during a backup or restore operation. This functionality requires a mechanism to close any applications that are running. Closing these applications is done by means of the KillAllApps function. Active Sync looks for this function in the Control Panel item, System.cpl. For this to work, you must have the simple source code file, System.cpl, that is included in the Data Synchronization Update for Windows CE Platform Builder 3.0. The OEM must implement the KillAllApps function in the following file:

\Wince300\Public\Datasync\Oak\Ctlpanel\System\System.c

For more information and to obtain the data synchronization update, see the "References" section.

As a result of these two factors, the standard mechanism in Ctlpnl.exe no longer defaults to using the System Control Panel item in Cplmain.cpl. The Ctlpnl.exe process tries to load the new item in System.cpl that was provided by the data synchronization update. However, this attempt will be unsuccessful because this simple .cpl file has no Control Panel item.

Note You can still access the System item by means of Control Panel. This still works because Control Panel enumerates all items in all .cpl files. Therefore, Control Panel opens the item that is contained in Cplmain.cpl.

RESOLUTION

To resolve this problem, the OEM can use one of the following methods:
  • Method 1: Implement your own Control Panel item in System.cpl.
  • Method 2: Implement a Control Panel item wrapper in System.cpl. This wrapper will redirect to System.cpl in Cplmain.cpl.
  • Method 3: Modify the mechanism in Ctlpnl.exe (mentioned earlier in this article) so that System.cpl is dealt with as a special case, and then load the item in Cplmain.cpl even if a System.cpl file exists on the computer.
  • Method 4: Modify the mechanism in Ctlpnl.exe (mentioned earlier in this article) to also default to the Control Panel item in Cplmain.cpl if the special file (such as System.cpl) exists but does not export the CPlApplet function.

STATUS

This behavior is by design.

MORE INFORMATION

  • Method 1: The System.cpl implementation in Windows CE 3.0 may be a good reference. The implementation of System.cpl can be found in the source file in the following location:

    \Wince300\Public\Wceshellfe\Oak\Ctlpnl\Cplmain\System.cpp

  • Method 2: To see an example of how to load System.cpl in Cplmain.cpl, refer to the code that is referenced by method 3.
  • Method 3: Modify the CplThread function in the source code file that is in the following location:

    \Wince300\Public\Wceshellfe\Oak\Ctlpnl\Ctlpnl\Ctlpnl.cpp

    You can insert the following lines of code before the LoadLibrary (Info.cpl) call.

    Note This code does not work with the original mechanism. An attempt to replace the System item in Control Panel by implementing a new System.cpl does not work on this device.
    // ################################################
    // ### Begin addition DataSync / CPL workaround ###
    
    DEBUGMSG(1, (L"DEBUG OUTPUT: %s, %d, %d\r\n", info.cpl, info.icon, info.iTabIndex));
    
    if (lstrcmpi(info.cpl, L"System.cpl") == 0 )  {
        lstrcpy(info.cpl, L"CPLMAIN.CPL");
        info.icon = 7;
        info.iTabIndex = -1;
        DEBUGMSG(1, (L"DEBUG OUTPUT: %s, %d, %d\r\n", info.cpl, info.icon, info.iTabIndex));
    }
    
    // #### End addition for DataSync / CPL workaround ####
    // ####################################################
    				
  • Method 4: Microsoft recommends this as the preferred resolution. This resolution is described by the documentation that is included in the data synchronization update.

    Modify the CplThread function in the following file:

    \Wince300\Public\wceshellfe\Oak\Ctlpnl\ctlpnl\Ctlpnl.cpp

    As a sample, you can replace this line of code,
    if( !( hinst = LoadLibrary(info.cpl) ) ) {
    with the following code:
    hinst = LoadLibrary(info.cpl);
    if ( !hinst || !GetProcAddress(  (HMODULE)hinst, TEXT("CPlApplet") ) )  {

REFERENCES

For additional information, click the following article number to view the article in the Microsoft Knowledge Base:

301965 Data Synchronization Update for Windows CE Platform Builder 3.0


Modification Type:MinorLast Reviewed:8/18/2005
Keywords:kbprb KB303934 kbAudDeveloper kbAudOEM