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

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

?? init.c

?? windows ce 3.00 嵌入式操作系統(tǒng)源代碼
?? C
字號(hào):
/*++

Copyright (c) 1997-2000 Microsoft Corporation.  All rights reserved.

Module Name:

    init.c

Abstract:

    This file contains the FSDMGR initialization/deinitialization entry
    points that initiate the loading/unloading other installable file
    system drivers (ie, FSDs such as FATFS.DLL).

    DEVICE.EXE still loads v1 and v2 FSDs and communicates with them via
    their FSD_Init and FSD_Deinit exports, but it also supports new FSDs
    indirectly via this new "FSD Manager", named FSDMGR.DLL.

    DEVICE.EXE detects a new FSD by the existence of an FSD_MountDisk export.
    In that case, it loads FSDMGR.DLL (if it hasn't already), and notifies
    FSDMGR_InitEx of (1) the module handle of the new FSD, and (2) the name
    of the new device (eg, "DSK1").

    FSDMGR.DLL interacts with the new FSD (XXX.DLL) through the following
    interfaces, which XXX.DLL must export:

      XXX_MountDisk(PDSK pDsk)

        Mounts the specified disk, returning TRUE if success, FALSE if error.
        The FSD must be able to cope with this call being issued redundantly
        (ie, it must determine from the media itself, not the uniqueness of
        the given DSK pointer, whether or not this disk has already been mounted).
        This is due to the nature of removable media and the fact that media
        may or may not have been removed -- or may have changed slots -- while
        the system was powered off.

        All I/O to the disk must be performed via calls to FSDMGR_ReadDisk and
        FSDMGR_WriteDisk in FSDMGR.DLL.  Similarly, FSDMGR_RegisterVolume should
        be used to register each volume present on the disk with the file system.

        Note that this function must also be exported as "FSD_MountDisk".

      XXX_UnmountDisk(PDSK pDsk)

        Unmounts the specified disk.  Returns TRUE if XXX.DLL successfully
        unmounted the disk, FALSE if not.  A requirement of returning
        TRUE is that all volumes on the disk previously registered with
        FSDMGR_RegisterVolume must first be deregistered with FSDMGR_DeregisterVolume.

        Note that this function must also be exported as "FSD_UnmountDisk".

    These rest of these exports define the functionality of the FSD.  Any
    function not exported is replaced with a stub function in FSDMGR that returns
    failure.

      XXX_CloseVolume
      XXX_CreateDirectoryW
      XXX_RemoveDirectoryW
      XXX_GetFileAttributesW
      XXX_SetFileAttributesW
      XXX_DeleteFileW
      XXX_MoveFileW
      XXX_DeleteAndRenameFileW (formerly known as "PrestoChangoFileName")
      XXX_GetDiskFreeSpaceW (formerly known as "GetDiskFreeSpace")
      XXX_Notify
      XXX_RegisterFileSystemFunction
      XXX_CreateFileW
      XXX_CloseFile
      XXX_ReadFile
      XXX_WriteFile
      XXX_GetFileSize
      XXX_SetFilePointer
      XXX_GetFileInformationByHandle
      XXX_FlushFileBuffers
      XXX_GetFileTime
      XXX_SetFileTime
      XXX_SetEndOfFile
      XXX_DeviceIoControl
      XXX_ReadFileWithSeek
      XXX_WriteFileWithSeek
      XXX_FindFirstFileW
      XXX_FindNextFileW
      XXX_FindClose

    There are also some noteworthy omissions.  We neither look for nor install handlers
    for the following APIs because they were not supported after v1.0:

      XXX_CeRegisterFileSystemNotification

    Similarly, the following APIs were not supported after v2.0:

      XXX_CeOidGetInfo

    And last but not least, XXX_CloseAllFiles is not supported because FSDMGR.DLL can
    enumerate all known handles for a given process and call XXX_CloseFile, eliminating
    the need for a special process termination handler.

--*/

#include "fsdmgrp.h"


/*  Globals
 */

HINSTANCE   hDLL;               // module handle of this DLL
HANDLE      hAFSAPI;
HANDLE      hFileAPI;
HANDLE      hFindAPI;
FSD_DLINK   dlFSDList;          // global FSD list
CRITICAL_SECTION csFSD;         // global CS for this DLL



/*  FSDMGR_InitEx - Entry point for DEVICE.EXE to initialize new FSD
 *
 *  ENTRY
 *      hFSD == handle to new FSD
 *      pwsDsk -> disk name
 *      pReserved == NULL (reserved for future use)
 *
 *  EXIT
 *      Pointer to internal DSK structure if successful, NULL if error
 *
 *  NOTES
 *      When DEVICE.EXE initializes an old-style FSD directly, it keeps
 *      track of how many devices the FSD claims to be managing.
 *
 *      DEVICE.EXE maintains a similar count for devices passed to FSDMGR,
 *      so for each device, we allocate a DSK structure and make sure we
 *      report a NEW (as opposed to REMOUNTED) DSK only once.
 *
 *      This function assumes it is single-thread in virtue of the fact that
 *      DEVICE.EXE is single-threaded when it calls it.
 */

PDSK FSDMGR_InitEx(HANDLE hFSD, PCWSTR pwsDsk, LPVOID pReserved)
{
    PFSD pFSD;
    PDSK pDsk;

    DEBUGMSGW(ZONE_INIT, (DBGTEXTW("FSDMGR_InitEx: initializing FSD for %s\n"), pwsDsk));

	
//    LoadLibrary(L"FSDMGR.DLL");

    pFSD = AllocFSD(hFSD);
    pDsk = AllocDisk(pFSD, pwsDsk);

    if (pDsk)
        FSDMGR_GetDiskInfo(pDsk, &pDsk->fdi);

    if (pFSD && pDsk && pFSD->pfnMountDisk(pDsk)) {
        ASSERT(VALIDSIG(pFSD, FSD_SIG) && VALIDSIG(pDsk, DSK_SIG));
        UnmarkDisk(pDsk, DSK_UNCERTAIN);
    }
    else {
        if (pDsk) {
            DeallocDisk(pDsk);
            pDsk = NULL;
        }
        if (pFSD) {
            DeallocFSD(pFSD);
            pFSD = NULL;
        }
    }

    // Here's where we indicate to DEVICE.EXE whether or not the disk
    // is being remounted; make sure you don't dereference pDsk past this
    // point.

    if (pDsk && (pDsk->dwFlags & DSK_REMOUNTED))
        (DWORD)pDsk |= DSK_REMOUNTED;

    DEBUGMSG(ZONE_INIT, (DBGTEXT("FSDMGR_InitEx returned 0x%x\n"), pDsk));
    return pDsk;
}


/*  FSDMGR_DeinitEx - Entry point for DEVICE.EXE to deinitialize new FSD
 *
 *  ENTRY
 *      pDsk -> DSK structure, or NULL to deinit all disks that are no
 *      longer present (ie, whose UNCERTAIN bit is still set)
 *
 *  EXIT
 *      TRUE if the specified DSK structure has been freed, FALSE if not;
 *      or, if no DSK structure was specified, we return the number of DSKs
 *      we were able to free.
 *
 *  NOTES
 *      This function assumes it is single-thread in virtue of the fact that
 *      DEVICE.EXE is single-threaded when it calls it.
 */

int FSDMGR_DeinitEx(PDSK pDsk)
{
    PFSD pFSD;
    int cDisks = 0;

    DEBUGMSGW(ZONE_INIT, (DBGTEXTW("FSDMGR_DeinitEx(0x%x): deinit'ing FSD for %s\n"), pDsk, pDsk? ((PDSK)((DWORD)pDsk & ~0x1))->wsDsk : TEXTW("all disks")));

    // We intercept the FSNOTIFY_POWER_ON notification that all volumes
    // receive and mark their respective DSK structures as UNCERTAIN.
    //
    // Afterward, FSDMGR_DeinitEx will start getting called for every disk
    // in the system, which we will simply ignore for UNCERTAIN disks (EXCEPT
    // to close their handle, because that puppy's dead as far as DEVICE.EXE
    // is concerned).
    //
    // Then we will start getting FSDMGR_InitEx calls for disks still present;
    // those should turn into XXX_MountDisk calls and the corresponding
    // UNCERTAIN bits cleared.  Then, finally, when we get FSNOTIFY_DEVICES_ON,
    // we need to locate disks still marked UNCERTAIN and call XXX_UnmountDisk.

    if (pDsk == NULL) {

        // We get this call *after* FSNOTIFY_DEVICES_ON; ie, it's the last major
        // event we get after the system has been reinitialized.  So let's walk all
        // the disk structures and call XXX_UnmountDisk for any disk still marked
        // UNCERTAIN.  Of course, the FSD is free to decline (eg, if there's still
        // open files in volumes on the disk).

loop1:  pFSD = dlFSDList.pFSDNext;
        while (pFSD != (PFSD)&dlFSDList) {
            ASSERT(VALIDSIG(pFSD, FSD_SIG));

loop2:      pDsk = pFSD->dlDskList.pDskNext;
            while (pDsk != (PDSK)&pFSD->dlDskList) {
                ASSERT(VALIDSIG(pDsk, DSK_SIG));

                if (pDsk->dwFlags & DSK_UNCERTAIN) {
                    if (pFSD->pfnUnmountDisk(pDsk)) {
                        if (DeallocDisk(pDsk))
                            cDisks++;
                        goto loop2;
                    }
                }
                pDsk = pDsk->dlDsk.pDskNext;
            }

            // We call DeallocFSD just in case all the disks attached
            // to the FSD were freed;  if they weren't, nothing changes.

            if (DeallocFSD(pFSD))
                goto loop1;
            pFSD = pFSD->dlFSD.pFSDNext;
        }
        DEBUGONLY(pDsk = NULL); // just for the benefit of my DEBUGMSG below
    }
    else {
        (DWORD)pDsk &= ~DSK_REMOUNTED;
        ASSERT(VALIDSIG(pDsk, DSK_SIG));

        // At the point where DEVICE.EXE issues this notification (inside
        // DeregisterDevice), our disk handle has already been close.  Note
        // that even if it hadn't been, there's no guarantee the driver would
        // be in any condition to respond, since we could be coming back up
        // from a powered-down state *or* the device may have been removed.
        // So it's perfectly reasonable to unconditionally mark the disk closed.

        MarkDisk(pDsk, DSK_CLOSED);

        if (!(pDsk->dwFlags & DSK_UNCERTAIN)) {

            pFSD = pDsk->pFSD;
            ASSERT(VALIDSIG(pFSD, FSD_SIG));

            if (pFSD->pfnUnmountDisk(pDsk)) {

                // Note that, despite XXX_UnmountDisk's apparent success,
                // DeallocDisk still won't deallocate the disk if it still has
                // volumes attached.

                if (DeallocDisk(pDsk))
                    cDisks++;

                // Similarly, DeallocFSD won't actually deallocate the FSD if it
                // still has disks attached.

                DeallocFSD(pFSD);
            }
        }
    }

    DEBUGMSG(ZONE_INIT, (DBGTEXT("FSDMGR_DeinitEx(0x%x) returned %d\n"), pDsk, cDisks));
    return cDisks;
}


/*  FSDMGR_Attach - DLL_PROCESS_ATTACH handler
 *
 *  ENTRY
 *      None
 *
 *  EXIT
 *      TRUE if successful, FALSE if not.  Most failures can probably
 *      be attributed to insufficient memory.
 *
 *  NOTES
 *      This is assumed to be protected by a critical section.  Since it's
 *      currently called only by FSDMGR_Main, we are protected by the loader's
 *      critical section.
 */

BOOL FSDMGR_Attach()
{
    DEBUGREGISTER(hDLL);

    InitList((PDLINK)&dlFSDList);
    InitializeCriticalSection(&csFSD);

    hAFSAPI = CreateAPISet("PFSD", ARRAY_SIZE(apfnAFSAPIs), apfnAFSAPIs, asigAFSAPIs);
    hFileAPI = CreateAPISet("HFSD", ARRAY_SIZE(apfnFileAPIs), apfnFileAPIs, asigFileAPIs);
    RegisterAPISet(hFileAPI, HT_FILE | REGISTER_APISET_TYPE);
    hFindAPI = CreateAPISet("FFSD", ARRAY_SIZE(apfnFindAPIs), apfnFindAPIs, asigFindAPIs);
    RegisterAPISet(hFindAPI, HT_FIND | REGISTER_APISET_TYPE);

    return hAFSAPI && hFileAPI && hFindAPI;
}


/*  FSDMGR_Detach - DLL_PROCESS_DETACH handler
 *
 *  ENTRY
 *      None
 *
 *  EXIT
 *      TRUE if successful, FALSE if not (currently, always successful)
 *
 *  NOTES
 *      This is assumed to be protected by a critical section.  Since it's
 *      currently called only by FSDMGR_Main, we are protected by the loader's
 *      critical section.
 */

BOOL FSDMGR_Detach(void)
{
    CloseHandle(hFindAPI);
    CloseHandle(hFileAPI);
    CloseHandle(hAFSAPI);
    DeleteCriticalSection(&csFSD);
    return TRUE;
}


/*  FSDMGR_Main - FSDMGR.DLL initialization entry point
 *
 *  ENTRY
 *      DllInstance == DLL module handle
 *      Reason == DLL_* initialization message
 *      pReserved == NULL (reserved for future use)
 *
 *  EXIT
 *      TRUE if successful, FALSE if not.  Most failures can probably
 *      be attributed to insufficient memory.
 */

BOOL WINAPI FSDMGR_Main(HINSTANCE DllInstance, INT Reason, LPVOID pReserved)
{
    switch(Reason) {

    case DLL_PROCESS_ATTACH:
        DEBUGMSG(ZONE_INIT, (DBGTEXT("FSDMGR_Main: DLL_PROCESS_ATTACH\n")));
        hDLL = DllInstance;
        return FSDMGR_Attach();

    case DLL_PROCESS_DETACH:
        DEBUGMSG(ZONE_INIT, (DBGTEXT("FSDMGR_Main: DLL_PROCESS_DETACH\n")));
        return FSDMGR_Detach();

    default:
      //DEBUGMSG(ZONE_INIT, (DBGTEXT("FSDMGR_Main: Reason #%d ignored\n"), Reason));
        break;
    }
    return TRUE;
}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
精品欧美一区二区久久| 欧美午夜精品久久久久久孕妇| 国产日韩av一区二区| 91福利在线导航| 久久99国产精品久久99| 亚洲综合在线五月| 国产片一区二区| 日韩一级黄色片| 在线观看日韩电影| av成人老司机| 国产精品一区不卡| 麻豆成人免费电影| 亚洲一卡二卡三卡四卡无卡久久 | 日韩精品最新网址| 国产成人啪免费观看软件| 亚洲大型综合色站| 中文字幕欧美一| 久久久一区二区| 欧美一区二区福利在线| 在线观看日韩av先锋影音电影院| 国产69精品久久久久毛片| 免费不卡在线视频| 图片区小说区区亚洲影院| 亚洲精品欧美综合四区| 欧美激情综合在线| 久久蜜桃av一区精品变态类天堂| 欧美精品v国产精品v日韩精品| 91在线高清观看| 成人激情小说网站| 国产69精品久久久久毛片| 国产麻豆9l精品三级站| 麻豆精品在线播放| 蜜桃一区二区三区在线| 亚洲国产综合视频在线观看| 亚洲精品videosex极品| 日韩毛片高清在线播放| 播五月开心婷婷综合| 亚洲猫色日本管| 欧美日韩三级一区| 色偷偷成人一区二区三区91| 成人国产精品视频| aa级大片欧美| 99国产精品久久久| 不卡的电影网站| 91免费国产在线观看| 91免费版在线| 欧美在线你懂的| 欧美日韩你懂的| 欧美一区二区在线看| 日韩三级伦理片妻子的秘密按摩| 制服丝袜亚洲网站| 欧美哺乳videos| 国产亚洲精久久久久久| 国产精品热久久久久夜色精品三区 | 26uuu国产一区二区三区| 精品捆绑美女sm三区| 久久一区二区三区国产精品| 久久久噜噜噜久噜久久综合| 日本一区二区三区电影| 欧美日韩综合不卡| av成人老司机| 成人av资源网站| 99久久婷婷国产综合精品电影| 91美女视频网站| 激情五月激情综合网| 国产综合色精品一区二区三区| 国产福利91精品一区| av一区二区三区| 欧美日韩精品系列| 日韩精品一区二区三区四区| 国产日韩综合av| 一区二区三区在线视频免费观看| 午夜精品免费在线观看| 国产一区二区三区免费观看| 99免费精品视频| 91精品国产日韩91久久久久久| 精品欧美一区二区久久| 国产精品不卡一区| 日韩电影免费在线| 国产91在线观看| 欧美三级电影网| 久久综合国产精品| 亚洲精选视频免费看| 欧美剧情片在线观看| 成年人午夜久久久| 粉嫩欧美一区二区三区高清影视| 色偷偷成人一区二区三区91| 欧美成人官网二区| 亚洲免费看黄网站| 国产一区二区三区免费播放| 色婷婷综合久久久久中文一区二区| 日韩精品一区二区三区在线 | 色综合一个色综合| 欧美一区二区在线不卡| 亚洲日本在线观看| 精品一区二区在线播放| 欧美中文字幕一二三区视频| 久久精品无码一区二区三区| 亚洲va韩国va欧美va精品 | 成人精品一区二区三区中文字幕| 欧美日韩高清影院| 中文字幕一区二区三区色视频 | 99r国产精品| 精品免费国产一区二区三区四区| 亚洲特级片在线| 国产精品99久久久久久有的能看| 欧美日韩中字一区| 亚洲三级免费观看| 国产一区二区在线看| 337p亚洲精品色噜噜狠狠| 亚洲女人的天堂| 成人性生交大片免费看视频在线| 日韩视频一区在线观看| 亚洲小说春色综合另类电影| a在线欧美一区| 国产亚洲制服色| 免费视频最近日韩| 欧美久久一区二区| 亚洲精品免费在线观看| 不卡在线观看av| 日本一区二区视频在线观看| 韩日av一区二区| 欧美本精品男人aⅴ天堂| 日韩 欧美一区二区三区| 欧美日韩在线亚洲一区蜜芽| 一区二区三区高清在线| 色综合亚洲欧洲| 亚洲美女屁股眼交3| 91污在线观看| 国产精品嫩草影院com| 成人免费视频视频在线观看免费| 国产亚洲欧美一区在线观看| 国产一区二区视频在线播放| 2022国产精品视频| 精品一区二区在线看| wwwwww.欧美系列| 国产福利一区在线| 欧美国产一区二区在线观看| 国产成人亚洲综合a∨婷婷图片| 久久婷婷色综合| 国产宾馆实践打屁股91| 日本一二三不卡| 97久久精品人人做人人爽50路| 成人免费在线观看入口| 色综合中文字幕| 亚洲午夜影视影院在线观看| 欧美日韩精品专区| 日韩高清在线观看| 精品国精品国产| 国产成人日日夜夜| 亚洲天天做日日做天天谢日日欢 | 久久精品一区八戒影视| 国产精品一区二区不卡| 中文字幕欧美一区| 欧美视频一区二区| 日韩福利电影在线| 亚洲精品在线免费观看视频| 国产成人av电影在线观看| 国产精品入口麻豆九色| 麻豆精品国产91久久久久久| 国产精品久久毛片a| 色偷偷成人一区二区三区91| 午夜国产精品一区| 久久蜜桃av一区精品变态类天堂 | 国产一区二区视频在线播放| 欧美激情在线看| 欧美艳星brazzers| 久久99精品久久久久久久久久久久| 久久久国产精品不卡| 色噜噜狠狠成人中文综合 | 亚洲永久精品大片| 夜夜爽夜夜爽精品视频| 精品中文av资源站在线观看| 国产一区二区三区免费| 国产女主播视频一区二区| 色综合视频一区二区三区高清| 亚洲一区二区三区爽爽爽爽爽| 8v天堂国产在线一区二区| 精品亚洲国内自在自线福利| 中文字幕在线一区二区三区| 欧美日韩高清在线| 成人网男人的天堂| 午夜激情一区二区| 中文字幕一区二区三| 欧美电影影音先锋| www.日韩精品| 蜜臀久久99精品久久久久久9| 国产精品久久久久影院色老大| 欧美精品日韩精品| eeuss鲁片一区二区三区| 免费观看日韩av| 亚洲女人****多毛耸耸8| 精品国产第一区二区三区观看体验| 成人a级免费电影| 久久99久久精品| 亚洲一卡二卡三卡四卡无卡久久| 国产三级一区二区三区| 欧美一区二区视频在线观看| 一本一道综合狠狠老| 国产精品888|