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
7b373edb
Commit
7b373edb
authored
Jul 13, 2012
by
Nikolay Sivov
Committed by
Alexandre Julliard
Jul 13, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ole32: Implement GetConvertStg().
parent
ea196ef0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
62 additions
and
3 deletions
+62
-3
storage32.c
dlls/ole32/storage32.c
+33
-3
storage32.c
dlls/ole32/tests/storage32.c
+29
-0
No files found.
dlls/ole32/storage32.c
View file @
7b373edb
...
...
@@ -9400,12 +9400,42 @@ HRESULT WINAPI OleConvertIStorageToOLESTREAM (
return
hRes
;
}
enum
stream_1ole_flags
{
OleStream_LinkedObject
=
0x00000001
,
OleStream_Convert
=
0x00000100
};
/***********************************************************************
* GetConvertStg (OLE32.@)
*/
HRESULT
WINAPI
GetConvertStg
(
IStorage
*
stg
)
{
FIXME
(
"unimplemented stub!
\n
"
);
return
E_FAIL
;
HRESULT
WINAPI
GetConvertStg
(
IStorage
*
stg
)
{
static
const
WCHAR
stream_1oleW
[]
=
{
1
,
'O'
,
'l'
,
'e'
,
0
};
static
const
DWORD
version_magic
=
0x02000001
;
DWORD
header
[
2
];
IStream
*
stream
;
HRESULT
hr
;
ULONG
len
;
TRACE
(
"%p
\n
"
,
stg
);
if
(
!
stg
)
return
E_INVALIDARG
;
hr
=
IStorage_OpenStream
(
stg
,
stream_1oleW
,
NULL
,
STGM_READ
|
STGM_SHARE_EXCLUSIVE
,
0
,
&
stream
);
if
(
FAILED
(
hr
))
return
hr
;
len
=
0
;
hr
=
IStream_Read
(
stream
,
header
,
sizeof
(
header
),
&
len
);
IStream_Release
(
stream
);
if
(
FAILED
(
hr
))
return
hr
;
if
(
header
[
0
]
!=
version_magic
)
{
ERR
(
"got wrong version magic for
\1
Ole stream, 0x%08x
\n
"
,
header
[
0
]);
return
E_FAIL
;
}
return
header
[
1
]
&
OleStream_Convert
?
S_OK
:
S_FALSE
;
}
/******************************************************************************
...
...
dlls/ole32/tests/storage32.c
View file @
7b373edb
...
...
@@ -2995,6 +2995,34 @@ static void test_hglobal_storage_creation(void)
ILockBytes_Release
(
ilb
);
}
static
void
test_convert
(
void
)
{
static
const
WCHAR
filename
[]
=
{
's'
,
't'
,
'o'
,
'r'
,
'a'
,
'g'
,
'e'
,
'.'
,
's'
,
't'
,
'g'
,
0
};
IStorage
*
stg
;
HRESULT
hr
;
hr
=
GetConvertStg
(
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"got 0x%08x
\n
"
,
hr
);
hr
=
StgCreateDocfile
(
filename
,
STGM_CREATE
|
STGM_SHARE_EXCLUSIVE
|
STGM_READWRITE
,
0
,
&
stg
);
ok
(
hr
==
S_OK
,
"StgCreateDocfile failed
\n
"
);
hr
=
GetConvertStg
(
stg
);
ok
(
hr
==
STG_E_FILENOTFOUND
,
"got 0x%08x
\n
"
,
hr
);
hr
=
SetConvertStg
(
stg
,
TRUE
);
todo_wine
{
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
hr
=
GetConvertStg
(
stg
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
hr
=
SetConvertStg
(
stg
,
FALSE
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
hr
=
GetConvertStg
(
stg
);
ok
(
hr
==
S_FALSE
,
"got 0x%08x
\n
"
,
hr
);
}
IStorage_Release
(
stg
);
DeleteFileW
(
filename
);
}
START_TEST
(
storage32
)
{
CHAR
temp
[
MAX_PATH
];
...
...
@@ -3038,4 +3066,5 @@ START_TEST(storage32)
test_copyto_locking
();
test_copyto_recursive
();
test_hglobal_storage_creation
();
test_convert
();
}
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