ReactOS 0.4.15-dev-5669-g09dde2c
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 103 of file taskswnd.cpp.

Constructor & Destructor Documentation

◆ CHardErrorThread()

CHardErrorThread::CHardErrorThread ( )
inline

Definition at line 114 of file taskswnd.cpp.

114 :
115 m_ThreadId(0),
118 m_Status(NULL),
120 {
121 }
#define NULL
Definition: types.h:112
#define FALSE
Definition: types.h:117

◆ ~CHardErrorThread()

CHardErrorThread::~CHardErrorThread ( )
inline

Definition at line 123 of file taskswnd.cpp.

124 {
126 {
127 /* Try to unstuck Show */
130 if (ret == WAIT_TIMEOUT)
133 }
134 }
#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:1613
#define PostThreadMessage
Definition: winuser.h:5823

Member Function Documentation

◆ s_HardErrorThreadProc()

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

Definition at line 168 of file taskswnd.cpp.

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

179 {
181
182 /* Ignore the new message if we are already showing one */
183 if (bIsRunning)
184 return;
185
186 m_Status = pData->Status;
187 m_dwType = pData->dwType;
188 m_Title = (PWCHAR)((ULONG_PTR)pData + pData->TitleOffset);
189 m_Text = (PWCHAR)((ULONG_PTR)pData + pData->MessageOffset);
191 if (!m_hThread)
192 {
195 }
196 }
CStringW m_Title
Definition: taskswnd.cpp:110
static DWORD CALLBACK s_HardErrorThreadProc(IN OUT LPVOID lpParameter)
Definition: taskswnd.cpp:168
CStringW m_Text
Definition: taskswnd.cpp:111
#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 136 of file taskswnd.cpp.

137 {
138 HRESULT hr;
139 CComPtr<IUserNotification> pnotification;
140
143 return hr;
144
145 hr = CoCreateInstance(CLSID_UserNotification,
146 NULL,
147 CLSCTX_INPROC_SERVER,
148 IID_PPV_ARG(IUserNotification, &pnotification));
150 return hr;
151
152 hr = pnotification->SetBalloonInfo(m_Title, m_Text, NIIF_WARNING);
154 return hr;
155
156 hr = pnotification->SetIconInfo(NULL, NULL);
158 return hr;
159
160 /* Show will block until the balloon closes */
161 hr = pnotification->Show(NULL, 0);
163 return hr;
164
165 return S_OK;
166 }
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
#define FAILED_UNEXPECTEDLY(hr)
Definition: shellutils.h:82
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 107 of file taskswnd.cpp.

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

◆ m_dwType

DWORD CHardErrorThread::m_dwType
private

Definition at line 109 of file taskswnd.cpp.

Referenced by StartThread().

◆ m_hThread

HANDLE CHardErrorThread::m_hThread
private

Definition at line 106 of file taskswnd.cpp.

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

◆ m_Status

DWORD CHardErrorThread::m_Status
private

Definition at line 108 of file taskswnd.cpp.

Referenced by StartThread().

◆ m_Text

CStringW CHardErrorThread::m_Text
private

Definition at line 111 of file taskswnd.cpp.

Referenced by StartThread(), and ThreadProc().

◆ m_ThreadId

DWORD CHardErrorThread::m_ThreadId
private

Definition at line 105 of file taskswnd.cpp.

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

◆ m_Title

CStringW CHardErrorThread::m_Title
private

Definition at line 110 of file taskswnd.cpp.

Referenced by StartThread(), and ThreadProc().


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