home *** CD-ROM | disk | FTP | other *** search
/ PC Online 1999 November / PCONLINE_11_99.ISO / filesbbs / OS2 / ACDCR032.ZIP / source / launchandwrap.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1999-08-08  |  18.9 KB  |  540 lines

  1. /*
  2.  * This program is free software; you can redistribute it and/or modify
  3.  * it under the terms of the GNU General Public License as published by
  4.  * the Free Software Foundation; either version 2, or (at your option)
  5.  * any later version.
  6.  *
  7.  * This program is distributed in the hope that it will be useful,
  8.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  9.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  10.  * GNU General Public License for more details.
  11.  *
  12.  * You should have received a copy of the GNU General Public License
  13.  * along with this program; see the file COPYING.  If not, write to
  14.  * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
  15.  */
  16.  
  17. #include "audiofolder.hh"
  18. #include "audiofolderhelp.h"
  19.  
  20. #include <stdio.h>
  21.  
  22. extern char chrImage[CCHMAXPATH];/* Path to iso-image */
  23. extern char chrCDRecord[CCHMAXPATH];/* Path to cdrecord */
  24. extern char chrCDROptions[CCHMAXPATH];
  25. extern char chrGrabberPath[CCHMAXPATH];
  26. extern LONG lCDROptions;
  27. extern char chrInstallDir[CCHMAXPATH];
  28. extern LONG lMKOptions;
  29. extern BOOL bMultiSessionDone;
  30. extern char chosenMultiSessionCD[3];
  31. extern char chrMkisofs[CCHMAXPATH];/* Path to mkisofs */
  32. extern char chrMkisofsOptions[CCHMAXPATH];
  33.  
  34. HMODULE queryModuleHandle(void);
  35. void changeBackslash(char* text);
  36.  
  37.  
  38. PSZ buildWrapName(PSZ wrapperName);
  39. PSZ buildWriteParam(CWAudioFolder* thisPtr, PSZ trackname);
  40.  
  41. PSZ buildWrapName(PSZ wrapperName)
  42. {
  43.   char exename[CCHMAXPATH];
  44.  
  45.   /* Build full path */
  46.   sprintf(exename,"%s\\%s",chrInstallDir,wrapperName);      
  47.   return exename;
  48. }
  49.  
  50. void changeSpace(char* text)
  51. {
  52.   char * chrPtr;
  53.   
  54.   chrPtr=strchr(text,' ');
  55.  
  56.   while(chrPtr!=NULL) {
  57.     *chrPtr='^';
  58.     chrPtr=strchr(text,' ');
  59.   }
  60. }
  61.  
  62. PSZ buildAudioWriteParam(CWAudioFolder* thisPtr, PSZ trackname)
  63. {    
  64.   char chrParams[CCHMAXPATH*2];
  65.   ULONG ulWriteFlagsLocal;
  66.  
  67.   if(thisPtr)
  68.     ulWriteFlagsLocal=thisPtr->cwQueryWriteFlags();
  69.   
  70.   sprintf(chrParams,"%s -audio",chrCDROptions);
  71.   if(ulWriteFlagsLocal & IDWF_DUMMY)
  72.     sprintf(chrParams,"%s -dummy",chrParams);
  73.   if(ulWriteFlagsLocal & IDWF_PAD)
  74.     sprintf(chrParams,"%s -pad",chrParams);
  75.   if(thisPtr->bWrite+1 == thisPtr->aWrite) {
  76.     if(ulWriteFlagsLocal & IDWF_NOFIX)
  77.       sprintf(chrParams,"%s -nofix",chrParams);
  78.   }
  79.   else
  80.     sprintf(chrParams,"%s -nofix",chrParams);/* -nofix for all but the last track */
  81.   if(ulWriteFlagsLocal & IDWF_PREEMP)
  82.     sprintf(chrParams,"%s -preemp",chrParams);
  83.   /* The ' will be replaced with " in cdr2lnch.exe to allow spaces in track names.
  84.      Included " are eaten by DosStartSession() so the track name would be broken.
  85.      The ^ included by changeSpace() for every space (' ') in the track name is
  86.      necessary because DosStartSession() seems to eat every space except one.
  87.      */
  88.   changeSpace(trackname);
  89.   sprintf(chrParams,"%s \'%s\' ",chrParams,trackname);/* add track path to cmd-line */
  90.   return chrParams;
  91. }
  92.  
  93. void buildDataWriteParam(CWDataFolder* thisPtr, char * text)
  94. {    
  95.  
  96.   ULONG ulWriteFlagsLocal;
  97.  
  98.   if(thisPtr)
  99.     ulWriteFlagsLocal=thisPtr->cwQueryCDTypeFlags();
  100.   
  101.   /* Build cdrecord/2 cmd-line parameters */
  102.   sprintf(text,chrCDROptions);//Cdrecord/2-options
  103.   /* Check if we write a multisession CD */
  104.   if( ulWriteFlagsLocal & IDCDT_MULTISESSION)
  105.     strcat(text," -multi");//multisessionswitch
  106.   else {
  107.     /* We write a singlesession disk so give the right track type */
  108.     if(ulWriteFlagsLocal & IDCDT_TRACKDATA)
  109.       strcat(text," -data");
  110.     if(ulWriteFlagsLocal & IDCDT_TRACKMODE2)
  111.       strcat(text," -mode2");
  112.     if(ulWriteFlagsLocal & IDCDT_TRACKXA1)
  113.       strcat(text," -xa1");
  114.     if(ulWriteFlagsLocal & IDCDT_TRACKXA2)
  115.       strcat(text," -xa2");
  116.     if(ulWriteFlagsLocal & IDCDT_TRACKCDI)
  117.       strcat(text," -cdi");
  118.   }
  119.  
  120.   return;
  121. }
  122.  
  123.  
  124. void buildMkisofsParam(CWDataFolder* thisPtr, char * text, char * outputName)
  125. {    
  126.   char *chrPtrParam;
  127.   ULONG ulFlags;
  128.   char filename[CCHMAXPATH];
  129.   char * chrPtr;
  130.   char * chrPtr2;
  131.   ULONG ulSize;
  132.   HWND hwnd;
  133.   PMINIRECORDCORE mrc;   
  134.   WPObject * contentObject;
  135.   LONG lValue1,lValue2;
  136.  
  137.   /* Build cmd-line for mkisofs */
  138.   ulFlags=thisPtr->cwQueryMkisofsFlags();
  139.   /* Path to mkisofs */
  140.   strcat(text,chrMkisofs);
  141.   strcat(text," ");
  142.   //chrPtrParam=strchr(text,0);
  143.   /* Additional options */
  144.   strncat(text,chrMkisofsOptions,sizeof(chrMkisofsOptions));
  145.   /* Filename options */
  146.   if(ulFlags & IDMK_ALLOW32CHARS)
  147.     strncat(text," -l",4);
  148.   if(ulFlags & IDMK_LEADINGPERIODS)
  149.     strncat(text," -L",4);
  150.   if(ulFlags & IDMK_JOLIET)
  151.     strncat(text," -J",4);
  152.   if(ulFlags & IDMK_ROCKRIDGE)
  153.     strncat(text," -r",4);
  154.   if(ulFlags & IDMK_TRANSTABLE)
  155.     strncat(text," -T",4);
  156.   //  if(ulFlags & IDMK_LOGFILE)
  157.   //   strncat(text," -log-filemkisofs.log",sizeof(" -log-filemkisofs.log"));
  158.   /* Add the autor-stuff */
  159.   if(strlen(thisPtr->chrApplication)) {
  160.     strncat(text," -A",strlen(" -A"));
  161.     strncat(text,thisPtr->chrApplication,strlen(thisPtr->chrApplication));
  162.   }
  163.   if(strlen(thisPtr->chrPublisher)) {
  164.     strncat(text," -P",strlen(" -P"));
  165.     strncat(text,thisPtr->chrPublisher,strlen(thisPtr->chrPublisher));
  166.   }
  167.   if(strlen(thisPtr->chrPreparer)) {
  168.     strncat(text," -p",strlen(" -p"));
  169.     strncat(text,thisPtr->chrPreparer,strlen(thisPtr->chrPreparer));
  170.   }
  171.   /*  if(strlen(chrCopyright)) {
  172.       strncat(text," -copyright",strlen(" -copyright"));
  173.       strncat(text,chrCopyright,strlen(chrCopyright));
  174.       }*/
  175.  
  176.  
  177.   ulFlags=thisPtr->cwQueryCDTypeFlags();
  178.   if((ulFlags & IDCDT_MULTISESSION) && !(ulFlags & IDCDT_FIRSTSESSION)) {
  179.     /* We are building the second image of a multisession disk */
  180.     /* Check if we did some setup stuff on the ms-page. Caution! Isn't bullet proof! */
  181.     if(!bMultiSessionDone) {
  182.       sprintf(text,"You have to provide some information on the 'CD-type selection' page prior to the creating \
  183. of multisession CDs!");  
  184.       WinMessageBox(  HWND_DESKTOP, HWND_DESKTOP,
  185.                       text,
  186.                       "Imagefile creation error",
  187.                       0UL, MB_OK | MB_ICONEXCLAMATION |MB_MOVEABLE);
  188.       DosFreeMem(thisPtr->pvSharedMem);
  189.       thisPtr->pvSharedMem=NULL;
  190.       return;
  191.     }
  192.  
  193.     /* Check if we have the necessary sectornumbers */
  194.     lValue1=thisPtr->cwQueryPreviousStartSector();
  195.     lValue2=thisPtr->cwQueryNextStartSector();
  196.     if(lValue1==lValue2) {
  197.       sprintf(text,"Need sector information of previous session. Go to the 'CD-type selection' page in \
  198. the settings notebook to supply it.");  
  199.       WinMessageBox(  HWND_DESKTOP, HWND_DESKTOP,
  200.                       text,
  201.                       "Imagefile creation error",
  202.                       0UL, MB_OK | MB_ICONEXCLAMATION |MB_MOVEABLE);
  203.       DosFreeMem(thisPtr->pvSharedMem);
  204.       thisPtr->pvSharedMem=NULL;
  205.       return;
  206.     }
  207.     sprintf(filename," -C%d,%d",lValue1,lValue2);
  208.     strncat(text,filename,strlen(filename));
  209.  
  210.     /* Check if we have a source drive for previous image */
  211.     strncat(text," -M",4);
  212.     if(ulFlags & IDCDT_USEWRITER) {
  213.       /* We use the writer as source. Check if 'dev=x,y,z' is given as cdrecord options */
  214.       chrPtr=strstr(chrCDROptions,"dev=");
  215.       if(NULL==chrPtr) {
  216.         sprintf(text,"There is no device given as a CD-writer . Go to the 'CD-type selection' page in \
  217. the settings notebook to chose a drive letter instead or go to the 'CDRecord/2' page to include a 'dev=x,y,z'-\
  218. statement in the options entryfield.");  
  219.         WinMessageBox(  HWND_DESKTOP, HWND_DESKTOP,
  220.                         text,
  221.                         "Imagefile creation error",
  222.                         0UL, MB_OK | MB_ICONEXCLAMATION |MB_MOVEABLE);
  223.         DosFreeMem(thisPtr->pvSharedMem);
  224.         thisPtr->pvSharedMem=NULL;
  225.         return;
  226.       }
  227.       /* Find '=' in 'dev=...' statement */
  228.       // chrPtr=strstr(chrCDROptions,"=");
  229.       //chrPtr++;/* Get address of value for dev=... */
  230.       /* Find end of 'dev=...' statement */
  231.       chrPtr2=chrPtr;
  232.       while(*chrPtr2!=' '&& *chrPtr2!=0)
  233.         chrPtr2++;
  234.       filename[0]=*chrPtr2;
  235.       *chrPtr2=0;
  236.       chrPtr=chrPtr2;
  237.       /* Find begin of traget,lun */
  238.       chrPtr-=3;
  239.       /* Add dev=... statement to cmd-line */
  240.       strncat(text,chrPtr,strlen(chrPtr));
  241.       *chrPtr2=filename[0];
  242.     }/* if(ulFlags & IDCDT_USEWRITER) */
  243.     else {
  244.       /* We use a drive letter as source drive */
  245.       strncat(text,chosenMultiSessionCD,sizeof(chosenMultiSessionCD));
  246.     }
  247.     /* We have all information. Build the rest of the cmd-line */
  248.   }/* end of if((ulFlags & IDCDT_MULTISESSION) && !(ulFlags & IDCDT_FIRSTSESSION)) */
  249.   else {
  250.   
  251.   }
  252.   if(outputName!=NULL) {
  253.     /* Name of output file */
  254.     strncat(text," -o",4);
  255.     strncat(text,chrImage,sizeof(chrImage));
  256.   }
  257.   /*****************************/
  258.   /* Query input files/folders */
  259.   /*****************************/
  260.   strncat(text," ",2);
  261.   /* Find last space. It's the beginning of the file names */
  262.   chrPtrParam=strrchr(text,' ');
  263.  
  264.   ulSize=sizeof(filename);
  265.   /* Query name of this folder */
  266.   if(!thisPtr->wpQueryRealName(filename,&ulSize,TRUE)) {
  267.     sprintf(text,"Error while quering the foldername!");  
  268.     WinMessageBox(  HWND_DESKTOP,   HWND_DESKTOP, text,"Image file creation",
  269.                     0UL, MB_OK | MB_ICONEXCLAMATION|MB_MOVEABLE );
  270.     DosFreeMem(thisPtr->pvSharedMem);
  271.     thisPtr->pvSharedMem=NULL;
  272.     return;/* There's an error */
  273.   }
  274.   strncat(text,filename,ulSize);
  275.  
  276.   hwnd=WinQueryWindow(thisPtr->hwndMkisofsMain,QW_PARENT); // Get folder HWND
  277.   /* Get hwnd of folder container */ 
  278.   hwnd=WinWindowFromID(hwnd,FID_CLIENT);
  279.   if(!WinIsWindow(WinQueryAnchorBlock(HWND_DESKTOP),hwnd)) {
  280.     sprintf(text,"Error while quering the container HWND!");  
  281.     WinMessageBox(  HWND_DESKTOP,   HWND_DESKTOP, text,"void CWDataFolder::cwCreateImage()",
  282.                     0UL, MB_OK | MB_ICONEXCLAMATION|MB_MOVEABLE );
  283.     DosFreeMem(thisPtr->pvSharedMem);
  284.     thisPtr->pvSharedMem=NULL;
  285.     return;
  286.   }
  287.   mrc=(PMINIRECORDCORE)WinSendMsg(hwnd,CM_QUERYRECORD,NULL,
  288.                                   MPFROM2SHORT(CMA_FIRST,CMA_ITEMORDER));
  289.   if(!mrc){ 
  290.     sprintf(text,"Error! The folder is empty!");  
  291.     WinMessageBox(  HWND_DESKTOP,   HWND_DESKTOP, text,"Image file creation",
  292.                     0UL, MB_OK | MB_ICONEXCLAMATION|MB_MOVEABLE );
  293.     DosFreeMem(thisPtr->pvSharedMem);
  294.     thisPtr->pvSharedMem=NULL;
  295.     return;
  296.   }
  297.  
  298.   /* Enumerate folder contents. We only use filesystem objects. If we find a shadow we follow
  299.      the link and use the linked object if it's a filesystem object */
  300.   while(mrc) {
  301.     /* Get wps-object-ptr. from container item */
  302.     contentObject=(WPObject*)OBJECT_FROM_PREC(mrc);//Get object
  303.     if(contentObject) {
  304.       /* Check if it's a shadow */
  305.       if(somResolveByName(contentObject,"wpQueryShadowedObject")) 
  306.         /* Yes, it's a shadow. Get file system object or NULL */
  307.         contentObject=thisPtr->cwGetFileSystemObject(contentObject);
  308.       else 
  309.         /* It's no shadow, so do nothing. If it's a filesystem object it's included in our list
  310.            because we yet provide this folder as input directory. If it's any other object (abstract)
  311.            mkisofs will skip it because it uses the filesystem for querying directory contents. */
  312.         contentObject=NULL;
  313.     }
  314.     if(contentObject){
  315.       /* It's a file system object */
  316.       strncat(text," ",2);
  317.       /* Check if it's folder */
  318.       if(somResolveByName(contentObject,"wpQueryContent")) {
  319.         /* It's a folder. Query the name. */
  320.         ulSize=sizeof(filename);
  321.         ((WPFileSystem*)contentObject)->wpQueryRealName(filename,&ulSize,FALSE);
  322.         /* Add the graft point to the command line. If not done, mkisofs will include the contents of
  323.            of the folder in the image, not the folder itself */ 
  324.         if((strlen(text)+strlen(filename)+2)>=SHAREDMEM_SIZE) {
  325.           sprintf(text,"Error! The length of the cmd-line exceeds %d Bytes!!\n",SHAREDMEM_SIZE);  
  326.           WinMessageBox(  HWND_DESKTOP,   HWND_DESKTOP, text,"Image file creation",
  327.                           0UL, MB_OK | MB_ICONEXCLAMATION|MB_MOVEABLE );
  328.           DosFreeMem(thisPtr->pvSharedMem);
  329.           thisPtr->pvSharedMem=NULL;
  330.           return;
  331.         }       
  332.         strncat(text,filename,ulSize);
  333.         strncat(text,"/=",2);        
  334.       }
  335.       /* Query the full path */
  336.       ulSize=sizeof(filename);
  337.       ((WPFileSystem*)contentObject)->wpQueryRealName(filename,&ulSize,TRUE);
  338.       /* Add the name to the command line */ 
  339.       if((strlen(text)+strlen(filename)+2)>=SHAREDMEM_SIZE) {
  340.         sprintf(text,"Error! The length of the cmd-line exceeds %d Bytes!!\n",SHAREDMEM_SIZE);  
  341.         WinMessageBox(  HWND_DESKTOP,   HWND_DESKTOP, text,"Image file creation",
  342.                         0UL, MB_OK | MB_ICONEXCLAMATION|MB_MOVEABLE );
  343.         DosFreeMem(thisPtr->pvSharedMem);
  344.         thisPtr->pvSharedMem=NULL;
  345.         return;
  346.       }
  347.       strncat(text,filename,ulSize);
  348.     }/* end of if(contentObject) */           
  349.     /* Get next container item */
  350.     mrc=(PMINIRECORDCORE)WinSendMsg(hwnd,CM_QUERYRECORD,MPFROMP(mrc),
  351.                                     MPFROM2SHORT(CMA_NEXT,CMA_ITEMORDER));
  352.   }// end of while(mrc)
  353.  
  354.   /* Change backslashs in sourcefiles */
  355.   changeBackslash(chrPtrParam);  
  356.   return;
  357. }
  358.  
  359. /* This function launches the writer with the params given */
  360. /* in PSZ parameter. PSZ folderPath is the path to put the */
  361. /* write.log. HWND hwnd is the window waiting for the      */
  362. /* WM_APPTERMINATE message                                 */
  363. ULONG launchWriter(PSZ parameter, PSZ folderPath,HWND hwnd, PSZ wrapperExe)
  364. {
  365.   STARTDATA startData={0};
  366.   APIRET rc;
  367.   PID pid;
  368.   ULONG ulSessionID=0;
  369.   PSZ pszTitle="Write CD";
  370.   char chrLoadError[CCHMAXPATH];
  371.   char startParams[CCHMAXPATH*4];
  372.   char exename[CCHMAXPATH]={0};
  373.     
  374.   memset(&startData,0,sizeof(startData));
  375.   startData.Length=sizeof(startData);
  376.   //startData.Related=SSF_RELATED_CHILD;
  377.   startData.Related=SSF_RELATED_INDEPENDENT;
  378.   startData.FgBg=SSF_FGBG_FORE;
  379.   startData.TraceOpt=SSF_TRACEOPT_NONE;
  380.   startData.PgmTitle=pszTitle;
  381.     
  382.   //  sprintf(exename,"%s",buildWrapName("cdr2lnch.exe"));
  383.   sprintf(exename,"%s",buildWrapName(wrapperExe));
  384.  
  385.   startData.PgmName=exename;
  386.   startData.InheritOpt=SSF_INHERTOPT_SHELL;
  387.   startData.SessionType=SSF_TYPE_WINDOWABLEVIO;
  388.   startData.PgmControl=0;
  389.   if(lCDROptions&IDCDR_HIDEWINDOW)
  390.     startData.PgmControl|=SSF_CONTROL_INVISIBLE;//|SSF_CONTROL_MAXIMIZE|SSF_CONTROL_NOAUTOCLOSE;
  391.   if(!(lCDROptions&IDCDR_CLOSEWINDOW))
  392.     startData.PgmControl|=SSF_CONTROL_NOAUTOCLOSE;
  393.   startData.InitXPos=30;
  394.   startData.InitYPos=30;
  395.   startData.InitXSize=500;
  396.   startData.InitYSize=400;
  397.   startData.ObjectBuffer=chrLoadError;
  398.   startData.ObjectBuffLen=(ULONG)sizeof(chrLoadError);
  399.   sprintf(startParams,"%d %s %s %s",hwnd,chrCDRecord,folderPath ,parameter);
  400.   startData.PgmInputs=startParams;
  401.  
  402.   rc=DosStartSession(&startData,&ulSessionID,&pid);   
  403.   return 0;   
  404. }
  405.  
  406.  
  407. ULONG launchMsInfo(HWND hwnd)
  408. {
  409.   /* hwnd:    notification window
  410.  
  411.      msinfo.exe sends a WM_APPTERMINATIONNOTIFY msg to that window which contains in mp1/mp2 the
  412.      two numbers necessary for creating of the second session.
  413.      The correct cmd-line for calling cdrecord/2 is build by msinfo. So we supply only the generic
  414.      cdrecord/2 information.
  415.    */
  416.  
  417.   STARTDATA startData={0};
  418.   APIRET rc;
  419.   PID pid;
  420.   ULONG ulSessionID=0;
  421.   PSZ pszTitle="Query multisession info";
  422.   char chrLoadError[CCHMAXPATH];
  423.   char startParams[CCHMAXPATH*4];
  424.   char exename[CCHMAXPATH]={0};
  425.     
  426.   memset(&startData,0,sizeof(startData));
  427.   startData.Length=sizeof(startData);
  428.   startData.Related=SSF_RELATED_INDEPENDENT;
  429.   startData.FgBg=SSF_FGBG_BACK;
  430.   startData.TraceOpt=SSF_TRACEOPT_NONE;
  431.   startData.PgmTitle=pszTitle;
  432.     
  433.   sprintf(exename,"%s",buildWrapName("msinfo.exe"));
  434.   startData.PgmName=exename;
  435.   startData.InheritOpt=SSF_INHERTOPT_SHELL;
  436.   startData.SessionType=SSF_TYPE_WINDOWABLEVIO;
  437.   startData.PgmControl=SSF_CONTROL_INVISIBLE;//|SSF_CONTROL_MAXIMIZE|SSF_CONTROL_NOAUTOCLOSE;
  438.   startData.InitXPos=30;
  439.   startData.InitYPos=30;
  440.   startData.InitXSize=500;
  441.   startData.InitYSize=400;
  442.   startData.ObjectBuffer=chrLoadError;
  443.   startData.ObjectBuffLen=(ULONG)sizeof(chrLoadError);
  444.   sprintf(startParams,"%d %s %s",hwnd, chrCDRecord, chrCDROptions);
  445.   startData.PgmInputs=startParams;
  446.   rc=DosStartSession(&startData,&ulSessionID,&pid);   
  447.   return 0;   
  448. }
  449.  
  450. ULONG launchGrabber(PSZ parameter, PSZ folderPath,HWND hwnd)
  451. {
  452.   STARTDATA startData={0};
  453.   APIRET rc;
  454.   PID pid;
  455.   ULONG ulSessionID=0;
  456.   PSZ pszTitle="Grab tracks";
  457.   char chrLoadError[CCHMAXPATH];
  458.   char startParams[CCHMAXPATH*4];
  459.   char exename[CCHMAXPATH]={0};
  460.     
  461.   memset(&startData,0,sizeof(startData));
  462.   startData.Length=sizeof(startData);
  463.   //startData.Related=SSF_RELATED_CHILD;
  464.   startData.Related=SSF_RELATED_INDEPENDENT;
  465.   startData.FgBg=SSF_FGBG_BACK;
  466.   startData.TraceOpt=SSF_TRACEOPT_NONE;
  467.   startData.PgmTitle=pszTitle;
  468.     
  469.   sprintf(exename,"%s",buildWrapName("wrapper.exe"));
  470.   startData.PgmName=exename;
  471.   startData.InheritOpt=SSF_INHERTOPT_SHELL;
  472.   startData.SessionType=SSF_TYPE_WINDOWABLEVIO;
  473.   startData.PgmControl=SSF_CONTROL_INVISIBLE;//|SSF_CONTROL_MAXIMIZE|SSF_CONTROL_NOAUTOCLOSE;
  474.   startData.InitXPos=30;
  475.   startData.InitYPos=30;
  476.   startData.InitXSize=500;
  477.   startData.InitYSize=400;
  478.   startData.ObjectBuffer=chrLoadError;
  479.   startData.ObjectBuffLen=(ULONG)sizeof(chrLoadError);
  480.   sprintf(startParams,"%d %s %s %s",hwnd,chrGrabberPath,folderPath ,parameter);
  481.   startData.PgmInputs=startParams;
  482.  
  483.   rc=DosStartSession(&startData,&ulSessionID,&pid);   
  484.   return 0;   
  485. }
  486.  
  487.  
  488. ULONG launchMkisofs(HWND hwnd)
  489. {
  490.   /* hwnd:    notification window
  491.  
  492.    */
  493.  
  494.   STARTDATA startData={0};
  495.   APIRET rc;
  496.   PID pid;
  497.   ULONG ulSessionID=0;
  498.   PSZ pszTitle="Create ISO-Image";
  499.   char chrLoadError[CCHMAXPATH];
  500.   char startParams[CCHMAXPATH*4];
  501.   char exename[CCHMAXPATH]={0};
  502.     
  503.   memset(&startData,0,sizeof(startData));
  504.   startData.Length=sizeof(startData);
  505.   startData.Related=SSF_RELATED_INDEPENDENT;
  506.   startData.FgBg=SSF_FGBG_FORE;
  507.   startData.TraceOpt=SSF_TRACEOPT_NONE;
  508.   startData.PgmTitle=pszTitle;
  509.     
  510.   sprintf(exename,"%s",buildWrapName("lnchmkis.exe"));
  511.   startData.PgmName=exename;
  512.   startData.InheritOpt=SSF_INHERTOPT_SHELL;
  513.   startData.SessionType=SSF_TYPE_WINDOWABLEVIO;
  514.   startData.PgmControl=0;
  515.   if(lMKOptions&IDMK_HIDEWINDOW)
  516.     startData.PgmControl|=SSF_CONTROL_INVISIBLE;
  517.   if(!(lMKOptions&IDMK_CLOSEWINDOW))
  518.     startData.PgmControl|=SSF_CONTROL_NOAUTOCLOSE;//|SSF_CONTROL_MAXIMIZE|SSF_CONTROL_NOAUTOCLOSE;
  519.   startData.InitXPos=30;
  520.   startData.InitYPos=30;
  521.   startData.InitXSize=500;
  522.   startData.InitYSize=400;
  523.   startData.ObjectBuffer=chrLoadError;
  524.   startData.ObjectBuffLen=(ULONG)sizeof(chrLoadError);
  525.   sprintf(startParams,"%d",hwnd);
  526.   startData.PgmInputs=startParams;
  527.   rc=DosStartSession(&startData,&ulSessionID,&pid);   
  528.   return rc;   
  529. }
  530.  
  531.  
  532.  
  533.  
  534.  
  535.  
  536.  
  537.  
  538.  
  539.  
  540.