Boost logo

Boost :

Subject: [boost] [interprocess][trunk][windows] named_mutex doesn't work whithin a DLL
From: Joaquin M Lopez Munoz (joaquin_at_[hidden])
Date: 2010-09-06 11:11:51


Environment: MSVC++ 9.0. I create the following DLL:

***bip_dll.cpp***
include <boost/interprocess/sync/named_mutex.hpp>

using namespace boost::interprocess;

named_mutex mutex(open_or_create,"foo");

__declspec(dllexport) void foo(){}
***bip_dll.cpp***

and use it inside the following executable:

***test.cpp***
__declspec(dllimport) void foo();

int main()
{
  foo();
}
***test.cpp***

The program hangs on DLL loading time when creation of mutex
in bip_dll.cpp is attempted. In particular, hanging occurs
inside the invocation of

  get_wmi_class_attribute(strValue,
    L"Win32_OperatingSystem", L"LastBootUpTime");

in line 1554 of boost/interprocess/detail/win32_api.hpp, when
control hits lines 1479 and ff:

      if( 0 != pIWbemLocator->ConnectServer(
            bstrNamespace, // Namespace
            0, // Userid
            0, // PW
            0, // Locale
            0, // flags
            0, // Authority
            0, // Context
            &pWbemServices
            )
         )
      {
        ...

This is related to ticket
https://svn.boost.org/trac/boost/ticket/4606 .

Thank you,

Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk