[omniORB] omniORB & cygwin1.dll (latest snapshot) wrapper bug

Goral, Jack jgoral@spss.com
Mon, 20 Mar 2000 09:00:50 -0600


Latest snapshot cygwin1.dll puts empty mount entries into Windows registry.
All xxxwrapper.c and gnuwin32.c (omkdepend) require a small change to work
again:

void GetGnuwin32Mounts(void)
{
  HKEY hkey;
  LONG rc;
  unsigned long len;
  char key[256];

  for (nmounts = 0; nmounts < MAX_MOUNTS; nmounts++) {
    sprintf(key,
	    "Software\\Cygnus Solutions\\CYGWIN.DLL
setup\\b15.0\\mounts\\%02X"
	    ,nmounts);

    if (RegOpenKeyEx(HKEY_CURRENT_USER,
		     key, 
		     0, 
		     KEY_READ, 
		     &hkey) != ERROR_SUCCESS) {
      if (nmounts == 0) {
		printf("Couldn't find registry key '%s' - RegOpenKey error
%d\n",
	       key, GetLastError());
		exit(1);
      }
      /* Empty registry keys at the end.
       * It happens with cygwin latest snapshot.
       */
      break;
    }

    if (RegQueryValueEx(hkey,
			"unix",
			NULL,
			NULL,
			NULL,
			&len) != ERROR_SUCCESS) {
//<modified-jgoral>
      if (nmounts == 0) {
		printf("1:RegQueryValueEx failed - error %d
\n",GetLastError());
		exit(1);
      }
      else
		break;
//</modified-jgoral>
    }
    unix[nmounts] = (char *)malloc(len+1);
    ....
    ....


Jack Goral