mirror of
https://github.com/reactos/reactos.git
synced 2025-08-06 06:33:07 +00:00
terminate shell service objects thread if there is nothing to do
svn path=/trunk/; revision=14434
This commit is contained in:
parent
5875f60018
commit
45ba821ec5
1 changed files with 19 additions and 17 deletions
|
@ -66,29 +66,31 @@ int SSOThread::Run()
|
||||||
RegCloseKey(hkey);
|
RegCloseKey(hkey);
|
||||||
}
|
}
|
||||||
|
|
||||||
MSG msg;
|
if (!sso_ptrs.empty()) {
|
||||||
|
MSG msg;
|
||||||
while(_alive) {
|
|
||||||
if (MsgWaitForMultipleObjects(1, &_evtFinish, FALSE, INFINITE, QS_ALLINPUT) == WAIT_OBJECT_0+0)
|
|
||||||
break; // _evtFinish has been set.
|
|
||||||
|
|
||||||
while(_alive) {
|
while(_alive) {
|
||||||
if (!PeekMessage(&msg, 0, 0, 0, PM_REMOVE))
|
if (MsgWaitForMultipleObjects(1, &_evtFinish, FALSE, INFINITE, QS_ALLINPUT) == WAIT_OBJECT_0+0)
|
||||||
break;
|
break; // _evtFinish has been set.
|
||||||
|
|
||||||
if (msg.message == WM_QUIT)
|
while(_alive) {
|
||||||
break;
|
if (!PeekMessage(&msg, 0, 0, 0, PM_REMOVE))
|
||||||
|
break;
|
||||||
|
|
||||||
TranslateMessage(&msg);
|
if (msg.message == WM_QUIT)
|
||||||
DispatchMessage(&msg);
|
break;
|
||||||
|
|
||||||
|
TranslateMessage(&msg);
|
||||||
|
DispatchMessage(&msg);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// shutdown all running Shell Service Objects
|
// shutdown all running Shell Service Objects
|
||||||
for(SSOVector::iterator it=sso_ptrs.begin(); it!=sso_ptrs.end(); ++it) {
|
for(SSOVector::iterator it=sso_ptrs.begin(); it!=sso_ptrs.end(); ++it) {
|
||||||
SIfacePtr<IOleCommandTarget>* sso_ptr = *it;
|
SIfacePtr<IOleCommandTarget>* sso_ptr = *it;
|
||||||
(*sso_ptr)->Exec(&CGID_ShellServiceObject, OLECMDID_SAVE, OLECMDEXECOPT_DODEFAULT, NULL, NULL);
|
(*sso_ptr)->Exec(&CGID_ShellServiceObject, OLECMDID_SAVE, OLECMDEXECOPT_DODEFAULT, NULL, NULL);
|
||||||
delete sso_ptr;
|
delete sso_ptr;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue