ReactOS 0.4.16-dev-1946-g52006dd
CHardErrorThread Class Reference
Collaboration diagram for CHardErrorThread:

Public Member Functions

 CHardErrorThread ()
 
 ~CHardErrorThread ()
 
HRESULT ThreadProc ()
 
void StartThread (PBALLOON_HARD_ERROR_DATA pData)
 

Static Public Member Functions

static DWORD CALLBACK s_HardErrorThreadProc (IN OUT LPVOID lpParameter)
 

Private Attributes

DWORD m_ThreadId
 
HANDLE m_hThread
 
LONG m_bThreadRunning
 
DWORD m_Status
 
DWORD m_dwType
 
CStringW m_Title
 
CStringW m_Text
 

Detailed Description

Definition at line 188 of file taskswnd.cpp.

Constructor & Destructor Documentation

◆ CHardErrorThread()

CHardErrorThread::CHardErrorThread ( )
inline

Definition at line 199 of file taskswnd.cpp.

199 :
200 m_ThreadId(0),
203 m_Status(NULL),
205 {
206 }
#define NULL
Definition: types.h:112
#define FALSE
Definition: types.h:117

◆ ~CHardErrorThread()

CHardErrorThread::~CHardErrorThread ( )
inline

Definition at line 208 of file taskswnd.cpp.

209 {
211 {
212 /* Try to unstuck Show */
215 if (ret == WAIT_TIMEOUT)
218 }
219 }
#define WAIT_TIMEOUT
Definition: dderror.h:14
#define CloseHandle
Definition: compat.h:739
BOOL WINAPI TerminateThread(IN HANDLE hThread, IN DWORD dwExitCode)
Definition: thread.c:587
return ret
Definition: mutex.c:146
unsigned long DWORD
Definition: ntddk_ex.h:95
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
Definition: synch.c:82
#define WM_QUIT
Definition: winuser.h:1651
#define PostThreadMessage
Definition: winuser.h:5944

Member Function Documentation

◆ s_HardErrorThreadProc()

static DWORD CALLBACK CHardErrorThread::s_HardErrorThreadProc ( IN OUT LPVOID  lpParameter)
inlinestatic

Definition at line 253 of file taskswnd.cpp.

254 {
255 CHardErrorThread* pThis = reinterpret_cast<CHardErrorThread*>(lpParameter);
256 pThis->ThreadProc();
257 CloseHandle(pThis->m_hThread);
260 return 0;
261 }
#define InterlockedExchange
Definition: armddk.h:54
HRESULT ThreadProc()
Definition: taskswnd.cpp:221
void WINAPI DECLSPEC_HOTPATCH OleUninitialize(void)
Definition: ole2.c:230

Referenced by StartThread().

◆ StartThread()

void CHardErrorThread::StartThread ( PBALLOON_HARD_ERROR_DATA  pData)
inline

Definition at line 263 of file taskswnd.cpp.

264 {
266
267 /* Ignore the new message if we are already showing one */
268 if (bIsRunning)
269 return;
270
271 m_Status = pData->Status;
272 m_dwType = pData->dwType;
273 m_Title = (PWCHAR)((ULONG_PTR)pData + pData->TitleOffset);
274 m_Text = (PWCHAR)((ULONG_PTR)pData + pData->MessageOffset);
276 if (!m_hThread)
277 {
280 }
281 }
CStringW m_Title
Definition: taskswnd.cpp:195
static DWORD CALLBACK s_HardErrorThreadProc(IN OUT LPVOID lpParameter)
Definition: taskswnd.cpp:253
CStringW m_Text
Definition: taskswnd.cpp:196
#define TRUE
Definition: types.h:120
HANDLE WINAPI DECLSPEC_HOTPATCH CreateThread(IN LPSECURITY_ATTRIBUTES lpThreadAttributes, IN DWORD dwStackSize, IN LPTHREAD_START_ROUTINE lpStartAddress, IN LPVOID lpParameter, IN DWORD dwCreationFlags, OUT LPDWORD lpThreadId)
Definition: thread.c:137
unsigned int BOOL
Definition: ntddk_ex.h:94
TW_UINT32 TW_UINT16 TW_UINT16 TW_MEMREF pData
Definition: twain.h:1830
uint32_t ULONG_PTR
Definition: typedefs.h:65
uint16_t * PWCHAR
Definition: typedefs.h:56

Referenced by CTaskSwitchWnd::OnCopyData().

◆ ThreadProc()

HRESULT CHardErrorThread::ThreadProc ( )
inline

Definition at line 221 of file taskswnd.cpp.

222 {
223 HRESULT hr;
224 CComPtr<IUserNotification> pnotification;
225
228 return hr;
229
230 hr = CoCreateInstance(CLSID_UserNotification,
231 NULL,
232 CLSCTX_INPROC_SERVER,
233 IID_PPV_ARG(IUserNotification, &pnotification));
235 return hr;
236
237 hr = pnotification->SetBalloonInfo(m_Title, m_Text, NIIF_WARNING);
239 return hr;
240
241 hr = pnotification->SetIconInfo(NULL, NULL);
243 return hr;
244
245 /* Show will block until the balloon closes */
246 hr = pnotification->Show(NULL, 0);
248 return hr;
249
250 return S_OK;
251 }
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
Definition: compobj.c:3325
HRESULT WINAPI DECLSPEC_HOTPATCH OleInitialize(LPVOID reserved)
Definition: ole2.c:169
#define FAILED_UNEXPECTEDLY
Definition: utils.cpp:30
#define S_OK
Definition: intsafe.h:52
HRESULT hr
Definition: shlfolder.c:183
#define IID_PPV_ARG(Itype, ppType)

Referenced by s_HardErrorThreadProc().

Member Data Documentation

◆ m_bThreadRunning

LONG CHardErrorThread::m_bThreadRunning
private

Definition at line 192 of file taskswnd.cpp.

Referenced by s_HardErrorThreadProc(), StartThread(), and ~CHardErrorThread().

◆ m_dwType

DWORD CHardErrorThread::m_dwType
private

Definition at line 194 of file taskswnd.cpp.

Referenced by StartThread().

◆ m_hThread

HANDLE CHardErrorThread::m_hThread
private

Definition at line 191 of file taskswnd.cpp.

Referenced by s_HardErrorThreadProc(), StartThread(), and ~CHardErrorThread().

◆ m_Status

DWORD CHardErrorThread::m_Status
private

Definition at line 193 of file taskswnd.cpp.

Referenced by StartThread().

◆ m_Text

CStringW CHardErrorThread::m_Text
private

Definition at line 196 of file taskswnd.cpp.

Referenced by StartThread(), and ThreadProc().

◆ m_ThreadId

DWORD CHardErrorThread::m_ThreadId
private

Definition at line 190 of file taskswnd.cpp.

Referenced by StartThread(), and ~CHardErrorThread().

◆ m_Title

CStringW CHardErrorThread::m_Title
private

Definition at line 195 of file taskswnd.cpp.

Referenced by StartThread(), and ThreadProc().


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