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
39562961
Commit
39562961
authored
Jul 14, 2012
by
Nikolay Sivov
Committed by
Alexandre Julliard
Jul 16, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ole32: Implement SetConvertStg().
parent
a3a97558
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
76 additions
and
16 deletions
+76
-16
ole2stubs.c
dlls/ole32/ole2stubs.c
+0
-9
storage32.c
dlls/ole32/storage32.c
+73
-5
storage32.c
dlls/ole32/tests/storage32.c
+3
-2
No files found.
dlls/ole32/ole2stubs.c
View file @
39562961
...
@@ -44,15 +44,6 @@ HRESULT WINAPI OleCreateLinkToFile(LPCOLESTR lpszFileName, REFIID riid,
...
@@ -44,15 +44,6 @@ HRESULT WINAPI OleCreateLinkToFile(LPCOLESTR lpszFileName, REFIID riid,
}
}
/******************************************************************************
/******************************************************************************
* SetConvertStg [OLE32.@]
*/
HRESULT
WINAPI
SetConvertStg
(
LPSTORAGE
pStg
,
BOOL
fConvert
)
{
FIXME
(
"(%p,%x), stub!
\n
"
,
pStg
,
fConvert
);
return
E_NOTIMPL
;
}
/******************************************************************************
* OleCreateLink [OLE32.@]
* OleCreateLink [OLE32.@]
*/
*/
HRESULT
WINAPI
OleCreateLink
(
LPMONIKER
pmkLinkSrc
,
REFIID
riid
,
DWORD
renderopt
,
LPFORMATETC
lpFormatEtc
,
HRESULT
WINAPI
OleCreateLink
(
LPMONIKER
pmkLinkSrc
,
REFIID
riid
,
DWORD
renderopt
,
LPFORMATETC
lpFormatEtc
,
...
...
dlls/ole32/storage32.c
View file @
39562961
...
@@ -9383,7 +9383,7 @@ HRESULT WINAPI OleConvertIStorageToOLESTREAM (
...
@@ -9383,7 +9383,7 @@ HRESULT WINAPI OleConvertIStorageToOLESTREAM (
enum
stream_1ole_flags
{
enum
stream_1ole_flags
{
OleStream_LinkedObject
=
0x00000001
,
OleStream_LinkedObject
=
0x00000001
,
OleStream_Convert
=
0x00000
100
OleStream_Convert
=
0x00000
004
};
};
/***********************************************************************
/***********************************************************************
...
@@ -9396,7 +9396,6 @@ HRESULT WINAPI GetConvertStg(IStorage *stg)
...
@@ -9396,7 +9396,6 @@ HRESULT WINAPI GetConvertStg(IStorage *stg)
DWORD
header
[
2
];
DWORD
header
[
2
];
IStream
*
stream
;
IStream
*
stream
;
HRESULT
hr
;
HRESULT
hr
;
ULONG
len
;
TRACE
(
"%p
\n
"
,
stg
);
TRACE
(
"%p
\n
"
,
stg
);
...
@@ -9405,20 +9404,89 @@ HRESULT WINAPI GetConvertStg(IStorage *stg)
...
@@ -9405,20 +9404,89 @@ HRESULT WINAPI GetConvertStg(IStorage *stg)
hr
=
IStorage_OpenStream
(
stg
,
stream_1oleW
,
NULL
,
STGM_READ
|
STGM_SHARE_EXCLUSIVE
,
0
,
&
stream
);
hr
=
IStorage_OpenStream
(
stg
,
stream_1oleW
,
NULL
,
STGM_READ
|
STGM_SHARE_EXCLUSIVE
,
0
,
&
stream
);
if
(
FAILED
(
hr
))
return
hr
;
if
(
FAILED
(
hr
))
return
hr
;
len
=
0
;
hr
=
IStream_Read
(
stream
,
header
,
sizeof
(
header
),
NULL
);
hr
=
IStream_Read
(
stream
,
header
,
sizeof
(
header
),
&
len
);
IStream_Release
(
stream
);
IStream_Release
(
stream
);
if
(
FAILED
(
hr
))
return
hr
;
if
(
FAILED
(
hr
))
return
hr
;
if
(
header
[
0
]
!=
version_magic
)
if
(
header
[
0
]
!=
version_magic
)
{
{
ERR
(
"got wrong version magic for
\
1
Ole stream, 0x%08x
\n
"
,
header
[
0
]);
ERR
(
"got wrong version magic for 1Ole stream, 0x%08x
\n
"
,
header
[
0
]);
return
E_FAIL
;
return
E_FAIL
;
}
}
return
header
[
1
]
&
OleStream_Convert
?
S_OK
:
S_FALSE
;
return
header
[
1
]
&
OleStream_Convert
?
S_OK
:
S_FALSE
;
}
}
/***********************************************************************
* SetConvertStg (OLE32.@)
*/
HRESULT
WINAPI
SetConvertStg
(
IStorage
*
storage
,
BOOL
convert
)
{
static
const
WCHAR
stream_1oleW
[]
=
{
1
,
'O'
,
'l'
,
'e'
,
0
};
static
const
DWORD
version_magic
=
0x02000001
;
DWORD
flags
=
convert
?
OleStream_Convert
:
0
;
IStream
*
stream
;
HRESULT
hr
;
TRACE
(
"(%p, %d)
\n
"
,
storage
,
convert
);
hr
=
IStorage_CreateStream
(
storage
,
stream_1oleW
,
STGM_WRITE
|
STGM_SHARE_EXCLUSIVE
,
0
,
0
,
&
stream
);
if
(
hr
==
S_OK
)
{
struct
empty_1ole_stream
{
DWORD
version_magic
;
DWORD
flags
;
BYTE
padding
[
12
];
};
struct
empty_1ole_stream
stream_data
;
stream_data
.
version_magic
=
version_magic
;
stream_data
.
flags
=
flags
;
memset
(
stream_data
.
padding
,
0
,
sizeof
(
stream_data
.
padding
));
hr
=
IStream_Write
(
stream
,
&
stream_data
,
sizeof
(
stream_data
),
NULL
);
IStream_Release
(
stream
);
}
else
if
(
hr
==
STG_E_FILEALREADYEXISTS
)
{
DWORD
header
[
2
];
hr
=
IStorage_OpenStream
(
storage
,
stream_1oleW
,
NULL
,
STGM_READWRITE
|
STGM_SHARE_EXCLUSIVE
,
0
,
&
stream
);
if
(
FAILED
(
hr
))
return
hr
;
hr
=
IStream_Read
(
stream
,
header
,
sizeof
(
header
),
NULL
);
if
(
FAILED
(
hr
))
{
IStream_Release
(
stream
);
return
hr
;
}
/* update flag if differs */
if
((
header
[
1
]
^
flags
)
&
OleStream_Convert
)
{
LARGE_INTEGER
pos
;
if
(
header
[
1
]
&
OleStream_Convert
)
flags
=
header
[
1
]
&
~
OleStream_Convert
;
else
flags
=
header
[
1
]
|
OleStream_Convert
;
pos
.
QuadPart
=
sizeof
(
DWORD
);
hr
=
IStream_Seek
(
stream
,
pos
,
STREAM_SEEK_SET
,
NULL
);
if
(
FAILED
(
hr
))
{
IStream_Release
(
stream
);
return
hr
;
}
hr
=
IStream_Write
(
stream
,
&
flags
,
sizeof
(
flags
),
NULL
);
}
IStream_Release
(
stream
);
}
return
hr
;
}
/******************************************************************************
/******************************************************************************
* StgIsStorageFile [OLE32.@]
* StgIsStorageFile [OLE32.@]
* Verify if the file contains a storage object
* Verify if the file contains a storage object
...
...
dlls/ole32/tests/storage32.c
View file @
39562961
...
@@ -3009,7 +3009,8 @@ static void test_convert(void)
...
@@ -3009,7 +3009,8 @@ static void test_convert(void)
hr
=
GetConvertStg
(
stg
);
hr
=
GetConvertStg
(
stg
);
ok
(
hr
==
STG_E_FILENOTFOUND
,
"got 0x%08x
\n
"
,
hr
);
ok
(
hr
==
STG_E_FILENOTFOUND
,
"got 0x%08x
\n
"
,
hr
);
hr
=
SetConvertStg
(
stg
,
TRUE
);
hr
=
SetConvertStg
(
stg
,
TRUE
);
todo_wine
{
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
hr
=
SetConvertStg
(
stg
,
TRUE
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
hr
=
GetConvertStg
(
stg
);
hr
=
GetConvertStg
(
stg
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
...
@@ -3017,7 +3018,7 @@ todo_wine {
...
@@ -3017,7 +3018,7 @@ todo_wine {
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
hr
=
GetConvertStg
(
stg
);
hr
=
GetConvertStg
(
stg
);
ok
(
hr
==
S_FALSE
,
"got 0x%08x
\n
"
,
hr
);
ok
(
hr
==
S_FALSE
,
"got 0x%08x
\n
"
,
hr
);
}
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