ReactOS 0.4.16-dev-340-g0540c21
CInterruptSync Class Reference
Inheritance diagram for CInterruptSync:
Collaboration diagram for CInterruptSync:

Public Member Functions

STDMETHODIMP QueryInterface (REFIID InterfaceId, PVOID *Interface)
 
 CInterruptSync (IUnknown *OuterUnknown)
 
virtual ~CInterruptSync ()
 
- Public Member Functions inherited from CUnknownImpl< IInterruptSync >
 STDMETHODIMP_ (ULONG) AddRef()
 
 STDMETHODIMP_ (ULONG) Release()
 

Public Attributes

 IMP_IInterruptSync
 
KSPIN_LOCK m_Lock
 
LIST_ENTRY m_ServiceRoutines
 
PKINTERRUPT m_Interrupt
 
INTERRUPTSYNCMODE m_Mode
 
PRESOURCELIST m_ResourceList
 
ULONG m_ResourceIndex
 
PINTERRUPTSYNCROUTINE m_SyncRoutine
 
PVOID m_DynamicContext
 
NTSTATUS m_Status
 

Friends

BOOLEAN NTAPI CInterruptSynchronizedRoutine (IN PVOID ServiceContext)
 
BOOLEAN NTAPI IInterruptServiceRoutine (IN PKINTERRUPT Interrupt, IN PVOID ServiceContext)
 

Additional Inherited Members

- Protected Member Functions inherited from CUnknownImpl< IInterruptSync >
 CUnknownImpl ()
 
virtual ~CUnknownImpl ()
 

Detailed Description

Definition at line 21 of file interrupt.cpp.

Constructor & Destructor Documentation

◆ CInterruptSync()

CInterruptSync::CInterruptSync ( IUnknown OuterUnknown)
inline

Definition at line 27 of file interrupt.cpp.

27{}

◆ ~CInterruptSync()

virtual CInterruptSync::~CInterruptSync ( )
inlinevirtual

Definition at line 28 of file interrupt.cpp.

28{}

Member Function Documentation

◆ QueryInterface()

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

Definition at line 53 of file interrupt.cpp.

56{
58
59 DPRINT("CInterruptSync::QueryInterface: this %p\n", this);
60
61 if (IsEqualGUIDAligned(refiid, IID_IInterruptSync) ||
63 {
64 *Output = PVOID(PUNKNOWN(this));
65 PUNKNOWN(*Output)->AddRef();
66 return STATUS_SUCCESS;
67 }
68
70 {
71 DPRINT1("CInterruptSync::QueryInterface: no interface!!! iface %S\n", GuidString.Buffer);
73 }
74
76}
#define DPRINT1
Definition: precomp.h:8
const GUID IID_IUnknown
IUnknown * PUNKNOWN
Definition: com_apitest.h:45
NTSYSAPI NTSTATUS WINAPI RtlStringFromGUID(REFGUID, PUNICODE_STRING)
ULONG AddRef()
static PWSTR GuidString
Definition: apphelp.c:93
NTSYSAPI VOID NTAPI RtlFreeUnicodeString(PUNICODE_STRING UnicodeString)
@ Output
Definition: arc.h:85
#define STATUS_SUCCESS
Definition: shellext.h:65
#define DPRINT
Definition: sndvol32.h:73
void * PVOID
Definition: typedefs.h:50
#define STATUS_UNSUCCESSFUL
Definition: udferr_usr.h:132
#define IsEqualGUIDAligned(guid1, guid2)
Definition: wdm.template.h:235

Friends And Related Function Documentation

◆ CInterruptSynchronizedRoutine

BOOLEAN NTAPI CInterruptSynchronizedRoutine ( IN PVOID  ServiceContext)
friend

Definition at line 84 of file interrupt.cpp.

86{
88 This->m_Status = This->m_SyncRoutine(This, This->m_DynamicContext);
89
90 DPRINT("CInterruptSynchronizedRoutine this %p SyncRoutine %p Context %p Status %x\n", This, This->m_SyncRoutine, This->m_DynamicContext, This->m_Status);
91 return TRUE;
92}
#define TRUE
Definition: types.h:120
_In_ PKSERVICE_ROUTINE _In_opt_ PVOID ServiceContext
Definition: iofuncs.h:801

◆ IInterruptServiceRoutine

BOOLEAN NTAPI IInterruptServiceRoutine ( IN PKINTERRUPT  Interrupt,
IN PVOID  ServiceContext 
)
friend

Definition at line 139 of file interrupt.cpp.

142{
143 PLIST_ENTRY CurEntry;
146 BOOL Success, Ret;
147
149
150 DPRINT("IInterruptServiceRoutine Mode %u\n", This->m_Mode);
151
152 Ret = FALSE;
153 if (This->m_Mode == InterruptSyncModeNormal)
154 {
155 CurEntry = This->m_ServiceRoutines.Flink;
156 while (CurEntry != &This->m_ServiceRoutines)
157 {
158 Entry = CONTAINING_RECORD(CurEntry, SYNC_ENTRY, ListEntry);
159 Status = Entry->SyncRoutine((CInterruptSync*)This, Entry->DynamicContext);
160 if (Status == STATUS_SUCCESS)
161 {
162 /* Mark as handled and break on the first success */
163 Ret = TRUE;
164 break;
165 }
166 CurEntry = CurEntry->Flink;
167 }
168 return Ret;
169 }
170 else if (This->m_Mode == InterruptSyncModeAll)
171 {
172 CurEntry = This->m_ServiceRoutines.Flink;
173 while (CurEntry != &This->m_ServiceRoutines)
174 {
175 Entry = CONTAINING_RECORD(CurEntry, SYNC_ENTRY, ListEntry);
176 Status = Entry->SyncRoutine((CInterruptSync*)This, Entry->DynamicContext);
177 if (Status == STATUS_SUCCESS)
178 {
179 /* Mark as handled but don't break */
180 Ret = TRUE;
181 }
182 CurEntry = CurEntry->Flink;
183 }
184 return Ret;
185 }
186 else if (This->m_Mode == InterruptSyncModeRepeat)
187 {
188 do
189 {
190 Success = FALSE;
191 CurEntry = This->m_ServiceRoutines.Flink;
192 while (CurEntry != &This->m_ServiceRoutines)
193 {
194 Entry = CONTAINING_RECORD(CurEntry, SYNC_ENTRY, ListEntry);
195 Status = Entry->SyncRoutine((CInterruptSync*)This, Entry->DynamicContext);
196 if (Status == STATUS_SUCCESS)
197 {
198 /* Mark as handled if it works at least once */
199 Success = TRUE;
200 Ret = TRUE;
201 }
202 CurEntry = CurEntry->Flink;
203 }
204 } while(Success);
205 return Ret;
206 }
207 else
208 {
209 DPRINT("Unknown mode %u\n", This->m_Mode);
210 return Ret;
211 }
212}
LONG NTSTATUS
Definition: precomp.h:26
#define FALSE
Definition: types.h:117
@ Success
Definition: eventcreate.c:712
unsigned int BOOL
Definition: ntddk_ex.h:94
Status
Definition: gdiplustypes.h:25
@ InterruptSyncModeAll
Definition: portcls.h:841
@ InterruptSyncModeNormal
Definition: portcls.h:840
@ InterruptSyncModeRepeat
Definition: portcls.h:842
base of all file and directory entries
Definition: entries.h:83
Definition: interrupt.cpp:15
Definition: typedefs.h:120
struct _LIST_ENTRY * Flink
Definition: typedefs.h:121
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260

Member Data Documentation

◆ IMP_IInterruptSync

CInterruptSync::IMP_IInterruptSync

Definition at line 26 of file interrupt.cpp.

◆ m_DynamicContext

PVOID CInterruptSync::m_DynamicContext

Definition at line 40 of file interrupt.cpp.

◆ m_Interrupt

PKINTERRUPT CInterruptSync::m_Interrupt

Definition at line 34 of file interrupt.cpp.

◆ m_Lock

KSPIN_LOCK CInterruptSync::m_Lock

Definition at line 32 of file interrupt.cpp.

◆ m_Mode

INTERRUPTSYNCMODE CInterruptSync::m_Mode

Definition at line 35 of file interrupt.cpp.

◆ m_ResourceIndex

ULONG CInterruptSync::m_ResourceIndex

Definition at line 37 of file interrupt.cpp.

◆ m_ResourceList

PRESOURCELIST CInterruptSync::m_ResourceList

Definition at line 36 of file interrupt.cpp.

◆ m_ServiceRoutines

LIST_ENTRY CInterruptSync::m_ServiceRoutines

Definition at line 33 of file interrupt.cpp.

◆ m_Status

NTSTATUS CInterruptSync::m_Status

Definition at line 41 of file interrupt.cpp.

◆ m_SyncRoutine

PINTERRUPTSYNCROUTINE CInterruptSync::m_SyncRoutine

Definition at line 39 of file interrupt.cpp.


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