[GME-commit] GMESRC/Java/native/JavaCompRunner RawComponent.cpp, 1.3, 1.4 JavaCompRunner.vcproj, 1.1, 1.2 ComponentDll.cpp, 1.3, 1.4

gme-commit at list.isis.vanderbilt.edu gme-commit at list.isis.vanderbilt.edu
Mon May 7 10:32:08 CDT 2007


Update of /project/gme-repository/GMESRC/Java/native/JavaCompRunner
In directory escher:/tmp/cvs-serv24583

Modified Files:
	RawComponent.cpp JavaCompRunner.vcproj ComponentDll.cpp 
Log Message:
increased buffer sizes (javapath was too short)

CVS User: Gyorgy Balogh, ISIS (bogyom)

Index: RawComponent.cpp
===================================================================
RCS file: /project/gme-repository/GMESRC/Java/native/JavaCompRunner/RawComponent.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** RawComponent.cpp	14 Dec 2005 15:51:52 -0000	1.3
--- RawComponent.cpp	7 May 2007 15:32:05 -0000	1.4
***************
*** 31,36 ****
      unloadJavaVM();
  
!     char          classPath[300];
!     char          buf[300];
      unsigned long bufSize;
      HKEY          regkey;
--- 31,36 ----
      unloadJavaVM();
  
!     char          classPath[2000];
!     char          buf[2000];
      unsigned long bufSize;
      HKEY          regkey;
***************
*** 40,44 ****
      RegOpenKeyEx(HKEY_LOCAL_MACHINE, "SOFTWARE\\GME", 0, KEY_EXECUTE, &regkey);
      type = REG_SZ;
!     bufSize = 300;
      RegQueryValueEx(regkey, "JavaClassPath", NULL, &type, (LPBYTE)classPath, &bufSize );
      RegCloseKey(regkey);
--- 40,44 ----
      RegOpenKeyEx(HKEY_LOCAL_MACHINE, "SOFTWARE\\GME", 0, KEY_EXECUTE, &regkey);
      type = REG_SZ;
!     bufSize = 2000;
      RegQueryValueEx(regkey, "JavaClassPath", NULL, &type, (LPBYTE)classPath, &bufSize );
      RegCloseKey(regkey);
***************
*** 47,57 ****
      RegOpenKeyEx(HKEY_LOCAL_MACHINE, "SOFTWARE\\JavaSoft\\Java Runtime Environment", 0, KEY_EXECUTE, &regkey);
      type = REG_SZ;        
! 	bufSize = 300;
      RegQueryValueEx(regkey, "CurrentVersion", NULL, &type, (LPBYTE)buf, &bufSize );
      RegCloseKey(regkey);
!     char javaVersionPath[200];
      sprintf( javaVersionPath, "SOFTWARE\\JavaSoft\\Java Runtime Environment\\%s", buf );
      RegOpenKeyEx(HKEY_LOCAL_MACHINE, javaVersionPath, 0, KEY_EXECUTE, &regkey);
!     bufSize = 300;
      type    = REG_SZ;
      buf[0] = 0;
--- 47,57 ----
      RegOpenKeyEx(HKEY_LOCAL_MACHINE, "SOFTWARE\\JavaSoft\\Java Runtime Environment", 0, KEY_EXECUTE, &regkey);
      type = REG_SZ;        
! 	bufSize = 2000;
      RegQueryValueEx(regkey, "CurrentVersion", NULL, &type, (LPBYTE)buf, &bufSize );
      RegCloseKey(regkey);
!     char javaVersionPath[2000];
      sprintf( javaVersionPath, "SOFTWARE\\JavaSoft\\Java Runtime Environment\\%s", buf );
      RegOpenKeyEx(HKEY_LOCAL_MACHINE, javaVersionPath, 0, KEY_EXECUTE, &regkey);
!     bufSize = 2000;
      type    = REG_SZ;
      buf[0] = 0;

Index: JavaCompRunner.vcproj
===================================================================
RCS file: /project/gme-repository/GMESRC/Java/native/JavaCompRunner/JavaCompRunner.vcproj,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** JavaCompRunner.vcproj	7 Apr 2005 20:48:19 -0000	1.1
--- JavaCompRunner.vcproj	7 May 2007 15:32:05 -0000	1.2
***************
*** 95,99 ****
  				Optimization="1"
  				InlineFunctionExpansion="1"
! 				AdditionalIncludeDirectories="..\..\..\GME\Interfaces,..\..\..\GME\Common,C:\j2sdk1.4.2_07\include,C:\j2sdk1.4.2_07\include\win32"
  				PreprocessorDefinitions="NDEBUG;WIN32;_WINDOWS;_USRDLL"
  				StringPooling="TRUE"
--- 95,99 ----
  				Optimization="1"
  				InlineFunctionExpansion="1"
! 				AdditionalIncludeDirectories="..\..\..\GME\Interfaces;..\..\..\GME\Common;"C:\Program Files\Java\jdk1.5.0_08\include";"C:\Program Files\Java\jdk1.5.0_08\include\win32""
  				PreprocessorDefinitions="NDEBUG;WIN32;_WINDOWS;_USRDLL"
  				StringPooling="TRUE"

Index: ComponentDll.cpp
===================================================================
RCS file: /project/gme-repository/GMESRC/Java/native/JavaCompRunner/ComponentDll.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** ComponentDll.cpp	7 Apr 2005 20:48:19 -0000	1.3
--- ComponentDll.cpp	7 May 2007 15:32:05 -0000	1.4
***************
*** 93,99 ****
  void CComponentApp::addComponents( HKEY root )
  {
!     char  buf[200];
!     char  buf2[200];
!     char  componentName[200];        
      int   ind = 0;
  
--- 93,99 ----
  void CComponentApp::addComponents( HKEY root )
  {
!     char  buf[2000];
!     char  buf2[2000];
!     char  componentName[2000];        
      int   ind = 0;
  
***************
*** 101,110 ****
      VERIFYTHROW(RegOpenKeyEx(root, "SOFTWARE\\GME\\Components", 0, KEY_READ, &folder )==ERROR_SUCCESS);
  
!     LONG  ret = RegEnumKey(folder, ind, componentName, 200);
      while(ret == ERROR_SUCCESS)
      {
!         char  classPath[200];
!         char  jclass[200];
!         DWORD len = 200;
          HKEY  component;
  
--- 101,110 ----
      VERIFYTHROW(RegOpenKeyEx(root, "SOFTWARE\\GME\\Components", 0, KEY_READ, &folder )==ERROR_SUCCESS);
  
!     LONG  ret = RegEnumKey(folder, ind, componentName, 2000);
      while(ret == ERROR_SUCCESS)
      {
!         char  classPath[2000];
!         char  jclass[2000];
!         DWORD len = 2000;
          HKEY  component;
  
***************
*** 118,122 ****
              HKEY  clsidkey;
              CLSID clsid;
!             len = 200;
              sprintf( buf, "%s\\CLSID", componentName );
              VERIFYTHROW(RegOpenKeyEx(HKEY_CLASSES_ROOT, buf, 0, KEY_READ, &clsidkey)==ERROR_SUCCESS);
--- 118,122 ----
              HKEY  clsidkey;
              CLSID clsid;
!             len = 2000;
              sprintf( buf, "%s\\CLSID", componentName );
              VERIFYTHROW(RegOpenKeyEx(HKEY_CLASSES_ROOT, buf, 0, KEY_READ, &clsidkey)==ERROR_SUCCESS);
***************
*** 126,130 ****
  
              // query class
!             len = 200;
              jclass[0] = 0;
              RegQueryValueEx(component, "JavaClass", NULL, NULL, (unsigned char*)jclass, &len );
--- 126,130 ----
  
              // query class
!             len = 2000;
              jclass[0] = 0;
              RegQueryValueEx(component, "JavaClass", NULL, NULL, (unsigned char*)jclass, &len );
***************
*** 137,141 ****
          }
          ind++;
!         ret = RegEnumKey(folder, ind, componentName, 200);
      }
  
--- 137,141 ----
          }
          ind++;
!         ret = RegEnumKey(folder, ind, componentName, 2000);
      }
  



More information about the GME-commit mailing list