GWES Exception with Non-CEPC x86 Platforms (328013)



The information in this article applies to:

  • Microsoft Windows CE .NET 4.1

This article was previously published under Q328013

SYMPTOMS

During startup of an Intel x86-based computer, an exception may occur in the Gwes.exe file.

CAUSE

The location of BOOTARGS parameters is determined by the CEPC bootloader (Loadcepc.exe) to a platform-dependent location in the computer's RAM, specified in the following location:

PLATFORM\$(CPUINDPATH)\FILES\CONFIG.BIB

GWES on the Windows CE .NET version 4.1 for x86 platform has a hard-coded reference to the location of BOOTARGS that is specific to CEPC. For platforms other than CEPC, this behavior may cause GWES to obtain invalid BOOTARGS parameters. Therefore, a fault in GWES occurs during initialization.

RESOLUTION

A supported fix is now available from Microsoft as Windows CE 4.1 Core OS QFE Q328013. To resolve this problem immediately, search for the keyword "QFE" on the following Microsoft Web site: The English version of this package has the file attributes (or later) that are listed in the following table. The dates and times for these files are listed in coordinated universal time (UTC). When you view the file information, it is converted to local time. To find the difference between UTC and local time, use the Time Zone tab in the Date and Time tool in Control Panel.
   Size         File name
   -------------------------------------
   08/30/2002  01:34pm    633,440    020830_armv4i_wce41-q328013.exe    
   08/30/2002  01:34pm    625,248    020830_armv4t_wce41-q328013.exe    
   08/30/2002  01:34pm    629,344    020830_armv4_wce41-q328013.exe    
   08/30/2002  01:34pm    576,096    020830_mips16_wce41-q328013.exe    
   08/30/2002  01:34pm    637,536    020830_mipsii_fp_wce41-q328013.exe    
   08/30/2002  01:34pm    637,536    020830_mipsii_wce41-q328013.exe    
   08/30/2002  01:34pm    645,728    020830_mipsiv_fp_wce41-q328013.exe    
   08/30/2002  01:34pm    645,728    020830_mipsiv_wce41-q328013.exe    
   08/30/2002  01:34pm    608,864    020830_sh3_wce41-q328013.exe    
   08/30/2002  01:34pm    604,768    020830_sh4_wce41-q328013.exe    
   08/30/2002  01:34pm    551,520    020830_x86_wce41-q328013.exe    

				
The English version of this fix has the file attributes (or later) that are listed in the following table:
   Date        Time        Size       File name      Platform
   -------------------------------------------------------------
   08/16/2002  09:45am    745,114    mgbase.lib    armv4\debug
   08/16/2002  09:43am    616,972    mgbase.lib    armv4\retail
   08/16/2002  09:41am    746,760    mgbase.lib    armv4i\debug
   08/16/2002  09:40am    618,682    mgbase.lib    armv4i\retail
   08/16/2002  09:38am    711,108    mgbase.lib    armv4t\debug
   08/16/2002  09:36am    615,644    mgbase.lib    armv4t\retail
   08/16/2002  09:51am    684,578    mgbase.lib    mips16\debug
   08/16/2002  09:50am    524,464    mgbase.lib    mips16\retail
   08/16/2002  09:48am    759,270    mgbase.lib    mipsii\debug
   08/16/2002  09:46am    618,482    mgbase.lib    mipsii\retail
   08/16/2002  09:54am    759,478    mgbase.lib    mipsII_fp\debug
   08/16/2002  09:53am    618,694    mgbase.lib    mipsII_fp\retail
   08/16/2002  10:08am    766,094    mgbase.lib    mipsiv\debug
   08/16/2002  10:06am    622,892    mgbase.lib    mipsiv\retail
   08/16/2002  10:01am    766,302    mgbase.lib    mipsiv_fp\debug
   08/16/2002  09:59am    623,102    mgbase.lib    mipsiv_fp\retail
   08/16/2002  09:58am    679,844    mgbase.lib    sh3\debug
   08/16/2002  09:56am    576,208    mgbase.lib    sh3\retail
   08/16/2002  10:04am    679,844    mgbase.lib    sh4\debug
   08/16/2002  10:03am    575,482    mgbase.lib    sh4\retail
   08/16/2002  09:35am    627,424    mgbase.lib    x86\debug
   08/21/2002  01:20pm    533,352    mgbase.lib    x86\retail
				

MORE INFORMATION

To resolve this issue, implement an optional IOCTL for obtaining the display attributes instead of referencing a private memory area. The IOCTL can then be adapted or not implemented at all for a particular platform.

After you apply this fix, you must implement IOCTL_HAL_QUERY_DISPLAYSETTINGS for the CEPC platform to work correctly, as follows:

FILE: PLATFORM\CEPC\KERNEL\HAL\OEMIOCTL.C
FUNCTION: OEMIoControl

Implement the IOCTL following the initial switch statement, as follows:
    switch (dwIoControlCode) {

/*** BEGIN NEW CODE ***/ 

    case IOCTL_HAL_QUERY_DISPLAYSETTINGS:

        if (lpBytesReturned) {
            *lpBytesReturned = 0;
        }
 
        if (!lpOutBuf) {
            SetLastError(ERROR_INVALID_PARAMETER);
        } else if (sizeof(DWORD)*3 > nOutBufSize) {
            SetLastError(ERROR_INSUFFICIENT_BUFFER);
        } else {
            // Check the boot arg structure for the default display settings.
 
            PBOOT_ARGS args;
 
            args = (PBOOT_ARGS)(*(PBYTE *)BOOT_ARG_PTR_LOCATION);
 
            if (0 != args) {
                args = (PBOOT_ARGS)((DWORD)args | 0x80000000);
 
                __try {
                    if (BOOTARG_SIG == args->dwSig) {
 
                        ((PDWORD)lpOutBuf)[0] = (DWORD)args->cxDisplayScreen;
                        ((PDWORD)lpOutBuf)[1] = (DWORD)args->cyDisplayScreen;
                        ((PDWORD)lpOutBuf)[2] = (DWORD)args->bppScreen;
 
                        if (lpBytesReturned) {
                            *lpBytesReturned = sizeof (DWORD) * 3;
                        }
 
                        return TRUE;
                    }
                } __except (EXCEPTION_EXECUTE_HANDLER) {
                    SetLastError(ERROR_INVALID_PARAMETER);
                }
            }
        }
 
        return FALSE;        

/*** END NEW CODE ***/ 
				
FILE: PUBLIC\COMMON\OAK\INC\PKFUNCS.H

Modify the initial comments to read as follows:
// Kernel IOCTLs based on FILE_DEVICE_HAL -- last ID used is 63.
				
Define the IOCTL as follows:
// IOCTL to query for a default display resolution.
#define IOCTL_HAL_QUERY_DISPLAYSETTINGS CTL_CODE(FILE_DEVICE_HAL, 63, METHOD_BUFFERED, FILE_ANY_ACCESS)
				
The third-party products that are discussed in this article are manufactured by companies that are independent of Microsoft. Microsoft makes no warranty, implied or otherwise, regarding the performance or reliability of these products.

STATUS

Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article.

Modification Type:MinorLast Reviewed:2/2/2006
Keywords:kbbug kbfix kbQFE KB328013