ReactOS  0.4.15-dev-3723-g8d70159
fxinterruptthreadpoolum.hpp
Go to the documentation of this file.
1 /*++
2 
3 Copyright (c) Microsoft. All rights reserved.
4 
5 Module Name:
6 
7  FxInterruptThreadpoolUm.hpp
8 
9 Abstract:
10 
11  This file contains the class definition for the threadpool for interrupt object.
12 
13 Author:
14 
15 
16 
17 Environment:
18 
19  User mode only
20 
21 Revision History:
22 
23 
24 
25 --*/
26 #pragma once
27 
28 #define MINIMUM_THREAD_COUNT_DEFAULT (1)
29 class FxInterrupt;
30 
32 {
33 
34 private:
35 
36  //
37  // Pointer to structure representing thread pool
38  //
40 
41  //
42  // Structure representing callback environment for thread pool
43  //
45 
46  //
47  // Minimum thread pool thread count
48  //
50 
51 
52  HRESULT
53  Initialize(
54  );
55 
56 public:
57 
59  PFX_DRIVER_GLOBALS FxDriverGlobals
60  );
61 
63 
64  static
65  HRESULT
68  _Out_ FxInterruptThreadpool** ppThreadpool
69  );
70 
73  VOID
74  )
75  {
76  return &m_CallbackEnvironment;
77  }
78 
79  PTP_WAIT
81  __in PTP_WAIT_CALLBACK pfnwa,
83  )
84  {
85  return ::CreateThreadpoolWait(pfnwa, Context, &m_CallbackEnvironment);
86  }
87 
88  HRESULT
90  _In_ ULONG InterruptCount
91  );
92 };
93 
95 {
96 
97 private:
98 
99  //
100  // threadpool wait block
101  //
102  PTP_WAIT m_Wait;
103 
104  //
105  // auto reset event
106  //
108 
109 
110  HRESULT
111  Initialize(
112  __in FxInterruptThreadpool* Threadpool,
114  __in PTP_WAIT_CALLBACK WaitCallback
115  );
116 
117 public:
118 
119  static
120  HRESULT
122  _In_ FxInterruptThreadpool* Threadpool,
124  _In_ PTP_WAIT_CALLBACK WaitCallback,
125  _Out_ FxInterruptWaitblock** Waitblock
126  );
127 
129  PFX_DRIVER_GLOBALS FxDriverGlobals
130  ) :
131  FxGlobalsStump(FxDriverGlobals),
132  m_Wait(NULL),
133  m_Event(NULL)
134  {
135  }
136 
138 
139  VOID
141  VOID
142  )
143  {
145  }
146 
147  VOID
149  VOID
150  )
151  {
152  //
153  // associates event with wait block and queues it
154  // to thread pool queue.
155  //
157  }
158 
159  VOID
161  VOID
162  )
163  {
164  //
165  // Passing a NULL handle clears the wait
166  //
168  }
169 
170  VOID
172  VOID
173  )
174  {
175  ::WaitForThreadpoolWaitCallbacks(m_Wait, FALSE);
176  }
177 
178  HANDLE
180  VOID
181  )
182  {
183  return m_Event;
184  }
185 
186  VOID
188  VOID
189  )
190  {
192  }
193 
194 };
195 
#define _Out_
Definition: ms_sal.h:345
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_INTERRUPT_CONFIG _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFINTERRUPT * Interrupt
Definition: wdfinterrupt.h:372
static HRESULT _CreateAndInit(_In_ PFX_DRIVER_GLOBALS DriverGlobals, _Out_ FxInterruptThreadpool **ppThreadpool)
static HRESULT _CreateAndInit(_In_ FxInterruptThreadpool *Threadpool, _In_ FxInterrupt *Interrupt, _In_ PTP_WAIT_CALLBACK WaitCallback, _Out_ FxInterruptWaitblock **Waitblock)
DriverGlobals
#define __inout_opt
Definition: dbghelp.h:53
PTP_WAIT CreateThreadpoolWait(__in PTP_WAIT_CALLBACK pfnwa, __inout_opt PVOID Context)
FxInterruptWaitblock(PFX_DRIVER_GLOBALS FxDriverGlobals)
#define FALSE
Definition: types.h:117
HRESULT Initialize(__in FxInterruptThreadpool *Threadpool, __in FxInterrupt *Interrupt, __in PTP_WAIT_CALLBACK WaitCallback)
#define _In_
Definition: ms_sal.h:308
LONG HRESULT
Definition: typedefs.h:79
HRESULT UpdateThreadPoolThreadLimits(_In_ ULONG InterruptCount)
PTP_CALLBACK_ENVIRON GetCallbackEnvironment(VOID)
TP_CALLBACK_ENVIRON m_CallbackEnvironment
#define NULL
Definition: types.h:112
unsigned int ULONG
Definition: retypes.h:1
static TP_CALLBACK_ENVIRON *static PTP_WAIT_CALLBACK
Definition: threadpool.c:27
struct _TP_POOL * PTP_POOL
Definition: winnt_old.h:4499
#define __in
Definition: dbghelp.h:35
FxInterruptThreadpool(PFX_DRIVER_GLOBALS FxDriverGlobals)