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
19e050eb
Commit
19e050eb
authored
Mar 20, 2003
by
Eric Pouech
Committed by
Alexandre Julliard
Mar 20, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moved WINE_MODREF.flags to WINE_MODREF.ldr.Flags, and make use of the
same flags values as Win2000.
parent
108a69bd
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
37 additions
and
31 deletions
+37
-31
loader.c
dlls/ntdll/loader.c
+20
-18
module.h
include/module.h
+0
-8
winternl.h
include/winternl.h
+12
-0
pe_image.c
loader/pe_image.c
+3
-3
version.c
misc/version.c
+1
-1
relay386.c
relay32/relay386.c
+1
-1
No files found.
dlls/ntdll/loader.c
View file @
19e050eb
...
...
@@ -134,6 +134,7 @@ WINE_MODREF *MODULE_AllocModRef( HMODULE hModule, LPCSTR filename )
if
(
!
exe_modref
)
exe_modref
=
wm
;
else
FIXME
(
"Trying to load second .EXE file: %s
\n
"
,
filename
);
}
else
wm
->
ldr
.
Flags
|=
LDR_IMAGE_IS_DLL
;
}
return
wm
;
}
...
...
@@ -149,7 +150,7 @@ static BOOL MODULE_InitDLL( WINE_MODREF *wm, DWORD type, LPVOID lpReserved )
/* Skip calls for modules loaded with special load flags */
if
(
wm
->
flags
&
WINE_MODREF
_DONT_RESOLVE_REFS
)
return
TRUE
;
if
(
wm
->
ldr
.
Flags
&
LDR
_DONT_RESOLVE_REFS
)
return
TRUE
;
TRACE
(
"(%s,%s,%p) - CALL
\n
"
,
wm
->
modname
,
typeName
[
type
],
lpReserved
);
...
...
@@ -209,14 +210,14 @@ BOOL MODULE_DllProcessAttach( WINE_MODREF *wm, LPVOID lpReserved )
assert
(
wm
);
/* prevent infinite recursion in case of cyclical dependencies */
if
(
(
wm
->
flags
&
WINE_MODREF_MARKER
)
||
(
wm
->
flags
&
WINE_MODREF
_PROCESS_ATTACHED
)
)
if
(
(
wm
->
ldr
.
Flags
&
LDR_LOAD_IN_PROGRESS
)
||
(
wm
->
ldr
.
Flags
&
LDR
_PROCESS_ATTACHED
)
)
goto
done
;
TRACE
(
"(%s,%p) - START
\n
"
,
wm
->
modname
,
lpReserved
);
/* Tag current MODREF to prevent recursive loop */
wm
->
flags
|=
WINE_MODREF_MARKER
;
wm
->
ldr
.
Flags
|=
LDR_LOAD_IN_PROGRESS
;
/* Recursively attach all DLLs this one depends on */
for
(
i
=
0
;
retv
&&
i
<
wm
->
nDeps
;
i
++
)
...
...
@@ -228,7 +229,7 @@ BOOL MODULE_DllProcessAttach( WINE_MODREF *wm, LPVOID lpReserved )
{
retv
=
MODULE_InitDLL
(
wm
,
DLL_PROCESS_ATTACH
,
lpReserved
);
if
(
retv
)
wm
->
flags
|=
WINE_MODREF
_PROCESS_ATTACHED
;
wm
->
ldr
.
Flags
|=
LDR
_PROCESS_ATTACHED
;
}
/* Re-insert MODREF at head of list */
...
...
@@ -243,10 +244,11 @@ BOOL MODULE_DllProcessAttach( WINE_MODREF *wm, LPVOID lpReserved )
}
/* Remove recursion flag */
wm
->
flags
&=
~
WINE_MODREF_MARKER
;
wm
->
ldr
.
Flags
&=
~
LDR_LOAD_IN_PROGRESS
;
TRACE
(
"(%s,%p) - END
\n
"
,
wm
->
modname
,
lpReserved
);
done:
RtlLeaveCriticalSection
(
&
loader_section
);
return
retv
;
...
...
@@ -270,13 +272,13 @@ void MODULE_DllProcessDetach( BOOL bForceDetach, LPVOID lpReserved )
for
(
wm
=
MODULE_modref_list
;
wm
;
wm
=
wm
->
next
)
{
/* Check whether to detach this DLL */
if
(
!
(
wm
->
flags
&
WINE_MODREF
_PROCESS_ATTACHED
)
)
if
(
!
(
wm
->
ldr
.
Flags
&
LDR
_PROCESS_ATTACHED
)
)
continue
;
if
(
wm
->
ldr
.
LoadCount
>
0
&&
!
bForceDetach
)
continue
;
/* Call detach notification */
wm
->
flags
&=
~
WINE_MODREF
_PROCESS_ATTACHED
;
wm
->
ldr
.
Flags
&=
~
LDR
_PROCESS_ATTACHED
;
MODULE_InitDLL
(
wm
,
DLL_PROCESS_DETACH
,
lpReserved
);
/* Restart at head of WINE_MODREF list, as entries might have
...
...
@@ -313,9 +315,9 @@ void MODULE_DllThreadAttach( LPVOID lpReserved )
for
(
;
wm
;
wm
=
wm
->
prev
)
{
if
(
!
(
wm
->
flags
&
WINE_MODREF
_PROCESS_ATTACHED
)
)
if
(
!
(
wm
->
ldr
.
Flags
&
LDR
_PROCESS_ATTACHED
)
)
continue
;
if
(
wm
->
flags
&
WINE_MODREF
_NO_DLL_CALLS
)
if
(
wm
->
ldr
.
Flags
&
LDR
_NO_DLL_CALLS
)
continue
;
MODULE_InitDLL
(
wm
,
DLL_THREAD_ATTACH
,
lpReserved
);
...
...
@@ -339,7 +341,7 @@ NTSTATUS WINAPI LdrDisableThreadCalloutsForDll(HMODULE hModule)
if
(
!
wm
)
ret
=
STATUS_DLL_NOT_FOUND
;
else
wm
->
flags
|=
WINE_MODREF
_NO_DLL_CALLS
;
wm
->
ldr
.
Flags
|=
LDR
_NO_DLL_CALLS
;
RtlLeaveCriticalSection
(
&
loader_section
);
...
...
@@ -634,10 +636,10 @@ NTSTATUS MODULE_LoadLibraryExA( LPCSTR libname, DWORD flags, WINE_MODREF** pwm)
{
(
*
pwm
)
->
ldr
.
LoadCount
++
;
if
(((
*
pwm
)
->
flags
&
WINE_MODREF
_DONT_RESOLVE_REFS
)
&&
if
(((
*
pwm
)
->
ldr
.
Flags
&
LDR
_DONT_RESOLVE_REFS
)
&&
!
(
flags
&
DONT_RESOLVE_DLL_REFERENCES
))
{
(
*
pwm
)
->
flags
&=
~
WINE_MODREF
_DONT_RESOLVE_REFS
;
(
*
pwm
)
->
ldr
.
Flags
&=
~
LDR
_DONT_RESOLVE_REFS
;
PE_fixup_imports
(
*
pwm
);
}
TRACE
(
"Already loaded module '%s' at %p, count=%d
\n
"
,
filename
,
(
*
pwm
)
->
ldr
.
BaseAddress
,
(
*
pwm
)
->
ldr
.
LoadCount
);
...
...
@@ -784,9 +786,9 @@ NTSTATUS WINAPI LdrShutdownThread(void)
for
(
wm
=
MODULE_modref_list
;
wm
;
wm
=
wm
->
next
)
{
if
(
!
(
wm
->
flags
&
WINE_MODREF
_PROCESS_ATTACHED
)
)
if
(
!
(
wm
->
ldr
.
Flags
&
LDR
_PROCESS_ATTACHED
)
)
continue
;
if
(
wm
->
flags
&
WINE_MODREF
_NO_DLL_CALLS
)
if
(
wm
->
ldr
.
Flags
&
LDR
_NO_DLL_CALLS
)
continue
;
MODULE_InitDLL
(
wm
,
DLL_THREAD_DETACH
,
NULL
);
...
...
@@ -852,7 +854,7 @@ static void MODULE_DecRefCount( WINE_MODREF *wm )
{
int
i
;
if
(
wm
->
flags
&
WINE_MODREF_MARKER
)
if
(
wm
->
ldr
.
Flags
&
LDR_UNLOAD_IN_PROGRESS
)
return
;
if
(
wm
->
ldr
.
LoadCount
<=
0
)
...
...
@@ -863,13 +865,13 @@ static void MODULE_DecRefCount( WINE_MODREF *wm )
if
(
wm
->
ldr
.
LoadCount
==
0
)
{
wm
->
flags
|=
WINE_MODREF_MARKER
;
wm
->
ldr
.
Flags
|=
LDR_UNLOAD_IN_PROGRESS
;
for
(
i
=
0
;
i
<
wm
->
nDeps
;
i
++
)
if
(
wm
->
deps
[
i
]
)
MODULE_DecRefCount
(
wm
->
deps
[
i
]
);
wm
->
flags
&=
~
WINE_MODREF_MARKER
;
wm
->
ldr
.
Flags
&=
~
LDR_UNLOAD_IN_PROGRESS
;
}
}
...
...
include/module.h
View file @
19e050eb
...
...
@@ -139,8 +139,6 @@ typedef struct _wine_modref
int
nDeps
;
struct
_wine_modref
**
deps
;
int
flags
;
char
*
filename
;
char
*
modname
;
char
*
short_filename
;
...
...
@@ -149,12 +147,6 @@ typedef struct _wine_modref
char
data
[
1
];
/* space for storing filename and short_filename */
}
WINE_MODREF
;
#define WINE_MODREF_INTERNAL 0x00000001
#define WINE_MODREF_NO_DLL_CALLS 0x00000002
#define WINE_MODREF_PROCESS_ATTACHED 0x00000004
#define WINE_MODREF_DONT_RESOLVE_REFS 0x00000020
#define WINE_MODREF_MARKER 0x80000000
extern
WINE_MODREF
*
MODULE_modref_list
;
/* Resource types */
...
...
include/winternl.h
View file @
19e050eb
...
...
@@ -1174,6 +1174,18 @@ typedef struct _LDR_MODULE
ULONG
TimeDateStamp
;
}
LDR_MODULE
,
*
PLDR_MODULE
;
/* those defines are (some of the) regular LDR_MODULE.Flags values */
#define LDR_IMAGE_IS_DLL 0x00000004
#define LDR_LOAD_IN_PROGRESS 0x00001000
#define LDR_UNLOAD_IN_PROGRESS 0x00002000
#define LDR_NO_DLL_CALLS 0x00040000
#define LDR_PROCESS_ATTACHED 0x00080000
#define LDR_MODULE_REBASED 0x00200000
/* these ones is Wine specific */
#define LDR_DONT_RESOLVE_REFS 0x40000000
#define LDR_WINE_INTERNAL 0x80000000
/* FIXME: to be checked */
#define MAXIMUM_FILENAME_LENGTH 256
...
...
loader/pe_image.c
View file @
19e050eb
...
...
@@ -508,10 +508,10 @@ WINE_MODREF *PE_CreateModule( HMODULE hModule, LPCSTR filename, DWORD flags,
{
NE_MODULE
*
pModule
=
(
NE_MODULE
*
)
GlobalLock16
(
hModule16
);
pModule
->
flags
|=
NE_FFLAGS_BUILTIN
;
wm
->
flags
|=
WINE_MODREF
_INTERNAL
;
wm
->
ldr
.
Flags
|=
LDR_WINE
_INTERNAL
;
}
else
if
(
flags
&
DONT_RESOLVE_DLL_REFERENCES
)
wm
->
flags
|=
WINE_MODREF
_DONT_RESOLVE_REFS
;
wm
->
ldr
.
Flags
|=
LDR
_DONT_RESOLVE_REFS
;
wm
->
find_export
=
PE_FindExportedFunction
;
...
...
@@ -522,7 +522,7 @@ WINE_MODREF *PE_CreateModule( HMODULE hModule, LPCSTR filename, DWORD flags,
/* Fixup Imports */
if
(
!
(
wm
->
flags
&
WINE_MODREF
_DONT_RESOLVE_REFS
)
&&
if
(
!
(
wm
->
ldr
.
Flags
&
LDR
_DONT_RESOLVE_REFS
)
&&
PE_fixup_imports
(
wm
))
{
/* remove entry from modref chain */
...
...
misc/version.c
View file @
19e050eb
...
...
@@ -464,7 +464,7 @@ static DWORD VERSION_GetLinkedDllVersion(void)
ophd
->
MajorSubsystemVersion
,
ophd
->
MinorSubsystemVersion
);
/* test if it is an external (native) dll */
if
(
!
(
wm
->
flags
&
WINE_MODREF
_INTERNAL
))
if
(
!
(
wm
->
ldr
.
Flags
&
LDR_WINE
_INTERNAL
))
{
int
i
;
for
(
i
=
0
;
special_dlls
[
i
];
i
++
)
...
...
relay32/relay386.c
View file @
19e050eb
...
...
@@ -238,7 +238,7 @@ static void get_entry_point( char *buffer, DEBUG_ENTRY_POINT *relay )
for
(
wm
=
MODULE_modref_list
;
wm
;
wm
=
wm
->
next
)
{
if
(
!
(
wm
->
flags
&
WINE_MODREF
_INTERNAL
))
continue
;
if
(
!
(
wm
->
ldr
.
Flags
&
LDR_WINE
_INTERNAL
))
continue
;
exp
=
RtlImageDirectoryEntryToData
(
wm
->
ldr
.
BaseAddress
,
TRUE
,
IMAGE_DIRECTORY_ENTRY_EXPORT
,
&
size
);
if
(
!
exp
)
continue
;
debug
=
(
DEBUG_ENTRY_POINT
*
)((
char
*
)
exp
+
size
);
...
...
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