Go Back   Club CDFreaks - Knowledge is Power > International Chat: Software related > Nero SDK Discussion Forum


Commercial message



Nero SDK Discussion Forum Discuss, problem with CD access if NeroSDK closed without inserted CD at International Chat: Software related forum; Hi, I have a problem with CD access after I close NeroSDK for several time now (see http://club.cdfreaks.com/showthread.php?t=127867 ). My further problem investigation brings some new facts and a new testprogram and so I create this new thread. Test program: Code:


Reply
 
Thread Tools
Old 21-04-2005   #1 (permalink)
CD Freaks Rookie
 
Join Date: May 2004
Posts: 43
problem with CD access if NeroSDK closed without inserted CD

Hi,

I have a problem with CD access after I close NeroSDK for several time now (see http://club.cdfreaks.com/showthread.php?t=127867). My further problem investigation brings some new facts and a new testprogram and so I create this new thread.

Test program:
Code:
#include "stdafx.h"
#include "NeroApiGlue.h"

NeroUserDlgInOut NERO_CALLBACK_ATTR UserDialog(void *pUserData, NeroUserDlgInOut type, void *data)
{
   printf ("UserDialog(type = %i) called\n",type);
   switch (type) {
   case DLG_AUTO_INSERT:         return DLG_RETURN_CONTINUE;  break;
   case DLG_DISCONNECT_RESTART:  return DLG_RETURN_ON_RESTART;break;
   case DLG_DISCONNECT:          return DLG_RETURN_CONTINUE;  break;
   case DLG_AUTO_INSERT_RESTART: return DLG_RETURN_EXIT;      break;
   case DLG_RESTART:             return DLG_RETURN_EXIT;      break;
   case DLG_SETTINGS_RESTART:    return DLG_RETURN_CONTINUE;  break;
   case DLG_OVERBURN:            return DLG_RETURN_TRUE;      break;
   case DLG_AUDIO_PROBLEMS:      return DLG_RETURN_EXIT;      break;
   case DLG_FILESEL_IMAGE:
      {
         strcpy((char*)data,"test.txt");
         return DLG_RETURN_TRUE; 
         break;
      }
   case DLG_WAITCD:
      {
         NERO_WAITCD_TYPE waitcdType = (NERO_WAITCD_TYPE) (int)data;
         char *waitcdString = NeroGetLocalizedWaitCDTexts (waitcdType);
         printf("waitcd: %s\n",waitcdString);
         NeroFreeMem(waitcdString);
         return DLG_RETURN_EXIT;
         break;
      }
   default: break;
   }
   return DLG_RETURN_EXIT;
}

BOOL NERO_CALLBACK_ATTR ProgressCallback(void *pUserData, DWORD dwProgressInPercent)
{
   printf("progress callback %i %", dwProgressInPercent);
   return true;
}

BOOL NERO_CALLBACK_ATTR AbortedCallback(void *pUserData)
{
   return FALSE;
}

int main(int argc, char* argv[])
{
   printf("Hello World!\n");
   if (!NeroAPIGlueConnect (NULL)) {
      printf("NeroAPIGlueConnect failed!\n");
      return -1;
   }
   
   char pcNeroFilesPath[128];
   char pcVendor[128];
   char pcSoftware[128];
   char pcLanguageFile[128];
   
   strcpy(pcNeroFilesPath, "NeroFiles");
   strcpy(pcVendor, "ahead");
   strcpy(pcSoftware, "Nero - Burning Rom");
   strcpy(pcLanguageFile, "Nero.txt");
   
   NERO_SETTINGS NeroSettings;
   memset(&NeroSettings, 0, sizeof(NeroSettings));
   NeroSettings.nstNeroFilesPath = pcNeroFilesPath;
   NeroSettings.nstVendor = pcVendor;
   NeroSettings.nstSoftware = pcSoftware;
   NeroSettings.nstUserDialog.ncCallbackFunction = UserDialog;
   NeroSettings.nstUserDialog.ncUserData = NULL;
   NeroSettings.nstLanguageFile =pcLanguageFile;
   NeroSettings.nstIdle.ncCallbackFunction = AbortedCallback;
   NeroSettings.nstIdle.ncUserData = NULL;
   
   NEROAPI_INIT_ERROR initErr = NeroInit (&NeroSettings, NULL);
   if (initErr!=NEROAPI_INIT_OK) {
      printf("NeroInit failed! errorcode = %i\n",initErr);
      NeroAPIGlueDone();
      return -2;
   }
   
   long DriveCount = 0;
   NERO_SCSI_DEVICE_INFOS* pDeviceInfos = NeroGetAvailableDrivesEx (MEDIA_CD, NULL);
   if (pDeviceInfos != NULL) {
      if (pDeviceInfos->nsdisNumDevInfos > 0) {
         for (DWORD dDeviceCounter = 0; (dDeviceCounter < pDeviceInfos->nsdisNumDevInfos); dDeviceCounter++) {
            NERO_SCSI_DEVICE_INFO devInfo=pDeviceInfos->nsdisDevInfos[dDeviceCounter];
            if ((devInfo.nsdiDevType == NEA_SCSI_DEVTYPE_WORM)&&
               ((devInfo.nsdiCapabilities & NSDI_IMAGE_RECORDER)==0)) 
            {
               DriveCount++;
            }
         }
      }
      else DriveCount = 0;
      NeroFreeMem(pDeviceInfos);
   }
   else DriveCount = -99;
   
   printf("Nero found %i drives.\n",DriveCount);
   
   char* ErrorLog = NeroGetErrorLog();
   printf("%s\n",ErrorLog);
   NeroFreeMem(ErrorLog);
   NERO_DRIVE_ERROR DriveError;
   NeroGetLastDriveError(&DriveError,NULL);
   printf("drive errror: %i\n",DriveError);
   
   printf("\nNeroSDK still open.\nPress ENTER to close...\n");
   getchar();
   
   NeroClearErrors();
   if(NeroDone()) printf("memory leaks detected by NeroDone()\n");
   NeroAPIGlueDone();
   
   printf("\nNeroSDK closed.\nPress ENTER to exit...\n");
   getchar();
   return 0;
}
My test program open NeroSDK, count CD writer, show Nero errorlog and close NeroSDK. This tasks are quite simple and so I think my code is correct. I insert a user input break before and after NeroDone().

I detect now, that if during NeroDone() (between my two user input breaks) no cd is inserted, then I can't access any cd with the windows explorer when my program stands at the second user input break ("NeroSDK closed. Press ENTER to exit..."). The status of the cd drive (cd or no cd present) during getting drive information seems to be irrelevant. You can start with a inserted CD and eject this CD at the first break ("NeroSDK still open. Press ENTER to close...") or you start without a CD, the result is the same.
After I close my application anythings is correct with the cd access, but between the close of NeroSDK and my application end can be much time.

To make it more difficult I detected that this behavoir occurs on some cddrives (mainly plextor drives but not only) every time and on other models of other manufactors not. I also detect a cd drive model (also a plextor) which produce this problem only if the cd drive tray is open during closing NeroSDK.

As you can read in my old thread http://club.cdfreaks.com/showthread.php?t=127867 the problem can also related to the hardware configuration

Can someone try my test program to see if my problem also occurs? Can someone help me to solve my problem in any way? If somebody need more information, please ask and I provide the wanted information.

PLEASE HELP ME
It is really annoying, not to be able to access CD drive after I close NeroSDK.

Bye,

Michael

PS: I try it with Nero 6.6.0.1, 6.6.0.6 and the new 6.6.0.12. Every version produce the problem.
__________________
some of my other unsolved NeroSDK problems:
SVCD plugin detection: http://club.cdfreaks.com/showthread.php?t=131226
Multisession time problem: http://club.cdfreaks.com/showthread.php?t=132537
May be someone can also help me with that problems.
michael2 is offline   Reply With Quote
Old 26-04-2005   #2 (permalink)
Moderator
 
Join Date: Jan 2005
Posts: 158
Re: problem with CD access if NeroSDK closed without inserted CD

This problem resides in the winaspi layer, which sometimes blocks windows mounting procedure, during it tries to obtain access to the drive.
Because of complexity of this problem the solution bypassing this winaspi limitation will unfortunatelly be available only in the next Nero upgrade.
__________________
czykit
Nero AG
czykit is offline   Reply With Quote
Old 29-04-2005   #3 (permalink)
New on Forum
 
Join Date: Apr 2005
Posts: 2
Re: problem with CD access if NeroSDK closed without inserted CD

Having same issue, when can we expect the next Nero Upgrade?
TonyVH is offline   Reply With Quote
Old 29-04-2005   #4 (permalink)
New on Forum
 
Join Date: Mar 2005
Posts: 4
Re: problem with CD access if NeroSDK closed without inserted CD

Same problem here, any information about a workaround would be great! I would also like to know when we can exspect the upgrade.
Thanks and best regards,
Ullrich
Ullrich is offline   Reply With Quote
Old 02-05-2005   #5 (permalink)
New on Forum
 
Join Date: Apr 2005
Posts: 2
Re: problem with CD access if NeroSDK closed without inserted CD

Solved the problem... Treat your application as you were writing a 'Nero' program. Create only 1 instant of nero and do not destroy it. Pass the pointers when you need to use it and everything should be fine.
TonyVH is offline   Reply With Quote
 
Reply

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
how to find Inserted Media is CD-R or CD-RW rajesri Nero SDK Discussion Forum 5 31-03-2008 03:31
make boot cd with further release of NeroSDK Joerg Tiedemann Nero SDK Discussion Forum 5 18-11-2006 18:44
auto cd err - any cd is inserted yardicd CD Freaks Living Room 2 18-10-2005 13:46
Problem with CD access after I use NeroAPI michael2 Nero SDK Discussion Forum 5 28-02-2005 18:24
- CD can eject but says CD not inserted ¿¿¡¡¿¿¡¡ Banana General Hardware Forum 0 28-03-2004 13:52


All times are GMT +2. The time now is 18:31.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.1.0