mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-09-02 04:13:34 +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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user