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
670711ef
Commit
670711ef
authored
Apr 06, 2004
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Handle file mappings on removable media entirely inside ntdll.
parent
42f28a72
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
32 additions
and
13 deletions
+32
-13
file.c
dlls/ntdll/file.c
+1
-2
loader.c
dlls/ntdll/loader.c
+3
-0
ntdll_misc.h
dlls/ntdll/ntdll_misc.h
+1
-0
virtual.c
dlls/ntdll/virtual.c
+24
-2
winternl.h
include/winternl.h
+1
-0
process.c
server/process.c
+2
-9
No files found.
dlls/ntdll/file.c
View file @
670711ef
...
@@ -964,8 +964,7 @@ NTSTATUS WINAPI NtQueryVolumeInformationFile( HANDLE handle, PIO_STATUS_BLOCK io
...
@@ -964,8 +964,7 @@ NTSTATUS WINAPI NtQueryVolumeInformationFile( HANDLE handle, PIO_STATUS_BLOCK io
{
{
int
fd
;
int
fd
;
if
((
io
->
u
.
Status
=
wine_server_handle_to_fd
(
handle
,
GENERIC_READ
,
if
((
io
->
u
.
Status
=
wine_server_handle_to_fd
(
handle
,
0
,
&
fd
,
NULL
,
NULL
))
!=
STATUS_SUCCESS
)
&
fd
,
NULL
,
NULL
))
!=
STATUS_SUCCESS
)
return
io
->
u
.
Status
;
return
io
->
u
.
Status
;
io
->
u
.
Status
=
STATUS_NOT_IMPLEMENTED
;
io
->
u
.
Status
=
STATUS_NOT_IMPLEMENTED
;
...
...
dlls/ntdll/loader.c
View file @
670711ef
...
@@ -1227,6 +1227,9 @@ static NTSTATUS load_native_dll( LPCWSTR load_path, LPCWSTR name, HANDLE file,
...
@@ -1227,6 +1227,9 @@ static NTSTATUS load_native_dll( LPCWSTR load_path, LPCWSTR name, HANDLE file,
nt
=
RtlImageNtHeader
(
module
);
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
)
SERVER_START_REQ
(
load_dll
)
{
{
req
->
handle
=
file
;
req
->
handle
=
file
;
...
...
dlls/ntdll/ntdll_misc.h
View file @
670711ef
...
@@ -94,6 +94,7 @@ extern NTSTATUS FILE_GetNtStatus(void);
...
@@ -94,6 +94,7 @@ extern NTSTATUS FILE_GetNtStatus(void);
typedef
BOOL
(
*
HANDLERPROC
)(
LPVOID
,
LPCVOID
);
typedef
BOOL
(
*
HANDLERPROC
)(
LPVOID
,
LPCVOID
);
extern
BOOL
VIRTUAL_SetFaultHandler
(
LPCVOID
addr
,
HANDLERPROC
proc
,
LPVOID
arg
);
extern
BOOL
VIRTUAL_SetFaultHandler
(
LPCVOID
addr
,
HANDLERPROC
proc
,
LPVOID
arg
);
extern
DWORD
VIRTUAL_HandleFault
(
LPCVOID
addr
);
extern
DWORD
VIRTUAL_HandleFault
(
LPCVOID
addr
);
extern
BOOL
VIRTUAL_HasMapping
(
LPCVOID
addr
);
/* code pages */
/* code pages */
extern
int
ntdll_umbstowcs
(
DWORD
flags
,
const
char
*
src
,
int
srclen
,
WCHAR
*
dst
,
int
dstlen
);
extern
int
ntdll_umbstowcs
(
DWORD
flags
,
const
char
*
src
,
int
srclen
,
WCHAR
*
dst
,
int
dstlen
);
...
...
dlls/ntdll/virtual.c
View file @
670711ef
...
@@ -43,6 +43,7 @@
...
@@ -43,6 +43,7 @@
#include "ntstatus.h"
#include "ntstatus.h"
#include "thread.h"
#include "thread.h"
#include "winternl.h"
#include "winternl.h"
#include "winioctl.h"
#include "wine/library.h"
#include "wine/library.h"
#include "wine/server.h"
#include "wine/server.h"
#include "wine/debug.h"
#include "wine/debug.h"
...
@@ -877,6 +878,22 @@ DWORD VIRTUAL_HandleFault( LPCVOID addr )
...
@@ -877,6 +878,22 @@ DWORD VIRTUAL_HandleFault( LPCVOID addr )
return
ret
;
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
;
}
/***********************************************************************
/***********************************************************************
...
@@ -1434,6 +1451,8 @@ NTSTATUS WINAPI NtMapViewOfSection( HANDLE handle, HANDLE process, PVOID *addr_p
...
@@ -1434,6 +1451,8 @@ NTSTATUS WINAPI NtMapViewOfSection( HANDLE handle, HANDLE process, PVOID *addr_p
ULONG
commit_size
,
const
LARGE_INTEGER
*
offset
,
ULONG
*
size_ptr
,
ULONG
commit_size
,
const
LARGE_INTEGER
*
offset
,
ULONG
*
size_ptr
,
SECTION_INHERIT
inherit
,
ULONG
alloc_type
,
ULONG
protect
)
SECTION_INHERIT
inherit
,
ULONG
alloc_type
,
ULONG
protect
)
{
{
IO_STATUS_BLOCK
io
;
FILE_FS_DEVICE_INFORMATION
device_info
;
NTSTATUS
res
;
NTSTATUS
res
;
UINT
size
=
0
;
UINT
size
=
0
;
int
flags
=
MAP_PRIVATE
;
int
flags
=
MAP_PRIVATE
;
...
@@ -1442,7 +1461,7 @@ NTSTATUS WINAPI NtMapViewOfSection( HANDLE handle, HANDLE process, PVOID *addr_p
...
@@ -1442,7 +1461,7 @@ NTSTATUS WINAPI NtMapViewOfSection( HANDLE handle, HANDLE process, PVOID *addr_p
void
*
base
,
*
ptr
=
(
void
*
)
-
1
,
*
ret
;
void
*
base
,
*
ptr
=
(
void
*
)
-
1
,
*
ret
;
DWORD
size_low
,
size_high
,
header_size
,
shared_size
;
DWORD
size_low
,
size_high
,
header_size
,
shared_size
;
HANDLE
shared_file
;
HANDLE
shared_file
;
BOOL
removable
;
BOOL
removable
=
FALSE
;
if
(
!
is_current_process
(
process
))
if
(
!
is_current_process
(
process
))
{
{
...
@@ -1470,13 +1489,16 @@ NTSTATUS WINAPI NtMapViewOfSection( HANDLE handle, HANDLE process, PVOID *addr_p
...
@@ -1470,13 +1489,16 @@ NTSTATUS WINAPI NtMapViewOfSection( HANDLE handle, HANDLE process, PVOID *addr_p
header_size
=
reply
->
header_size
;
header_size
=
reply
->
header_size
;
shared_file
=
reply
->
shared_file
;
shared_file
=
reply
->
shared_file
;
shared_size
=
reply
->
shared_size
;
shared_size
=
reply
->
shared_size
;
removable
=
reply
->
removable
;
}
}
SERVER_END_REQ
;
SERVER_END_REQ
;
if
(
res
)
return
res
;
if
(
res
)
return
res
;
if
((
res
=
wine_server_handle_to_fd
(
handle
,
0
,
&
unix_handle
,
NULL
,
NULL
)))
return
res
;
if
((
res
=
wine_server_handle_to_fd
(
handle
,
0
,
&
unix_handle
,
NULL
,
NULL
)))
return
res
;
if
(
NtQueryVolumeInformationFile
(
handle
,
&
io
,
&
device_info
,
sizeof
(
device_info
),
FileFsDeviceInformation
)
==
STATUS_SUCCESS
)
removable
=
device_info
.
Characteristics
&
FILE_REMOVABLE_MEDIA
;
if
(
prot
&
VPROT_IMAGE
)
if
(
prot
&
VPROT_IMAGE
)
{
{
if
(
shared_file
)
if
(
shared_file
)
...
...
include/winternl.h
View file @
670711ef
...
@@ -1165,6 +1165,7 @@ NTSTATUS WINAPI NtQuerySystemInformation(SYSTEM_INFORMATION_CLASS,PVOID,ULONG,P
...
@@ -1165,6 +1165,7 @@ NTSTATUS WINAPI NtQuerySystemInformation(SYSTEM_INFORMATION_CLASS,PVOID,ULONG,P
NTSTATUS
WINAPI
NtQuerySystemTime
(
PLARGE_INTEGER
);
NTSTATUS
WINAPI
NtQuerySystemTime
(
PLARGE_INTEGER
);
NTSTATUS
WINAPI
NtQueryValueKey
(
HKEY
,
const
UNICODE_STRING
*
,
KEY_VALUE_INFORMATION_CLASS
,
void
*
,
DWORD
,
DWORD
*
);
NTSTATUS
WINAPI
NtQueryValueKey
(
HKEY
,
const
UNICODE_STRING
*
,
KEY_VALUE_INFORMATION_CLASS
,
void
*
,
DWORD
,
DWORD
*
);
NTSTATUS
WINAPI
NtQueryVirtualMemory
(
HANDLE
,
LPCVOID
,
MEMORY_INFORMATION_CLASS
,
PVOID
,
ULONG
,
ULONG
*
);
NTSTATUS
WINAPI
NtQueryVirtualMemory
(
HANDLE
,
LPCVOID
,
MEMORY_INFORMATION_CLASS
,
PVOID
,
ULONG
,
ULONG
*
);
NTSTATUS
WINAPI
NtQueryVolumeInformationFile
(
HANDLE
,
PIO_STATUS_BLOCK
,
PVOID
,
ULONG
,
FS_INFORMATION_CLASS
);
void
WINAPI
NtRaiseException
(
PEXCEPTION_RECORD
,
PCONTEXT
,
BOOL
);
void
WINAPI
NtRaiseException
(
PEXCEPTION_RECORD
,
PCONTEXT
,
BOOL
);
NTSTATUS
WINAPI
NtReadFile
(
HANDLE
,
HANDLE
,
PIO_APC_ROUTINE
,
PVOID
,
PIO_STATUS_BLOCK
,
PVOID
,
ULONG
,
PLARGE_INTEGER
,
PULONG
);
NTSTATUS
WINAPI
NtReadFile
(
HANDLE
,
HANDLE
,
PIO_APC_ROUTINE
,
PVOID
,
PIO_STATUS_BLOCK
,
PVOID
,
ULONG
,
PLARGE_INTEGER
,
PULONG
);
NTSTATUS
WINAPI
NtReadVirtualMemory
(
HANDLE
,
const
void
*
,
void
*
,
SIZE_T
,
SIZE_T
*
);
NTSTATUS
WINAPI
NtReadVirtualMemory
(
HANDLE
,
const
void
*
,
void
*
,
SIZE_T
,
SIZE_T
*
);
...
...
server/process.c
View file @
670711ef
...
@@ -1121,15 +1121,8 @@ DECL_HANDLER(load_dll)
...
@@ -1121,15 +1121,8 @@ DECL_HANDLER(load_dll)
struct
process_dll
*
dll
;
struct
process_dll
*
dll
;
struct
file
*
file
=
NULL
;
struct
file
*
file
=
NULL
;
if
(
req
->
handle
)
if
(
req
->
handle
&&
!
(
file
=
get_file_obj
(
current
->
process
,
req
->
handle
,
GENERIC_READ
)))
{
return
;
if
(
!
(
file
=
get_file_obj
(
current
->
process
,
req
->
handle
,
GENERIC_READ
)))
return
;
if
(
is_file_removable
(
file
))
/* don't keep the file open on removable media */
{
release_object
(
file
);
file
=
NULL
;
}
}
if
((
dll
=
process_load_dll
(
current
->
process
,
file
,
req
->
base
,
if
((
dll
=
process_load_dll
(
current
->
process
,
file
,
req
->
base
,
get_req_data
(),
get_req_data_size
()
)))
get_req_data
(),
get_req_data_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