/*1* Support for delayed imports2*3* Copyright 2005 Alexandre Julliard4*5* This library is free software; you can redistribute it and/or6* modify it under the terms of the GNU Lesser General Public7* License as published by the Free Software Foundation; either8* version 2.1 of the License, or (at your option) any later version.9*10* This library is distributed in the hope that it will be useful,11* but WITHOUT ANY WARRANTY; without even the implied warranty of12* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU13* Lesser General Public License for more details.14*15* You should have received a copy of the GNU Lesser General Public16* License along with this library; if not, write to the Free Software17* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA18*/1920#include <stdarg.h>21#include "windef.h"22#include "winbase.h"23#include "delayloadhandler.h"2425WINBASEAPI void *WINAPI DelayLoadFailureHook( LPCSTR name, LPCSTR function );26WINBASEAPI void *WINAPI ResolveDelayLoadedAPI( void* base, const IMAGE_DELAYLOAD_DESCRIPTOR* desc,27PDELAYLOAD_FAILURE_DLL_CALLBACK dllhook,28PDELAYLOAD_FAILURE_SYSTEM_ROUTINE syshook,29IMAGE_THUNK_DATA* addr, ULONG flags );3031static inline void *image_base(void)32{33#ifdef __WINE_PE_BUILD34extern IMAGE_DOS_HEADER __ImageBase;35return (void *)&__ImageBase;36#else37extern IMAGE_NT_HEADERS __wine_spec_nt_header;38return (void *)((__wine_spec_nt_header.OptionalHeader.ImageBase + 0xffff) & ~0xffff);39#endif40}4142FARPROC WINAPI __delayLoadHelper2( const IMAGE_DELAYLOAD_DESCRIPTOR *descr, IMAGE_THUNK_DATA *addr )43{44return ResolveDelayLoadedAPI( image_base(), descr, NULL, DelayLoadFailureHook, addr, 0 );45}464748