Index: src/libs/zbxwin32/perfmon.c
===================================================================
--- src/libs/zbxwin32/perfmon.c	(revision 61113)
+++ src/libs/zbxwin32/perfmon.c	(working copy)
@@ -255,9 +255,9 @@
 	const char			*__function_name = "check_counter_path";
 	PDH_COUNTER_PATH_ELEMENTS	*cpe = NULL;
 	PDH_STATUS			status;
-	int				is_numeric, ret = FAIL;
+	int				path_modified = 0, ret = FAIL;
 	DWORD				dwSize = 0;
-	wchar_t				*wcounterPath;
+	wchar_t				*wcounterPath, *wptr;
 
 	wcounterPath = zbx_utf8_to_unicode(counterPath);
 
@@ -280,16 +280,45 @@
 		goto clean;
 	}
 
-	is_numeric = (SUCCEED == _wis_uint(cpe->szObjectName) ? 0x01 : 0);
-	is_numeric |= (SUCCEED == _wis_uint(cpe->szCounterName) ? 0x02 : 0);
+	if (SUCCEED == _wis_uint(cpe->szObjectName))
+	{
+		cpe->szObjectName = get_counter_name(_wtoi(cpe->szObjectName));
+		path_modified = 1;
+	}
 
-	if (0 != is_numeric)
+	if (SUCCEED == _wis_uint(cpe->szCounterName))
 	{
-		if (0x01 & is_numeric)
-			cpe->szObjectName = get_counter_name(_wtoi(cpe->szObjectName));
-		if (0x02 & is_numeric)
-			cpe->szCounterName = get_counter_name(_wtoi(cpe->szCounterName));
+		cpe->szCounterName = get_counter_name(_wtoi(cpe->szCounterName));
+		path_modified = 1;
+	}
 
+	if (NULL != cpe->szInstanceName)
+	{
+		for (wptr = cpe->szInstanceName; L'\0' != *wptr; wptr++)
+		{
+			switch (*wptr)
+			{
+				case L'(':
+					*wptr = L'[';
+					break;
+				case L')':
+					*wptr = L']';
+					break;
+				case L'#':
+				case L'\\':
+				case L'/':
+					*wptr = L'_';
+					break;
+				default:
+					continue;
+			}
+
+			path_modified = 1;
+		}
+	}
+
+	if (0 != path_modified)
+	{
 		if (ERROR_SUCCESS != zbx_PdhMakeCounterPath(__function_name, cpe, counterPath))
 			goto clean;
 
Index: bin/win32/zabbix_agentd.exe
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/x-dosexec
