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
5a08a028
Commit
5a08a028
authored
Jul 31, 1999
by
Andreas Mohr
Committed by
Alexandre Julliard
Jul 31, 1999
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed the DSEG value in the SEGTABLEENTRY struct.
parent
4d7e8778
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
31 deletions
+34
-31
segment.c
loader/ne/segment.c
+34
-31
No files found.
loader/ne/segment.c
View file @
5a08a028
...
@@ -34,7 +34,7 @@ DECLARE_DEBUG_CHANNEL(fixup)
...
@@ -34,7 +34,7 @@ DECLARE_DEBUG_CHANNEL(fixup)
DECLARE_DEBUG_CHANNEL
(
module
)
DECLARE_DEBUG_CHANNEL
(
module
)
DECLARE_DEBUG_CHANNEL
(
segment
)
DECLARE_DEBUG_CHANNEL
(
segment
)
#define SEL(x)
GlobalHandleToSel16(x
)
#define SEL(x)
((x)|1
)
/***********************************************************************
/***********************************************************************
* NE_GetRelocAddrName
* NE_GetRelocAddrName
...
@@ -742,6 +742,32 @@ void NE_InitializeDLLs( HMODULE16 hModule )
...
@@ -742,6 +742,32 @@ void NE_InitializeDLLs( HMODULE16 hModule )
/***********************************************************************
/***********************************************************************
* NE_Ne2MemFlags
*
* This function translates NE segment flags to GlobalAlloc flags
*/
static
WORD
NE_Ne2MemFlags
(
WORD
flags
)
{
WORD
memflags
=
0
;
#if 1
if
(
flags
&
NE_SEGFLAGS_DISCARDABLE
)
memflags
|=
GMEM_DISCARDABLE
;
if
(
flags
&
NE_SEGFLAGS_MOVEABLE
||
(
!
(
flags
&
NE_SEGFLAGS_DATA
)
&&
!
(
flags
&
NE_SEGFLAGS_LOADED
)
&&
!
(
flags
&
NE_SEGFLAGS_ALLOCATED
)
)
)
memflags
|=
GMEM_MOVEABLE
;
memflags
|=
GMEM_ZEROINIT
;
#else
memflags
=
GMEM_ZEROINIT
|
GMEM_FIXED
;
#endif
return
memflags
;
}
/***********************************************************************
* NE_CreateInstance
* NE_CreateInstance
*
*
* If lib_only is TRUE, handle the module like a library even if it is a .EXE
* If lib_only is TRUE, handle the module like a library even if it is a .EXE
...
@@ -751,7 +777,7 @@ HINSTANCE16 NE_CreateInstance( NE_MODULE *pModule, HINSTANCE16 *prev,
...
@@ -751,7 +777,7 @@ HINSTANCE16 NE_CreateInstance( NE_MODULE *pModule, HINSTANCE16 *prev,
{
{
SEGTABLEENTRY
*
pSegment
;
SEGTABLEENTRY
*
pSegment
;
int
minsize
;
int
minsize
;
HINSTANCE16
hNew
Instance
;
HINSTANCE16
hNew
Seg
;
if
(
pModule
->
dgroup
==
0
)
if
(
pModule
->
dgroup
==
0
)
{
{
...
@@ -772,40 +798,17 @@ HINSTANCE16 NE_CreateInstance( NE_MODULE *pModule, HINSTANCE16 *prev,
...
@@ -772,40 +798,17 @@ HINSTANCE16 NE_CreateInstance( NE_MODULE *pModule, HINSTANCE16 *prev,
minsize
=
pSegment
->
minsize
?
pSegment
->
minsize
:
0x10000
;
minsize
=
pSegment
->
minsize
?
pSegment
->
minsize
:
0x10000
;
if
(
pModule
->
ss
==
pModule
->
dgroup
)
minsize
+=
pModule
->
stack_size
;
if
(
pModule
->
ss
==
pModule
->
dgroup
)
minsize
+=
pModule
->
stack_size
;
minsize
+=
pModule
->
heap_size
;
minsize
+=
pModule
->
heap_size
;
hNew
Instance
=
GLOBAL_Alloc
(
GMEM_ZEROINIT
|
GMEM_FIXED
,
minsize
,
hNew
Seg
=
GLOBAL_Alloc
(
NE_Ne2MemFlags
(
pSegment
->
flags
)
,
minsize
,
pModule
->
self
,
FALSE
,
FALSE
,
FALSE
);
pModule
->
self
,
FALSE
,
FALSE
,
FALSE
);
if
(
!
hNew
Instance
)
return
0
;
if
(
!
hNew
Seg
)
return
0
;
pSegment
->
hSeg
=
hNew
Instance
;
pSegment
->
hSeg
=
hNew
Seg
;
pSegment
->
flags
|=
NE_SEGFLAGS_ALLOCATED
;
pSegment
->
flags
|=
NE_SEGFLAGS_ALLOCATED
;
return
hNewInstance
;
}
/***********************************************************************
/* a HINSTANCE is the selector of the DSEG */
* NE_Ne2MemFlags
return
(
HINSTANCE16
)
SEL
(
hNewSeg
);
*
* This function translates NE segment flags to GlobalAlloc flags
*/
static
WORD
NE_Ne2MemFlags
(
WORD
flags
)
{
WORD
memflags
=
0
;
#if 1
if
(
flags
&
NE_SEGFLAGS_DISCARDABLE
)
memflags
|=
GMEM_DISCARDABLE
;
if
(
flags
&
NE_SEGFLAGS_MOVEABLE
||
(
!
(
flags
&
NE_SEGFLAGS_DATA
)
&&
!
(
flags
&
NE_SEGFLAGS_LOADED
)
&&
!
(
flags
&
NE_SEGFLAGS_ALLOCATED
)
)
)
memflags
|=
GMEM_MOVEABLE
;
memflags
|=
GMEM_ZEROINIT
;
#else
memflags
=
GMEM_ZEROINIT
|
GMEM_FIXED
;
#endif
return
memflags
;
}
}
/***********************************************************************
/***********************************************************************
* NE_AllocateSegment (WPROCS.26)
* NE_AllocateSegment (WPROCS.26)
*
*
...
...
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