From 45b808d8c3b6b7a8f13cf20fb3ab201802f81bf2 Mon Sep 17 00:00:00 2001 From: Kurt Zenker Date: Tue, 19 Jun 2007 15:17:20 +0000 Subject: [PATCH] INTEGRATION: CWS obr05 (1.21.124); FILE MERGED 2007/04/03 09:46:23 obr 1.21.124.1: #i76025# New OSL API: osl_getModuleHandle & osl_getAsciiFunctionSymbol Also removed usage of osl_psz_getSymbol and osl_psz_loadModule in nlsupport.c and security.c --- sal/osl/w32/module.c | 39 ++++++++++++++++++++++++++++++++++++--- 1 file changed, 36 insertions(+), 3 deletions(-) diff --git a/sal/osl/w32/module.c b/sal/osl/w32/module.c index ba954cc6b157..519a62b4b14e 100644 --- a/sal/osl/w32/module.c +++ b/sal/osl/w32/module.c @@ -4,9 +4,9 @@ * * $RCSfile: module.c,v $ * - * $Revision: 1.21 $ + * $Revision: 1.22 $ * - * last change: $Author: hr $ $Date: 2006-06-20 04:20:56 $ + * last change: $Author: kz $ $Date: 2007-06-19 16:17:20 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -86,6 +86,23 @@ oslModule SAL_CALL osl_loadModule(rtl_uString *strModuleName, sal_Int32 nRtldMod return ret; } +/*****************************************************************************/ +/* osl_getModuleHandle */ +/*****************************************************************************/ + +sal_Bool SAL_CALL +osl_getModuleHandle(rtl_uString *pModuleName, oslModule *pResult) +{ + HINSTANCE hInstance = GetModuleHandleW(pModuleName->buffer); + if( hInstance ) + { + *pResult = (oslModule) hInstance; + return sal_True; + } + + return sal_False; +} + /*****************************************************************************/ /* osl_unloadModule */ /*****************************************************************************/ @@ -128,12 +145,28 @@ oslGenericFunction SAL_CALL osl_getFunctionSymbol( oslModule Module, rtl_uString OUSTRING_TO_OSTRING_CVTFLAGS ); - address=(oslGenericFunction)GetProcAddress((HINSTANCE)Module, rtl_string_getStr(symbolName)); + address=osl_getAsciiFunctionSymbol(Module, rtl_string_getStr(symbolName)); rtl_string_release(symbolName); return address; } +/*****************************************************************************/ +/* osl_getAsciiFunctionSymbol */ +/*****************************************************************************/ +oslGenericFunction SAL_CALL +osl_getAsciiFunctionSymbol( oslModule Module, const sal_Char *pSymbol ) +{ + oslGenericFunction fncAddr = NULL; + + if( pSymbol ) + fncAddr=(oslGenericFunction)GetProcAddress((HINSTANCE) Module, pSymbol); + + return fncAddr; +} + + + /*****************************************************************************/ /* osl_addressGetModuleURL */ /*****************************************************************************/