⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 rw_root.c

📁 [随书类]Dos6.0源代码
💻 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 ) );
}


⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -