rw_root.c
资源名称:DOS系统的源代码.rar [点击查看]
上传用户:xiaoan1112
上传日期:2013-04-11
资源大小:19621k
文件大小:2k
源码类别:
操作系统开发
开发平台:
Visual C++
- /***************************************************************************/
- /* */
- /* RW_ROOT.C */
- /* */
- /* Copyright (c) 1991 - Microsoft Corp. */
- /* All rights reserved. */
- /* Microsoft Confidential */
- /* */
- /* Reads or writes a specified root directory sector on the specified */
- /* drive. */
- /* */
- /* ReadWriteRoot( int iDosDrv, struct BPB *Bpb, void *Buf, int Sector */
- /* int ReadWrite ) */
- /* */
- /* ARGUMENTS: iDosDrv - The DOS drive number to get the sector from */
- /* Bpb - Ptr to bpb structure for the specified drive */
- /* Buf - Ptr to sector buffer */
- /* Sector - The root directory sector number based 0 */
- /* ReadWrite- Flags reading or writing sector - READ or WRITE */
- /* RETURNS: int - OK if successfull else int 25h error code */
- /* */
- /* johnhe - 02-14-90 */
- /***************************************************************************/
- #include <alias.h>
- #include <disk_io.h>
- int ReadWriteRoot( int iDosDrv, struct BPB *Bpb, void *Buf, int Sector,
- int ReadWrite )
- {
- struct ABSIO_PACKET absPack;
- absPack.uNumSectors = 1;
- absPack.pchBuffer = (char far *)Buf;
- absPack.lStartSector = (long)(Bpb->uReservSec +
- ((UINT)Bpb->uchNumberFats * Bpb->uSecPerFat) +
- (UINT)Sector );
- return( AbsReadWrite( iDosDrv, &absPack, ReadWrite ) );
- }