Пример #1
0
void __chk8087( void )
/********************/
{
    char    devinfo;

#if defined( __386__ )
    DosDevConfig( &devinfo, DEVINFO_COPROCESSOR );
    if( devinfo == 0 ) {
        _RWD_real87 = 0;
    } else {
        _RWD_real87 = __x87id();
    }
    _RWD_8087 = _RWD_real87;
#else
    if( _RWD_8087 == 0 ) {
        DosDevConfig( &devinfo, 3, 0 );
        if( devinfo == 0 ) {
            _RWD_real87 = 0;
        } else {
            _RWD_real87 = __x87id();
        }
        _RWD_8087 = _RWD_real87;
    }
    if( _RWD_real87 ) {
        __GrabFP87();
    }
    if( _RWD_8087 ) {
        _RWD_FPE_handler = __default_sigfpe_handler;
    }
#endif
    _fpreset();
}
Пример #2
0
int main(VOID) {



 BYTE    Model      = 0,  /* Model number */

         SubModel   = 0,  /* Submodel */

         Adapter    = 0,  /* Display adapter type */

         CoProc     = 0,  /* Math coprocessor installed? */

         Printers   = 0;  /* Number of printers */



 APIRET  rc         = NO_ERROR; /* Return code */



    rc = DosDevConfig(&Model, DEVINFO_MODEL);

    if (rc != NO_ERROR) {

       printf("DosDevConfig error:  return code = %u\n", rc);

       return 1;

    }



    rc = DosDevConfig(&SubModel, DEVINFO_SUBMODEL);

    printf("    Model/SubModel:  %d / %d\n", Model, SubModel);



    rc = DosDevConfig(&Adapter, DEVINFO_ADAPTER);

    printf("      Display type:  %s\n", (Adapter ? "Color" : "Monochrome"));



    rc = DosDevConfig(&CoProc, DEVINFO_COPROCESSOR);

    printf(" Math co-processor?  %s\n", (CoProc ? "Yes" : "No"));



    rc = DosDevConfig(&Printers, DEVINFO_PRINTER);

    printf("Number of printers:  %d\n", Printers);



    return NO_ERROR;

}
Пример #3
0
void    __chk8087() {
/******************/

    char    devinfo;

#if defined( __386__ )
    DosDevConfig( &devinfo, DEVINFO_COPROCESSOR );
#else
    DosDevConfig( &devinfo, 3, 0 );
#endif
    if( devinfo == 0 ) {
        _RWD_8087 = 0;
    } else {
        _RWD_8087 = __init_80x87( _RWD_8087cw );
    }
    _RWD_real87 = _RWD_8087;
}
Пример #4
0
int NumPrinters()
{
    char                num_printers;
    unsigned short      rc;

    rc = DosDevConfig( &num_printers, 0, 0 );
    if( rc != 0 ) return( 0 );
    if( num_printers > PortsFound ) num_printers = PortsFound;
    return( num_printers );
}
Пример #5
0
void machine_type( int print )
/****************************/
{
    int manuf, plevel, buswidth, ndptype, ndp;

    techoutput( "\n------------------------------------------------------\n");
    manuf = 0;
    buswidth = 0;
    plevel = PType();
    if( plevel < 2 ) buswidth = PBus();
    if( plevel < 1 ) manuf = PPrefix();
    ndptype = NDPType();
    if( (plevel ==  4) && (ndptype == 3) ) ndptype = 4;
    if( (plevel ==  5) && (ndptype == 3) ) ndptype = 5;
    if( (plevel ==  6) && (ndptype == 3) ) ndptype = 6;
    if( (plevel ==  7) && (ndptype == 3) ) ndptype = 7;
    techoutput( "An %s processor is installed in this system.\n",
                ProcessorType[manuf][plevel][buswidth] );

#ifdef __OS2__
    DosDevConfig( &ndp, 3, 0 );
    if( ndp != 0 ) ndp = 1;
#else
    ndp = NDPEquip();
#endif
    techoutput( "%s math coprocessor (NDP) is present\n",
                CoProcessorType[ ndptype ] );
    techoutput( "\tand Equipment Flags say math coprocessor %s present.\n",
                IsNotIs[ ndp ] );
#ifdef __OS2__
    techoutput( "Skipping math coprocessor interrupt check since this is not DOS.\n" );
    print = print; /* stop the warning message */
#else
    if( ndptype != 0 ) {
        LineCount++;
        techoutput( "The next test may cause the system to hang if math\n"
                "\tcoprocessor (NDP) interrupts are not handled properly.\n" );
        techoutput( "%s (NDP) interrupts are %s.\n",
                    CoProcessorType[ ndptype ],
                    monint( print ) ?
                        "properly enabled" :
                        "not enabled (math exceptions will not be detected!)"
                  );
    } else {
        techoutput( "Skipping math coprocessor interrupt check.\n" );
    }
#endif
}
/*******************************************************************************
    extern message is called by a calling application
*******************************************************************************/
int  APIENTRY UpsPortlist(HWND hWndDlg, int id, char *parms)
	{
		int  	c, iCommPorts;
		LONG	cur;
		char	string[20];
		BYTE  	cCommPorts;

		DosDevConfig (&cCommPorts, DEVINFO_RS232);
		iCommPorts = (int)cCommPorts;
		WinEnableWindowUpdate(WinWindowFromID(hWndDlg, id), FALSE);

		WinSendDlgItemMsg(hWndDlg, id, LM_DELETEALL, 0, 0);
		for(c = 0; c < iCommPorts; c++)
			{
				sprintf(string, "com%d", (c + 1));
				cur = (LONG)WinSendDlgItemMsg(hWndDlg, id, LM_INSERTITEM, MPFROMSHORT(LIT_END), MPFROMP(string));
				if(!stricmp(parms, string)) WinSendDlgItemMsg(hWndDlg, id, LM_SELECTITEM, MPFROMSHORT(cur), MPFROMSHORT(TRUE));
			}
		WinEnableWindowUpdate(WinWindowFromID(hWndDlg, id), TRUE);
		return 0;
	}