server: Pass full object attributes in the create_completion request.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
426c4a2f08
commit
1eb69be36f
|
@ -1153,29 +1153,30 @@ NTSTATUS WINAPI NtReleaseKeyedEvent( HANDLE handle, const void *key,
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
NTSTATUS WINAPI NtCreateIoCompletion( PHANDLE CompletionPort, ACCESS_MASK DesiredAccess,
|
NTSTATUS WINAPI NtCreateIoCompletion( PHANDLE CompletionPort, ACCESS_MASK DesiredAccess,
|
||||||
POBJECT_ATTRIBUTES ObjectAttributes, ULONG NumberOfConcurrentThreads )
|
POBJECT_ATTRIBUTES attr, ULONG NumberOfConcurrentThreads )
|
||||||
{
|
{
|
||||||
NTSTATUS status;
|
NTSTATUS status;
|
||||||
|
data_size_t len;
|
||||||
|
struct object_attributes *objattr;
|
||||||
|
|
||||||
TRACE("(%p, %x, %p, %d)\n", CompletionPort, DesiredAccess,
|
TRACE("(%p, %x, %p, %d)\n", CompletionPort, DesiredAccess, attr, NumberOfConcurrentThreads);
|
||||||
ObjectAttributes, NumberOfConcurrentThreads);
|
|
||||||
|
|
||||||
if (!CompletionPort)
|
if (!CompletionPort)
|
||||||
return STATUS_INVALID_PARAMETER;
|
return STATUS_INVALID_PARAMETER;
|
||||||
|
|
||||||
|
if ((status = alloc_object_attributes( attr, &objattr, &len ))) return status;
|
||||||
|
|
||||||
SERVER_START_REQ( create_completion )
|
SERVER_START_REQ( create_completion )
|
||||||
{
|
{
|
||||||
req->access = DesiredAccess;
|
req->access = DesiredAccess;
|
||||||
req->attributes = ObjectAttributes ? ObjectAttributes->Attributes : 0;
|
|
||||||
req->rootdir = wine_server_obj_handle( ObjectAttributes ? ObjectAttributes->RootDirectory : 0 );
|
|
||||||
req->concurrent = NumberOfConcurrentThreads;
|
req->concurrent = NumberOfConcurrentThreads;
|
||||||
if (ObjectAttributes && ObjectAttributes->ObjectName)
|
wine_server_add_data( req, objattr, len );
|
||||||
wine_server_add_data( req, ObjectAttributes->ObjectName->Buffer,
|
|
||||||
ObjectAttributes->ObjectName->Length );
|
|
||||||
if (!(status = wine_server_call( req )))
|
if (!(status = wine_server_call( req )))
|
||||||
*CompletionPort = wine_server_ptr_handle( reply->handle );
|
*CompletionPort = wine_server_ptr_handle( reply->handle );
|
||||||
}
|
}
|
||||||
SERVER_END_REQ;
|
SERVER_END_REQ;
|
||||||
|
|
||||||
|
RtlFreeHeap( GetProcessHeap(), 0, objattr );
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4980,11 +4980,9 @@ struct create_completion_request
|
||||||
{
|
{
|
||||||
struct request_header __header;
|
struct request_header __header;
|
||||||
unsigned int access;
|
unsigned int access;
|
||||||
unsigned int attributes;
|
|
||||||
unsigned int concurrent;
|
unsigned int concurrent;
|
||||||
obj_handle_t rootdir;
|
/* VARARG(objattr,object_attributes); */
|
||||||
/* VARARG(filename,unicode_str); */
|
char __pad_20[4];
|
||||||
char __pad_28[4];
|
|
||||||
};
|
};
|
||||||
struct create_completion_reply
|
struct create_completion_reply
|
||||||
{
|
{
|
||||||
|
@ -6161,6 +6159,6 @@ union generic_reply
|
||||||
struct terminate_job_reply terminate_job_reply;
|
struct terminate_job_reply terminate_job_reply;
|
||||||
};
|
};
|
||||||
|
|
||||||
#define SERVER_PROTOCOL_VERSION 496
|
#define SERVER_PROTOCOL_VERSION 497
|
||||||
|
|
||||||
#endif /* __WINE_WINE_SERVER_PROTOCOL_H */
|
#endif /* __WINE_WINE_SERVER_PROTOCOL_H */
|
||||||
|
|
|
@ -130,7 +130,9 @@ static unsigned int completion_map_access( struct object *obj, unsigned int acce
|
||||||
return access & ~(GENERIC_READ | GENERIC_WRITE | GENERIC_EXECUTE | GENERIC_ALL);
|
return access & ~(GENERIC_READ | GENERIC_WRITE | GENERIC_EXECUTE | GENERIC_ALL);
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct completion *create_completion( struct directory *root, const struct unicode_str *name, unsigned int attr, unsigned int concurrent )
|
static struct completion *create_completion( struct directory *root, const struct unicode_str *name,
|
||||||
|
unsigned int attr, unsigned int concurrent,
|
||||||
|
const struct security_descriptor *sd )
|
||||||
{
|
{
|
||||||
struct completion *completion;
|
struct completion *completion;
|
||||||
|
|
||||||
|
@ -140,6 +142,9 @@ static struct completion *create_completion( struct directory *root, const struc
|
||||||
{
|
{
|
||||||
list_init( &completion->queue );
|
list_init( &completion->queue );
|
||||||
completion->depth = 0;
|
completion->depth = 0;
|
||||||
|
if (sd) default_set_sd( &completion->obj, sd,
|
||||||
|
OWNER_SECURITY_INFORMATION | GROUP_SECURITY_INFORMATION |
|
||||||
|
DACL_SECURITY_INFORMATION | SACL_SECURITY_INFORMATION );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -175,16 +180,15 @@ DECL_HANDLER(create_completion)
|
||||||
struct completion *completion;
|
struct completion *completion;
|
||||||
struct unicode_str name;
|
struct unicode_str name;
|
||||||
struct directory *root = NULL;
|
struct directory *root = NULL;
|
||||||
|
const struct security_descriptor *sd;
|
||||||
|
const struct object_attributes *objattr = get_req_object_attributes( &sd, &name );
|
||||||
|
|
||||||
reply->handle = 0;
|
if (!objattr) return;
|
||||||
|
if (objattr->rootdir && !(root = get_directory_obj( current->process, objattr->rootdir, 0 ))) return;
|
||||||
|
|
||||||
get_req_unicode_str( &name );
|
if ((completion = create_completion( root, &name, objattr->attributes, req->concurrent, sd )))
|
||||||
if (req->rootdir && !(root = get_directory_obj( current->process, req->rootdir, 0 )))
|
|
||||||
return;
|
|
||||||
|
|
||||||
if ( (completion = create_completion( root, &name, req->attributes, req->concurrent )) != NULL )
|
|
||||||
{
|
{
|
||||||
reply->handle = alloc_handle( current->process, completion, req->access, req->attributes );
|
reply->handle = alloc_handle( current->process, completion, req->access, objattr->attributes );
|
||||||
release_object( completion );
|
release_object( completion );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3466,10 +3466,8 @@ struct handle_info
|
||||||
/* Create I/O completion port */
|
/* Create I/O completion port */
|
||||||
@REQ(create_completion)
|
@REQ(create_completion)
|
||||||
unsigned int access; /* desired access to a port */
|
unsigned int access; /* desired access to a port */
|
||||||
unsigned int attributes; /* object attributes */
|
|
||||||
unsigned int concurrent; /* max number of concurrent active threads */
|
unsigned int concurrent; /* max number of concurrent active threads */
|
||||||
obj_handle_t rootdir; /* root directory */
|
VARARG(objattr,object_attributes); /* object attributes */
|
||||||
VARARG(filename,unicode_str); /* port name */
|
|
||||||
@REPLY
|
@REPLY
|
||||||
obj_handle_t handle; /* port handle */
|
obj_handle_t handle; /* port handle */
|
||||||
@END
|
@END
|
||||||
|
|
|
@ -2182,10 +2182,8 @@ C_ASSERT( FIELD_OFFSET(struct get_token_statistics_reply, group_count) == 32 );
|
||||||
C_ASSERT( FIELD_OFFSET(struct get_token_statistics_reply, privilege_count) == 36 );
|
C_ASSERT( FIELD_OFFSET(struct get_token_statistics_reply, privilege_count) == 36 );
|
||||||
C_ASSERT( sizeof(struct get_token_statistics_reply) == 40 );
|
C_ASSERT( sizeof(struct get_token_statistics_reply) == 40 );
|
||||||
C_ASSERT( FIELD_OFFSET(struct create_completion_request, access) == 12 );
|
C_ASSERT( FIELD_OFFSET(struct create_completion_request, access) == 12 );
|
||||||
C_ASSERT( FIELD_OFFSET(struct create_completion_request, attributes) == 16 );
|
C_ASSERT( FIELD_OFFSET(struct create_completion_request, concurrent) == 16 );
|
||||||
C_ASSERT( FIELD_OFFSET(struct create_completion_request, concurrent) == 20 );
|
C_ASSERT( sizeof(struct create_completion_request) == 24 );
|
||||||
C_ASSERT( FIELD_OFFSET(struct create_completion_request, rootdir) == 24 );
|
|
||||||
C_ASSERT( sizeof(struct create_completion_request) == 32 );
|
|
||||||
C_ASSERT( FIELD_OFFSET(struct create_completion_reply, handle) == 8 );
|
C_ASSERT( FIELD_OFFSET(struct create_completion_reply, handle) == 8 );
|
||||||
C_ASSERT( sizeof(struct create_completion_reply) == 16 );
|
C_ASSERT( sizeof(struct create_completion_reply) == 16 );
|
||||||
C_ASSERT( FIELD_OFFSET(struct open_completion_request, access) == 12 );
|
C_ASSERT( FIELD_OFFSET(struct open_completion_request, access) == 12 );
|
||||||
|
|
|
@ -4087,10 +4087,8 @@ static void dump_get_token_statistics_reply( const struct get_token_statistics_r
|
||||||
static void dump_create_completion_request( const struct create_completion_request *req )
|
static void dump_create_completion_request( const struct create_completion_request *req )
|
||||||
{
|
{
|
||||||
fprintf( stderr, " access=%08x", req->access );
|
fprintf( stderr, " access=%08x", req->access );
|
||||||
fprintf( stderr, ", attributes=%08x", req->attributes );
|
|
||||||
fprintf( stderr, ", concurrent=%08x", req->concurrent );
|
fprintf( stderr, ", concurrent=%08x", req->concurrent );
|
||||||
fprintf( stderr, ", rootdir=%04x", req->rootdir );
|
dump_varargs_object_attributes( ", objattr=", cur_size );
|
||||||
dump_varargs_unicode_str( ", filename=", cur_size );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void dump_create_completion_reply( const struct create_completion_reply *req )
|
static void dump_create_completion_reply( const struct create_completion_reply *req )
|
||||||
|
|
Loading…
Reference in New Issue