Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
16dc0378
Commit
16dc0378
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 mode keep the stream size above the small block limit.
parent
02fc79b2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
0 deletions
+28
-0
stg_stream.c
dlls/ole32/stg_stream.c
+4
-0
storage32.c
dlls/ole32/tests/storage32.c
+24
-0
No files found.
dlls/ole32/stg_stream.c
View file @
16dc0378
...
@@ -575,6 +575,10 @@ static HRESULT WINAPI StgStreamImpl_SetSize(
...
@@ -575,6 +575,10 @@ static HRESULT WINAPI StgStreamImpl_SetSize(
return
STG_E_ACCESSDENIED
;
return
STG_E_ACCESSDENIED
;
}
}
/* In simple mode keep the stream size above the small block limit */
if
(
This
->
parentStorage
->
ancestorStorage
->
base
.
openFlags
&
STGM_SIMPLE
)
libNewSize
.
u
.
LowPart
=
max
(
libNewSize
.
u
.
LowPart
,
LIMIT_TO_USE_SMALL_BLOCK
);
if
(
This
->
streamSize
.
u
.
LowPart
==
libNewSize
.
u
.
LowPart
)
if
(
This
->
streamSize
.
u
.
LowPart
==
libNewSize
.
u
.
LowPart
)
return
S_OK
;
return
S_OK
;
...
...
dlls/ole32/tests/storage32.c
View file @
16dc0378
...
@@ -1354,6 +1354,7 @@ static void test_simple(void)
...
@@ -1354,6 +1354,7 @@ static void test_simple(void)
HRESULT
r
;
HRESULT
r
;
IStream
*
stm
;
IStream
*
stm
;
static
const
WCHAR
stmname
[]
=
{
'C'
,
'O'
,
'N'
,
'T'
,
'E'
,
'N'
,
'T'
,
'S'
,
0
};
static
const
WCHAR
stmname
[]
=
{
'C'
,
'O'
,
'N'
,
'T'
,
'E'
,
'N'
,
'T'
,
'S'
,
0
};
static
const
WCHAR
stmname2
[]
=
{
'S'
,
'm'
,
'a'
,
'l'
,
'l'
,
0
};
LARGE_INTEGER
pos
;
LARGE_INTEGER
pos
;
ULARGE_INTEGER
upos
;
ULARGE_INTEGER
upos
;
DWORD
count
;
DWORD
count
;
...
@@ -1400,6 +1401,19 @@ static void test_simple(void)
...
@@ -1400,6 +1401,19 @@ static void test_simple(void)
IStream_Release
(
stm
);
IStream_Release
(
stm
);
r
=
IStorage_CreateStream
(
stg
,
stmname2
,
STGM_SHARE_EXCLUSIVE
|
STGM_READWRITE
,
0
,
0
,
&
stm
);
ok
(
r
==
S_OK
,
"got %08x
\n
"
,
r
);
upos
.
QuadPart
=
100
;
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
);
IStream_Release
(
stm
);
IStorage_Commit
(
stg
,
STGC_DEFAULT
);
IStorage_Commit
(
stg
,
STGC_DEFAULT
);
IStorage_Release
(
stg
);
IStorage_Release
(
stg
);
...
@@ -1415,6 +1429,16 @@ static void test_simple(void)
...
@@ -1415,6 +1429,16 @@ static void test_simple(void)
IStream_Release
(
stm
);
IStream_Release
(
stm
);
r
=
IStorage_OpenStream
(
stg
,
stmname2
,
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
==
4096
,
"got %d
\n
"
,
stat
.
cbSize
.
u
.
LowPart
);
IStream_Release
(
stm
);
IStorage_Release
(
stg
);
IStorage_Release
(
stg
);
DeleteFileW
(
filename
);
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