From 3a6e7013b6fdbac8d42b2f7c43fabc084f88773b Mon Sep 17 00:00:00 2001 From: ehouse Date: Mon, 11 May 2009 01:55:47 +0000 Subject: [PATCH] Don't open localization .dll if version is missing or wrong. --- xwords4/wince/ceresstr.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/xwords4/wince/ceresstr.c b/xwords4/wince/ceresstr.c index 0a2c3c255..425313458 100644 --- a/xwords4/wince/ceresstr.c +++ b/xwords4/wince/ceresstr.c @@ -21,6 +21,9 @@ #include "ceutil.h" #include "cedebug.h" +static XP_U16 getDLLVersion( HINSTANCE hinst ); + + HINSTANCE ceLoadResFile( const XP_UCHAR* file ) { @@ -30,8 +33,14 @@ ceLoadResFile( const XP_UCHAR* file ) VSIZE(widebuf) ); widebuf[len] = 0; hinst = LoadLibrary( widebuf ); + + if ( CUR_DLL_VERSION != getDLLVersion( hinst ) ) { + FreeLibrary( hinst ); + hinst = NULL; + } + return hinst; -} +} /* ceLoadResFile */ void ceCloseResFile( HINSTANCE inst )