This is the mail archive of the ecos-patches@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Fix population of platform list dialog on Win2k


The appended patch passes the true length of the recieve buffer to
RegEnumKeyEx() when interrogating the registry for platform info.
Previously, the length passed was one character short which could
result in premature termination of the platform read loop.

John Dallaway
eCosCentric Limited

--cut here--

Index: ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/host/tools/ecostest/ChangeLog,v
retrieving revision 1.14
diff -u -5 -r1.14 ChangeLog
--- ChangeLog	13 Feb 2003 16:23:38 -0000	1.14
+++ ChangeLog	21 Feb 2003 21:51:42 -0000
@@ -1,5 +1,11 @@
+2003-02-21  John Dallaway  <jld at ecoscentric dot com>
+
+	* common/eCosTestPlatform.cpp (CeCosTestPlatform::Load): Allow an
+	extra character for string termination when retrieving registry
+	key names.
+
 2003-02-13  John Dallaway  <jld at ecoscentric dot com>
 
 	* common/eCosTestPlatform.cpp:
 	Look for all persistent application settings under
         "HKEY_CURRENT_USER\Software\eCos Configuration Tool\"
Index: common/eCosTestPlatform.cpp
===================================================================
RCS file: /cvs/ecos/ecos/host/tools/ecostest/common/eCosTestPlatform.cpp,v
retrieving revision 1.4
diff -u -5 -r1.4 eCosTestPlatform.cpp
--- common/eCosTestPlatform.cpp	13 Feb 2003 16:23:39 -0000	1.4
+++ common/eCosTestPlatform.cpp	21 Feb 2003 21:51:43 -0000
@@ -169,18 +169,18 @@
     //      GdbCmd  String [optional]
     FILETIME ftLastWriteTime;
     DWORD dwMaxSubKeyLen;
     if(ERROR_SUCCESS==RegQueryInfoKey(hKey,NULL,NULL,NULL,&dwSubKeys,&dwMaxSubKeyLen,NULL,NULL,NULL,NULL,NULL,NULL)){
       TCHAR *szName=new TCHAR[1+dwMaxSubKeyLen];
-      DWORD dwSizeName=dwMaxSubKeyLen;
+      DWORD dwSizeName=sizeof(TCHAR)*(1+dwMaxSubKeyLen);
       for(DWORD dwIndex=0;ERROR_SUCCESS==RegEnumKeyEx(hKey, dwIndex, szName, &dwSizeName, NULL, NULL, NULL, &ftLastWriteTime); dwIndex++){
         CeCosTestPlatform t;
         if(t.LoadFromRegistry(hKey,szName)){
           t.m_strName=szName;
           CeCosTestPlatform::Add(t);
         }
-        dwSizeName=dwMaxSubKeyLen;
+        dwSizeName=sizeof(TCHAR)*(1+dwMaxSubKeyLen);
       }
       delete [] szName;
     }
     RegCloseKey(hKey);
   }


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]