ReactOS 0.4.17-dev-966-gf06eace
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 195 of file taskswnd.cpp.

Constructor & Destructor Documentation

◆ CHardErrorThread()

CHardErrorThread::CHardErrorThread ( )
inline

Definition at line 206 of file taskswnd.cpp.

206 :
207 m_ThreadId(0),
210 m_Status(NULL),
212 {
213 }
#define NULL
Definition: types.h:112
#define FALSE
Definition: types.h:117

◆ ~CHardErrorThread()

CHardErrorThread::~CHardErrorThread ( )
inline

Definition at line 215 of file taskswnd.cpp.

216 {
218 {
219 /* Try to unstuck Show */
222 if (ret == WAIT_TIMEOUT)
225 }
226 }
#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:147
unsigned long DWORD
Definition: ntddk_ex.h:95
#define WM_QUIT
Definition: winuser.h:1651
#define PostThreadMessage
Definition: winuser.h:5999
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
Definition: synch.c:82

Member Function Documentation

◆ s_HardErrorThreadProc()

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

Definition at line 260 of file taskswnd.cpp.

261 {
262 CHardErrorThread* pThis = reinterpret_cast<CHardErrorThread*>(lpParameter);
263 pThis->ThreadProc();
264 CloseHandle(pThis->m_hThread);
267 return 0;
268 }
#define InterlockedExchange
Definition: armddk.h:54
HRESULT ThreadProc()
Definition: taskswnd.cpp:228
void WINAPI DECLSPEC_HOTPATCH OleUninitialize(void)
Definition: ole2.c:218

Referenced by StartThread().

◆ StartThread()

void CHardErrorThread::StartThread ( PBALLOON_HARD_ERROR_DATA  pData)
inline

Definition at line 270 of file taskswnd.cpp.

271 {
273
274 /* Ignore the new message if we are already showing one */
275 if (bIsRunning)
276 return;
277
278 m_Status = pData->Status;
279 m_dwType = pData->dwType;
280 m_Title = (PWCHAR)((ULONG_PTR)pData + pData->TitleOffset);
281 m_Text = (PWCHAR)((ULONG_PTR)pData + pData->MessageOffset);
283 if (!m_hThread)
284 {
286 }
287 }
CStringW m_Title
Definition: taskswnd.cpp:202
static DWORD CALLBACK s_HardErrorThreadProc(IN OUT LPVOID lpParameter)
Definition: taskswnd.cpp:260
CStringW m_Text
Definition: taskswnd.cpp:203
#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 228 of file taskswnd.cpp.

229 {
230 HRESULT hr;
231 CComPtr<IUserNotification> pnotification;
232
235 return hr;
236
237 hr = CoCreateInstance(CLSID_UserNotification,
238 NULL,
239 CLSCTX_INPROC_SERVER,
240 IID_PPV_ARG(IUserNotification, &pnotification));
242 return hr;
243
244 hr = pnotification->SetBalloonInfo(m_Title, m_Text, NIIF_WARNING);
246 return hr;
247
248 hr = pnotification->SetIconInfo(NULL, NULL);
250 return hr;
251
252 /* Show will block until the balloon closes */
253 hr = pnotification->Show(NULL, 0);
255 return hr;
256
257 return S_OK;
258 }
#define IID_PPV_ARG(Itype, ppType)
HRESULT hr
Definition: delayimp.cpp:582
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, IUnknown *outer, DWORD cls_context, REFIID riid, void **obj)
Definition: combase.c:1685
HRESULT WINAPI DECLSPEC_HOTPATCH OleInitialize(LPVOID reserved)
Definition: ole2.c:162
#define FAILED_UNEXPECTEDLY
Definition: utils.cpp:33
#define S_OK
Definition: intsafe.h:52

Referenced by s_HardErrorThreadProc().

Member Data Documentation

◆ m_bThreadRunning

LONG CHardErrorThread::m_bThreadRunning
private

Definition at line 199 of file taskswnd.cpp.

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

◆ m_dwType

DWORD CHardErrorThread::m_dwType
private

Definition at line 201 of file taskswnd.cpp.

Referenced by StartThread().

◆ m_hThread

HANDLE CHardErrorThread::m_hThread
private

Definition at line 198 of file taskswnd.cpp.

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

◆ m_Status

DWORD CHardErrorThread::m_Status
private

Definition at line 200 of file taskswnd.cpp.

Referenced by StartThread().

◆ m_Text

CStringW CHardErrorThread::m_Text
private

Definition at line 203 of file taskswnd.cpp.

Referenced by StartThread(), and ThreadProc().

◆ m_ThreadId

DWORD CHardErrorThread::m_ThreadId
private

Definition at line 197 of file taskswnd.cpp.

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

◆ m_Title

CStringW CHardErrorThread::m_Title
private

Definition at line 202 of file taskswnd.cpp.

Referenced by StartThread(), and ThreadProc().


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