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
ff58be5c
Commit
ff58be5c
authored
Oct 04, 2001
by
Mike McCormack
Committed by
Alexandre Julliard
Oct 04, 2001
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fetch a handle type in FILE_GetUnixHandle.
parent
840434ac
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
130 additions
and
78 deletions
+130
-78
file.c
files/file.c
+17
-3
server_protocol.h
include/wine/server_protocol.h
+6
-1
console.c
server/console.c
+14
-11
device.c
server/device.c
+15
-11
file.c
server/file.c
+30
-26
mapping.c
server/mapping.c
+12
-1
object.c
server/object.c
+1
-1
pipe.c
server/pipe.c
+14
-11
protocol.def
server/protocol.def
+5
-0
serial.c
server/serial.c
+14
-12
trace.c
server/trace.c
+2
-1
No files found.
files/file.c
View file @
ff58be5c
...
@@ -201,12 +201,12 @@ HANDLE FILE_DupUnixHandle( int fd, DWORD access )
...
@@ -201,12 +201,12 @@ HANDLE FILE_DupUnixHandle( int fd, DWORD access )
/***********************************************************************
/***********************************************************************
* FILE_GetUnixHandle
* FILE_GetUnixHandle
Type
*
*
* Retrieve the Unix handle corresponding to a file handle.
* Retrieve the Unix handle corresponding to a file handle.
* Returns -1 on failure.
* Returns -1 on failure.
*/
*/
int
FILE_GetUnixHandle
(
HANDLE
handle
,
DWORD
access
)
int
FILE_GetUnixHandle
Type
(
HANDLE
handle
,
DWORD
access
,
DWORD
*
type
)
{
{
int
ret
,
fd
=
-
1
;
int
ret
,
fd
=
-
1
;
...
@@ -216,7 +216,11 @@ int FILE_GetUnixHandle( HANDLE handle, DWORD access )
...
@@ -216,7 +216,11 @@ int FILE_GetUnixHandle( HANDLE handle, DWORD access )
{
{
req
->
handle
=
handle
;
req
->
handle
=
handle
;
req
->
access
=
access
;
req
->
access
=
access
;
if
(
!
(
ret
=
SERVER_CALL_ERR
()))
fd
=
req
->
fd
;
if
(
!
(
ret
=
SERVER_CALL_ERR
()))
{
fd
=
req
->
fd
;
if
(
type
)
*
type
=
req
->
type
;
}
}
}
SERVER_END_REQ
;
SERVER_END_REQ
;
if
(
ret
)
return
-
1
;
if
(
ret
)
return
-
1
;
...
@@ -234,6 +238,16 @@ int FILE_GetUnixHandle( HANDLE handle, DWORD access )
...
@@ -234,6 +238,16 @@ int FILE_GetUnixHandle( HANDLE handle, DWORD access )
return
fd
;
return
fd
;
}
}
/***********************************************************************
* FILE_GetUnixHandle
*
* Retrieve the Unix handle corresponding to a file handle.
* Returns -1 on failure.
*/
int
FILE_GetUnixHandle
(
HANDLE
handle
,
DWORD
access
)
{
return
FILE_GetUnixHandleType
(
handle
,
access
,
NULL
);
}
/*************************************************************************
/*************************************************************************
* FILE_OpenConsole
* FILE_OpenConsole
...
...
include/wine/server_protocol.h
View file @
ff58be5c
...
@@ -570,7 +570,12 @@ struct get_handle_fd_request
...
@@ -570,7 +570,12 @@ struct get_handle_fd_request
handle_t
handle
;
handle_t
handle
;
unsigned
int
access
;
unsigned
int
access
;
int
fd
;
int
fd
;
int
type
;
};
};
#define FD_TYPE_INVALID 0
#define FD_TYPE_DEFAULT 1
#define FD_TYPE_CONSOLE 2
#define FD_TYPE_OVERLAPPED 3
...
@@ -1912,6 +1917,6 @@ union generic_request
...
@@ -1912,6 +1917,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
3
#define SERVER_PROTOCOL_VERSION 5
4
#endif
/* __WINE_WINE_SERVER_PROTOCOL_H */
#endif
/* __WINE_WINE_SERVER_PROTOCOL_H */
server/console.c
View file @
ff58be5c
...
@@ -355,17 +355,20 @@ static int console_input_get_fd( struct object *obj )
...
@@ -355,17 +355,20 @@ static int console_input_get_fd( struct object *obj )
static
int
console_get_info
(
struct
object
*
obj
,
struct
get_file_info_request
*
req
)
static
int
console_get_info
(
struct
object
*
obj
,
struct
get_file_info_request
*
req
)
{
{
req
->
type
=
FILE_TYPE_CHAR
;
if
(
req
)
req
->
attr
=
0
;
{
req
->
access_time
=
0
;
req
->
type
=
FILE_TYPE_CHAR
;
req
->
write_time
=
0
;
req
->
attr
=
0
;
req
->
size_high
=
0
;
req
->
access_time
=
0
;
req
->
size_low
=
0
;
req
->
write_time
=
0
;
req
->
links
=
0
;
req
->
size_high
=
0
;
req
->
index_high
=
0
;
req
->
size_low
=
0
;
req
->
index_low
=
0
;
req
->
links
=
0
;
req
->
serial
=
0
;
req
->
index_high
=
0
;
return
1
;
req
->
index_low
=
0
;
req
->
serial
=
0
;
}
return
FD_TYPE_CONSOLE
;
}
}
static
void
console_input_destroy
(
struct
object
*
obj
)
static
void
console_input_destroy
(
struct
object
*
obj
)
...
...
server/device.c
View file @
ff58be5c
...
@@ -68,17 +68,21 @@ static int device_get_info( struct object *obj, struct get_file_info_request *re
...
@@ -68,17 +68,21 @@ static int device_get_info( struct object *obj, struct get_file_info_request *re
{
{
struct
device
*
dev
=
(
struct
device
*
)
obj
;
struct
device
*
dev
=
(
struct
device
*
)
obj
;
assert
(
obj
->
ops
==
&
device_ops
);
assert
(
obj
->
ops
==
&
device_ops
);
req
->
type
=
FILE_TYPE_UNKNOWN
;
req
->
attr
=
dev
->
id
;
/* hack! */
if
(
req
)
req
->
access_time
=
0
;
{
req
->
write_time
=
0
;
req
->
type
=
FILE_TYPE_UNKNOWN
;
req
->
size_high
=
0
;
req
->
attr
=
dev
->
id
;
/* hack! */
req
->
size_low
=
0
;
req
->
access_time
=
0
;
req
->
links
=
0
;
req
->
write_time
=
0
;
req
->
index_high
=
0
;
req
->
size_high
=
0
;
req
->
index_low
=
0
;
req
->
size_low
=
0
;
req
->
serial
=
0
;
req
->
links
=
0
;
return
1
;
req
->
index_high
=
0
;
req
->
index_low
=
0
;
req
->
serial
=
0
;
}
return
FD_TYPE_DEFAULT
;
}
}
/* create a device */
/* create a device */
...
...
server/file.c
View file @
ff58be5c
...
@@ -268,34 +268,37 @@ static int file_get_info( struct object *obj, struct get_file_info_request *req
...
@@ -268,34 +268,37 @@ static int file_get_info( struct object *obj, struct get_file_info_request *req
struct
file
*
file
=
(
struct
file
*
)
obj
;
struct
file
*
file
=
(
struct
file
*
)
obj
;
assert
(
obj
->
ops
==
&
file_ops
);
assert
(
obj
->
ops
==
&
file_ops
);
if
(
fstat
(
file
->
obj
.
fd
,
&
st
)
==
-
1
)
if
(
req
)
{
{
file_set_error
();
if
(
fstat
(
file
->
obj
.
fd
,
&
st
)
==
-
1
)
return
0
;
{
}
file_set_error
();
if
(
S_ISCHR
(
st
.
st_mode
)
||
S_ISFIFO
(
st
.
st_mode
)
||
return
FD_TYPE_INVALID
;
S_ISSOCK
(
st
.
st_mode
)
||
isatty
(
file
->
obj
.
fd
))
req
->
type
=
FILE_TYPE_CHAR
;
}
else
req
->
type
=
FILE_TYPE_DISK
;
if
(
S_ISCHR
(
st
.
st_mode
)
||
S_ISFIFO
(
st
.
st_mode
)
||
if
(
S_ISDIR
(
st
.
st_mode
))
req
->
attr
=
FILE_ATTRIBUTE_DIRECTORY
;
S_ISSOCK
(
st
.
st_mode
)
||
isatty
(
file
->
obj
.
fd
))
req
->
type
=
FILE_TYPE_CHAR
;
else
req
->
attr
=
FILE_ATTRIBUTE_ARCHIVE
;
else
req
->
type
=
FILE_TYPE_DISK
;
if
(
!
(
st
.
st_mode
&
S_IWUSR
))
req
->
attr
|=
FILE_ATTRIBUTE_READONLY
;
if
(
S_ISDIR
(
st
.
st_mode
))
req
->
attr
=
FILE_ATTRIBUTE_DIRECTORY
;
req
->
access_time
=
st
.
st_atime
;
else
req
->
attr
=
FILE_ATTRIBUTE_ARCHIVE
;
req
->
write_time
=
st
.
st_mtime
;
if
(
!
(
st
.
st_mode
&
S_IWUSR
))
req
->
attr
|=
FILE_ATTRIBUTE_READONLY
;
if
(
S_ISDIR
(
st
.
st_mode
))
req
->
access_time
=
st
.
st_atime
;
{
req
->
write_time
=
st
.
st_mtime
;
req
->
size_high
=
0
;
if
(
S_ISDIR
(
st
.
st_mode
))
req
->
size_low
=
0
;
{
}
req
->
size_high
=
0
;
else
req
->
size_low
=
0
;
{
}
req
->
size_high
=
st
.
st_size
>>
32
;
else
req
->
size_low
=
st
.
st_size
&
0xffffffff
;
{
req
->
size_high
=
st
.
st_size
>>
32
;
req
->
size_low
=
st
.
st_size
&
0xffffffff
;
}
req
->
links
=
st
.
st_nlink
;
req
->
index_high
=
st
.
st_dev
;
req
->
index_low
=
st
.
st_ino
;
req
->
serial
=
0
;
/* FIXME */
}
}
req
->
links
=
st
.
st_nlink
;
return
FD_TYPE_DEFAULT
;
req
->
index_high
=
st
.
st_dev
;
req
->
index_low
=
st
.
st_ino
;
req
->
serial
=
0
;
/* FIXME */
return
1
;
}
}
static
void
file_destroy
(
struct
object
*
obj
)
static
void
file_destroy
(
struct
object
*
obj
)
...
@@ -501,6 +504,7 @@ DECL_HANDLER(get_handle_fd)
...
@@ -501,6 +504,7 @@ DECL_HANDLER(get_handle_fd)
if
((
fd
=
obj
->
ops
->
get_fd
(
obj
))
!=
-
1
)
if
((
fd
=
obj
->
ops
->
get_fd
(
obj
))
!=
-
1
)
send_client_fd
(
current
->
process
,
fd
,
req
->
handle
);
send_client_fd
(
current
->
process
,
fd
,
req
->
handle
);
}
}
req
->
type
=
obj
->
ops
->
get_file_info
(
obj
,
NULL
);
release_object
(
obj
);
release_object
(
obj
);
}
}
}
}
...
...
server/mapping.c
View file @
ff58be5c
...
@@ -33,6 +33,7 @@ struct mapping
...
@@ -33,6 +33,7 @@ struct mapping
};
};
static
int
mapping_get_fd
(
struct
object
*
obj
);
static
int
mapping_get_fd
(
struct
object
*
obj
);
static
int
mapping_get_info
(
struct
object
*
obj
,
struct
get_file_info_request
*
req
);
static
void
mapping_dump
(
struct
object
*
obj
,
int
verbose
);
static
void
mapping_dump
(
struct
object
*
obj
,
int
verbose
);
static
void
mapping_destroy
(
struct
object
*
obj
);
static
void
mapping_destroy
(
struct
object
*
obj
);
...
@@ -48,7 +49,7 @@ static const struct object_ops mapping_ops =
...
@@ -48,7 +49,7 @@ static const struct object_ops mapping_ops =
NULL
,
/* poll_event */
NULL
,
/* poll_event */
mapping_get_fd
,
/* get_fd */
mapping_get_fd
,
/* get_fd */
no_flush
,
/* flush */
no_flush
,
/* flush */
no_get_file
_info
,
/* get_file_info */
mapping_get
_info
,
/* get_file_info */
mapping_destroy
/* destroy */
mapping_destroy
/* destroy */
};
};
...
@@ -309,6 +310,16 @@ static int mapping_get_fd( struct object *obj )
...
@@ -309,6 +310,16 @@ static int mapping_get_fd( struct object *obj )
return
get_mmap_fd
(
mapping
->
file
);
return
get_mmap_fd
(
mapping
->
file
);
}
}
static
int
mapping_get_info
(
struct
object
*
obj
,
struct
get_file_info_request
*
req
)
{
struct
mapping
*
mapping
=
(
struct
mapping
*
)
obj
;
struct
object
*
file
=
(
struct
object
*
)
mapping
->
file
;
assert
(
obj
->
ops
==
&
mapping_ops
);
assert
(
file
);
return
file
->
ops
->
get_file_info
(
file
,
req
);
}
static
void
mapping_destroy
(
struct
object
*
obj
)
static
void
mapping_destroy
(
struct
object
*
obj
)
{
{
struct
mapping
*
mapping
=
(
struct
mapping
*
)
obj
;
struct
mapping
*
mapping
=
(
struct
mapping
*
)
obj
;
...
...
server/object.c
View file @
ff58be5c
...
@@ -266,7 +266,7 @@ int no_flush( struct object *obj )
...
@@ -266,7 +266,7 @@ int no_flush( struct object *obj )
int
no_get_file_info
(
struct
object
*
obj
,
struct
get_file_info_request
*
info
)
int
no_get_file_info
(
struct
object
*
obj
,
struct
get_file_info_request
*
info
)
{
{
set_error
(
STATUS_OBJECT_TYPE_MISMATCH
);
set_error
(
STATUS_OBJECT_TYPE_MISMATCH
);
return
0
;
return
FD_TYPE_INVALID
;
}
}
void
no_destroy
(
struct
object
*
obj
)
void
no_destroy
(
struct
object
*
obj
)
...
...
server/pipe.c
View file @
ff58be5c
...
@@ -126,17 +126,20 @@ static int pipe_get_fd( struct object *obj )
...
@@ -126,17 +126,20 @@ static int pipe_get_fd( struct object *obj )
static
int
pipe_get_info
(
struct
object
*
obj
,
struct
get_file_info_request
*
req
)
static
int
pipe_get_info
(
struct
object
*
obj
,
struct
get_file_info_request
*
req
)
{
{
req
->
type
=
FILE_TYPE_PIPE
;
if
(
req
)
req
->
attr
=
0
;
{
req
->
access_time
=
0
;
req
->
type
=
FILE_TYPE_PIPE
;
req
->
write_time
=
0
;
req
->
attr
=
0
;
req
->
size_high
=
0
;
req
->
access_time
=
0
;
req
->
size_low
=
0
;
req
->
write_time
=
0
;
req
->
links
=
0
;
req
->
size_high
=
0
;
req
->
index_high
=
0
;
req
->
size_low
=
0
;
req
->
index_low
=
0
;
req
->
links
=
0
;
req
->
serial
=
0
;
req
->
index_high
=
0
;
return
1
;
req
->
index_low
=
0
;
req
->
serial
=
0
;
}
return
FD_TYPE_DEFAULT
;
}
}
static
void
pipe_destroy
(
struct
object
*
obj
)
static
void
pipe_destroy
(
struct
object
*
obj
)
...
...
server/protocol.def
View file @
ff58be5c
...
@@ -526,7 +526,12 @@ enum event_op { PULSE_EVENT, SET_EVENT, RESET_EVENT };
...
@@ -526,7 +526,12 @@ enum event_op { PULSE_EVENT, SET_EVENT, RESET_EVENT };
unsigned int access; /* wanted access rights */
unsigned int access; /* wanted access rights */
@REPLY
@REPLY
int fd; /* file descriptor */
int fd; /* file descriptor */
int type; /* the type of file */
@END
@END
#define FD_TYPE_INVALID 0
#define FD_TYPE_DEFAULT 1
#define FD_TYPE_CONSOLE 2
#define FD_TYPE_OVERLAPPED 3
/* Set a file current position */
/* Set a file current position */
...
...
server/serial.c
View file @
ff58be5c
...
@@ -160,18 +160,20 @@ static int serial_get_fd( struct object *obj )
...
@@ -160,18 +160,20 @@ 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
)
{
{
assert
(
obj
->
ops
==
&
serial_ops
);
if
(
req
)
req
->
type
=
FILE_TYPE_CHAR
;
{
req
->
attr
=
0
;
req
->
type
=
FILE_TYPE_CHAR
;
req
->
access_time
=
0
;
req
->
attr
=
0
;
req
->
write_time
=
0
;
req
->
access_time
=
0
;
req
->
size_high
=
0
;
req
->
write_time
=
0
;
req
->
size_low
=
0
;
req
->
size_high
=
0
;
req
->
links
=
0
;
req
->
size_low
=
0
;
req
->
index_high
=
0
;
req
->
links
=
0
;
req
->
index_low
=
0
;
req
->
index_high
=
0
;
req
->
serial
=
0
;
req
->
index_low
=
0
;
return
1
;
req
->
serial
=
0
;
}
return
FD_TYPE_DEFAULT
;
}
}
/* these function calculates the timeout for an async operation
/* these function calculates the timeout for an async operation
...
...
server/trace.c
View file @
ff58be5c
...
@@ -713,7 +713,8 @@ static void dump_get_handle_fd_request( const struct get_handle_fd_request *req
...
@@ -713,7 +713,8 @@ static void dump_get_handle_fd_request( const struct get_handle_fd_request *req
static
void
dump_get_handle_fd_reply
(
const
struct
get_handle_fd_request
*
req
)
static
void
dump_get_handle_fd_reply
(
const
struct
get_handle_fd_request
*
req
)
{
{
fprintf
(
stderr
,
" fd=%d"
,
req
->
fd
);
fprintf
(
stderr
,
" fd=%d,"
,
req
->
fd
);
fprintf
(
stderr
,
" type=%d"
,
req
->
type
);
}
}
static
void
dump_set_file_pointer_request
(
const
struct
set_file_pointer_request
*
req
)
static
void
dump_set_file_pointer_request
(
const
struct
set_file_pointer_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