Ignore:
Timestamp:
Nov 4, 2009, 4:21:24 PM (16 years ago)
Author:
pasha
Message:

Rebuild buffers supply, fix DDCMD_WRITE with len=0 in WAVE chain, remove/add debug output, change DebugInt3 for debug/nondebug version, move unused code to unused directore

File:
1 edited

Legend:

Unmodified
Added
Removed
  • OCO/trunk/drv16/ssm_idc.cpp

    r396 r468  
    2929#include "event.hpp"
    3030#include <include.h>
    31 
     31#include <devhelp.h>
    3232
    3333extern "C" int open_strategy;
     
    4747
    4848      case DDCMD_SETUP: {
    49          ddprintf(("DDCMD_SETUP"));
    5049         if (!pstream)
    51             return ERROR_INVALID_STREAM;
     50         {
     51             dprintf(("DDCMD_SETUP err pstream"));
     52             return ERROR_INVALID_STREAM;
     53         }
    5254         PDDCMDSETUP p = (PDDCMDSETUP) pCommon;
    5355         SETUP_PARM __far *psp = (SETUP_PARM __far *) p->pSetupParm;
     
    5658           // if there is a flags field in the SETUP_PARM
    5759           // the tell MMPM it can send us 'RECURRING' events....
    58          if (p->ulSetupParmSize > sizeof(ULONG)) {
     60         if (p->ulSetupParmSize > sizeof(ULONG))
     61         {
     62//            dprintf(("DDCMD_SETUP ParmSize %ld", p->ulSetupParmSize));
    5963            psp->ulFlags = SETUP_RECURRING_EVENTS;
    6064         }
     
    7478         break;
    7579      }
    76       case DDCMD_WRITE: {
    77           PDDCMDREADWRITE p=(PDDCMDREADWRITE) pCommon;
     80      // Task time
     81      case DDCMD_WRITE:
     82      {
     83           PDDCMDREADWRITE p=(PDDCMDREADWRITE) pCommon;
     84           ULONG           Space;
    7885
    79          if (!pstream)
    80             return ERROR_INVALID_STREAM;
    81          ulReturnCode = pstream->Write((PSTREAMBUF) p->pBuffer,(unsigned) p->ulBufferSize);
    82          ddprintf(("DDCMD_WRITE %lx",p->ulBufferSize));
    83          if (ulReturnCode)
    84             return ulReturnCode;
     86           if (!pstream)
     87           {
     88              dprintf(("DDCMD_WRITE err stream %x", (USHORT)pstream));
     89              return ERROR_INVALID_STREAM;
     90           }
     91#ifdef PS_Thinking
     92           OSS16_WaveGetSpace(pstream->StreamId, &Space);
     93           ddprintf(("DDCMD_WRITE %lx space %lx",p->ulBufferSize, Space));
     94           if (Space < p->ulBufferSize)
     95           {
     96               DevHelp_ProcBlock (pstream->StreamId, 2, 0);
     97               ddprintf(("DDCMD_WRITE after %lx space %lx",p->ulBufferSize, Space));
     98           }
     99#endif
     100           ulReturnCode = pstream->Write((PSTREAMBUF) p->pBuffer,(unsigned) p->ulBufferSize);
     101//           ddprintf(("DDCMD_WRITE %lx rc=%ld",p->ulBufferSize, ulReturnCode));
     102           if (ulReturnCode)
     103              return ulReturnCode;
    85104         break;
    86105      }
    87106      case DDCMD_STATUS: {
    88          ddprintf(("DDCMD_STATUS"));
     107//         ddprintf(("DDCMD_STATUS"));
    89108         PDDCMDSTATUS p = (PDDCMDSTATUS) pCommon;
    90109         PSTATUS_PARM p2 = (PSTATUS_PARM) p->pStatus;
     
    92111           return ERROR_INVALID_STREAM;
    93112         p2->ulTime = pstream->GetCurrentTime();
     113//         ddprintf(("DDCMD_STATUS time:%ld",p2->ulTime));
    94114         break;
    95115      }
    96       case DDCMD_CONTROL: {
     116      case DDCMD_CONTROL:
     117      {
    97118         PDDCMDCONTROL p = (PDDCMDCONTROL) pCommon;
    98119         if (!pstream)
    99             return ERROR_INVALID_STREAM;
     120         {
     121             dprintf(("DDCMD_CONTROL err stream %x", (USHORT)pstream));
     122             return ERROR_INVALID_STREAM;
     123         }
    100124
    101          switch (p->ulCmd) {
     125         switch (p->ulCmd)
     126         {
    102127         case DDCMD_START:
    103128             ddprintf(("DDCMD_START"));
    104              return pstream->StartStream();
     129             ulReturnCode = pstream->StartStream();
     130             ddprintf(("DDCMD_START End rc=%ld",ulReturnCode));
     131             return ulReturnCode;
    105132         case DDCMD_STOP:
    106133             ddprintf(("DDCMD_STOP"));
     134             DevHelp_ProcBlock ((ULONG)p, 2, 0);
    107135             p->ulParmSize=sizeof(ULONG);
    108             return pstream->StopStream((PCONTROL_PARM)p->pParm);
     136             return pstream->StopStream((PCONTROL_PARM)p->pParm);
    109137         case DDCMD_PAUSE:
    110138             ddprintf(("DDCMD_PAUSE"));
     
    118146             return pstream->EnableEvent(p);
    119147         case DDCMD_DISABLE_EVENT:
    120              ddprintf(("DDCMD_DISABLE_EVENT"));
     148//             ddprintf(("DDCMD_DISABLE_EVENT"));
    121149             return pstream->DisableEvent(p);
    122150         case DDCMD_PAUSE_TIME:
    123              ddprintf(("DDCMD_PAUSE_TIME"));
     151//             ddprintf(("DDCMD_PAUSE_TIME"));
    124152             return pstream->PauseStreamTime();
    125153         case DDCMD_RESUME_TIME:
     
    130158         } /* endswitch */
    131159      }
    132       case DDCMD_REG_STREAM: {
    133          ddprintf(("DDCMD_REG_STREAM"));
     160      case DDCMD_REG_STREAM:
     161      {
     162         ddprintf(("DDCMD_REG_STREAM size:%lx countbuf:%lx",((PDDCMDREGISTER) pCommon)->ulBufSize, ((PDDCMDREGISTER) pCommon)->ulNumBufs));
    134163         if (pstream)
     164         {
     165             dprintf(("DDCMD_REG_STREAM err stream %x", (USHORT)pstream));
    135166             return ERROR_HNDLR_REGISTERED;
     167         }
    136168         pstream = FindStream_fromFile(((PDDCMDREGISTER) pCommon)->ulSysFileNum);
    137169         if (!pstream)
    138             return ERROR_STREAM_CREATION;
     170         {
     171             dprintf(("DDCMD_REG_STREAM1 err stream %x", (USHORT)pstream));
     172             return ERROR_STREAM_CREATION;
     173         }
    139174         ulReturnCode = pstream->Register((PDDCMDREGISTER) pCommon);
    140          //dprintf(("DDCMD_EntryPoint: DDCMD_REG_STREAM stream %x returned %d", (USHORT)pCommon->hStream, (USHORT)ulReturnCode));
    141175         if (ulReturnCode)
    142             return ERROR_STREAM_CREATION;
     176         {
     177             dprintf(("DDCMD_REG_STREAM err stream %x returned %d", (USHORT)pCommon->hStream, (USHORT)ulReturnCode));
     178             return ERROR_STREAM_CREATION;
     179         }
     180         ddprintf(("DDCMD_REG_STREAM end size:%lx countbuf:%lx",((PDDCMDREGISTER) pCommon)->ulBufSize, ((PDDCMDREGISTER) pCommon)->ulNumBufs));
    143181         break;
    144182      }
Note: See TracChangeset for help on using the changeset viewer.