Ignore:
Timestamp:
Mar 23, 2001, 6:14:13 PM (24 years ago)
Author:
sandervl
Message:

Updates + fixes for DirectAudio interface

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sbliveos2/trunk/drv16/dwavestrm.cpp

    r167 r168  
    3333#include "malloc.h"
    3434
    35 
    3635void cdecl HookHandler(ULONG ulSysFileNum)
    3736{
     
    5756        DevHelp_VMFree((LIN)temp->pBuffptr);
    5857        DevHelp_VMUnLock(temp->linLock);
    59         free(temp->pLock);
    6058        delete temp;
     59
     60        temp = (PSTREAMBUFFEREX)pStream->qhReturn.PopHead();
    6161    }
    6262    return;
     
    6767{
    6868    PSTREAMBUFFEREX pStreamBuf;
    69     LIN   linAddr;
    70     PULONG pLock;
    71     ULONG PageListCount;
    72     LIN   linLock;
    73     int   rc;
     69    LIN             linAddr;
     70    PULONG          pLock;
     71    ULONG           PageListCount;
     72    LIN             linLock;
     73    int             rc;
    7474
    75     pLock = (PULONG)malloc(12);
    76     if(pLock == NULL) {
     75    pStreamBuf = new STREAMBUFFEREX(uLength, (PSTREAMBUF)0);
     76    if(pStreamBuf == NULL) {
    7777        DebugInt3();
    7878        return 1;
    7979    }
    8080
     81    pLock = &pStreamBuf->lock[0];
     82
    8183    rc = DevHelp_VirtToLin(SELECTOROF(pLock), OFFSETOF(pLock), &linLock);
    8284    if(rc) {
    8385        DebugInt3();
     86        delete pStreamBuf;
    8487        return rc;
    8588    }
     
    8891    if(rc) {
    8992        DebugInt3();
    90         DevHelp_VMFree(linAddr);
     93        delete pStreamBuf;
    9194        return rc;
    9295    }
     
    9598    if(rc) {
    9699        DebugInt3();
     100        DevHelp_VMUnLock(linLock);
     101        delete pStreamBuf;
    97102        return rc;
    98103    }
    99 
    100     pStreamBuf = new STREAMBUFFEREX(uLength, (PSTREAMBUF)linAddr, linLock, pLock);
     104    pStreamBuf->pBuffptr = (PSTREAMBUF)linAddr;
     105    pStreamBuf->linLock  = linLock;
    101106
    102107    return WAVESTREAM::Write((PSTREAMBUFFER)pStreamBuf);
     
    111116        if(ulStreamState == STREAM_STREAMING) {//means we're called during an interrupt
    112117            qhReturn.PushOnTail((PQUEUEELEMENT)temp);
    113             DevHelp_ArmCtxHook(hCtxHook, ulSysFileNum);
     118            DevHelp_ArmCtxHook(ulSysFileNum, hCtxHook);
    114119        }
    115120        else {
    116121            DevHelp_VMFree((LIN)temp->pBuffptr);
    117122            DevHelp_VMUnLock(temp->linLock);
    118             free(temp->pLock);
    119123            delete temp;
    120124        }
Note: See TracChangeset for help on using the changeset viewer.