#1 Burning Software

It is currently Wed Dec 18, 2024 10:50 pm

All times are UTC




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Locked Files after burning
PostPosted: Tue Feb 09, 2010 3:06 am 
Offline

Joined: Tue Oct 31, 2006 12:25 am
Posts: 43
Hi

I'm using Starburn 10.0.0.4128 under Delphi 2010 to burn DVD video files + some proprietary files to a disk. However i am finding that after burning and releasing the burner the files that have been burned are still locked. They remain locked until i restart the application.

This is the method i use for building the UDF file tree:
Code:
procedure TsbBurner.PrepareDVDFilesFileTree(sDiscLabel:string;
                                            sPublisherName:string;
                                            ssVideoTSFiles:TStrings;       // Files for VIDEO_TS folder
                                            ssRootFiles:TStrings;          // Files for Root folder
                                            sOtherFolder:string;           // Name of other folder
                                            ssOtherFolderFiles:TStrings);  // Files for Other folder
var
  l__ULONG__Status : DWORD;   
  l__CHAR__ExceptionText : Packed Array[ 1..1024 ] Of Char; 
  l__EXCEPTION_NUMBER : EXCEPTION_NUMBER;
  pVideoTSFolder:pointer;
  pAudioTSFolder:pointer;
  pOtherFolder:pointer;   
  l__PVOID__NewNode: Pointer;
  sMessage: string;
  i: Integer;
  FYear, FMonth, FDay: Word;
  FHour, FMin, FSec, FMSec: Word;

  procedure _AddFile(sFilename:string;pFolder:Pointer;sNameOnDisk:string='');
  var
    pNameOnDisk: Pointer;
  begin
    if sNameOnDisk='' then
      pNameOnDisk:=nil
    else
      pNameOnDisk:=Pchar(sNameOnDisk);

    l__EXCEPTION_NUMBER :=
            StarBurn_UDF_Add(
                PCHAR( @l__CHAR__ExceptionText[1] ),
                sizeof( l__CHAR__ExceptionText ),
                l__ULONG__Status,
                Pchar(sFilename),
                pNameOnDisk,
                pFolder,
                l__PVOID__NewNode
                );

    // Check for success
    If l__EXCEPTION_NUMBER <> EN_SUCCESS Then
    Begin
      sMessage:= Format('%s (%d,%d): %s',
                        ['Failed to add '+sFilename,
                         Integer(l__EXCEPTION_NUMBER),
                         l__ULONG__Status,
                         PAnsiChar(@l__CHAR__ExceptionText[1])]);
      Logger.Log(sMessage);
      Raise Exception.Create(sMessage);
    End;
  end;

begin
  ShutDownFileTree;
  l__ULONG__Status := ERROR_GEN_FAILURE;

  ZeroMemory(@l__CHAR__ExceptionText, sizeof( l__CHAR__ExceptionText));
  FDVDFilesRootFolder:=nil;
  ZeroMemory(@UDFControlBlock, sizeof( UDF_CONTROL_BLOCK));

  Logger.Log('Formatting folders...');

  // Format root directory
  l__EXCEPTION_NUMBER :=
            StarBurn_UDF_Add(
                PCHAR( @l__CHAR__ExceptionText[1] ),
                sizeof( l__CHAR__ExceptionText ),
                l__ULONG__Status,
            NIL,
            NIL,
            NIL,
            FDVDFilesRootFolder
            );

  If l__EXCEPTION_NUMBER <> EN_SUCCESS Then
  Begin
    sMessage:= Format('%s (%d,%d): %s',
                      ['Failed to create Root',
                       Integer(l__EXCEPTION_NUMBER),
                       l__ULONG__Status,
                       PAnsiChar(@l__CHAR__ExceptionText[1])]);
    Logger.Log(sMessage);
    Raise Exception.Create(sMessage);
  End;

  // Format VIDEO_TS directory
  l__EXCEPTION_NUMBER :=
            StarBurn_UDF_Add(
                PCHAR( @l__CHAR__ExceptionText[1] ),
                sizeof( l__CHAR__ExceptionText ),
                l__ULONG__Status,     
            nil,
            'VIDEO_TS',
            FDVDFilesRootFolder,
            pVideoTSFolder
            );

  If l__EXCEPTION_NUMBER <> EN_SUCCESS Then
  Begin
    sMessage:= Format('%s (%d,%d): %s',
                      ['Failed to create VIDEO_TS',
                       Integer(l__EXCEPTION_NUMBER),
                       l__ULONG__Status,
                       PAnsiChar(@l__CHAR__ExceptionText[1])]);
    Logger.Log(sMessage);
    Raise Exception.Create(sMessage);
  End;

  // Format AUDIO_TS directory
  l__EXCEPTION_NUMBER :=
            StarBurn_UDF_Add(
                PCHAR( @l__CHAR__ExceptionText[1] ),
                sizeof( l__CHAR__ExceptionText ),
                l__ULONG__Status,     
            nil,
            'AUDIO_TS',
            FDVDFilesRootFolder,
            pAudioTSFolder
            );     

  If l__EXCEPTION_NUMBER <> EN_SUCCESS Then
  Begin
    sMessage:= Format('%s (%d,%d): %s',
                      ['Failed to create AUDIO_TS',
                       Integer(l__EXCEPTION_NUMBER),
                       l__ULONG__Status,
                       PAnsiChar(@l__CHAR__ExceptionText[1])]);
    Logger.Log(sMessage);
    Raise Exception.Create(sMessage);
  End;

  // Format OTHER directory
  if (ssOtherFolderFiles<>nil) and (ssOtherFolderFiles.count>0) then
  begin
    if sOtherFolder='' then Raise Exception.Create('Other folder name unspecified');
    l__EXCEPTION_NUMBER :=
            StarBurn_UDF_Add(
                PCHAR( @l__CHAR__ExceptionText[1] ),
                sizeof( l__CHAR__ExceptionText ),
                l__ULONG__Status,
            nil,
            pchar(sOtherFolder),
            FDVDFilesRootFolder,
            pOtherFolder
            );

    If l__EXCEPTION_NUMBER <> EN_SUCCESS Then
    Begin
      sMessage:= Format('%s (%d,%d): %s',
                        ['Failed to create '+sOtherFolder,
                         Integer(l__EXCEPTION_NUMBER),
                         l__ULONG__Status,
                         PAnsiChar(@l__CHAR__ExceptionText[1])]);
      Logger.Log(sMessage);
      Raise Exception.Create(sMessage);
    End;
  end;


  Logger.Log('Formatting files...');

  // VIDEO_TS
  for i := 0 to ssVideoTSFiles.Count - 1 do
    _AddFile(ssVideoTSFiles[i],pVideoTSFolder);

  // OTHER_TS
  if (ssOtherFolderFiles<>nil) and (ssOtherFolderFiles.count>0) then
    for i := 0 to ssOtherFolderFiles.Count - 1 do
      _AddFile(ssOtherFolderFiles[i],pOtherFolder);

  // Root
  if (ssRootFiles<>nil) then
    for i := 0 to ssRootFiles.Count - 1 do
      _AddFile(ssRootFiles[i],FDVDFilesRootFolder);


  //
  // Try to create UDF
  //
  DecodeDate(Date, FYear, FMonth, FDay);
  DecodeTime(Now, FHour, FMin, FSec, FMSec);

  l__EXCEPTION_NUMBER :=
      StarBurn_UDF_CreateEx(
          StarBurn_UDF_GetNodeObject(FDVDFilesRootFolder), // This is ROOT
          NIL,//@pVideoTSFolder, // This is VIDEO_TS and not ROOT, for VIDEO_TS listing
          NIL,//@pAudioTSFolder, // This is AUDIO_TS and not ROOT, for AUDIO_TS listing
          @UDFControlBlock,
          PCHAR( @l__CHAR__ExceptionText[1] ),
          sizeof( l__CHAR__ExceptionText ),
          l__ULONG__Status,
          PChar(sDiscLabel),
          PChar(sPublisherName),
          PChar(sPublisherName+' Burning Library'),
          FYear, FMonth, FDay,
          FHour, FMin, FSec, FMSec
          );
  FUDFControlBlockCreated := True;

  If l__EXCEPTION_NUMBER <> EN_SUCCESS Then
  Begin
    sMessage:= Format('%s (%d,%d): %s',
                      ['Create UDF failed',
                       Integer(l__EXCEPTION_NUMBER),
                       l__ULONG__Status,
                       PAnsiChar(@l__CHAR__ExceptionText[1])]);

    Logger.Log(sMessage);
    Raise Exception.Create(sMessage);
  End;
end;


Free it as follows:

Code:
procedure TsbBurner.ShutDownFileTree;
begin
  // Was file tree allocated
  if (ISO9660JolietFileTree <> nil) then
  begin
    Logger.Log('Destroy: FileTree');
    StarBurn_Destroy(ISO9660JolietFileTree);
    ISO9660JolietFileTree := nil;
  end;

  // Destroy UDF
  If FUDFControlBlockCreated and (UDFControlBlock.m__PVOID__Body <> nil) Then
  begin
    Logger.Log('Destroy: UDFControlBlock');
    StarBurn_UDF_Destroy(StarBurn_UDF_GetNodeObject(FDVDFilesRootFolder),
                         @UDFControlBlock);
    FDVDFilesRootFolder:= nil;
    FUDFControlBlockCreated := False;
  end;
end;



As well as performing the usual functions for unlocking and releasing the burner.

Thanks


Top
 Profile  
 
 Post subject: Re: Locked Files after burning
PostPosted: Tue Feb 09, 2010 10:46 am 
Offline
Site Admin

Joined: Fri Jun 18, 2004 12:03 am
Posts: 4089
Location: British Virgin Islands
1) We don't support V10 for at least two years or so... Update to V12 and re-new your ASM plan to get support.

2) You don't destroy UDF file tree object after burning so keep all file handles opened. That's why files are "locked" until you don't close your app (so OS will close handles for you).


Top
 Profile  
 
 Post subject: Re: Locked Files after burning
PostPosted: Wed Feb 10, 2010 12:01 am 
Offline

Joined: Tue Oct 31, 2006 12:25 am
Posts: 43
1. I can't see a link for purchasing an update for my existing license. Please advise.

2. Thanks.


Top
 Profile  
 
 Post subject: Re: Locked Files after burning
PostPosted: Wed Feb 10, 2010 8:11 am 
Offline
Site Admin

Joined: Fri Jun 18, 2004 12:03 am
Posts: 4089
Location: British Virgin Islands
I've dropped and e-mail to you and sales. They should contanct you ASAP.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 51 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group