diff options
author | Hennes Rohling <hro@openoffice.org> | 2001-09-24 12:49:29 +0000 |
---|---|---|
committer | Hennes Rohling <hro@openoffice.org> | 2001-09-24 12:49:29 +0000 |
commit | a5f016087e9e998c1d402356747997b11a0df9ef (patch) | |
tree | 609fe274d7033d7f9d73d06d5b0a8f2c405f7267 /sal | |
parent | 67342c73b14b6c39c9d9bfaea93e060507307f21 (diff) |
#90826# Use global mutex to access Set/Get CurrentDirectory()
Diffstat (limited to 'sal')
-rw-r--r-- | sal/osl/w32/dllentry.c | 15 | ||||
-rw-r--r-- | sal/osl/w32/process.c | 13 |
2 files changed, 21 insertions, 7 deletions
diff --git a/sal/osl/w32/dllentry.c b/sal/osl/w32/dllentry.c index e1f66ce3ddf6..2662335414e9 100644 --- a/sal/osl/w32/dllentry.c +++ b/sal/osl/w32/dllentry.c @@ -2,9 +2,9 @@ * * $RCSfile: dllentry.c,v $ * - * $Revision: 1.14 $ + * $Revision: 1.15 $ * - * last change: $Author: obr $ $Date: 2001-06-07 09:23:22 $ + * last change: $Author: hro $ $Date: 2001-09-24 13:49:29 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -82,12 +82,13 @@ //------------------------------------------------------------------------------ extern HRESULT (WINAPI *_CoInitializeEx) (LPVOID pvReserved, DWORD dwCoInit); -extern LPWSTR *lpArgvW; +extern LPWSTR *lpArgvW; extern DWORD g_dwTLSTextEncodingIndex; extern void SAL_CALL _osl_callThreadKeyCallbackOnThreadDetach(void); extern CRITICAL_SECTION g_ThreadKeyListCS; -extern oslMutex g_Mutex; +extern oslMutex g_Mutex; +extern oslMutex g_CurrentDirectoryMutex; //------------------------------------------------------------------------------ // defines @@ -191,6 +192,9 @@ sal_Bool WINAPI DllMain( HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved /* initialize global mutex */ g_Mutex = osl_createMutex(); + /* initialize "current directory" mutex */ + g_CurrentDirectoryMutex = osl_createMutex(); + /* request winsock rev. 1.1 */ wVersionRequested = MAKEWORD(1, 1); @@ -252,6 +256,9 @@ sal_Bool WINAPI DllMain( HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved DeleteCriticalSection( &g_ThreadKeyListCS ); osl_destroyMutex( g_Mutex ); + + osl_destroyMutex( g_CurrentDirectoryMutex ); + break; case DLL_THREAD_ATTACH: diff --git a/sal/osl/w32/process.c b/sal/osl/w32/process.c index e12801d58a65..fa723c610af7 100644 --- a/sal/osl/w32/process.c +++ b/sal/osl/w32/process.c @@ -2,9 +2,9 @@ * * $RCSfile: process.c,v $ * - * $Revision: 1.18 $ + * $Revision: 1.19 $ * - * last change: $Author: obr $ $Date: 2001-09-12 11:32:25 $ + * last change: $Author: hro $ $Date: 2001-09-24 13:49:15 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -120,10 +120,17 @@ oslProcessError SAL_CALL osl_setProcessLocale( rtl_Locale * pLocale ) /***************************************************************************/ +extern oslMutex g_CurrentDirectoryMutex; + oslProcessError SAL_CALL osl_getProcessWorkingDir( rtl_uString **pustrWorkingDir ) { TCHAR szBuffer[MAX_PATH]; - DWORD dwLen = GetCurrentDirectory( sizeof(szBuffer) / sizeof(TCHAR), szBuffer ); + DWORD dwLen; + + + osl_acquireMutex( g_CurrentDirectoryMutex ); + dwLen = GetCurrentDirectory( sizeof(szBuffer) / sizeof(TCHAR), szBuffer ); + osl_releaseMutex( g_CurrentDirectoryMutex ); if ( dwLen ) { |