Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
646f17f2
Commit
646f17f2
authored
Aug 12, 2005
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implemented DelayLoadFailureHook and use it in the winebuild-generated
delay load code.
parent
b49c12a9
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
15 deletions
+24
-15
kernel32.spec
dlls/kernel/kernel32.spec
+1
-1
module.c
dlls/kernel/module.c
+16
-0
import.c
tools/winebuild/import.c
+7
-14
No files found.
dlls/kernel/kernel32.spec
View file @
646f17f2
...
...
@@ -283,7 +283,7 @@
# @ stub DecodeSystemPointer ( -> ntdll.RtlDecodeSystemPointer)
@ stdcall DefineDosDeviceA(long str str)
@ stdcall DefineDosDeviceW(long wstr wstr)
@ st
ub DelayLoadFailureHook
@ st
dcall DelayLoadFailureHook(str str)
@ stdcall DeleteAtom(long)
@ stdcall DeleteCriticalSection(ptr) ntdll.RtlDeleteCriticalSection
@ stdcall DeleteFiber(ptr)
...
...
dlls/kernel/module.c
View file @
646f17f2
...
...
@@ -39,6 +39,7 @@
#include "module.h"
#include "kernel_private.h"
#include "wine/exception.h"
#include "wine/debug.h"
#include "wine/unicode.h"
#include "wine/server.h"
...
...
@@ -967,3 +968,18 @@ FARPROC WINAPI GetProcAddress32_16( HMODULE hModule, LPCSTR function )
/* FIXME: we used to disable snoop when returning proc for Win16 subsystem */
return
GetProcAddress
(
hModule
,
function
);
}
/***********************************************************************
* DelayLoadFailureHook (KERNEL32.@)
*/
FARPROC
WINAPI
DelayLoadFailureHook
(
LPCSTR
name
,
LPCSTR
function
)
{
ULONG_PTR
args
[
2
];
ERR
(
"failed to delay load %s.%s
\n
"
,
name
,
function
);
args
[
0
]
=
(
ULONG_PTR
)
name
;
args
[
1
]
=
(
ULONG_PTR
)
function
;
RaiseException
(
EXCEPTION_WINE_STUB
,
EH_NONCONTINUABLE
,
2
,
args
);
return
NULL
;
}
tools/winebuild/import.c
View file @
646f17f2
...
...
@@ -36,7 +36,6 @@
#include "windef.h"
#include "winbase.h"
#include "wine/exception.h"
#include "build.h"
struct
import
...
...
@@ -526,7 +525,7 @@ static void add_extra_undef_symbols( const DLLSPEC *spec )
kernel_imports
+=
add_extra_symbol
(
extras
,
&
count
,
"LoadLibraryA"
,
spec
);
kernel_imports
+=
add_extra_symbol
(
extras
,
&
count
,
"FreeLibrary"
,
spec
);
kernel_imports
+=
add_extra_symbol
(
extras
,
&
count
,
"GetProcAddress"
,
spec
);
kernel_imports
+=
add_extra_symbol
(
extras
,
&
count
,
"
RaiseException
"
,
spec
);
kernel_imports
+=
add_extra_symbol
(
extras
,
&
count
,
"
DelayLoadFailureHook
"
,
spec
);
}
if
(
nb_stubs
)
ntdll_imports
+=
add_extra_symbol
(
extras
,
&
count
,
"RtlRaiseException"
,
spec
);
...
...
@@ -965,9 +964,9 @@ static int output_delayed_imports( FILE *outfile, const DLLSPEC *spec )
}
fprintf
(
outfile
,
" }
\n
};
\n\n
"
);
fprintf
(
outfile
,
"extern void __stdcall RaiseException(unsigned int, unsigned int, unsigned int, const void *args[]);
\n
"
);
fprintf
(
outfile
,
"extern void * __stdcall LoadLibraryA(const char*);
\n
"
);
fprintf
(
outfile
,
"extern void * __stdcall GetProcAddress(void *, const char*);
\n
"
);
fprintf
(
outfile
,
"extern void * __stdcall DelayLoadFailureHook(const char *, const char*);
\n
"
);
fprintf
(
outfile
,
"
\n
"
);
fprintf
(
outfile
,
"void *__stdcall __wine_delay_load( int idx_nr )
\n
"
);
...
...
@@ -979,17 +978,11 @@ static int output_delayed_imports( FILE *outfile, const DLLSPEC *spec )
fprintf
(
outfile
,
" void *fn;
\n\n
"
);
fprintf
(
outfile
,
" if (!*imd->phmod) *imd->phmod = LoadLibraryA(imd->szName);
\n
"
);
fprintf
(
outfile
,
" if (*imd->phmod && (fn = GetProcAddress(*imd->phmod, *pINT)))
\n
"
);
fprintf
(
outfile
,
" /* patch IAT with final value */
\n
"
);
fprintf
(
outfile
,
" return *pIAT = fn;
\n
"
);
fprintf
(
outfile
,
" else {
\n
"
);
fprintf
(
outfile
,
" const void *args[2];
\n
"
);
fprintf
(
outfile
,
" args[0] = imd->szName;
\n
"
);
fprintf
(
outfile
,
" args[1] = *pINT;
\n
"
);
fprintf
(
outfile
,
" RaiseException( 0x%08x, %d, 2, args );
\n
"
,
EXCEPTION_WINE_STUB
,
EH_NONCONTINUABLE
);
fprintf
(
outfile
,
" return 0;
\n
"
);
fprintf
(
outfile
,
" }
\n
}
\n
"
);
fprintf
(
outfile
,
" if (!*imd->phmod || !(fn = GetProcAddress(*imd->phmod, *pINT)))
\n
"
);
fprintf
(
outfile
,
" fn = DelayLoadFailureHook(imd->szName, *pINT);
\n
"
);
fprintf
(
outfile
,
" /* patch IAT with final value */
\n
"
);
fprintf
(
outfile
,
" return *pIAT = fn;
\n
"
);
fprintf
(
outfile
,
"}
\n
"
);
return
nb_delayed
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment