Changeset 526 for OCO/trunk/drv16/ioctl.cpp
- Timestamp:
- Jul 22, 2010, 9:33:17 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
OCO/trunk/drv16/ioctl.cpp
r486 r526 202 202 ULONG ulDevicetype; 203 203 204 #ifdef DEBUG205 204 dprintf(("IACapability: src type: 0x%lx, op %d",p->ulDataType, (USHORT)p->ulOperation)); 206 #endif207 205 208 206 // get the hardware device type based on the datatype and operation 209 207 ulDevicetype = GetHardwareType((USHORT)p->ulDataType,(USHORT)p->ulOperation,LDev); 210 208 211 #ifdef DEBUG 212 // dprintf(("IACapability: dev type: %ld, ldev %d",ulDevicetype, LDev)); 213 #endif 209 //dprintf(("IACapability: dev type: %ld, ldev %d",ulDevicetype, LDev)); 214 210 215 211 // Tell the caller we support this IOCTL … … 231 227 p->ulSamplingRate = HZ_44100; 232 228 // 233 dprintf(("IACapability: Error support"));229 rprintf(("IACapability: Error support")); 234 230 prp->usStatus |= RPERR; 235 231 } 236 232 } 237 233 else { 238 #ifdef DEBUG 239 // dprintf(("IACapability: Error get HW obj")); 240 #endif 234 //dprintf(("IACapability: Error get HW obj")); 241 235 //PS+++ filling to our parameters as say mmpm2.inf for returning error in this call 242 236 // (for HDA only!!!!!) … … 270 264 if (p->usIOCtlRequest != AUDIO_CHANGE) 271 265 { 272 dprintf(("IAudioControl: Error support req:%x",p->usIOCtlRequest));266 rprintf(("IAudioControl: Error support req:%x",p->usIOCtlRequest)); 273 267 p->sReturnCode = INVALID_REQUEST; 274 268 prp->usStatus |= RPERR | RPBADCMD; … … 284 278 if(addr >= 0x10000UL) 285 279 { 286 dprintf(("Invalid MCI_AUDIO_CHANGE pnt %lx!!", (ULONG)pAudChange));280 rprintf(("Invalid MCI_AUDIO_CHANGE pnt %lx!!", (ULONG)pAudChange)); 287 281 p->sReturnCode = INVALID_REQUEST; 288 282 prp->usStatus |= RPERR | RPBADCMD; … … 296 290 if(addr >= 0x10000UL) 297 291 { 298 dprintf(("Invalid MCI_TRACK_INFO pnt %lx!!", (ULONG)pMasterVol));292 rprintf(("Invalid MCI_TRACK_INFO pnt %lx!!", (ULONG)pMasterVol)); 299 293 p->sReturnCode = INVALID_REQUEST; 300 294 prp->usStatus |= RPERR | RPBADCMD; … … 304 298 pStream = FindStream_fromFile((ULONG) prp->s.ioctl.usSysFileNum); 305 299 if(pStream == NULL) { 306 dprintf(("IAudioControl stream %lx not found!", (ULONG) prp->s.ioctl.usSysFileNum));300 rprintf(("IAudioControl stream %lx not found!", (ULONG) prp->s.ioctl.usSysFileNum)); 307 301 DebugInt3(); 308 302 return; … … 316 310 volume = pAudChange->lVolume >> 16UL; 317 311 volume = (volume*OSS32_MAX_VOLUME)/0x7FFFUL; 318 //dprintf(("Set stream volume of %x to %d", prp->s.ioctl.usSysFileNum, volume));312 //dprintf(("Set stream volume of %x to %d", prp->s.ioctl.usSysFileNum, volume)); 319 313 pStream->SetProperty(PROPERTY_VOLUME, MAKE_VOLUME_LR(volume, volume)); 320 314 } … … 390 384 if(DevHelp_VerifyAccess(SELECTOROF(pInit), sizeof(MCI_AUDIO_INIT), OFFSETOF(pInit), VERIFY_READWRITE)) 391 385 { 392 dprintf(("Invalid MCI_AUDIO_INIT pnt %lx!!", (ULONG)pInit));386 rprintf(("Invalid MCI_AUDIO_INIT pnt %lx!!", (ULONG)pInit)); 393 387 prp->usStatus |= RPERR | RPBADCMD; 394 388 return; … … 411 405 if (audioCaps.ulSupport != SUPPORT_SUCCESS) 412 406 { 413 dprintf(("IDirectAudio: DevCaps failed"));407 rprintf(("IDirectAudio: DevCaps failed")); 414 408 pInit->sReturnCode = INVALID_REQUEST; 415 409 prp->usStatus |= RPERR; … … 419 413 else 420 414 { 421 dprintf(("IDirectAudio: HW DevCaps failed"));415 rprintf(("IDirectAudio: HW DevCaps failed")); 422 416 pInit->sReturnCode = INVALID_REQUEST; 423 417 prp->usStatus |= RPERR; … … 427 421 pStream = new DWAVESTREAM(AUDIOHW_WAVE_PLAY, pInit, prp->s.ioctl.usSysFileNum, MixerStreamId); 428 422 if(pStream == NULL) { 429 //dprintf(("IDirectAudio: pStream"));423 //dprintf(("IDirectAudio: pStream")); 430 424 DebugInt3(); 431 425 pInit->sReturnCode = INVALID_REQUEST; … … 437 431 { 438 432 delete pStream; 439 //dprintf(("IlDirectAudio: IsEverythingOk"));433 //dprintf(("IlDirectAudio: IsEverythingOk")); 440 434 DebugInt3(); 441 435 pInit->sReturnCode = INVALID_REQUEST; … … 463 457 if(DevHelp_VerifyAccess(SELECTOROF(pInit), sizeof(MCI_AUDIO_INIT), OFFSETOF(pInit), VERIFY_READWRITE)) 464 458 { 465 dprintf(("Invalid MCI_AUDIO_INIT pnt %lx!!", (ULONG)pInit));459 rprintf(("Invalid MCI_AUDIO_INIT pnt %lx!!", (ULONG)pInit)); 466 460 prp->usStatus |= RPERR | RPBADCMD; 467 461 return; … … 484 478 if (audioCaps.ulSupport != SUPPORT_SUCCESS) 485 479 { 486 dprintf(("IlDirectAudio: DevCaps failed"));480 rprintf(("IlDirectAudio: DevCaps failed")); 487 481 prp->usStatus |= RPERR; 488 482 pInit->sReturnCode = INVALID_REQUEST; 489 483 return; 490 484 } 491 //dprintf(("IoctlDirectAudio ret0"));485 //dprintf(("IoctlDirectAudio ret0")); 492 486 pInit->sReturnCode = 0; 493 487 return; 494 488 } 495 489 else { 496 dprintf(("IoctlDirectAudio err req"));490 rprintf(("IoctlDirectAudio err req")); 497 491 pInit->sReturnCode = INVALID_REQUEST; 498 492 prp->usStatus |= RPERR; … … 508 502 if(DevHelp_VerifyAccess(SELECTOROF(lpCaps), sizeof(OSS32_DEVCAPS), OFFSETOF(lpCaps), VERIFY_READWRITE)) 509 503 { 510 dprintf(("Invalid OSS32_DEVCAPS pnt %lx!!", (ULONG)lpCaps));504 rprintf(("Invalid OSS32_DEVCAPS pnt %lx!!", (ULONG)lpCaps)); 511 505 prp->usStatus |= RPERR | RPBADCMD; 512 506 return; … … 519 513 { 520 514 pHWobj->DevCaps(lpCaps); 521 //dprintf(("IoctlDirectAudio ret1"));515 //dprintf(("IoctlDirectAudio ret1")); 522 516 return; 523 517 } … … 525 519 { 526 520 prp->usStatus |= RPERR; 527 //dprintf(("IoctlDirectAudio ret err1"));521 //dprintf(("IoctlDirectAudio ret err1")); 528 522 return; 529 523 } … … 534 528 if(pStream == NULL) 535 529 { 536 dprintf(("IDirectAudio stream %lx not found!", (ULONG) prp->s.ioctl.usSysFileNum));530 rprintf(("IDirectAudio stream %lx not found!", (ULONG) prp->s.ioctl.usSysFileNum)); 537 531 DebugInt3(); 538 532 prp->usStatus |= RPERR | RPBADCMD; … … 545 539 if(DevHelp_VerifyAccess(SELECTOROF(pDAudioCmd), sizeof(DAUDIO_CMD), OFFSETOF(pDAudioCmd), VERIFY_READWRITE)) 546 540 { 547 dprintf(("Invalid DAUDIO_CMD pnt %lx!!", (ULONG)pDAudioCmd));541 rprintf(("Invalid DAUDIO_CMD pnt %lx!!", (ULONG)pDAudioCmd)); 548 542 prp->usStatus |= RPERR | RPBADCMD; 549 543 return; … … 553 547 { 554 548 case DAUDIO_CLOSE: 555 //dprintf(("ID close"));549 //dprintf(("ID close")); 556 550 delete pStream; 557 551 break; … … 559 553 case DAUDIO_SETVOLUME: 560 554 { 561 //dprintf(("ID SetVolume"));555 //dprintf(("ID SetVolume")); 562 556 pStream->SetProperty(PROPERTY_VOLUME, MAKE_VOLUME_LR(pDAudioCmd->Vol.VolumeL, pDAudioCmd->Vol.VolumeR)); 563 557 break; … … 566 560 case DAUDIO_GETVOLUME: 567 561 { 568 //dprintf(("ID GetVolume"));562 //dprintf(("ID GetVolume")); 569 563 pDAudioCmd->Vol.VolumeL = GET_VOLUME_L(pStream->GetProperty(PROPERTY_VOLUME)); 570 564 pDAudioCmd->Vol.VolumeR = GET_VOLUME_R(pStream->GetProperty(PROPERTY_VOLUME)); … … 582 576 else 583 577 { 584 dprintf(("ID Start rc1"));578 rprintf(("ID Start rc1")); 585 579 rc = 1; //fail 586 580 } … … 616 610 case DAUDIO_GETPOS: 617 611 { 618 //dprintf(("ID GetPos"));612 //dprintf(("ID GetPos")); 619 613 pDAudioCmd->Pos.ulCurrentPos = pStream->GetCurrentPos(); 620 614 pDAudioCmd->Pos.ulWritePos = pStream->GetCurrentWritePos(); … … 624 618 case DAUDIO_ADDBUFFER: 625 619 { 626 //dprintf(("ID AddBuffer"));620 //dprintf(("ID AddBuffer")); 627 621 rc = pStream->Write((PSTREAMBUF)pDAudioCmd->Buffer.lpBuffer, pDAudioCmd->Buffer.ulBufferLength); 628 622 break; … … 631 625 case DAUDIO_SETPROPERTY: 632 626 { 633 //dprintf(("ID SetProp"));627 //dprintf(("ID SetProp")); 634 628 rc = pStream->SetProperty((USHORT)pDAudioCmd->SetProperty.type, pDAudioCmd->SetProperty.value); 635 629 break; … … 640 634 DDCMDREGISTER reg; 641 635 642 //dprintf(("ID Reg"));636 //dprintf(("ID Reg")); 643 637 reg.ulFunction = DDCMD_REG_STREAM; 644 638 reg.hStream = pDAudioCmd->Thread.hSemaphore; … … 651 645 case DAUDIO_DEREGISTER_THREAD: 652 646 { 653 //dprintf(("ID DeReg"));647 //dprintf(("ID DeReg")); 654 648 pStream->DeRegister(); 655 649 break; … … 657 651 658 652 case DAUDIO_QUERYVERSION: 659 //dprintf(("ID qVer"));653 //dprintf(("ID qVer")); 660 654 pDAudioCmd->Version.ulVersion = DAUDIO_VERSION; 661 655 break; … … 664 658 if(rc) 665 659 { 666 //dprintf(("IoctlDirectAudio ret err rc=%ld",rc));660 //dprintf(("IoctlDirectAudio ret err rc=%ld",rc)); 667 661 prp->usStatus |= RPERR | RPBADCMD; 668 662 return; 669 663 } 670 //dprintf(("IoctlDirectAudio ret Ok"));664 //dprintf(("IoctlDirectAudio ret Ok")); 671 665 return; 672 666 } … … 687 681 extern "C" void StrategyIoctl(PREQPACKET prp, USHORT LDev) 688 682 { 689 #ifdef DEBUG690 683 dprintf(("StrategyIoctl:cat:0x%x, code:0x%x cd %d gd %d", prp->s.ioctl.bCategory, prp->s.ioctl.bCode, current_device, LDev)); 691 #endif692 684 switch (prp->s.ioctl.bCategory) { 693 685 case DAUDIO_IOCTL_CAT: /* 0x91 */ … … 721 713 } 722 714 723 #ifdef DEBUG 724 dprintf(("StrategyIoctl:ret:0x%x", (USHORT)prp->usStatus)); 725 #endif 715 //dprintf(("StrategyIoctl:ret:0x%x", (USHORT)prp->usStatus)); 726 716 return; 727 717 }
Note:
See TracChangeset
for help on using the changeset viewer.