亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? atamain.cpp

?? WinCE5.0BSP for Renesas SH7770
?? CPP
?? 第 1 頁 / 共 3 頁
字號:
            "Atapi!GetDSKRegistryValueSet> Bad value(%d) for %s in DSK instance key; valid: {0, 1}\r\n"
            ), pDskReg->dwWriteCache, REG_VAL_DSK_WRITECACHE));
        return FALSE;
    }

    // fetch look-ahead boolean
    fRet = AtaGetRegistryValue(hDSKInstanceKey, REG_VAL_DSK_LOOKAHEAD, &pDskReg->dwLookAhead);
    if (!fRet) {
        DEBUGMSG(ZONE_INIT|ZONE_ERROR, (_T(
            "Atapi!GetDSKRegistryValueSet> Failed to read %s from DSK instance key\r\n"
            ), REG_VAL_DSK_LOOKAHEAD));
        return FALSE;
    }
    if (pDskReg->dwLookAhead >= 2) {
        DEBUGMSG(ZONE_INIT|ZONE_ERROR, (_T(
            "Atapi!GetDSKRegistryValueSet> Bad value(%d) for %s in DSK instance key; valid: {0, 1}\r\n"
            ), pDskReg->dwLookAhead, REG_VAL_DSK_LOOKAHEAD));
        return FALSE;
    }

    // fetch transfer mode
    fRet = AtaGetRegistryValue(hDSKInstanceKey, REG_VAL_DSK_TRANSFERMODE, &pDskReg->dwTransferMode);
    if (!fRet) {
        DEBUGMSG(ZONE_INIT|ZONE_ERROR, (_T(
            "Atapi!GetDSKRegistryValueSet> Failed to read %s from DSK instance key\r\n"
            ), REG_VAL_DSK_TRANSFERMODE));
        return FALSE;
    }

    return TRUE;
}

// This function reads the I/O window data from the IDE instance key and builds
// the I/O ports for the primary and secondary IDE controller channels
BOOL
GetIoPort(
    HKEY hDevKey,
    PTSTR szDevKey,
    CIDEBUS *pBus
    )
{
    BOOL fRet = FALSE;

    DEBUGCHK(pBus);
    DEBUGCHK(pBus->m_pPrimaryPort);

    // TODO: What if the IDE/ATA controller only supports a single device on
    // TODO: (con't) a single channel and bus mastering?

    // save the base virtual addresss of the device control (RegBase)
    // and alternate status (RegAlt) I/O windows

	pBus->m_pPrimaryPort->m_dwRegBase = (DWORD)MapAddress(ATAPI_REGBASE, ATAPI_REGSIZE);
	pBus->m_pPrimaryPort->m_dwRegAlt  = pBus->m_pPrimaryPort->m_dwRegBase;
	pBus->m_pPrimaryPort->m_dwAtapiControl = pBus->m_pPrimaryPort->m_dwRegBase;
	pBus->m_pPrimaryPort->m_dwAtapiBuffer = (DWORD)MapAddress(ATAPI_BUFFER_BASE, ATAPI_BUFFER_SIZE);

    pBus->m_pPrimaryPort->m_fInitialized = TRUE;

    fRet = TRUE;

    return fRet;
}

// IDE/ATA and ATA/ATAPI device stream interface

/*++

DSK_Init
    This function is called as a result of IDE_Init calling ActivateDevice on
    HKLM\Drivers\@BUS\@IDEAdapter\DeviceX, to initialize a master or slave
    device on a particular IDE/ATA channel of a particular IDE/ATA controller.
    That is, an "IDE" driver is a bus driver for devices to one its IDE/ATA
    controller's channels.

    This function is responsible for creating a CDisk instance to associate
    with a device.  This function reads the "Object" value from its instance
    key to determine which CDisk (sub)type to instantiate and calls Init on the
    CDisk instance to initialize the device.  If the device is not present, then
    Init will fail.  The "Object" value maps to a function that creates an
    instance of the target CDisk (sub)type.

    Note that this driver model is convoluted.  A CDisk (sub)type instance
    corresponds to both an IDE/ATA controller and an ATA/ATAPI device.

Parameters:
    dwContext - pointer to string containing the registry path to the active key
    of the associated device; the active key contains a key to the device's instance
    key, which stores all of the device's configuration information

Return:
    On success, return handle to device (to identify device); this handle is
    passed to all subsequent DSK_Xxx calls.  Otherwise, return null.

--*/

#define DSKINIT_UNDO_CLS_KEY_ACTIVE 0x1
#define DSKINIT_UNDO_CLS_KEY_DEVICE 0x2

EXTERN_C
DWORD
DSK_Init(
    DWORD dwContext
    )
{
    DWORD dwUndo = 0;                     // undo bitset

    PTSTR szActiveKey = (PTSTR)dwContext; // name of device's active key
    HKEY hActiveKey;                      // handle to device's active key
    PTSTR szDevKey = NULL;                // name of device's instance key
    HKEY hDevKey;                         // handle to device's instance key

    POBJECTFUNCTION pObject = NULL;       // pointer to spawn function

    CPort *pPort = NULL;                  // port
    DWORD dwDeviceId = 0;                 // device ID; 0 => master, 1 => slave

    CDisk *pDisk = NULL;                  // return

    // guard global data; i.e., g_pDiskRoot

    EnterCriticalSection(&g_csMain);

    // open device's active key

    if ((ERROR_SUCCESS != RegOpenKeyEx(HKEY_LOCAL_MACHINE, szActiveKey, 0, 0, &hActiveKey))) {
        DEBUGMSG(ZONE_INIT|ZONE_ERROR, (_T(
            "Atapi!DSK_Init> Failed to open device's active key(%s)\r\n"
            ), szActiveKey));
        goto exit;
    }
    dwUndo |= DSKINIT_UNDO_CLS_KEY_ACTIVE;
    DUMPREGKEY(ZONE_INIT, szActiveKey, hActiveKey);

    // read name of and open device's instance key from device's active key

    if (!(hDevKey = AtaLoadRegKey(hActiveKey, &szDevKey))) {
        DEBUGMSG(ZONE_INIT|ZONE_ERROR, (_T(
            "Atapi!DSK_Init> Failed to fetch/open device's instance key from device's active key(%s)\r\n"
            ), szActiveKey));
        goto exit;
    }
    dwUndo |= DSKINIT_UNDO_CLS_KEY_DEVICE;
    DUMPREGKEY(ZONE_INIT, szDevKey, hDevKey);

    // fetch heap address of port instance from device's instance key

    if (!AtaGetRegistryValue(hDevKey, REG_VALUE_PORT, (PDWORD)&pPort)) {
        DEBUGMSG(ZONE_INIT|ZONE_ERROR, (_T(
            "Atapi!DSK_Init> Failed to read address of port instance from device's instance key(%s)\r\n"
            ), szDevKey));
        goto exit;
    }

    // fetch device ID from device's instance key; this informs the CDisk
    // instance as to which device (i.e., master/slave) it is

    if (!AtaGetRegistryValue(hDevKey, REG_VAL_DSK_DEVICEID, &dwDeviceId)) {
        DEBUGMSG(ZONE_INIT|ZONE_ERROR, (_T(
            "Atapi!DSK_Init> Failed to read device ID device's instance key(%s)\r\n"
            ), szDevKey));
        goto exit;
    }

    // resolve address of spawn function

    pObject = (POBJECTFUNCTION)GetProcAddress(g_hInstance, pPort->m_pController->m_pIdeReg->pszSpawnFunction);
    if (!pObject) {
        DEBUGMSG(ZONE_INIT|ZONE_ERROR, (_T(
            "Atapi!DSK_Init> Failed to resolve address of device's spawn function(%s)\r\n"
            ), pPort->m_pController->m_pIdeReg->pszSpawnFunction));
        goto exit;
    }

    // instantiate CDisk object

    pDisk = pObject(hDevKey);

    // if successful, write the name of the device's active and instance keys to
    // its CDisk instance, and add the CDisk instance to the IDE/ATA bus driver's
    // list of active disk devices

    if (pDisk) {

        // this information is used for ATA/ATAPI power management

        pDisk->SetActiveKey(szActiveKey);
        pDisk->SetDeviceKey(szDevKey);

        // inform the CDisk instance as to which device it is

        pDisk->m_pPort = pPort;
        pDisk->m_dwDeviceId = dwDeviceId;
        pDisk->m_dwDevice = dwDeviceId;

        // configure register block

        pDisk->ConfigureRegisterBlock(pPort->m_pController->m_pIdeReg->dwRegisterStride);

        // initialize device

        if (!pDisk->Init(hActiveKey)) {
            delete pDisk;
            pDisk = NULL;
            goto exit;
        }

        // add CDisk instance to IDE/ATA controller's list of active devices

        pDisk->m_pNextDisk = g_pDiskRoot;
        g_pDiskRoot = pDisk;

        DEBUGMSG(ZONE_INIT, (_T(
            "Atapi!DSK_Init> Initialized %s %s on %s\r\n"
            ), ((pPort == pPort->m_pController->m_pPrimaryPort) ? (_T("PRIMARY")) : (_T("SECONDARY"))),
               ((dwDeviceId == 0) ? (_T("MASTER")) : (_T("SLAVE"))),
               szDevKey
            ));
    }

exit:;

    // clean up
    if (NULL == pDisk) {
        if (dwUndo & DSKINIT_UNDO_CLS_KEY_ACTIVE) {
            RegCloseKey(hActiveKey);
        }
        if (dwUndo & DSKINIT_UNDO_CLS_KEY_DEVICE) {
            RegCloseKey(hDevKey);
        }
        // pPort is deleted in IDE_Deinit
    }
    if (szDevKey) {
        LocalFree(szDevKey);
    }

    LeaveCriticalSection(&g_csMain);

    return (DWORD)pDisk;
}

/*++

DSK_Deinit
    This function deallocates the associated CDisk instance.

Parameters:
    dwHandle - pointer to associated CDisk instance (initially returned by
    DSK_Init)

Return:
    This function always succeeds.

--*/
EXTERN_C
BOOL
DSK_Deinit(
    DWORD dwHandle
    )
{
    CDisk *pDiskPrev = NULL;
    CDisk *pDiskCur = g_pDiskRoot;

    EnterCriticalSection(&g_csMain);

    // find the CDisk instance in global CDisk list

    while (pDiskCur) {
        if (pDiskCur == (CDisk *)dwHandle) {
            break;
        }
        pDiskPrev = pDiskCur;
        pDiskCur = pDiskCur->m_pNextDisk;
    }

    // remove CDisk instance from global CDisk list

    if (pDiskCur) {
        if (pDiskPrev) {
            pDiskPrev = pDiskCur->m_pNextDisk;
        }
        else {
            g_pDiskRoot = pDiskCur->m_pNextDisk;
        }
        delete pDiskCur;
    }

    LeaveCriticalSection(&g_csMain);

    return TRUE;
}

/*++

DSK_Open
    This function opens a CDisk instance for use.

Parameters:
    dwHandle - pointer to associated CDisk instance (initially returned by
    DSK_Init)
    dwAccess - specifes how the caller would like too use the device (read
    and/or write) [this argument is ignored]
    dwShareMode - specifies how the caller would like this device to be shared
    [this argument is ignored]

Return:
    On success, return handle to "open" CDisk instance; this handle is the
    same as dwHandle.  Otherwise, return null.

--*/
EXTERN_C
DWORD
DSK_Open(
    HANDLE dwHandle,
    DWORD dwAccess,
    DWORD dwShareMode
    )
{
    CDisk *pDisk = (CDisk *)dwHandle;

    EnterCriticalSection(&g_csMain);

    // validate the CDisk instance

    if (!AtaIsValidDisk(pDisk)) {
        pDisk = NULL;
    }

    LeaveCriticalSection(&g_csMain);

    // if the CDisk instance is valid, then open; open just increments the
    // instance's open count

    if (pDisk) {
        pDisk->Open();
    }

    return (DWORD)pDisk;
}

/*++

DSK_Close
    This function closes a CDisk instance.

Parameters:
    dwHandle - pointer to associated CDisk instance (initially returned by
    DSK_Init)

Return:
    On success, return true.  Otherwise, return false.

--*/
EXTERN_C
BOOL
DSK_Close(
    DWORD dwHandle
    )
{
    CDisk *pDisk = (CDisk *)dwHandle;

    EnterCriticalSection(&g_csMain);

    // validate the CDisk instance

    if (!AtaIsValidDisk(pDisk)) {
        pDisk = NULL;
    }

    LeaveCriticalSection(&g_csMain);

    // if CDisk instance is valid, then close; close just decrements the
    // instance's open count

    if (pDisk) {
        pDisk->Close();
    }

    return (pDisk != NULL);
}

/*++

DSK_IOControl
    This function processes an IOCTL_DISK_Xxx/DISK_IOCTL_Xxx I/O control.

Parameters:
    dwHandle - pointer to associated CDisk instance (initially returned by
    DSK_Init)
    dwIOControlCode - I/O control to perform
    pInBuf - pointer to buffer containing the input data of the I/O control
    nInBufSize - size of pInBuf (bytes)
    pOutBuf - pointer to buffer that is to receive the output data of the
    I/O control
    nOutBufSize - size of pOutBuf (bytes)
    pBytesReturned - pointer to DWORD that is to receive the size (bytes) of the
    output data of the I/O control
    pOverlapped - ignored

Return:
    On success, return true.  Otherwise, return false.

--*/
EXTERN_C
BOOL
DSK_IOControl(
    DWORD dwHandle,
    DWORD dwIoControlCode,
    PBYTE pInBuf,
    DWORD nInBufSize,
    PBYTE pOutBuf,
    DWORD nOutBufSize,
    PDWORD pBytesReturned,
    PDWORD pOverlapped)
{
    CDisk *pDisk = (CDisk *)dwHandle;
    BOOL fRet = FALSE;

    if (OEM_CERTIFY_TRUST != PSLGetCallerTrust()) {
        SetLastError(ERROR_ACCESS_DENIED);
        return FALSE;
    }

    EnterCriticalSection(&g_csMain);

    // validate CDisk instance

    if (!AtaIsValidDisk(pDisk)) {
        pDisk = NULL;
    }

    LeaveCriticalSection(&g_csMain);

    if (!pDisk) {
        return FALSE;
    }

    // DISK_IOCTL_INITIALIZED is a deprecated IOCTL; what does PostInit do?

    if (dwIoControlCode == DISK_IOCTL_INITIALIZED) {
        fRet = pDisk->PostInit((PPOST_INIT_BUF)pInBuf);
    }
    else {

        IOREQ IOReq;

        // build I/O request structure

        memset(&IOReq, 0, sizeof(IOReq));
        IOReq.dwCode = dwIoControlCode;
        IOReq.pInBuf = pInBuf;
        IOReq.dwInBufSize = nInBufSize;
        IOReq.pOutBuf = pOutBuf;
        IOReq.dwOutBufSize = nOutBufSize;
        IOReq.pBytesReturned = pBytesReturned;
        IOReq.hProcess = GetCallerProcess();

        // perform I/O control

        __try {
            fRet = pDisk->PerformIoctl(&IOReq);
        } __except(EXCEPTION_EXECUTE_HANDLER) {
            fRet = FALSE;
            SetLastError(ERROR_GEN_FAILURE);
        }
    }

    return fRet;
}

/*++

DSK_PowerUp
    This function resumes the device.

Parameters:
    None

Return:
    On success, return true.  Otherwise, return false.

--*/
EXTERN_C
VOID
DSK_PowerUp(
    VOID
    )
{
    EnterCriticalSection(&g_csMain);

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
蜜桃av噜噜一区| 欧美视频精品在线观看| 精品国产第一区二区三区观看体验| 婷婷综合另类小说色区| 欧美日韩国产区一| 美女在线观看视频一区二区| 日韩精品一区二区三区四区视频| 国产一区二区三区电影在线观看| 久久精品欧美一区二区三区麻豆 | 日韩一区二区三区电影| 美女视频免费一区| 国产亚洲视频系列| 91在线精品一区二区| 日本sm残虐另类| 欧美精品一级二级三级| 老司机免费视频一区二区 | 日本成人在线不卡视频| 欧美一区二区视频在线观看2020 | 蜜桃av一区二区在线观看| 精品国产三级a在线观看| 久久成人羞羞网站| 2欧美一区二区三区在线观看视频 337p粉嫩大胆噜噜噜噜噜91av | 欧美va亚洲va| 福利电影一区二区三区| 国产精品婷婷午夜在线观看| 国产精品亚洲视频| 亚洲天堂2014| 欧美日韩亚洲综合一区二区三区| 日本欧美肥老太交大片| 日韩视频一区二区| 国产成人在线视频网址| 国产精品女主播av| 在线观看视频一区二区 | 3d动漫精品啪啪1区2区免费| 免费成人小视频| 精品播放一区二区| 国产毛片精品视频| 中文字幕在线视频一区| 91尤物视频在线观看| 亚洲狠狠爱一区二区三区| 日韩视频中午一区| 粉嫩嫩av羞羞动漫久久久| 亚洲制服丝袜av| 日韩一区二区精品葵司在线| 丁香另类激情小说| 亚洲v日本v欧美v久久精品| 久久嫩草精品久久久久| 色综合天天做天天爱| 一区二区成人在线视频| 欧美精品免费视频| av影院午夜一区| 亚洲电影第三页| 国产日韩视频一区二区三区| 欧美亚洲国产一区二区三区| 国内欧美视频一区二区| 亚洲视频每日更新| 日韩手机在线导航| 99视频有精品| 毛片基地黄久久久久久天堂| 国产精品私房写真福利视频| 亚洲少妇屁股交4| 日韩三级视频在线观看| 日本韩国一区二区三区| 精品无码三级在线观看视频| 亚洲欧美aⅴ...| 欧美一卡二卡三卡四卡| 在线精品国精品国产尤物884a| 另类人妖一区二区av| 在线观看亚洲精品| 成人午夜电影小说| 久久成人av少妇免费| 亚洲精品自拍动漫在线| 中文无字幕一区二区三区| 日韩免费观看高清完整版在线观看| 一本大道久久精品懂色aⅴ| 国精品**一区二区三区在线蜜桃| 婷婷夜色潮精品综合在线| 97se亚洲国产综合自在线观| 免费观看在线色综合| 亚洲乱码日产精品bd| 国产欧美精品一区aⅴ影院 | 天天综合色天天| 天天av天天翘天天综合网色鬼国产 | 亚洲福利视频一区二区| 香蕉影视欧美成人| 555夜色666亚洲国产免| 欧美一区二区啪啪| 精品国产凹凸成av人网站| 久久久国际精品| 国产精品区一区二区三区| 亚洲日本在线视频观看| 一区二区三区不卡在线观看| 亚洲国产乱码最新视频| 日韩成人精品在线观看| 久久aⅴ国产欧美74aaa| 国产91精品一区二区麻豆亚洲| 成人美女视频在线观看| 91成人在线精品| 欧美成人官网二区| 中文av一区特黄| 色欧美乱欧美15图片| 欧美日韩免费在线视频| 欧美电视剧在线观看完整版| 久久久天堂av| 自拍av一区二区三区| 天天色天天爱天天射综合| 国内成人自拍视频| 99精品视频一区二区三区| 欧美日韩精品一区二区三区蜜桃| 精品成人一区二区| 一区二区三区.www| 久久av老司机精品网站导航| 成人免费视频国产在线观看| 欧美性生交片4| 久久视频一区二区| 欧美日韩在线精品一区二区三区激情| 制服丝袜日韩国产| 国产欧美日韩一区二区三区在线观看| 亚洲欧美另类久久久精品2019| 日韩高清在线观看| av爱爱亚洲一区| 日韩免费观看2025年上映的电影| 中文字幕一区二区三区在线播放 | 一个色综合av| 国产在线不卡一卡二卡三卡四卡| 99在线精品免费| 精品国产91久久久久久久妲己| 国产精品黄色在线观看| 欧美不卡激情三级在线观看| 亚洲精品自拍动漫在线| 国产麻豆精品95视频| 欧美日本一区二区| 亚洲欧美偷拍另类a∨色屁股| 狠狠色2019综合网| 欧美日韩中字一区| 亚洲欧美在线观看| 国产一区二区毛片| 欧美人牲a欧美精品| 国产精品久久久久久久岛一牛影视| 免费在线观看成人| 欧美日韩日日夜夜| 夜夜嗨av一区二区三区四季av | 日韩美女主播在线视频一区二区三区| av高清不卡在线| 国产香蕉久久精品综合网| 日韩电影一区二区三区| 色老综合老女人久久久| 国产精品久久久久久亚洲毛片| 日韩电影在线观看电影| 欧美日韩在线播放| 亚洲永久免费av| 91美女视频网站| 国产精品久久久久久亚洲伦| 国产99久久久久| 久久精品视频免费| 国产麻豆视频一区二区| 久久中文字幕电影| 国精产品一区一区三区mba视频| 日韩色视频在线观看| 青青青爽久久午夜综合久久午夜| 欧美精品日日鲁夜夜添| 视频一区二区国产| 91精品免费观看| 日韩精品中午字幕| 九色综合狠狠综合久久| 精品卡一卡二卡三卡四在线| 麻豆成人av在线| 精品福利av导航| 韩国一区二区三区| 久久精品视频一区二区三区| 国产经典欧美精品| 国产蜜臀97一区二区三区| 粉嫩高潮美女一区二区三区 | 精品国产91亚洲一区二区三区婷婷| 日韩 欧美一区二区三区| 欧美嫩在线观看| 日韩和欧美一区二区三区| 欧美一区二区在线不卡| 精品一区二区三区免费| 精品福利一区二区三区| 国产欧美日产一区| 99视频有精品| 亚洲国产日韩a在线播放性色| 欧美日韩国产bt| 久久精品国产亚洲5555| 国产亚洲人成网站| 99久久国产综合精品色伊| 亚洲欧美日韩在线播放| 欧美日韩国产精选| 狠狠色丁香九九婷婷综合五月| 国产精品日日摸夜夜摸av| 91在线观看成人| 日韩专区欧美专区| 久久亚洲一级片| 色综合 综合色| 奇米精品一区二区三区四区| 国内成人免费视频| 亚洲免费观看高清完整版在线 | 在线欧美一区二区| 久久精品999|