Ignore:
Timestamp:
Nov 9, 2009, 2:36:35 AM (16 years ago)
Author:
pasha
Message:

Fix buffers overflow problem, check Flash10, fix some strange code

File:
1 edited

Legend:

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

    r468 r473  
    203203
    204204#ifdef DEBUG
    205 //   dprintf(("IACapability: src type: %d, op %d",(USHORT)p->ulDataType, (USHORT)p->ulOperation));
     205   dprintf(("IACapability: src type: 0x%lx, op %d",p->ulDataType, (USHORT)p->ulOperation));
    206206#endif
    207207
     
    210210
    211211#ifdef DEBUG
    212 //   dprintf(("IACapability: dev type: %d, ldev %d",ulDevicetype, LDev));
     212   dprintf(("IACapability: dev type: %ld, ldev %d",ulDevicetype, LDev));
    213213#endif
    214214
     
    223223   {
    224224      pHWobj->DevCaps(p);
    225       if (p->ulSupport != SUPPORT_SUCCESS) {
     225      if (p->ulSupport != SUPPORT_SUCCESS)
     226      {
     227         //PS+++ filling to our parameters as say mmpm2.inf for returning error in this call
     228         // (for HDA only!!!!!)
     229         p->ulDataType     = WAVE_FORMAT_4S16;
     230         p->ulChannels     = 2;
     231         p->ulSamplingRate = HZ_44100;
     232         //
    226233         dprintf(("IACapability: Error support"));
    227234         prp->usStatus |= RPERR;
     
    232239       dprintf(("IACapability: Error get HW obj"));
    233240#endif
     241      //PS+++ filling to our parameters as say mmpm2.inf for returning error in this call
     242      // (for HDA only!!!!!)
     243      p->ulDataType     = WAVE_FORMAT_4S16;
     244      p->ulChannels     = 2;
     245      p->ulSamplingRate = HZ_44100;
     246      //
    234247      p->ulSupport = UNSUPPORTED_DATATYPE;
    235248      prp->usStatus |= RPERR;
     
    367380void IoctlDirectAudio(PREQPACKET prp)
    368381{
    369     dprintf(("IoctlDirectAudio"));
     382    dprintf(("IoctlDirectAudio Code:0x%x",prp->s.ioctl.bCode));
    370383    if(prp->s.ioctl.bCode == DAUDIO_OPEN)
    371384    {
     
    396409        {
    397410            pHWobj->DevCaps(&audioCaps);
    398             if (audioCaps.ulSupport != SUPPORT_SUCCESS) {
     411            if (audioCaps.ulSupport != SUPPORT_SUCCESS)
     412            {
    399413                dprintf(("IDirectAudio: DevCaps failed"));
    400414                pInit->sReturnCode = INVALID_REQUEST;
     
    403417            }
    404418        }
    405         else {
     419        else
     420        {
     421            dprintf(("IDirectAudio: HW DevCaps failed"));
    406422            pInit->sReturnCode = INVALID_REQUEST;
    407423            prp->usStatus |= RPERR;
     
    418434        }
    419435
    420         if(!pStream->IsEverythingOk()) {
     436        if(!pStream->IsEverythingOk())
     437        {
    421438            delete pStream;
    422439            dprintf(("IlDirectAudio: IsEverythingOk"));
     
    465482        {
    466483            pHWobj->DevCaps(&audioCaps);
    467             if (audioCaps.ulSupport != SUPPORT_SUCCESS) {
     484            if (audioCaps.ulSupport != SUPPORT_SUCCESS)
     485            {
    468486                dprintf(("IlDirectAudio: DevCaps failed"));
    469487                prp->usStatus |= RPERR;
     
    471489                return;
    472490            }
     491            dprintf(("IoctlDirectAudio ret"));
    473492            pInit->sReturnCode = 0;
    474493            return;
    475494        }
    476495        else {
     496            dprintf(("IoctlDirectAudio err req"));
    477497            pInit->sReturnCode = INVALID_REQUEST;
    478498            prp->usStatus |= RPERR;
     
    499519        {
    500520            pHWobj->DevCaps(lpCaps);
    501             return;
    502         }
    503         else {
     521            dprintf(("IoctlDirectAudio ret1"));
     522            return;
     523        }
     524        else
     525        {
    504526            prp->usStatus |= RPERR;
     527            dprintf(("IoctlDirectAudio ret err1"));
    505528            return;
    506529        }
     
    509532
    510533    pStream = FindStream_fromFile((ULONG) prp->s.ioctl.usSysFileNum);
    511     if(pStream == NULL) {
     534    if(pStream == NULL)
     535    {
    512536        dprintf(("IDirectAudio stream %lx not found!", (ULONG) prp->s.ioctl.usSysFileNum));
    513537        DebugInt3();
     
    547571    case DAUDIO_START:
    548572    {
    549         if(numFreeStreams > 0) {
     573        if(numFreeStreams > 0)
     574        {
    550575              rc = pStream->StartStream();
    551576              if(!rc) numFreeStreams--;
     
    621646    }
    622647
    623     if(rc) {
     648    if(rc)
     649    {
     650        dprintf(("IoctlDirectAudio ret err rc=%ld",rc));
    624651        prp->usStatus |= RPERR | RPBADCMD;
    625652        return;
    626653    }
     654    dprintf(("IoctlDirectAudio ret Ok"));
    627655    return;
    628656}
     
    644672{
    645673#ifdef DEBUG
    646     dprintf(("StrategyIoctl:cat:0x%x, code:0x%x dev %d", prp->s.ioctl.bCategory, prp->s.ioctl.bCode, current_device));
     674    dprintf(("StrategyIoctl:cat:0x%x, code:0x%x cd %d gd %d", prp->s.ioctl.bCategory, prp->s.ioctl.bCode, current_device, LDev));
    647675#endif
    648676    if (prp->s.ioctl.bCategory == DAUDIO_IOCTL_CAT)
Note: See TracChangeset for help on using the changeset viewer.