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

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

?? stream.c

?? 從大量的wince源代碼中剝離出的fat文件系統(tǒng)源代碼。移植性非常高。 微軟的代碼
?? C
?? 第 1 頁 / 共 4 頁
字號:

            if ((pstm->s_pvol->v_flags & VOLF_UPDATE_ACCESS) && !(pstm->s_flags & STF_ACCESS_TIME)) {

                SYSTEMTIME stTmp;
                FILETIME ftTmp1, ftTmp2;

                stTmp = stLocal;
                stTmp.wDayOfWeek = stTmp.wHour = stTmp.wMinute = stTmp.wSecond = stTmp.wMilliseconds = 0;

                // Now that I've truncated the local system time to midnight,
                // I need to switch back to non-local time to perform the
                // necessary comparison.

                DEBUGMSG(ZONE_STREAMS && ZONE_LOGIO,(DBGTEXT("FATFS!CommitStream: current (truncated) local system time: y=%d,m=%d,d=%d,h=%d,m=%d,s=%d\n"), stTmp.wYear, stTmp.wMonth, stTmp.wDay, stTmp.wHour, stTmp.wMinute, stTmp.wSecond));
                SystemTimeToFileTime(&stTmp, &ftTmp1);

                DEBUGMSG(ZONE_STREAMS && ZONE_LOGIO,(DBGTEXT("FATFS!CommitStream: current (truncated) local file time: %08x,%08x\n"), ftTmp1.dwLowDateTime, ftTmp1.dwHighDateTime));
                LocalFileTimeToFileTime(&ftTmp1, &ftTmp2);

                DEBUGMSG(ZONE_STREAMS && ZONE_LOGIO,(DBGTEXT("FATFS!CommitStream: current (truncated) file time: %08x,%08x\n"), ftTmp2.dwLowDateTime, ftTmp2.dwHighDateTime));
                if (pstm->s_ftAccess.dwLowDateTime != ftTmp2.dwLowDateTime ||
                    pstm->s_ftAccess.dwHighDateTime != ftTmp2.dwHighDateTime) {

                    pstm->s_ftAccess = ftTmp2;
                    pstm->s_flags |= STF_ACCESS_TIME | STF_DIRTY_INFO;
                }
            }

            if (pstm->s_flags & STF_DIRTY) {

                PBUF pbuf;

                // We don't specify a stream for FindBuffer, because we're
                // not trying to find a buffer for THIS stream, but rather its
                // directory's stream.

                // Also note this means we need to call CommitBuffer and UnholdBuffer
                // when we're done (instead of the usual ModifyStreamBuffer).

                if (pstm->s_blkDir == INVALID_BLOCK) {
                    DEBUGMSGBREAK(TRUE,(DBGTEXT("FATFS!CommitStream: invalid blkDir!\n")));
                    dwError = ERROR_INVALID_BLOCK;
                }
                else
                    dwError = FindBuffer(pstm->s_pvol, pstm->s_blkDir, NULL, FALSE, &pbuf);

                if (dwError == ERROR_SUCCESS) {

                    PDIRENTRY pde;
                    DWORD clusFirst;

                    pde = (PDIRENTRY)(pbuf->b_pdata + pstm->s_offDir);

                    dwError = ModifyBuffer(pbuf, pde, sizeof(DIRENTRY));

                    if (!dwError) {

                        pstm->s_attr |= ATTR_ARCHIVE;
                        pde->de_attr = pstm->s_attr;

                        pde->de_size = pstm->s_size;

                        clusFirst = pstm->s_clusFirst;
                        if (clusFirst == UNKNOWN_CLUSTER)
                            clusFirst = NO_CLUSTER;
                        SETDIRENTRYCLUSTER(pstm->s_pvol, pde, clusFirst);

                        if (pstm->s_flags & STF_CREATE_TIME) {
                            FileTimeToDOSTime(&pstm->s_ftCreate,
                                            &pde->de_createdDate,
                                            &pde->de_createdTime,
                                            &pde->de_createdTimeMsec);
                            pstm->s_flags &= ~STF_CREATE_TIME;
                        }

                        // A dirty data stream always gets a new write time, unless
                        // STF_WRITE_TIME is set, in which case someone has already set a
                        // specific write time.

                        if ((pstm->s_flags & (STF_DIRTY_DATA | STF_WRITE_TIME)) == STF_DIRTY_DATA) {

                            // We could simply call GetSystemTimeAsFileTime,
                            // with s_ftWrite as the destination, but if both
                            // last access and last write times are being updated,
                            // I prefer to insure that both times are identical.

                            FILETIME ftTmp;
                            SystemTimeToFileTime(&stLocal, &ftTmp);
                            LocalFileTimeToFileTime(&ftTmp, &pstm->s_ftWrite);
                            pstm->s_flags |= STF_WRITE_TIME;
                        }

                        if (pstm->s_flags & STF_WRITE_TIME) {
                            FileTimeToDOSTime(&pstm->s_ftWrite,
                                            &pde->de_date,
                                            &pde->de_time, NULL);
                            pstm->s_flags &= ~STF_WRITE_TIME;
                        }

                        if (pstm->s_flags & STF_ACCESS_TIME) {
                            FileTimeToDOSTime(&pstm->s_ftAccess,
                                            &pde->de_lastAccessDate, NULL, NULL);
                            pstm->s_flags &= ~STF_ACCESS_TIME;
                        }

                        if (fAll)
                            dwError = CommitBuffer(pbuf, FALSE);
                    }

                    UnholdBuffer(pbuf);

#if 0
                    if (!dwError)
                        FILESYSTEMNOTIFICATION(pstm->s_pvol, DB_CEOID_CHANGED, 0, SHCNE_UPDATEITEM, &pstm->s_sid, &pstm->s_sidParent, NULL, NULL, NULL, DBGTEXTW("CommitStream"));
#endif                  

                    // Even if the buffer couldn't be written, the dirt has still
                    // moved from the stream's data structure to the buffer

                    pstm->s_flags &= ~(STF_DIRTY | STF_DIRTY_CLUS);
                }

                // If there was some error getting a buffer however, note that the
                // stream remains dirty.
            }
        }
    }
    else {

        // CommitAndReleaseStreamBuffers would have insured the release for us,
        // but since we can't do a commit, we'll have to insure the release ourselves.

        ReleaseStreamBuffer(pstm, FALSE);
        dwError = !(pstm->s_flags & STF_DIRTY)? ERROR_SUCCESS : ERROR_ACCESS_DENIED;
    }

    DEBUGMSG(ZONE_STREAMS || ZONE_ERRORS && dwError,(DBGTEXT("FATFS!CommitStream returned %d for '%.11hs'\n"), dwError, pstm->s_achOEM));
    return dwError;
}


/*  RewindStream
 *
 *  ENTRY
 *      pstm - pointer to DSTREAM
 *      pos - position within DSTREAM to rewind to, or INVALID_POS to reinitialize
 *
 *  EXIT
 *      None
 */

void RewindStream(PDSTREAM pstm, DWORD pos)
{
    
    if ((pos == INVALID_POS) || (pos < pstm->s_run.r_start) ||
        ((pstm->s_run.r_clusNext == UNKNOWN_CLUSTER) && (pstm->s_clusFirst != UNKNOWN_CLUSTER))) {
       pstm->s_run.r_start = 0;
       pstm->s_run.r_end = 0;
       pstm->s_run.r_clusThis = UNKNOWN_CLUSTER;
       pstm->s_run.r_clusNext = pstm->s_clusFirst;
       pstm->s_run.r_clusPrev = NO_CLUSTER;
    }
}


/*  SeekStream
 *
 *  ENTRY
 *      pstm - pointer to DSTREAM
 *      pos - position within DSTREAM to seek to
 *
 *  EXIT
 *      0 if successful, error code if not
 *      (eg, ERROR_HANDLE_EOF if end of cluster chain reached)
 */

DWORD SeekStream(PDSTREAM pstm, DWORD pos)
{
    DWORD dwError;
    ASSERT(OWNCRITICALSECTION(&pstm->s_cs));

    if ((pos == INVALID_POS) || (pos < pstm->s_run.r_start) ||
    ((pstm->s_run.r_clusNext == UNKNOWN_CLUSTER) && (pstm->s_clusFirst != UNKNOWN_CLUSTER))) {

        RewindStream(pstm, pos);
    }

    // Locate the data run which contains the position requested.

    do {
        
        if (pos < pstm->s_run.r_end)
            return ERROR_SUCCESS;

        DEBUGMSG(ZONE_LOGIO && (pstm->s_flags & STF_DEMANDPAGED),(DBGTEXT("FATFS!SeekStream(DP): begin unpack\n")));
        dwError = UnpackRun(pstm);
        DEBUGMSG(ZONE_LOGIO && (pstm->s_flags & STF_DEMANDPAGED),(DBGTEXT("FATFS!SeekStream(DP): end unpack\n")));

        if (dwError)
            break;

    } while (TRUE);

    return dwError;
}


/*  PositionStream - Find cluster containing (or preceding) specified position
 *
 *  ENTRY
 *      pstm - pointer to DSTREAM
 *      pos - offset within stream to seek to
 *
 *  EXIT
 *      There are three general cases that callers are concerned about:
 *
 *          UNKNOWN_CLUSTER:    the specified position does not lie
 *                              within a cluster (ie, is beyond EOF)
 *
 *          NO_CLUSTER:         the specified position does not require a
 *                              cluster (in other words, pos is ZERO)
 *
 *          Valid cluster:      There are two cases here:  if pos is on a
 *                              cluster boundary, we will return the cluster
 *                              PRECEDING the one containing pos, otherwise
 *                              we will return the cluster CONTAINING pos.
 */

DWORD PositionStream(PDSTREAM pstm, DWORD pos)
{
    ASSERT(OWNCRITICALSECTION(&pstm->s_cs));

    if ((pos == INVALID_POS) || (pos < pstm->s_run.r_start) ||
    ((pstm->s_run.r_clusNext == UNKNOWN_CLUSTER) && (pstm->s_clusFirst != UNKNOWN_CLUSTER))) {

        RewindStream(pstm, pos);
    }

    // Locate the data run which contains the position requested.

    do {
        if (pos == pstm->s_run.r_start)
            return pstm->s_run.r_clusPrev;

        if (pos <= pstm->s_run.r_end) {

            return pstm->s_run.r_clusThis +
                   ((pos - pstm->s_run.r_start - 1) >>
                    (pstm->s_pvol->v_log2cblkClus + BLOCK_LOG2));
        }

        
    } while (UnpackRun(pstm) == ERROR_SUCCESS);

    return UNKNOWN_CLUSTER;
}


/*  ReadStream
 *
 *  Returns a pointer (to a buffer) containing data from the requested
 *  stream position, and the amount of data available in the buffer.  ppvEnd
 *  is optional as long as the caller knows that the size and alignment of
 *  its data is such that all the data will be buffered;  directory streams
 *  are an example of this:  as long as the caller calls ReadStream before
 *  examining each DIRENTRY record, the caller can be assured that the entire
 *  DIRENTRY is in the buffer (that would not, however, be a particularly
 *  efficient way to scan a directory stream. -JTP)
 *
 *  ENTRY
 *      pstm - pointer to DSTREAM
 *      pos - position within DSTREAM to read from
 *      ppvStart - pointer to pointer to receive starting address of data
 *      ppvEnd - pointer to pointer to receive ending address of data
 *
 *  EXIT
 *      0 if successful, error code if not (eg, error reading the disk, or
 *      ERROR_HANDLE_EOF if the end of the stream has been reached).
 */

DWORD ReadStream(PDSTREAM pstm, DWORD pos, PVOID *ppvStart, PVOID *ppvEnd)
{
    DWORD dwError;

    ASSERT(OWNCRITICALSECTION(&pstm->s_cs));

    dwError = SeekStream(pstm, pos);

    if (!dwError)
        dwError = ReadStreamBuffer(pstm, pos, 0, ppvStart, ppvEnd);

    return dwError;
}


/*  ReadStreamData
 *
 *  Whereas ReadStream returns a pointer (to a buffer) and a length,
 *  and then the caller reads whatever data it wants up to that length,
 *  this function takes a memory address and a length and simply reads
 *  that many bytes directly into that address, avoiding the use of
 *  disk buffers whenever possible.
 *
 *  Thus, unlike ReadStream, where the caller can never get more than a
 *  buffer's worth of data back at a time and probably needs to put a loop
 *  around its ReadStream call, ReadStreamData can read any amount of data
 *  with one call (no external loop).
 *
 *  ENTRY
 *      pstm - pointer to DSTREAM
 *      pos - position within DSTREAM to read from
 *      pvData - pointer to memory to read to
 *      len - length of data to read
 *      plenRead - pointer to DWORD for length read (optional)
 *
 *  EXIT
 *      0 if successful, error code if not (eg, error reading the disk)
 *
 *  NOTES
 *      To avoid using buffers
 */

DWORD ReadStreamData(PDSTREAM pstm, DWORD pos, PVOID pvData, DWORD len, PDWORD plenRead)
{
    DWORD cb;
    PBYTE pbStart, pbEnd;
    DWORD dwError = ERROR_SUCCESS;

    ASSERT(OWNCRITICALSECTION(&pstm->s_cs));

    // Use cb to temporarily hold the maximum number of bytes that
    // can be read, and then adjust the length of the read downward as needed.

    cb = pos > pstm->s_size? 0 : pstm->s_size - pos;
    if (len > cb)

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
精品国精品国产| 一区二区成人在线观看| 国产欧美精品一区| 亚洲午夜久久久久| 国产69精品一区二区亚洲孕妇| 欧美亚洲国产bt| 欧美极品xxx| 久久精品国产秦先生| 欧洲国产伦久久久久久久| 国产日产欧美一区二区视频| 日韩在线播放一区二区| 色综合天天天天做夜夜夜夜做| 久久久久久久精| 蜜臀av一级做a爰片久久| 欧美午夜电影网| 亚洲人成网站色在线观看| 国产福利一区二区三区在线视频| 91精品国产一区二区三区| 亚洲一区二区中文在线| 99re这里只有精品首页| 国产精品网曝门| 丁香啪啪综合成人亚洲小说| 久久只精品国产| 激情六月婷婷久久| ww亚洲ww在线观看国产| 蜜桃视频免费观看一区| 日韩一区二区三区视频在线| 午夜久久久影院| 欧美美女黄视频| 五月激情六月综合| 欧美精品久久99久久在免费线 | 成人免费视频网站在线观看| 久久免费视频一区| 国产精品一区二区视频| 中文字幕av免费专区久久| 福利91精品一区二区三区| 国产蜜臀av在线一区二区三区| 国产在线播放一区二区三区| 精品成人佐山爱一区二区| 另类小说综合欧美亚洲| 久久婷婷国产综合国色天香| 国产毛片精品一区| 欧美高清一级片在线观看| 99久精品国产| 五月激情六月综合| 日韩女优制服丝袜电影| 国产成人在线视频播放| 亚洲私人黄色宅男| 欧美区一区二区三区| 免费成人美女在线观看| 久久久不卡影院| www.日韩精品| 亚洲超丰满肉感bbw| 精品美女一区二区| 99精品国产91久久久久久| 亚洲乱码国产乱码精品精小说 | **性色生活片久久毛片| 在线视频观看一区| 免费成人结看片| 国产精品青草久久| 欧美日韩午夜在线| 狠狠色2019综合网| 一区二区三区在线观看网站| 日韩欧美在线123| 成人免费毛片片v| 午夜精品123| 国产女人aaa级久久久级| 在线免费不卡电影| 国产精品中文字幕一区二区三区| 亚洲图片另类小说| 欧美大片一区二区三区| 色综合久久天天| 精品一区二区三区在线视频| 亚洲图片另类小说| 久久只精品国产| 欧美少妇bbb| 成人深夜视频在线观看| 日韩av网站在线观看| 国产精品久久免费看| 日韩欧美国产不卡| 欧洲在线/亚洲| eeuss鲁一区二区三区| 美女久久久精品| 亚洲一区二区三区四区中文字幕| 国产三级一区二区| 日韩一区二区免费在线电影| 色香色香欲天天天影视综合网| 久久精品国产色蜜蜜麻豆| 亚洲一区二区三区在线看| 日本一区二区三级电影在线观看| 欧美一区二区国产| 欧美日韩国产小视频| 97超碰欧美中文字幕| 国产高清无密码一区二区三区| 日韩主播视频在线| 艳妇臀荡乳欲伦亚洲一区| 中文av字幕一区| 久久久99精品免费观看不卡| 91精品国产欧美一区二区18| 欧美少妇xxx| 精品视频全国免费看| 色老综合老女人久久久| 成人国产精品免费观看| 国产成人免费视频网站| 美女视频第一区二区三区免费观看网站 | 免费观看日韩电影| 亚洲成人免费看| 亚洲国产成人高清精品| 一区二区三区**美女毛片| 国产精品视频在线看| 国产精品乱码一区二三区小蝌蚪| 久久看人人爽人人| 国产亚洲精品免费| 国产日韩成人精品| 中文字幕在线观看不卡| 亚洲欧洲另类国产综合| 中文字幕一区在线观看| 国产精品国产a| 亚洲三级电影全部在线观看高清| 国产精品久久久久久久久免费桃花 | 久久爱www久久做| 麻豆精品在线观看| 国产在线精品一区二区不卡了| 精品亚洲aⅴ乱码一区二区三区| 精品一区二区三区视频 | 成人免费av资源| 91色九色蝌蚪| 欧美日韩高清一区二区| 91精品国产一区二区| 精品国产伦一区二区三区观看方式 | 蜜臀99久久精品久久久久久软件| 久久精品二区亚洲w码| 国产麻豆9l精品三级站| 成人福利电影精品一区二区在线观看 | 美女网站在线免费欧美精品| 麻豆精品新av中文字幕| 国产福利一区二区| 91亚洲精华国产精华精华液| 精品污污网站免费看| 欧美一区二区美女| 国产欧美日韩在线视频| 亚洲日本青草视频在线怡红院| 香港成人在线视频| 国产麻豆视频精品| 91福利资源站| 久久综合网色—综合色88| 亚洲欧美激情视频在线观看一区二区三区 | 丝袜亚洲另类丝袜在线| 国产做a爰片久久毛片| 91浏览器打开| 精品三级在线观看| 亚洲裸体xxx| 国产麻豆91精品| 欧美无乱码久久久免费午夜一区| 欧美精品一区二区三区高清aⅴ| 中文字幕亚洲成人| 久久国产日韩欧美精品| 91免费小视频| 久久理论电影网| 亚洲aⅴ怡春院| 99热这里都是精品| 精品久久久三级丝袜| 亚洲精品日日夜夜| 国产精品99久久久久久久vr | 69堂精品视频| 亚洲视频一区二区免费在线观看| 奇米777欧美一区二区| 91网址在线看| 久久精品一区蜜桃臀影院| 亚洲国产毛片aaaaa无费看| 成人精品国产福利| 精品美女一区二区三区| 天天综合网天天综合色| 91免费国产视频网站| 国产欧美精品国产国产专区 | 亚洲视频在线观看三级| 国产成人av在线影院| 日韩欧美黄色影院| 首页亚洲欧美制服丝腿| 色天使久久综合网天天| 国产精品天干天干在观线| 精品一区二区三区免费毛片爱 | 91色乱码一区二区三区| 国产日韩欧美一区二区三区乱码| 青草av.久久免费一区| 欧美性xxxxxx少妇| 亚洲激情av在线| av电影一区二区| 中文字幕一区二区三区色视频| 国产精品小仙女| 国产日韩v精品一区二区| 狠狠色狠狠色综合| 中文成人综合网| 狠狠色伊人亚洲综合成人| 精品成人免费观看| 麻豆精品在线视频| www国产亚洲精品久久麻豆| 另类人妖一区二区av| 日韩手机在线导航| 久久99精品国产|