Signed-off-by: Paul Gofman pgofman@codeweavers.com --- dlls/ntdll/tests/pipe.c | 34 ++++++++++++++++++++++++++++++++-- server/named_pipe.c | 25 ++++++++++++++++++------- 2 files changed, 50 insertions(+), 9 deletions(-)
diff --git a/dlls/ntdll/tests/pipe.c b/dlls/ntdll/tests/pipe.c index 9e8b623d75b..bfc8dc0b3be 100644 --- a/dlls/ntdll/tests/pipe.c +++ b/dlls/ntdll/tests/pipe.c @@ -65,6 +65,7 @@ typedef struct { #endif
static NTSTATUS (WINAPI *pNtFsControlFile) (HANDLE handle, HANDLE event, PIO_APC_ROUTINE apc, PVOID apc_context, PIO_STATUS_BLOCK io, ULONG code, PVOID in_buffer, ULONG in_size, PVOID out_buffer, ULONG out_size); +static NTSTATUS (WINAPI *pNtCreateDirectoryObject)(HANDLE *, ACCESS_MASK, OBJECT_ATTRIBUTES *); static NTSTATUS (WINAPI *pNtCreateNamedPipeFile) (PHANDLE handle, ULONG access, POBJECT_ATTRIBUTES attr, PIO_STATUS_BLOCK iosb, ULONG sharing, ULONG dispo, ULONG options, @@ -73,6 +74,7 @@ static NTSTATUS (WINAPI *pNtCreateNamedPipeFile) (PHANDLE handle, ULONG access, ULONG inbound_quota, ULONG outbound_quota, PLARGE_INTEGER timeout); static NTSTATUS (WINAPI *pNtQueryInformationFile) (IN HANDLE FileHandle, OUT PIO_STATUS_BLOCK IoStatusBlock, OUT PVOID FileInformation, IN ULONG Length, IN FILE_INFORMATION_CLASS FileInformationClass); +static NTSTATUS (WINAPI *pNtQueryObject)(HANDLE, OBJECT_INFORMATION_CLASS, void *, ULONG, ULONG *); static NTSTATUS (WINAPI *pNtQueryVolumeInformationFile)(HANDLE handle, PIO_STATUS_BLOCK io, void *buffer, ULONG length, FS_INFORMATION_CLASS info_class); static NTSTATUS (WINAPI *pNtSetInformationFile) (HANDLE handle, PIO_STATUS_BLOCK io, PVOID ptr, ULONG len, FILE_INFORMATION_CLASS class); static NTSTATUS (WINAPI *pNtCancelIoFile) (HANDLE hFile, PIO_STATUS_BLOCK io_status); @@ -94,8 +96,10 @@ static BOOL init_func_ptrs(void) }
loadfunc(NtFsControlFile) + loadfunc(NtCreateDirectoryObject) loadfunc(NtCreateNamedPipeFile) loadfunc(NtQueryInformationFile) + loadfunc(NtQueryObject) loadfunc(NtQueryVolumeInformationFile) loadfunc(NtSetInformationFile) loadfunc(NtCancelIoFile) @@ -2405,14 +2409,20 @@ static void test_security_info(void) static void test_empty_name(void) { HANDLE hdirectory, hpipe, hwrite, handle; + OBJECT_TYPE_INFORMATION *type_info; + OBJECT_NAME_INFORMATION *name_info; OBJECT_ATTRIBUTES attr; LARGE_INTEGER timeout; UNICODE_STRING name; IO_STATUS_BLOCK io; DWORD data, length; + char buffer[1024]; NTSTATUS status; BOOL ret;
+ type_info = (OBJECT_TYPE_INFORMATION *)buffer; + name_info = (OBJECT_NAME_INFORMATION *)buffer; + hpipe = hwrite = NULL;
attr.Length = sizeof(attr); @@ -2438,13 +2448,17 @@ static void test_empty_name(void) &io, FILE_SHARE_READ | FILE_SHARE_WRITE, FILE_CREATE, FILE_SYNCHRONOUS_IO_NONALERT, 0, 0, 0, 3, 4096, 4096, &timeout); todo_wine ok(status == STATUS_OBJECT_NAME_INVALID, "Got unexpected status %#x.\n", status); - + if (!status) + CloseHandle(hpipe); CloseHandle(hdirectory);
pRtlInitUnicodeString(&name, L"\Device\NamedPipe\"); attr.RootDirectory = 0; attr.ObjectName = &name;
+ status = pNtCreateDirectoryObject(&hdirectory, GENERIC_READ | SYNCHRONIZE, &attr); + todo_wine ok(status == STATUS_OBJECT_TYPE_MISMATCH, "Got unexpected status %#x.\n", status); + status = NtCreateFile(&hdirectory, GENERIC_READ | SYNCHRONIZE, &attr, &io, NULL, 0, FILE_SHARE_READ|FILE_SHARE_WRITE, FILE_OPEN, 0, NULL, 0 ); ok(!status, "Got unexpected status %#x.\n", status); @@ -2454,10 +2468,18 @@ static void test_empty_name(void) name.MaximumLength = 0; attr.RootDirectory = hdirectory;
+ hpipe = NULL; status = pNtCreateNamedPipeFile(&hpipe, GENERIC_READ | SYNCHRONIZE, &attr, &io, FILE_SHARE_READ | FILE_SHARE_WRITE, FILE_CREATE, FILE_SYNCHRONOUS_IO_NONALERT, 0, 0, 0, 3, 4096, 4096, &timeout); - todo_wine ok(!status, "Got unexpected status %#x.\n", status); + ok(!status, "Got unexpected status %#x.\n", status); + type_info->TypeName.Buffer = NULL; + status = pNtQueryObject(hpipe, ObjectTypeInformation, type_info, sizeof(buffer), NULL); + ok(!status, "Got unexpected status %#x.\n", status); + ok(type_info->TypeName.Buffer && !wcscmp(type_info->TypeName.Buffer, L"File"), + "Got unexpected type %s.\n", debugstr_w(type_info->TypeName.Buffer)); + status = pNtQueryObject(hpipe, ObjectNameInformation, name_info, sizeof(buffer), NULL); + todo_wine ok(status == STATUS_OBJECT_PATH_INVALID, "Got unexpected status %#x.\n", status);
status = pNtCreateNamedPipeFile(&handle, GENERIC_READ | SYNCHRONIZE, &attr, &io, FILE_SHARE_READ | FILE_SHARE_WRITE, FILE_OPEN, FILE_SYNCHRONOUS_IO_NONALERT, @@ -2469,6 +2491,14 @@ static void test_empty_name(void) FILE_SHARE_READ|FILE_SHARE_WRITE, FILE_OPEN, FILE_SYNCHRONOUS_IO_NONALERT, NULL, 0 ); todo_wine ok(!status, "Got unexpected status %#x.\n", status);
+ type_info->TypeName.Buffer = NULL; + status = pNtQueryObject(hwrite, ObjectTypeInformation, type_info, sizeof(buffer), NULL); + todo_wine ok(!status, "Got unexpected status %#x.\n", status); + todo_wine ok(type_info->TypeName.Buffer && !wcscmp(type_info->TypeName.Buffer, L"File"), + "Got unexpected type %s.\n", debugstr_w(type_info->TypeName.Buffer)); + status = pNtQueryObject(hwrite, ObjectNameInformation, name_info, sizeof(buffer), NULL); + todo_wine ok(status == STATUS_OBJECT_PATH_INVALID, "Got unexpected status %#x.\n", status); + attr.RootDirectory = hpipe; status = NtCreateFile(&handle, GENERIC_READ | SYNCHRONIZE, &attr, &io, NULL, 0, FILE_SHARE_READ|FILE_SHARE_WRITE, FILE_OPEN, diff --git a/server/named_pipe.c b/server/named_pipe.c index 60bd059d93d..ebf13c04a50 100644 --- a/server/named_pipe.c +++ b/server/named_pipe.c @@ -1350,28 +1350,39 @@ DECL_HANDLER(create_named_pipe) struct named_pipe *pipe; struct pipe_server *server; struct unicode_str name; - struct object *root; + struct object *root = NULL; const struct security_descriptor *sd; - const struct object_attributes *objattr = get_req_object_attributes( &sd, &name, &root ); + const struct object_attributes *objattr = get_req_object_attributes( &sd, &name, NULL );
if (!objattr) return;
if (!req->sharing || (req->sharing & ~(FILE_SHARE_READ | FILE_SHARE_WRITE)) || (!(req->flags & NAMED_PIPE_MESSAGE_STREAM_WRITE) && (req->flags & NAMED_PIPE_MESSAGE_STREAM_READ))) { - if (root) release_object( root ); set_error( STATUS_INVALID_PARAMETER ); return; }
- if (!name.len) /* pipes need a root directory even without a name */ + if (objattr->rootdir) { - if (!objattr->rootdir) + struct object *obj; + + if ((obj = get_handle_obj( current->process, objattr->rootdir, 0, &named_pipe_device_file_ops ))) + { + root = grab_object( &((struct named_pipe_device_file *)obj)->device->obj ); + release_object( obj ); + } + else { - set_error( STATUS_OBJECT_PATH_SYNTAX_BAD ); return; } - if (!(root = get_directory_obj( current->process, objattr->rootdir ))) return; + } + + if (!name.len && !root) /* pipes need a root directory even without a name */ + { + if (!objattr->rootdir) + set_error( STATUS_OBJECT_PATH_SYNTAX_BAD ); + return; }
pipe = create_named_object( root, &named_pipe_ops, &name, objattr->attributes | OBJ_OPENIF, NULL );
Signed-off-by: Paul Gofman pgofman@codeweavers.com --- dlls/ntdll/tests/pipe.c | 2 +- server/named_pipe.c | 12 +++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/dlls/ntdll/tests/pipe.c b/dlls/ntdll/tests/pipe.c index bfc8dc0b3be..1230fecfda7 100644 --- a/dlls/ntdll/tests/pipe.c +++ b/dlls/ntdll/tests/pipe.c @@ -2479,7 +2479,7 @@ static void test_empty_name(void) ok(type_info->TypeName.Buffer && !wcscmp(type_info->TypeName.Buffer, L"File"), "Got unexpected type %s.\n", debugstr_w(type_info->TypeName.Buffer)); status = pNtQueryObject(hpipe, ObjectNameInformation, name_info, sizeof(buffer), NULL); - todo_wine ok(status == STATUS_OBJECT_PATH_INVALID, "Got unexpected status %#x.\n", status); + ok(status == STATUS_OBJECT_PATH_INVALID, "Got unexpected status %#x.\n", status);
status = pNtCreateNamedPipeFile(&handle, GENERIC_READ | SYNCHRONIZE, &attr, &io, FILE_SHARE_READ | FILE_SHARE_WRITE, FILE_OPEN, FILE_SYNCHRONOUS_IO_NONALERT, diff --git a/server/named_pipe.c b/server/named_pipe.c index ebf13c04a50..2d536448ae4 100644 --- a/server/named_pipe.c +++ b/server/named_pipe.c @@ -105,6 +105,7 @@ struct named_pipe_device_file
static void named_pipe_dump( struct object *obj, int verbose ); static unsigned int named_pipe_map_access( struct object *obj, unsigned int access ); +static WCHAR *named_pipe_get_full_name( struct object *obj, data_size_t *ret_len ); static int named_pipe_link_name( struct object *obj, struct object_name *name, struct object *parent ); static struct object *named_pipe_open_file( struct object *obj, unsigned int access, unsigned int sharing, unsigned int options ); @@ -124,7 +125,7 @@ static const struct object_ops named_pipe_ops = named_pipe_map_access, /* map_access */ default_get_sd, /* get_sd */ default_set_sd, /* set_sd */ - default_get_full_name, /* get_full_name */ + named_pipe_get_full_name, /* get_full_name */ no_lookup_name, /* lookup_name */ named_pipe_link_name, /* link_name */ default_unlink_name, /* unlink_name */ @@ -328,6 +329,15 @@ static unsigned int named_pipe_map_access( struct object *obj, unsigned int acce return access & ~(GENERIC_READ | GENERIC_WRITE | GENERIC_EXECUTE | GENERIC_ALL); }
+static WCHAR *named_pipe_get_full_name( struct object *obj, data_size_t *ret_len ) +{ + WCHAR *ret; + + if (!(ret = default_get_full_name( obj, ret_len ))) + set_error( STATUS_OBJECT_PATH_INVALID ); + return ret; +} + static void pipe_server_dump( struct object *obj, int verbose ) { struct pipe_server *server = (struct pipe_server *) obj;
Signed-off-by: Paul Gofman pgofman@codeweavers.com --- dlls/ntdll/tests/pipe.c | 31 ++++++++++++++++++++----------- server/named_pipe.c | 25 +++++++++++++++++++++++-- 2 files changed, 43 insertions(+), 13 deletions(-)
diff --git a/dlls/ntdll/tests/pipe.c b/dlls/ntdll/tests/pipe.c index 1230fecfda7..42bd825dc3c 100644 --- a/dlls/ntdll/tests/pipe.c +++ b/dlls/ntdll/tests/pipe.c @@ -2487,39 +2487,48 @@ static void test_empty_name(void) todo_wine ok(status == STATUS_OBJECT_NAME_NOT_FOUND, "Got unexpected status %#x.\n", status);
attr.RootDirectory = hpipe; + pRtlInitUnicodeString(&name, L"a"); status = NtCreateFile(&hwrite, GENERIC_WRITE | FILE_WRITE_ATTRIBUTES | SYNCHRONIZE, &attr, &io, NULL, 0, FILE_SHARE_READ|FILE_SHARE_WRITE, FILE_OPEN, FILE_SYNCHRONOUS_IO_NONALERT, NULL, 0 ); - todo_wine ok(!status, "Got unexpected status %#x.\n", status); + ok(status == STATUS_OBJECT_NAME_INVALID, "Got unexpected status %#x.\n", status); + + name.Buffer = NULL; + name.Length = 0; + name.MaximumLength = 0; + attr.RootDirectory = hpipe; + status = NtCreateFile(&hwrite, GENERIC_WRITE | FILE_WRITE_ATTRIBUTES | SYNCHRONIZE, &attr, &io, NULL, 0, + FILE_SHARE_READ|FILE_SHARE_WRITE, FILE_OPEN, FILE_SYNCHRONOUS_IO_NONALERT, NULL, 0 ); + ok(!status, "Got unexpected status %#x.\n", status);
type_info->TypeName.Buffer = NULL; status = pNtQueryObject(hwrite, ObjectTypeInformation, type_info, sizeof(buffer), NULL); - todo_wine ok(!status, "Got unexpected status %#x.\n", status); - todo_wine ok(type_info->TypeName.Buffer && !wcscmp(type_info->TypeName.Buffer, L"File"), + ok(!status, "Got unexpected status %#x.\n", status); + ok(type_info->TypeName.Buffer && !wcscmp(type_info->TypeName.Buffer, L"File"), "Got unexpected type %s.\n", debugstr_w(type_info->TypeName.Buffer)); status = pNtQueryObject(hwrite, ObjectNameInformation, name_info, sizeof(buffer), NULL); - todo_wine ok(status == STATUS_OBJECT_PATH_INVALID, "Got unexpected status %#x.\n", status); + ok(status == STATUS_OBJECT_PATH_INVALID, "Got unexpected status %#x.\n", status);
attr.RootDirectory = hpipe; status = NtCreateFile(&handle, GENERIC_READ | SYNCHRONIZE, &attr, &io, NULL, 0, FILE_SHARE_READ|FILE_SHARE_WRITE, FILE_OPEN, FILE_NON_DIRECTORY_FILE | FILE_SYNCHRONOUS_IO_NONALERT, NULL, 0 ); - todo_wine ok(status == STATUS_PIPE_NOT_AVAILABLE, "Got unexpected status %#x.\n", status); + ok(status == STATUS_PIPE_NOT_AVAILABLE, "Got unexpected status %#x.\n", status);
attr.RootDirectory = hpipe; status = NtCreateFile(&handle, GENERIC_WRITE | SYNCHRONIZE, &attr, &io, NULL, 0, FILE_SHARE_READ|FILE_SHARE_WRITE, FILE_OPEN, FILE_SYNCHRONOUS_IO_NONALERT, NULL, 0 ); - todo_wine ok(status == STATUS_PIPE_NOT_AVAILABLE, "Got unexpected status %#x.\n", status); + ok(status == STATUS_PIPE_NOT_AVAILABLE, "Got unexpected status %#x.\n", status);
data = 0xdeadbeef; ret = WriteFile(hwrite, &data, sizeof(data), &length, NULL); - todo_wine ok(ret, "Got unexpected ret %#x, GetLastError() %u.\n", ret, GetLastError()); - todo_wine ok(length == sizeof(data), "Got unexpected length %#x.\n", length); + ok(ret, "Got unexpected ret %#x, GetLastError() %u.\n", ret, GetLastError()); + ok(length == sizeof(data), "Got unexpected length %#x.\n", length);
data = 0; ret = ReadFile(hpipe, &data, sizeof(data), &length, NULL); - todo_wine ok(ret, "Got unexpected ret %#x, GetLastError() %u.\n", ret, GetLastError()); - todo_wine ok(length == sizeof(data), "Got unexpected length %#x.\n", length); - todo_wine ok(data == 0xdeadbeef, "Got unexpected data %#x.\n", data); + ok(ret, "Got unexpected ret %#x, GetLastError() %u.\n", ret, GetLastError()); + ok(length == sizeof(data), "Got unexpected length %#x.\n", length); + ok(data == 0xdeadbeef, "Got unexpected data %#x.\n", data);
CloseHandle(hwrite); CloseHandle(hpipe); diff --git a/server/named_pipe.c b/server/named_pipe.c index 2d536448ae4..38509fc02ae 100644 --- a/server/named_pipe.c +++ b/server/named_pipe.c @@ -152,6 +152,10 @@ static void pipe_end_get_file_info( struct fd *fd, obj_handle_t handle, unsigned
/* server end functions */ static void pipe_server_dump( struct object *obj, int verbose ); +static struct object *pipe_server_lookup_name( struct object *obj, struct unicode_str *name, + unsigned int attr ); +static struct object *pipe_server_open_file( struct object *obj, unsigned int access, + unsigned int sharing, unsigned int options ); static void pipe_server_destroy( struct object *obj); static int pipe_server_ioctl( struct fd *fd, ioctl_code_t code, struct async *async );
@@ -170,10 +174,10 @@ static const struct object_ops pipe_server_ops = pipe_end_get_sd, /* get_sd */ pipe_end_set_sd, /* set_sd */ pipe_end_get_full_name, /* get_full_name */ - no_lookup_name, /* lookup_name */ + pipe_server_lookup_name, /* lookup_name */ no_link_name, /* link_name */ NULL, /* unlink_name */ - no_open_file, /* open_file */ + pipe_server_open_file, /* open_file */ no_kernel_obj_list, /* get_kernel_obj_list */ fd_close_handle, /* close_handle */ pipe_server_destroy /* destroy */ @@ -449,6 +453,23 @@ static void pipe_end_destroy( struct object *obj ) if (pipe_end->pipe) release_object( pipe_end->pipe ); }
+static struct object *pipe_server_lookup_name( struct object *obj, struct unicode_str *name, + unsigned int attr ) +{ + if (name && name->len) + set_error( STATUS_OBJECT_NAME_INVALID ); + + return NULL; +} + +static struct object *pipe_server_open_file( struct object *obj, unsigned int access, + unsigned int sharing, unsigned int options ) +{ + struct pipe_server *server = (struct pipe_server *)obj; + + return server->pipe_end.pipe->obj.ops->open_file( &server->pipe_end.pipe->obj, access, sharing, options ); +} + static void pipe_server_destroy( struct object *obj ) { struct pipe_server *server = (struct pipe_server *)obj;
Signed-off-by: Paul Gofman pgofman@codeweavers.com --- dlls/ntdll/tests/pipe.c | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-)
diff --git a/dlls/ntdll/tests/pipe.c b/dlls/ntdll/tests/pipe.c index 42bd825dc3c..662dc1d55cb 100644 --- a/dlls/ntdll/tests/pipe.c +++ b/dlls/ntdll/tests/pipe.c @@ -2408,7 +2408,7 @@ static void test_security_info(void)
static void test_empty_name(void) { - HANDLE hdirectory, hpipe, hwrite, handle; + HANDLE hdirectory, hpipe, hpipe2, hwrite, hwrite2, handle; OBJECT_TYPE_INFORMATION *type_info; OBJECT_NAME_INFORMATION *name_info; OBJECT_ATTRIBUTES attr; @@ -2486,6 +2486,11 @@ static void test_empty_name(void) 0, 0, 0, 1, 4096, 4096, &timeout); todo_wine ok(status == STATUS_OBJECT_NAME_NOT_FOUND, "Got unexpected status %#x.\n", status);
+ status = pNtCreateNamedPipeFile(&hpipe2, GENERIC_READ | SYNCHRONIZE, &attr, + &io, FILE_SHARE_READ | FILE_SHARE_WRITE, FILE_CREATE, FILE_SYNCHRONOUS_IO_NONALERT, + 0, 0, 0, 3, 4096, 4096, &timeout); + ok(!status, "Got unexpected status %#x.\n", status); + attr.RootDirectory = hpipe; pRtlInitUnicodeString(&name, L"a"); status = NtCreateFile(&hwrite, GENERIC_WRITE | FILE_WRITE_ATTRIBUTES | SYNCHRONIZE, &attr, &io, NULL, 0, @@ -2519,20 +2524,38 @@ static void test_empty_name(void) FILE_SHARE_READ|FILE_SHARE_WRITE, FILE_OPEN, FILE_SYNCHRONOUS_IO_NONALERT, NULL, 0 ); ok(status == STATUS_PIPE_NOT_AVAILABLE, "Got unexpected status %#x.\n", status);
+ attr.RootDirectory = hpipe2; + status = NtCreateFile(&hwrite2, GENERIC_WRITE | FILE_WRITE_ATTRIBUTES | SYNCHRONIZE, &attr, &io, NULL, 0, + FILE_SHARE_READ|FILE_SHARE_WRITE, FILE_OPEN, FILE_SYNCHRONOUS_IO_NONALERT, NULL, 0 ); + ok(!status, "Got unexpected status %#x.\n", status); + data = 0xdeadbeef; ret = WriteFile(hwrite, &data, sizeof(data), &length, NULL); ok(ret, "Got unexpected ret %#x, GetLastError() %u.\n", ret, GetLastError()); ok(length == sizeof(data), "Got unexpected length %#x.\n", length);
+ data = 0xfeedcafe; + ret = WriteFile(hwrite2, &data, sizeof(data), &length, NULL); + ok(ret, "Got unexpected ret %#x, GetLastError() %u.\n", ret, GetLastError()); + ok(length == sizeof(data), "Got unexpected length %#x.\n", length); + data = 0; ret = ReadFile(hpipe, &data, sizeof(data), &length, NULL); ok(ret, "Got unexpected ret %#x, GetLastError() %u.\n", ret, GetLastError()); ok(length == sizeof(data), "Got unexpected length %#x.\n", length); ok(data == 0xdeadbeef, "Got unexpected data %#x.\n", data);
+ data = 0; + ret = ReadFile(hpipe2, &data, sizeof(data), &length, NULL); + ok(ret, "Got unexpected ret %#x, GetLastError() %u.\n", ret, GetLastError()); + ok(length == sizeof(data), "Got unexpected length %#x.\n", length); + ok(data == 0xfeedcafe, "Got unexpected data %#x.\n", data); + CloseHandle(hwrite); CloseHandle(hpipe); CloseHandle(hdirectory); + CloseHandle(hpipe2); + CloseHandle(hwrite2); }
START_TEST(pipe)
Paul Gofman pgofman@codeweavers.com writes:
@@ -1350,28 +1350,39 @@ DECL_HANDLER(create_named_pipe) struct named_pipe *pipe; struct pipe_server *server; struct unicode_str name;
- struct object *root;
- struct object *root = NULL; const struct security_descriptor *sd;
- const struct object_attributes *objattr = get_req_object_attributes( &sd, &name, &root );
- const struct object_attributes *objattr = get_req_object_attributes( &sd, &name, NULL );
It should be possible to make get_req_object_attributes() not require a directory instead.
On 11/11/20 22:09, Alexandre Julliard wrote:
Paul Gofman pgofman@codeweavers.com writes:
@@ -1350,28 +1350,39 @@ DECL_HANDLER(create_named_pipe) struct named_pipe *pipe; struct pipe_server *server; struct unicode_str name;
- struct object *root;
- struct object *root = NULL; const struct security_descriptor *sd;
- const struct object_attributes *objattr = get_req_object_attributes( &sd, &name, &root );
- const struct object_attributes *objattr = get_req_object_attributes( &sd, &name, NULL );
It should be possible to make get_req_object_attributes() not require a directory instead.
Will it be better to pass object ops to get_req_object_attributes() and update the usages accordingly? Possibly allowing NULL which will default to directory.
On 11/11/20 22:16, Paul Gofman wrote:
On 11/11/20 22:09, Alexandre Julliard wrote:
Paul Gofman pgofman@codeweavers.com writes:
@@ -1350,28 +1350,39 @@ DECL_HANDLER(create_named_pipe) struct named_pipe *pipe; struct pipe_server *server; struct unicode_str name;
- struct object *root;
- struct object *root = NULL; const struct security_descriptor *sd;
- const struct object_attributes *objattr = get_req_object_attributes( &sd, &name, &root );
- const struct object_attributes *objattr = get_req_object_attributes( &sd, &name, NULL );
It should be possible to make get_req_object_attributes() not require a directory instead.
Will it be better to pass object ops to get_req_object_attributes() and update the usages accordingly? Possibly allowing NULL which will default to directory.
Or actually I can better just use get_handle_obj() without specifying any ops in get_req_object_attributes().
Paul Gofman pgofman@codeweavers.com writes:
On 11/11/20 22:16, Paul Gofman wrote:
On 11/11/20 22:09, Alexandre Julliard wrote:
Paul Gofman pgofman@codeweavers.com writes:
@@ -1350,28 +1350,39 @@ DECL_HANDLER(create_named_pipe) struct named_pipe *pipe; struct pipe_server *server; struct unicode_str name;
- struct object *root;
- struct object *root = NULL; const struct security_descriptor *sd;
- const struct object_attributes *objattr = get_req_object_attributes( &sd, &name, &root );
- const struct object_attributes *objattr = get_req_object_attributes( &sd, &name, NULL );
It should be possible to make get_req_object_attributes() not require a directory instead.
Will it be better to pass object ops to get_req_object_attributes() and update the usages accordingly? Possibly allowing NULL which will default to directory.
Or actually I can better just use get_handle_obj() without specifying any ops in get_req_object_attributes().
Yes, that's what I meant. It should fail later when trying to link an object into something that's not a directory.