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
16a9a2d7
Commit
16a9a2d7
authored
Jan 15, 2001
by
Ulrich Weigand
Committed by
Alexandre Julliard
Jan 15, 2001
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't call a NE DLL's DllEntryPoint twice during one single
LoadModule() call.
parent
a8be2a5b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
63 additions
and
4 deletions
+63
-4
segment.c
loader/ne/segment.c
+63
-4
No files found.
loader/ne/segment.c
View file @
16a9a2d7
...
...
@@ -765,7 +765,44 @@ static void NE_CallDllEntryPoint( NE_MODULE *pModule, DWORD dwReason )
* returns FALSE ...
*
*/
void
NE_DllProcessAttach
(
HMODULE16
hModule
)
struct
ne_init_list
{
int
count
;
int
size
;
NE_MODULE
**
module
;
};
static
void
add_to_init_list
(
struct
ne_init_list
*
list
,
NE_MODULE
*
hModule
)
{
if
(
list
->
count
==
list
->
size
)
{
int
newSize
=
list
->
size
+
128
;
NE_MODULE
**
newModule
=
HeapReAlloc
(
GetProcessHeap
(),
0
,
list
->
module
,
newSize
*
sizeof
(
NE_MODULE
*
)
);
if
(
!
newModule
)
{
FIXME_
(
dll
)(
"Out of memory!"
);
return
;
}
list
->
module
=
newModule
;
list
->
size
=
newSize
;
}
list
->
module
[
list
->
count
++
]
=
hModule
;
}
static
void
free_init_list
(
struct
ne_init_list
*
list
)
{
if
(
list
->
module
)
{
HeapFree
(
GetProcessHeap
(),
0
,
list
->
module
);
memset
(
list
,
0
,
sizeof
(
*
list
)
);
}
}
static
void
fill_init_list
(
struct
ne_init_list
*
list
,
HMODULE16
hModule
)
{
NE_MODULE
*
pModule
;
WORD
*
pModRef
;
...
...
@@ -774,6 +811,11 @@ void NE_DllProcessAttach( HMODULE16 hModule )
if
(
!
(
pModule
=
NE_GetPtr
(
hModule
)))
return
;
assert
(
!
(
pModule
->
flags
&
NE_FFLAGS_WIN32
)
);
/* Never add a module twice */
for
(
i
=
0
;
i
<
list
->
count
;
i
++
)
if
(
list
->
module
[
i
]
==
pModule
)
return
;
/* Check for recursive call */
if
(
pModule
->
misc_flags
&
0x80
)
return
;
...
...
@@ -786,10 +828,10 @@ void NE_DllProcessAttach( HMODULE16 hModule )
pModRef
=
NE_MODULE_TABLE
(
pModule
);
for
(
i
=
0
;
i
<
pModule
->
modref_count
;
i
++
)
if
(
pModRef
[
i
]
)
NE_DllProcessAttach
(
(
HMODULE16
)
pModRef
[
i
]
);
fill_init_list
(
list
,
(
HMODULE16
)
pModRef
[
i
]
);
/*
Call DLL entry point
*/
NE_CallDllEntryPoint
(
pModule
,
DLL_PROCESS_ATTACH
);
/*
Add current module
*/
add_to_init_list
(
list
,
pModule
);
/* Remove recursion flag */
pModule
->
misc_flags
&=
~
0x80
;
...
...
@@ -797,6 +839,23 @@ void NE_DllProcessAttach( HMODULE16 hModule )
TRACE_
(
dll
)(
"(%s) - END
\n
"
,
NE_MODULE_NAME
(
pModule
)
);
}
static
void
call_init_list
(
struct
ne_init_list
*
list
)
{
int
i
;
for
(
i
=
0
;
i
<
list
->
count
;
i
++
)
NE_CallDllEntryPoint
(
list
->
module
[
i
],
DLL_PROCESS_ATTACH
);
}
void
NE_DllProcessAttach
(
HMODULE16
hModule
)
{
struct
ne_init_list
list
;
memset
(
&
list
,
0
,
sizeof
(
list
)
);
fill_init_list
(
&
list
,
hModule
);
call_init_list
(
&
list
);
free_init_list
(
&
list
);
}
/***********************************************************************
* NE_Ne2MemFlags
...
...
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