Commit 49b2f6d9 authored by Alexandre Julliard's avatar Alexandre Julliard

Get rid of the removable media handling in the server.

parent 670711ef
...@@ -312,8 +312,7 @@ HANDLE VOLUME_OpenDevice( LPCWSTR name, DWORD access, DWORD sharing, ...@@ -312,8 +312,7 @@ HANDLE VOLUME_OpenDevice( LPCWSTR name, DWORD access, DWORD sharing,
{ {
TRACE("trying %s\n", buffer ); TRACE("trying %s\n", buffer );
ret = FILE_CreateFile( buffer, access, sharing, sa, OPEN_EXISTING, ret = FILE_CreateFile( buffer, access, sharing, sa, OPEN_EXISTING, attributes, 0 );
attributes, 0, DRIVE_FIXED );
if (ret || GetLastError() != ERROR_FILE_NOT_FOUND) break; if (ret || GetLastError() != ERROR_FILE_NOT_FOUND) break;
if (!dev) break; if (!dev) break;
......
...@@ -106,7 +106,7 @@ static HANDLE open_vxd_handle( LPCWSTR name ) ...@@ -106,7 +106,7 @@ static HANDLE open_vxd_handle( LPCWSTR name )
unix_name[len1] = '/'; unix_name[len1] = '/';
WideCharToMultiByte( CP_UNIXCP, 0, name, -1, unix_name + len1 + 1, len2, NULL, NULL); WideCharToMultiByte( CP_UNIXCP, 0, name, -1, unix_name + len1 + 1, len2, NULL, NULL);
ret = FILE_CreateFile( unix_name, 0, FILE_SHARE_READ|FILE_SHARE_WRITE, NULL, ret = FILE_CreateFile( unix_name, 0, FILE_SHARE_READ|FILE_SHARE_WRITE, NULL,
OPEN_ALWAYS, 0, 0, DRIVE_FIXED ); OPEN_ALWAYS, 0, 0 );
HeapFree( GetProcessHeap(), 0, unix_name ); HeapFree( GetProcessHeap(), 0, unix_name );
return ret; return ret;
} }
......
...@@ -824,7 +824,6 @@ static HANDLE INT21_CreateMagicDeviceHandle( LPCWSTR name ) ...@@ -824,7 +824,6 @@ static HANDLE INT21_CreateMagicDeviceHandle( LPCWSTR name )
req->create = FILE_OPEN_IF; req->create = FILE_OPEN_IF;
req->options = FILE_SYNCHRONOUS_IO_ALERT; req->options = FILE_SYNCHRONOUS_IO_ALERT;
req->attrs = 0; req->attrs = 0;
req->removable = 0;
wine_server_add_data( req, unix_name, strlen(unix_name) ); wine_server_add_data( req, unix_name, strlen(unix_name) );
SetLastError(0); SetLastError(0);
if (!wine_server_call_err( req )) ret = reply->handle; if (!wine_server_call_err( req )) ret = reply->handle;
......
...@@ -183,7 +183,7 @@ void FILE_SetDosError(void) ...@@ -183,7 +183,7 @@ void FILE_SetDosError(void)
*/ */
HANDLE FILE_CreateFile( LPCSTR filename, DWORD access, DWORD sharing, HANDLE FILE_CreateFile( LPCSTR filename, DWORD access, DWORD sharing,
LPSECURITY_ATTRIBUTES sa, DWORD creation, LPSECURITY_ATTRIBUTES sa, DWORD creation,
DWORD attributes, HANDLE template, UINT drive_type ) DWORD attributes, HANDLE template )
{ {
unsigned int err; unsigned int err;
UINT disp, options; UINT disp, options;
...@@ -220,7 +220,6 @@ HANDLE FILE_CreateFile( LPCSTR filename, DWORD access, DWORD sharing, ...@@ -220,7 +220,6 @@ HANDLE FILE_CreateFile( LPCSTR filename, DWORD access, DWORD sharing,
req->create = disp; req->create = disp;
req->options = options; req->options = options;
req->attrs = attributes; req->attrs = attributes;
req->removable = (drive_type == DRIVE_REMOVABLE || drive_type == DRIVE_CDROM);
wine_server_add_data( req, filename, strlen(filename) ); wine_server_add_data( req, filename, strlen(filename) );
SetLastError(0); SetLastError(0);
err = wine_server_call( req ); err = wine_server_call( req );
...@@ -365,7 +364,7 @@ HANDLE WINAPI CreateFileW( LPCWSTR filename, DWORD access, DWORD sharing, ...@@ -365,7 +364,7 @@ HANDLE WINAPI CreateFileW( LPCWSTR filename, DWORD access, DWORD sharing,
if (device) if (device)
{ {
ret = FILE_CreateFile( device, access, sharing, sa, creation, ret = FILE_CreateFile( device, access, sharing, sa, creation,
attributes, template, DRIVE_FIXED ); attributes, template );
} }
else else
{ {
...@@ -442,8 +441,7 @@ HANDLE WINAPI CreateFileW( LPCWSTR filename, DWORD access, DWORD sharing, ...@@ -442,8 +441,7 @@ HANDLE WINAPI CreateFileW( LPCWSTR filename, DWORD access, DWORD sharing,
} }
ret = FILE_CreateFile( full_name.long_name, access, sharing, ret = FILE_CreateFile( full_name.long_name, access, sharing,
sa, creation, attributes, template, sa, creation, attributes, template );
GetDriveTypeW( full_name.short_name ) );
done: done:
if (!ret) ret = INVALID_HANDLE_VALUE; if (!ret) ret = INVALID_HANDLE_VALUE;
TRACE("returning %p\n", ret); TRACE("returning %p\n", ret);
...@@ -1439,8 +1437,7 @@ BOOL WINAPI MoveFileExW( LPCWSTR fn1, LPCWSTR fn2, DWORD flag ) ...@@ -1439,8 +1437,7 @@ BOOL WINAPI MoveFileExW( LPCWSTR fn1, LPCWSTR fn2, DWORD flag )
/* check if we are allowed to rename the source */ /* check if we are allowed to rename the source */
hFile = FILE_CreateFile( full_name1.long_name, 0, 0, hFile = FILE_CreateFile( full_name1.long_name, 0, 0,
NULL, OPEN_EXISTING, 0, 0, NULL, OPEN_EXISTING, 0, 0 );
GetDriveTypeW( full_name1.short_name ) );
if (!hFile) if (!hFile)
{ {
if (GetLastError() != ERROR_ACCESS_DENIED) return FALSE; if (GetLastError() != ERROR_ACCESS_DENIED) return FALSE;
...@@ -1452,8 +1449,7 @@ BOOL WINAPI MoveFileExW( LPCWSTR fn1, LPCWSTR fn2, DWORD flag ) ...@@ -1452,8 +1449,7 @@ BOOL WINAPI MoveFileExW( LPCWSTR fn1, LPCWSTR fn2, DWORD flag )
/* check, if we are allowed to delete the destination, /* check, if we are allowed to delete the destination,
** (but the file not being there is fine) */ ** (but the file not being there is fine) */
hFile = FILE_CreateFile( full_name2.long_name, GENERIC_READ|GENERIC_WRITE, 0, hFile = FILE_CreateFile( full_name2.long_name, GENERIC_READ|GENERIC_WRITE, 0,
NULL, OPEN_EXISTING, 0, 0, NULL, OPEN_EXISTING, 0, 0 );
GetDriveTypeW( full_name2.short_name ) );
if(!hFile && GetLastError() != ERROR_FILE_NOT_FOUND) return FALSE; if(!hFile && GetLastError() != ERROR_FILE_NOT_FOUND) return FALSE;
CloseHandle(hFile); CloseHandle(hFile);
......
...@@ -41,7 +41,7 @@ extern void FILE_SetDosError(void); ...@@ -41,7 +41,7 @@ extern void FILE_SetDosError(void);
extern BOOL FILE_Stat( LPCSTR unixName, BY_HANDLE_FILE_INFORMATION *info, BOOL *is_symlink ); extern BOOL FILE_Stat( LPCSTR unixName, BY_HANDLE_FILE_INFORMATION *info, BOOL *is_symlink );
extern HANDLE FILE_CreateFile( LPCSTR filename, DWORD access, DWORD sharing, extern HANDLE FILE_CreateFile( LPCSTR filename, DWORD access, DWORD sharing,
LPSECURITY_ATTRIBUTES sa, DWORD creation, LPSECURITY_ATTRIBUTES sa, DWORD creation,
DWORD attributes, HANDLE template, UINT drive_type ); DWORD attributes, HANDLE template );
/* files/directory.c */ /* files/directory.c */
extern int DIR_Init(void); extern int DIR_Init(void);
......
...@@ -753,7 +753,6 @@ struct create_file_request ...@@ -753,7 +753,6 @@ struct create_file_request
int create; int create;
unsigned int options; unsigned int options;
unsigned int attrs; unsigned int attrs;
int removable;
/* VARARG(filename,string); */ /* VARARG(filename,string); */
}; };
struct create_file_reply struct create_file_reply
...@@ -1487,7 +1486,6 @@ struct get_mapping_info_reply ...@@ -1487,7 +1486,6 @@ struct get_mapping_info_reply
void* base; void* base;
obj_handle_t shared_file; obj_handle_t shared_file;
int shared_size; int shared_size;
int removable;
}; };
...@@ -3693,6 +3691,6 @@ union generic_reply ...@@ -3693,6 +3691,6 @@ union generic_reply
struct set_global_windows_reply set_global_windows_reply; struct set_global_windows_reply set_global_windows_reply;
}; };
#define SERVER_PROTOCOL_VERSION 136 #define SERVER_PROTOCOL_VERSION 137
#endif /* __WINE_WINE_SERVER_PROTOCOL_H */ #endif /* __WINE_WINE_SERVER_PROTOCOL_H */
...@@ -1201,7 +1201,7 @@ static void load_wine_registry(HKEY hkey,LPCSTR fn) ...@@ -1201,7 +1201,7 @@ static void load_wine_registry(HKEY hkey,LPCSTR fn)
{ {
HANDLE file; HANDLE file;
if ((file = FILE_CreateFile( fn, GENERIC_READ, 0, NULL, OPEN_EXISTING, if ((file = FILE_CreateFile( fn, GENERIC_READ, 0, NULL, OPEN_EXISTING,
FILE_ATTRIBUTE_NORMAL, 0, DRIVE_FIXED ))) FILE_ATTRIBUTE_NORMAL, 0 )))
{ {
SERVER_START_REQ( load_registry ) SERVER_START_REQ( load_registry )
{ {
......
...@@ -58,7 +58,6 @@ struct file ...@@ -58,7 +58,6 @@ struct file
struct fd *fd; /* file descriptor for this file */ struct fd *fd; /* file descriptor for this file */
unsigned int access; /* file access (GENERIC_READ/WRITE) */ unsigned int access; /* file access (GENERIC_READ/WRITE) */
unsigned int options; /* file options (FILE_DELETE_ON_CLOSE, FILE_SYNCHRONOUS...) */ unsigned int options; /* file options (FILE_DELETE_ON_CLOSE, FILE_SYNCHRONOUS...) */
int removable; /* is file on removable media? */
struct async_queue read_q; struct async_queue read_q;
struct async_queue write_q; struct async_queue write_q;
}; };
...@@ -109,7 +108,6 @@ static struct file *create_file_for_fd( int fd, unsigned int access, unsigned in ...@@ -109,7 +108,6 @@ static struct file *create_file_for_fd( int fd, unsigned int access, unsigned in
{ {
file->access = access; file->access = access;
file->options = FILE_SYNCHRONOUS_IO_NONALERT; file->options = FILE_SYNCHRONOUS_IO_NONALERT;
file->removable = 0;
if (!(file->fd = create_anonymous_fd( &file_fd_ops, fd, &file->obj ))) if (!(file->fd = create_anonymous_fd( &file_fd_ops, fd, &file->obj )))
{ {
release_object( file ); release_object( file );
...@@ -122,7 +120,7 @@ static struct file *create_file_for_fd( int fd, unsigned int access, unsigned in ...@@ -122,7 +120,7 @@ static struct file *create_file_for_fd( int fd, unsigned int access, unsigned in
static struct object *create_file( const char *nameptr, size_t len, unsigned int access, static struct object *create_file( const char *nameptr, size_t len, unsigned int access,
unsigned int sharing, int create, unsigned int options, unsigned int sharing, int create, unsigned int options,
unsigned int attrs, int removable ) unsigned int attrs )
{ {
struct file *file; struct file *file;
int flags; int flags;
...@@ -160,7 +158,6 @@ static struct object *create_file( const char *nameptr, size_t len, unsigned int ...@@ -160,7 +158,6 @@ static struct object *create_file( const char *nameptr, size_t len, unsigned int
file->access = access; file->access = access;
file->options = options; file->options = options;
file->removable = removable;
if (is_overlapped( file )) if (is_overlapped( file ))
{ {
init_async_queue (&file->read_q); init_async_queue (&file->read_q);
...@@ -207,12 +204,6 @@ int is_same_file( struct file *file1, struct file *file2 ) ...@@ -207,12 +204,6 @@ int is_same_file( struct file *file1, struct file *file2 )
return is_same_file_fd( file1->fd, file2->fd ); return is_same_file_fd( file1->fd, file2->fd );
} }
/* check if the file is on removable media */
int is_file_removable( struct file *file )
{
return file->removable;
}
/* create a temp file for anonymous mappings */ /* create a temp file for anonymous mappings */
struct file *create_temp_file( int access ) struct file *create_temp_file( int access )
{ {
...@@ -525,7 +516,7 @@ DECL_HANDLER(create_file) ...@@ -525,7 +516,7 @@ DECL_HANDLER(create_file)
reply->handle = 0; reply->handle = 0;
if ((file = create_file( get_req_data(), get_req_data_size(), req->access, if ((file = create_file( get_req_data(), get_req_data_size(), req->access,
req->sharing, req->create, req->options, req->attrs, req->removable ))) req->sharing, req->create, req->options, req->attrs )))
{ {
reply->handle = alloc_handle( current->process, file, req->access, req->inherit ); reply->handle = alloc_handle( current->process, file, req->access, req->inherit );
release_object( file ); release_object( file );
......
...@@ -93,7 +93,6 @@ extern struct file *get_file_obj( struct process *process, obj_handle_t handle, ...@@ -93,7 +93,6 @@ extern struct file *get_file_obj( struct process *process, obj_handle_t handle,
unsigned int access ); unsigned int access );
extern int get_file_unix_fd( struct file *file ); extern int get_file_unix_fd( struct file *file );
extern int is_same_file( struct file *file1, struct file *file2 ); extern int is_same_file( struct file *file1, struct file *file2 );
extern int is_file_removable( struct file *file );
extern int grow_file( struct file *file, int size_high, int size_low ); extern int grow_file( struct file *file, int size_high, int size_low );
extern struct file *create_temp_file( int access ); extern struct file *create_temp_file( int access );
extern void file_set_error(void); extern void file_set_error(void);
......
...@@ -396,7 +396,6 @@ DECL_HANDLER(get_mapping_info) ...@@ -396,7 +396,6 @@ DECL_HANDLER(get_mapping_info)
reply->base = mapping->base; reply->base = mapping->base;
reply->shared_file = 0; reply->shared_file = 0;
reply->shared_size = mapping->shared_size; reply->shared_size = mapping->shared_size;
reply->removable = is_file_removable( mapping->file );
if (mapping->shared_file) if (mapping->shared_file)
reply->shared_file = alloc_handle( current->process, mapping->shared_file, reply->shared_file = alloc_handle( current->process, mapping->shared_file,
GENERIC_READ|GENERIC_WRITE, 0 ); GENERIC_READ|GENERIC_WRITE, 0 );
......
...@@ -577,7 +577,6 @@ enum event_op { PULSE_EVENT, SET_EVENT, RESET_EVENT }; ...@@ -577,7 +577,6 @@ enum event_op { PULSE_EVENT, SET_EVENT, RESET_EVENT };
int create; /* file create action */ int create; /* file create action */
unsigned int options; /* file options */ unsigned int options; /* file options */
unsigned int attrs; /* file attributes for creation */ unsigned int attrs; /* file attributes for creation */
int removable; /* is file on removable media? */
VARARG(filename,string); /* file name */ VARARG(filename,string); /* file name */
@REPLY @REPLY
obj_handle_t handle; /* handle to the file */ obj_handle_t handle; /* handle to the file */
...@@ -1095,7 +1094,6 @@ enum char_info_mode ...@@ -1095,7 +1094,6 @@ enum char_info_mode
void* base; /* default base addr (for VPROT_IMAGE mapping) */ void* base; /* default base addr (for VPROT_IMAGE mapping) */
obj_handle_t shared_file; /* shared mapping file handle */ obj_handle_t shared_file; /* shared mapping file handle */
int shared_size; /* shared mapping size */ int shared_size; /* shared mapping size */
int removable; /* is file on removable media? */
@END @END
......
...@@ -837,7 +837,6 @@ static void dump_create_file_request( const struct create_file_request *req ) ...@@ -837,7 +837,6 @@ static void dump_create_file_request( const struct create_file_request *req )
fprintf( stderr, " create=%d,", req->create ); fprintf( stderr, " create=%d,", req->create );
fprintf( stderr, " options=%08x,", req->options ); fprintf( stderr, " options=%08x,", req->options );
fprintf( stderr, " attrs=%08x,", req->attrs ); fprintf( stderr, " attrs=%08x,", req->attrs );
fprintf( stderr, " removable=%d,", req->removable );
fprintf( stderr, " filename=" ); fprintf( stderr, " filename=" );
dump_varargs_string( cur_size ); dump_varargs_string( cur_size );
} }
...@@ -1336,8 +1335,7 @@ static void dump_get_mapping_info_reply( const struct get_mapping_info_reply *re ...@@ -1336,8 +1335,7 @@ static void dump_get_mapping_info_reply( const struct get_mapping_info_reply *re
fprintf( stderr, " header_size=%d,", req->header_size ); fprintf( stderr, " header_size=%d,", req->header_size );
fprintf( stderr, " base=%p,", req->base ); fprintf( stderr, " base=%p,", req->base );
fprintf( stderr, " shared_file=%p,", req->shared_file ); fprintf( stderr, " shared_file=%p,", req->shared_file );
fprintf( stderr, " shared_size=%d,", req->shared_size ); fprintf( stderr, " shared_size=%d", req->shared_size );
fprintf( stderr, " removable=%d", req->removable );
} }
static void dump_create_snapshot_request( const struct create_snapshot_request *req ) static void dump_create_snapshot_request( const struct create_snapshot_request *req )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment