Skip to content
Snippets Groups Projects
Commit abd79ddd authored by Eric Pouech's avatar Eric Pouech Committed by Alexandre Julliard
Browse files

Fixed loading of native NE dlls.

parent b6b8bf83
No related branches found
No related tags found
No related merge requests found
......@@ -758,18 +758,6 @@ static BOOL NE_LoadDLLs( NE_MODULE *pModule )
HMODULE16 hDLL;
if ((hDLL = MODULE_LoadModule16( buffer, TRUE )) < 32)
{
/* append ".dll" if no other extension */
if (!strchr(buffer,'.'))
strcpy( buffer + *pstr, ".dll" );
/* Retry to get the handle to see whether it was loaded */
if ((*pModRef = GetModuleHandle16( buffer )))
goto was_loaded;
hDLL = MODULE_LoadModule16( buffer, TRUE );
}
if (hDLL < 32)
{
/* FIXME: cleanup what was done */
......@@ -784,7 +772,7 @@ static BOOL NE_LoadDLLs( NE_MODULE *pModule )
else /* Increment the reference count of the DLL */
{
NE_MODULE *pOldDLL;
was_loaded:
pOldDLL = NE_GetPtr( *pModRef );
if (pOldDLL) pOldDLL->count++;
}
......@@ -859,7 +847,14 @@ HINSTANCE16 NE_LoadModule( LPCSTR name, BOOL implicit )
if ((hFile = OpenFile16( name, &ofs, OF_READ )) == HFILE_ERROR16)
{
return 2; /* File not found */
char buffer[260];
/* 4 == strlen(".dll") */
strncpy(buffer, name, sizeof(buffer) - 1 - 4);
strcat(buffer, ".dll");
if ((hFile = OpenFile16( buffer, &ofs, OF_READ )) == HFILE_ERROR16) {
return 2; /* File not found */
}
}
hInstance = NE_LoadFileModule( hFile, &ofs, implicit );
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment