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
a7609ee1
Commit
a7609ee1
authored
Mar 05, 2005
by
Mike McCormack
Committed by
Alexandre Julliard
Mar 05, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Test and fix grfMode handling in StgOpenDocfile.
parent
6cef9c09
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
175 additions
and
114 deletions
+175
-114
storage32.c
dlls/ole32/storage32.c
+122
-102
storage32.c
dlls/ole32/tests/storage32.c
+53
-12
No files found.
dlls/ole32/storage32.c
View file @
a7609ee1
This diff is collapsed.
Click to expand it.
dlls/ole32/tests/storage32.c
View file @
a7609ee1
...
...
@@ -90,16 +90,32 @@ void test_create_storage_modes(void)
ok
(
r
==
STG_E_INVALIDFLAG
,
"StgCreateDocfile succeeded
\n
"
);
r
=
StgCreateDocfile
(
filename
,
STGM_CREATE
|
STGM_SHARE_EXCLUSIVE
,
0
,
&
stg
);
ok
(
r
==
STG_E_INVALIDFLAG
,
"StgCreateDocfile succeeded
\n
"
);
r
=
StgCreateDocfile
(
filename
,
STGM_CREATE
|
STGM_SHARE_EXCLUSIVE
|
STGM_READWRITE
,
0
,
NULL
);
r
=
StgCreateDocfile
(
filename
,
STGM_CREATE
|
STGM_SHARE_EXCLUSIVE
|
STGM_READWRITE
,
0
,
NULL
);
ok
(
r
==
STG_E_INVALIDPOINTER
,
"StgCreateDocfile succeeded
\n
"
);
r
=
StgCreateDocfile
(
filename
,
STGM_CREATE
|
STGM_SHARE_EXCLUSIVE
|
STGM_READWRITE
,
1
,
&
stg
);
r
=
StgCreateDocfile
(
filename
,
STGM_CREATE
|
STGM_SHARE_EXCLUSIVE
|
STGM_READWRITE
,
1
,
&
stg
);
ok
(
r
==
STG_E_INVALIDPARAMETER
,
"StgCreateDocfile succeeded
\n
"
);
r
=
StgCreateDocfile
(
filename
,
STGM_CREATE
|
STGM_SHARE_DENY_WRITE
|
STGM_READWRITE
,
0
,
&
stg
);
ok
(
r
==
STG_E_INVALIDFLAG
,
"StgCreateDocfile succeeded
\n
"
);
r
=
StgCreateDocfile
(
filename
,
STGM_SHARE_EXCLUSIVE
|
STGM_READ
,
0
,
&
stg
);
ok
(
r
==
STG_E_INVALIDFLAG
,
"StgCreateDocfile succeeded
\n
"
);
r
=
StgCreateDocfile
(
filename
,
STGM_PRIORITY
,
0
,
&
stg
);
ok
(
r
==
STG_E_INVALIDFLAG
,
"StgCreateDocfile succeeded
\n
"
);
/* StgCreateDocfile seems to be very particular about the flags it accepts */
r
=
StgCreateDocfile
(
filename
,
STGM_SHARE_EXCLUSIVE
|
STGM_READWRITE
|
STGM_TRANSACTED
|
STGM_WRITE
,
0
,
&
stg
);
ok
(
r
==
STG_E_INVALIDFLAG
,
"StgCreateDocfile succeeded
\n
"
);
r
=
StgCreateDocfile
(
filename
,
STGM_SHARE_EXCLUSIVE
|
STGM_READWRITE
|
STGM_TRANSACTED
|
8
,
0
,
&
stg
);
ok
(
r
==
STG_E_INVALIDFLAG
,
"StgCreateDocfile succeeded
\n
"
);
r
=
StgCreateDocfile
(
filename
,
STGM_SHARE_EXCLUSIVE
|
STGM_READWRITE
|
STGM_TRANSACTED
|
0x80
,
0
,
&
stg
);
ok
(
r
==
STG_E_INVALIDFLAG
,
"StgCreateDocfile succeeded
\n
"
);
r
=
StgCreateDocfile
(
filename
,
STGM_SHARE_EXCLUSIVE
|
STGM_READWRITE
|
STGM_TRANSACTED
|
0x800
,
0
,
&
stg
);
ok
(
r
==
STG_E_INVALIDFLAG
,
"StgCreateDocfile succeeded
\n
"
);
r
=
StgCreateDocfile
(
filename
,
STGM_SHARE_EXCLUSIVE
|
STGM_READWRITE
|
STGM_TRANSACTED
|
0x8000
,
0
,
&
stg
);
ok
(
r
==
STG_E_INVALIDFLAG
,
"StgCreateDocfile succeeded
\n
"
);
r
=
StgCreateDocfile
(
filename
,
STGM_SHARE_EXCLUSIVE
|
STGM_READWRITE
|
STGM_TRANSACTED
|
0x80000
,
0
,
&
stg
);
ok
(
r
==
STG_E_INVALIDFLAG
,
"StgCreateDocfile succeeded
\n
"
);
r
=
StgCreateDocfile
(
filename
,
STGM_SHARE_EXCLUSIVE
|
STGM_READWRITE
|
STGM_TRANSACTED
|
0x800000
,
0
,
&
stg
);
ok
(
r
==
STG_E_INVALIDFLAG
,
"StgCreateDocfile succeeded
\n
"
);
ok
(
stg
==
NULL
,
"stg was set
\n
"
);
/* check what happens if the file already exists */
...
...
@@ -107,8 +123,7 @@ void test_create_storage_modes(void)
ok
(
r
==
S_OK
,
"StgCreateDocfile failed
\n
"
);
r
=
IStorage_Release
(
stg
);
ok
(
r
==
0
,
"storage not released
\n
"
);
r
=
StgCreateDocfile
(
filename
,
STGM_SHARE_EXCLUSIVE
|
STGM_READWRITE
|
STGM_TRANSACTED
,
0
,
&
stg
);
r
=
StgCreateDocfile
(
filename
,
STGM_SHARE_EXCLUSIVE
|
STGM_READWRITE
|
STGM_TRANSACTED
,
0
,
&
stg
);
ok
(
r
==
STG_E_FILEALREADYEXISTS
,
"StgCreateDocfile wrong error
\n
"
);
r
=
StgCreateDocfile
(
filename
,
STGM_READ
,
0
,
&
stg
);
ok
(
r
==
STG_E_INVALIDFLAG
,
"StgCreateDocfile succeeded
\n
"
);
...
...
@@ -130,24 +145,50 @@ void test_create_storage_modes(void)
ok
(
r
==
STG_E_INVALIDFLAG
,
"StgCreateDocfile wrong error
\n
"
);
ok
(
DeleteFileW
(
filename
),
"failed to delete file
\n
"
);
r
=
StgCreateDocfile
(
filename
,
STGM_SHARE_EXCLUSIVE
|
STGM_READWRITE
|
STGM_TRANSACTED
,
0
,
&
stg
);
r
=
StgCreateDocfile
(
filename
,
STGM_SHARE_EXCLUSIVE
|
STGM_READWRITE
|
STGM_TRANSACTED
,
0
,
&
stg
);
ok
(
r
==
S_OK
,
"StgCreateDocfile failed
\n
"
);
r
=
IStorage_Release
(
stg
);
ok
(
r
==
0
,
"storage not released
\n
"
);
r
=
StgCreateDocfile
(
filename
,
STGM_SHARE_EXCLUSIVE
|
STGM_READWRITE
|
STGM_TRANSACTED
|
STGM_FAILIFTHERE
,
0
,
&
stg
);
r
=
StgCreateDocfile
(
filename
,
STGM_SHARE_EXCLUSIVE
|
STGM_READWRITE
|
STGM_TRANSACTED
|
STGM_FAILIFTHERE
,
0
,
&
stg
);
ok
(
r
==
STG_E_FILEALREADYEXISTS
,
"StgCreateDocfile wrong error
\n
"
);
r
=
StgCreateDocfile
(
filename
,
STGM_SHARE_EXCLUSIVE
|
STGM_WRITE
,
0
,
&
stg
);
ok
(
r
==
STG_E_FILEALREADYEXISTS
,
"StgCreateDocfile wrong error
\n
"
);
/*ok(DeleteFileW(filename), "failed to delete file\n"); */
r
=
StgCreateDocfile
(
filename
,
STGM_CREATE
|
STGM_SHARE_EXCLUSIVE
|
STGM_READWRITE
|
STGM_TRANSACTED
,
0
,
&
stg
);
r
=
StgCreateDocfile
(
filename
,
STGM_CREATE
|
STGM_SHARE_EXCLUSIVE
|
STGM_READWRITE
|
STGM_TRANSACTED
,
0
,
&
stg
);
ok
(
r
==
S_OK
,
"StgCreateDocfile failed
\n
"
);
r
=
IStorage_Release
(
stg
);
ok
(
r
==
0
,
"storage not released
\n
"
);
ok
(
DeleteFileW
(
filename
),
"failed to delete file
\n
"
);
/* test the way excel uses StgCreateDocFile */
r
=
StgCreateDocfile
(
filename
,
STGM_TRANSACTED
|
STGM_CREATE
|
STGM_SHARE_DENY_WRITE
|
STGM_READWRITE
,
0
,
&
stg
);
ok
(
r
==
S_OK
,
"StgCreateDocfile the excel way failed
\n
"
);
if
(
r
==
S_OK
)
{
r
=
IStorage_Release
(
stg
);
ok
(
r
==
0
,
"storage not released
\n
"
);
ok
(
DeleteFileW
(
filename
),
"failed to delete file
\n
"
);
}
/* looks like we need STGM_TRANSACTED or STGM_CREATE */
r
=
StgCreateDocfile
(
filename
,
STGM_TRANSACTED
|
STGM_SHARE_DENY_WRITE
|
STGM_READWRITE
,
0
,
&
stg
);
ok
(
r
==
S_OK
,
"StgCreateDocfile the excel way failed
\n
"
);
if
(
r
==
S_OK
)
{
r
=
IStorage_Release
(
stg
);
ok
(
r
==
0
,
"storage not released
\n
"
);
ok
(
DeleteFileW
(
filename
),
"failed to delete file
\n
"
);
}
/* test the way msi uses StgCreateDocfile */
r
=
StgCreateDocfile
(
filename
,
STGM_DIRECT
|
STGM_READWRITE
|
STGM_SHARE_EXCLUSIVE
,
0
,
&
stg
);
ok
(
r
==
S_OK
,
"StgCreateDocFile failed
\n
"
);
r
=
IStorage_Release
(
stg
);
ok
(
r
==
0
,
"storage not released
\n
"
);
ok
(
DeleteFileW
(
filename
),
"failed to delete file
\n
"
);
}
void
test_storage_stream
(
void
)
...
...
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