File:  [OS/2 SDKs] / os2sdk / demos / examples / config / config.c
Revision 1.1.1.2 (vendor branch): download - view: text, annotated - select for diffs
Thu Aug 9 12:26:23 2018 UTC (7 years, 9 months ago) by root
Branches: msft, MAIN
CVS tags: os2sdk-1988, HEAD
Microsoft OS/2 SDK 03-01-1988

/*
 * Example of DosDevConfig usage
 *
 * This calls gets information about the attached devices. This
 * program works in Family API mode.
 *
 * Compile as: cl -AL -Lp -G0 config.c
 *
 * Created by Microsoft Corp. 1986
 */

#define INCL_DOSDEVICES

#include  <os2def.h>
#include  <bsedos.h>

main()
{
	UCHAR DeviceInfo[10];  /* Buffer to put information into */
	USHORT Item;	       /* Item number			 */
	USHORT Parm = 0;       /* RESERVED: must be zero	 */

	/* Check number of RS232 cards attached */
	Item = 1;
	DosDevConfig(DeviceInfo, Item, Parm);
	printf("%d RS232 adapter(s) installed.\n", (int)DeviceInfo[0]);

	/* Check number of diskette drives */
	Item = 2;
	DosDevConfig(DeviceInfo, Item, Parm);
	printf("%d diskette drive(s) installed.\n", (int)DeviceInfo[0]);
}

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.