词条 | whichxms |
释义 | DOS SVGACC图形开发库函数 原型:extern int far whichxms (unsigned int far *xmskbytesavail, unsigned int far *xmshandlesavail) 输入: 无输入参数 输出: 如果探测到扩展内存则返回1,否则返回0 xmskbytesavail - 扩展内存的空闲大小(千字节数) xmshandlesavail - 扩展内存的可用大小(千字节数) 用法: WHICHXMS检测是否存在扩展内存支持,并且安装相应的库函数调用。这个函数必须在所有其它扩展内存函数调用之前调用。WHICHXMS同时还返回扩展内存的空闲大小和可用大小。可用大小是有限制的,一般为32。这个限制可以在CONFIG.SYS文件中修改扩展内存驱动(常用的是与微软兼容的HIMEM.SYS)命令行来改变。 例子 /* * show what xms memory is available */ #include <stdlib.h> #include <conio.h> #include "svgacc.h" void main(void) { int er, mem, handles; if ( whichxms(&mem,&handles) ) { printf("an active xms memory manager was found!\"); printf("a total of %d kb of xms memory available...\",mem); printf("a total of %d xms memory handles available...\",handles); printf(" \"); if ((mem < 1) || (handles < 1)) { printf("sorry...there is either no free xms or\"); printf("no free handles\"); printf(" \"); printf("xms support not available...\"); exit(1); } else { printf(" \"); printf("xms support is ready and available!\"); exit(1); } } else { printf("sorry...no active xms memory manager found...\"); printf("make sure you have an xms memory manager\"); printf("(such as HIMEM.SYS) loaded\"); printf(" \"); printf("xms support not available...\"); exit(1); } exit(0); } |
随便看 |
百科全书收录4421916条中文百科知识,基本涵盖了大多数领域的百科知识,是一部内容开放、自由的电子版百科全书。