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