home *** CD-ROM | disk | FTP | other *** search
/ PC Action 1998 October / PCA1098.ISO / Demos / lr2 / REDIST / DPLAY50A.TXT < prev   
Text File  |  1997-11-07  |  5KB  |  165 lines

  1. Microsoft DirectPlay 5.0a Web Redistribution
  2. ============================================
  3.  
  4. Release Notes
  5. =============
  6. DirectPlay 5.0a fixes the following problems:
  7.  
  8. 1) Simultaneous Join: When several clients attempt to join a session at the same time,
  9. it is possible that not all the players will be visible.  All the computers in the 
  10. session must have DPLAY50A.EXE installed for the fix to work.
  11.  
  12. 2) Send: Failure to send a guaranteed message on TCP/IP did not result in an error
  13. code being returned by the Send() API.  This has been fixed.
  14.  
  15.  
  16. Installation as part of a game setup
  17. ====================================
  18. The command line arguments to install this are:
  19.  
  20. "DPLAY50A.EXE"
  21.  
  22. If you want it to install with out any prompting and minimal UI, the
  23. command line arguments are:
  24.  
  25. "DPLAY50A.EXE /Q:A /R:N"
  26.  
  27. The general scheme of things is that you launch this in a seperate process
  28. and then check the return code from process to see if you need to reboot or
  29. not.
  30.  
  31. To install DPLAY50A.EXE alongside DirectX 5, your setup program will need to implement
  32. the following steps
  33.  
  34. // return TRUE if reboot required
  35. // FALSE if no reboot required
  36. BOOL SetupDPlayAndDirectX(HWND hwnd, LPSTR lpszDXRootPath. LPSTR lpszDPlayPath)
  37. {
  38.   BOOL  fRebootDplay = FALSE;
  39.   BOOL  fRebootDX = FALSE;
  40.  
  41.   // install DirectPlay 5.0a
  42.   fRebootDplay = LaunchCabPack("DPLAY50A.EXE", "/Q:A /R:N", lpszDPlayPath)
  43.  
  44.   // setup DirectX 5.0
  45.   fRebootDX = DirectXSetup(hwnd, lpszRootPath, DSETUP_DIRECTX);
  46.  
  47.   if ( fRebootDplay )
  48.   {
  49.     // Need to reinstall DirectPlay 5.0a if a reboot required
  50.     LaunchCabPack("DPLAY50A.EXE", "/Q:A /R:N", lpszCWD);
  51.   }
  52.  
  53.   return ( fRebootDplay || fRebootDX );
  54.  
  55. }
  56.  
  57.  
  58. #define IE_ERROR_SUCCESS_REBOOT_REQUIRED 3010L
  59.  
  60.  
  61. //****************************************************************************
  62. // Function: LaunchCabpack()
  63. //
  64. // Purpose:
  65. //      This function launched a cabpack and checks to see if it needs to
  66. //      rebooted.
  67. //
  68. // Parameters:
  69. //      LPSTR lpszApp     - appname (i.e. "DPLAY50A.EXE")
  70. //      LPSTR lpszCMDLine - Command Line (i.e. "/Q:A /R:N")
  71. //      LPSTR lpszCWD     - current working directory
  72. //
  73. // Return Code:
  74. //      BOOL  TRUE if you need to reboot. 
  75. //
  76. //****************************************************************************
  77. BOOL LaunchCabpack(LPSTR lpszApp, LPSTR lpszCMDLine, LPSTR lpszCWD)
  78. {
  79.     DWORD               dwReturnCode;
  80.     INT                 nResult = FALSE;
  81.     STARTUPINFO        si;
  82.     PROCESS_INFORMATION pi;
  83.  
  84.  
  85.     DPF(0, "LaunchCabpack:");
  86.     DPF(0, "LaunchCabpack: lpszApp     [%s]", lpszApp);
  87.     DPF(0, "LaunchCabpack: lpszCMDLine [%s]", lpszCMDLine);
  88.     DPF(0, "LaunchCabpack: lpszCWD     [%s]", lpszCWD);
  89.     
  90.     memset(&si, 0, sizeof(si));
  91.     
  92.     si.cb = sizeof(si);
  93.     if (CreateProcess(lpszApp, lpszCMDLine, NULL, NULL, 0, 0, NULL, lpszCWD, &si, &pi))
  94.     {
  95.         DWORD dwTimeout = 30;
  96.         DWORD dwRC      = WAIT_TIMEOUT;
  97.         MSG   msg;
  98.         
  99.         DPF( 0, "LaunchCabpack: Waiting for process %08X to end", pi.hProcess);
  100.  
  101.         //
  102.         // Wait for App to shutdown
  103.         //
  104.         while (dwRC == WAIT_TIMEOUT)
  105.         {
  106.             //
  107.             // Wait for object
  108.             //
  109.             dwRC = WaitForSingleObject(pi.hProcess, dwTimeout);
  110.  
  111. #ifdef DEBUG
  112.             switch (dwRC)
  113.             {
  114.                 case WAIT_ABANDONED:
  115.                     DPF(0, "LaunchCabpack: WaitForSingleObject returned WAIT_ABANDONED");
  116.                     break;
  117.                 case WAIT_FAILED:
  118.                     DPF(0, "LaunchCabpack: WaitForSingleObject returned WAIT_FAILED [%08X]", GetLastError);
  119.                     break;
  120.                 case WAIT_OBJECT_0:
  121.                     DPF(0, "LaunchCabpack: WaitForSingleObject returned WAIT_OBJECT_0");
  122.                     break;
  123.                 case WAIT_TIMEOUT:
  124.                     DPF(0, "LaunchCabpack: WaitForSingleObject returned WAIT_TIMEOUT");
  125.                     break;
  126.                 default:
  127.                     DPF(0, "LaunchCabpack: WaitForSingleObject returned UNKNOWN - [%lu]", dwRC);
  128.                     break;
  129.             }       
  130. #endif
  131.             //
  132.             // Flush the Queue
  133.             //
  134.             while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
  135.             {
  136.                  TranslateMessage(&msg);
  137.                  DispatchMessage(&msg);
  138.             }    
  139.  
  140.         }
  141.         
  142.         GetExitCodeProcess(pi.hProcess, &dwReturnCode);
  143.         if (dwReturnCode == IE_ERROR_SUCCESS_REBOOT_REQUIRED)
  144.         {
  145.             DPF(0, "LaunchCabpack:  Need to force reboot...");
  146.             nResult = TRUE;
  147.         }
  148.         CloseHandle(pi.hProcess);
  149.         CloseHandle(pi.hThread);
  150.         
  151.         DPF( 0, "LaunchCabpack: process %08X ended", pi.hProcess);
  152.  
  153.     }
  154.     else
  155.     {
  156.         DPF(0, "LaunchCabpack: CreateProcess() Failed!!!");
  157.     }
  158.  
  159.     return nResult;
  160. }
  161.  
  162.  
  163.  
  164.  
  165.