szFirstBackSlash[0] = '\0';
HRESULT ParseForWinRegInfo(LPSTR szString, LPSTR szKeyStr, LPSTR szRootKey, DWORD dwRootKeyBufSize, LPSTR szKey, DWORD dwKeyBufSize, LPSTR szName, DWORD dwNameBufSize){  int     i;  int     iLen;  int     iBrackets;  char    szStrCopy[MAX_BUF];  LPSTR   szFirstNonSpace;  LPSTR   szFirstBackSlash;  BOOL    bFoundOpenBracket;  BOOL    bFoundName;  *szRootKey = '\0';  *szKey = '\0';  *szName = '\0';  lstrcpy(szStrCopy, szString);  if((szFirstNonSpace = GetFirstNonSpace(&(szStrCopy[lstrlen(szKeyStr)]))) != NULL)  {    iLen = lstrlen(szFirstNonSpace);    if(szFirstNonSpace[iLen - 1] == '\n')    {      szFirstNonSpace[--iLen] = '\0';    }    szFirstBackSlash = strstr(szFirstNonSpace, "\\");    if(!szFirstBackSlash)      return(WIZ_ERROR_PARSING_UNINST_STRS);    lstrcpy(szRootKey, szFirstNonSpace);    szFirstNonSpace = &(szFirstBackSlash[1]);    iLen = lstrlen(szFirstNonSpace);    iBrackets         = 0;    bFoundName        = FALSE;    bFoundOpenBracket = FALSE;    for(i = iLen - 1; i >= 0; i--)    {      if(bFoundName == FALSE)      {        /* Find the Name created in the Windows registry key.         * Since the Name can contain '[' and ']', we have to         * parse for the brackets that denote the Name string in         * szFirstNonSpace.  It parses from right to left.         */        if(szFirstNonSpace[i] == ']')        {          if(iBrackets == 0)            szFirstNonSpace[i] = '\0';          ++iBrackets;        }        else if(szFirstNonSpace[i] == '[')        {          bFoundOpenBracket = TRUE;          --iBrackets;        }        if((bFoundOpenBracket) && (iBrackets == 0))        {          lstrcpy(szName, &(szFirstNonSpace[i + 1]));          bFoundName = TRUE;        }      }      else      {        /* locate the first non space to the left of the last '[' */        if(!isspace(szFirstNonSpace[i]))        {          szFirstNonSpace[i + 1] = '\0';          lstrcpy(szKey, szFirstNonSpace);          break;        }      }    }  }  return(WIZ_OK);}