Opened 11 years ago
Closed 11 years ago
#5552 closed Bugs (fixed)
get_wmi_class_attribute hangs on win2003
Reported by: | anonymous | Owned by: | Ion Gaztañaga |
---|---|---|---|
Milestone: | To Be Determined | Component: | interprocess |
Version: | Boost 1.46.1 | Severity: | Problem |
Keywords: | hang, COM | Cc: |
Description
I found this problem while I was using shared_memory. Function hangs on call to pIWbemLocator->ConnectServer.
The solution to this issue is changing CoInitialize(0) at the beginning of function to CoInitializeEx(0, COINIT_MULTITHREADED).
Change History (2)
comment:1 by , 11 years ago
comment:2 by , 11 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Fixed in trunk, thanks for the patch. From 1.48, use of WMI is disabled, but I would be grateful if someone could enable it again uncommentting
#define BOOST_INTERPROCESS_HAS_WINDOWS_KERNEL_BOOTTIME
#define BOOST_INTERPROCESS_HAS_KERNEL_BOOTTIME
#include <boost/interprocess/detail/win32_api.hpp>
in detail/tmp_dir_helpders.hpp
so that we can enable it again.
This problem is irrelevant to "CoInitializeEx(0, COINIT_MULTITHREADED)". (There is a possibility of operating by chance.)
The problem is dependence on "CoInitializeSecurity" that cannot be used two times or more.
Therefore, the problem that "ExecQuery" fails when "CoInitializeSecurity" has already been used happens. (Please refer to the following reproduction code.)
Solving it by using both "CoInitializeSecurity" and "CoSetProxyBlanket" is correct.
Reproduction code
Patch
boost/interprocess/detail/win32_api.hpp