Saw that this was allowed on MSDN and checked with a windows machine
-- v3: ntdll/tests: Add NULL timeout test for NtCreateNamedPipeFile.
From: Etaash Mathamsetty etaash.mathamsetty@gmail.com
--- dlls/ntdll/unix/file.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/dlls/ntdll/unix/file.c b/dlls/ntdll/unix/file.c index 3a24d4ebbf2..43bde14e5d8 100644 --- a/dlls/ntdll/unix/file.c +++ b/dlls/ntdll/unix/file.c @@ -4132,7 +4132,7 @@ NTSTATUS WINAPI NtCreateNamedPipeFile( HANDLE *handle, ULONG access, OBJECT_ATTR (int)inbound_quota, (int)outbound_quota, timeout );
/* assume we only get relative timeout */ - if (timeout->QuadPart > 0) FIXME( "Wrong time %s\n", wine_dbgstr_longlong(timeout->QuadPart) ); + if (timeout && timeout->QuadPart > 0) FIXME( "Wrong time %s\n", wine_dbgstr_longlong(timeout->QuadPart) );
if ((status = alloc_object_attributes( attr, &objattr, &len ))) return status;
@@ -4149,7 +4149,7 @@ NTSTATUS WINAPI NtCreateNamedPipeFile( HANDLE *handle, ULONG access, OBJECT_ATTR req->maxinstances = max_inst; req->outsize = outbound_quota; req->insize = inbound_quota; - req->timeout = timeout->QuadPart; + req->timeout = timeout ? timeout->QuadPart : 0ULL; wine_server_add_data( req, objattr, len ); if (!(status = wine_server_call( req ))) {
From: Etaash Mathamsetty etaash.mathamsetty@gmail.com
--- dlls/ntdll/tests/om.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
diff --git a/dlls/ntdll/tests/om.c b/dlls/ntdll/tests/om.c index c03b5e4cfca..a67c987a8c2 100644 --- a/dlls/ntdll/tests/om.c +++ b/dlls/ntdll/tests/om.c @@ -412,6 +412,16 @@ static void test_name_collisions(void) ok( iosb.Information == FILE_OPENED, "wrong info %Ix\n", iosb.Information ); pNtClose(h1);
+ memset( &iosb, 0xcc, sizeof(iosb) ); + status = pNtCreateNamedPipeFile( &h1, GENERIC_READ|GENERIC_WRITE, &attr, &iosb, + FILE_SHARE_READ|FILE_SHARE_WRITE, + FILE_OPEN_IF, FILE_PIPE_FULL_DUPLEX, + FALSE, FALSE, FALSE, 10, 256, 256, NULL ); + ok(status == STATUS_SUCCESS, "failed to create pipe %08lx\n", status); + ok( iosb.Status == STATUS_SUCCESS, "wrong status %08lx\n", status); + ok( iosb.Information == FILE_OPENED, "wrong info %Ix\n", iosb.Information ); + pNtClose(h1); + h1 = CreateNamedPipeA( "\\.\pipe\named_pipe", PIPE_ACCESS_DUPLEX, PIPE_READMODE_BYTE, 10, 256, 256, 1000, NULL ); winerr = GetLastError();
On Sun Aug 20 01:49:23 2023 +0000, Alexandre Julliard wrote:
Please add a test.
test added