mirror of
https://github.com/reactos/reactos.git
synced 2025-06-13 00:38:29 +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;
|
FARPROC fnExp = NULL;
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
|
|
||||||
|
if (!hModule)
|
||||||
|
{
|
||||||
|
SetLastError(ERROR_PROC_NOT_FOUND);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
if (HIWORD(lpProcName) != 0)
|
if (HIWORD(lpProcName) != 0)
|
||||||
{
|
{
|
||||||
RtlInitAnsiString (&ProcedureName,
|
RtlInitAnsiString (&ProcedureName,
|
||||||
|
@ -354,8 +360,7 @@ BOOL WINAPI FreeLibrary(HINSTANCE hLibModule)
|
||||||
{
|
{
|
||||||
/* this is a LOAD_LIBRARY_AS_DATAFILE module */
|
/* this is a LOAD_LIBRARY_AS_DATAFILE module */
|
||||||
char *ptr = (char *)hLibModule - 1;
|
char *ptr = (char *)hLibModule - 1;
|
||||||
UnmapViewOfFile(ptr);
|
return UnmapViewOfFile(ptr);
|
||||||
return TRUE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Status = LdrUnloadDll(hLibModule);
|
Status = LdrUnloadDll(hLibModule);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue