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
cc8c36c4
Commit
cc8c36c4
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, CreateStream with the STGM_CREATE flag should fail.
parent
0faf1558
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
0 deletions
+37
-0
storage32.c
dlls/ole32/storage32.c
+3
-0
storage32.c
dlls/ole32/tests/storage32.c
+34
-0
No files found.
dlls/ole32/storage32.c
View file @
cc8c36c4
...
@@ -992,6 +992,9 @@ static HRESULT WINAPI StorageBaseImpl_CreateStream(
...
@@ -992,6 +992,9 @@ static HRESULT WINAPI StorageBaseImpl_CreateStream(
return
STG_E_ACCESSDENIED
;
return
STG_E_ACCESSDENIED
;
}
}
if
(
This
->
ancestorStorage
->
base
.
openFlags
&
STGM_SIMPLE
)
if
(
grfMode
&
STGM_CREATE
)
return
STG_E_INVALIDFLAG
;
/*
/*
* Initialize the out parameter
* Initialize the out parameter
*/
*/
...
...
dlls/ole32/tests/storage32.c
View file @
cc8c36c4
...
@@ -1343,6 +1343,39 @@ void test_readonly(void)
...
@@ -1343,6 +1343,39 @@ void test_readonly(void)
DeleteFileA
(
"winetest"
);
DeleteFileA
(
"winetest"
);
}
}
static
void
test_simple
(
void
)
{
/* Tests for STGM_SIMPLE mode */
static
const
WCHAR
szPrefix
[]
=
{
's'
,
't'
,
'g'
,
0
};
static
const
WCHAR
szDot
[]
=
{
'.'
,
0
};
WCHAR
filename
[
MAX_PATH
];
IStorage
*
stg
;
HRESULT
r
;
IStream
*
stm
;
static
const
WCHAR
stmname
[]
=
{
'C'
,
'O'
,
'N'
,
'T'
,
'E'
,
'N'
,
'T'
,
'S'
,
0
};
if
(
!
GetTempFileNameW
(
szDot
,
szPrefix
,
0
,
filename
))
return
;
DeleteFileW
(
filename
);
r
=
StgCreateDocfile
(
filename
,
STGM_SIMPLE
|
STGM_CREATE
|
STGM_SHARE_EXCLUSIVE
|
STGM_READWRITE
,
0
,
&
stg
);
ok
(
r
==
S_OK
,
"got %08x
\n
"
,
r
);
r
=
IStorage_CreateStream
(
stg
,
stmname
,
STGM_CREATE
|
STGM_SHARE_EXCLUSIVE
|
STGM_READWRITE
,
0
,
0
,
&
stm
);
ok
(
r
==
STG_E_INVALIDFLAG
,
"got %08x
\n
"
,
r
);
r
=
IStorage_CreateStream
(
stg
,
stmname
,
STGM_SHARE_EXCLUSIVE
|
STGM_READWRITE
,
0
,
0
,
&
stm
);
ok
(
r
==
S_OK
,
"got %08x
\n
"
,
r
);
IStream_Release
(
stm
);
IStorage_Commit
(
stg
,
STGC_DEFAULT
);
IStorage_Release
(
stg
);
DeleteFileW
(
filename
);
}
START_TEST
(
storage32
)
START_TEST
(
storage32
)
{
{
test_hglobal_storage_stat
();
test_hglobal_storage_stat
();
...
@@ -1357,4 +1390,5 @@ START_TEST(storage32)
...
@@ -1357,4 +1390,5 @@ START_TEST(storage32)
test_access
();
test_access
();
test_writeclassstg
();
test_writeclassstg
();
test_readonly
();
test_readonly
();
test_simple
();
}
}
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