Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
568c67e1
Commit
568c67e1
authored
Oct 08, 2001
by
Mike McCormack
Committed by
Alexandre Julliard
Oct 08, 2001
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make serial fd blocking mode depend on FILE_FLAG_OVERLAPPED.
parent
58b29952
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
30 additions
and
10 deletions
+30
-10
dos_fs.c
files/dos_fs.c
+5
-4
file.c
files/file.c
+1
-1
file.h
include/file.h
+1
-1
server_protocol.h
include/wine/server_protocol.h
+3
-1
protocol.def
server/protocol.def
+2
-0
serial.c
server/serial.c
+17
-3
trace.c
server/trace.c
+1
-0
No files found.
files/dos_fs.c
View file @
568c67e1
...
@@ -705,13 +705,13 @@ const DOS_DEVICE *DOSFS_GetDeviceByHandle( HFILE hFile )
...
@@ -705,13 +705,13 @@ const DOS_DEVICE *DOSFS_GetDeviceByHandle( HFILE hFile )
/**************************************************************************
/**************************************************************************
* DOSFS_CreateCommPort
* DOSFS_CreateCommPort
*/
*/
static
HANDLE
DOSFS_CreateCommPort
(
LPCSTR
name
,
DWORD
access
)
static
HANDLE
DOSFS_CreateCommPort
(
LPCSTR
name
,
DWORD
access
,
DWORD
attributes
)
{
{
HANDLE
ret
;
HANDLE
ret
;
char
devname
[
40
];
char
devname
[
40
];
size_t
len
;
size_t
len
;
TRACE
(
"%s %lx
\n
"
,
name
,
acces
s
);
TRACE
_
(
file
)(
"%s %lx %lx
\n
"
,
name
,
access
,
attribute
s
);
PROFILE_GetWineIniString
(
"serialports"
,
name
,
""
,
devname
,
sizeof
devname
);
PROFILE_GetWineIniString
(
"serialports"
,
name
,
""
,
devname
,
sizeof
devname
);
if
(
!
devname
[
0
])
if
(
!
devname
[
0
])
...
@@ -724,6 +724,7 @@ static HANDLE DOSFS_CreateCommPort(LPCSTR name, DWORD access)
...
@@ -724,6 +724,7 @@ static HANDLE DOSFS_CreateCommPort(LPCSTR name, DWORD access)
{
{
req
->
access
=
access
;
req
->
access
=
access
;
req
->
inherit
=
0
;
/*FIXME*/
req
->
inherit
=
0
;
/*FIXME*/
req
->
attributes
=
attributes
;
req
->
sharing
=
FILE_SHARE_READ
|
FILE_SHARE_WRITE
;
req
->
sharing
=
FILE_SHARE_READ
|
FILE_SHARE_WRITE
;
memcpy
(
server_data_ptr
(
req
),
devname
,
len
);
memcpy
(
server_data_ptr
(
req
),
devname
,
len
);
SetLastError
(
0
);
SetLastError
(
0
);
...
@@ -745,7 +746,7 @@ static HANDLE DOSFS_CreateCommPort(LPCSTR name, DWORD access)
...
@@ -745,7 +746,7 @@ static HANDLE DOSFS_CreateCommPort(LPCSTR name, DWORD access)
* Open a DOS device. This might not map 1:1 into the UNIX device concept.
* Open a DOS device. This might not map 1:1 into the UNIX device concept.
* Returns 0 on failure.
* Returns 0 on failure.
*/
*/
HANDLE
DOSFS_OpenDevice
(
const
char
*
name
,
DWORD
access
)
HANDLE
DOSFS_OpenDevice
(
const
char
*
name
,
DWORD
access
,
DWORD
attributes
)
{
{
int
i
;
int
i
;
const
char
*
p
;
const
char
*
p
;
...
@@ -790,7 +791,7 @@ HANDLE DOSFS_OpenDevice( const char *name, DWORD access )
...
@@ -790,7 +791,7 @@ HANDLE DOSFS_OpenDevice( const char *name, DWORD access )
return
FILE_CreateDevice
(
i
,
access
,
NULL
);
return
FILE_CreateDevice
(
i
,
access
,
NULL
);
}
}
if
(
(
handle
=
DOSFS_CreateCommPort
(
DOSFS_Devices
[
i
].
name
,
access
))
)
if
(
(
handle
=
DOSFS_CreateCommPort
(
DOSFS_Devices
[
i
].
name
,
access
,
attributes
))
)
return
handle
;
return
handle
;
FIXME
(
"device open %s not supported (yet)
\n
"
,
DOSFS_Devices
[
i
].
name
);
FIXME
(
"device open %s not supported (yet)
\n
"
,
DOSFS_Devices
[
i
].
name
);
return
0
;
return
0
;
...
...
files/file.c
View file @
568c67e1
...
@@ -488,7 +488,7 @@ HANDLE WINAPI CreateFileA( LPCSTR filename, DWORD access, DWORD sharing,
...
@@ -488,7 +488,7 @@ HANDLE WINAPI CreateFileA( LPCSTR filename, DWORD access, DWORD sharing,
{
{
TRACE
(
"opening device '%s'
\n
"
,
filename
);
TRACE
(
"opening device '%s'
\n
"
,
filename
);
if
(
!
(
ret
=
DOSFS_OpenDevice
(
filename
,
access
)))
if
(
!
(
ret
=
DOSFS_OpenDevice
(
filename
,
access
,
attributes
)))
{
{
/* Do not silence this please. It is a critical error. -MM */
/* Do not silence this please. It is a critical error. -MM */
ERR
(
"Couldn't open device '%s'!
\n
"
,
filename
);
ERR
(
"Couldn't open device '%s'!
\n
"
,
filename
);
...
...
include/file.h
View file @
568c67e1
...
@@ -98,7 +98,7 @@ extern time_t DOSFS_FileTimeToUnixTime( const FILETIME *ft, DWORD *remainder );
...
@@ -98,7 +98,7 @@ extern time_t DOSFS_FileTimeToUnixTime( const FILETIME *ft, DWORD *remainder );
extern
BOOL
DOSFS_ToDosFCBFormat
(
LPCSTR
name
,
LPSTR
buffer
);
extern
BOOL
DOSFS_ToDosFCBFormat
(
LPCSTR
name
,
LPSTR
buffer
);
extern
const
DOS_DEVICE
*
DOSFS_GetDevice
(
const
char
*
name
);
extern
const
DOS_DEVICE
*
DOSFS_GetDevice
(
const
char
*
name
);
extern
const
DOS_DEVICE
*
DOSFS_GetDeviceByHandle
(
HFILE
hFile
);
extern
const
DOS_DEVICE
*
DOSFS_GetDeviceByHandle
(
HFILE
hFile
);
extern
HANDLE
DOSFS_OpenDevice
(
const
char
*
name
,
DWORD
access
);
extern
HANDLE
DOSFS_OpenDevice
(
const
char
*
name
,
DWORD
access
,
DWORD
attributes
);
extern
BOOL
DOSFS_FindUnixName
(
LPCSTR
path
,
LPCSTR
name
,
LPSTR
long_buf
,
extern
BOOL
DOSFS_FindUnixName
(
LPCSTR
path
,
LPCSTR
name
,
LPSTR
long_buf
,
INT
long_len
,
LPSTR
short_buf
,
INT
long_len
,
LPSTR
short_buf
,
BOOL
ignore_case
);
BOOL
ignore_case
);
...
...
include/wine/server_protocol.h
View file @
568c67e1
...
@@ -576,6 +576,7 @@ struct get_handle_fd_request
...
@@ -576,6 +576,7 @@ struct get_handle_fd_request
#define FD_TYPE_DEFAULT 1
#define FD_TYPE_DEFAULT 1
#define FD_TYPE_CONSOLE 2
#define FD_TYPE_CONSOLE 2
#define FD_TYPE_OVERLAPPED 3
#define FD_TYPE_OVERLAPPED 3
#define FD_TYPE_TIMEOUT 4
...
@@ -1454,6 +1455,7 @@ struct create_serial_request
...
@@ -1454,6 +1455,7 @@ struct create_serial_request
struct
request_header
__header
;
struct
request_header
__header
;
unsigned
int
access
;
unsigned
int
access
;
int
inherit
;
int
inherit
;
unsigned
int
attributes
;
unsigned
int
sharing
;
unsigned
int
sharing
;
/* VARARG(name,string); */
/* VARARG(name,string); */
handle_t
handle
;
handle_t
handle
;
...
@@ -1917,6 +1919,6 @@ union generic_request
...
@@ -1917,6 +1919,6 @@ union generic_request
struct
get_window_tree_request
get_window_tree
;
struct
get_window_tree_request
get_window_tree
;
};
};
#define SERVER_PROTOCOL_VERSION 5
4
#define SERVER_PROTOCOL_VERSION 5
5
#endif
/* __WINE_WINE_SERVER_PROTOCOL_H */
#endif
/* __WINE_WINE_SERVER_PROTOCOL_H */
server/protocol.def
View file @
568c67e1
...
@@ -532,6 +532,7 @@ enum event_op { PULSE_EVENT, SET_EVENT, RESET_EVENT };
...
@@ -532,6 +532,7 @@ enum event_op { PULSE_EVENT, SET_EVENT, RESET_EVENT };
#define FD_TYPE_DEFAULT 1
#define FD_TYPE_DEFAULT 1
#define FD_TYPE_CONSOLE 2
#define FD_TYPE_CONSOLE 2
#define FD_TYPE_OVERLAPPED 3
#define FD_TYPE_OVERLAPPED 3
#define FD_TYPE_TIMEOUT 4
/* Set a file current position */
/* Set a file current position */
...
@@ -1299,6 +1300,7 @@ enum message_type
...
@@ -1299,6 +1300,7 @@ enum message_type
@REQ(create_serial)
@REQ(create_serial)
unsigned int access; /* wanted access rights */
unsigned int access; /* wanted access rights */
int inherit; /* inherit flag */
int inherit; /* inherit flag */
unsigned int attributes; /* eg. FILE_FLAG_OVERLAPPED */
unsigned int sharing; /* sharing flags */
unsigned int sharing; /* sharing flags */
VARARG(name,string); /* file name */
VARARG(name,string); /* file name */
@REPLY
@REPLY
...
...
server/serial.c
View file @
568c67e1
...
@@ -44,6 +44,7 @@ struct serial
...
@@ -44,6 +44,7 @@ struct serial
{
{
struct
object
obj
;
struct
object
obj
;
unsigned
int
access
;
unsigned
int
access
;
unsigned
int
attrib
;
/* timeout values */
/* timeout values */
unsigned
int
readinterval
;
unsigned
int
readinterval
;
...
@@ -78,7 +79,7 @@ static const struct object_ops serial_ops =
...
@@ -78,7 +79,7 @@ static const struct object_ops serial_ops =
/* SERIAL PORT functions */
/* SERIAL PORT functions */
static
struct
serial
*
create_serial
(
const
char
*
nameptr
,
size_t
len
,
unsigned
int
access
)
static
struct
serial
*
create_serial
(
const
char
*
nameptr
,
size_t
len
,
unsigned
int
access
,
int
attributes
)
{
{
struct
serial
*
serial
;
struct
serial
*
serial
;
struct
termios
tios
;
struct
termios
tios
;
...
@@ -115,8 +116,14 @@ static struct serial *create_serial( const char *nameptr, size_t len, unsigned i
...
@@ -115,8 +116,14 @@ static struct serial *create_serial( const char *nameptr, size_t len, unsigned i
return
NULL
;
return
NULL
;
}
}
/* set the fd back to blocking if necessary */
if
(
!
(
attributes
&
FILE_FLAG_OVERLAPPED
)
)
if
(
0
>
fcntl
(
fd
,
F_SETFL
,
0
))
perror
(
"fcntl"
);
if
((
serial
=
alloc_object
(
&
serial_ops
,
fd
)))
if
((
serial
=
alloc_object
(
&
serial_ops
,
fd
)))
{
{
serial
->
attrib
=
attributes
;
serial
->
access
=
access
;
serial
->
access
=
access
;
serial
->
readinterval
=
0
;
serial
->
readinterval
=
0
;
serial
->
readmult
=
0
;
serial
->
readmult
=
0
;
...
@@ -160,6 +167,9 @@ static int serial_get_fd( struct object *obj )
...
@@ -160,6 +167,9 @@ static int serial_get_fd( struct object *obj )
static
int
serial_get_info
(
struct
object
*
obj
,
struct
get_file_info_request
*
req
)
static
int
serial_get_info
(
struct
object
*
obj
,
struct
get_file_info_request
*
req
)
{
{
struct
serial
*
serial
=
(
struct
serial
*
)
obj
;
assert
(
obj
->
ops
==
&
serial_ops
);
if
(
req
)
if
(
req
)
{
{
req
->
type
=
FILE_TYPE_CHAR
;
req
->
type
=
FILE_TYPE_CHAR
;
...
@@ -173,7 +183,11 @@ static int serial_get_info( struct object *obj, struct get_file_info_request *re
...
@@ -173,7 +183,11 @@ static int serial_get_info( struct object *obj, struct get_file_info_request *re
req
->
index_low
=
0
;
req
->
index_low
=
0
;
req
->
serial
=
0
;
req
->
serial
=
0
;
}
}
return
FD_TYPE_DEFAULT
;
if
(
serial
->
attrib
&
FILE_FLAG_OVERLAPPED
)
return
FD_TYPE_OVERLAPPED
;
return
FD_TYPE_TIMEOUT
;
}
}
/* these function calculates the timeout for an async operation
/* these function calculates the timeout for an async operation
...
@@ -202,7 +216,7 @@ DECL_HANDLER(create_serial)
...
@@ -202,7 +216,7 @@ DECL_HANDLER(create_serial)
struct
serial
*
serial
;
struct
serial
*
serial
;
req
->
handle
=
0
;
req
->
handle
=
0
;
if
((
serial
=
create_serial
(
get_req_data
(
req
),
get_req_data_size
(
req
),
req
->
access
)))
if
((
serial
=
create_serial
(
get_req_data
(
req
),
get_req_data_size
(
req
),
req
->
access
,
req
->
attributes
)))
{
{
req
->
handle
=
alloc_handle
(
current
->
process
,
serial
,
req
->
access
,
req
->
inherit
);
req
->
handle
=
alloc_handle
(
current
->
process
,
serial
,
req
->
access
,
req
->
inherit
);
release_object
(
serial
);
release_object
(
serial
);
...
...
server/trace.c
View file @
568c67e1
...
@@ -1556,6 +1556,7 @@ static void dump_create_serial_request( const struct create_serial_request *req
...
@@ -1556,6 +1556,7 @@ static void dump_create_serial_request( const struct create_serial_request *req
{
{
fprintf
(
stderr
,
" access=%08x,"
,
req
->
access
);
fprintf
(
stderr
,
" access=%08x,"
,
req
->
access
);
fprintf
(
stderr
,
" inherit=%d,"
,
req
->
inherit
);
fprintf
(
stderr
,
" inherit=%d,"
,
req
->
inherit
);
fprintf
(
stderr
,
" attributes=%08x,"
,
req
->
attributes
);
fprintf
(
stderr
,
" sharing=%08x,"
,
req
->
sharing
);
fprintf
(
stderr
,
" sharing=%08x,"
,
req
->
sharing
);
fprintf
(
stderr
,
" name="
);
fprintf
(
stderr
,
" name="
);
cur_pos
+=
dump_varargs_string
(
req
);
cur_pos
+=
dump_varargs_string
(
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