ReactOS 0.4.16-dev-1028-g8602629
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 105 of file taskswnd.cpp.

Constructor & Destructor Documentation

◆ CHardErrorThread()

CHardErrorThread::CHardErrorThread ( )
inline

Definition at line 116 of file taskswnd.cpp.

116 :
117 m_ThreadId(0),
120 m_Status(NULL),
122 {
123 }
#define NULL
Definition: types.h:112
#define FALSE
Definition: types.h:117

◆ ~CHardErrorThread()

CHardErrorThread::~CHardErrorThread ( )
inline

Definition at line 125 of file taskswnd.cpp.

126 {
128 {
129 /* Try to unstuck Show */
132 if (ret == WAIT_TIMEOUT)
135 }
136 }
#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
unsigned long DWORD
Definition: ntddk_ex.h:95
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
Definition: synch.c:82
int ret
#define WM_QUIT
Definition: winuser.h:1634
#define PostThreadMessage
Definition: winuser.h:5853

Member Function Documentation

◆ s_HardErrorThreadProc()

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

Definition at line 170 of file taskswnd.cpp.

171 {
172 CHardErrorThread* pThis = reinterpret_cast<CHardErrorThread*>(lpParameter);
173 pThis->ThreadProc();
174 CloseHandle(pThis->m_hThread);
177 return 0;
178 }
#define InterlockedExchange
Definition: armddk.h:54
HRESULT ThreadProc()
Definition: taskswnd.cpp:138
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 180 of file taskswnd.cpp.

181 {
183
184 /* Ignore the new message if we are already showing one */
185 if (bIsRunning)
186 return;
187
188 m_Status = pData->Status;
189 m_dwType = pData->dwType;
190 m_Title = (PWCHAR)((ULONG_PTR)pData + pData->TitleOffset);
191 m_Text = (PWCHAR)((ULONG_PTR)pData + pData->MessageOffset);
193 if (!m_hThread)
194 {
197 }
198 }
CStringW m_Title
Definition: taskswnd.cpp:112
static DWORD CALLBACK s_HardErrorThreadProc(IN OUT LPVOID lpParameter)
Definition: taskswnd.cpp:170
CStringW m_Text
Definition: taskswnd.cpp:113
#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 138 of file taskswnd.cpp.

139 {
140 HRESULT hr;
141 CComPtr<IUserNotification> pnotification;
142
145 return hr;
146
147 hr = CoCreateInstance(CLSID_UserNotification,
148 NULL,
149 CLSCTX_INPROC_SERVER,
150 IID_PPV_ARG(IUserNotification, &pnotification));
152 return hr;
153
154 hr = pnotification->SetBalloonInfo(m_Title, m_Text, NIIF_WARNING);
156 return hr;
157
158 hr = pnotification->SetIconInfo(NULL, NULL);
160 return hr;
161
162 /* Show will block until the balloon closes */
163 hr = pnotification->Show(NULL, 0);
165 return hr;
166
167 return S_OK;
168 }
#define FAILED_UNEXPECTEDLY(hr)
Definition: debug.h:83
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 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 109 of file taskswnd.cpp.

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

◆ m_dwType

DWORD CHardErrorThread::m_dwType
private

Definition at line 111 of file taskswnd.cpp.

Referenced by StartThread().

◆ m_hThread

HANDLE CHardErrorThread::m_hThread
private

Definition at line 108 of file taskswnd.cpp.

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

◆ m_Status

DWORD CHardErrorThread::m_Status
private

Definition at line 110 of file taskswnd.cpp.

Referenced by StartThread().

◆ m_Text

CStringW CHardErrorThread::m_Text
private

Definition at line 113 of file taskswnd.cpp.

Referenced by StartThread(), and ThreadProc().

◆ m_ThreadId

DWORD CHardErrorThread::m_ThreadId
private

Definition at line 107 of file taskswnd.cpp.

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

◆ m_Title

CStringW CHardErrorThread::m_Title
private

Definition at line 112 of file taskswnd.cpp.

Referenced by StartThread(), and ThreadProc().


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