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
02fc79b2
Commit
02fc79b2
authored
Jun 01, 2009
by
Huw Davies
Committed by
Alexandre Julliard
Jun 02, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ole32: In simple create mode the size returned by IStream_Stat is actually the…
ole32: In simple create mode the size returned by IStream_Stat is actually the current stream position.
parent
cc8c36c4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
50 additions
and
0 deletions
+50
-0
stg_stream.c
dlls/ole32/stg_stream.c
+6
-0
storage32.c
dlls/ole32/tests/storage32.c
+44
-0
No files found.
dlls/ole32/stg_stream.c
View file @
02fc79b2
...
...
@@ -841,12 +841,18 @@ static HRESULT WINAPI StgStreamImpl_Stat(
if
(
readSuccessful
)
{
StorageImpl
*
root
=
This
->
parentStorage
->
ancestorStorage
;
StorageUtl_CopyPropertyToSTATSTG
(
pstatstg
,
&
curProperty
,
grfStatFlag
);
pstatstg
->
grfMode
=
This
->
grfMode
;
/* In simple create mode cbSize is the current pos */
if
((
root
->
base
.
openFlags
&
STGM_SIMPLE
)
&&
root
->
create
)
pstatstg
->
cbSize
=
This
->
currentPosition
;
return
S_OK
;
}
...
...
dlls/ole32/tests/storage32.c
View file @
02fc79b2
...
...
@@ -1354,6 +1354,10 @@ static void test_simple(void)
HRESULT
r
;
IStream
*
stm
;
static
const
WCHAR
stmname
[]
=
{
'C'
,
'O'
,
'N'
,
'T'
,
'E'
,
'N'
,
'T'
,
'S'
,
0
};
LARGE_INTEGER
pos
;
ULARGE_INTEGER
upos
;
DWORD
count
;
STATSTG
stat
;
if
(
!
GetTempFileNameW
(
szDot
,
szPrefix
,
0
,
filename
))
return
;
...
...
@@ -1368,11 +1372,51 @@ static void test_simple(void)
r
=
IStorage_CreateStream
(
stg
,
stmname
,
STGM_SHARE_EXCLUSIVE
|
STGM_READWRITE
,
0
,
0
,
&
stm
);
ok
(
r
==
S_OK
,
"got %08x
\n
"
,
r
);
upos
.
QuadPart
=
6000
;
r
=
IStream_SetSize
(
stm
,
upos
);
ok
(
r
==
S_OK
,
"got %08x
\n
"
,
r
);
r
=
IStream_Write
(
stm
,
"foo"
,
3
,
&
count
);
ok
(
r
==
S_OK
,
"got %08x
\n
"
,
r
);
ok
(
count
==
3
,
"got %d
\n
"
,
count
);
pos
.
QuadPart
=
0
;
r
=
IStream_Seek
(
stm
,
pos
,
STREAM_SEEK_CUR
,
&
upos
);
ok
(
r
==
S_OK
,
"got %08x
\n
"
,
r
);
ok
(
upos
.
QuadPart
==
3
,
"got %d
\n
"
,
upos
.
u
.
LowPart
);
r
=
IStream_Stat
(
stm
,
&
stat
,
STATFLAG_NONAME
);
ok
(
r
==
S_OK
,
"got %08x
\n
"
,
r
);
ok
(
stat
.
cbSize
.
QuadPart
==
3
,
"got %d
\n
"
,
stat
.
cbSize
.
u
.
LowPart
);
pos
.
QuadPart
=
1
;
r
=
IStream_Seek
(
stm
,
pos
,
STREAM_SEEK_SET
,
&
upos
);
ok
(
r
==
S_OK
,
"got %08x
\n
"
,
r
);
ok
(
upos
.
QuadPart
==
1
,
"got %d
\n
"
,
upos
.
u
.
LowPart
);
r
=
IStream_Stat
(
stm
,
&
stat
,
STATFLAG_NONAME
);
ok
(
r
==
S_OK
,
"got %08x
\n
"
,
r
);
ok
(
stat
.
cbSize
.
QuadPart
==
1
,
"got %d
\n
"
,
stat
.
cbSize
.
u
.
LowPart
);
IStream_Release
(
stm
);
IStorage_Commit
(
stg
,
STGC_DEFAULT
);
IStorage_Release
(
stg
);
r
=
StgOpenStorage
(
filename
,
NULL
,
STGM_SIMPLE
|
STGM_SHARE_EXCLUSIVE
|
STGM_READWRITE
,
NULL
,
0
,
&
stg
);
ok
(
r
==
S_OK
,
"got %08x
\n
"
,
r
);
r
=
IStorage_OpenStream
(
stg
,
stmname
,
NULL
,
STGM_SHARE_EXCLUSIVE
|
STGM_READWRITE
,
0
,
&
stm
);
ok
(
r
==
S_OK
,
"got %08x
\n
"
,
r
);
r
=
IStream_Stat
(
stm
,
&
stat
,
STATFLAG_NONAME
);
ok
(
r
==
S_OK
,
"got %08x
\n
"
,
r
);
ok
(
stat
.
cbSize
.
QuadPart
==
6000
,
"got %d
\n
"
,
stat
.
cbSize
.
u
.
LowPart
);
IStream_Release
(
stm
);
IStorage_Release
(
stg
);
DeleteFileW
(
filename
);
}
...
...
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