home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / tolkit45.zip / os2tk45 / samples / tcpiptk / r0lib32 / testini.c < prev    next >
C/C++ Source or Header  |  1999-05-11  |  3KB  |  63 lines

  1. /********************************************************copyrite.xic********/
  2. /*                                                                          */
  3. /*   Licensed Materials - Property of IBM                                   */
  4. /*   IBM TCP/IP for OS/2                                                    */
  5. /*   (C) Copyright IBM Corporation. 1990,1996.                              */
  6. /*                                                                          */
  7. /*   All rights reserved.                                                   */
  8. /*                                                                          */
  9. /*   US Government Users Restricted Rights -                                */
  10. /*   Use, duplication or disclosure restricted by GSA ADP Schedule          */
  11. /*   Contract with IBM Corp.                                                */
  12. /*                                                                          */
  13. /*--------------------------------------------------------------------------*/
  14. /*  DISCLAIMER OF WARRANTIES.  The following [enclosed] code is             */
  15. /*  sample code created by IBM Corporation. This sample code is not         */
  16. /*  part of any standard or IBM product and is provided to you solely       */
  17. /*  for  the purpose of assisting you in the development of your            */
  18. /*  applications.  The code is provided "AS IS", without                    */
  19. /*  warranty of any kind.  IBM shall not be liable for any damages          */
  20. /*  arising out of your use of the sample code, even if they have been      */
  21. /*  advised of the possibility of such damages.                             */
  22. /*--------------------------------------------------------------------------*/
  23. /************************** TESTINI.C *****************************************/
  24. #define INCL_DOSDEVICES
  25. #define INCL_DOSDEVIOCTL
  26. #define INCL_DOS
  27. #include <os2.h>
  28. #include <stdio.h>
  29. #include <malloc.h>
  30. #include <genio.h>
  31.  
  32.  
  33. int main()
  34. {
  35.   HFILE test_handle;
  36.   unsigned long action;
  37.   unsigned long cbFile          = 0L;
  38.   unsigned long ulAttribue      = 0L;
  39.   unsigned long fsOpenFlags     = 1L;
  40.   unsigned long fsOpenModes     = 0x12;
  41.   unsigned long peaop2          = 0L;
  42.   APIRET result;
  43.  
  44.   /* Open device driver */
  45.   result=DosOpen("TEST$",&test_handle,&action,cbFile,ulAttribue,fsOpenFlags,fsOpenModes,peaop2);
  46.   if (result) {
  47.     printf("Error %d opening TEST$ (test.sys)\n",result);
  48.     return 1;
  49.   }
  50.   else
  51.     printf("test.sys opened with handle %d\n",test_handle);
  52.  
  53.  
  54.   /* Initialize device drivers */
  55. //  result = DosDevIOCtl(NULL,NULL, 0x62, DeviceIO, test_handle);
  56.   result = DosDevIOCtl(test_handle,DeviceIO,CALL_INIT,0L,0L,0L,0L,0L,0L);
  57.   if (result) {
  58.     result=DosClose(test_handle);
  59.     printf("Unable to initialize TEST.SYS \n");
  60.   }
  61.  
  62. }
  63.