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
eb59527f
Commit
eb59527f
authored
Feb 02, 2022
by
Nikolay Sivov
Committed by
Alexandre Julliard
Feb 02, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
scrrun/tests: Add some tests for DoOpenPipeStream().
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
8f8fe74f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
96 additions
and
1 deletion
+96
-1
filesystem.c
dlls/scrrun/filesystem.c
+7
-0
scrrun.spec
dlls/scrrun/scrrun.spec
+1
-1
filesystem.c
dlls/scrrun/tests/filesystem.c
+88
-0
No files found.
dlls/scrrun/filesystem.c
View file @
eb59527f
...
@@ -839,6 +839,13 @@ static HRESULT create_textstream(const WCHAR *filename, DWORD disposition, IOMod
...
@@ -839,6 +839,13 @@ static HRESULT create_textstream(const WCHAR *filename, DWORD disposition, IOMod
return
S_OK
;
return
S_OK
;
}
}
HRESULT
WINAPI
DoOpenPipeStream
(
HANDLE
pipe
,
IOMode
mode
,
ITextStream
**
stream
)
{
FIXME
(
"%p, %d, %p.
\n
"
,
pipe
,
mode
,
stream
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
drive_QueryInterface
(
IDrive
*
iface
,
REFIID
riid
,
void
**
obj
)
static
HRESULT
WINAPI
drive_QueryInterface
(
IDrive
*
iface
,
REFIID
riid
,
void
**
obj
)
{
{
struct
drive
*
This
=
impl_from_IDrive
(
iface
);
struct
drive
*
This
=
impl_from_IDrive
(
iface
);
...
...
dlls/scrrun/scrrun.spec
View file @
eb59527f
...
@@ -3,4 +3,4 @@
...
@@ -3,4 +3,4 @@
@ stdcall -private DllGetClassObject(ptr ptr ptr)
@ stdcall -private DllGetClassObject(ptr ptr ptr)
@ stdcall -private DllRegisterServer()
@ stdcall -private DllRegisterServer()
@ stdcall -private DllUnregisterServer()
@ stdcall -private DllUnregisterServer()
@ st
ub DoOpenPipeStream
@ st
dcall DoOpenPipeStream(long long ptr)
dlls/scrrun/tests/filesystem.c
View file @
eb59527f
...
@@ -35,6 +35,8 @@
...
@@ -35,6 +35,8 @@
static
IFileSystem3
*
fs3
;
static
IFileSystem3
*
fs3
;
static
HRESULT
(
WINAPI
*
pDoOpenPipeStream
)(
HANDLE
pipe
,
DWORD
mode
,
ITextStream
**
stream
);
/* w2k and 2k3 error code. */
/* w2k and 2k3 error code. */
#define E_VAR_NOT_SET 0x800a005b
#define E_VAR_NOT_SET 0x800a005b
...
@@ -2590,6 +2592,91 @@ static void test_MoveFile(void)
...
@@ -2590,6 +2592,91 @@ static void test_MoveFile(void)
SysFreeString
(
str
);
SysFreeString
(
str
);
}
}
static
void
test_DoOpenPipeStream
(
void
)
{
static
const
char
testdata
[]
=
"test"
;
ITextStream
*
stream_read
,
*
stream_write
;
SECURITY_ATTRIBUTES
pipe_attr
;
HANDLE
piperead
,
pipewrite
;
DWORD
written
;
HRESULT
hr
;
BSTR
str
;
BOOL
ret
;
pDoOpenPipeStream
=
(
void
*
)
GetProcAddress
(
GetModuleHandleA
(
"scrrun.dll"
),
"DoOpenPipeStream"
);
pipe_attr
.
nLength
=
sizeof
(
SECURITY_ATTRIBUTES
);
pipe_attr
.
bInheritHandle
=
TRUE
;
pipe_attr
.
lpSecurityDescriptor
=
NULL
;
ret
=
CreatePipe
(
&
piperead
,
&
pipewrite
,
&
pipe_attr
,
0
);
ok
(
ret
,
"Failed to create pipes.
\n
"
);
hr
=
pDoOpenPipeStream
(
piperead
,
ForReading
,
&
stream_read
);
todo_wine
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
if
(
SUCCEEDED
(
hr
))
{
ok
(
!!
stream_read
,
"Unexpected stream pointer.
\n
"
);
ret
=
WriteFile
(
pipewrite
,
testdata
,
sizeof
(
testdata
),
&
written
,
NULL
);
ok
(
ret
,
"Failed to write to the pipe.
\n
"
);
ok
(
written
==
sizeof
(
testdata
),
"Write to anonymous pipe wrote %d bytes.
\n
"
,
written
);
hr
=
ITextStream_Read
(
stream_read
,
4
,
&
str
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
ok
(
!
wcscmp
(
str
,
L"test"
),
"Unexpected data read %s.
\n
"
,
wine_dbgstr_w
(
str
));
SysFreeString
(
str
);
ITextStream_Release
(
stream_read
);
}
ret
=
CloseHandle
(
pipewrite
);
ok
(
ret
,
"Unexpected return value.
\n
"
);
/* Stream takes ownership. */
ret
=
CloseHandle
(
piperead
);
todo_wine
ok
(
!
ret
,
"Unexpected return value.
\n
"
);
/* Streams on both ends. */
ret
=
CreatePipe
(
&
piperead
,
&
pipewrite
,
&
pipe_attr
,
0
);
ok
(
ret
,
"Failed to create pipes.
\n
"
);
stream_read
=
NULL
;
hr
=
pDoOpenPipeStream
(
piperead
,
ForReading
,
&
stream_read
);
todo_wine
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
stream_write
=
NULL
;
hr
=
pDoOpenPipeStream
(
pipewrite
,
ForWriting
,
&
stream_write
);
todo_wine
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
if
(
SUCCEEDED
(
hr
))
{
str
=
SysAllocString
(
L"data"
);
hr
=
ITextStream_Write
(
stream_write
,
str
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
ITextStream_Write
(
stream_read
,
str
);
ok
(
hr
==
CTL_E_BADFILEMODE
,
"Unexpected hr %#x.
\n
"
,
hr
);
SysFreeString
(
str
);
hr
=
ITextStream_Read
(
stream_write
,
1
,
&
str
);
ok
(
hr
==
CTL_E_BADFILEMODE
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
ITextStream_Read
(
stream_read
,
4
,
&
str
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
ok
(
!
wcscmp
(
str
,
L"data"
),
"Unexpected data.
\n
"
);
SysFreeString
(
str
);
}
if
(
stream_read
)
ITextStream_Release
(
stream_read
);
if
(
stream_write
)
ITextStream_Release
(
stream_write
);
}
START_TEST
(
filesystem
)
START_TEST
(
filesystem
)
{
{
HRESULT
hr
;
HRESULT
hr
;
...
@@ -2632,6 +2719,7 @@ START_TEST(filesystem)
...
@@ -2632,6 +2719,7 @@ START_TEST(filesystem)
test_GetExtensionName
();
test_GetExtensionName
();
test_GetSpecialFolder
();
test_GetSpecialFolder
();
test_MoveFile
();
test_MoveFile
();
test_DoOpenPipeStream
();
IFileSystem3_Release
(
fs3
);
IFileSystem3_Release
(
fs3
);
...
...
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