Greetings everybody,
Does anyone have any info on the IServiceProvider::QueryService method? I'm trying to get a pointer to the ITimerService interface and I don't have any idea as to what is required for the first parameter of the method. The prototype is as follows:

HRESULT QueryService(
REFGUID guidService,
REFIID riid,
void **ppv

guidService: Unique identifier of the service (a SID).
riid: Unique identifier of the interface the caller wishes to receive for the service.

The second parameter should be IID_ITimerService. What about the first?
Is there a specific timer associated SID on Win2K?

Or equivalently, What is the SID associated with the Windows Timer Service (W32Timer)?
Posted on 2003-08-03 21:41:38 by Poimander
Hi Poimander,

its totally up to the object what is accepts as SID.
Some SIDs are defined for windows shell and IE in shlguid.h for example.

Posted on 2003-08-04 00:14:21 by japheth
Hi japheth,
Apparently only a few objects actually support the IServiceProvider
interface, but I still haven't been able to get a pointer to the ITimerService. There is very little info on the net, so it appears the ITimerService interface isn't really supported in practice, otherwise MS would have produced dedicated examples of it's usage by now.
Posted on 2003-08-04 18:49:37 by Poimander
Here you go Poimander, from comdef.h

struct __declspec(uuid("3050F35F-98B5-11CF-BB82-00AA00BDCE0B")) ITimerService;
Posted on 2003-08-30 00:08:01 by djinn