Index: mutex.inl
===================================================================
RCS file: /cvsroot/boost/boost/libs/thread/src/mutex.inl,v
retrieving revision 1.5.10.2
diff -u -r1.5.10.2 mutex.inl
--- mutex.inl	14 Sep 2006 21:51:00 -0000	1.5.10.2
+++ mutex.inl	27 Sep 2006 20:52:57 -0000
@@ -23,7 +23,7 @@
         version_info.dwMajorVersion >= 4)
     {
         if (HMODULE kernel_module = GetModuleHandle(TEXT("KERNEL32.DLL")))
-            g_TryEnterCriticalSection = reinterpret_cast<TryEnterCriticalSection_type>(GetProcAddress(kernel_module, "TryEnterCriticalSection"));
+            g_TryEnterCriticalSection = reinterpret_cast<TryEnterCriticalSection_type>(GetProcAddress(kernel_module, TEXT("TryEnterCriticalSection")));
     }
 }
 
@@ -61,8 +61,10 @@
 inline void* new_mutex(const char* name)
 {
 #if defined(BOOST_NO_ANSI_APIS)
-    USES_CONVERSION;
-    HANDLE mutex = CreateMutexW(0, 0, A2CW(name));
+    int num_wide_chars = (strlen(name) + 1);
+    LPWSTR wide_name = (LPWSTR)_alloca( num_wide_chars * 2 );
+    ::MultiByteToWideChar(CP_ACP, 0, name, -1, wide_name, num_wide_chars);
+    HANDLE mutex = CreateMutexW(0, 0, wide_name);
 #else
     HANDLE mutex = CreateMutexA(0, 0, name);
 #endif
