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
37957093
Commit
37957093
authored
Jun 10, 2005
by
Robert Shearman
Committed by
Alexandre Julliard
Jun 10, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change code style of form "if( x )" to "if (x)" for consistency.
parent
2a198838
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
70 additions
and
70 deletions
+70
-70
change.c
server/change.c
+8
-8
fd.c
server/fd.c
+2
-2
mailslot.c
server/mailslot.c
+16
-16
named_pipe.c
server/named_pipe.c
+36
-36
registry.c
server/registry.c
+6
-6
thread.c
server/thread.c
+1
-1
token.c
server/token.c
+1
-1
No files found.
server/change.c
View file @
37957093
...
@@ -87,21 +87,21 @@ static void adjust_changes( int fd, unsigned int filter )
...
@@ -87,21 +87,21 @@ static void adjust_changes( int fd, unsigned int filter )
return
;
return
;
val
=
DN_MULTISHOT
;
val
=
DN_MULTISHOT
;
if
(
filter
&
FILE_NOTIFY_CHANGE_FILE_NAME
)
if
(
filter
&
FILE_NOTIFY_CHANGE_FILE_NAME
)
val
|=
DN_RENAME
|
DN_DELETE
|
DN_CREATE
;
val
|=
DN_RENAME
|
DN_DELETE
|
DN_CREATE
;
if
(
filter
&
FILE_NOTIFY_CHANGE_DIR_NAME
)
if
(
filter
&
FILE_NOTIFY_CHANGE_DIR_NAME
)
val
|=
DN_RENAME
|
DN_DELETE
|
DN_CREATE
;
val
|=
DN_RENAME
|
DN_DELETE
|
DN_CREATE
;
if
(
filter
&
FILE_NOTIFY_CHANGE_ATTRIBUTES
)
if
(
filter
&
FILE_NOTIFY_CHANGE_ATTRIBUTES
)
val
|=
DN_ATTRIB
;
val
|=
DN_ATTRIB
;
if
(
filter
&
FILE_NOTIFY_CHANGE_SIZE
)
if
(
filter
&
FILE_NOTIFY_CHANGE_SIZE
)
val
|=
DN_MODIFY
;
val
|=
DN_MODIFY
;
if
(
filter
&
FILE_NOTIFY_CHANGE_LAST_WRITE
)
if
(
filter
&
FILE_NOTIFY_CHANGE_LAST_WRITE
)
val
|=
DN_MODIFY
;
val
|=
DN_MODIFY
;
if
(
filter
&
FILE_NOTIFY_CHANGE_LAST_ACCESS
)
if
(
filter
&
FILE_NOTIFY_CHANGE_LAST_ACCESS
)
val
|=
DN_ACCESS
;
val
|=
DN_ACCESS
;
if
(
filter
&
FILE_NOTIFY_CHANGE_CREATION
)
if
(
filter
&
FILE_NOTIFY_CHANGE_CREATION
)
val
|=
DN_CREATE
;
val
|=
DN_CREATE
;
if
(
filter
&
FILE_NOTIFY_CHANGE_SECURITY
)
if
(
filter
&
FILE_NOTIFY_CHANGE_SECURITY
)
val
|=
DN_ATTRIB
;
val
|=
DN_ATTRIB
;
fcntl
(
fd
,
F_NOTIFY
,
val
);
fcntl
(
fd
,
F_NOTIFY
,
val
);
#endif
#endif
...
...
server/fd.c
View file @
37957093
...
@@ -1384,9 +1384,9 @@ int default_fd_get_poll_events( struct fd *fd )
...
@@ -1384,9 +1384,9 @@ int default_fd_get_poll_events( struct fd *fd )
{
{
int
events
=
0
;
int
events
=
0
;
if
(
!
list_empty
(
&
fd
->
read_q
))
if
(
!
list_empty
(
&
fd
->
read_q
))
events
|=
POLLIN
;
events
|=
POLLIN
;
if
(
!
list_empty
(
&
fd
->
write_q
))
if
(
!
list_empty
(
&
fd
->
write_q
))
events
|=
POLLOUT
;
events
|=
POLLOUT
;
return
events
;
return
events
;
...
...
server/mailslot.c
View file @
37957093
...
@@ -198,7 +198,7 @@ static int mailslot_get_poll_events( struct fd *fd )
...
@@ -198,7 +198,7 @@ static int mailslot_get_poll_events( struct fd *fd )
int
events
=
0
;
int
events
=
0
;
assert
(
mailslot
->
obj
.
ops
==
&
mailslot_ops
);
assert
(
mailslot
->
obj
.
ops
==
&
mailslot_ops
);
if
(
!
list_empty
(
&
mailslot
->
read_q
))
if
(
!
list_empty
(
&
mailslot
->
read_q
))
events
|=
POLLIN
;
events
|=
POLLIN
;
return
events
;
return
events
;
...
@@ -208,7 +208,7 @@ static void mailslot_poll_event( struct fd *fd, int event )
...
@@ -208,7 +208,7 @@ static void mailslot_poll_event( struct fd *fd, int event )
{
{
struct
mailslot
*
mailslot
=
get_fd_user
(
fd
);
struct
mailslot
*
mailslot
=
get_fd_user
(
fd
);
if
(
!
list_empty
(
&
mailslot
->
read_q
)
&&
(
POLLIN
&
event
)
)
if
(
!
list_empty
(
&
mailslot
->
read_q
)
&&
(
POLLIN
&
event
)
)
async_terminate_head
(
&
mailslot
->
read_q
,
STATUS_ALERTED
);
async_terminate_head
(
&
mailslot
->
read_q
,
STATUS_ALERTED
);
set_fd_events
(
fd
,
mailslot_get_poll_events
(
fd
)
);
set_fd_events
(
fd
,
mailslot_get_poll_events
(
fd
)
);
...
@@ -222,13 +222,13 @@ static void mailslot_queue_async( struct fd *fd, void *apc, void *user,
...
@@ -222,13 +222,13 @@ static void mailslot_queue_async( struct fd *fd, void *apc, void *user,
assert
(
mailslot
->
obj
.
ops
==
&
mailslot_ops
);
assert
(
mailslot
->
obj
.
ops
==
&
mailslot_ops
);
if
(
type
!=
ASYNC_TYPE_READ
)
if
(
type
!=
ASYNC_TYPE_READ
)
{
{
set_error
(
STATUS_INVALID_PARAMETER
);
set_error
(
STATUS_INVALID_PARAMETER
);
return
;
return
;
}
}
if
(
list_empty
(
&
mailslot
->
writers
)
||
if
(
list_empty
(
&
mailslot
->
writers
)
||
!
mailslot_message_count
(
mailslot
))
!
mailslot_message_count
(
mailslot
))
{
{
set_error
(
STATUS_IO_TIMEOUT
);
set_error
(
STATUS_IO_TIMEOUT
);
...
@@ -267,18 +267,18 @@ static struct mailslot *create_mailslot( const WCHAR *name, size_t len, int max_
...
@@ -267,18 +267,18 @@ static struct mailslot *create_mailslot( const WCHAR *name, size_t len, int max_
int
fds
[
2
];
int
fds
[
2
];
static
const
WCHAR
slot
[]
=
{
'm'
,
'a'
,
'i'
,
'l'
,
's'
,
'l'
,
'o'
,
't'
,
'\\'
,
0
};
static
const
WCHAR
slot
[]
=
{
'm'
,
'a'
,
'i'
,
'l'
,
's'
,
'l'
,
'o'
,
't'
,
'\\'
,
0
};
if
(
(
len
<=
strlenW
(
slot
)
)
||
strncmpiW
(
slot
,
name
,
strlenW
(
slot
)
)
)
if
((
len
<=
strlenW
(
slot
))
||
strncmpiW
(
slot
,
name
,
strlenW
(
slot
)
)
)
{
{
set_error
(
STATUS_OBJECT_NAME_INVALID
);
set_error
(
STATUS_OBJECT_NAME_INVALID
);
return
NULL
;
return
NULL
;
}
}
mailslot
=
create_named_object
(
sync_namespace
,
&
mailslot_ops
,
name
,
len
);
mailslot
=
create_named_object
(
sync_namespace
,
&
mailslot_ops
,
name
,
len
);
if
(
!
mailslot
)
if
(
!
mailslot
)
return
NULL
;
return
NULL
;
/* it already exists - there can only be one mailslot to read from */
/* it already exists - there can only be one mailslot to read from */
if
(
get_error
()
==
STATUS_OBJECT_NAME_COLLISION
)
if
(
get_error
()
==
STATUS_OBJECT_NAME_COLLISION
)
{
{
release_object
(
mailslot
);
release_object
(
mailslot
);
return
NULL
;
return
NULL
;
...
@@ -291,7 +291,7 @@ static struct mailslot *create_mailslot( const WCHAR *name, size_t len, int max_
...
@@ -291,7 +291,7 @@ static struct mailslot *create_mailslot( const WCHAR *name, size_t len, int max_
list_init
(
&
mailslot
->
writers
);
list_init
(
&
mailslot
->
writers
);
list_init
(
&
mailslot
->
read_q
);
list_init
(
&
mailslot
->
read_q
);
if
(
!
socketpair
(
PF_UNIX
,
SOCK_DGRAM
,
0
,
fds
)
)
if
(
!
socketpair
(
PF_UNIX
,
SOCK_DGRAM
,
0
,
fds
)
)
{
{
fcntl
(
fds
[
0
],
F_SETFL
,
O_NONBLOCK
);
fcntl
(
fds
[
0
],
F_SETFL
,
O_NONBLOCK
);
fcntl
(
fds
[
1
],
F_SETFL
,
O_NONBLOCK
);
fcntl
(
fds
[
1
],
F_SETFL
,
O_NONBLOCK
);
...
@@ -299,7 +299,7 @@ static struct mailslot *create_mailslot( const WCHAR *name, size_t len, int max_
...
@@ -299,7 +299,7 @@ static struct mailslot *create_mailslot( const WCHAR *name, size_t len, int max_
fds
[
1
],
&
mailslot
->
obj
);
fds
[
1
],
&
mailslot
->
obj
);
mailslot
->
write_fd
=
create_anonymous_fd
(
&
mail_writer_fd_ops
,
mailslot
->
write_fd
=
create_anonymous_fd
(
&
mail_writer_fd_ops
,
fds
[
0
],
&
mailslot
->
obj
);
fds
[
0
],
&
mailslot
->
obj
);
if
(
mailslot
->
fd
&&
mailslot
->
write_fd
)
return
mailslot
;
if
(
mailslot
->
fd
&&
mailslot
->
write_fd
)
return
mailslot
;
}
}
else
file_set_error
();
else
file_set_error
();
...
@@ -402,7 +402,7 @@ DECL_HANDLER(create_mailslot)
...
@@ -402,7 +402,7 @@ DECL_HANDLER(create_mailslot)
reply
->
handle
=
0
;
reply
->
handle
=
0
;
mailslot
=
create_mailslot
(
get_req_data
(),
get_req_data_size
(),
mailslot
=
create_mailslot
(
get_req_data
(),
get_req_data_size
(),
req
->
max_msgsize
,
req
->
read_timeout
);
req
->
max_msgsize
,
req
->
read_timeout
);
if
(
mailslot
)
if
(
mailslot
)
{
{
reply
->
handle
=
alloc_handle
(
current
->
process
,
mailslot
,
reply
->
handle
=
alloc_handle
(
current
->
process
,
mailslot
,
GENERIC_READ
,
req
->
inherit
);
GENERIC_READ
,
req
->
inherit
);
...
@@ -418,19 +418,19 @@ DECL_HANDLER(open_mailslot)
...
@@ -418,19 +418,19 @@ DECL_HANDLER(open_mailslot)
reply
->
handle
=
0
;
reply
->
handle
=
0
;
if
(
!
(
req
->
sharing
&
FILE_SHARE_READ
)
)
if
(
!
(
req
->
sharing
&
FILE_SHARE_READ
)
)
{
{
set_error
(
STATUS_SHARING_VIOLATION
);
set_error
(
STATUS_SHARING_VIOLATION
);
return
;
return
;
}
}
mailslot
=
open_mailslot
(
get_req_data
(),
get_req_data_size
()
);
mailslot
=
open_mailslot
(
get_req_data
(),
get_req_data_size
()
);
if
(
mailslot
)
if
(
mailslot
)
{
{
struct
mail_writer
*
writer
;
struct
mail_writer
*
writer
;
writer
=
create_mail_writer
(
mailslot
,
req
->
access
,
req
->
sharing
);
writer
=
create_mail_writer
(
mailslot
,
req
->
access
,
req
->
sharing
);
if
(
writer
)
if
(
writer
)
{
{
reply
->
handle
=
alloc_handle
(
current
->
process
,
writer
,
reply
->
handle
=
alloc_handle
(
current
->
process
,
writer
,
req
->
access
,
req
->
inherit
);
req
->
access
,
req
->
inherit
);
...
@@ -448,16 +448,16 @@ DECL_HANDLER(set_mailslot_info)
...
@@ -448,16 +448,16 @@ DECL_HANDLER(set_mailslot_info)
{
{
struct
mailslot
*
mailslot
=
get_mailslot_obj
(
current
->
process
,
req
->
handle
,
0
);
struct
mailslot
*
mailslot
=
get_mailslot_obj
(
current
->
process
,
req
->
handle
,
0
);
if
(
mailslot
)
if
(
mailslot
)
{
{
if
(
req
->
flags
&
MAILSLOT_SET_READ_TIMEOUT
)
if
(
req
->
flags
&
MAILSLOT_SET_READ_TIMEOUT
)
mailslot
->
read_timeout
=
req
->
read_timeout
;
mailslot
->
read_timeout
=
req
->
read_timeout
;
reply
->
max_msgsize
=
mailslot
->
max_msgsize
;
reply
->
max_msgsize
=
mailslot
->
max_msgsize
;
reply
->
read_timeout
=
mailslot
->
read_timeout
;
reply
->
read_timeout
=
mailslot
->
read_timeout
;
reply
->
msg_count
=
mailslot_message_count
(
mailslot
);
reply
->
msg_count
=
mailslot_message_count
(
mailslot
);
/* get the size of the next message */
/* get the size of the next message */
if
(
reply
->
msg_count
)
if
(
reply
->
msg_count
)
reply
->
next_msgsize
=
mailslot_next_msg_size
(
mailslot
);
reply
->
next_msgsize
=
mailslot_next_msg_size
(
mailslot
);
else
else
reply
->
next_msgsize
=
MAILSLOT_NO_MESSAGE
;
reply
->
next_msgsize
=
MAILSLOT_NO_MESSAGE
;
...
...
server/named_pipe.c
View file @
37957093
...
@@ -213,7 +213,7 @@ static void named_pipe_destroy( struct object *obj)
...
@@ -213,7 +213,7 @@ static void named_pipe_destroy( struct object *obj)
static
struct
fd
*
pipe_client_get_fd
(
struct
object
*
obj
)
static
struct
fd
*
pipe_client_get_fd
(
struct
object
*
obj
)
{
{
struct
pipe_client
*
client
=
(
struct
pipe_client
*
)
obj
;
struct
pipe_client
*
client
=
(
struct
pipe_client
*
)
obj
;
if
(
client
->
fd
)
if
(
client
->
fd
)
return
(
struct
fd
*
)
grab_object
(
client
->
fd
);
return
(
struct
fd
*
)
grab_object
(
client
->
fd
);
set_error
(
STATUS_PIPE_DISCONNECTED
);
set_error
(
STATUS_PIPE_DISCONNECTED
);
return
NULL
;
return
NULL
;
...
@@ -246,7 +246,7 @@ static struct fd *pipe_server_get_fd( struct object *obj )
...
@@ -246,7 +246,7 @@ static struct fd *pipe_server_get_fd( struct object *obj )
static
void
notify_empty
(
struct
pipe_server
*
server
)
static
void
notify_empty
(
struct
pipe_server
*
server
)
{
{
if
(
!
server
->
flush_poll
)
if
(
!
server
->
flush_poll
)
return
;
return
;
assert
(
server
->
state
==
ps_connected_server
);
assert
(
server
->
state
==
ps_connected_server
);
assert
(
server
->
event
);
assert
(
server
->
event
);
...
@@ -260,7 +260,7 @@ static void notify_empty( struct pipe_server *server )
...
@@ -260,7 +260,7 @@ static void notify_empty( struct pipe_server *server )
static
void
do_disconnect
(
struct
pipe_server
*
server
)
static
void
do_disconnect
(
struct
pipe_server
*
server
)
{
{
/* we may only have a server fd, if the client disconnected */
/* we may only have a server fd, if the client disconnected */
if
(
server
->
client
)
if
(
server
->
client
)
{
{
assert
(
server
->
client
->
server
==
server
);
assert
(
server
->
client
->
server
==
server
);
assert
(
server
->
client
->
fd
);
assert
(
server
->
client
->
fd
);
...
@@ -278,13 +278,13 @@ static void pipe_server_destroy( struct object *obj)
...
@@ -278,13 +278,13 @@ static void pipe_server_destroy( struct object *obj)
assert
(
obj
->
ops
==
&
pipe_server_ops
);
assert
(
obj
->
ops
==
&
pipe_server_ops
);
if
(
server
->
fd
)
if
(
server
->
fd
)
{
{
notify_empty
(
server
);
notify_empty
(
server
);
do_disconnect
(
server
);
do_disconnect
(
server
);
}
}
if
(
server
->
client
)
if
(
server
->
client
)
{
{
server
->
client
->
server
=
NULL
;
server
->
client
->
server
=
NULL
;
server
->
client
=
NULL
;
server
->
client
=
NULL
;
...
@@ -306,11 +306,11 @@ static void pipe_client_destroy( struct object *obj)
...
@@ -306,11 +306,11 @@ static void pipe_client_destroy( struct object *obj)
assert
(
obj
->
ops
==
&
pipe_client_ops
);
assert
(
obj
->
ops
==
&
pipe_client_ops
);
if
(
server
)
if
(
server
)
{
{
notify_empty
(
server
);
notify_empty
(
server
);
switch
(
server
->
state
)
switch
(
server
->
state
)
{
{
case
ps_connected_server
:
case
ps_connected_server
:
/* Don't destroy the server's fd here as we can't
/* Don't destroy the server's fd here as we can't
...
@@ -343,13 +343,13 @@ static int pipe_data_remaining( struct pipe_server *server )
...
@@ -343,13 +343,13 @@ static int pipe_data_remaining( struct pipe_server *server )
assert
(
server
->
client
);
assert
(
server
->
client
);
fd
=
get_unix_fd
(
server
->
client
->
fd
);
fd
=
get_unix_fd
(
server
->
client
->
fd
);
if
(
fd
<
0
)
if
(
fd
<
0
)
return
0
;
return
0
;
pfd
.
fd
=
fd
;
pfd
.
fd
=
fd
;
pfd
.
events
=
POLLIN
;
pfd
.
events
=
POLLIN
;
pfd
.
revents
=
0
;
pfd
.
revents
=
0
;
if
(
0
>
poll
(
&
pfd
,
1
,
0
)
)
if
(
0
>
poll
(
&
pfd
,
1
,
0
)
)
return
0
;
return
0
;
return
pfd
.
revents
&
POLLIN
;
return
pfd
.
revents
&
POLLIN
;
...
@@ -360,7 +360,7 @@ static void check_flushed( void *arg )
...
@@ -360,7 +360,7 @@ static void check_flushed( void *arg )
struct
pipe_server
*
server
=
(
struct
pipe_server
*
)
arg
;
struct
pipe_server
*
server
=
(
struct
pipe_server
*
)
arg
;
assert
(
server
->
event
);
assert
(
server
->
event
);
if
(
pipe_data_remaining
(
server
)
)
if
(
pipe_data_remaining
(
server
)
)
{
{
struct
timeval
tv
;
struct
timeval
tv
;
...
@@ -382,25 +382,25 @@ static int pipe_server_flush( struct fd *fd, struct event **event )
...
@@ -382,25 +382,25 @@ static int pipe_server_flush( struct fd *fd, struct event **event )
{
{
struct
pipe_server
*
server
=
get_fd_user
(
fd
);
struct
pipe_server
*
server
=
get_fd_user
(
fd
);
if
(
!
server
)
if
(
!
server
)
return
0
;
return
0
;
if
(
server
->
state
!=
ps_connected_server
)
if
(
server
->
state
!=
ps_connected_server
)
return
0
;
return
0
;
/* FIXME: if multiple threads flush the same pipe,
/* FIXME: if multiple threads flush the same pipe,
maybe should create a list of processes to notify */
maybe should create a list of processes to notify */
if
(
server
->
flush_poll
)
if
(
server
->
flush_poll
)
return
0
;
return
0
;
if
(
pipe_data_remaining
(
server
)
)
if
(
pipe_data_remaining
(
server
)
)
{
{
struct
timeval
tv
;
struct
timeval
tv
;
/* this kind of sux -
/* this kind of sux -
there's no unix way to be alerted when a pipe becomes empty */
there's no unix way to be alerted when a pipe becomes empty */
server
->
event
=
create_event
(
NULL
,
0
,
0
,
0
);
server
->
event
=
create_event
(
NULL
,
0
,
0
,
0
);
if
(
!
server
->
event
)
if
(
!
server
->
event
)
return
0
;
return
0
;
gettimeofday
(
&
tv
,
NULL
);
gettimeofday
(
&
tv
,
NULL
);
add_timeout
(
&
tv
,
100
);
add_timeout
(
&
tv
,
100
);
...
@@ -447,9 +447,9 @@ static struct named_pipe *create_named_pipe( const WCHAR *name, size_t len )
...
@@ -447,9 +447,9 @@ static struct named_pipe *create_named_pipe( const WCHAR *name, size_t len )
struct
named_pipe
*
pipe
;
struct
named_pipe
*
pipe
;
pipe
=
create_named_object
(
sync_namespace
,
&
named_pipe_ops
,
name
,
len
);
pipe
=
create_named_object
(
sync_namespace
,
&
named_pipe_ops
,
name
,
len
);
if
(
pipe
)
if
(
pipe
)
{
{
if
(
get_error
()
!=
STATUS_OBJECT_NAME_COLLISION
)
if
(
get_error
()
!=
STATUS_OBJECT_NAME_COLLISION
)
{
{
/* initialize it if it didn't already exist */
/* initialize it if it didn't already exist */
pipe
->
instances
=
0
;
pipe
->
instances
=
0
;
...
@@ -488,7 +488,7 @@ static struct pipe_server *create_pipe_server( struct named_pipe *pipe, unsigned
...
@@ -488,7 +488,7 @@ static struct pipe_server *create_pipe_server( struct named_pipe *pipe, unsigned
struct
pipe_server
*
server
;
struct
pipe_server
*
server
;
server
=
alloc_object
(
&
pipe_server_ops
);
server
=
alloc_object
(
&
pipe_server_ops
);
if
(
!
server
)
if
(
!
server
)
return
NULL
;
return
NULL
;
server
->
fd
=
NULL
;
server
->
fd
=
NULL
;
...
@@ -510,7 +510,7 @@ static struct pipe_client *create_pipe_client( struct pipe_server *server, unsig
...
@@ -510,7 +510,7 @@ static struct pipe_client *create_pipe_client( struct pipe_server *server, unsig
struct
pipe_client
*
client
;
struct
pipe_client
*
client
;
client
=
alloc_object
(
&
pipe_client_ops
);
client
=
alloc_object
(
&
pipe_client_ops
);
if
(
!
client
)
if
(
!
client
)
return
NULL
;
return
NULL
;
client
->
fd
=
NULL
;
client
->
fd
=
NULL
;
...
@@ -551,10 +551,10 @@ DECL_HANDLER(create_named_pipe)
...
@@ -551,10 +551,10 @@ DECL_HANDLER(create_named_pipe)
reply
->
handle
=
0
;
reply
->
handle
=
0
;
pipe
=
create_named_pipe
(
get_req_data
(),
get_req_data_size
()
);
pipe
=
create_named_pipe
(
get_req_data
(),
get_req_data_size
()
);
if
(
!
pipe
)
if
(
!
pipe
)
return
;
return
;
if
(
get_error
()
!=
STATUS_OBJECT_NAME_COLLISION
)
if
(
get_error
()
!=
STATUS_OBJECT_NAME_COLLISION
)
{
{
pipe
->
insize
=
req
->
insize
;
pipe
->
insize
=
req
->
insize
;
pipe
->
outsize
=
req
->
outsize
;
pipe
->
outsize
=
req
->
outsize
;
...
@@ -565,15 +565,15 @@ DECL_HANDLER(create_named_pipe)
...
@@ -565,15 +565,15 @@ DECL_HANDLER(create_named_pipe)
else
else
{
{
set_error
(
0
);
/* clear the name collision */
set_error
(
0
);
/* clear the name collision */
if
(
pipe
->
maxinstances
<=
pipe
->
instances
)
if
(
pipe
->
maxinstances
<=
pipe
->
instances
)
{
{
set_error
(
STATUS_PIPE_BUSY
);
set_error
(
STATUS_PIPE_BUSY
);
release_object
(
pipe
);
release_object
(
pipe
);
return
;
return
;
}
}
if
(
(
pipe
->
maxinstances
!=
req
->
maxinstances
)
||
if
((
pipe
->
maxinstances
!=
req
->
maxinstances
)
||
(
pipe
->
timeout
!=
req
->
timeout
)
||
(
pipe
->
timeout
!=
req
->
timeout
)
||
(
pipe
->
flags
!=
req
->
flags
)
)
(
pipe
->
flags
!=
req
->
flags
)
)
{
{
set_error
(
STATUS_ACCESS_DENIED
);
set_error
(
STATUS_ACCESS_DENIED
);
release_object
(
pipe
);
release_object
(
pipe
);
...
@@ -582,7 +582,7 @@ DECL_HANDLER(create_named_pipe)
...
@@ -582,7 +582,7 @@ DECL_HANDLER(create_named_pipe)
}
}
server
=
create_pipe_server
(
pipe
,
req
->
options
);
server
=
create_pipe_server
(
pipe
,
req
->
options
);
if
(
server
)
if
(
server
)
{
{
reply
->
handle
=
alloc_handle
(
current
->
process
,
server
,
reply
->
handle
=
alloc_handle
(
current
->
process
,
server
,
GENERIC_READ
|
GENERIC_WRITE
,
req
->
inherit
);
GENERIC_READ
|
GENERIC_WRITE
,
req
->
inherit
);
...
@@ -601,7 +601,7 @@ DECL_HANDLER(open_named_pipe)
...
@@ -601,7 +601,7 @@ DECL_HANDLER(open_named_pipe)
int
fds
[
2
];
int
fds
[
2
];
pipe
=
open_named_pipe
(
get_req_data
(),
get_req_data_size
()
);
pipe
=
open_named_pipe
(
get_req_data
(),
get_req_data_size
()
);
if
(
!
pipe
)
if
(
!
pipe
)
{
{
set_error
(
STATUS_NO_SUCH_FILE
);
set_error
(
STATUS_NO_SUCH_FILE
);
return
;
return
;
...
@@ -610,14 +610,14 @@ DECL_HANDLER(open_named_pipe)
...
@@ -610,14 +610,14 @@ DECL_HANDLER(open_named_pipe)
server
=
find_server2
(
pipe
,
ps_idle_server
,
ps_wait_open
);
server
=
find_server2
(
pipe
,
ps_idle_server
,
ps_wait_open
);
release_object
(
pipe
);
release_object
(
pipe
);
if
(
!
server
)
if
(
!
server
)
{
{
set_error
(
STATUS_PIPE_NOT_AVAILABLE
);
set_error
(
STATUS_PIPE_NOT_AVAILABLE
);
return
;
return
;
}
}
client
=
create_pipe_client
(
server
,
req
->
flags
);
client
=
create_pipe_client
(
server
,
req
->
flags
);
if
(
client
)
if
(
client
)
{
{
if
(
!
socketpair
(
PF_UNIX
,
SOCK_STREAM
,
0
,
fds
))
if
(
!
socketpair
(
PF_UNIX
,
SOCK_STREAM
,
0
,
fds
))
{
{
...
@@ -640,7 +640,7 @@ DECL_HANDLER(open_named_pipe)
...
@@ -640,7 +640,7 @@ DECL_HANDLER(open_named_pipe)
fds
[
0
],
&
server
->
obj
);
fds
[
0
],
&
server
->
obj
);
if
(
client
->
fd
&&
server
->
fd
&&
res
!=
1
)
if
(
client
->
fd
&&
server
->
fd
&&
res
!=
1
)
{
{
if
(
server
->
state
==
ps_wait_open
)
if
(
server
->
state
==
ps_wait_open
)
async_terminate_head
(
&
server
->
wait_q
,
STATUS_SUCCESS
);
async_terminate_head
(
&
server
->
wait_q
,
STATUS_SUCCESS
);
assert
(
list_empty
(
&
server
->
wait_q
)
);
assert
(
list_empty
(
&
server
->
wait_q
)
);
server
->
state
=
ps_connected_server
;
server
->
state
=
ps_connected_server
;
...
@@ -663,10 +663,10 @@ DECL_HANDLER(connect_named_pipe)
...
@@ -663,10 +663,10 @@ DECL_HANDLER(connect_named_pipe)
struct
pipe_server
*
server
;
struct
pipe_server
*
server
;
server
=
get_pipe_server_obj
(
current
->
process
,
req
->
handle
,
0
);
server
=
get_pipe_server_obj
(
current
->
process
,
req
->
handle
,
0
);
if
(
!
server
)
if
(
!
server
)
return
;
return
;
switch
(
server
->
state
)
switch
(
server
->
state
)
{
{
case
ps_idle_server
:
case
ps_idle_server
:
case
ps_wait_connect
:
case
ps_wait_connect
:
...
@@ -705,7 +705,7 @@ DECL_HANDLER(wait_named_pipe)
...
@@ -705,7 +705,7 @@ DECL_HANDLER(wait_named_pipe)
return
;
return
;
}
}
server
=
find_server
(
pipe
,
ps_wait_open
);
server
=
find_server
(
pipe
,
ps_wait_open
);
if
(
server
)
if
(
server
)
{
{
/* there's already a server waiting for a client to connect */
/* there's already a server waiting for a client to connect */
thread_queue_apc
(
current
,
NULL
,
req
->
func
,
APC_ASYNC_IO
,
thread_queue_apc
(
current
,
NULL
,
req
->
func
,
APC_ASYNC_IO
,
...
@@ -737,9 +737,9 @@ DECL_HANDLER(disconnect_named_pipe)
...
@@ -737,9 +737,9 @@ DECL_HANDLER(disconnect_named_pipe)
reply
->
fd
=
-
1
;
reply
->
fd
=
-
1
;
server
=
get_pipe_server_obj
(
current
->
process
,
req
->
handle
,
0
);
server
=
get_pipe_server_obj
(
current
->
process
,
req
->
handle
,
0
);
if
(
!
server
)
if
(
!
server
)
return
;
return
;
switch
(
server
->
state
)
switch
(
server
->
state
)
{
{
case
ps_connected_server
:
case
ps_connected_server
:
assert
(
server
->
fd
);
assert
(
server
->
fd
);
...
@@ -778,7 +778,7 @@ DECL_HANDLER(get_named_pipe_info)
...
@@ -778,7 +778,7 @@ DECL_HANDLER(get_named_pipe_info)
struct
pipe_server
*
server
;
struct
pipe_server
*
server
;
server
=
get_pipe_server_obj
(
current
->
process
,
req
->
handle
,
0
);
server
=
get_pipe_server_obj
(
current
->
process
,
req
->
handle
,
0
);
if
(
!
server
)
if
(
!
server
)
return
;
return
;
reply
->
flags
=
server
->
pipe
->
flags
;
reply
->
flags
=
server
->
pipe
->
flags
;
...
...
server/registry.c
View file @
37957093
...
@@ -271,7 +271,7 @@ static void key_dump( struct object *obj, int verbose )
...
@@ -271,7 +271,7 @@ static void key_dump( struct object *obj, int verbose )
/* notify waiter and maybe delete the notification */
/* notify waiter and maybe delete the notification */
static
void
do_notification
(
struct
key
*
key
,
struct
notify
*
notify
,
int
del
)
static
void
do_notification
(
struct
key
*
key
,
struct
notify
*
notify
,
int
del
)
{
{
if
(
notify
->
event
)
if
(
notify
->
event
)
{
{
set_event
(
notify
->
event
);
set_event
(
notify
->
event
);
release_object
(
notify
->
event
);
release_object
(
notify
->
event
);
...
@@ -756,7 +756,7 @@ static int delete_key( struct key *key, int recurse )
...
@@ -756,7 +756,7 @@ static int delete_key( struct key *key, int recurse )
}
}
while
(
recurse
&&
(
key
->
last_subkey
>=
0
))
while
(
recurse
&&
(
key
->
last_subkey
>=
0
))
if
(
0
>
delete_key
(
key
->
subkeys
[
key
->
last_subkey
],
1
))
if
(
0
>
delete_key
(
key
->
subkeys
[
key
->
last_subkey
],
1
))
return
-
1
;
return
-
1
;
for
(
index
=
0
;
index
<=
parent
->
last_subkey
;
index
++
)
for
(
index
=
0
;
index
<=
parent
->
last_subkey
;
index
++
)
...
@@ -1930,13 +1930,13 @@ DECL_HANDLER(set_registry_notification)
...
@@ -1930,13 +1930,13 @@ DECL_HANDLER(set_registry_notification)
struct
notify
*
notify
;
struct
notify
*
notify
;
key
=
get_hkey_obj
(
req
->
hkey
,
KEY_NOTIFY
);
key
=
get_hkey_obj
(
req
->
hkey
,
KEY_NOTIFY
);
if
(
key
)
if
(
key
)
{
{
event
=
get_event_obj
(
current
->
process
,
req
->
event
,
SYNCHRONIZE
);
event
=
get_event_obj
(
current
->
process
,
req
->
event
,
SYNCHRONIZE
);
if
(
event
)
if
(
event
)
{
{
notify
=
find_notify
(
key
,
current
->
process
,
req
->
hkey
);
notify
=
find_notify
(
key
,
current
->
process
,
req
->
hkey
);
if
(
notify
)
if
(
notify
)
{
{
release_object
(
notify
->
event
);
release_object
(
notify
->
event
);
grab_object
(
event
);
grab_object
(
event
);
...
@@ -1945,7 +1945,7 @@ DECL_HANDLER(set_registry_notification)
...
@@ -1945,7 +1945,7 @@ DECL_HANDLER(set_registry_notification)
else
else
{
{
notify
=
mem_alloc
(
sizeof
(
*
notify
)
);
notify
=
mem_alloc
(
sizeof
(
*
notify
)
);
if
(
notify
)
if
(
notify
)
{
{
grab_object
(
event
);
grab_object
(
event
);
notify
->
event
=
event
;
notify
->
event
=
event
;
...
...
server/thread.c
View file @
37957093
...
@@ -419,7 +419,7 @@ static int check_wait( struct thread *thread )
...
@@ -419,7 +419,7 @@ static int check_wait( struct thread *thread )
struct
wait_queue_entry
*
entry
=
wait
->
queues
;
struct
wait_queue_entry
*
entry
=
wait
->
queues
;
/* Suspended threads may not acquire locks */
/* Suspended threads may not acquire locks */
if
(
thread
->
process
->
suspend
+
thread
->
suspend
>
0
)
return
-
1
;
if
(
thread
->
process
->
suspend
+
thread
->
suspend
>
0
)
return
-
1
;
assert
(
wait
);
assert
(
wait
);
if
(
wait
->
flags
&
SELECT_ALL
)
if
(
wait
->
flags
&
SELECT_ALL
)
...
...
server/token.c
View file @
37957093
...
@@ -764,7 +764,7 @@ static unsigned int token_access_check( struct token *token,
...
@@ -764,7 +764,7 @@ static unsigned int token_access_check( struct token *token,
/* open a security token */
/* open a security token */
DECL_HANDLER
(
open_token
)
DECL_HANDLER
(
open_token
)
{
{
if
(
req
->
flags
&
OPEN_TOKEN_THREAD
)
if
(
req
->
flags
&
OPEN_TOKEN_THREAD
)
{
{
struct
thread
*
thread
=
get_thread_from_handle
(
req
->
handle
,
0
);
struct
thread
*
thread
=
get_thread_from_handle
(
req
->
handle
,
0
);
if
(
thread
)
if
(
thread
)
...
...
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