Performance Monitor object issues on 32 Bit OS, works on 32-bit but not on 64-bit

Hi,

  1. We have our own perfomance monitor object which works OK Windows 2000 32-bit, but does not work
    OK on 64-bit(IA-64) and 32-bit Windows 2003 for Counter Logs, but System monitor is working OK on
    all platforms.

******Log**************
(PDH-CSV 4.0) (India Standard Time)(-330) \CANON\XXXX(000000 G:)\Avg. Disk Bytes/Transfer
11/19/2004 11:18:26.312
11/19/2004 11:18:27.296
11/19/2004 11:18:28.296
11/19/2004 11:18:29.296
11/19/2004 11:18:30.296
11/19/2004 11:18:31.296
11/19/2004 11:18:32.312
11/19/2004 11:18:33.296
11/19/2004 11:18:34.296

  1. Also, If we are selecting all instances and all counters under Counter log, all instances are not comming
    on Windows 2003 but working on Windows 2000.

This is just the main code extract on how are are doing, we have done no changes to the code for
different plaforms.

********************** Code Extract*******
IEnumWbemClassObject l_penumerator;
IWbemServices* l_services;
ULONG l_uljunk;
DWORD NUM_INSTANCES = 0;
IWbemClassObject** l_ppcop = NULL;

l_Hr = l_services->CreateInstanceEnum(bs,WBEM_FLAG_SHALLOW |
WBEM_FLAG_RETURN_IMMEDIATELY, NULL, &l_penumerator);

l_Hr = l_penumerator->Next(INFINITE, 1, &l_ppcop[NUM_INSTANCES], &l_uljunk);
/* PROBLEM: In Win2003, it is breaking on the very first time.
but in Win 2K, it is enumerating properly */
if(l_Hr == WBEM_S_FALSE){
break;
}

********************** Code Extract*******
If we are not use WMI objects, it seems to be OK, please suggest a way with WMI.

Thanks and Regards
Deepak

Any inputs on this, please note that malloc,etc is done and code snippet lists the main
lines only.
Need to know, if there is way out or if some good WMI sample code is available with anyone working on Windows 2003, if the usage is incorrect. I guess, more or less whatever works on Windows 2000 should work on Windows 2003, if anyone has any input, please let me know. need this urgently.

Thanks and Regards
Deepak


From: Kotian, Deepak
Sent: Fri 11/19/2004 12:12 PM
To: xxxxx@lists.osr.com
Subject: Performance Monitor object issues on 32 Bit OS, works on 32-bit but not on 64-bit

Hi,

  1. We have our own perfomance monitor object which works OK Windows 2000 32-bit, but does not work
    OK on 64-bit(IA-64) and 32-bit Windows 2003 for Counter Logs, but System monitor is working OK on
    all platforms.

******Log**************
(PDH-CSV 4.0) (India Standard Time)(-330) \CANON\XXXX(000000 G:)\Avg. Disk Bytes/Transfer
11/19/2004 11:18:26.312
11/19/2004 11:18:27.296
11/19/2004 11:18:28.296
11/19/2004 11:18:29.296
11/19/2004 11:18:30.296
11/19/2004 11:18:31.296
11/19/2004 11:18:32.312
11/19/2004 11:18:33.296
11/19/2004 11:18:34.296

  1. Also, If we are selecting all instances and all counters under Counter log, all instances are not comming
    on Windows 2003 but working on Windows 2000.

This is just the main code extract on how are are doing, we have done no changes to the code for
different plaforms.

********************** Code Extract*******
IEnumWbemClassObject l_penumerator;
IWbemServices* l_services;
ULONG l_uljunk;
DWORD NUM_INSTANCES = 0;
IWbemClassObject** l_ppcop = NULL;

l_Hr = l_services->CreateInstanceEnum(bs,WBEM_FLAG_SHALLOW |
WBEM_FLAG_RETURN_IMMEDIATELY, NULL, &l_penumerator);

l_Hr = l_penumerator->Next(INFINITE, 1, &l_ppcop[NUM_INSTANCES], &l_uljunk);
/* PROBLEM: In Win2003, it is breaking on the very first time.
but in Win 2K, it is enumerating properly */
if(l_Hr == WBEM_S_FALSE){
break;
}

********************** Code Extract*******
If we are not use WMI objects, it seems to be OK, please suggest a way with WMI.

Thanks and Regards
Deepak