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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? sdmemmain.cpp

?? 6410BSP3
?? CPP
?? 第 1 頁 / 共 3 頁
字號:
//
// Copyright (c) Microsoft Corporation.  All rights reserved.
//
//
// Use of this sample source code is subject to the terms of the Microsoft
// license agreement under which you licensed this sample source code. If
// you did not accept the terms of the license agreement, you are not
// authorized to use this sample source code. For the terms of the license,
// please see the license agreement between you and Microsoft or, if applicable,
// see the LICENSE.RTF on your install media or the root of your tools installation.
// THE SAMPLE SOURCE CODE IS PROVIDED "AS IS", WITH NO WARRANTIES OR INDEMNITIES.
//

// Copyright (c) 2002 BSQUARE Corporation.  All rights reserved.
// DO NOT REMOVE --- BEGIN EXTERNALLY DEVELOPED SOURCE CODE ID 40973--- DO NOT REMOVE

// Driver entry points for SD Memory Card client driver

#include <windows.h>
#include "SDMemory.h"
#include <ceddk.h>

    // initialize debug zones
SD_DEBUG_INSTANTIATE_ZONES(
     TEXT("SDMemory"), // module name
     ZONE_ENABLE_INIT | ZONE_ENABLE_ERROR | ZONE_ENABLE_WARN,   // initial settings
     TEXT("Disk I/O"),
     TEXT("Card I/O"),
     TEXT("Bus Requests"),
     TEXT("Power"),
     TEXT(""),
     TEXT(""),
     TEXT(""),
     TEXT(""),
     TEXT(""),
     TEXT(""),
     TEXT(""));

DWORD SetDiskInfo( PSD_MEMCARD_INFO, PDISK_INFO );
DWORD GetDiskInfo( PSD_MEMCARD_INFO, PDISK_INFO );
DWORD GetStorageID( PSD_MEMCARD_INFO, PSTORAGE_IDENTIFICATION, DWORD, DWORD* );
BOOL GetDeviceInfo(PSD_MEMCARD_INFO pMemCard, PSTORAGEDEVICEINFO pStorageInfo);

#define DEFAULT_MEMORY_TAGS 4

///////////////////////////////////////////////////////////////////////////////
//  DllEntry - the main dll entry point
//  Input:  hInstance - the instance that is attaching
//          Reason - the reason for attaching
//          pReserved - not much
//  Output:
//  Return: always returns TRUE
//  Notes:  this is only used to initialize the zones
///////////////////////////////////////////////////////////////////////////////
extern "C" BOOL WINAPI DllEntry(HINSTANCE hInstance, ULONG Reason, LPVOID pReserved)
{
    BOOL fRet = TRUE;

    if ( Reason == DLL_PROCESS_ATTACH ) {
        DisableThreadLibraryCalls((HMODULE) hInstance);
        if (!SDInitializeCardLib()) {
            fRet = FALSE;
        }
    }
    else if ( Reason == DLL_PROCESS_DETACH ) {
        SDDeinitializeCardLib();
    }

    return fRet;
}

///////////////////////////////////////////////////////////////////////////////
//  SMC_Close - the close entry point for the memory driver
//  Input:  hOpenContext - the context returned from SMC_Open
//  Output:
//  Return: always returns TRUE
//  Notes:
///////////////////////////////////////////////////////////////////////////////
extern "C" BOOL WINAPI SMC_Close(DWORD hOpenContext)
{
    DEBUGMSG(SDCARD_ZONE_FUNC, (TEXT("SDMemory: +-SMC_Close\n")));
    return TRUE;
}

///////////////////////////////////////////////////////////////////////////////
//  CleanUpDevice - cleanup the device instance
//  Input:  pDevice - device instance
//  Output:
//  Return:
//  Notes:
///////////////////////////////////////////////////////////////////////////////
VOID CleanUpDevice(PSD_MEMCARD_INFO pDevice)
{
    DeinitializePowerManagement(pDevice);

    // acquire removal lock
    AcquireRemovalLock(pDevice);

    if (NULL != pDevice->pRegPath) {
        // free the reg path
        SDFreeMemory(pDevice->pRegPath);
    }

    if (NULL != pDevice->hBufferList) {
        // delete the buffer memory list
        SDDeleteMemList(pDevice->hBufferList);
    }

    ReleaseRemovalLock(pDevice);

    DeleteCriticalSection(&pDevice->RemovalLock);
    DeleteCriticalSection(&pDevice->CriticalSection);

    // free the sterile I/O request
    if (NULL != pDevice->pSterileIoRequest) {
        LocalFree(pDevice->pSterileIoRequest);
        pDevice->pSterileIoRequest = NULL;
    }

    // free the device memory
    SDFreeMemory(pDevice);
}

///////////////////////////////////////////////////////////////////////////////
//  SMC_Deinit - the deinit entry point for the memory driver
//  Input:  hDeviceContext - the context returned from SMC_Init
//  Output:
//  Return: always returns TRUE
//  Notes:
///////////////////////////////////////////////////////////////////////////////
extern "C" BOOL WINAPI SMC_Deinit(DWORD hDeviceContext)
{
    PSD_MEMCARD_INFO pDevice;

    DEBUGMSG(SDCARD_ZONE_INIT, (TEXT("SDMemory: +SMC_Deinit\n")));

    pDevice = (PSD_MEMCARD_INFO)hDeviceContext;

        // now it is safe to clean up
    CleanUpDevice(pDevice);

    DEBUGMSG(SDCARD_ZONE_INIT, (TEXT("SDMemory: -SMC_Deinit\n")));

    return TRUE;
}

///////////////////////////////////////////////////////////////////////////////
//  SlotEventCallBack - slot event callback for fast-path events
//  Input:  hDevice - device handle
//          pContext - device specific context that was registered
//          SlotEventType - slot event type
//          pData - Slot event data (can be NULL)
//          DataLength - length of slot event data (can be 0)
//  Output:
//  Return:
//  Notes:
//
//      If this callback is registered the client driver can be notified of
//      slot events (such as device removal) using a fast path mechanism.  This
//      is useful if a driver must be notified of device removal
//      before its XXX_Deinit is called.
//
//      This callback can be called at a high thread priority and should only
//      set flags or set events.  This callback must not perform any
//      bus requests or call any apis that can perform bus requests.
///////////////////////////////////////////////////////////////////////////////
VOID SlotEventCallBack(SD_DEVICE_HANDLE    hDevice,
                       PVOID               pContext,
                       SD_SLOT_EVENT_TYPE  SlotEventType,
                       PVOID               pData,
                       DWORD               DataLength)
{
    PSD_MEMCARD_INFO pDevice;

    DEBUGMSG(SDCARD_ZONE_INIT, (TEXT("SDMemory: +SlotEventCallBack - %d \n"),SlotEventType));

    switch (SlotEventType) {
        case SDCardEjected :
            pDevice = (PSD_MEMCARD_INFO)pContext;
                // mark that the card is being ejected
            pDevice->CardEjected = TRUE;
                // acquire the removal lock to block this callback
                // in case an ioctl is in progress
            AcquireRemovalLock(pDevice);
            ReleaseRemovalLock(pDevice);

            break;

    }

    DEBUGMSG(SDCARD_ZONE_INIT, (TEXT("SDMemory: -SlotEventCallBack \n")));
}

///////////////////////////////////////////////////////////////////////////////
//  SMC_Init - the init entry point for the memory driver
//  Input:  dwContext - the context for this init
//  Output:
//  Return: non-zero context
//  Notes:
///////////////////////////////////////////////////////////////////////////////
extern "C" DWORD WINAPI SMC_Init(DWORD dwContext)
{
  SD_DEVICE_HANDLE                hClientHandle;  // client handle
  PSD_MEMCARD_INFO                pDevice;        // this instance of the device
  SDCARD_CLIENT_REGISTRATION_INFO ClientInfo;     // client into
  ULONG                           BufferSize;     // size of buffer
  HKEY                            hSubKey;        // registry key
  SD_API_STATUS                   Status;         // intermediate status
  DWORD                           data;           // registry data
  DWORD                           dataLength;     // registry data length

  DEBUGMSG(SDCARD_ZONE_INIT, (TEXT("SDMemory: +SMC_Init\r\n")));

  pDevice = (PSD_MEMCARD_INFO)SDAllocateMemoryWithTag(
      sizeof(SD_MEMCARD_INFO),
      SD_MEMORY_TAG);
  if (pDevice == NULL) {
    DEBUGMSG(SDCARD_ZONE_ERROR, (TEXT("SDMemory: Failed to allocate device info\r\n")));
    DEBUGMSG(SDCARD_ZONE_INIT, (TEXT("SDMemory: -SMC_Init\r\n")));
    return 0;
  }

  // initialize sterile I/O request to NULL
  pDevice->pSterileIoRequest = NULL;

  InitializeCriticalSection(&pDevice->CriticalSection);
  InitializeCriticalSection(&pDevice->RemovalLock);

  // get the device handle from the bus driver
  hClientHandle = SDGetDeviceHandle(dwContext, &pDevice->pRegPath);
  // store device handle in local context
  pDevice->hDevice = hClientHandle;
  if (NULL == hClientHandle) {
    DEBUGMSG(SDCARD_ZONE_ERROR, (TEXT("SDMemory: Failed to get client handle\r\n")));
    CleanUpDevice(pDevice);
    DEBUGMSG(SDCARD_ZONE_INIT, (TEXT("SDMemory: -SMC_Init\r\n")));
    return 0;
  }

  // allocate sterile I/O request
  pDevice->pSterileIoRequest = (PSG_REQ)LocalAlloc(
      LPTR,
      (sizeof(SG_REQ) + ((MAX_SG_BUF - 1) * sizeof(SG_BUF)))
      );
  if (NULL == pDevice->pSterileIoRequest) {
    DEBUGMSG(SDCARD_ZONE_ERROR, (TEXT("SDMemory: Failed to allocate sterile I/O request\r\n")));
    CleanUpDevice(pDevice);
    DEBUGMSG(SDCARD_ZONE_INIT, (TEXT("SDMemory: -SMC_Init\r\n")));
    return 0;
  }

  // register our debug zones
  SDRegisterDebugZones(hClientHandle, pDevice->pRegPath);

  memset(&ClientInfo, 0, sizeof(ClientInfo));

  // set client options and register as a client device
  _tcscpy(ClientInfo.ClientName, TEXT("Memory Card"));

  // set the callback
  ClientInfo.pSlotEventCallBack = SlotEventCallBack;

  Status = SDRegisterClient(hClientHandle, pDevice, &ClientInfo);
  if (!SD_API_SUCCESS(Status)) {
    DEBUGMSG(SDCARD_ZONE_ERROR, (TEXT("SDMemory: Failed to register client : 0x%08X\r\n"),
          Status));
    CleanUpDevice(pDevice);
    DEBUGMSG(SDCARD_ZONE_INIT, (TEXT("SDMemory: -SMC_Init\r\n")));
    return 0;
  }
#ifdef _FOR_MOVI_NAND_
  /**
   * Description : There is no way to distinguish between HSMMC and moviNAND.
   *               So, We assume A HSMMC card is a moviNAND. Default value is false;
   */
  pDevice->IsHSMMC = FALSE;
#endif
  // configure card and retrieve disk size/format information
  if( SDMemCardConfig( pDevice ) != ERROR_SUCCESS ) {
    CleanUpDevice(pDevice);
    DEBUGMSG( SDCARD_ZONE_ERROR, (TEXT("SDMemory: Error initializing MemCard structure and card\r\n")));
    return 0;
  }

  // aet a default block transfer size
  pDevice->BlockTransferSize = DEFAULT_BLOCK_TRANSFER_SIZE;

  // read configuration from registry

  // open the reg path
  if (RegOpenKeyEx(
        HKEY_LOCAL_MACHINE,
        pDevice->pRegPath,
        0,
        KEY_ALL_ACCESS,
        &hSubKey) == ERROR_SUCCESS
     ) {
    // read "BlockTransferSize"
    dataLength = sizeof(pDevice->BlockTransferSize);
    RegQueryValueEx(
        hSubKey,
        BLOCK_TRANSFER_SIZE_KEY,
        NULL,
        NULL,
        (PUCHAR)&(pDevice->BlockTransferSize),
        &dataLength);
    if (pDevice->BlockTransferSize != DEFAULT_BLOCK_TRANSFER_SIZE) {
      DEBUGMSG(SDCARD_ZONE_INIT, (TEXT("SDMemory: Initialize: Using block transfer size of %d blocks\r\n"),
            pDevice->BlockTransferSize));
    }

    // read "SingleBlockWrites"
    // default to using mulitple block writes
    pDevice->SingleBlockWrites = FALSE;
    dataLength = sizeof(DWORD);
    data = 0;
    if (RegQueryValueEx(
          hSubKey,
          SINGLE_BLOCK_WRITES_KEY,
          NULL,
          NULL,
          (PUCHAR)&data,
          &dataLength) == ERROR_SUCCESS
       ) {
      // key is present
      pDevice->SingleBlockWrites = TRUE;
      DEBUGMSG(SDCARD_ZONE_INIT, (TEXT("SDMemory: Initialize: Using single block write commands only\r\n")));
    }

    // read "DisablePowerManagement"
    // on by default unless key is present
    pDevice->EnablePowerManagement = TRUE;
    dataLength = sizeof(DWORD);
    data = 0;
    if (RegQueryValueEx(
          hSubKey,
          DISABLE_POWER_MANAGEMENT,
          NULL,
          NULL,
          (PUCHAR)&data,
          &dataLength) == ERROR_SUCCESS
       ) {
      // key is present
      DEBUGMSG(SDCARD_ZONE_INIT, (TEXT("SDMemory: Initialize: Disabled power management\r\n")));
      pDevice->EnablePowerManagement = FALSE;
    }

    // read "IdleTimeout"
    pDevice->IdleTimeout = DEFAULT_IDLE_TIMEOUT;
    dataLength = sizeof(pDevice->IdleTimeout);
    if (RegQueryValueEx(
          hSubKey,
          IDLE_TIMEOUT,
          NULL,
          NULL,

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91精品国产黑色紧身裤美女| av一区二区三区黑人| 在线不卡免费av| 日韩经典中文字幕一区| 日韩无一区二区| 国产一区二区三区美女| 亚洲国产成人在线| 在线免费精品视频| 丝袜美腿亚洲色图| 欧美精品一区二区三区在线| 国产乱理伦片在线观看夜一区| 欧美国产综合色视频| 在线观看亚洲精品视频| 免费人成精品欧美精品| 国产日韩av一区二区| 在线免费观看一区| 捆绑调教美女网站视频一区| 国产精品久久久久久福利一牛影视| 一本色道久久加勒比精品| 日本大胆欧美人术艺术动态| 久久精品一区二区三区不卡| 色综合激情五月| 久久精工是国产品牌吗| 国产精品福利一区| 91精品婷婷国产综合久久竹菊| 国产精品99久| 亚洲成av人片一区二区| 久久这里只有精品6| 91亚洲精品久久久蜜桃网站| 美女网站视频久久| 亚洲日本成人在线观看| 日韩精品一区在线| 99精品偷自拍| 精品在线免费观看| 亚洲制服欧美中文字幕中文字幕| 亚洲精品一区二区三区四区高清| 91片在线免费观看| 国产麻豆91精品| 日日夜夜免费精品| 亚洲图片欧美激情| 久久久一区二区| 欧美人妇做爰xxxⅹ性高电影 | 精品国产一区二区三区av性色 | 欧亚洲嫩模精品一区三区| 久久99精品一区二区三区| 亚洲精品第1页| 国产无人区一区二区三区| 欧美日本免费一区二区三区| 97久久人人超碰| 国产在线国偷精品产拍免费yy| 亚洲一区二区av在线| 国产精品久久久久久久久图文区| 精品少妇一区二区三区在线视频 | 麻豆91在线播放| 一区二区三区久久| 欧美激情在线观看视频免费| 精品久久一区二区三区| 91精品国产一区二区三区| 欧美日韩夫妻久久| 色屁屁一区二区| 99精品欧美一区二区三区小说 | 国产成人aaa| 久久99国内精品| 日本不卡的三区四区五区| 亚洲成人综合在线| 亚洲永久免费av| 一区二区久久久久久| 亚洲少妇中出一区| 亚洲欧洲色图综合| 成人免费一区二区三区在线观看| 国产亚洲一二三区| 久久人人97超碰com| www国产精品av| 久久网这里都是精品| 久久综合丝袜日本网| 久久久久久久综合日本| 国产亚洲精品bt天堂精选| 国产亚洲一二三区| 国产精品免费网站在线观看| 国产精品视频在线看| 亚洲桃色在线一区| 亚洲激情图片一区| 日韩高清在线电影| 极品少妇xxxx精品少妇| 国产一区二区三区电影在线观看| 国产伦精品一区二区三区在线观看| 国产精品12区| 91亚洲国产成人精品一区二区三 | 秋霞成人午夜伦在线观看| 蜜桃在线一区二区三区| 国产一区二区三区四| 国产高清精品网站| 99视频精品在线| 欧美日韩激情一区二区| 精品欧美一区二区久久| 久久久三级国产网站| 国产精品久久久久久久久动漫| 一区二区三区在线观看视频| 五月婷婷综合在线| 久久电影国产免费久久电影| 成人三级在线视频| 在线观看国产日韩| 精品sm捆绑视频| 国产精品国产三级国产| 亚洲国产综合在线| 麻豆91在线播放| 91猫先生在线| 精品久久久久久无| 亚洲日本乱码在线观看| 久久精品噜噜噜成人88aⅴ| 懂色av噜噜一区二区三区av| 欧美在线看片a免费观看| 日韩一区二区不卡| 国产精品欧美经典| 午夜av一区二区| 国产成人欧美日韩在线电影| 欧美在线观看视频一区二区三区| 日韩女优制服丝袜电影| 亚洲欧美中日韩| 另类小说图片综合网| 94-欧美-setu| 日韩精品一区在线观看| 樱花影视一区二区| 国产在线视频精品一区| 欧美日韩亚洲另类| 久久影视一区二区| 性久久久久久久久| 成人高清视频在线观看| 欧美一区二区免费视频| 亚洲欧美另类久久久精品| 蜜桃在线一区二区三区| 91极品视觉盛宴| 欧美国产欧美亚州国产日韩mv天天看完整| 亚洲国产va精品久久久不卡综合| 国产成人免费9x9x人网站视频| 欧美日韩国产系列| 亚洲欧美日韩久久| 丁香啪啪综合成人亚洲小说| 日韩欧美综合在线| 亚洲国产成人av| 色综合欧美在线视频区| 国产精品女上位| 国产精品888| 久久一区二区三区四区| 看国产成人h片视频| 欧美亚洲一区三区| 一区二区三区在线视频播放| www.亚洲在线| 欧美激情一区三区| 国产精品18久久久久久久久久久久| 日韩一区二区三区电影| 亚洲va韩国va欧美va| 欧美性大战久久| 亚洲摸摸操操av| aaa国产一区| 亚洲色欲色欲www在线观看| 不卡的av电影| 国产精品免费视频网站| 高清国产午夜精品久久久久久| 日韩精品一区二区三区视频| 日韩高清在线一区| 欧美一区二区免费| 美女网站色91| 久久日韩粉嫩一区二区三区| 国产曰批免费观看久久久| 精品国产露脸精彩对白| 精品综合久久久久久8888| 日韩欧美色电影| 国产乱子伦视频一区二区三区| 精品福利一区二区三区免费视频| 麻豆国产欧美日韩综合精品二区| 精品国一区二区三区| 国产精品一二三在| 中文字幕高清一区| 99久久婷婷国产| 亚洲影视在线播放| 4438x亚洲最大成人网| 美女免费视频一区| 国产亚洲精品超碰| 色综合久久久久网| 五月婷婷久久综合| 欧美白人最猛性xxxxx69交| 国产剧情一区在线| 中文字幕亚洲欧美在线不卡| 色婷婷综合久久久久中文 | 91丨九色丨国产丨porny| 亚洲六月丁香色婷婷综合久久 | 一本一道久久a久久精品综合蜜臀| 亚洲另类在线制服丝袜| 欧美精品一二三| 国产在线一区二区综合免费视频| 欧美极品美女视频| 欧美日韩免费不卡视频一区二区三区| 午夜成人在线视频| 国产日韩三级在线| 在线中文字幕一区二区| 日韩电影在线观看一区| 国产偷国产偷精品高清尤物| 在线中文字幕一区二区| 激情欧美一区二区|