mirror of
https://github.com/reactos/reactos.git
synced 2025-05-31 23:18:39 +00:00
Set last error to ERROR_PROC_NOT_FOUND in case of NULL module in GetProcAddress
Check for error when freeing datafile Fixes 2 winetests svn path=/trunk/; revision=51104
This commit is contained in:
parent
073c778dcb
commit
8fb7057c46
1 changed files with 7 additions and 2 deletions
|
@ -310,6 +310,12 @@ GetProcAddress( HMODULE hModule, LPCSTR lpProcName )
|
|||
FARPROC fnExp = NULL;
|
||||
NTSTATUS Status;
|
||||
|
||||
if (!hModule)
|
||||
{
|
||||
SetLastError(ERROR_PROC_NOT_FOUND);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (HIWORD(lpProcName) != 0)
|
||||
{
|
||||
RtlInitAnsiString (&ProcedureName,
|
||||
|
@ -354,8 +360,7 @@ BOOL WINAPI FreeLibrary(HINSTANCE hLibModule)
|
|||
{
|
||||
/* this is a LOAD_LIBRARY_AS_DATAFILE module */
|
||||
char *ptr = (char *)hLibModule - 1;
|
||||
UnmapViewOfFile(ptr);
|
||||
return TRUE;
|
||||
return UnmapViewOfFile(ptr);
|
||||
}
|
||||
|
||||
Status = LdrUnloadDll(hLibModule);
|
||||
|
|
Loading…
Reference in a new issue