home *** CD-ROM | disk | FTP | other *** search
/ back2roots/padua / padua.7z / padua / ftp.vapor.com / microdot-1 / md1_src_02.lzx / autoopenfail.c < prev    next >
C/C++ Source or Header  |  2014-05-19  |  965b  |  45 lines

  1. #include <proto/dos.h>
  2. #include <proto/exec.h>
  3. #include <string.h>
  4.  
  5. extern struct WBStartup *_WBenchMsg;
  6. extern char __stdiowin[];
  7. extern long __oslibversion;
  8.  
  9. #define WS(x) Write( fh, x, strlen( x ) )
  10.  
  11. void __regargs __autoopenfail(char *lib)
  12. {
  13.    struct DOSBase *DOSBase;
  14.    long fh;
  15.    char buf[50];
  16.    
  17.    DOSBase = (struct DOSBase *)OldOpenLibrary("dos.library");
  18.    if (_WBenchMsg == NULL)
  19.       fh = Output();
  20.    else
  21.       fh = Open(__stdiowin, MODE_NEWFILE);
  22.  
  23.    if (fh)
  24.    {
  25.        RawDoFmt("Ben÷tige (mindestens) V%ld der ",
  26.                 &__oslibversion, (void (*))"\x16\xC0\x4E\x75", buf);
  27.    
  28.        Write(fh, buf, strlen(buf));
  29.        Write(fh, lib, strlen(lib));
  30.        Write(fh, "\n", 1);
  31.    
  32.        if (_WBenchMsg)
  33.        {
  34.            Delay(200);
  35.            Close(fh);
  36.        }
  37.    }   
  38.  
  39.    
  40.    CloseLibrary((struct Library *)DOSBase);
  41.    ((struct Process *)FindTask(NULL))->pr_Result2 = 
  42.                       ERROR_INVALID_RESIDENT_LIBRARY;
  43.  
  44. }
  45.