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
5bd51364
Commit
5bd51364
authored
Jan 12, 2007
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Moved the check for removable file in load_dll to the server.
parent
c255bf46
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
16 additions
and
22 deletions
+16
-22
loader.c
dlls/ntdll/loader.c
+0
-3
ntdll_misc.h
dlls/ntdll/ntdll_misc.h
+0
-1
virtual.c
dlls/ntdll/virtual.c
+0
-16
fd.c
server/fd.c
+7
-1
file.c
server/file.c
+6
-0
file.h
server/file.h
+2
-0
process.c
server/process.c
+1
-1
No files found.
dlls/ntdll/loader.c
View file @
5bd51364
...
...
@@ -1438,9 +1438,6 @@ static NTSTATUS load_native_dll( LPCWSTR load_path, LPCWSTR name, HANDLE file,
nt
=
RtlImageNtHeader
(
module
);
/* don't keep the file open if the mapping is from removable media */
if
(
!
VIRTUAL_HasMapping
(
module
))
file
=
0
;
SERVER_START_REQ
(
load_dll
)
{
req
->
handle
=
file
;
...
...
dlls/ntdll/ntdll_misc.h
View file @
5bd51364
...
...
@@ -111,7 +111,6 @@ extern NTSTATUS DIR_get_unix_cwd( char **cwd );
/* virtual memory */
extern
NTSTATUS
VIRTUAL_HandleFault
(
LPCVOID
addr
);
extern
BOOL
VIRTUAL_HasMapping
(
LPCVOID
addr
);
extern
void
VIRTUAL_SetForceExec
(
BOOL
enable
);
extern
void
VIRTUAL_UseLargeAddressSpace
(
void
);
...
...
dlls/ntdll/virtual.c
View file @
5bd51364
...
...
@@ -1291,22 +1291,6 @@ NTSTATUS VIRTUAL_HandleFault( LPCVOID addr )
return
ret
;
}
/***********************************************************************
* VIRTUAL_HasMapping
*
* Check if the specified view has an associated file mapping.
*/
BOOL
VIRTUAL_HasMapping
(
LPCVOID
addr
)
{
FILE_VIEW
*
view
;
BOOL
ret
=
FALSE
;
RtlEnterCriticalSection
(
&
csVirtual
);
if
((
view
=
VIRTUAL_FindView
(
addr
)))
ret
=
(
view
->
mapping
!=
0
);
RtlLeaveCriticalSection
(
&
csVirtual
);
return
ret
;
}
/***********************************************************************
* VIRTUAL_SetForceExec
...
...
server/fd.c
View file @
5bd51364
...
...
@@ -1668,6 +1668,12 @@ int is_same_file_fd( struct fd *fd1, struct fd *fd2 )
return
fd1
->
inode
==
fd2
->
inode
;
}
/* check if fd is on a removable device */
int
is_fd_removable
(
struct
fd
*
fd
)
{
return
(
fd
->
inode
&&
fd
->
inode
->
device
->
removable
);
}
/* handler for close_handle that refuses to close fd-associated handles in other processes */
int
fd_close_handle
(
struct
object
*
obj
,
struct
process
*
process
,
obj_handle_t
handle
)
{
...
...
@@ -1966,7 +1972,7 @@ DECL_HANDLER(get_handle_fd)
reply
->
type
=
fd
->
fd_ops
->
get_file_info
(
fd
,
&
reply
->
flags
);
if
(
reply
->
type
!=
FD_TYPE_INVALID
)
{
if
(
fd
->
inode
&&
fd
->
inode
->
device
->
removable
)
reply
->
flags
|=
FD_FLAG_REMOVABLE
;
if
(
is_fd_removable
(
fd
)
)
reply
->
flags
|=
FD_FLAG_REMOVABLE
;
if
(
!
req
->
cached
)
{
int
unix_fd
=
get_unix_fd
(
fd
);
...
...
server/file.c
View file @
5bd51364
...
...
@@ -319,6 +319,12 @@ int get_file_unix_fd( struct file *file )
return
get_unix_fd
(
file
->
fd
);
}
struct
file
*
grab_file_unless_removable
(
struct
file
*
file
)
{
if
(
is_fd_removable
(
file
->
fd
))
return
NULL
;
return
(
struct
file
*
)
grab_object
(
file
);
}
/* extend a file beyond the current end of file */
static
int
extend_file
(
struct
file
*
file
,
file_pos_t
new_size
)
{
...
...
server/file.h
View file @
5bd51364
...
...
@@ -55,6 +55,7 @@ extern void *get_fd_user( struct fd *fd );
extern
void
set_fd_user
(
struct
fd
*
fd
,
const
struct
fd_ops
*
ops
,
struct
object
*
user
);
extern
int
get_unix_fd
(
struct
fd
*
fd
);
extern
int
is_same_file_fd
(
struct
fd
*
fd1
,
struct
fd
*
fd2
);
extern
int
is_fd_removable
(
struct
fd
*
fd
);
extern
int
fd_close_handle
(
struct
object
*
obj
,
struct
process
*
process
,
obj_handle_t
handle
);
extern
void
fd_poll_event
(
struct
fd
*
fd
,
int
event
);
extern
int
check_fd_events
(
struct
fd
*
fd
,
int
events
);
...
...
@@ -104,6 +105,7 @@ extern struct file *get_file_obj( struct process *process, obj_handle_t handle,
unsigned
int
access
);
extern
int
get_file_unix_fd
(
struct
file
*
file
);
extern
int
is_same_file
(
struct
file
*
file1
,
struct
file
*
file2
);
extern
struct
file
*
grab_file_unless_removable
(
struct
file
*
file
);
extern
int
grow_file
(
struct
file
*
file
,
file_pos_t
size
);
extern
struct
file
*
create_temp_file
(
int
access
);
extern
void
file_set_error
(
void
);
...
...
server/process.c
View file @
5bd51364
...
...
@@ -492,7 +492,7 @@ static struct process_dll *process_load_dll( struct process *process, struct fil
free
(
dll
);
return
NULL
;
}
if
(
file
)
dll
->
file
=
(
struct
file
*
)
grab_object
(
file
);
if
(
file
)
dll
->
file
=
grab_file_unless_removable
(
file
);
list_add_tail
(
&
process
->
dlls
,
&
dll
->
entry
);
}
return
dll
;
...
...
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