Patch level :2.1 022
Files correlati :xvagadll.dll Ricompilazione Demo : [ ] Commento :aggiunta gestione delle licenze e degli utenti nel caso di Win2000 term server. Aggiunta anche la creazione del campo.ini per ogni utente in questa configurazione. git-svn-id: svn://10.65.10.50/trunk@11934 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
		
							parent
							
								
									1b1b938a7a
								
							
						
					
					
						commit
						9f9dc7cea1
					
				@ -819,3 +819,107 @@ int OsWin32_GetSessionId()
 | 
			
		||||
	return (int) h;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#define BUFSIZE 80
 | 
			
		||||
 | 
			
		||||
bool OsWin32_IsWindowsServer()
 | 
			
		||||
{
 | 
			
		||||
  bool server = false;
 | 
			
		||||
   OSVERSIONINFOEX osvi;
 | 
			
		||||
   BOOL bOsVersionInfoEx;
 | 
			
		||||
 | 
			
		||||
   // Try calling GetVersionEx using the OSVERSIONINFOEX structure.
 | 
			
		||||
   // If that fails, try using the OSVERSIONINFO structure.
 | 
			
		||||
 | 
			
		||||
   ZeroMemory(&osvi, sizeof(OSVERSIONINFOEX));
 | 
			
		||||
   osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX);
 | 
			
		||||
 | 
			
		||||
   if( !(bOsVersionInfoEx = GetVersionEx ((OSVERSIONINFO *) &osvi)) )
 | 
			
		||||
   {
 | 
			
		||||
      osvi.dwOSVersionInfoSize = sizeof (OSVERSIONINFO);
 | 
			
		||||
      if (! GetVersionEx ( (OSVERSIONINFO *) &osvi) ) 
 | 
			
		||||
         return FALSE;
 | 
			
		||||
   }
 | 
			
		||||
 | 
			
		||||
   switch (osvi.dwPlatformId)
 | 
			
		||||
   {
 | 
			
		||||
      // Test for the Windows NT product family.
 | 
			
		||||
      case VER_PLATFORM_WIN32_NT:
 | 
			
		||||
 | 
			
		||||
         // Test for the specific product family.
 | 
			
		||||
         if ( osvi.dwMajorVersion == 5 && osvi.dwMinorVersion == 2 )
 | 
			
		||||
            server = true; // Microsoft Windows Server 2003 family
 | 
			
		||||
 | 
			
		||||
         // Test for specific product on Windows NT 4.0 SP6 and later.
 | 
			
		||||
         if( bOsVersionInfoEx )
 | 
			
		||||
         {
 | 
			
		||||
            const BYTE wProductType = osvi.wReserved[1]& 0xFF;
 | 
			
		||||
            // Test for the server type.
 | 
			
		||||
            if ( wProductType == 3 ) // VER_NT_SERVER
 | 
			
		||||
            {
 | 
			
		||||
               if( osvi.dwMajorVersion == 5 && osvi.dwMinorVersion == 2 )
 | 
			
		||||
               {
 | 
			
		||||
                  /*if( osvi.wSuiteMask & VER_SUITE_DATACENTER )
 | 
			
		||||
                     server = true; // Datacenter Edition
 | 
			
		||||
                  else if( osvi.wSuiteMask & VER_SUITE_ENTERPRISE )
 | 
			
		||||
                     server = true; // Enterprise Edition
 | 
			
		||||
                  else if ( osvi.wSuiteMask == VER_SUITE_BLADE )
 | 
			
		||||
                     server = true; // Web Edition
 | 
			
		||||
                  else
 | 
			
		||||
                     server = true; // Standard Edition*/
 | 
			
		||||
                  server = true;
 | 
			
		||||
               }
 | 
			
		||||
 | 
			
		||||
               else if( osvi.dwMajorVersion == 5 && osvi.dwMinorVersion == 0 )
 | 
			
		||||
               {
 | 
			
		||||
                  /*if( osvi.wSuiteMask & VER_SUITE_DATACENTER )
 | 
			
		||||
                     server = true; // Datacenter Server
 | 
			
		||||
                  else if( osvi.wSuiteMask & VER_SUITE_ENTERPRISE )
 | 
			
		||||
                     server = true; // Advanced Server
 | 
			
		||||
                  else
 | 
			
		||||
                     server = true; // Server*/
 | 
			
		||||
                 server = true;
 | 
			
		||||
               }
 | 
			
		||||
 | 
			
		||||
               else  // Windows NT 4.0 
 | 
			
		||||
               {
 | 
			
		||||
                  /*if( osvi.wSuiteMask & VER_SUITE_ENTERPRISE )
 | 
			
		||||
                     server = true; // Server 4.0, Enterprise Edition
 | 
			
		||||
                  else
 | 
			
		||||
                     server = true; // Server 4.0*/
 | 
			
		||||
                 server = true;
 | 
			
		||||
               }
 | 
			
		||||
            }
 | 
			
		||||
         }
 | 
			
		||||
         else  // Test for specific product on Windows NT 4.0 SP5 and earlier
 | 
			
		||||
         {
 | 
			
		||||
            HKEY hKey;
 | 
			
		||||
            char szProductType[BUFSIZE];
 | 
			
		||||
            DWORD dwBufLen=BUFSIZE;
 | 
			
		||||
            LONG lRet;
 | 
			
		||||
 | 
			
		||||
            lRet = RegOpenKeyEx( HKEY_LOCAL_MACHINE,
 | 
			
		||||
               "SYSTEM\\CurrentControlSet\\Control\\ProductOptions",
 | 
			
		||||
               0, KEY_QUERY_VALUE, &hKey );
 | 
			
		||||
            if( lRet != ERROR_SUCCESS )
 | 
			
		||||
               return FALSE;
 | 
			
		||||
 | 
			
		||||
            lRet = RegQueryValueEx( hKey, "ProductType", NULL, NULL,
 | 
			
		||||
               (LPBYTE) szProductType, &dwBufLen);
 | 
			
		||||
            if( (lRet != ERROR_SUCCESS) || (dwBufLen > BUFSIZE) )
 | 
			
		||||
               return FALSE;
 | 
			
		||||
 | 
			
		||||
            RegCloseKey( hKey );
 | 
			
		||||
 | 
			
		||||
            if ( lstrcmpi( "LANMANNT", szProductType) == 0 )
 | 
			
		||||
               server = true; // Server
 | 
			
		||||
            if ( lstrcmpi( "SERVERNT", szProductType) == 0 )
 | 
			
		||||
               server = true; // Advanced Server
 | 
			
		||||
         }
 | 
			
		||||
 | 
			
		||||
         break;
 | 
			
		||||
 | 
			
		||||
      default:
 | 
			
		||||
         break;
 | 
			
		||||
   }
 | 
			
		||||
   return server; 
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -34,6 +34,7 @@ bool OsWin32_SL_WriteBlock(unsigned short reg, unsigned short size, const unsign
 | 
			
		||||
 | 
			
		||||
BOOL OsWin32_SpoolRow(const char*  pData, unsigned int cbBytes, unsigned int hPrnDC);
 | 
			
		||||
int OsWin32_GetSessionId();
 | 
			
		||||
bool OsWin32_IsWindowsServer();
 | 
			
		||||
 | 
			
		||||
#ifdef SPEECH_API
 | 
			
		||||
bool OsWin32_InitializeSpeech();
 | 
			
		||||
 | 
			
		||||
@ -3915,12 +3915,18 @@ int xvt_sys_get_os_version()
 | 
			
		||||
  int major, minor;
 | 
			
		||||
  switch (::wxGetOsVersion(&major, &minor))
 | 
			
		||||
  {
 | 
			
		||||
  case wxGTK:
 | 
			
		||||
    os = XVT_WS_LINUX_GTK; break;
 | 
			
		||||
#ifdef WIN32
 | 
			
		||||
  case wxWIN95:
 | 
			
		||||
    os = minor == 0 ? XVT_WS_WIN_95 : XVT_WS_WIN_98; break;
 | 
			
		||||
  case wxWINDOWS_NT:
 | 
			
		||||
    os = XVT_WS_WIN_NT; break;
 | 
			
		||||
    os = XVT_WS_WIN_NT; 
 | 
			
		||||
    if (OsWin32_IsWindowsServer())
 | 
			
		||||
      os = XVT_WS_WIN_SERVER;
 | 
			
		||||
    break;
 | 
			
		||||
#else
 | 
			
		||||
  case wxGTK:
 | 
			
		||||
    os = XVT_WS_LINUX_GTK; break;
 | 
			
		||||
#endif
 | 
			
		||||
  default:
 | 
			
		||||
    break;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
@ -14,6 +14,7 @@
 | 
			
		||||
#define XVT_WS_WIN_NT    411
 | 
			
		||||
#define XVT_WS_WIN_2000  412
 | 
			
		||||
#define XVT_WS_WIN_XP    413
 | 
			
		||||
#define XVT_WS_WIN_SERVER 414
 | 
			
		||||
 | 
			
		||||
#define ATTR_WIN_BASE 10000
 | 
			
		||||
#define ATTR_WIN_CMD_LINE               (ATTR_WIN_BASE + 0)
 | 
			
		||||
 | 
			
		||||
@ -781,20 +781,32 @@ const char* xvt_fsys_get_campo_ini()
 | 
			
		||||
    xvt_fsys_convert_dir_to_str(&dir, exedir, sizeof(exedir));
 | 
			
		||||
#ifdef WIN32
 | 
			
		||||
    if (xvt_fsys_is_network_drive(exedir))
 | 
			
		||||
    {
 | 
			
		||||
      bFound = xvt_fsys_get_campo_stp_value("CampoIni", path, sizeof(path));
 | 
			
		||||
 | 
			
		||||
    if (!bFound)
 | 
			
		||||
    {
 | 
			
		||||
        const char* pp = getenv("PREFPATH");
 | 
			
		||||
/*      const char* pp = getenv("PREFPATH");
 | 
			
		||||
      if (pp != NULL)
 | 
			
		||||
      {
 | 
			
		||||
        char dri[_MAX_DRIVE], dir[_MAX_PATH];
 | 
			
		||||
        xvt_fsys_parse_pathname(pp, dri, dir, NULL, NULL, NULL);
 | 
			
		||||
        xvt_fsys_build_pathname(path, dri, dir, "campo", "ini", NULL);
 | 
			
		||||
        bFound = TRUE;
 | 
			
		||||
      }*/
 | 
			
		||||
      if (xvt_sys_get_os_version() == XVT_WS_WIN_SERVER)
 | 
			
		||||
      {
 | 
			
		||||
        xvt_fsys_build_pathname(path, NULL, wxGetHomeDir(), "campo", "ini", NULL);
 | 
			
		||||
        bFound = xvt_fsys_file_exists(path);
 | 
			
		||||
        if (!bFound)
 | 
			
		||||
        {
 | 
			
		||||
				  char pathstd[_MAX_PATH];
 | 
			
		||||
   	  	  xvt_fsys_build_pathname(pathstd, NULL, exedir, "campo", "ini", NULL);
 | 
			
		||||
   	  	  if (xvt_fsys_file_exists(pathstd))
 | 
			
		||||
					  wxCopyFile(pathstd, path);
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
		if (!bFound)
 | 
			
		||||
  	  xvt_fsys_build_pathname(path, NULL, exedir, "campo", "ini", NULL);
 | 
			
		||||
#else
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user