WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

Process ID

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

213: Cannot Retrieve Counter Index

Keywords: 	  213: Cannot retrieve counter Index

Question:

I'm getting the following error on a single machine with the Process Extender tListProc():
 
   213: Cannot retrieve counter Index.
This is on NT4. Works on a ton of other machines.

Answer:

tListProc is attempting to retrieve a counter index from the registry under the key:
   HKEY_Local_Machine\Software\Microsoft\Windows NT\CurrentVersion\perflib\00

The logged in user must have READ permission on that key. Perfromance counting might be disabled on this machine. Check if the following registry key is defined.
[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\PerfProc\Performance]
"Disable Performance Counters"=dword:00000000
If it is please reference: http://techsupt.winbatch.com/webcgi/webbatch.exe?techsupt/nftechsupt.web+WinBatch/Functions+Performance~Counters~Disabled.txt

Question:

I have winbatch 2000c and the process extender that goes with that which is wproc32i.dll version 10006.

I discovered that after using the tlistproc() command too many times on a particular computer that i will get the following error message... WIL Extender error 213: Cannot Retrieve Counter Index.

I wrote a small loop that would keep track of the number of times that i called the command and it seems to fail at about the same number on two different NT4 boxes. One of which is NT Server, and the other is just Workstation. That number is a very familiar number to me. 32768. That number is just a little too close to... oh lets say some theoretical, or perhaps not so theoretical ceiling. I can resolve the problem by logging out and back in or restarting, one of those two. i'll have to double-check that. i was hoping that someone out there might check this out, and perhaps offer a suggestion as to how one could get rid of this error. do i need to use a DLLFREE command to maybe get this extender out of memory and then reload it? or would that be a waste of time? i'll probably try that in the meantime.

This is my test script. (sorry winbatch guys it's more than 5 lines, but not that long! :-) it's just got an error handler wrapped around it. obviously you'll probably turn off all the error handling for testing.)

Addextender("wproc32i.dll")
IntControl(73,2,0,0,0)
errormode(@off)
lcc = 0
le = 0

boxopen("process list test","Starting...")

starttime = timedate()

while le == 0
lcc = lcc + 1
currenttime = timedate()
boxtext(strcat("Start time was: %starttime%",@CR,"Current count is: %lcc%",@CR,"Current
time is: %currenttime%"))
proclist=tlistproc()
yield(5000)
end while

endtime = timedate()

message("process list check failure","Failure occured on attempt %lcc%")

exit

:WBERRORHANDLER
le = LastError()
return
Thanks, in advance for any help you can provide!

Answer:

I believe this error is a result of a bug in Windows NT 4.0. This error occurs when an application is repeatedly opening, closing, and reopening the key, which causes an internal reference counter to overflow, and RegOpenKeyEx to fail.

Behind the scenes the tListProc function accesses the 'Perflib' key in the registry to get process information. We open the key grab the info then close the key.

Microsoft has confirmed this to be a problem in Windows NT 4.0. On Windows NT 4.0 starting with Service Pack 4 (SP4), the key can be opened and closed only 65,535 times. Note: This bug was corrected in Windows 2000.

I am not sure that unloading the wwproc32i.dll will solve the problem. I sounds as though you might have to reboot.

A supported fix for NT 4.0 is now available from Microsoft, but it is only intended to correct the problem described and should be applied only to systems experiencing this specific problem.

To resolve this problem, contact Microsoft Product Support Services to obtain the fix. For a complete list of Microsoft Product Support Services phone numbers and information on support costs, please go to the following address on the World Wide Web:

http://support.microsoft.com/directory/overview.asp

This information was gathered from the following Microsoft tech article: http://support.microsoft.com/support/kb/articles/Q237/3/04.ASP


Question:

I'm running tListProc() on a network machine in which I have full permissions as administrator to read and write the registry, but when I run the function, I'm getting the Error 213.

If I runs the script on my local NT machine, it works fine. I have admin permissions on that remote machine. Any ideas?

Answer:

tListProc() cannot access processes on a remote machine. No way to do that with this function or any other functions we offer at the present time.

This has nothing to do with the registry permissions in this case, but rather with the fact that tListProc looks at the local machine only.


You could try installing and running the 'exctrlst' utility. This tool provides information about the performance counter DLLs that have been installed on a computer running Microsoft Windows. The tool lists the services and applications that provide performance information by using the Windows registry. When monitored using the Performance console provided in Windows, the data provided by these performance counters can be useful for optimizing and troubleshooting.

http://technet.microsoft.com/en-us/library/cc737958(WS.10).aspx


Article ID:   W14546
Filename:   213 Cannot Retrieve Counter Index.txt
File Created: 2017:07:28:13:58:38
Last Updated: 2014:07:18:09:49:33