win32pdh and background processes

  • Thread starter David L. Jessup
  • Start date
D

David L. Jessup

I'm sorry if this is a duplicate posting. I attempted to post before,
but it doesn't appear to have been sent out correctly.

Anyway, I've got a problem, and I'm hoping somebody here can help.
First the background:

I'm trying to write a program that monitors processes on a legacy
Windows NT 4.0 box. I have written one version of this program that I
can run from the command line --- but logging out of the account kills
the program. I have also written a version of this program that runs
(successfully) as a service on Windows 2000, but fails on Win NT with
the following message:

The procedure entry point RegisterServiceCtrlHandlerExW could not
be located in the dynamic link library ADVAPI32.dll.

Further investigation has revealed that this DLL problem is associated
with all versions of the servicemanager module dating back to its
introduction in version 161 of the win32 package.

I have also tried running my program under the Scheduled Tasks
service. If I am logged in, this works perfectly well, although it
creates a console for the program. However, if I am not logged in,
the program dies on the win32pdh.EnumObjectItems function:

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

My questions are:
(a) Why does win32pdh.EnumObjectItems die when I am not logged on?
(b) Is there a technique other than creating my own service or using
the Scheduled Tasks service to run a program when I'm not logged in?

--- David
 

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

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,822
Latest member
israfaceZa

Latest Threads

Top