Removed the no longer used SMB file I/O support, we can't do reliable

file I/O in user space anyway.
This commit is contained in:
Alexandre Julliard 2004-05-14 22:24:48 +00:00
parent 63a5d81cfa
commit 8c29b5f0cc
13 changed files with 3 additions and 2166 deletions

View File

@ -232,7 +232,6 @@ Miscellaneous:
Note: these directories will ultimately get moved into their
respective dlls.
files/ - KERNEL file I/O
misc/ - KERNEL registry
objects/ - GDI logical objects

5
configure vendored
View File

@ -20005,8 +20005,6 @@ esac
ac_config_commands="$ac_config_commands dlls/wineps/data"
ac_config_commands="$ac_config_commands files"
ac_config_commands="$ac_config_commands include/wine"
ac_config_commands="$ac_config_commands misc"
@ -20806,7 +20804,6 @@ do
"dlls/user/dde" ) CONFIG_COMMANDS="$CONFIG_COMMANDS dlls/user/dde" ;;
"dlls/user/resources" ) CONFIG_COMMANDS="$CONFIG_COMMANDS dlls/user/resources" ;;
"dlls/wineps/data" ) CONFIG_COMMANDS="$CONFIG_COMMANDS dlls/wineps/data" ;;
"files" ) CONFIG_COMMANDS="$CONFIG_COMMANDS files" ;;
"include/wine" ) CONFIG_COMMANDS="$CONFIG_COMMANDS include/wine" ;;
"misc" ) CONFIG_COMMANDS="$CONFIG_COMMANDS misc" ;;
"objects" ) CONFIG_COMMANDS="$CONFIG_COMMANDS objects" ;;
@ -21618,8 +21615,6 @@ echo "$as_me: creating dlls/user/dde" >&6;} && mkdir "dlls/user/dde") ;;
echo "$as_me: creating dlls/user/resources" >&6;} && mkdir "dlls/user/resources") ;;
dlls/wineps/data ) test -d "dlls/wineps/data" || ({ echo "$as_me:$LINENO: creating dlls/wineps/data" >&5
echo "$as_me: creating dlls/wineps/data" >&6;} && mkdir "dlls/wineps/data") ;;
files ) test -d "files" || ({ echo "$as_me:$LINENO: creating files" >&5
echo "$as_me: creating files" >&6;} && mkdir "files") ;;
include/wine ) test -d "include/wine" || ({ echo "$as_me:$LINENO: creating include/wine" >&5
echo "$as_me: creating include/wine" >&6;} && mkdir "include/wine") ;;
misc ) test -d "misc" || ({ echo "$as_me:$LINENO: creating misc" >&5

View File

@ -1465,7 +1465,6 @@ WINE_CONFIG_EXTRA_DIR(dlls/kernel/messages)
WINE_CONFIG_EXTRA_DIR(dlls/user/dde)
WINE_CONFIG_EXTRA_DIR(dlls/user/resources)
WINE_CONFIG_EXTRA_DIR(dlls/wineps/data)
WINE_CONFIG_EXTRA_DIR(files)
WINE_CONFIG_EXTRA_DIR(include/wine)
WINE_CONFIG_EXTRA_DIR(misc)
WINE_CONFIG_EXTRA_DIR(objects)

View File

@ -18,7 +18,6 @@ SPEC_SRCS16 = \
windebug.spec
C_SRCS = \
$(TOPOBJDIR)/files/smb.c \
$(TOPOBJDIR)/misc/registry.c \
actctx.c \
atom.c \
@ -93,7 +92,6 @@ MC_SRCS = \
EXTRA_OBJS = $(ASM_SRCS:.s=.o)
SUBDIRS = tests
EXTRASUBDIRS = \
$(TOPOBJDIR)/files \
$(TOPOBJDIR)/misc \
messages \
nls

View File

@ -483,24 +483,6 @@ NTSTATUS WINAPI NtReadFile(HANDLE hFile, HANDLE hEvent,
}
return io_status->u.Status;
}
switch (type)
{
case FD_TYPE_SMB:
FIXME("NIY-SMB\n");
/* FIXME */
/* return SMB_ReadFile(hFile, unix_handle, buffer, length, io_status); */
wine_server_release_fd( hFile, unix_handle );
return STATUS_INVALID_HANDLE;
case FD_TYPE_DEFAULT:
/* normal unix file */
break;
default:
FIXME("Unsupported type of fd %d\n", type);
wine_server_release_fd( hFile, unix_handle );
return STATUS_INVALID_HANDLE;
}
if (offset)
{
@ -667,23 +649,6 @@ NTSTATUS WINAPI NtWriteFile(HANDLE hFile, HANDLE hEvent,
}
return io_status->u.Status;
}
switch (type)
{
case FD_TYPE_SMB:
FIXME("NIY-SMB\n");
wine_server_release_fd( hFile, unix_handle );
return STATUS_NOT_IMPLEMENTED;
case FD_TYPE_DEFAULT:
/* normal unix files */
if (unix_handle == -1) return STATUS_INVALID_HANDLE;
break;
default:
FIXME("Unsupported type of fd %d\n", type);
wine_server_release_fd( hFile, unix_handle );
return STATUS_INVALID_HANDLE;
}
if (offset)
{

File diff suppressed because it is too large Load Diff

View File

@ -1,43 +0,0 @@
/*
* Copyright (C) 2002 Mike McCormack
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef __INC_SMB__
#define __INC_SMB__
static inline int SMB_isSepW (WCHAR c) {return (c == '\\' || c == '/');}
static inline int SMB_isUNCW (LPCWSTR filename) {return (filename && SMB_isSepW (filename[0]) && SMB_isSepW (filename[1]));}
NTSTATUS WINAPI SMB_ReadFile(HANDLE hFile, int fd, LPVOID buffer, DWORD bytesToRead,
PIO_STATUS_BLOCK io_status);
extern HANDLE WINAPI SMB_CreateFileW( LPCWSTR filename, DWORD access, DWORD sharing,
LPSECURITY_ATTRIBUTES sa, DWORD creation,
DWORD attributes, HANDLE template );
typedef struct tagSMB_DIR
{
int current;
int num_entries;
unsigned char **entries;
unsigned char *buffer;
} SMB_DIR;
extern SMB_DIR* WINAPI SMB_FindFirst(LPCWSTR filename);
extern BOOL WINAPI SMB_FindNext(SMB_DIR *dir, WIN32_FIND_DATAW *data );
extern BOOL WINAPI SMB_CloseDir(SMB_DIR *dir);
#endif /* __INC_SMB__ */

View File

@ -795,8 +795,7 @@ enum fd_type
{
FD_TYPE_INVALID,
FD_TYPE_DEFAULT,
FD_TYPE_SOCKET,
FD_TYPE_SMB
FD_TYPE_SOCKET
};
#define FD_FLAG_OVERLAPPED 0x01
#define FD_FLAG_TIMEOUT 0x02
@ -2371,41 +2370,6 @@ struct get_named_pipe_info_reply
};
struct create_smb_request
{
struct request_header __header;
int fd;
unsigned int tree_id;
unsigned int user_id;
unsigned int file_id;
unsigned int dialect;
};
struct create_smb_reply
{
struct reply_header __header;
obj_handle_t handle;
};
struct get_smb_info_request
{
struct request_header __header;
obj_handle_t handle;
unsigned int flags;
unsigned int offset;
};
struct get_smb_info_reply
{
struct reply_header __header;
unsigned int tree_id;
unsigned int user_id;
unsigned int dialect;
unsigned int file_id;
unsigned int offset;
};
#define SMBINFO_SET_OFFSET 0x01
struct create_window_request
{
@ -3208,8 +3172,6 @@ enum request
REQ_wait_named_pipe,
REQ_disconnect_named_pipe,
REQ_get_named_pipe_info,
REQ_create_smb,
REQ_get_smb_info,
REQ_create_window,
REQ_link_window,
REQ_destroy_window,
@ -3390,8 +3352,6 @@ union generic_request
struct wait_named_pipe_request wait_named_pipe_request;
struct disconnect_named_pipe_request disconnect_named_pipe_request;
struct get_named_pipe_info_request get_named_pipe_info_request;
struct create_smb_request create_smb_request;
struct get_smb_info_request get_smb_info_request;
struct create_window_request create_window_request;
struct link_window_request link_window_request;
struct destroy_window_request destroy_window_request;
@ -3570,8 +3530,6 @@ union generic_reply
struct wait_named_pipe_reply wait_named_pipe_reply;
struct disconnect_named_pipe_reply disconnect_named_pipe_reply;
struct get_named_pipe_info_reply get_named_pipe_info_reply;
struct create_smb_reply create_smb_reply;
struct get_smb_info_reply get_smb_info_reply;
struct create_window_reply create_window_reply;
struct link_window_reply link_window_reply;
struct destroy_window_reply destroy_window_reply;
@ -3614,6 +3572,6 @@ union generic_reply
struct set_global_windows_reply set_global_windows_reply;
};
#define SERVER_PROTOCOL_VERSION 141
#define SERVER_PROTOCOL_VERSION 142
#endif /* __WINE_WINE_SERVER_PROTOCOL_H */

View File

@ -34,7 +34,6 @@ C_SRCS = \
semaphore.c \
serial.c \
signal.c \
smb.c \
snapshot.c \
sock.c \
thread.c \

View File

@ -606,8 +606,7 @@ enum fd_type
{
FD_TYPE_INVALID,
FD_TYPE_DEFAULT,
FD_TYPE_SOCKET,
FD_TYPE_SMB
FD_TYPE_SOCKET
};
#define FD_FLAG_OVERLAPPED 0x01
#define FD_FLAG_TIMEOUT 0x02
@ -1675,31 +1674,6 @@ enum message_type
@END
@REQ(create_smb)
int fd;
unsigned int tree_id;
unsigned int user_id;
unsigned int file_id;
unsigned int dialect;
@REPLY
obj_handle_t handle;
@END
@REQ(get_smb_info)
obj_handle_t handle;
unsigned int flags;
unsigned int offset;
@REPLY
unsigned int tree_id;
unsigned int user_id;
unsigned int dialect;
unsigned int file_id;
unsigned int offset;
@END
#define SMBINFO_SET_OFFSET 0x01
/* Create a window */
@REQ(create_window)
user_handle_t parent; /* parent window */

View File

@ -236,8 +236,6 @@ DECL_HANDLER(connect_named_pipe);
DECL_HANDLER(wait_named_pipe);
DECL_HANDLER(disconnect_named_pipe);
DECL_HANDLER(get_named_pipe_info);
DECL_HANDLER(create_smb);
DECL_HANDLER(get_smb_info);
DECL_HANDLER(create_window);
DECL_HANDLER(link_window);
DECL_HANDLER(destroy_window);
@ -417,8 +415,6 @@ static const req_handler req_handlers[REQ_NB_REQUESTS] =
(req_handler)req_wait_named_pipe,
(req_handler)req_disconnect_named_pipe,
(req_handler)req_get_named_pipe_info,
(req_handler)req_create_smb,
(req_handler)req_get_smb_info,
(req_handler)req_create_window,
(req_handler)req_link_window,
(req_handler)req_destroy_window,

View File

@ -1,191 +0,0 @@
/*
* Server-side smb network file management
*
* Copyright (C) 1998 Alexandre Julliard
* Copyright (C) 2000, 2001, 2002 Mike McCormack
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* FIXME: if you can't find something to fix,
* you're not looking hard enough
*/
#include "config.h"
#include <assert.h>
#include <fcntl.h>
#include <stdarg.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <sys/time.h>
#include <sys/types.h>
#include <time.h>
#include <unistd.h>
#ifdef HAVE_UTIME_H
#include <utime.h>
#endif
#ifdef HAVE_TERMIOS_H
#include <termios.h>
#endif
#ifdef HAVE_SYS_IOCTL_H
#include <sys/ioctl.h>
#endif
#include "winerror.h"
#include "windef.h"
#include "winbase.h"
#include "file.h"
#include "handle.h"
#include "thread.h"
#include "request.h"
static void smb_dump( struct object *obj, int verbose );
static struct fd *smb_get_fd( struct object *obj );
static void smb_destroy(struct object *obj);
static int smb_get_info( struct fd *fd, int *flags );
static int smb_get_poll_events( struct fd *fd );
struct smb
{
struct object obj;
struct fd *fd;
unsigned int tree_id;
unsigned int user_id;
unsigned int dialect;
unsigned int file_id;
unsigned int offset;
};
static const struct object_ops smb_ops =
{
sizeof(struct smb), /* size */
smb_dump, /* dump */
default_fd_add_queue, /* add_queue */
default_fd_remove_queue, /* remove_queue */
default_fd_signaled, /* signaled */
no_satisfied, /* satisfied */
smb_get_fd, /* get_fd */
smb_destroy /* destroy */
};
static const struct fd_ops smb_fd_ops =
{
smb_get_poll_events, /* get_poll_events */
default_poll_event, /* poll_event */
no_flush, /* flush */
smb_get_info, /* get_file_info */
no_queue_async /* queue_async */
};
static struct fd *smb_get_fd( struct object *obj )
{
struct smb *smb = (struct smb *)obj;
return (struct fd *)grab_object( smb->fd );
}
static void smb_destroy( struct object *obj)
{
struct smb *smb = (struct smb *)obj;
assert( obj->ops == &smb_ops );
if (smb->fd) release_object( smb->fd );
}
static void smb_dump( struct object *obj, int verbose )
{
struct smb *smb = (struct smb *)obj;
assert( obj->ops == &smb_ops );
fprintf( stderr, "Smb file fd=%p\n", smb->fd );
}
static struct smb *get_smb_obj( struct process *process, obj_handle_t handle, unsigned int access )
{
return (struct smb *)get_handle_obj( process, handle, access, &smb_ops );
}
static int smb_get_poll_events( struct fd *fd )
{
struct smb *smb = get_fd_user( fd );
int events = 0;
assert( smb->obj.ops == &smb_ops );
events |= POLLIN;
/* fprintf(stderr,"poll events are %04x\n",events); */
return events;
}
static int smb_get_info( struct fd *fd, int *flags )
{
/* struct smb *smb = get_fd_user( fd ); */
/* assert( smb->obj.ops == &smb_ops ); */
*flags = 0;
return FD_TYPE_SMB;
}
/* create a smb */
DECL_HANDLER(create_smb)
{
struct smb *smb;
int fd;
reply->handle = 0;
fd = thread_get_inflight_fd( current, req->fd );
if (fd == -1)
{
set_error( STATUS_INVALID_HANDLE );
return;
}
if (!(smb = alloc_object( &smb_ops )))
{
close( fd );
return;
}
smb->tree_id = req->tree_id;
smb->user_id = req->user_id;
smb->dialect = req->dialect;
smb->file_id = req->file_id;
smb->offset = 0;
if ((smb->fd = create_anonymous_fd( &smb_fd_ops, fd, &smb->obj )))
{
reply->handle = alloc_handle( current->process, smb, GENERIC_READ, 0);
}
release_object( smb );
}
DECL_HANDLER(get_smb_info)
{
struct smb *smb;
if ((smb = get_smb_obj( current->process, req->handle, 0 )))
{
if(req->flags & SMBINFO_SET_OFFSET)
smb->offset = req->offset;
reply->tree_id = smb->tree_id;
reply->user_id = smb->user_id;
reply->dialect = smb->dialect;
reply->file_id = smb->file_id;
reply->offset = smb->offset;
release_object( smb );
}
}

View File

@ -1974,36 +1974,6 @@ static void dump_get_named_pipe_info_reply( const struct get_named_pipe_info_rep
fprintf( stderr, " insize=%08x", req->insize );
}
static void dump_create_smb_request( const struct create_smb_request *req )
{
fprintf( stderr, " fd=%d,", req->fd );
fprintf( stderr, " tree_id=%08x,", req->tree_id );
fprintf( stderr, " user_id=%08x,", req->user_id );
fprintf( stderr, " file_id=%08x,", req->file_id );
fprintf( stderr, " dialect=%08x", req->dialect );
}
static void dump_create_smb_reply( const struct create_smb_reply *req )
{
fprintf( stderr, " handle=%p", req->handle );
}
static void dump_get_smb_info_request( const struct get_smb_info_request *req )
{
fprintf( stderr, " handle=%p,", req->handle );
fprintf( stderr, " flags=%08x,", req->flags );
fprintf( stderr, " offset=%08x", req->offset );
}
static void dump_get_smb_info_reply( const struct get_smb_info_reply *req )
{
fprintf( stderr, " tree_id=%08x,", req->tree_id );
fprintf( stderr, " user_id=%08x,", req->user_id );
fprintf( stderr, " dialect=%08x,", req->dialect );
fprintf( stderr, " file_id=%08x,", req->file_id );
fprintf( stderr, " offset=%08x", req->offset );
}
static void dump_create_window_request( const struct create_window_request *req )
{
fprintf( stderr, " parent=%p,", req->parent );
@ -2643,8 +2613,6 @@ static const dump_func req_dumpers[REQ_NB_REQUESTS] = {
(dump_func)dump_wait_named_pipe_request,
(dump_func)dump_disconnect_named_pipe_request,
(dump_func)dump_get_named_pipe_info_request,
(dump_func)dump_create_smb_request,
(dump_func)dump_get_smb_info_request,
(dump_func)dump_create_window_request,
(dump_func)dump_link_window_request,
(dump_func)dump_destroy_window_request,
@ -2821,8 +2789,6 @@ static const dump_func reply_dumpers[REQ_NB_REQUESTS] = {
(dump_func)0,
(dump_func)dump_disconnect_named_pipe_reply,
(dump_func)dump_get_named_pipe_info_reply,
(dump_func)dump_create_smb_reply,
(dump_func)dump_get_smb_info_reply,
(dump_func)dump_create_window_reply,
(dump_func)dump_link_window_reply,
(dump_func)0,
@ -2999,8 +2965,6 @@ static const char * const req_names[REQ_NB_REQUESTS] = {
"wait_named_pipe",
"disconnect_named_pipe",
"get_named_pipe_info",
"create_smb",
"get_smb_info",
"create_window",
"link_window",
"destroy_window",