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
708a846a
Commit
708a846a
authored
Oct 24, 2001
by
Ove Kaaven
Committed by
Alexandre Julliard
Oct 24, 2001
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Save a disk file's drive type in the server object.
parent
96ebfa98
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
37 additions
and
14 deletions
+37
-14
dos_fs.c
files/dos_fs.c
+1
-1
file.c
files/file.c
+7
-3
file.h
include/file.h
+2
-1
server_protocol.h
include/wine/server_protocol.h
+3
-1
registry.c
misc/registry.c
+1
-1
file.c
server/file.c
+16
-6
mapping.c
server/mapping.c
+1
-0
object.h
server/object.h
+1
-0
protocol.def
server/protocol.def
+2
-0
trace.c
server/trace.c
+3
-1
No files found.
files/dos_fs.c
View file @
708a846a
...
...
@@ -766,7 +766,7 @@ HANDLE DOSFS_OpenDevice( const char *name, DWORD access, DWORD attributes, LPSEC
if
(
!
strcmp
(
DOSFS_Devices
[
i
].
name
,
"NUL"
))
return
FILE_CreateFile
(
"/dev/null"
,
access
,
FILE_SHARE_READ
|
FILE_SHARE_WRITE
,
sa
,
OPEN_EXISTING
,
0
,
0
,
TRUE
);
OPEN_EXISTING
,
0
,
0
,
TRUE
,
DRIVE_UNKNOWN
);
if
(
!
strcmp
(
DOSFS_Devices
[
i
].
name
,
"CON"
))
{
HANDLE
to_dup
;
switch
(
access
&
(
GENERIC_READ
|
GENERIC_WRITE
))
{
...
...
files/file.c
View file @
708a846a
...
...
@@ -281,7 +281,8 @@ static HANDLE FILE_OpenConsole( BOOL output, DWORD access, LPSECURITY_ATTRIBUTES
*/
HANDLE
FILE_CreateFile
(
LPCSTR
filename
,
DWORD
access
,
DWORD
sharing
,
LPSECURITY_ATTRIBUTES
sa
,
DWORD
creation
,
DWORD
attributes
,
HANDLE
template
,
BOOL
fail_read_only
)
DWORD
attributes
,
HANDLE
template
,
BOOL
fail_read_only
,
UINT
drive_type
)
{
DWORD
err
;
HANDLE
ret
;
...
...
@@ -302,6 +303,7 @@ HANDLE FILE_CreateFile( LPCSTR filename, DWORD access, DWORD sharing,
req
->
sharing
=
sharing
;
req
->
create
=
creation
;
req
->
attrs
=
attributes
;
req
->
drive_type
=
drive_type
;
memcpy
(
server_data_ptr
(
req
),
filename
,
len
);
SetLastError
(
0
);
err
=
SERVER_CALL
();
...
...
@@ -509,7 +511,8 @@ HANDLE WINAPI CreateFileA( LPCSTR filename, DWORD access, DWORD sharing,
ret
=
FILE_CreateFile
(
full_name
.
long_name
,
access
,
sharing
,
sa
,
creation
,
attributes
,
template
,
DRIVE_GetFlags
(
full_name
.
drive
)
&
DRIVE_FAIL_READ_ONLY
);
DRIVE_GetFlags
(
full_name
.
drive
)
&
DRIVE_FAIL_READ_ONLY
,
GetDriveTypeA
(
full_name
.
short_name
)
);
done:
if
(
!
ret
)
ret
=
INVALID_HANDLE_VALUE
;
return
ret
;
...
...
@@ -977,7 +980,8 @@ found:
hFileRet
=
FILE_CreateFile
(
full_name
.
long_name
,
access
,
sharing
,
NULL
,
OPEN_EXISTING
,
0
,
0
,
DRIVE_GetFlags
(
full_name
.
drive
)
&
DRIVE_FAIL_READ_ONLY
);
DRIVE_GetFlags
(
full_name
.
drive
)
&
DRIVE_FAIL_READ_ONLY
,
GetDriveTypeA
(
full_name
.
short_name
)
);
if
(
!
hFileRet
)
goto
not_found
;
GetFileTime
(
hFileRet
,
NULL
,
NULL
,
&
filetime
);
...
...
include/file.h
View file @
708a846a
...
...
@@ -77,7 +77,8 @@ extern BOOL FILE_Stat( LPCSTR unixName, BY_HANDLE_FILE_INFORMATION *info );
extern
HFILE16
FILE_Dup2
(
HFILE16
hFile1
,
HFILE16
hFile2
);
extern
HANDLE
FILE_CreateFile
(
LPCSTR
filename
,
DWORD
access
,
DWORD
sharing
,
LPSECURITY_ATTRIBUTES
sa
,
DWORD
creation
,
DWORD
attributes
,
HANDLE
template
,
BOOL
fail_read_only
);
DWORD
attributes
,
HANDLE
template
,
BOOL
fail_read_only
,
UINT
drive_type
);
extern
HANDLE
FILE_CreateDevice
(
int
client_id
,
DWORD
access
,
LPSECURITY_ATTRIBUTES
sa
);
extern
LONG
WINAPI
WIN16_hread
(
HFILE16
,
SEGPTR
,
LONG
);
...
...
include/wine/server_protocol.h
View file @
708a846a
...
...
@@ -566,6 +566,7 @@ struct create_file_request
unsigned
int
sharing
;
int
create
;
unsigned
int
attrs
;
int
drive_type
;
/* VARARG(filename,string); */
handle_t
handle
;
};
...
...
@@ -907,6 +908,7 @@ struct get_mapping_info_request
void
*
base
;
handle_t
shared_file
;
int
shared_size
;
int
drive_type
;
};
...
...
@@ -2054,6 +2056,6 @@ union generic_request
struct
get_window_properties_request
get_window_properties
;
};
#define SERVER_PROTOCOL_VERSION 6
1
#define SERVER_PROTOCOL_VERSION 6
2
#endif
/* __WINE_WINE_SERVER_PROTOCOL_H */
misc/registry.c
View file @
708a846a
...
...
@@ -1184,7 +1184,7 @@ static void load_wine_registry(HKEY hkey,LPCSTR fn)
case
WINE_REG_VER_2
:
{
HANDLE
file
;
if
((
file
=
FILE_CreateFile
(
fn
,
GENERIC_READ
,
0
,
NULL
,
OPEN_EXISTING
,
FILE_ATTRIBUTE_NORMAL
,
0
,
TRUE
)))
FILE_ATTRIBUTE_NORMAL
,
0
,
TRUE
,
DRIVE_UNKNOWN
)))
{
SERVER_START_REQ
(
load_registry
)
{
...
...
server/file.c
View file @
708a846a
...
...
@@ -38,6 +38,7 @@ struct file
unsigned
int
access
;
/* file access (GENERIC_READ/WRITE) */
unsigned
int
flags
;
/* flags (FILE_FLAG_*) */
unsigned
int
sharing
;
/* file sharing mode */
int
drive_type
;
/* type of drive the file is on */
};
#define NAME_HASH_SIZE 37
...
...
@@ -103,7 +104,7 @@ static int check_sharing( const char *name, int hash, unsigned int access,
/* create a file from a file descriptor */
/* if the function fails the fd is closed */
static
struct
file
*
create_file_for_fd
(
int
fd
,
unsigned
int
access
,
unsigned
int
sharing
,
unsigned
int
attrs
)
unsigned
int
attrs
,
int
drive_type
)
{
struct
file
*
file
;
if
((
file
=
alloc_object
(
&
file_ops
,
fd
)))
...
...
@@ -113,13 +114,15 @@ static struct file *create_file_for_fd( int fd, unsigned int access, unsigned in
file
->
access
=
access
;
file
->
flags
=
attrs
;
file
->
sharing
=
sharing
;
file
->
drive_type
=
drive_type
;
}
return
file
;
}
static
struct
file
*
create_file
(
const
char
*
nameptr
,
size_t
len
,
unsigned
int
access
,
unsigned
int
sharing
,
int
create
,
unsigned
int
attrs
)
unsigned
int
sharing
,
int
create
,
unsigned
int
attrs
,
int
drive_type
)
{
struct
file
*
file
;
int
hash
,
flags
;
...
...
@@ -169,7 +172,7 @@ static struct file *create_file( const char *nameptr, size_t len, unsigned int a
goto
error
;
}
if
(
!
(
file
=
create_file_for_fd
(
fd
,
access
,
sharing
,
attrs
)))
if
(
!
(
file
=
create_file_for_fd
(
fd
,
access
,
sharing
,
attrs
,
drive_type
)))
{
free
(
name
);
return
NULL
;
...
...
@@ -193,6 +196,12 @@ int is_same_file( struct file *file1, struct file *file2 )
return
!
strcmp
(
file1
->
name
,
file2
->
name
);
}
/* get the type of drive the file is on */
int
get_file_drive_type
(
struct
file
*
file
)
{
return
file
->
drive_type
;
}
/* Create an anonymous Unix file */
int
create_anonymous_file
(
void
)
{
...
...
@@ -223,7 +232,7 @@ struct file *create_temp_file( int access )
int
fd
;
if
((
fd
=
create_anonymous_file
())
==
-
1
)
return
NULL
;
return
create_file_for_fd
(
fd
,
access
,
0
,
0
);
return
create_file_for_fd
(
fd
,
access
,
0
,
0
,
DRIVE_FIXED
);
}
static
void
file_dump
(
struct
object
*
obj
,
int
verbose
)
...
...
@@ -463,7 +472,7 @@ DECL_HANDLER(create_file)
req
->
handle
=
0
;
if
((
file
=
create_file
(
get_req_data
(
req
),
get_req_data_size
(
req
),
req
->
access
,
req
->
sharing
,
req
->
create
,
req
->
attrs
)))
req
->
sharing
,
req
->
create
,
req
->
attrs
,
req
->
drive_type
)))
{
req
->
handle
=
alloc_handle
(
current
->
process
,
file
,
req
->
access
,
req
->
inherit
);
release_object
(
file
);
...
...
@@ -482,7 +491,8 @@ DECL_HANDLER(alloc_file_handle)
set_error
(
STATUS_INVALID_HANDLE
);
return
;
}
if
((
file
=
create_file_for_fd
(
fd
,
req
->
access
,
FILE_SHARE_READ
|
FILE_SHARE_WRITE
,
0
)))
if
((
file
=
create_file_for_fd
(
fd
,
req
->
access
,
FILE_SHARE_READ
|
FILE_SHARE_WRITE
,
0
,
DRIVE_UNKNOWN
)))
{
req
->
handle
=
alloc_handle
(
current
->
process
,
file
,
req
->
access
,
0
);
release_object
(
file
);
...
...
server/mapping.c
View file @
708a846a
...
...
@@ -380,6 +380,7 @@ DECL_HANDLER(get_mapping_info)
req
->
base
=
mapping
->
base
;
req
->
shared_file
=
0
;
req
->
shared_size
=
mapping
->
shared_size
;
req
->
drive_type
=
get_file_drive_type
(
mapping
->
file
);
if
(
mapping
->
shared_file
)
req
->
shared_file
=
alloc_handle
(
current
->
process
,
mapping
->
shared_file
,
GENERIC_READ
|
GENERIC_WRITE
,
0
);
...
...
server/object.h
View file @
708a846a
...
...
@@ -145,6 +145,7 @@ extern void abandon_mutexes( struct thread *thread );
extern
struct
file
*
get_file_obj
(
struct
process
*
process
,
handle_t
handle
,
unsigned
int
access
);
extern
int
is_same_file
(
struct
file
*
file1
,
struct
file
*
file2
);
extern
int
get_file_drive_type
(
struct
file
*
file
);
extern
int
grow_file
(
struct
file
*
file
,
int
size_high
,
int
size_low
);
extern
int
create_anonymous_file
(
void
);
extern
struct
file
*
create_temp_file
(
int
access
);
...
...
server/protocol.def
View file @
708a846a
...
...
@@ -523,6 +523,7 @@ enum event_op { PULSE_EVENT, SET_EVENT, RESET_EVENT };
unsigned int sharing; /* sharing flags */
int create; /* file create action */
unsigned int attrs; /* file attributes for creation */
int drive_type; /* type of drive the file is on */
VARARG(filename,string); /* file name */
@REPLY
handle_t handle; /* handle to the file */
...
...
@@ -825,6 +826,7 @@ enum event_op { PULSE_EVENT, SET_EVENT, RESET_EVENT };
void* base; /* default base addr (for VPROT_IMAGE mapping) */
handle_t shared_file; /* shared mapping file handle */
int shared_size; /* shared mapping size */
int drive_type; /* type of drive the file is on */
@END
...
...
server/trace.c
View file @
708a846a
...
...
@@ -709,6 +709,7 @@ static void dump_create_file_request( const struct create_file_request *req )
fprintf
(
stderr
,
" sharing=%08x,"
,
req
->
sharing
);
fprintf
(
stderr
,
" create=%d,"
,
req
->
create
);
fprintf
(
stderr
,
" attrs=%08x,"
,
req
->
attrs
);
fprintf
(
stderr
,
" drive_type=%d,"
,
req
->
drive_type
);
fprintf
(
stderr
,
" filename="
);
cur_pos
+=
dump_varargs_string
(
req
);
}
...
...
@@ -1032,7 +1033,8 @@ static void dump_get_mapping_info_reply( const struct get_mapping_info_request *
fprintf
(
stderr
,
" header_size=%d,"
,
req
->
header_size
);
fprintf
(
stderr
,
" base=%p,"
,
req
->
base
);
fprintf
(
stderr
,
" shared_file=%d,"
,
req
->
shared_file
);
fprintf
(
stderr
,
" shared_size=%d"
,
req
->
shared_size
);
fprintf
(
stderr
,
" shared_size=%d,"
,
req
->
shared_size
);
fprintf
(
stderr
,
" drive_type=%d"
,
req
->
drive_type
);
}
static
void
dump_create_device_request
(
const
struct
create_device_request
*
req
)
...
...
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