Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
b6b9050d
Commit
b6b9050d
authored
Nov 11, 2013
by
André Hentschel
Committed by
Alexandre Julliard
Nov 12, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Implement LdrResolveDelayLoadedAPI.
parent
c6f70ca8
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
67 additions
and
0 deletions
+67
-0
kernel32.spec
dlls/kernel32/kernel32.spec
+1
-0
loader.c
dlls/ntdll/loader.c
+65
-0
ntdll.spec
dlls/ntdll/ntdll.spec
+1
-0
No files found.
dlls/kernel32/kernel32.spec
View file @
b6b9050d
...
...
@@ -1030,6 +1030,7 @@
@ stdcall RequestWakeupLatency(long)
@ stdcall ResetEvent(long)
@ stdcall ResetWriteWatch(ptr long)
@ stdcall ResolveDelayLoadedAPI(ptr ptr ptr ptr ptr long) ntdll.LdrResolveDelayLoadedAPI
@ stdcall RestoreLastError(long) ntdll.RtlRestoreLastWin32Error
@ stdcall ResumeThread(long)
@ cdecl -arch=arm,x86_64 RtlAddFunctionTable(ptr long long) ntdll.RtlAddFunctionTable
...
...
dlls/ntdll/loader.c
View file @
b6b9050d
...
...
@@ -36,6 +36,7 @@
#include "windef.h"
#include "winnt.h"
#include "winternl.h"
#include "delayloadhandler.h"
#include "wine/exception.h"
#include "wine/library.h"
...
...
@@ -2383,6 +2384,70 @@ BOOLEAN WINAPI RtlDllShutdownInProgress(void)
return
process_detaching
;
}
/****************************************************************************
* LdrResolveDelayLoadedAPI (NTDLL.@)
*/
void
*
WINAPI
LdrResolveDelayLoadedAPI
(
void
*
base
,
const
IMAGE_DELAYLOAD_DESCRIPTOR
*
desc
,
PDELAYLOAD_FAILURE_DLL_CALLBACK
dllhook
,
void
*
syshook
,
IMAGE_THUNK_DATA
*
addr
,
ULONG
flags
)
{
IMAGE_THUNK_DATA
*
pIAT
,
*
pINT
;
DELAYLOAD_INFO
delayinfo
;
UNICODE_STRING
mod
;
const
CHAR
*
name
;
HMODULE
*
phmod
;
NTSTATUS
nts
;
FARPROC
fp
;
DWORD
id
;
FIXME
(
"(%p, %p, %p, %p, %p, 0x%08x), partial stub
\n
"
,
base
,
desc
,
dllhook
,
syshook
,
addr
,
flags
);
phmod
=
get_rva
(
base
,
desc
->
ModuleHandleRVA
);
pIAT
=
get_rva
(
base
,
desc
->
ImportAddressTableRVA
);
pINT
=
get_rva
(
base
,
desc
->
ImportNameTableRVA
);
name
=
get_rva
(
base
,
desc
->
DllNameRVA
);
id
=
addr
-
pIAT
;
if
(
!*
phmod
)
{
if
(
!
RtlCreateUnicodeStringFromAsciiz
(
&
mod
,
name
))
{
nts
=
STATUS_NO_MEMORY
;
goto
fail
;
}
nts
=
LdrLoadDll
(
NULL
,
0
,
&
mod
,
phmod
);
RtlFreeUnicodeString
(
&
mod
);
if
(
nts
)
goto
fail
;
}
if
(
IMAGE_SNAP_BY_ORDINAL
(
pINT
[
id
].
u1
.
Ordinal
))
nts
=
LdrGetProcedureAddress
(
*
phmod
,
NULL
,
LOWORD
(
pINT
[
id
].
u1
.
Ordinal
),
(
void
**
)
&
fp
);
else
{
const
IMAGE_IMPORT_BY_NAME
*
iibn
=
get_rva
(
base
,
pINT
[
id
].
u1
.
AddressOfData
);
ANSI_STRING
fnc
;
RtlInitAnsiString
(
&
fnc
,
(
char
*
)
iibn
->
Name
);
nts
=
LdrGetProcedureAddress
(
*
phmod
,
&
fnc
,
0
,
(
void
**
)
&
fp
);
}
if
(
!
nts
)
{
pIAT
[
id
].
u1
.
Function
=
(
ULONG_PTR
)
fp
;
return
fp
;
}
fail:
delayinfo
.
Size
=
sizeof
(
delayinfo
);
delayinfo
.
DelayloadDescriptor
=
desc
;
delayinfo
.
ThunkAddress
=
addr
;
delayinfo
.
TargetDllName
=
name
;
delayinfo
.
TargetApiDescriptor
.
ImportDescribedByName
=
!
IMAGE_SNAP_BY_ORDINAL
(
pINT
[
id
].
u1
.
Ordinal
);
delayinfo
.
TargetApiDescriptor
.
Description
.
Ordinal
=
LOWORD
(
pINT
[
id
].
u1
.
Ordinal
);
delayinfo
.
TargetModuleBase
=
*
phmod
;
delayinfo
.
Unused
=
NULL
;
delayinfo
.
LastError
=
nts
;
return
dllhook
(
4
,
&
delayinfo
);
}
/******************************************************************
* LdrShutdownProcess (NTDLL.@)
...
...
dlls/ntdll/ntdll.spec
View file @
b6b9050d
...
...
@@ -75,6 +75,7 @@
@ stdcall LdrProcessRelocationBlock(ptr long ptr long)
@ stdcall LdrQueryImageFileExecutionOptions(ptr wstr long ptr long ptr)
@ stdcall LdrQueryProcessModuleInformation(ptr long ptr)
@ stdcall LdrResolveDelayLoadedAPI(ptr ptr ptr ptr ptr long)
@ stub LdrSetAppCompatDllRedirectionCallback
@ stub LdrSetDllManifestProber
@ stdcall LdrShutdownProcess()
...
...
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