Source code of Windows XP (NT5)
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
/*++
Copyright (C) 1997-2001 Microsoft Corporation
Module Name:
Abstract:
History:
--*/
//***************************************************************************
//
// EVPROV.H
//
// Sample event provider.
//
// raymcc 14-Aug-97
//
//***************************************************************************
#ifndef _EVPROV_H_
#define _EVPROV_H_
#define EVENTCLASS L"MyEvent"
class CMyEventProvider : public IWbemEventProvider, public IWbemProviderInit { ULONG m_cRef; IWbemServices *m_pNs; IWbemObjectSink *m_pSink; IWbemClassObject *m_pEventClassDef; int m_eStatus; HANDLE m_hThread; static DWORD WINAPI EventThread(LPVOID pArg); void InstanceThread();
public: enum { Pending, Running, PendingStop, Stopped };
CMyEventProvider(); ~CMyEventProvider();
//
// IUnknown members
//
STDMETHODIMP QueryInterface(REFIID, LPVOID *); STDMETHODIMP_(ULONG) AddRef(void); STDMETHODIMP_(ULONG) Release(void);
// Inherited from IWbemEventProvider
// =================================
HRESULT STDMETHODCALLTYPE ProvideEvents( /* [in] */ IWbemObjectSink __RPC_FAR *pSink, /* [in] */ long lFlags );
// Inherited from IWbemProviderInit
// ================================
HRESULT STDMETHODCALLTYPE Initialize( /* [in] */ LPWSTR pszUser, /* [in] */ LONG lFlags, /* [in] */ LPWSTR pszNamespace, /* [in] */ LPWSTR pszLocale, /* [in] */ IWbemServices __RPC_FAR *pNamespace, /* [in] */ IWbemContext __RPC_FAR *pCtx, /* [in] */ IWbemProviderInitSink __RPC_FAR *pInitSink ); };
#endif
|