win32pdh and background processes

  • Thread starter David L. Jessup
  • Start date
D

David L. Jessup

Hi there:

I am trying to write a program to monitor certain processes on a
Windows NT 4.0 box without me needing to be logged in. I have
successfully created a python program that performs this task by
running as a service on Windows 2000, but it fails on Win NT due to a
missing procedure entry point "RegisterServiceCtrlHandlerExW" in
ADVAPI32.dll; this problem appears to be due to the servicemanager
module, and exists in all versions of the win32 package back to 161,
which is when the servicemanager module first appeared. I then tried
to run the program in an infinite loop using the "Scheduled Tasks"
service to spawn the program. If I am logged in when the program is
running, the program runs fine, although it creates a console on my
screen. However, if I am not logged in when the program kicks off, my
program dies on a call to win32pdh.EnumObjectItems:

items, instances = win32pdh.EnumObjectItems(None, None, \
'Process', win32pdh.PERF_DETAIL_WIZARD)

My question: Why does win32pdh.EnumObjectItems die when I'm not
logged in?

Any help you can give me would be greatly appreciated.

--- David Jessup
(N.B.: My e-mail address has a fairly obnoxious spam filter running,
due to the large amounts of spam I receive at this address. If you
choose to e-mail me privately, ignore any e-mails from the spam
filter.)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top