home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / header45.zip / ssm.h < prev    next >
C/C++ Source or Header  |  1999-03-15  |  43KB  |  809 lines

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