home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / cset21v6.zip / MMPM2TK / TK / H / SSM.H < prev    next >
C/C++ Source or Header  |  1993-03-26  |  39KB  |  727 lines

  1. /****************************************************************************/
  2. /*                                                                          */
  3. /* Module Name: SSM.H                                                       */
  4. /*                                                                          */
  5. /* OS/2 2.0 Multimedia Extensions Sync/Stream Manager Definitions file      */
  6. /*                                                                          */
  7. /* Copyright (c) International Business Machines Corporation 1991, 1992     */
  8. /*                        All Rights Reserved                               */
  9. /*                                                                          */
  10. /****************************************************************************/
  11.  
  12. #define MAX_SPI_NAME  9      /* Maximum ASCIIZ stream handler name/class  */
  13.                              /* and device driver name                    */
  14.  
  15.  
  16. /* XLATOFF */
  17. #pragma pack(4)
  18. /* XLATON */
  19.  
  20. /****************************************************************************/
  21. /*                                                                          */
  22. /*  Global Type Declarations                                                */
  23. /*                                                                          */
  24. /****************************************************************************/
  25. typedef ULONG  HSTREAM;               /* Stream Handle                      */
  26. typedef HSTREAM FAR *PHSTREAM;        /* Pointer to Stream Handle           */
  27.  
  28. typedef ULONG  HEVENT;                /* Event Handle                       */
  29. typedef HEVENT FAR *PHEVENT;          /* Pointer to Event Handle            */
  30.  
  31. typedef ULONG  HID;                   /* Stream Handler ID                  */
  32. /* The following define was deleted because it conflicts with an OS/2 PM define */
  33. /*typedef HID  FAR *PHID;                Pointer to Stream Handler ID       */
  34.  
  35. typedef struct _LOCKH {               /* Memory locking handle (used by PDD)*/
  36.    BYTE     lock[16];
  37.    } LOCKH;
  38. typedef LOCKH           FAR  *PLOCKH;            /* Ptr to a LOCKH        */
  39.  
  40. #define RC ULONG                      /* Used for all return codes          */
  41.  
  42. typedef struct  _SLAVE { /* slave */
  43.    HSTREAM       hstreamSlave;          /* Handle for this slave            */
  44.    MMTIME        mmtimeStart;           /* Offset in master stream time to start */
  45.    } SLAVE;                             /*  this slave.                     */
  46. typedef SLAVE           FAR  *PSLAVE;            /* Ptr to a SLAVE        */
  47.  
  48. typedef struct  _MASTER { /* master */
  49.    HSTREAM       hstreamMaster;         /* Handle for this master           */
  50.    } MASTER;
  51. typedef MASTER           FAR  *PMASTER;            /* Ptr to a MASTER       */
  52.  
  53. /* XLATOFF */
  54. #pragma pack(1)
  55. /* XLATON */
  56.  
  57. typedef struct  _HAND { /* hand */
  58.    SZ            szHandlerClass[MAX_SPI_NAME]; /* Stream handler class      */
  59.    SZ            szHandlerName[MAX_SPI_NAME];  /* Stream handler name       */
  60.    } HAND;
  61. typedef HAND            FAR  *PHAND;             /* Ptr to a HAND         */
  62.  
  63. /* XLATOFF */
  64. #pragma pack()
  65. /* XLATON */
  66.  
  67.  
  68. #include "spcb.h"
  69. #include "evcb.h"
  70. #include "acb.h"
  71. #include "dcb.h"
  72.  
  73. /****************************************************************************/
  74. /* INI file support defines                                                 */
  75. /****************************************************************************/
  76. /* RCDATA defines:                                                          */
  77. #define SPI_RESOURCE   1               /* RCDATA resource number            */
  78. #define SH_DLL_TYPE    0               /* DLL type stream handler           */
  79. #define SH_PDD_TYPE    1               /* PDD type stream handler           */
  80. #define SPCBSIZE       72L             /* SPCB length, the Resource compiler*/
  81.                                        /*   doesn't allow sizeof(SPCB).     */
  82.  
  83. /* XLATOFF */
  84. /****************************************************************************/
  85. /*                                                                          */
  86. /*  Function Prototypes for Application event entry routine, SHC entry      */
  87. /*  routine, SMH entry routine. All use the Pure C calling convention       */
  88. /*                                                                          */
  89. /****************************************************************************/
  90. typedef ULONG (APIENTRY EVFN) (PEVCB  pevcb);
  91. typedef EVFN (FAR *PEVFN);
  92.  
  93. typedef ULONG (APIENTRY SHCFN) (PVOID pParmIn);
  94. typedef SHCFN (FAR *PSHCFN);
  95.  
  96. typedef ULONG (APIENTRY SMHFN) (PVOID pParmIn);
  97. typedef SMHFN (FAR *PSMHFN);
  98.  
  99. /* XLATON */
  100. #ifdef XXXXX
  101. typedef PVOID PEVFN;
  102. typedef PVOID PSHCFN;
  103. typedef PVOID PSMHFN;
  104. #endif
  105.  
  106.  
  107. /****************************************************************************/
  108. /*                                                                          */
  109. /*  Function Prototypes for SPI functions                                   */
  110. /*  All use Pure C calling convention                                       */
  111. /*  Six major categories:                                                   */
  112. /*     - stream creation                                                    */
  113. /*     - stream control                                                     */
  114. /*     - event handling                                                     */
  115. /*     - sync handling                                                      */
  116. /*     - configuration                                                      */
  117. /*     - stream protocol programming                                        */
  118. /****************************************************************************/
  119.  
  120.  
  121. /* XLATOFF */
  122. /****************************************************************************/
  123. /* Stream Creation                                                          */
  124. /****************************************************************************/
  125.  
  126. ULONG APIENTRY SpiAssociate ( HSTREAM hstream,
  127.                               HID hid,
  128.                               PACB pacb );
  129.  
  130.  
  131. ULONG APIENTRY SpiEnumerateHandlers ( PHAND pahand,       /* ptr to array handler name/class */
  132.                                       PULONG pulNumHand );
  133.  
  134.  
  135. ULONG APIENTRY SpiGetHandler ( PSZ pszHName,
  136.                                HID *phidSrc,
  137.                                HID *phidTgt );
  138.  
  139. ULONG APIENTRY SpiCreateStream ( HID hidSrc,        /* input                   */
  140.                                  HID hidTgt,        /* input                   */
  141.                                  PSPCBKEY pspcbkey, /* input                   */
  142.                                  PDCB pdcbSrc,      /* input - Src device info */
  143.                                  PDCB pdcbTgt,      /* input - Tgt device info */
  144.                                  PIMPL_EVCB pevcb,  /* input                   */
  145.                                  PEVFN EventEntry,  /* input                   */
  146.                                  HSTREAM hstreamBuf,/* input                   */
  147.                                  PHSTREAM phstream, /* output                  */
  148.                                  PHEVENT phevent ); /* output - implicit hevent*/
  149.  
  150. ULONG APIENTRY SpiSendMsg ( HSTREAM hstream,
  151.                             HID hid,
  152.                             ULONG ulMsgType,
  153.                             PVOID pMsg );
  154.  
  155. /* XLATON */
  156. // The first thing in the pMsg must be the length of the structure!
  157. typedef struct _MSG_COMMON { /* msg */
  158.      ULONG   ulMsgLen;              /* length of structure */
  159.    } MSG_COMMON;
  160. /* XLATOFF */
  161.  
  162.  
  163. /****************************************************************************/
  164. /* Stream Control                                                           */
  165. /****************************************************************************/
  166.  
  167.  
  168. ULONG APIENTRY SpiDestroyStream ( HSTREAM hstream );
  169.  
  170.  
  171. ULONG APIENTRY SpiGetTime ( HSTREAM hstream,
  172.                             PMMTIME pmmtime );
  173.  
  174. ULONG APIENTRY SpiSeekStream ( HSTREAM hstream,
  175.                                ULONG ulFlags,
  176.                                LONG  lSeekPoint );  /*mmtime or other          */
  177.  
  178. /* SpiSeekStream() ulFlags defines:                                         */
  179. #define SPI_SEEK_ABSOLUTE   0x0000L         /* Seek from beginning of stream*/
  180. #define SPI_SEEK_RELATIVE   0x0001L         /* Seek from current location   */
  181. #define SPI_SEEK_FROMEND    0x0002L         /* TEMP                         */
  182. #define SPI_SEEK_SLAVES     0x0010L         /* Seek all slave streams       */
  183.  
  184. #define SPI_SEEK_MMTIME     0x0000L         /* lSeekPoint == mmtime (default)*/
  185. #define SPI_SEEK_BYTES      0x0100L         /* lSeekPoint == bytes          */
  186.  
  187. #define SPI_SEEK_IFRAME     0x1000L         /* Seek to nearest IFRAME       */
  188.  
  189. #define VALIDSEEKFLAGS      ( SPI_SEEK_RELATIVE |           \
  190.                               SPI_SEEK_ABSOLUTE |           \
  191.                               SPI_SEEK_FROMEND  |           \
  192.                               SPI_SEEK_MMTIME |             \
  193.                               SPI_SEEK_SLAVES |             \
  194.                               SPI_SEEK_IFRAME |             \
  195.                               SPI_SEEK_BYTES )
  196.  
  197.  
  198. ULONG APIENTRY SpiStartStream ( HSTREAM hstream,
  199.                                 ULONG ulFlags );
  200.  
  201. /* SpiStartStream() ulFlags defines:                                        */
  202. #define SPI_START_STREAM    0x0000L         /* Only start this one stream   */
  203. #define SPI_START_SLAVES    0x0001L         /* Start this master and any slaves */
  204. #define SPI_START_PREROLL   0x0002L         /* Start the stream, but do preroll */
  205.  
  206. #define VALIDSTARTFLAGS     ( SPI_START_STREAM |            \
  207.                               SPI_START_SLAVES |            \
  208.                               SPI_START_PREROLL )
  209.  
  210.  
  211. ULONG APIENTRY SpiStopStream ( HSTREAM hstream,
  212.                                ULONG ulFlags );
  213.  
  214. /* XLATON */
  215. /* SpiStopStream() ulFlags defines:                                         */
  216. #define SPI_STOP_STREAM    0x0000L         /* Only stop this one stream     */
  217.                                            /* The default is to pause the data          */
  218.                                            /*  stream. No change to data buffers.       */
  219.                                            /*  synchronous call (no event notification) */
  220. #define SPI_STOP_SLAVES    0x0001L         /* Stop this master and any slaves           */
  221. #define SPI_STOP_FLUSH     0x0002L         /* Stop and flush all filled buffers.        */
  222.                                            /*  Stops the Src & Tgt SH, lets the         */
  223.                                            /*  Tgt SH run until out of buffers          */
  224.                                            /*  thereby, "flushing" all buffers.         */
  225.                                            /*  Tgt SH stops when out of buffers         */
  226.                                            /*  (This is a ASYNCHRONOUS call, event      */
  227.                                            /*   notification sent to appl when done.)   */
  228. #define SPI_STOP_DISCARD   0x0004L         /* Stop and discard all filled buffers.      */
  229.                                            /*  Stops the Src & Tgt SH                   */
  230.                                            /*  then discards all buffers current for    */
  231.                                            /*  this stream.                             */
  232.                                            /*  (This is a ASYNCHRONOUS call, event      */
  233.                                            /*   notification sent to appl when done.)   */
  234.  
  235.  
  236. /* XLATOFF */
  237. #define VALIDSTOPFLAGS     ( SPI_STOP_STREAM |              \
  238.                              SPI_STOP_SLAVES |              \
  239.                              SPI_STOP_FLUSH |               \
  240.                              SPI_STOP_DISCARD )
  241.  
  242.  
  243. /****************************************************************************/
  244. /* Event Handling                                                           */
  245. /****************************************************************************/
  246.  
  247.  
  248. ULONG APIENTRY SpiDisableEvent ( HEVENT hevent );
  249.  
  250.  
  251. ULONG APIENTRY SpiEnableEvent ( PEVCB pevcb,
  252.                                 PHEVENT phevent );
  253.  
  254.  
  255. /****************************************************************************/
  256. /* Sync Handling                                                            */
  257. /****************************************************************************/
  258.  
  259.  
  260. ULONG APIENTRY SpiDisableSync  ( HSTREAM hstreamMaster );
  261.  
  262.  
  263. ULONG APIENTRY SpiEnableSync ( HSTREAM hstreamMaster,
  264.                                PSLAVE paslaveList,
  265.                                ULONG ulNumSlaves,
  266.                                MMTIME mmtimeSync );
  267.  
  268.  
  269. ULONG APIENTRY SpiDetermineSyncMaster ( PHSTREAM phstreamMaster,
  270.                                         PMASTER  paMasterList,
  271.                                         ULONG    ulNumMasters );
  272.  
  273.  
  274. /****************************************************************************/
  275. /* Protocol manipulation                                                    */
  276. /****************************************************************************/
  277.  
  278. ULONG APIENTRY SpiGetProtocol ( HID hid,
  279.                                 PSPCBKEY pspcbkey,  /* input key               */
  280.                                 PSPCB pspcb );      /* output SPCB             */
  281.  
  282.  
  283. ULONG APIENTRY SpiInstallProtocol ( HID hid,
  284.                                     PSPCBKEY pspcbkey,  /* input key           */
  285.                                     PSPCB pspcb ,       /* input SPCB          */
  286.                                     ULONG ulFlags );    /* install flags       */
  287.  
  288. /* SpiInstallProtocol() ulFlags defines:                                    */
  289. #define SPI_INSTALL_PROTOCOL   0x0000L         /* Install this protocol     */
  290. #define SPI_DEINSTALL_PROTOCOL 0x0001L         /* DeInstall this protocol   */
  291.  
  292. #define VALIDINSTALLFLAGS     (SPI_INSTALL_PROTOCOL | SPI_DEINSTALL_PROTOCOL)
  293.  
  294. ULONG APIENTRY SpiEnumerateProtocols ( HID hid,
  295.                                        PVOID    paSPCBKeys,        /* ptr to buffer to fill with SPCB keys */
  296.                                        PULONG   pulNumSPCBKeys );  /* # of entries buffer on input,        */
  297.                                                                /*  # of SPCB key on output.            */
  298. /* XLATON */
  299.  
  300.  
  301.  
  302. /****************************************************************************/
  303. /*                                                                          */
  304. /*  Function Prototypes for SMH functions                                   */
  305. /*  All use Pure C calling convention                                       */
  306. /* NOTE ABOUT POINTERS:                                                     */
  307. /*  0:32 linear addresses for ring 3 (DLL) stream handlers                  */
  308. /*  16:16 selector/offset addresses for ring 0 (PDD) stream handlers        */
  309. /****************************************************************************/
  310.  
  311. ULONG APIENTRY SMHEntryPoint ( PVOID pParmIn );
  312.  
  313. typedef struct _SMH_COMMON { /* smhfunc */
  314.       ULONG    ulFunction;        /* SMH command function                   */
  315.       HID      hid;               /* handler ID                             */
  316.    } SMH_COMMON;
  317. typedef SMH_COMMON      FAR  *PSMH_COMMON;       /* Ptr to common part    */
  318.  
  319.  
  320. /****************************************************************************/
  321. #define SMH_REGISTER           0L              /* (Valid only from ring 3 stream */
  322.                                                /*  handler)                 */
  323.      typedef struct  _PARM_REG { /* smhreg */
  324.         ULONG     ulFunction;                  /* SMH command function      */
  325.         PSZ       pszSHName;                   /* Max size = 8 characters   */
  326.         HID FAR  *phidSrc;                     /* (9 including null)        */
  327.         HID FAR  *phidTgt;
  328.         PSHCFN    pshcfnEntry;                 /* Handler entry point for SHC's  */
  329.                                                /*  Only used for Ring 0 handlers.*/
  330.         ULONG     ulFlags;
  331.         ULONG     ulMaxNumStreams;             /* Max # of streams          */
  332.         ULONG     ulMaxNumEvents;              /* Max # of events/stream    */
  333.         } PARM_REG;
  334. typedef PARM_REG        FAR  *PPARM_REG;
  335.  
  336. #define REGISTER_TGT_HNDLR     0x0001L         /* This handler is Target.   */
  337. #define REGISTER_SRC_HNDLR     0x0002L         /* This handler is Source.   */
  338.                                                /* Handlr can be both.       */
  339. #define REGISTER_NONSTREAMING  0x0004L         /* Handler is non-streaming. */
  340. #define VALIDREGISTERFLAGS     (REGISTER_TGT_HNDLR | REGISTER_SRC_HNDLR | REGISTER_NONSTREAMING)
  341.  
  342.  
  343. /* Notes:                                                                     */
  344. /*  - Since ring 0 (DD) stream handlers can not use the IDC interface to the  */
  345. /*    sync/stream manager during DD initialization time, it must use the IOCTL*/
  346. /*    function to perform the SMH_REGISTER function. The addresses are 16:16  */
  347. /*    for this IOCTl instead of 0:32, because it comes form a device driver.  */
  348. #define SSMDD_CATEGORY            0x0081    /* Category (For ring 0 stream handler) */
  349. #define IOCTL_FUNC_SMH_REGISTER   0x0040    /* Function (For ring 0 stream handler) */
  350.  
  351.  
  352. /****************************************************************************/
  353. #define SMH_DEREGISTER         1L              /* SMH_Deregister()          */
  354.      typedef struct  _PARM_DEREG { /* smhder */
  355.         ULONG     ulFunction;                  /* SMH command function      */
  356.         PSZ       pszSHName;                   /* Max size = 8 char, 9 includes */
  357.         } PARM_DEREG;                          /* the null.                 */
  358. typedef PARM_DEREG      FAR  *PPARM_DEREG;
  359.  
  360.  
  361. /****************************************************************************/
  362. #define SMH_REPORTEVENT        2L              /* SMH_ReportEvent()         */
  363.      typedef struct  _PARM_EVENT { /* smhrev */
  364.         ULONG     ulFunction;                  /* SMH command function      */
  365.         HID       hid;
  366.         HEVENT    hevent;                      /* Used only for explicit events   */
  367.                                                /*  Must be 0 for sync and implicit*/
  368.                                                /*  events (i.e. error events)     */
  369.         PEVCB     pevcbEvent;                  /* Event status & HSTREAM          */
  370.         } PARM_EVENT;
  371. typedef PARM_EVENT      FAR  *PPARM_EVENT;
  372.  
  373.  
  374. /****************************************************************************/
  375. #define SMH_NOTIFY             3L              /* SMH_Notify()              */
  376.      typedef struct  _PARM_NOTIFY { /* smhnot */
  377.         ULONG     ulFunction;       /* Input - SMH command function         */
  378.         HID       hid;              /* Input                                */
  379.         HSTREAM   hstream;          /* Input                                */
  380.         ULONG     ulFlags;          /* Input/Output                         */
  381.         ULONG     ulGetNumEntries;  /* Input/Output - # of entries in table */
  382.         ULONG     ulRetNumEntries;  /* Input/Output - # of entries in table */
  383.         PVOID     pGetBufTab;       /* Output - Ptr to buffer/record table  */
  384.         PVOID     pRetBufTab;       /* Input - Ptr to buffer/record table   */
  385.         } PARM_NOTIFY;
  386. typedef PARM_NOTIFY     FAR  *PPARM_NOTIFY;
  387.  
  388.      typedef struct _SRCBUFTAB { /* srcbuftab */
  389.         PVOID    pBuffer;      /* Ptr to buffer                             */
  390.         PVOID    pRecord;      /* Ptr to record in buffer (split-streams only)  */
  391.         ULONG    ulLength;     /* Max buf length on GetEmpty, Filled        */
  392.                                /* (actual) rec/buf length on ReturnFull.    */
  393.         ULONG    ulMessageParm; /* Message to passed to application         */
  394.         MMTIME   mmtimeOffset; /* mmtime offset from beginning of buffer    */
  395.         } SRCBUFTAB;
  396. typedef SRCBUFTAB       FAR  *PSRCBUFTAB;        /* Ptr to a buffer entry */
  397.  
  398.      typedef struct _TGTBUFTAB { /* tgtbuftab */
  399.         PVOID    pBuffer;      /* Ptr to buffer                             */
  400.         ULONG    ulBufId;      /* Buffer ID. Passed to SH on GetFull, must  */
  401.                                /* be passed back to SSM on ReturnEmpty.     */
  402.         ULONG    ulLength;     /* Filled (actual) buffer length on GetFull, */
  403.                                /* unused on ReturnEmpty.                    */
  404.         ULONG    ulMessageParm; /* Message to passed to application         */
  405.         MMTIME   mmtimeOffset; /* mmtime offset from beginning of buffer    */
  406.         } TGTBUFTAB;
  407. typedef TGTBUFTAB       FAR  *PTGTBUFTAB;        /* Ptr to a buffer entry */
  408.  
  409. /* EXTENDED SMH_NOTIFY Structures */
  410.  
  411.      typedef struct  _PARM_ENOTIFY { /* smhenot */
  412.         ULONG     ulFunction;       /* Input - SMH command function         */
  413.         HID       hid;              /* Input                                */
  414.         HSTREAM   hstream;          /* Input                                */
  415.         ULONG     ulFlags;          /* Input/Output                         */
  416.         ULONG     ulGetNumEntries;  /* Input/Output - # of entries in table */
  417.         ULONG     ulRetNumEntries;  /* Input/Output - # of entries in table */
  418.         PVOID     pGetBufTab;       /* Output - Ptr to buffer/record table  */
  419.         PVOID     pRetBufTab;       /* Input - Ptr to buffer/record table   */
  420.         ULONG     ulParm1;          /* Reserved for future use */
  421.         ULONG     ulParm2;          /* Reserved for future use */
  422.         } PARM_ENOTIFY;
  423. typedef PARM_ENOTIFY     FAR  *PPARM_ENOTIFY;
  424.  
  425.      typedef struct _ESRCBUFTAB { /* esrcbuftab */
  426.         PVOID    pBuffer;      /* Ptr to buffer                             */
  427.         PVOID    pRecord;      /* Ptr to record in buffer (split-streams only)  */
  428.         ULONG    ulLength;     /* Max buf length on GetEmpty, Filled        */
  429.                                /* (actual) rec/buf length on ReturnFull.    */
  430.         ULONG    ulMessageParm; /* Message to passed to application         */
  431.         MMTIME   mmtimeOffset; /* mmtime offset from beginning of buffer    */
  432.         ULONG    ulParm1;      /* Record or buffer specific data */
  433.         ULONG    ulParm2;      /* Record or buffer specific data */
  434.         } ESRCBUFTAB;
  435. typedef ESRCBUFTAB       FAR  *PESRCBUFTAB;        /* Ptr to a buffer entry */
  436.  
  437.      typedef struct _ETGTBUFTAB { /* etgtbuftab */
  438.         PVOID    pBuffer;      /* Ptr to buffer                             */
  439.         ULONG    ulBufId;      /* Buffer ID. Passed to SH on GetFull, must  */
  440.                                /* be passed back to SSM on ReturnEmpty.     */
  441.         ULONG    ulLength;     /* Filled (actual) buffer length on GetFull, */
  442.                                /* unused on ReturnEmpty.                    */
  443.         ULONG    ulMessageParm; /* Message to passed to application         */
  444.         MMTIME   mmtimeOffset; /* mmtime offset from beginning of buffer    */
  445.         ULONG    ulParm1;      /* Buffer specific data */
  446.         ULONG    ulParm2;      /* Buffer specific data */
  447.         } ETGTBUFTAB;
  448. typedef ETGTBUFTAB       FAR  *PETGTBUFTAB;        /* Ptr to a buffer entry */
  449.  
  450.  
  451. /*SMH_ulFlags:                                                              */
  452. #define BUF_GETEMPTY       0x00000001L   /* Ptr returned in SMH_pGetBuffer  */
  453. #define BUF_RETURNFULL     0x00000002L   /* Ptr passed in SMH_pRetBuffer    */
  454. #define BUF_GETFULL        0x00000004L   /* Ptr returned in SMH_pGetBuffer  */
  455. #define BUF_RETURNEMPTY    0x00000008L   /* Ptr passed in SMH_pRetBuffer    */
  456. #define BUF_GIVEBUF        0x00000010L   /* Ptr passed in SMH_pRetBuffer    */
  457. #define BUF_EOS            0x00000100L   /* End of stream. Source sets this on */
  458.                                          /*  last buffer. Target sets it after */
  459.                                          /*  consuming the laset buffer.       */
  460. #define BUF_RECORDS        0x00004000L   /* One or more records (Split-stream) */
  461. #define BUF_LASTRECORD     0x00008000L   /* (BUF_RETURNFULL only) Mark         */
  462.                                          /* these record(s) as being the       */
  463.                                          /* last in the buffer. So the SSM     */
  464.                                          /* knows the maximum # of records     */
  465.                                          /* produced for this buffer.          */
  466.                                          /* (Split stream only)                */
  467. /*SMH_ulFlags: (Available at ring 0 only)                                      */
  468. #define BUF_LINEAR         0x00010000L   /* Ptrs are Global linear (Ring 0 only) */
  469. #define BUF_PHYSICAL       0x00020000L   /* Ptrs are physical (Ring 0 only)      */
  470.                                          /* (valid only for phyically            */
  471.                                          /*  contiguous buffers)                 */
  472. #define BUF_RESERVED       0x00040000L   /* Reserved                             */
  473. #define BUF_EXTENDED       0x80000000L   /* Use Extended SMH_NOTIFY structures   */
  474.  
  475. #define VALIDSOURCEFLAGS (BUF_RETURNFULL|BUF_GETEMPTY|BUF_EOS|BUF_LASTRECORD|BUF_PHYSICAL|BUF_LINEAR|BUF_RECORDS|BUF_GIVEBUF|BUF_EXTENDED)
  476. #define VALIDTARGETFLAGS (BUF_RETURNEMPTY|BUF_GETFULL|BUF_PHYSICAL|BUF_LINEAR|BUF_EOS|BUF_EXTENDED)
  477.  
  478.  
  479. /****************************************************************************/
  480. #define SMH_LOCKMEM            4L              /* SMH_LockMem()             */
  481.      typedef struct  _PARM_LOCKM { /* smhloc */
  482.         ULONG     ulFunction;                  /* SMH command function      */
  483.         PVOID     pBuffer;
  484.         ULONG     ulBufSize;
  485.         PLOCKH    plockh;
  486.         ULONG     ulFlags;
  487.         } PARM_LOCKM;
  488. typedef PARM_LOCKM      FAR  *PPARM_LOCKM;
  489.  
  490. /*SMH_ulFlags:                                                              */
  491. #define SSM_LOCKMEM            0x0000L         /* Lock Memory.              */
  492. #define SSM_UNLOCKMEM          0x0001L         /* Unlock memory.            */
  493. #define SSM_CONTIGLOCK         0x0002L         /* Lock memory contiguously. */
  494. /****************************************************************************/
  495.  
  496.  
  497.  
  498. /****************************************************************************/
  499. /*                                                                          */
  500. /*  Function Prototypes for SHC functions (Stream Handler Functions)        */
  501. /*  All use Pure C calling convention                                       */
  502. /*                                                                          */
  503. /* NOTE ABOUT POINTERS:                                                     */
  504. /*  0:32 linear addresses for ring 3 (DLL) stream handlers                  */
  505. /*  16:16 selector/offset addresses for ring 0 (PDD) stream handlers        */
  506. /****************************************************************************/
  507. typedef struct _SHC_COMMON { /* shcfunc */
  508.       ULONG    ulFunction;        /* Handler command function               */
  509.       HID      hid;               /* handler ID                             */
  510.    } SHC_COMMON;
  511. typedef SHC_COMMON      FAR  *PSHC_COMMON;       /* Ptr to common part    */
  512.  
  513.  
  514. /****************************************************************************/
  515. #define SHC_ASSOCIATE             0L
  516.      typedef struct _PARM_ASSOC { /* shcass */
  517.         ULONG    ulFunction;        /* Handler command function             */
  518.         HID      hid;               /* handler ID                           */
  519.         HSTREAM  hstream;           /* handle of stream instance            */
  520.         PACB     pacb;              /* pointer to associate control block   */
  521.      } PARM_ASSOC;
  522. typedef PARM_ASSOC      FAR  *PPARM_ASSOC;
  523.  
  524.  
  525. /****************************************************************************/
  526. #define SHC_CLOSE                 1L
  527.      typedef struct _PARM_CLOSE { /* shcclo */
  528.         ULONG    ulFunction;        /* Handler command function             */
  529.         HID      hid;               /* handler ID                           */
  530.      } PARM_CLOSE;
  531. typedef PARM_CLOSE      FAR  *PPARM_CLOSE;
  532.  
  533.  
  534. /****************************************************************************/
  535. #define SHC_CREATE                2L
  536.      typedef struct _PARM_CREATE { /* shccrt */
  537.         ULONG    ulFunction;        /* Handler command function             */
  538.         HID      hid;               /* handler ID                           */
  539.         HSTREAM  hstream;           /* handle of stream instance            */
  540.         SPCBKEY  spcbkey;           /* type of stream to create             */
  541.         PSPCB    pspcb;             /* Pointer to SPCB from handler         */
  542.         HSTREAM  hstreamBuf;        /* Used for split streams or to associate*/
  543.                                     /* another stream with this stream.     */
  544.         PDCB     pdcb;              /* pointer to device control block      */
  545.      } PARM_CREATE;
  546. typedef PARM_CREATE     FAR  *PPARM_CREATE;
  547.  
  548.  
  549. /****************************************************************************/
  550. #define SHC_DESTROY               3L
  551.      typedef struct _PARM_DESTROY { /* shcdes */
  552.         ULONG    ulFunction;        /* Handler command function             */
  553.         HID      hid;               /* handler ID                           */
  554.         HSTREAM  hstream;           /* handle of stream instance            */
  555.      } PARM_DESTROY;
  556. typedef PARM_DESTROY    FAR  *PPARM_DESTROY;
  557.  
  558.  
  559. /****************************************************************************/
  560. #define SHC_START                 4L
  561.      typedef struct _PARM_START { /* shcstr */
  562.         ULONG    ulFunction;        /* Handler command function             */
  563.         HID      hid;               /* handler ID                           */
  564.         HSTREAM  hstream;           /* handle of stream instance            */
  565.         ULONG    ulFlags;           /* Start flags                          */
  566.      } PARM_START;
  567. typedef PARM_START      FAR  *PPARM_START;
  568.  
  569. /* ulFlags:                                                                 */
  570. #define FLUSH_START      0x0001L    /* This start is a result of a Flush Stop command. */
  571.  
  572.  
  573. /****************************************************************************/
  574. #define SHC_STOP                  5L
  575.      typedef struct _PARM_STOP { /* shcstp */
  576.         ULONG    ulFunction;        /* Handler command function             */
  577.         HID      hid;               /* handler ID                           */
  578.         HSTREAM  hstream;           /* handle of stream instance            */
  579.         ULONG    ulFlags;           /* Stop flags (refer to ulFlags defines under */
  580.                                     /*  SpiStopStream() call.               */
  581.      } PARM_STOP;
  582. typedef PARM_STOP       FAR  *PPARM_STOP;
  583.  
  584.  
  585. /****************************************************************************/
  586. #define SHC_SEEK                  6L
  587.      typedef struct _PARM_SEEK { /* shcsek */
  588.         ULONG    ulFunction;        /* Handler command function             */
  589.         HID      hid;               /* handler ID                           */
  590.         HSTREAM  hstream;           /* handle of stream instance            */
  591.         ULONG    ulFlags;           /* Seek flag (refer to ulFlags defines  */
  592.                                     /*  under SpiSeekStream() call).        */
  593.         LONG     lSeekPoint;        /* seek to point , mmtime or other      */
  594.      } PARM_SEEK;
  595. typedef PARM_SEEK       FAR  *PPARM_SEEK;
  596.  
  597.  
  598. /****************************************************************************/
  599. #define SHC_ENABLE_EVENT          7L
  600.      typedef struct _PARM_ENEVENT { /* shceev */
  601.         ULONG    ulFunction;        /* Handler command function             */
  602.         HID      hid;               /* handler ID                           */
  603.         HEVENT   hevent;            /* handle of event to enable            */
  604.         PEVCB    pevcbUser;         /* User event information (e.g. hstream */
  605.                                     /*  EventType, EventSubType)            */
  606.      } PARM_ENEVENT;
  607. typedef PARM_ENEVENT    FAR  *PPARM_ENEVENT;
  608.  
  609.  
  610. /****************************************************************************/
  611. #define SHC_DISABLE_EVENT         8L
  612.      typedef struct _PARM_DISEVENT { /* shcdev */
  613.         ULONG    ulFunction;        /* Handler command function             */
  614.         HID      hid;               /* handler ID                           */
  615.         HSTREAM  hstream;           /* handle to stream for this event      */
  616.         HEVENT   hevent;            /* handle of event to disable           */
  617.      } PARM_DISEVENT;
  618. typedef PARM_DISEVENT   FAR  *PPARM_DISEVENT;
  619.  
  620.  
  621. /****************************************************************************/
  622. #define SHC_ENABLE_SYNC           9L
  623.      typedef struct _PARM_ENSYNC { /* shcesy */
  624.         ULONG    ulFunction;        /* Handler command function             */
  625.         HID      hid;               /* handler ID                           */
  626.         HSTREAM  hstream;           /* handle of stream instance            */
  627.         ULONG    ulFlags;           /* Sync flags                           */
  628.         MMTIME   mmtimeSync;        /* granularity of sync interval (if null, use default) */
  629.         PSYNC_EVCB pevcbSyncPulse;  /* Sync pulse EVCB information          */
  630.         ULONG    ulSyncPulseSem;    /* Optional 16 bit system               */
  631.                                     /* Semaphore for handler                */
  632.      } PARM_ENSYNC;
  633. typedef PARM_ENSYNC     FAR  *PPARM_ENSYNC;
  634.  
  635. /* ulFlags:                                                                 */
  636. #define SYNC_MASTER      0x0000L    /* The handler will be a master for this sync*/
  637. #define SYNC_SLAVE       0x0001L    /* The handler will be a slave for this sync */
  638.  
  639.  
  640. /****************************************************************************/
  641. #define SHC_DISABLE_SYNC          10L
  642.      typedef struct _PARM_DISSYNC { /* shcdsy */
  643.         ULONG    ulFunction;        /* Handler command function             */
  644.         HID      hid;               /* handler ID                           */
  645.         HSTREAM  hstream;           /* handle of stream instance            */
  646.      } PARM_DISSYNC;
  647. typedef PARM_DISSYNC    FAR  *PPARM_DISSYNC;
  648.  
  649.  
  650. /****************************************************************************/
  651. #define SHC_GET_TIME              11L
  652.      typedef struct _PARM_GTIME { /* shcgti */
  653.         ULONG    ulFunction;        /* Handler command function             */
  654.         HID      hid;               /* handler ID                           */
  655.         HSTREAM  hstream;           /* handle of stream instance            */
  656.         MMTIME   mmtimeCurrent;     /* Returns current stream time          */
  657.      } PARM_GTIME;
  658. typedef PARM_GTIME      FAR  *PPARM_GTIME;
  659.  
  660.  
  661. /****************************************************************************/
  662. #define SHC_GET_PROTOCOL          12L
  663.      typedef struct _PARM_GPROT { /* shcgpt */
  664.         ULONG    ulFunction;        /* Handler command function             */
  665.         HID      hid;               /* handler ID                           */
  666.         SPCBKEY  spcbkey;           /* key of SPCB                          */
  667.         PSPCB    pspcb;             /* ptr to SPCB (output)                 */
  668.      } PARM_GPROT;
  669. typedef PARM_GPROT      FAR  *PPARM_GPROT;
  670.  
  671.  
  672. /****************************************************************************/
  673. #define SHC_INSTALL_PROTOCOL      13L
  674.      typedef struct _PARM_INSTPROT { /* shcipt */
  675.         ULONG    ulFunction;        /* Handler command function             */
  676.         HID      hid;               /* handler ID                           */
  677.         SPCBKEY  spcbkey;           /* key of SPCB                          */
  678.         PSPCB    pspcb;             /* ptr to SPCB to install               */
  679.         ULONG    ulFlags;           /* Install / Deinstall flags            */
  680.      } PARM_INSTPROT;
  681. typedef PARM_INSTPROT   FAR  *PPARM_INSTPROT;
  682.  
  683.  
  684. /****************************************************************************/
  685. #define SHC_ENUMERATE_PROTOCOLS   14L
  686.      typedef struct _PARM_ENUMPROT { /* shcqpi */
  687.         ULONG    ulFunction;        /* Handler command function             */
  688.         HID      hid;               /* handler ID                           */
  689.         PVOID    paSPCBKeys;        /* ptr to buffer to fill with SPCB keys */
  690.         PULONG   pulNumSPCBKeys;    /* # of entries buffer on input,        */
  691.                                     /*  # of SPCB key on output.            */
  692.      } PARM_ENUMPROT;
  693. typedef PARM_ENUMPROT   FAR  *PPARM_ENUMPROT;
  694.  
  695.  
  696. /****************************************************************************/
  697. #define SHC_NEGOTIATE_RESULT      15L
  698.      typedef struct _PARM_NEGOTIATE { /* shcneg */
  699.         ULONG    ulFunction;        /* Handler command function             */
  700.         HID      hid;               /* handler ID                           */
  701.         HSTREAM  hstream;           /* handle of stream instance            */
  702.         PSPCB    pspcb;             /* Ptr to negotiated SPCB               */
  703.         ULONG    ulErrorStatus;     /* On error, indicates which field in the*/
  704.      } PARM_NEGOTIATE;              /* SPCB failed the negotiation.         */
  705. typedef PARM_NEGOTIATE  FAR  *PPARM_NEGOTIATE;
  706.  
  707.  
  708. /****************************************************************************/
  709. #define SHC_SENDMSG              16L
  710.      typedef struct _PARM_SNDMSG { /* shcsndmsg */
  711.         ULONG    ulFunction;        /* Handler command function             */
  712.         HID      hid;               /* handler ID                           */
  713.         HSTREAM  hstream;           /* handle of stream instance            */
  714.         ULONG    ulMsgType;         /* Stream handler message type          */
  715.         PVOID    pMsg;              /* Pointer to Message control block     */
  716.      } PARM_SNDMSG;
  717. typedef PARM_SNDMSG  FAR  *PPARM_SNDMSG;
  718.  
  719.  
  720. /****************************************************************************/
  721.  
  722.  
  723.  
  724. /* XLATOFF */
  725. #pragma pack()
  726. /* XLATON */
  727.