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
f5fc925f
Commit
f5fc925f
authored
Feb 17, 2014
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Move fixup_imports to avoid forward declarations.
parent
0f0bf586
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
51 additions
and
51 deletions
+51
-51
loader.c
dlls/ntdll/loader.c
+51
-51
No files found.
dlls/ntdll/loader.c
View file @
f5fc925f
...
...
@@ -705,57 +705,6 @@ static NTSTATUS create_module_activation_context( LDR_MODULE *module )
}
/****************************************************************
* fixup_imports
*
* Fixup all imports of a given module.
* The loader_section must be locked while calling this function.
*/
static
NTSTATUS
fixup_imports
(
WINE_MODREF
*
wm
,
LPCWSTR
load_path
)
{
int
i
,
nb_imports
;
const
IMAGE_IMPORT_DESCRIPTOR
*
imports
;
WINE_MODREF
*
prev
;
DWORD
size
;
NTSTATUS
status
;
ULONG_PTR
cookie
;
if
(
!
(
wm
->
ldr
.
Flags
&
LDR_DONT_RESOLVE_REFS
))
return
STATUS_SUCCESS
;
/* already done */
wm
->
ldr
.
Flags
&=
~
LDR_DONT_RESOLVE_REFS
;
if
(
!
(
imports
=
RtlImageDirectoryEntryToData
(
wm
->
ldr
.
BaseAddress
,
TRUE
,
IMAGE_DIRECTORY_ENTRY_IMPORT
,
&
size
)))
return
STATUS_SUCCESS
;
nb_imports
=
0
;
while
(
imports
[
nb_imports
].
Name
&&
imports
[
nb_imports
].
FirstThunk
)
nb_imports
++
;
if
(
!
nb_imports
)
return
STATUS_SUCCESS
;
/* no imports */
if
(
!
create_module_activation_context
(
&
wm
->
ldr
))
RtlActivateActivationContext
(
0
,
wm
->
ldr
.
ActivationContext
,
&
cookie
);
/* Allocate module dependency list */
wm
->
nDeps
=
nb_imports
;
wm
->
deps
=
RtlAllocateHeap
(
GetProcessHeap
(),
0
,
nb_imports
*
sizeof
(
WINE_MODREF
*
)
);
/* load the imported modules. They are automatically
* added to the modref list of the process.
*/
prev
=
current_modref
;
current_modref
=
wm
;
status
=
STATUS_SUCCESS
;
for
(
i
=
0
;
i
<
nb_imports
;
i
++
)
{
if
(
!
(
wm
->
deps
[
i
]
=
import_dll
(
wm
->
ldr
.
BaseAddress
,
&
imports
[
i
],
load_path
)))
status
=
STATUS_DLL_NOT_FOUND
;
}
current_modref
=
prev
;
if
(
wm
->
ldr
.
ActivationContext
)
RtlDeactivateActivationContext
(
0
,
cookie
);
return
status
;
}
/*************************************************************************
* is_dll_native_subsystem
*
...
...
@@ -885,6 +834,57 @@ static void free_tls_slot( LDR_MODULE *mod )
}
/****************************************************************
* fixup_imports
*
* Fixup all imports of a given module.
* The loader_section must be locked while calling this function.
*/
static
NTSTATUS
fixup_imports
(
WINE_MODREF
*
wm
,
LPCWSTR
load_path
)
{
int
i
,
nb_imports
;
const
IMAGE_IMPORT_DESCRIPTOR
*
imports
;
WINE_MODREF
*
prev
;
DWORD
size
;
NTSTATUS
status
;
ULONG_PTR
cookie
;
if
(
!
(
wm
->
ldr
.
Flags
&
LDR_DONT_RESOLVE_REFS
))
return
STATUS_SUCCESS
;
/* already done */
wm
->
ldr
.
Flags
&=
~
LDR_DONT_RESOLVE_REFS
;
if
(
!
(
imports
=
RtlImageDirectoryEntryToData
(
wm
->
ldr
.
BaseAddress
,
TRUE
,
IMAGE_DIRECTORY_ENTRY_IMPORT
,
&
size
)))
return
STATUS_SUCCESS
;
nb_imports
=
0
;
while
(
imports
[
nb_imports
].
Name
&&
imports
[
nb_imports
].
FirstThunk
)
nb_imports
++
;
if
(
!
nb_imports
)
return
STATUS_SUCCESS
;
/* no imports */
if
(
!
create_module_activation_context
(
&
wm
->
ldr
))
RtlActivateActivationContext
(
0
,
wm
->
ldr
.
ActivationContext
,
&
cookie
);
/* Allocate module dependency list */
wm
->
nDeps
=
nb_imports
;
wm
->
deps
=
RtlAllocateHeap
(
GetProcessHeap
(),
0
,
nb_imports
*
sizeof
(
WINE_MODREF
*
)
);
/* load the imported modules. They are automatically
* added to the modref list of the process.
*/
prev
=
current_modref
;
current_modref
=
wm
;
status
=
STATUS_SUCCESS
;
for
(
i
=
0
;
i
<
nb_imports
;
i
++
)
{
if
(
!
(
wm
->
deps
[
i
]
=
import_dll
(
wm
->
ldr
.
BaseAddress
,
&
imports
[
i
],
load_path
)))
status
=
STATUS_DLL_NOT_FOUND
;
}
current_modref
=
prev
;
if
(
wm
->
ldr
.
ActivationContext
)
RtlDeactivateActivationContext
(
0
,
cookie
);
return
status
;
}
/*************************************************************************
* alloc_module
*
...
...
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