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
8ea25acd
Commit
8ea25acd
authored
Apr 15, 2008
by
Reece Dunn
Committed by
Alexandre Julliard
Apr 17, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shlwapi: Fixed the todo blocks in the SHCreateStreamOnFile tests.
parent
ae576c40
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
53 deletions
+15
-53
istream.c
dlls/shlwapi/istream.c
+15
-22
istream.c
dlls/shlwapi/tests/istream.c
+0
-31
No files found.
dlls/shlwapi/istream.c
View file @
8ea25acd
...
...
@@ -119,13 +119,10 @@ static HRESULT WINAPI IStream_fnRead(IStream *iface, void* pv, ULONG cb, ULONG*
TRACE
(
"(%p,%p,0x%08x,%p)
\n
"
,
This
,
pv
,
cb
,
pcbRead
);
if
(
!
pv
)
return
STG_E_INVALIDPOINTER
;
if
(
!
ReadFile
(
This
->
hFile
,
pv
,
cb
,
&
dwRead
,
NULL
))
{
ERR
(
"error %d reading file
\n
"
,
GetLastError
());
return
HRESULT_FROM_WIN32
(
GetLastError
())
;
WARN
(
"error %d reading file
\n
"
,
GetLastError
());
return
S_FALSE
;
}
if
(
pcbRead
)
*
pcbRead
=
dwRead
;
...
...
@@ -142,16 +139,13 @@ static HRESULT WINAPI IStream_fnWrite(IStream *iface, const void* pv, ULONG cb,
TRACE
(
"(%p,%p,0x%08x,%p)
\n
"
,
This
,
pv
,
cb
,
pcbWritten
);
if
(
!
pv
)
return
STG_E_INVALIDPOINTER
;
switch
(
STGM_ACCESS_MODE
(
This
->
dwMode
))
{
case
STGM_WRITE
:
case
STGM_READWRITE
:
break
;
default:
return
E_FAIL
;
return
STG_E_ACCESSDENIED
;
}
if
(
!
WriteFile
(
This
->
hFile
,
pv
,
cb
,
&
dwWritten
,
NULL
))
...
...
@@ -176,7 +170,7 @@ static HRESULT WINAPI IStream_fnSeek(IStream *iface, LARGE_INTEGER dlibMove,
IStream_fnCommit
(
iface
,
0
);
/* If ever buffered, this will be needed */
dwPos
=
SetFilePointer
(
This
->
hFile
,
dlibMove
.
u
.
LowPart
,
NULL
,
dwOrigin
);
if
(
dwPos
==
INVALID_SET_FILE_POINTER
)
return
E_FAIL
;
return
HRESULT_FROM_WIN32
(
GetLastError
())
;
if
(
pNewPos
)
{
...
...
@@ -224,7 +218,7 @@ static HRESULT WINAPI IStream_fnCopyTo(IStream *iface, IStream* pstm, ULARGE_INT
pcbWritten
->
QuadPart
=
0
;
if
(
!
pstm
)
return
S
TG_E_INVALIDPOINTER
;
return
S
_OK
;
IStream_fnCommit
(
iface
,
0
);
/* If ever buffered, this will be needed */
...
...
@@ -418,9 +412,6 @@ HRESULT WINAPI SHCreateStreamOnFileEx(LPCWSTR lpszPath, DWORD dwMode,
*
lppStream
=
NULL
;
if
(
dwMode
&
STGM_TRANSACTED
)
return
E_INVALIDARG
;
/* Access */
switch
(
STGM_ACCESS_MODE
(
dwMode
))
{
...
...
@@ -440,6 +431,9 @@ HRESULT WINAPI SHCreateStreamOnFileEx(LPCWSTR lpszPath, DWORD dwMode,
/* Sharing */
switch
(
STGM_SHARE_MODE
(
dwMode
))
{
case
0
:
dwShare
=
FILE_SHARE_READ
|
FILE_SHARE_WRITE
;
break
;
case
STGM_SHARE_DENY_READ
:
dwShare
=
FILE_SHARE_WRITE
;
break
;
...
...
@@ -459,7 +453,7 @@ HRESULT WINAPI SHCreateStreamOnFileEx(LPCWSTR lpszPath, DWORD dwMode,
switch
(
STGM_CREATE_MODE
(
dwMode
))
{
case
STGM_FAILIFTHERE
:
dwCreate
=
OPEN_EXISTING
;
dwCreate
=
bCreate
?
CREATE_NEW
:
OPEN_EXISTING
;
break
;
case
STGM_CREATE
:
dwCreate
=
CREATE_ALWAYS
;
...
...
@@ -473,12 +467,7 @@ HRESULT WINAPI SHCreateStreamOnFileEx(LPCWSTR lpszPath, DWORD dwMode,
dwAttributes
,
0
);
if
(
hFile
==
INVALID_HANDLE_VALUE
)
{
HRESULT
hRet
=
(
HRESULT
)
GetLastError
();
if
(
hRet
>
0
)
hRet
=
HRESULT_FROM_WIN32
(
hRet
);
return
hRet
;
}
return
HRESULT_FROM_WIN32
(
GetLastError
());
*
lppStream
=
IStream_Create
(
lpszPath
,
hFile
,
dwMode
);
...
...
@@ -503,6 +492,9 @@ HRESULT WINAPI SHCreateStreamOnFileW(LPCWSTR lpszPath, DWORD dwMode,
if
(
!
lpszPath
||
!
lppStream
)
return
E_INVALIDARG
;
if
((
dwMode
&
(
STGM_CONVERT
|
STGM_DELETEONRELEASE
|
STGM_TRANSACTED
))
!=
0
)
return
E_INVALIDARG
;
return
SHCreateStreamOnFileEx
(
lpszPath
,
dwMode
,
0
,
FALSE
,
NULL
,
lppStream
);
}
...
...
@@ -528,7 +520,8 @@ HRESULT WINAPI SHCreateStreamOnFileA(LPCSTR lpszPath, DWORD dwMode,
TRACE
(
"(%s,%d,%p)
\n
"
,
debugstr_a
(
lpszPath
),
dwMode
,
lppStream
);
if
(
!
lpszPath
)
return
E_INVALIDARG
;
return
HRESULT_FROM_WIN32
(
ERROR_PATH_NOT_FOUND
);
MultiByteToWideChar
(
0
,
0
,
lpszPath
,
-
1
,
szPath
,
MAX_PATH
);
return
SHCreateStreamOnFileW
(
szPath
,
dwMode
,
lppStream
);
}
...
...
dlls/shlwapi/tests/istream.c
View file @
8ea25acd
...
...
@@ -198,7 +198,6 @@ static void test_SHCreateStreamOnFileA(DWORD mode)
stream
=
NULL
;
ret
=
(
*
pSHCreateStreamOnFileA
)(
NULL
,
mode
,
&
stream
);
todo_wine
ok
(
ret
==
HRESULT_FROM_WIN32
(
ERROR_PATH_NOT_FOUND
),
"SHCreateStreamOnFileA: expected HRESULT_FROM_WIN32(ERROR_PATH_NOT_FOUND), got 0x%08x
\n
"
,
ret
);
ok
(
stream
==
NULL
,
"SHCreateStreamOnFileA: expected a NULL IStream object, got %p
\n
"
,
stream
);
...
...
@@ -226,15 +225,12 @@ static void test_SHCreateStreamOnFileA(DWORD mode)
stream
=
NULL
;
ret
=
(
*
pSHCreateStreamOnFileA
)(
test_file
,
mode
|
STGM_FAILIFTHERE
,
&
stream
);
todo_wine
ok
(
ret
==
HRESULT_FROM_WIN32
(
ERROR_FILE_NOT_FOUND
),
"SHCreateStreamOnFileA: expected HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND), got 0x%08x
\n
"
,
ret
);
ok
(
stream
==
NULL
,
"SHCreateStreamOnFileA: expected a NULL IStream object, got %p
\n
"
,
stream
);
stream
=
NULL
;
ret
=
(
*
pSHCreateStreamOnFileA
)(
test_file
,
mode
|
STGM_CREATE
,
&
stream
);
todo_wine
ok
(
ret
==
S_OK
,
"SHCreateStreamOnFileA: expected S_OK, got 0x%08x
\n
"
,
ret
);
todo_wine
ok
(
stream
!=
NULL
,
"SHCreateStreamOnFileA: expected a valid IStream object, got NULL
\n
"
);
if
(
stream
)
{
...
...
@@ -250,9 +246,7 @@ static void test_SHCreateStreamOnFileA(DWORD mode)
stream
=
NULL
;
ret
=
(
*
pSHCreateStreamOnFileA
)(
test_file
,
mode
|
STGM_FAILIFTHERE
,
&
stream
);
todo_wine
ok
(
ret
==
S_OK
,
"SHCreateStreamOnFileA: expected S_OK, got 0x%08x
\n
"
,
ret
);
todo_wine
ok
(
stream
!=
NULL
,
"SHCreateStreamOnFileA: expected a valid IStream object, got NULL
\n
"
);
if
(
stream
)
{
...
...
@@ -264,9 +258,7 @@ static void test_SHCreateStreamOnFileA(DWORD mode)
stream
=
NULL
;
ret
=
(
*
pSHCreateStreamOnFileA
)(
test_file
,
mode
|
STGM_CREATE
,
&
stream
);
todo_wine
ok
(
ret
==
S_OK
,
"SHCreateStreamOnFileA: expected S_OK, got 0x%08x
\n
"
,
ret
);
todo_wine
ok
(
stream
!=
NULL
,
"SHCreateStreamOnFileA: expected a valid IStream object, got NULL
\n
"
);
if
(
stream
)
{
...
...
@@ -322,15 +314,12 @@ static void test_SHCreateStreamOnFileW(DWORD mode)
stream
=
NULL
;
ret
=
(
*
pSHCreateStreamOnFileW
)(
test_file
,
mode
|
STGM_FAILIFTHERE
,
&
stream
);
todo_wine
ok
(
ret
==
HRESULT_FROM_WIN32
(
ERROR_FILE_NOT_FOUND
),
"SHCreateStreamOnFileW: expected HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND), got 0x%08x
\n
"
,
ret
);
ok
(
stream
==
NULL
,
"SHCreateStreamOnFileW: expected a NULL IStream object, got %p
\n
"
,
stream
);
stream
=
NULL
;
ret
=
(
*
pSHCreateStreamOnFileW
)(
test_file
,
mode
|
STGM_CREATE
,
&
stream
);
todo_wine
ok
(
ret
==
S_OK
,
"SHCreateStreamOnFileW: expected S_OK, got 0x%08x
\n
"
,
ret
);
todo_wine
ok
(
stream
!=
NULL
,
"SHCreateStreamOnFileW: expected a valid IStream object, got NULL
\n
"
);
if
(
stream
)
{
...
...
@@ -346,9 +335,7 @@ static void test_SHCreateStreamOnFileW(DWORD mode)
stream
=
NULL
;
ret
=
(
*
pSHCreateStreamOnFileW
)(
test_file
,
mode
|
STGM_FAILIFTHERE
,
&
stream
);
todo_wine
ok
(
ret
==
S_OK
,
"SHCreateStreamOnFileW: expected S_OK, got 0x%08x
\n
"
,
ret
);
todo_wine
ok
(
stream
!=
NULL
,
"SHCreateStreamOnFileW: expected a valid IStream object, got NULL
\n
"
);
if
(
stream
)
{
...
...
@@ -360,9 +347,7 @@ static void test_SHCreateStreamOnFileW(DWORD mode)
stream
=
NULL
;
ret
=
(
*
pSHCreateStreamOnFileW
)(
test_file
,
mode
|
STGM_CREATE
,
&
stream
);
todo_wine
ok
(
ret
==
S_OK
,
"SHCreateStreamOnFileW: expected S_OK, got 0x%08x
\n
"
,
ret
);
todo_wine
ok
(
stream
!=
NULL
,
"SHCreateStreamOnFileW: expected a valid IStream object, got NULL
\n
"
);
if
(
stream
)
{
...
...
@@ -397,7 +382,6 @@ static void test_SHCreateStreamOnFileEx(DWORD mode, DWORD stgm)
stream
=
NULL
;
ret
=
(
*
pSHCreateStreamOnFileEx
)(
test_file
,
mode
,
0
,
FALSE
,
template
,
&
stream
);
todo_wine
ok
(
ret
==
HRESULT_FROM_WIN32
(
ERROR_FILE_NOT_FOUND
),
"SHCreateStreamOnFileEx: expected HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND), got 0x%08x
\n
"
,
ret
);
ok
(
stream
==
NULL
,
"SHCreateStreamOnFileEx: expected a NULL IStream object, got %p
\n
"
,
stream
);
...
...
@@ -419,16 +403,13 @@ static void test_SHCreateStreamOnFileEx(DWORD mode, DWORD stgm)
return
;
}
}
else
{
todo_wine
ok
(
ret
==
HRESULT_FROM_WIN32
(
ERROR_FILE_NOT_FOUND
),
"SHCreateStreamOnFileEx: expected HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND), got 0x%08x
\n
"
,
ret
);
}
ok
(
stream
==
NULL
,
"SHCreateStreamOnFileEx: expected a NULL IStream object, got %p
\n
"
,
stream
);
stream
=
NULL
;
ret
=
(
*
pSHCreateStreamOnFileEx
)(
test_file
,
mode
|
STGM_FAILIFTHERE
|
stgm
,
0
,
TRUE
,
NULL
,
&
stream
);
todo_wine
ok
(
ret
==
S_OK
,
"SHCreateStreamOnFileEx: expected S_OK, got 0x%08x
\n
"
,
ret
);
todo_wine
ok
(
stream
!=
NULL
,
"SHCreateStreamOnFileEx: expected a valid IStream object, got NULL
\n
"
);
if
(
stream
)
{
...
...
@@ -442,9 +423,7 @@ static void test_SHCreateStreamOnFileEx(DWORD mode, DWORD stgm)
stream
=
NULL
;
ret
=
(
*
pSHCreateStreamOnFileEx
)(
test_file
,
mode
|
STGM_CREATE
|
stgm
,
0
,
FALSE
,
NULL
,
&
stream
);
todo_wine
ok
(
ret
==
S_OK
,
"SHCreateStreamOnFileEx: expected S_OK, got 0x%08x
\n
"
,
ret
);
todo_wine
ok
(
stream
!=
NULL
,
"SHCreateStreamOnFileEx: expected a valid IStream object, got NULL
\n
"
);
if
(
stream
)
{
...
...
@@ -458,9 +437,7 @@ static void test_SHCreateStreamOnFileEx(DWORD mode, DWORD stgm)
stream
=
NULL
;
ret
=
(
*
pSHCreateStreamOnFileEx
)(
test_file
,
mode
|
STGM_CREATE
|
stgm
,
0
,
TRUE
,
NULL
,
&
stream
);
todo_wine
ok
(
ret
==
S_OK
,
"SHCreateStreamOnFileEx: expected S_OK, got 0x%08x
\n
"
,
ret
);
todo_wine
ok
(
stream
!=
NULL
,
"SHCreateStreamOnFileEx: expected a valid IStream object, got NULL
\n
"
);
if
(
stream
)
{
...
...
@@ -476,9 +453,7 @@ static void test_SHCreateStreamOnFileEx(DWORD mode, DWORD stgm)
stream
=
NULL
;
ret
=
(
*
pSHCreateStreamOnFileEx
)(
test_file
,
mode
|
STGM_FAILIFTHERE
|
stgm
,
0
,
FALSE
,
NULL
,
&
stream
);
todo_wine
ok
(
ret
==
S_OK
,
"SHCreateStreamOnFileEx: expected S_OK, got 0x%08x
\n
"
,
ret
);
todo_wine
ok
(
stream
!=
NULL
,
"SHCreateStreamOnFileEx: expected a valid IStream object, got NULL
\n
"
);
if
(
stream
)
{
...
...
@@ -490,15 +465,12 @@ static void test_SHCreateStreamOnFileEx(DWORD mode, DWORD stgm)
stream
=
NULL
;
ret
=
(
*
pSHCreateStreamOnFileEx
)(
test_file
,
mode
|
STGM_FAILIFTHERE
|
stgm
,
0
,
TRUE
,
NULL
,
&
stream
);
todo_wine
ok
(
ret
==
HRESULT_FROM_WIN32
(
ERROR_FILE_EXISTS
),
"SHCreateStreamOnFileEx: expected HRESULT_FROM_WIN32(ERROR_FILE_EXISTS), got 0x%08x
\n
"
,
ret
);
ok
(
stream
==
NULL
,
"SHCreateStreamOnFileEx: expected a NULL IStream object, got %p
\n
"
,
stream
);
stream
=
NULL
;
ret
=
(
*
pSHCreateStreamOnFileEx
)(
test_file
,
mode
|
STGM_CREATE
|
stgm
,
0
,
FALSE
,
NULL
,
&
stream
);
todo_wine
ok
(
ret
==
S_OK
,
"SHCreateStreamOnFileEx: expected S_OK, got 0x%08x
\n
"
,
ret
);
todo_wine
ok
(
stream
!=
NULL
,
"SHCreateStreamOnFileEx: expected a valid IStream object, got NULL
\n
"
);
if
(
stream
)
{
...
...
@@ -510,9 +482,7 @@ static void test_SHCreateStreamOnFileEx(DWORD mode, DWORD stgm)
stream
=
NULL
;
ret
=
(
*
pSHCreateStreamOnFileEx
)(
test_file
,
mode
|
STGM_CREATE
|
stgm
,
0
,
TRUE
,
NULL
,
&
stream
);
todo_wine
ok
(
ret
==
S_OK
,
"SHCreateStreamOnFileEx: expected S_OK, got 0x%08x
\n
"
,
ret
);
todo_wine
ok
(
stream
!=
NULL
,
"SHCreateStreamOnFileEx: expected a valid IStream object, got NULL
\n
"
);
if
(
stream
)
{
...
...
@@ -522,7 +492,6 @@ static void test_SHCreateStreamOnFileEx(DWORD mode, DWORD stgm)
ok
(
refcount
==
0
,
"SHCreateStreamOnFileEx: expected 0, got %d
\n
"
,
refcount
);
}
todo_wine
ok
(
DeleteFileW
(
test_file
),
"SHCreateStreamOnFileEx: could not delete the test file, got error %d
\n
"
,
GetLastError
());
}
...
...
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