⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ddl.c

📁 此代码为WCE5.0下显示器的源代码
💻 C
📖 第 1 页 / 共 2 页
字号:
//  successfully.
//  Otherwise it is FALSE.
//
{
    HKEY hkGDI = NULL;
    DWORD dwStatus;
    WCHAR aucDoubleByte[256];    

    DDLSbcToDbc(hDDL, pValueName, (LPUCHAR)aucDoubleByte);

    dwStatus = RegOpenKeyEx(HKEY_LOCAL_MACHINE, DRIVER_REGISTRY_STRING,
                                              0, 0, &hkGDI);
    if (dwStatus != ERROR_SUCCESS)
    {
        hkGDI = NULL;
        return FALSE;
    }
    else
    {
        dwStatus = (DWORD)RegSetValueEx(hkGDI, (LPWSTR)aucDoubleByte, 0, REG_NONE,
                                                  (PBYTE)&pValueData, ulValueLength);
        if (dwStatus == ERROR_SUCCESS)
        {
            RegCloseKey(hkGDI);
            return TRUE;
        }
        else
        {
            RegCloseKey(hkGDI);
            return FALSE;
        }
    }
    
}   // DDLGetRegistryParameters()


VOID
DDLEventNotification(
    HDDL hDDL,
    LPEVENTINFO lpEventInfo
    )
//
// DESCRIPTION:
//  DDLEventNotification performs any configuration required by the 
//  display before(after) a mode change occurs.
//
// PARAMETERS:
//  hDDL            Points to the hardware device extension structure.
//                  This parameter is not used by the display abstraction
//                  layer, but is provided as a handle uniquely
//                  identifying the graphics adapter for device dependant
//                  layer.
//  lpEventInfo     Points to a buffer containing event details.
//  
{
    DALDEBUG((DALDBG_ENTRY_EXIT, "DDLEventNotification: *** entry point ***"));

    if (NULL == hDDL)
    {
      DALDEBUG((DALDBG_DETAIL, 
               "DDLEventNotification: NULL hDDL"));
      return;
    }

    if (NULL == lpEventInfo)
    {
      DALDEBUG((DALDBG_DETAIL, 
               "DDLEventNotification: NULL lpEventInfo"));
      return;
    }

    DALDEBUG((DALDBG_DETAIL, "DDLEventNotification: do nothing"));

    DALDEBUG((DALDBG_ENTRY_EXIT, "DDLEventNofification: *** exit ***"));

} // DDLEventNotification()


BOOL FAR DDLMessageCode(HDDL hDDL, ULONG ulDriverId, ULONG ulMessageCode, ULONG ulBufSize, LPVOID pvBuf)
{
    return FALSE;
}


BOOL 
DDLShareModeTable(
    HDDL hDDL, 
    LPVOID lpModeTable, 
    ULONG ulConnectedDisplays
    )
//
// DESCRIPTION:
//  DDLShareModeTable passes the mode table from one instance of DAL into
//  that of another
//
// PARAMETERS:
//  hDDL                Points to the hardware device extension structure.
//                      This parameter is not used by the display abstraction
//                      layer, but is provided as a handle uniquely
//                      identifying the graphics adapter for device dependant
//                      layer.
//  lpModeTable         Points to an DAL mode table, format unknown
//  ulConnectedDisplays Bit vector of displays connected
//
// RETURN VALUE:    
//  The return value is TRUE, unless a failure occurs
// 
// Feb 24, 2K - Alec Ciolac; 
//              This function is used only for Aurora support. For RPD6.11 and M6.11 it should simply return FALSE 
{
    return FALSE;
}


ULONG
DDLGetDriverOptions(
    HDDL hDDL
    )
{
    ULONG ulSize;
    ULONG ulData;
    ULONG ulDriverOptions = 0;

    // needs be initialized before each call to DDL to read from the registry
    ulSize = sizeof(ULONG);
    ulData = 0;

    if ((DDLGetRegistryParameters(hDDL,
                                  (LPUCHAR) DDLREGOPTION_ALWAYSSETOPTIMUM,
                                  (LPVOID) &ulData,
                                  (LPULONG) &ulSize)) &&
        (ulSize == sizeof(ULONG)) &&
        (ulData == 1))
    {
        // Flag the driver options to apply the patch
        ulDriverOptions |= RPRO_DRIVER_OPTIONS_16BPP_555;
    }

    // needs be initialized before each call to DDL to read from the registry
    ulSize = sizeof(ULONG);
    ulData = 0;

    if ((DDLGetRegistryParameters(hDDL,
                                  (LPUCHAR) DDLREGOPTION_PATCHLCDSYNCPROBLEM,
                                  (LPVOID) &ulData,
                                  (LPULONG) &ulSize)) &&
        (ulSize == sizeof(ULONG)) &&
        (ulData == 1))
    {
        // Flag the driver options to apply the patch
        ulDriverOptions |= RPRO_PATCH_FOR_LCD_SYNC_PROBLEM;
    }

    // needs be initialized before each call to DDL to read from the registry
    ulSize = sizeof(ULONG);
    ulData = 0;

    if ((DDLGetRegistryParameters(hDDL,
                                  (LPUCHAR) DDLREGOPTION_PLLPROBLEMNBLANKDELAY,
                                  (LPVOID) &ulData,
                                  (LPULONG) &ulSize)) &&
        (ulSize == sizeof(ULONG)) &&
        (ulData == 1))
    {
        // Flag the driver options to apply the patch
        ulDriverOptions |= PLL_PROBLEM_N_BLANK_DELAY;
    }

    // needs be initialized before each call to DDL to read from the registry
    ulSize = sizeof(ULONG);
    ulData = 0;

    if ((DDLGetRegistryParameters(hDDL,
                                  (LPUCHAR) szDDLREGOPTIONLT_USENONEXTPLL4PRIMARY,
                                  (LPVOID) &ulData,
                                  (LPULONG) &ulSize)) &&
        (ulSize == sizeof(ULONG)) &&
        (ulData == 1))
    {
        // This flag applies only to LT-Pro ASICs [cdsouza]
        if (0)
        {
        // Flag the driver options to apply the patch
        ulDriverOptions |= LT_USE_NON_EXT_PLL_4PRIMARY;
        }
    }

    return (ulDriverOptions);

} // DDLGetDriverOptions()


VOID FAR
DDLGetAdapterID(
    HDDL hDDL,
    LPCHAR lpcDriverID
    )
//
// DESCRIPTION:
//  Fills in the current Adapter ID.
//
// PARAMETERS:
//  hDDL                Points to the hardware device extension structure.
//  lpcDriverID         Pointer to the Device ID string (to be filled).
//
{
    memcpy((LPVOID)lpcDriverID, (LPVOID)DDL_ADAPTERID, sizeof (DDL_ADAPTERID));

}   // DDLGetAdapterID


BOOL FAR
DDLGetMonitorInfo(
    HDDL hDDL,
    LPMONITOR_INFO lpMonitorInfo
    )
//
// DESCRIPTION:
//  DDLGetMonitorInfo retrieves registry info for monitor limitations.
//
// PARAMETERS:
//  hDDL            Points to the hardware device extension structure.
//                  This parameter is not used by the display abstraction
//                  layer, but is provided as a handle uniquely
//                  identifying the graphics adapter for device dependant
//                  layer.
//  lpMonitorInfo   Points to a buffer containing monitor-specific parameters.
//
// RETURN VALUE:
//  The return value is TRUE if ALL data was read from the registry successfully.
//  Otherwise it is FALSE.
//
{
    DALDEBUG((DALDBG_ENTRY_EXIT, "DDLGetMonitorInfo: *** entry point ***"));

    // we return false all the time because we either rely on the OS monitor
    // info or we rely on DDC.
    DALDEBUG((DALDBG_ENTRY_EXIT, "DDLGetMonitorInfo: *** exit fail ***"));

    return FALSE;
}   // DDLGetMonitorInfo()


ULONG FAR
DDLGetRegistryPathName(
    HDDL hDDL,
    LPUCHAR lpPathName
    )
//
// DESCRIPTION:
//  DDLGetRegistryPathName retrieves the path in which we store our ATI-apecific
//  registry settings.
//
// PARAMETERS:
//  hDDL            Points to the hardware device extension structure.
//                  This parameter is not used by the display abstraction
//                  layer, but is provided as a handle uniquely
//                  identifying the graphics adapter for device dependant
//                  layer.
//  lpPathName      Points to a buffer containing the registry path.
//
// RETURN VALUE:
//  The return value is the size of the registry path string.
//
{
    lpPathName = (LPVOID)DRIVER_REGISTRY_STRING;

    return sizeof(DRIVER_REGISTRY_STRING);
}   // DDLGetRegistryPathName()


VOID FAR
DDLRegisterAND(
    HDDL hDDL,
    ULONG ulOffset,
    ULONG ulMask
    )
//
// DESCRIPTION:
//  Function performs an atomic register AND to enable bits.  This operation
//  must be atomic!
//
// PARAMETERS:
//  hDDL                Points to the hardware device extension structure.
//
// RETURN VALUE:
//  Reference frequency.
//
{     // to do - fix for ce
    ULONG_PTR ulAddr = 0;

    ulAddr = (ULONG_PTR)((LPULONG)pHwDeviceExtension[gdwMMIndex]->pvAuxBaseAddress + ulOffset);

    *((DWORD *) ulAddr) &= ulMask;

} // DDLRegisterAND()


VOID FAR
DDLRegisterOR(
    HDDL hDDL,
    ULONG ulOffset,
    ULONG ulMask
    )
//
// DESCRIPTION:
//  function performs an atomic register or
//
// PARAMETERS:
//  hDDL                Points to the hardware device extension structure.
//
// RETURN VALUE:
//  Reference frequency.
//
{      // to do - fix for ce
    ULONG_PTR ulAddr = 0;

    ulAddr = (ULONG_PTR)((LPULONG)pHwDeviceExtension[gdwMMIndex]->pvAuxBaseAddress + ulOffset);

    *((DWORD *) ulAddr) |= ulMask;

} // DDLRegisterOR()


BOOL
DDLBiosInt10(
    HDDL hDDL,
    PVIDEO_X86_BIOS_ARGUMENTS pBiosArguments
    )
//
// DESCRIPTION:
//  DDLBiosInt10 performs the equivalent of an MS-DOS INT10 operation,
//  such as setting the video mode.  DDLBiosInt10 runs the BIOS ROM code
//  on the device.
//
// PARAMETERS:
//  hDDL            Points to the hardware device extension structure.
//                  This parameter is not used by the display abstraction
//                  layer, but is provided as a handle uniquely identifying
//                  the graphics adapter for device dependant layer.
//  BiosArguments   Structure containing values for the x86
//                  registers that should be set before making the BIOS call.
//                  The caller will set any unsued registers to zero.  All
//                  values set up in the VIDEO_Z86_BIOS_ARGUMENTS structure are
//                  interpreted as immediate values.
//
// RETURN VALUE:
//  The return value is true if the function executed successfully.
//  Otherwise it is false.
//
{     // to do - fix
    DWORD vpStatus;   // System calls return value
    // Valid only for VGA-enabled adapters.
    vpStatus = 0;

    if (NO_ERROR == vpStatus)
    {
        return TRUE;
    }
    else
    {
        return FALSE;
    }

}   // DDLBiosInt10()



⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -