msvcp: Return if module is not loaded (Coverity)

Piotr Caban piotr.caban at gmail.com
Mon Jan 6 05:02:35 CST 2014


On 01/04/14 19:24, André Hentschel wrote:
> 1147949
> ---
>   dlls/msvcp90/msvcp_main.c | 9 ++++++++-
>   1 file changed, 8 insertions(+), 1 deletion(-)
>
> diff --git a/dlls/msvcp90/msvcp_main.c b/dlls/msvcp90/msvcp_main.c
> index 489aacb..d946f3b 100644
> --- a/dlls/msvcp90/msvcp_main.c
> +++ b/dlls/msvcp90/msvcp_main.c
> @@ -67,7 +67,14 @@ static void init_cxx_funcs(void)
>   {
>       HMODULE hmod = GetModuleHandleA( MSVCRT_NAME(_MSVCP_VER) );
>
> -    if (!hmod) FIXME( "%s not loaded\n", MSVCRT_NAME(_MSVCP_VER) );
> +    if (!hmod)
> +    {
> +        FIXME( "%s not loaded\n", MSVCRT_NAME(_MSVCP_VER) );
> +        MSVCRT_operator_new = NULL;
> +        MSVCRT_operator_delete = NULL;
> +        MSVCRT_set_new_handler = NULL;
> +        return;
> +    }
If we want to handle GetModuleHandle failure we should probably fail to 
load msvcpXX.dll (I'm not sure if it may ever happen unless we forget to 
import proper msvcrXX dll in makefile).




More information about the wine-devel mailing list