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
6c42be25
Commit
6c42be25
authored
Mar 28, 2005
by
Mike McCormack
Committed by
Alexandre Julliard
Mar 28, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implement CreateMailslot using NtCreateMailslotFile.
parent
a63c2eb3
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
87 additions
and
22 deletions
+87
-22
sync.c
dlls/kernel/sync.c
+41
-3
mailslot.c
dlls/kernel/tests/mailslot.c
+3
-9
file.c
dlls/ntdll/file.c
+42
-0
nt.c
dlls/ntdll/nt.c
+0
-10
winternl.h
include/winternl.h
+1
-0
No files found.
dlls/kernel/sync.c
View file @
6c42be25
...
...
@@ -1576,10 +1576,48 @@ HANDLE WINAPI CreateMailslotA( LPCSTR lpName, DWORD nMaxMessageSize,
HANDLE
WINAPI
CreateMailslotW
(
LPCWSTR
lpName
,
DWORD
nMaxMessageSize
,
DWORD
lReadTimeout
,
LPSECURITY_ATTRIBUTES
sa
)
{
FIXME
(
"(%s,%ld,%ld,%p): stub
\n
"
,
debugstr_w
(
lpName
),
HANDLE
handle
=
INVALID_HANDLE_VALUE
;
OBJECT_ATTRIBUTES
attr
;
UNICODE_STRING
nameW
;
LARGE_INTEGER
timeout
;
IO_STATUS_BLOCK
iosb
;
NTSTATUS
status
;
TRACE
(
"%s %ld %ld %p
\n
"
,
debugstr_w
(
lpName
),
nMaxMessageSize
,
lReadTimeout
,
sa
);
SetLastError
(
ERROR_CALL_NOT_IMPLEMENTED
);
return
INVALID_HANDLE_VALUE
;
if
(
!
RtlDosPathNameToNtPathName_U
(
lpName
,
&
nameW
,
NULL
,
NULL
))
{
SetLastError
(
ERROR_PATH_NOT_FOUND
);
return
INVALID_HANDLE_VALUE
;
}
if
(
nameW
.
Length
>=
MAX_PATH
*
sizeof
(
WCHAR
)
)
{
SetLastError
(
ERROR_FILENAME_EXCED_RANGE
);
RtlFreeUnicodeString
(
&
nameW
);
return
INVALID_HANDLE_VALUE
;
}
attr
.
Length
=
sizeof
(
attr
);
attr
.
RootDirectory
=
0
;
attr
.
Attributes
=
OBJ_CASE_INSENSITIVE
;
attr
.
ObjectName
=
&
nameW
;
attr
.
SecurityDescriptor
=
sa
?
sa
->
lpSecurityDescriptor
:
NULL
;
attr
.
SecurityQualityOfService
=
NULL
;
timeout
.
QuadPart
=
(
ULONGLONG
)
lReadTimeout
*
-
10000
;
status
=
NtCreateMailslotFile
(
&
handle
,
GENERIC_READ
|
GENERIC_WRITE
,
&
attr
,
&
iosb
,
0
,
0
,
nMaxMessageSize
,
&
timeout
);
if
(
status
)
{
SetLastError
(
RtlNtStatusToDosError
(
status
)
);
handle
=
INVALID_HANDLE_VALUE
;
}
RtlFreeUnicodeString
(
&
nameW
);
return
handle
;
}
...
...
dlls/kernel/tests/mailslot.c
View file @
6c42be25
...
...
@@ -57,21 +57,15 @@ static int mailslot_test()
hSlot
=
CreateMailslot
(
"blah"
,
0
,
0
,
NULL
);
ok
(
hSlot
==
INVALID_HANDLE_VALUE
,
"Created mailslot with invalid name
\n
"
);
todo_wine
{
ok
(
GetLastError
()
==
ERROR_INVALID_NAME
,
"error should be ERROR_INVALID_NAME
\n
"
);
}
ok
(
GetLastError
()
==
ERROR_INVALID_NAME
,
"error should be ERROR_INVALID_NAME
\n
"
);
/* open a mailslot with a null name */
hSlot
=
CreateMailslot
(
NULL
,
0
,
0
,
NULL
);
ok
(
hSlot
==
INVALID_HANDLE_VALUE
,
"Created mailslot with invalid name
\n
"
);
todo_wine
{
ok
(
GetLastError
()
==
ERROR_PATH_NOT_FOUND
,
ok
(
GetLastError
()
==
ERROR_PATH_NOT_FOUND
,
"error should be ERROR_PATH_NOT_FOUND
\n
"
);
}
todo_wine
{
...
...
dlls/ntdll/file.c
View file @
6c42be25
...
...
@@ -1739,3 +1739,45 @@ NTSTATUS WINAPI NtCancelIoFile( HANDLE hFile, PIO_STATUS_BLOCK io_status )
timeout
.
u
.
LowPart
=
timeout
.
u
.
HighPart
=
0
;
return
io_status
->
u
.
Status
=
NtDelayExecution
(
TRUE
,
&
timeout
);
}
/******************************************************************************
* NtCreateMailslotFile [NTDLL.@]
* ZwCreateMailslotFile [NTDLL.@]
*
* PARAMS
* pHandle [O] pointer to receive the handle created
* DesiredAccess [I] access mode (read, write, etc)
* ObjectAttributes [I] fully qualified NT path of the mailslot
* IoStatusBlock [O] receives completion status and other info
* CreateOptions [I]
* MailslotQuota [I]
* MaxMessageSize [I]
* TimeOut [I]
*
* RETURNS
* An NT status code
*/
NTSTATUS
WINAPI
NtCreateMailslotFile
(
PHANDLE
pHandle
,
ULONG
DesiredAccess
,
POBJECT_ATTRIBUTES
attr
,
PIO_STATUS_BLOCK
IoStatusBlock
,
ULONG
CreateOptions
,
ULONG
MailslotQuota
,
ULONG
MaxMessageSize
,
PLARGE_INTEGER
TimeOut
)
{
static
const
WCHAR
leadin
[]
=
{
'\\'
,
'?'
,
'?'
,
'\\'
,
'M'
,
'A'
,
'I'
,
'L'
,
'S'
,
'L'
,
'O'
,
'T'
,
'\\'
};
NTSTATUS
ret
;
FIXME
(
"%p %08lx %p %p %08lx %08lx %08lx %p
\n
"
,
pHandle
,
DesiredAccess
,
attr
,
IoStatusBlock
,
CreateOptions
,
MailslotQuota
,
MaxMessageSize
,
TimeOut
);
if
(
attr
->
ObjectName
->
Length
<
sizeof
(
leadin
)
||
strncmpiW
(
attr
->
ObjectName
->
Buffer
,
leadin
,
sizeof
(
leadin
)
/
sizeof
(
leadin
[
0
])
))
{
return
STATUS_OBJECT_NAME_INVALID
;
}
ret
=
STATUS_NOT_IMPLEMENTED
;
return
ret
;
}
dlls/ntdll/nt.c
View file @
6c42be25
...
...
@@ -540,16 +540,6 @@ NTSTATUS WINAPI NtQueryPerformanceCounter(
}
/******************************************************************************
* NtCreateMailslotFile [NTDLL.@]
* ZwCreateMailslotFile [NTDLL.@]
*/
NTSTATUS
WINAPI
NtCreateMailslotFile
(
DWORD
x1
,
DWORD
x2
,
DWORD
x3
,
DWORD
x4
,
DWORD
x5
,
DWORD
x6
,
DWORD
x7
,
DWORD
x8
)
{
FIXME
(
"(0x%08lx,0x%08lx,0x%08lx,0x%08lx,0x%08lx,0x%08lx,0x%08lx,0x%08lx),stub!
\n
"
,
x1
,
x2
,
x3
,
x4
,
x5
,
x6
,
x7
,
x8
);
return
0
;
}
/******************************************************************************
* NtQuerySystemInformation [NTDLL.@]
* ZwQuerySystemInformation [NTDLL.@]
*
...
...
include/winternl.h
View file @
6c42be25
...
...
@@ -1424,6 +1424,7 @@ NTSTATUS WINAPI NtCreateEvent(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES *,BOO
NTSTATUS
WINAPI
NtCreateFile
(
PHANDLE
,
ACCESS_MASK
,
POBJECT_ATTRIBUTES
,
PIO_STATUS_BLOCK
,
PLARGE_INTEGER
,
ULONG
,
ULONG
,
ULONG
,
ULONG
,
PVOID
,
ULONG
);
NTSTATUS
WINAPI
NtCreateIoCompletion
(
PHANDLE
,
ACCESS_MASK
,
POBJECT_ATTRIBUTES
,
ULONG
);
NTSTATUS
WINAPI
NtCreateKey
(
PHKEY
,
ACCESS_MASK
,
const
OBJECT_ATTRIBUTES
*
,
ULONG
,
const
UNICODE_STRING
*
,
ULONG
,
PULONG
);
NTSTATUS
WINAPI
NtCreateMailslotFile
(
PHANDLE
,
ACCESS_MASK
,
POBJECT_ATTRIBUTES
,
PIO_STATUS_BLOCK
,
ULONG
,
ULONG
,
ULONG
,
PLARGE_INTEGER
);
NTSTATUS
WINAPI
NtCreateMutant
(
HANDLE
*
,
ACCESS_MASK
,
const
OBJECT_ATTRIBUTES
*
,
BOOLEAN
);
NTSTATUS
WINAPI
NtCreateNamedPipeFile
(
PHANDLE
,
ULONG
,
POBJECT_ATTRIBUTES
,
PIO_STATUS_BLOCK
,
ULONG
,
ULONG
,
ULONG
,
ULONG
,
ULONG
,
ULONG
,
ULONG
,
ULONG
,
ULONG
,
PLARGE_INTEGER
);
NTSTATUS
WINAPI
NtCreateSection
(
HANDLE
*
,
ACCESS_MASK
,
const
OBJECT_ATTRIBUTES
*
,
const
LARGE_INTEGER
*
,
ULONG
,
ULONG
,
HANDLE
);
...
...
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