home *** CD-ROM | disk | FTP | other *** search
/ PC Online 1997 May / PCO_5_97.ISO / FilesBBS / OS2 / DSKSL085.ARJ / DSKSL085.ZIP / dskslpub.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-03-03  |  3.3 KB  |  111 lines

  1. /*
  2.  * $Source: e:/source/driver/sleep/RCS/dskslpub.h,v $
  3.  * $Revision: 1.3 $
  4.  * $Date: 1997/03/03 01:21:15 $
  5.  * $Author: vitus $
  6.  *
  7.  * Describes IOCtl interface to dsksleep.flt
  8.  *
  9.  * $Log: dskslpub.h,v $
  10.  * Revision 1.3  1997/03/03 01:21:15  vitus
  11.  * Added DSKSL_MSGS_* IOCtls and structure
  12.  *
  13.  * Revision 1.2  1997/02/26 01:49:54  vitus
  14.  * Added SET/QUERY_DEVSTATE, Changed timeout units to seconds
  15.  *
  16.  * Revision 1.1  1997/02/06 01:07:05  vitus
  17.  * Initial revision
  18.  *
  19.  * -------------------------------------------
  20.  * This code is Copyright Vitus Jensen 1996-97
  21.  */
  22.  
  23. #if !defined(_DSKSLPUB_H)
  24. #define _DSKSLPUB_H
  25. #pragma pack(1)                    /* all structures packed */
  26.  
  27.  
  28. /*
  29.  * IOCtl category and function codes
  30.  */
  31. #define IOCTL_DSKSLEEP_CATEGORY    0xC0        /* a user-defined category */
  32. #define DSKSL_QUERY_VERSION    0x60        /* returns USHORT */
  33. #define DSKSL_QUERY_TIMEOUT    0x61        /* return device list */
  34. #define DSKSL_SET_TIMEOUT    0x41        /* changes single entry */
  35. #define DSKSL_QUERY_DEVSTATE    0x62        /* stopped? */
  36. #define DSKSL_SET_DEVSTATE    0x42        /* stop now! */
  37. #define DSKSL_READ_MSGS        0x63        /* read startup messages */
  38. #define DSKSL_CLEAR_MSGS    0x43        /* forget all messages */
  39.  
  40.  
  41.  
  42. /* Defines device settings */
  43. typedef struct _DEVICE_TIMEOUT {
  44.     UCHAR    adapter;            /* adapter index */
  45.     UCHAR    unit;                /* unit index */
  46.     UCHAR    reserved[2];            /* (padding) */
  47.     ULONG    seconds;            /* 0 -> no sleep */
  48. } DEVICE_TIMEOUT;
  49.  
  50.  
  51.  
  52. /* Returned by DSKSL_QUERY_TIMEOUT */
  53. typedef struct _DSKSL_QL_DATA {
  54.     USHORT        cb;            /* byte count driver wants
  55.                            to return (may be larger
  56.                            than application buffer) */
  57.     UCHAR        reserved[2];        /* (padding) */
  58.     DEVICE_TIMEOUT    list[1];        /* some compiler don't
  59.                            support '[]' ... */
  60. } DSKSL_QL_DATA, * PDSKSL_QL_DATA;
  61.  
  62.  
  63.  
  64. /* Passed to DSKSL_SET_TIMEOUT */
  65. typedef struct _DSKSL_SETTO_PARM {
  66.     USHORT        cb;            /* size of complete structure */
  67.     UCHAR        reserved[2];        /* (padding) */
  68.     DEVICE_TIMEOUT    list[1];        /* see above */
  69. } DSKSL_SETTO_PARM, * PDSKSL_SETTO_PARM;
  70.  
  71.  
  72.  
  73. /* Passed to DSKSL_QUERY_DEVSTATE and DSKSL_SET_DEVSTATE */
  74. typedef struct _DSKSL_DEVSTATE_PARM {
  75.     UCHAR    adapter;            /* adapter index */
  76.     UCHAR    unit;                /* unit index */
  77. } DSKSL_DEVSTATE_PARM, * PDSKSL_DEVSTATE_PARM;
  78.  
  79.  
  80.  
  81. /* Returned from DSKSL_QUERY_DEVSTATE
  82.  * -- x seconds until device is stopped
  83.  * Passed to DSKSL_SET_DEVSTATE
  84.  * -- change current timeout to x seconds
  85.  *    setting this value to 0 will immediately stop the
  86.  *    device.
  87.  *    OBS: any disk I/O will reset the device timeout to it's maximum. */
  88. typedef struct _DSKSL_DEVSTATE_DATA {
  89.     ULONG    seconds;            /* seconds still to go
  90.                            until device is stopped */
  91. } DSKSL_DEVSTATE_DATA, * PDSKSL_DEVSTATE_DATA;
  92.  
  93.  
  94.  
  95. /* Returned by DSKSL_READ_MSGS
  96.  * 'msg' will contain a buffer filled with ASCIIZ strings.  Strings
  97.  * usually don't contain newlines.
  98.  * Some time in the future this buffer might even contain messages
  99.  * added after system startup.
  100.  * To clear the buffer just issue DSKSL_CLEAR_MSGS w/o parameter or
  101.  * data buffer. */
  102. typedef struct _DSKSL_MSGS_DATA {
  103.     USHORT    cb;                /* byte count driver wants
  104.                            to return */
  105.     char    msg[1];                /* some compiler don't
  106.                            support '[]' */
  107. } DSKSL_MSGS_DATA;
  108.  
  109. #pragma pack()
  110. #endif /* _DSKSLPUB_H */
  111.