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

📄 ramdrv.c

📁 这是DOS系统的源代码,汇编写的,值得看看,对开发操作系统的人员有价值
💻 C
字号:
/***************************************************************************/
/* 																								*/
/* RAMDRV.C																						*/
/* 																								*/
/*		Copyright (c) 1991 - Microsoft Corp.											*/
/*		All rights reserved.																	*/
/*		Microsoft Confidential																*/
/*																									*/
/* Checks to see if RAMDRV is loaded by examining the label on each 			*/
/* non-removable disk on the sytem looking for the label "MS-RAMDR.IVE		*/
/* and then using the entry's date as the version number. The search			*/
/* will stop after the first non-local drive is detected.						*/
/*																									*/
/*	unsigned GetRamDrive( void )															*/
/*																									*/
/* ARGUMENTS:	NONE																			*/
/*	RETURN:		unsigned	- Ram drive internal revision number.					*/
/*																									*/
/* Created 08-26-90 - johnhe																*/
/***************************************************************************/

#include		<stdio.h>
#include		<stdlib.h>
#include		<string.h>
#include		<dos.h>

#include		<alias.h>
#include 	<disk_io.h>

/***************************************************************************/

unsigned GetRamDrive( void )
{
	static char			RamDrv[] = "X:\\MS-RAMDR.IVE";
	register				Drv;
	unsigned				uDate;
	struct find_t		Info;

	for ( uDate = 0, RamDrv[0] = 'C';
			uDate == 0 && IsReallyValidHardDrive( RamDrv[ 0 ] );
			RamDrv[0]++ )
	{
		Drv = (int)RamDrv[0] - 'A' + 1;
		if ( !IsRemoveable( Drv ) && IsLocalDrive( Drv) )
		{
			if ( _dos_findfirst( RamDrv, _A_VOLID, &Info ) == OK )
				uDate = Info.wr_date;

							/* This findfirst works around a bug in old versions	*/
							/* of DOS which happens when doing a findfirst for		*/
							/* a volume ID.													*/

			_dos_findfirst( RamDrv, _A_NORMAL, &Info );
		}
	}

	return( uDate );
}

⌨️ 快捷键说明

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