ReactOS  0.4.14-dev-317-g96040ec
CServiceGroup Class Reference
Inheritance diagram for CServiceGroup:
Collaboration diagram for CServiceGroup:

Public Member Functions

STDMETHODIMP QueryInterface (REFIID InterfaceId, PVOID *Interface)
 
 STDMETHODIMP_ (ULONG) AddRef()
 
 STDMETHODIMP_ (ULONG) Release()
 
 CServiceGroup (IUnknown *OuterUnknown)
 
virtual ~CServiceGroup ()
 

Public Attributes

 IMP_IServiceGroup
 

Protected Attributes

LIST_ENTRY m_ServiceSinkHead
 
BOOL m_TimerInitialized
 
KTIMER m_Timer
 
KDPC m_Dpc
 
KSPIN_LOCK m_Lock
 
LONG m_Ref
 

Friends

VOID NTAPI IServiceGroupDpc (IN struct _KDPC *Dpc, IN PVOID DeferredContext, IN PVOID SystemArgument1, IN PVOID SystemArgument2)
 

Detailed Description

Definition at line 32 of file service_group.cpp.

Constructor & Destructor Documentation

◆ CServiceGroup()

CServiceGroup::CServiceGroup ( IUnknown OuterUnknown)

Definition at line 109 of file service_group.cpp.

110 {
111  // initialize dpc
113 
114  // set highest importance
116 
117  // initialize service group list lock
119 
120  // initialize service group list
122 }
VOID NTAPI KeSetImportanceDpc(IN PKDPC Dpc, IN KDPC_IMPORTANCE Importance)
Definition: dpc.c:957
LIST_ENTRY m_ServiceSinkHead
FORCEINLINE VOID KeInitializeSpinLock(_Out_ PKSPIN_LOCK SpinLock)
Definition: kefuncs.h:251
KSPIN_LOCK m_Lock
#define InitializeListHead(ListHead)
Definition: env_spec_w32.h:944
VOID NTAPI KeInitializeDpc(IN PKDPC Dpc, IN PKDEFERRED_ROUTINE DeferredRoutine, IN PVOID DeferredContext)
Definition: dpc.c:711
friend VOID NTAPI IServiceGroupDpc(IN struct _KDPC *Dpc, IN PVOID DeferredContext, IN PVOID SystemArgument1, IN PVOID SystemArgument2)

◆ ~CServiceGroup()

virtual CServiceGroup::~CServiceGroup ( )
inlinevirtual

Definition at line 56 of file service_group.cpp.

56 {}

Member Function Documentation

◆ QueryInterface()

NTSTATUS NTAPI CServiceGroup::QueryInterface ( REFIID  InterfaceId,
PVOID Interface 
)

Definition at line 82 of file service_group.cpp.

85 {
87 
88  if (IsEqualGUIDAligned(refiid, IID_IServiceGroup) ||
89  IsEqualGUIDAligned(refiid, IID_IServiceSink) ||
91  {
92  *Output = PVOID(PSERVICEGROUP(this));
93  PUNKNOWN(*Output)->AddRef();
94  return STATUS_SUCCESS;
95  }
96 
98  {
99  DPRINT1("CServiceGroup::QueryInterface no interface!!! iface %S\n", GuidString.Buffer);
101  }
102 
103  return STATUS_UNSUCCESSFUL;
104 }
IServiceGroup * PSERVICEGROUP
Definition: portcls.h:614
static PWSTR GuidString
Definition: apphelp.c:91
IUnknown * PUNKNOWN
Definition: com_apitest.h:45
#define IsEqualGUIDAligned(guid1, guid2)
Definition: wdm.template.h:233
void * PVOID
Definition: retypes.h:9
const GUID IID_IUnknown
NTSYSAPI VOID NTAPI RtlFreeUnicodeString(PUNICODE_STRING UnicodeString)
ULONG AddRef()
#define STATUS_UNSUCCESSFUL
Definition: udferr_usr.h:132
Definition: arc.h:85
NTSYSAPI NTSTATUS WINAPI RtlStringFromGUID(REFGUID, PUNICODE_STRING)
#define DPRINT1
Definition: precomp.h:8
return STATUS_SUCCESS
Definition: btrfs.c:2938

◆ STDMETHODIMP_() [1/2]

CServiceGroup::STDMETHODIMP_ ( ULONG  )
inline

Definition at line 37 of file service_group.cpp.

38  {
40  return m_Ref;
41  }
#define InterlockedIncrement
Definition: armddk.h:53

◆ STDMETHODIMP_() [2/2]

CServiceGroup::STDMETHODIMP_ ( ULONG  )
inline

Definition at line 42 of file service_group.cpp.

43  {
45 
46  if (!m_Ref)
47  {
48  delete this;
49  return 0;
50  }
51  return m_Ref;
52  }
#define InterlockedDecrement
Definition: armddk.h:52

Friends And Related Function Documentation

◆ IServiceGroupDpc

VOID NTAPI IServiceGroupDpc ( IN struct _KDPC Dpc,
IN PVOID  DeferredContext,
IN PVOID  SystemArgument1,
IN PVOID  SystemArgument2 
)
friend

Definition at line 252 of file service_group.cpp.

258 {
259  PLIST_ENTRY CurEntry;
262 
263  // acquire service group list lock
265 
266  // grab first entry
267  CurEntry = This->m_ServiceSinkHead.Flink;
268 
269  // loop the list and call the attached service sink/group
270  while (CurEntry != &This->m_ServiceSinkHead)
271  {
272  //grab current entry
274 
275  // call service sink/group
276  Entry->pServiceSink->RequestService();
277 
278  // move to next entry
279  CurEntry = CurEntry->Flink;
280  }
281 
282  // release service group list lock
284 }
struct _Entry Entry
Definition: kefuncs.h:640
VOID NTAPI KeAcquireSpinLockAtDpcLevel(IN PKSPIN_LOCK SpinLock)
Definition: spinlock.c:192
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
struct _LIST_ENTRY * Flink
Definition: typedefs.h:119
VOID NTAPI KeReleaseSpinLockFromDpcLevel(IN PKSPIN_LOCK SpinLock)
Definition: spinlock.c:215
Definition: typedefs.h:117
struct GROUP_ENTRY * PGROUP_ENTRY
base of all file and directory entries
Definition: entries.h:82
_In_opt_ PVOID DeferredContext
Definition: ketypes.h:675

Referenced by CServiceGroup().

Member Data Documentation

◆ IMP_IServiceGroup

CServiceGroup::IMP_IServiceGroup

Definition at line 54 of file service_group.cpp.

◆ m_Dpc

KDPC CServiceGroup::m_Dpc
protected

Definition at line 64 of file service_group.cpp.

Referenced by CServiceGroup().

◆ m_Lock

KSPIN_LOCK CServiceGroup::m_Lock
protected

Definition at line 65 of file service_group.cpp.

Referenced by CServiceGroup().

◆ m_Ref

LONG CServiceGroup::m_Ref
protected

Definition at line 69 of file service_group.cpp.

Referenced by STDMETHODIMP_().

◆ m_ServiceSinkHead

LIST_ENTRY CServiceGroup::m_ServiceSinkHead
protected

Definition at line 60 of file service_group.cpp.

Referenced by CServiceGroup().

◆ m_Timer

KTIMER CServiceGroup::m_Timer
protected

Definition at line 63 of file service_group.cpp.

◆ m_TimerInitialized

BOOL CServiceGroup::m_TimerInitialized
protected

Definition at line 62 of file service_group.cpp.


The documentation for this class was generated from the following file: