[python-win32] RegisterServiceCtrlHandler(Ex) and Handler(Ex)

le dahut le.dahut at laposte.net
Tue Feb 5 11:02:08 CET 2008


Hello,

While trying to use RegisterServiceCtrlHandler function, it appears that 
  this function acts like RegisterServiceCtrlHandlerEx if it is run on 
W2000 or higher.

According to msdn, a HandlerEx function has to be used to get callbacks. 
This function should take 4 arguments :
DWORD WINAPI HandlerEx(
   __in  DWORD dwControl,
   __in  DWORD dwEventType,
   __in  LPVOID lpEventData,
   __in  LPVOID lpContext
);

But in fact it gets only one.
I've modified win32serviceutil to verify it :
def ServiceCtrlHandler(self, control) => def ServiceCtrlHandler(self, 
control, *args)

and :
def SvcOther(self, control, *args):

*args still is an empty tuple (). I only get "dwControl", why don't I 
get "dwEventType", "lpEventData" and "lpContext" (this last one is user 
defined so it can be empty, but not the other two) ?



More information about the python-win32 mailing list