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

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

?? wd_misc.c

?? 文件系統(tǒng)轅馬,想要的258031823大幅度反對反對法
?? C
字號:
/*
**********************************************************************
*                          Micrium, Inc.
*                      949 Crestview Circle
*                     Weston,  FL 33327-1848
*
*                            uC/FS
*
*             (c) Copyright 2001 - 2003, Micrium, Inc.
*                      All rights reserved.
*
***********************************************************************

----------------------------------------------------------------------
File        : wd_misc.c
Purpose     : Device Driver using Windows I/O function for logical sector
              access.
---------------------------END-OF-HEADER------------------------------
*/

/*********************************************************************
*
*             #include Section
*
**********************************************************************
*/

#include "fs_dev.h" 
#include "fs_lbl.h" 
#include "FS_ConfDefaults.h"        /* FS Configuration */
#include "fs_api.h"
#include "fs_clib.h"

#if FS_USE_WINDRIVE_DRIVER

#ifndef _WIN32
#error Driver requires Windows API
#endif /* _WIN32 */

#include <windows.h>
#include <winioctl.h>

/*********************************************************************
*
*             Local data types
*
**********************************************************************
*/



/*********************************************************************
*
*             Local variables        
*
**********************************************************************
*/

static HANDLE             _hDrive           [FS_WD_MAXDEV];


/*********************************************************************
*
*             Local functions
*
**********************************************************************
*/

/*********************************************************************
*
*       _InitMedium
*
*  Description:
*    Initializes the medium.
*    In this driver, this simply means opening the device.
*
*  Parameters:
*    Unit        - Unit number.
* 
*  Return value:
*    
*/
static void _InitMedium(FS_U8 Unit) {
  if (_hDrive[Unit] == INVALID_HANDLE_VALUE) {
    _hDrive[Unit] = CreateFile(Unit ? FS_WD_DEV1NAME : FS_WD_DEV0NAME, 
                                  GENERIC_READ    | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE,
                                  NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
  }
}
/*********************************************************************
*
*          _GetStatus
*
*  Description:
*    FS driver function. Get status of the media.
*
*  Parameters:
*    Unit                  - Device number.
* 
*  Return value:
*    FS_MEDIA_STATEUNKNOWN if the state of the media is unknown.
*    FS_MEDIA_ISNOTPRESENT if no card is present.
*    FS_MEDIA_ISPRESENT if a card is present.
*/
static int _GetStatus(FS_U8 Unit) {
  if (_hDrive[Unit] == INVALID_HANDLE_VALUE) {
    _InitMedium(Unit);
  }
  return (_hDrive[Unit] == INVALID_HANDLE_VALUE) ? FS_MEDIA_ISNOTPRESENT : FS_MEDIA_ISPRESENT;
}


/*********************************************************************
*
*       _ReadBurst
*
*  Description:
*    FS driver function. Write sector to the media.
*
*  Parameters:
*    Unit    - Device number.
*    Sector      - Sector to be read from the device.
*    pBuffer     - Pointer to data.
* 
*  Return value:
*    ==0         - Sector has been written to the device.
*    <0          - An error has occured.
*/

static int _ReadBurst(FS_U8 Unit, FS_U32 SectorNo, FS_U32 NumSectors, void *pBuffer) {
  FS_U32 NumBytesTransfered;
  FS_U32 NumBytes;
  LARGE_INTEGER FilePos;

  NumBytes = FS_SEC_SIZE * NumSectors;
  FilePos.QuadPart     = (__int64)SectorNo * (__int64)FS_SEC_SIZE; 

  SetFilePointer(_hDrive[Unit], FilePos.LowPart, &FilePos.HighPart, FILE_BEGIN);
  ReadFile(_hDrive[Unit], pBuffer, NumBytes, &NumBytesTransfered, NULL);
  return (NumBytesTransfered == NumBytes) ? 0 : -1;
}

/*********************************************************************
*
*       _WriteBurst
*
*  Description:
*    FS driver function. Write sector to the media.
*
*  Parameters:
*    Unit    - Device number.
*    Sector      - Sector to be written to the device.
*    pBuffer     - Pointer to data to be stored.
* 
*  Return value:
*    ==0         - Sector has been written to the device.
*    <0          - An error has occured.
*/

static int _WriteBurst(FS_U8 Unit, FS_U32 SectorNo, FS_U32 NumSectors, const void *pBuffer) {
  FS_U32 NumBytesTransfered;
  FS_U32 NumBytes;
  LARGE_INTEGER FilePos;

  NumBytes = FS_SEC_SIZE * NumSectors;
  FilePos.QuadPart     = (__int64)SectorNo * (__int64)FS_SEC_SIZE; 

  SetFilePointer(_hDrive[Unit], FilePos.LowPart, &FilePos.HighPart, FILE_BEGIN);
  WriteFile(_hDrive[Unit], pBuffer, NumBytes, &NumBytesTransfered, NULL);
  return (NumBytesTransfered == NumBytes) ? 0 : -1;
}

/*********************************************************************
*
*       _Read
*
*  Description:
*    FS driver function. Read a sector from the media.
*
*  Parameters:
*    Unit    - Device number.
*    Sector      - Sector to be read from the device.
*    pBuffer     - Pointer to buffer for storing the data.
* 
*  Return value:
*    ==0         - Sector has been read and copied to pBuffer.
*    <0          - An error has occured.
*/

static int _Read(FS_U8 Unit, FS_U32 Sector, void *pBuffer) {
  return _ReadBurst(Unit, Sector, 1, pBuffer);
}


/*********************************************************************
*
*       _Write
*
*  Description:
*    FS driver function. Write sector to the media.
*
*  Parameters:
*    Unit    - Device number.
*    Sector      - Sector to be written to the device.
*    pBuffer     - Pointer to data to be stored.
* 
*  Return value:
*    ==0         - Sector has been written to the device.
*    <0          - An error has occured.
*/
static int _Write(FS_U8 Unit, FS_U32 Sector, void *pBuffer) {
  return _WriteBurst(Unit, Sector, 1, pBuffer);
}

/*********************************************************************
*
*       _IoCtl
*
*  Description:
*    FS driver function. Execute device command.
*
*  Parameters:
*    Unit        - Unit number.
*    Cmd         - Command to be executed.
*    Aux         - Parameter depending on command.
*    pBuffer     - Pointer to a buffer used for the command.
* 
*  Return value:
*    Command specific. In general a negative value means an error.
*/
static int _IoCtl(FS_U8 Unit, FS_I32 Cmd, FS_I32 Aux, void *pBuffer) {
  FS_DEV_INFO *pInfo;
  FS_U32 NumCylinders;
  FS_U32 NumSectors;

  FS_USE_PARA(Aux);
  switch (Cmd) {
  case FS_CMD_GET_DEVINFO:
    if (pBuffer) {
      DISK_GEOMETRY DiskGeometry;
      DWORD Size;
      _InitMedium(Unit);
      Size = sizeof(DiskGeometry);
      DeviceIoControl(_hDrive[Unit], IOCTL_DISK_GET_DRIVE_GEOMETRY, NULL, 0, &DiskGeometry, Size, &Size, NULL);
      pInfo = (FS_DEV_INFO *)pBuffer;
      NumCylinders = (FS_U32)DiskGeometry.Cylinders.QuadPart;
      if (DiskGeometry.SectorsPerTrack == 63) {
        /* Some media report inaccurate values (MMC/SD).
         * Since we can not read the Number of sectors from the card info structure, we have to estimate: -6%
         */
        NumCylinders = (NumCylinders + 1) & ~1;
        NumSectors = NumCylinders * DiskGeometry.SectorsPerTrack * DiskGeometry.TracksPerCylinder;
        NumSectors = (FS_U32)(((__int64)NumSectors * 94) / 100);
      } else {
        NumSectors = NumCylinders * DiskGeometry.SectorsPerTrack * DiskGeometry.TracksPerCylinder;
      }
      pInfo->NumSectors      = NumSectors;
      pInfo->BytesPerSector  = (FS_U16)DiskGeometry.BytesPerSector;
      pInfo->NumHeads        = (FS_U16)DiskGeometry.TracksPerCylinder;
      pInfo->SectorsPerTrack = (FS_U16)DiskGeometry.SectorsPerTrack;

      return 0;
    }
    break;
  }
  return -1;
}

/*********************************************************************
*
*       _InitDevice
*
*  Description:
*    Initializes the device.
*    In this driver, this simply means marking the handle as invalid.
*
*  Parameters:
*    Unit        - Unit number.
* 
*  Return value:
*    
*/
static int _InitDevice(FS_U8 Unit) {
  _hDrive[Unit] = INVALID_HANDLE_VALUE;
  return 0;
}

/*********************************************************************
*
*             Global variables        
*
**********************************************************************
*/

const FS_DEVICE_TYPE FS__windrive_driver = {
  "windrv",
  FS_WD_MAXDEV,
  _GetStatus,
  _Read,
  _Write,
  _IoCtl,
  _ReadBurst,
  _WriteBurst,
  _InitDevice,
  _InitMedium
};

#endif /* END OF FS_USE_WINDRIVE_DRIVER */

/*************************** End of file ****************************/

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美精品99久久久**| 婷婷亚洲久悠悠色悠在线播放| 精品久久人人做人人爱| 精品久久久久久久久久久院品网| 午夜精品久久久久久久蜜桃app| 欧美色图一区二区三区| 日本高清不卡在线观看| 91精品国产综合久久婷婷香蕉| 日本一区二区三区视频视频| 一区二区三区在线不卡| 精品影视av免费| av激情综合网| 欧美一区二区三区爱爱| 亚洲黄色小视频| 成人中文字幕在线| 欧美一区二区三区在线电影| 久久国产精品第一页| 在线影视一区二区三区| 日本欧美韩国一区三区| 91猫先生在线| 国产精品免费观看视频| 精品一区二区三区影院在线午夜| 久久久国产精华| 天天色图综合网| 2023国产一二三区日本精品2022| 天天影视色香欲综合网老头| 欧美精品一区二区三区很污很色的 | 蜜芽一区二区三区| 成人中文字幕在线| 亚洲成人午夜电影| 欧洲一区二区av| 亚洲精品国产一区二区精华液| 欧美日韩精品一区二区天天拍小说| 亚洲欧洲综合另类| 成人一区二区三区中文字幕| 亚洲国产精品久久不卡毛片| 色欧美片视频在线观看| 中文字幕一区二区三区精华液| 国产精品一区二区黑丝| 26uuu国产一区二区三区| 91丨porny丨首页| 久久99国内精品| 亚洲国产视频网站| 中文幕一区二区三区久久蜜桃| 欧美日韩二区三区| 成人短视频下载| 亚洲视频 欧洲视频| av在线不卡免费看| 国内精品久久久久影院一蜜桃| 精品国产免费视频| 91成人免费网站| av电影在线观看不卡| 精品一区二区在线看| 五月婷婷综合激情| 亚洲免费观看高清在线观看| 久久久电影一区二区三区| 欧美男女性生活在线直播观看| 北岛玲一区二区三区四区 | 国产精品资源在线看| 亚洲成人精品影院| 一区二区三区久久| 亚洲嫩草精品久久| 亚洲欧洲精品成人久久奇米网| 久久新电视剧免费观看| 日韩欧美中文字幕公布| 国产在线一区观看| 蜜桃av一区二区三区电影| 香蕉久久夜色精品国产使用方法 | 欧美精品久久久久久久多人混战| 91日韩一区二区三区| 从欧美一区二区三区| 国产精品99久久久久| 韩国v欧美v亚洲v日本v| 国产自产2019最新不卡| 紧缚奴在线一区二区三区| 蓝色福利精品导航| 精品一区二区三区欧美| 免费人成网站在线观看欧美高清| 日日噜噜夜夜狠狠视频欧美人| 精品国产伦理网| 精品国产91洋老外米糕| www久久精品| 欧美激情中文字幕| 欧美日韩精品一区二区三区| 欧美中文字幕一区二区三区亚洲| 99精品黄色片免费大全| 看片网站欧美日韩| 精品一区二区综合| 成人一级黄色片| 91免费版在线看| 欧美在线高清视频| 欧美一区二区三区视频| 精品999在线播放| 国产女同性恋一区二区| 国产精品久久福利| 精品国产一二三区| 日本一区二区高清| 亚洲精品成人在线| 日日夜夜精品视频免费| 国产在线精品国自产拍免费| 亚洲综合偷拍欧美一区色| 国产欧美va欧美不卡在线| 亚洲欧美综合网| 亚洲sss视频在线视频| 久久精品国产99久久6| 国产福利精品一区| 久久99精品国产麻豆不卡| 成人黄页在线观看| 在线观看欧美日本| 日韩一区二区电影网| 国产拍揄自揄精品视频麻豆| 亚洲乱码国产乱码精品精的特点| 五月天国产精品| 国产一区二区在线观看免费| 91在线国产福利| 91精品国产91综合久久蜜臀| 国产亚洲精品bt天堂精选| 精品国产免费一区二区三区四区 | 亚洲精品中文在线观看| 日本中文字幕一区| 盗摄精品av一区二区三区| 欧美性xxxxxx少妇| 久久久久久黄色| 午夜亚洲福利老司机| 国产成人精品www牛牛影视| 精品视频一区二区三区免费| 精品国产三级电影在线观看| 一区二区三区在线观看网站| 国内外成人在线| 欧美亚男人的天堂| 国产欧美中文在线| 琪琪久久久久日韩精品| 色一情一伦一子一伦一区| 精品久久国产老人久久综合| 亚洲女人的天堂| 国产ts人妖一区二区| 成人影视亚洲图片在线| 欧美精品久久99| 亚洲激情中文1区| 国产成人免费网站| 日韩三级免费观看| 亚洲成人资源网| 91欧美一区二区| 久久久久久久电影| 久久99久久精品| 欧美一区二区在线看| 亚洲免费电影在线| 成人av网址在线观看| 亚洲精品一线二线三线| 蜜芽一区二区三区| 欧美一级日韩不卡播放免费| 亚洲四区在线观看| www.欧美.com| 国产精品色婷婷久久58| 国产在线精品一区二区| 日韩精品一区二区三区视频播放 | 韩国av一区二区三区在线观看| 欧美日高清视频| 亚洲精品视频在线| 91丝袜美腿高跟国产极品老师| 国产欧美一区二区三区在线老狼| 国内精品自线一区二区三区视频| 欧美一区二区三区不卡| 图片区小说区国产精品视频| 欧洲精品一区二区三区在线观看| 一区二区三区中文字幕精品精品 | 成人免费看视频| 日本一区二区久久| 成人精品视频一区二区三区尤物| 久久久久国产精品厨房| 国产一区二区三区免费观看| 精品欧美久久久| 精品一区二区在线看| 久久精品亚洲一区二区三区浴池| 国产一区二区三区黄视频| 久久久九九九九| 成人黄色片在线观看| 亚洲欧洲精品一区二区三区| 色呦呦一区二区三区| 亚洲制服丝袜一区| 欧美电影在哪看比较好| 日本aⅴ亚洲精品中文乱码| 欧美电视剧免费观看| 国产精品自产自拍| 日韩一区中文字幕| 欧美色偷偷大香| 日本不卡高清视频| 国产亚洲午夜高清国产拍精品| 成人午夜免费av| 亚洲精品高清视频在线观看| 欧美日韩三级在线| 激情六月婷婷综合| 综合精品久久久| 欧美精品乱人伦久久久久久| 久久99热狠狠色一区二区| 国产欧美日韩三区| 欧美网站一区二区| 国产精品原创巨作av| 最新热久久免费视频| 欧美剧在线免费观看网站|