From 287f1f0eab994f7e06bb691c4ed9cf4a3c893b4d Mon Sep 17 00:00:00 2001 From: Ulrich Weigand Date: Sun, 25 Apr 1999 11:02:33 +0000 Subject: [PATCH] Return 32-bit module in GetModuleHandle16() if appropriate. --- loader/ne/module.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/loader/ne/module.c b/loader/ne/module.c index d2b95d307cb..3a3d7c38b3d 100644 --- a/loader/ne/module.c +++ b/loader/ne/module.c @@ -1399,15 +1399,15 @@ HMODULE16 WINAPI GetModuleHandle16( LPCSTR name ) return hModule; } - /* FIXME: need to add ... - * 5. If the extension of 'name' is '.EXE' and the base filename of 'name' - * matches the base filename of the module filename of some 32-bit module: - * Return the corresponding 16-bit dummy module handle. + /* If the extension of 'name' is '.EXE' and the base filename of 'name' + * matches the base filename of the module filename of some 32-bit module: + * Return the corresponding 16-bit dummy module handle. */ - if(len >= 4 && !strcasecmp(name+len-4, ".EXE")) + if (len >= 4 && !strcasecmp(name+len-4, ".EXE")) { - FIXME(module, "Should return the 16-bit dummy module of some 32-bit module (if it exists)\n"); - return 0; + HMODULE hModule = GetModuleHandleA( name ); + if ( hModule ) + return MapHModuleLS( hModule ); } if (!strcmp(tmpstr,"MSDOS"))