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
f5d21eb2
Commit
f5d21eb2
authored
Aug 27, 2002
by
Mike McCormack
Committed by
Alexandre Julliard
Aug 27, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't cache file handles for NE executable modules so that we don't
lock the CDROM.
parent
160ab19a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
18 deletions
+20
-18
module.c
loader/ne/module.c
+7
-11
resource.c
loader/ne/resource.c
+1
-0
segment.c
loader/ne/segment.c
+12
-7
No files found.
loader/ne/module.c
View file @
f5d21eb2
...
...
@@ -421,22 +421,18 @@ BOOL16 NE_SetEntryPoint( HMODULE16 hModule, WORD ordinal, WORD offset )
*/
HANDLE
NE_OpenFile
(
NE_MODULE
*
pModule
)
{
HANDLE
handle
;
char
*
name
;
static
HANDLE
cachedfd
=
INVALID_HANDLE_VALUE
;
TRACE
(
"(%p) cache: mod=%p fd=%d
\n
"
,
pModule
,
pCachedModule
,
cachedfd
);
if
(
pCachedModule
==
pModule
)
return
cachedfd
;
CloseHandle
(
cachedfd
);
pCachedModule
=
pModule
;
TRACE
(
"(%p)
\n
"
,
pModule
);
/* mjm - removed module caching because it keeps open file handles
thus preventing CDROMs from being ejected */
name
=
NE_MODULE_NAME
(
pModule
);
if
((
cachedfd
=
CreateFileA
(
name
,
GENERIC_READ
,
FILE_SHARE_READ
,
if
((
handle
=
CreateFileA
(
name
,
GENERIC_READ
,
FILE_SHARE_READ
,
NULL
,
OPEN_EXISTING
,
0
,
0
))
==
INVALID_HANDLE_VALUE
)
MESSAGE
(
"Can't open file '%s' for module %04x
\n
"
,
name
,
pModule
->
self
);
TRACE
(
"opened '%s' -> %d
\n
"
,
name
,
cachedfd
);
return
cachedfd
;
TRACE
(
"opened '%s' -> %d
\n
"
,
name
,
handle
);
return
handle
;
}
...
...
loader/ne/resource.c
View file @
f5d21eb2
...
...
@@ -246,6 +246,7 @@ HGLOBAL16 WINAPI NE_DefResourceHandler( HGLOBAL16 hMemObj, HMODULE16 hModule,
ReadFile
(
fd
,
GlobalLock16
(
handle
),
(
int
)
pNameInfo
->
length
<<
sizeShift
,
&
res
,
NULL
);
}
CloseHandle
(
fd
);
return
handle
;
}
return
(
HGLOBAL16
)
0
;
...
...
loader/ne/segment.c
View file @
f5d21eb2
...
...
@@ -189,7 +189,7 @@ BOOL NE_LoadSegment( NE_MODULE *pModule, WORD segnum )
if
(
buff
==
NULL
)
{
WARN_
(
dll
)(
"Memory exausted!"
);
return
FALSE
;
goto
fail
;
}
ReadFile
(
hf
,
buff
,
size
,
&
res
,
NULL
);
...
...
@@ -213,10 +213,10 @@ BOOL NE_LoadSegment( NE_MODULE *pModule, WORD segnum )
NE_FixupSegmentPrologs
(
pModule
,
segnum
);
if
(
!
(
pSeg
->
flags
&
NE_SEGFLAGS_RELOC_DATA
))
return
TRUE
;
/* No relocation data, we are done */
goto
succeed
;
/* No relocation data, we are done */
ReadFile
(
hf
,
&
count
,
sizeof
(
count
),
&
res
,
NULL
);
if
(
!
count
)
return
TRUE
;
if
(
!
count
)
goto
succeed
;
TRACE_
(
fixup
)(
"Fixups for %.*s, segment %d, hSeg %04x
\n
"
,
*
((
BYTE
*
)
pModule
+
pModule
->
name_table
),
...
...
@@ -230,13 +230,13 @@ BOOL NE_LoadSegment( NE_MODULE *pModule, WORD segnum )
reloc_entries
=
(
struct
relocation_entry_s
*
)
HeapAlloc
(
GetProcessHeap
(),
0
,
count
*
sizeof
(
struct
relocation_entry_s
));
if
(
reloc_entries
==
NULL
)
{
WARN_
(
fixup
)(
"Not enough memory for relocation entries!"
);
return
FALSE
;
goto
fail
;
}
if
(
!
ReadFile
(
hf
,
reloc_entries
,
count
*
sizeof
(
struct
relocation_entry_s
),
&
res
,
NULL
)
||
(
res
!=
count
*
sizeof
(
struct
relocation_entry_s
)))
{
WARN_
(
fixup
)(
"Unable to read relocation information
\n
"
);
return
FALSE
;
goto
fail
;
}
/*
...
...
@@ -419,6 +419,9 @@ BOOL NE_LoadSegment( NE_MODULE *pModule, WORD segnum )
}
HeapFree
(
GetProcessHeap
(),
0
,
reloc_entries
);
succeed:
CloseHandle
(
hf
);
return
TRUE
;
unknown:
...
...
@@ -427,6 +430,9 @@ unknown:
i
+
1
,
rep
->
address_type
,
rep
->
relocation_type
,
rep
->
offset
,
rep
->
target1
,
rep
->
target2
);
HeapFree
(
GetProcessHeap
(),
0
,
reloc_entries
);
fail:
CloseHandle
(
hf
);
return
FALSE
;
}
...
...
@@ -464,8 +470,7 @@ BOOL NE_LoadAllSegments( NE_MODULE *pModule )
NtCurrentTeb
()
->
cur_stack
=
MAKESEGPTR
(
pModule
->
self_loading_sel
,
0xff00
-
sizeof
(
STACK16FRAME
)
);
DuplicateHandle
(
GetCurrentProcess
(),
NE_OpenFile
(
pModule
),
GetCurrentProcess
(),
&
hf
,
0
,
FALSE
,
DUPLICATE_SAME_ACCESS
);
hf
=
NE_OpenFile
(
pModule
);
hFile16
=
Win32HandleToDosFileHandle
(
hf
);
TRACE_
(
dll
)(
"CallBootAppProc(hModule=0x%04x,hf=0x%04x)
\n
"
,
pModule
->
self
,
hFile16
);
...
...
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