Skip to main content

 none
E_IMAPI_RECORDER_MEDIA_BUSY exception what is ? RRS feed

  • Question

  • I have implement the IMAPI2 interface on DELPHI , when call the procedure Write(IStream) with CD-RW and USB driver , i catch the exception E_IMAPI_RECORDER_MEDIA_BUSY 

    what is this ? why i have this exceptoin ? 

    example of code write

      if Not CheckAssignedAndActivationDrive(IndexDriver) then Exit;
    
      DiscStreamISO := nil;
      DiscStream    := nil;
      IsoLoader := TMsftIsoImageManager.Create(nil);
      Try
        Try
          if IsoLoader.SetPath(PathIso) <> S_OK then
          begin
            Exit;
          end;
    
          if IsoLoader.DefaultInterface.Get_Stream(DiscStream) <> S_OK then
          begin
            Exit;
          end;
    
          SupportWriteSppedDescriptors := DataWriter.SupportedWriteSpeedDescriptors;
          SafeArrayGetLBound(SupportWriteSppedDescriptors, 1, LBound);
          SafeArrayGetUBound(SupportWriteSppedDescriptors, 1, HBound);
          RequestedSectorsPerSecond := -1;
          UsePCav                   := False;
          {Rescrivibili}
          for I := LBound to HBound do
          begin
            SafeArrayGetElement(SupportWriteSppedDescriptors, I, vTmp);
    
            if VarIsNull(vTmp) then Continue;
            if not Supports(vTmp, IWriteSpeedDescriptor, test) then Continue;
            
            RequestedSectorsPerSecond := test.WriteSpeed;
            UsePCav                   := test.RotationTypeIsPureCAV;
          end;
          DoOnProgressBurnCustom(LanguageModule.siLangLinked1.GetTextOrDefault('IDS_326' (* 'Avvio masterizzazione...' *) ));
          DataWriter.BufferUnderrunFreeDisabled := False;
          DataWriter.SetWriteSpeed(RequestedSectorsPerSecond,UsePCav);
          
          FWriting := True;
          DataWriter.Write(IMAPI2_TLB.IStream(DiscStream));
          StatusWrite := SbBurned;
          DriveEject(IndexDriver);
        Except on E : Exception do
          begin
            if assigned(DataWriter) then
              DataWriter.CancelWrite;
            StatusWrite := SbError;
          end;
        End;
      Finally
        if Assigned(DiscStream) then
          DiscStream._Release;
        IsoLoader.Free;
      End;

     
    Friday, November 3, 2017 12:57 AM