static BOOL is_local_machine( const WCHAR *name, DWORD len )
{
WCHAR buf[MAX_COMPUTERNAME_LENGTH + 1];
- DWORD buflen = sizeof(buf) / sizeof(buf[0]);
+ DWORD buflen = ARRAY_SIZE(buf);
if (!GetComputerNameW( buf, &buflen )) return FALSE;
return len == buflen && !memicmpW( name, buf, buflen );
}
*hcounter = NULL;
- for (i = 0; i < sizeof(counter_sources) / sizeof(counter_sources[0]); i++)
+ for (i = 0; i < ARRAY_SIZE(counter_sources); i++)
{
if (pdh_match_path( counter_sources[i].path, path ))
{
FIXME("remote machine not supported\n");
return PDH_CSTATUS_NO_MACHINE;
}
- for (i = 0; i < sizeof(counter_sources) / sizeof(counter_sources[0]); i++)
+ for (i = 0; i < ARRAY_SIZE(counter_sources); i++)
{
if (pdh_match_path( counter_sources[i].path, name ))
{
PDH_STATUS ret;
WCHAR *machineW = NULL;
WCHAR bufferW[PDH_MAX_COUNTER_NAME];
- DWORD sizeW = sizeof(bufferW) / sizeof(WCHAR);
+ DWORD sizeW = ARRAY_SIZE(bufferW);
TRACE("%s %d %p %p\n", debugstr_a(machine), index, buffer, size);
if (!buffer || !size) return PDH_INVALID_ARGUMENT;
if (!index) return ERROR_SUCCESS;
- for (i = 0; i < sizeof(counter_sources) / sizeof(counter_sources[0]); i++)
+ for (i = 0; i < ARRAY_SIZE(counter_sources); i++)
{
if (counter_sources[i].index == index)
{
if ((ret = validate_path( path ))) return ret;
- for (i = 0; i < sizeof(counter_sources) / sizeof(counter_sources[0]); i++)
+ for (i = 0; i < ARRAY_SIZE(counter_sources); i++)
if (pdh_match_path( counter_sources[i].path, path )) return ERROR_SUCCESS;
return PDH_CSTATUS_NO_COUNTER;
}
+/***********************************************************************
+ * PdhVbAddCounter (PDH.@)
+ */
+PDH_STATUS WINAPI PdhVbAddCounter( PDH_HQUERY query, LPCSTR path, PDH_HCOUNTER *counter )
+{
+ FIXME("%p, %s, %p: stub!\n", query, debugstr_a(path), counter);
+
+ if (!path) return PDH_INVALID_ARGUMENT;
+
+ return PDH_NOT_IMPLEMENTED;
+}
+
/***********************************************************************
* PdhValidatePathExA (PDH.@)
*/