Back to index

lightning-sunbird  0.9+nobinonly
logging.c
Go to the documentation of this file.
00001 /* ***** BEGIN LICENSE BLOCK *****
00002  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
00003  *
00004  * The contents of this file are subject to the Mozilla Public License Version
00005  * 1.1 (the "License"); you may not use this file except in compliance with
00006  * the License. You may obtain a copy of the License at
00007  * http://www.mozilla.org/MPL/
00008  *
00009  * Software distributed under the License is distributed on an "AS IS" basis,
00010  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
00011  * for the specific language governing rights and limitations under the
00012  * License.
00013  *
00014  * The Original Code is Mozilla Navigator.
00015  *
00016  * The Initial Developer of the Original Code is
00017  * Netscape Communications Corp.
00018  * Portions created by the Initial Developer are Copyright (C) 2001
00019  * the Initial Developer. All Rights Reserved.
00020  *
00021  * Contributor(s):
00022  *   Sean Su <ssu@netscape.com>
00023  *
00024  * Alternatively, the contents of this file may be used under the terms of
00025  * either of the GNU General Public License Version 2 or later (the "GPL"),
00026  * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
00027  * in which case the provisions of the GPL or the LGPL are applicable instead
00028  * of those above. If you wish to allow use of your version of this file only
00029  * under the terms of either the GPL or the LGPL, and not to allow others to
00030  * use your version of this file under the terms of the MPL, indicate your
00031  * decision by deleting the provisions above and replace them with the notice
00032  * and other provisions required by the GPL or the LGPL. If you do not delete
00033  * the provisions above, a recipient may use your version of this file under
00034  * the terms of any one of the MPL, the GPL or the LGPL.
00035  *
00036  * ***** END LICENSE BLOCK ***** */
00037 
00038 #include "extern.h"
00039 #include "logging.h"
00040 #include "extra.h"
00041 #include "ifuncns.h"
00042 #include "xpi.h"
00043 
00044 #define E_USER_CANCEL         -813
00045 #define SECTION_EXIT_STATUS   "Exit Status"
00046 #define KEY_STATUS            "Status"
00047 
00048 int AppendToGlobalMessageStream(char *szInfo)
00049 {
00050   DWORD dwInfoLen = lstrlen(szInfo);
00051   DWORD dwMessageLen;
00052 
00053   if(gErrorMessageStream.bEnabled && gErrorMessageStream.szMessage)
00054   {
00055     dwMessageLen = lstrlen(gErrorMessageStream.szMessage);
00056     if((dwInfoLen + dwMessageLen) >= gErrorMessageStream.dwMessageBufSize)
00057     {
00058       if(NS_GlobalReAlloc(&gErrorMessageStream.szMessage,
00059                           gErrorMessageStream.dwMessageBufSize,
00060                           dwInfoLen + dwMessageLen + MAX_BUF_TINY) == NULL)
00061         return(WIZ_OUT_OF_MEMORY);
00062 
00063       gErrorMessageStream.dwMessageBufSize = dwInfoLen +
00064                                              dwMessageLen +
00065                                              MAX_BUF_TINY;
00066     }
00067 
00068     lstrcat(gErrorMessageStream.szMessage, szInfo);
00069   }
00070 
00071   return(WIZ_OK);
00072 }
00073 
00074 void LogISTime(int iType)
00075 {
00076   char       szBuf[MAX_BUF];
00077   char       szTime[MAX_BUF_TINY];
00078   char       szDate[MAX_BUF_TINY];
00079   SYSTEMTIME stLocalTime;
00080 
00081   GetLocalTime(&stLocalTime);
00082   GetTimeFormat(LOCALE_NEUTRAL,
00083                 LOCALE_NOUSEROVERRIDE,
00084                 &stLocalTime,
00085                 NULL,
00086                 szTime,
00087                 sizeof(szTime));
00088   GetDateFormat(LOCALE_NEUTRAL,
00089                 LOCALE_NOUSEROVERRIDE,
00090                 &stLocalTime,
00091                 NULL,
00092                 szDate,
00093                 sizeof(szDate));
00094 
00095   if(iType == W_START)
00096     wsprintf(szBuf, "Start Log: %s - %s\n", szDate, szTime);
00097   else
00098     wsprintf(szBuf, "End Log: %s - %s\n", szDate, szTime);
00099 
00100   UpdateInstallStatusLog(szBuf);
00101 }
00102 
00103 void LogISProductInfo(void)
00104 {
00105   char szBuf[MAX_BUF];
00106 
00107   wsprintf(szBuf, "\n    Product Info:\n");
00108   UpdateInstallStatusLog(szBuf);
00109 
00110   switch(sgProduct.mode)
00111   {
00112     case SILENT:
00113       wsprintf(szBuf, "        Install mode: Silent\n");
00114       break;
00115     case AUTO:
00116       wsprintf(szBuf, "        Install mode: Auto\n");
00117       break;
00118     default:
00119       wsprintf(szBuf, "        Install mode: Normal\n");
00120       break;
00121   }
00122   UpdateInstallStatusLog(szBuf);
00123 
00124   wsprintf(szBuf, "        Company name: %s\n        Product name (external): %s\n        Product name (internal): %s\n        Uninstall Filename: %s\n        UserAgent: %s\n        Alternate search path: %s\n",
00125            sgProduct.szCompanyName,
00126            sgProduct.szProductName,
00127            sgProduct.szProductNameInternal,
00128            sgProduct.szUninstallFilename,
00129            sgProduct.szUserAgent,
00130            sgProduct.szAlternateArchiveSearchPath);
00131   UpdateInstallStatusLog(szBuf);
00132 }
00133 
00134 void LogISDestinationPath(void)
00135 {
00136   char szBuf[MAX_BUF];
00137 
00138   wsprintf(szBuf,
00139            "\n    Destination Path:\n        Main: %s\n        SubPath: %s\n",
00140            sgProduct.szPath,
00141            sgProduct.szSubPath);
00142   UpdateInstallStatusLog(szBuf);
00143 }
00144 
00145 void LogISShared(void)
00146 {
00147   char szBuf[MAX_BUF];
00148 
00149   if(sgProduct.bSharedInst == TRUE)
00150     wsprintf(szBuf,"\n    Shared Installation:  TRUE\n");
00151   UpdateInstallStatusLog(szBuf);
00152 }
00153 
00154 void LogISSetupType(void)
00155 {
00156   char szBuf[MAX_BUF_TINY];
00157 
00158   switch(dwSetupType)
00159   {
00160     case ST_RADIO3:
00161       wsprintf(szBuf, "\n    Setup Type: %s\n",
00162                diSetupType.stSetupType3.szDescriptionShort);
00163       break;
00164 
00165     case ST_RADIO2:
00166       wsprintf(szBuf, "\n    Setup Type: %s\n",
00167                diSetupType.stSetupType2.szDescriptionShort);
00168       break;
00169 
00170     case ST_RADIO1:
00171       wsprintf(szBuf, "\n    Setup Type: %s\n",
00172                diSetupType.stSetupType1.szDescriptionShort);
00173       break;
00174 
00175     default:
00176       wsprintf(szBuf, "\n    Setup Type: %s\n",
00177                diSetupType.stSetupType0.szDescriptionShort);
00178       break;
00179   }
00180 
00181   UpdateInstallStatusLog(szBuf);
00182 }
00183 
00184 void LogISComponentsSelected(void)
00185 {
00186   char szBuf[MAX_BUF_TINY];
00187   siC  *siCNode;
00188   BOOL bFoundComponentSelected;
00189 
00190   wsprintf(szBuf, "\n    Components selected:\n");
00191   UpdateInstallStatusLog(szBuf);
00192 
00193   bFoundComponentSelected = FALSE;
00194   siCNode = siComponents;
00195   do
00196   {
00197     if(siCNode == NULL)
00198       break;
00199 
00200     if(siCNode->dwAttributes & SIC_SELECTED)
00201     {
00202       if(!siCNode->bForceUpgrade)
00203         wsprintf(szBuf,
00204                  "        %s\n",
00205                  siCNode->szDescriptionShort);
00206       else
00207         wsprintf(szBuf,
00208                  "        %s (Required)\n",
00209                  siCNode->szDescriptionShort);
00210 
00211       UpdateInstallStatusLog(szBuf);
00212       bFoundComponentSelected = TRUE;
00213     }
00214 
00215     siCNode = siCNode->Next;
00216   } while((siCNode != NULL) && (siCNode != siComponents));
00217 
00218   if(!bFoundComponentSelected)
00219   {
00220     wsprintf(szBuf, "        none\n");
00221     UpdateInstallStatusLog(szBuf);
00222   }
00223 }
00224 
00225 void LogISComponentsToDownload(void)
00226 {
00227   char szBuf[MAX_BUF_TINY];
00228   char szArchivePath[MAX_BUF_MEDIUM];
00229   siC  *siCNode;
00230   BOOL bFoundComponentSelected;
00231   BOOL bFoundComponentsToDownload;
00232 
00233   wsprintf(szBuf, "\n    Components to download:\n");
00234   UpdateInstallStatusLog(szBuf);
00235 
00236   bFoundComponentSelected = FALSE;
00237   bFoundComponentsToDownload = FALSE;
00238   siCNode = siComponents;
00239   do
00240   {
00241     if(siCNode == NULL)
00242       break;
00243 
00244     if(siCNode->dwAttributes & SIC_SELECTED)
00245     {
00246 
00247       if(LocateJar(siCNode,
00248                    szArchivePath,
00249                    sizeof(szArchivePath),
00250                    gbPreviousUnfinishedDownload) == AP_NOT_FOUND)
00251       {
00252         wsprintf(szBuf,
00253                  "        %s will be downloaded\n",
00254                  siCNode->szDescriptionShort);
00255         bFoundComponentsToDownload = TRUE;
00256       }
00257       else
00258         wsprintf(szBuf,
00259                  "        %s found: %s\n",
00260                  siCNode->szDescriptionShort,
00261                  szArchivePath);
00262 
00263       UpdateInstallStatusLog(szBuf);
00264       bFoundComponentSelected = TRUE;
00265     }
00266 
00267     siCNode = siCNode->Next;
00268   } while((siCNode != NULL) && (siCNode != siComponents));
00269 
00270   if(!bFoundComponentSelected)
00271   {
00272     wsprintf(szBuf, "        none\n");
00273     UpdateInstallStatusLog(szBuf);
00274   }
00275   if(!bFoundComponentsToDownload)
00276   {
00277     wsprintf(szBuf, "        **\n        ** All components have been found locally.  No components will be downloaded.\n        **\n");
00278     UpdateInstallStatusLog(szBuf);
00279   }
00280 }
00281 
00282 void LogISDownloadProtocol(DWORD dwProtocolType)
00283 {
00284   char szBuf[MAX_BUF];
00285   char szProtocolType[MAX_BUF];
00286 
00287   switch(dwProtocolType)
00288   {
00289     case UP_HTTP:
00290       lstrcpy(szProtocolType, "HTTP");
00291       break;
00292 
00293     default:
00294       lstrcpy(szProtocolType, "FTP");
00295       break;
00296   }
00297 
00298   wsprintf(szBuf, "\n    Download protocol: %s\n", szProtocolType);
00299   UpdateInstallStatusLog(szBuf);
00300 }
00301 
00302 void LogISDownloadStatus(char *szStatus, char *szFailedFile)
00303 {
00304   char szBuf[MAX_BUF];
00305   siC   *siCObject = NULL;
00306   DWORD dwIndex;
00307 
00308   if(szFailedFile)
00309     wsprintf(szBuf,
00310              "\n    Download status: %s\n          file: %s\n\n",
00311              szStatus,
00312              szFailedFile);
00313   else
00314     wsprintf(szBuf,
00315              "\n    Download status: %s\n",
00316              szStatus);
00317   UpdateInstallStatusLog(szBuf);
00318 
00319   dwIndex = 0;
00320   siCObject = SiCNodeGetObject(dwIndex, TRUE, AC_ALL);
00321   while(siCObject)
00322   {
00323     if(siCObject->dwAttributes & SIC_SELECTED)
00324     {
00325       wsprintf(szBuf, "        %s: NetRetries:%d, CRCRetries:%d, NetTimeOuts:%d\n",
00326                siCObject->szDescriptionShort,
00327                siCObject->iNetRetries,
00328                siCObject->iCRCRetries,
00329                siCObject->iNetTimeOuts);
00330       UpdateInstallStatusLog(szBuf);
00331     }
00332 
00333     ++dwIndex;
00334     siCObject = SiCNodeGetObject(dwIndex, TRUE, AC_ALL);
00335   }
00336 }
00337 
00338 void LogISComponentsFailedCRC(char *szList, int iWhen)
00339 {
00340   char szBuf[MAX_BUF];
00341 
00342   if(iWhen == W_STARTUP)
00343   {
00344     if(szList && (*szList != '\0'))
00345       wsprintf(szBuf,
00346                "\n    Components corrupted (startup):\n%s",
00347                szList);
00348     else
00349       wsprintf(szBuf,
00350                "\n    Components corrupted (startup):\n        none\n");
00351   }
00352   else
00353   {
00354     if(szList && (*szList != '\0'))
00355       wsprintf(szBuf,
00356                "\n    Components corrupted (download):\n%s",
00357                szList);
00358     else
00359       wsprintf(szBuf,
00360                "\n    Components corrupted (download):\n        none\n");
00361   }
00362 
00363   UpdateInstallStatusLog(szBuf);
00364 }
00365 
00366 void LogISXPInstall(int iWhen)
00367 {
00368   char szBuf[MAX_BUF];
00369 
00370   if(iWhen == W_START)
00371     wsprintf(szBuf, "\n    XPInstall Start\n");
00372   else
00373     wsprintf(szBuf, "    XPInstall End\n");
00374 
00375   UpdateInstallStatusLog(szBuf);
00376 }
00377 
00378 void LogISXPInstallComponent(char *szComponentName)
00379 {
00380   char szBuf[MAX_BUF];
00381 
00382   wsprintf(szBuf, "        %s", szComponentName);
00383   UpdateInstallStatusLog(szBuf);
00384 }
00385 
00386 void LogISXPInstallComponentResult(DWORD dwErrorNumber)
00387 {
00388   char szBuf[MAX_BUF];
00389   char szErrorString[MAX_BUF];
00390 
00391   GetErrorString(dwErrorNumber, szErrorString, sizeof(szErrorString));
00392   wsprintf(szBuf, ": %d %s\n", dwErrorNumber, szErrorString);
00393   UpdateInstallStatusLog(szBuf);
00394 }
00395 
00396 void LogISLaunchApps(int iWhen)
00397 {
00398   char szBuf[MAX_BUF];
00399 
00400   if(iWhen == W_START)
00401     wsprintf(szBuf, "\n    Launch Apps Start\n");
00402   else
00403     wsprintf(szBuf, "    Launch Apps End\n");
00404 
00405   UpdateInstallStatusLog(szBuf);
00406 }
00407 
00408 void LogISLaunchAppsComponent(char *szComponentName)
00409 {
00410   char szBuf[MAX_BUF];
00411 
00412   wsprintf(szBuf, "    launching %s\n", szComponentName);
00413   UpdateInstallStatusLog(szBuf);
00414 }
00415 
00416 void LogISLaunchAppsComponentUncompress(char *szComponentName, DWORD dwErr)
00417 {
00418   char szBuf[MAX_BUF];
00419 
00420   wsprintf(szBuf, "    uncompressing %s: %d\n", szComponentName, dwErr);
00421   UpdateInstallStatusLog(szBuf);
00422 }
00423 
00424 void LogISProcessXpcomFile(int iStatus, int iResult)
00425 {
00426   char szBuf[MAX_BUF];
00427 
00428   if(iStatus == LIS_SUCCESS)
00429     wsprintf(szBuf, "\n    Uncompressing Xpcom Succeeded: %d\n", iResult);
00430   else
00431     wsprintf(szBuf, "\n    Uncompressing Xpcom Failed: %d\n", iResult);
00432 
00433   UpdateInstallStatusLog(szBuf);
00434 }
00435 
00436 void LogISDiskSpace(dsN *dsnComponentDSRequirement)
00437 {
00438   ULONGLONG ullDSAvailable;
00439   dsN       *dsnTemp = NULL;
00440   char      szBuf[MAX_BUF];
00441   char      szDSRequired[MAX_BUF_TINY];
00442   char      szDSAvailable[MAX_BUF_TINY];
00443 
00444   if(dsnComponentDSRequirement != NULL)
00445   {
00446     wsprintf(szBuf, "\n    Disk Space Info:\n");
00447     UpdateInstallStatusLog(szBuf);
00448     dsnTemp = dsnComponentDSRequirement;
00449     do
00450     {
00451       if(!dsnTemp)
00452         break;
00453 
00454       ullDSAvailable = GetDiskSpaceAvailable(dsnTemp->szVDSPath);
00455       _ui64toa(ullDSAvailable, szDSAvailable, 10);
00456       _ui64toa(dsnTemp->ullSpaceRequired, szDSRequired, 10);
00457       wsprintf(szBuf,
00458                "             Path: %s\n         Required: %sKB\n        Available: %sKB\n",
00459                dsnTemp->szVDSPath,
00460                szDSRequired,
00461                szDSAvailable);
00462       UpdateInstallStatusLog(szBuf);
00463 
00464       dsnTemp = dsnTemp->Next;
00465     } while((dsnTemp != NULL) && (dsnTemp != dsnComponentDSRequirement));
00466   }
00467 }
00468 
00469 void LogISTurboMode(BOOL bTurboMode)
00470 {
00471   char szBuf[MAX_BUF];
00472 
00473   if(bTurboMode)
00474     wsprintf(szBuf, "\n    Turbo Mode: true\n");
00475   else
00476     wsprintf(szBuf, "\n    Turbo Mode: false\n");
00477 
00478   UpdateInstallStatusLog(szBuf);
00479 }
00480 
00481 void LogMSProductInfo(void)
00482 {
00483   char szBuf[MAX_BUF];
00484   char szOSType[MAX_BUF_TINY];
00485 
00486   GetOSTypeString(szOSType, sizeof(szOSType));
00487   if(*gSystemInfo.szExtraString != '\0')
00488     wsprintf(szBuf, "UserAgent=%s/%s (%s,%d.%d.%d,%s)",
00489              sgProduct.szProductName,
00490              sgProduct.szUserAgent,
00491              szOSType,
00492              gSystemInfo.dwMajorVersion,
00493              gSystemInfo.dwMinorVersion,
00494              gSystemInfo.dwBuildNumber,
00495              gSystemInfo.szExtraString);
00496   else
00497     wsprintf(szBuf, "UserAgent=%s/%s (%s,%d.%d.%d)",
00498              sgProduct.szProductName,
00499              sgProduct.szUserAgent,
00500              szOSType,
00501              gSystemInfo.dwMajorVersion,
00502              gSystemInfo.dwMinorVersion,
00503              gSystemInfo.dwBuildNumber);
00504 
00505   AppendToGlobalMessageStream(szBuf);
00506 }
00507 
00508 void LogMSDownloadProtocol(DWORD dwProtocolType)
00509 {
00510   char szMessageStream[MAX_BUF_TINY];
00511   char szProtocolType[MAX_BUF];
00512 
00513   switch(dwProtocolType)
00514   {
00515     case UP_HTTP:
00516       lstrcpy(szProtocolType, "HTTP");
00517       break;
00518 
00519     default:
00520       lstrcpy(szProtocolType, "FTP");
00521       break;
00522   }
00523 
00524   wsprintf(szMessageStream, "&DownloadProtocol=%s", szProtocolType);
00525   AppendToGlobalMessageStream(szMessageStream);
00526 }
00527 
00528 void LogMSDownloadStatus(int iDownloadStatus)
00529 {
00530   char szMessageStream[MAX_BUF_TINY];
00531 
00532   wsprintf(szMessageStream, "&DownloadStatus=%d", iDownloadStatus);
00533   AppendToGlobalMessageStream(szMessageStream);
00534   gErrorMessageStream.bSendMessage = TRUE;
00535 }
00536 
00537 void LogMSDownloadFileStatus(void)
00538 {
00539   siC   *siCObject = NULL;
00540   DWORD dwIndex;
00541   char  szMessageStream[MAX_BUF];
00542 
00543   ZeroMemory(szMessageStream, sizeof(szMessageStream));
00544   dwIndex = 0;
00545   siCObject = SiCNodeGetObject(dwIndex, TRUE, AC_ALL);
00546   while(siCObject)
00547   {
00548     if(siCObject->iNetRetries ||
00549        siCObject->iCRCRetries ||
00550        siCObject->iNetTimeOuts)
00551     {
00552       char szFileInfo[MAX_BUF_SMALL];
00553 
00554       wsprintf(szFileInfo,
00555                "&%s=%d,%d,%d",
00556                siCObject->szArchiveName,
00557                siCObject->iNetRetries,
00558                siCObject->iCRCRetries,
00559                siCObject->iNetTimeOuts);
00560 
00561       lstrcat(szMessageStream, szFileInfo);
00562     }
00563     ++dwIndex;
00564     siCObject = SiCNodeGetObject(dwIndex, TRUE, AC_ALL);
00565   }
00566 
00567   if(*szMessageStream != '\0')
00568     AppendToGlobalMessageStream(szMessageStream);
00569 }
00570 
00571 void LogMSXPInstallStatus(char *szFile, int iErr)
00572 {
00573   char szMessageStream[MAX_BUF];
00574   static BOOL bAlreadyLogged = FALSE;
00575 
00576   if(bAlreadyLogged)
00577     return;
00578 
00579   if(szFile)
00580     wsprintf(szMessageStream, "&XPInstallStatus=%d&XPInstallFile=%s", iErr, szFile);
00581   else
00582     wsprintf(szMessageStream, "&XPInstallStatus=%d", iErr);
00583 
00584   AppendToGlobalMessageStream(szMessageStream);
00585   bAlreadyLogged = TRUE;
00586   if((iErr != E_REBOOT) &&
00587     (((iErr == E_USER_CANCEL) &&
00588        !gErrorMessageStream.bShowConfirmation) ||
00589      ((iErr != E_USER_CANCEL) &&
00590       (iErr != WIZ_OK))))
00591     gErrorMessageStream.bSendMessage = TRUE;
00592 }
00593 
00594 void LogMSTurboMode(BOOL bTurboMode)
00595 {
00596   char szMessageStream[MAX_BUF];
00597 
00598   wsprintf(szMessageStream, "&TM=%d", bTurboMode);
00599   AppendToGlobalMessageStream(szMessageStream);
00600 }
00601 
00602 /* Function: GetExitStatusLogFile()
00603  *       in: aProductName, aLogFileBufSize
00604  *   in/out: aLogFile
00605  *  purpose: To build the full filename of the exit log file
00606  *           located in the TEMP dir given aProductName.
00607  */
00608 void GetExitStatusLogFile(LPSTR aProductName, LPSTR aLogFile, DWORD aLogFileBufSize)
00609 {
00610   char buf[MAX_BUF];
00611   char logFilename[MAX_BUF];
00612 
00613   if(!aProductName || !aLogFile)
00614     return;
00615 
00616   *aLogFile = '\0';
00617   lstrcpy(buf, szOSTempDir);
00618   MozCopyStr(szOSTempDir, buf, sizeof(buf));
00619   AppendBackSlash(buf, sizeof(buf));
00620   _snprintf(logFilename, sizeof(logFilename), SETUP_EXIT_STATUS_LOG, aProductName);
00621   logFilename[sizeof(logFilename) - 1] = '\0';
00622   _snprintf(aLogFile, aLogFileBufSize, "%s%s", buf, logFilename);
00623   aLogFile[aLogFileBufSize - 1] = '\0';
00624 }
00625 
00626 /* Function: DeleteExitStatusFile()
00627  *       in: none.
00628  *      out: none
00629  *  purpose: To delete the setup's exit status file located in
00630  *           the TEMP dir.
00631  */
00632 void DeleteExitStatusFile()
00633 {
00634   char logFile[MAX_BUF];
00635 
00636   GetExitStatusLogFile(sgProduct.szProductNameInternal, logFile, sizeof(logFile));
00637   if(FileExists(logFile))
00638     DeleteFile(logFile);
00639 }
00640 
00641 /* Function: LogExitStatus()
00642  *       in: status to log.
00643  *      out: none
00644  *  purpose: To log the exit status of this setup.  We're normally
00645  *           trying to log the need for a reboot.
00646  */
00647 void LogExitStatus(LPSTR status)
00648 {
00649   char logFile[MAX_BUF];
00650 
00651   GetExitStatusLogFile(sgProduct.szProductNameInternal, logFile, sizeof(logFile));
00652   WritePrivateProfileString(SECTION_EXIT_STATUS, KEY_STATUS, status, logFile);
00653 }
00654 
00655 /* Function: GetGreSetupExitStatus()
00656  *       in: none
00657  *      out: aStatus - status read in from the exit  status log file
00658  *  purpose: To read the exis status from the GRE setup that was run
00659  *           from within this setup.
00660  */
00661 void GetGreSetupExitStatus(LPSTR aStatus, DWORD aStatusBufSize)
00662 {
00663   char logFile[MAX_BUF];
00664 
00665   *aStatus = '\0';
00666   GetExitStatusLogFile("GRE", logFile, sizeof(logFile));
00667   if(FileExists(logFile))
00668     GetPrivateProfileString(SECTION_EXIT_STATUS, KEY_STATUS, "", aStatus, aStatusBufSize, logFile);
00669 }
00670