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
52ce30d2
Commit
52ce30d2
authored
Jul 17, 2012
by
Nikolay Sivov
Committed by
Alexandre Julliard
Jul 17, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ole32: Make ole stream creation helper capable of handling flags data.
parent
88e6c817
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
44 deletions
+31
-44
clipboard.c
dlls/ole32/clipboard.c
+1
-1
storage32.c
dlls/ole32/storage32.c
+29
-42
storage32.h
dlls/ole32/storage32.h
+1
-1
No files found.
dlls/ole32/clipboard.c
View file @
52ce30d2
...
...
@@ -662,7 +662,7 @@ static HRESULT render_embed_source_hack(IDataObject *data, LPFORMATETC fmt)
ProgIDFromCLSID
(
&
clsID
,
&
strProgID
);
WideCharToMultiByte
(
CP_ACP
,
0
,
strProgID
,
-
1
,
strOleTypeName
,
sizeof
(
strOleTypeName
),
NULL
,
NULL
);
OLECONVERT_CreateOleStream
(
std
.
u
.
pstg
);
STORAGE_CreateOleStream
(
std
.
u
.
pstg
,
0
);
OLECONVERT_CreateCompObjStream
(
std
.
u
.
pstg
,
strOleTypeName
);
}
}
...
...
dlls/ole32/storage32.c
View file @
52ce30d2
...
...
@@ -8520,18 +8520,18 @@ static DWORD OLECONVERT_WriteOLE20ToBuffer(LPSTORAGE pStorage, BYTE **pData)
}
/*************************************************************************
*
OLECONVERT
_CreateOleStream [Internal]
*
STORAGE
_CreateOleStream [Internal]
*
* Creates the "\001OLE" stream in the IStorage if necessary.
*
* PARAMS
* pStorage [I] Dest storage to create the stream in
* storage [I] Dest storage to create the stream in
* flags [I] flags to be set for newly created stream
*
* RETURNS
*
Nothing
*
HRESULT return value
*
* NOTES
* This function is used by OleConvertOLESTREAMToIStorage only.
*
* This stream is still unknown, MS Word seems to have extra data
* but since the data is stored in the OLESTREAM there should be
...
...
@@ -8539,28 +8539,32 @@ static DWORD OLECONVERT_WriteOLE20ToBuffer(LPSTORAGE pStorage, BYTE **pData)
* deleted it will create it with this default data.
*
*/
void
OLECONVERT_CreateOleStream
(
LPSTORAGE
pStorage
)
HRESULT
STORAGE_CreateOleStream
(
IStorage
*
storage
,
DWORD
flags
)
{
HRESULT
hRes
;
IStream
*
pStream
;
static
const
WCHAR
wstrStreamName
[]
=
{
1
,
'O'
,
'l'
,
'e'
,
0
};
BYTE
pOleStreamHeader
[]
=
static
const
WCHAR
stream_1oleW
[]
=
{
1
,
'O'
,
'l'
,
'e'
,
0
};
static
const
DWORD
version_magic
=
0x02000001
;
IStream
*
stream
;
HRESULT
hr
;
hr
=
IStorage_CreateStream
(
storage
,
stream_1oleW
,
STGM_WRITE
|
STGM_SHARE_EXCLUSIVE
,
0
,
0
,
&
stream
);
if
(
hr
==
S_OK
)
{
0x01
,
0x00
,
0x00
,
0x02
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
struct
empty_1ole_stream
{
DWORD
version_magic
;
DWORD
flags
;
BYTE
padding
[
12
];
};
struct
empty_1ole_stream
stream_data
;
/* Create stream if not present */
hRes
=
IStorage_CreateStream
(
pStorage
,
wstrStreamName
,
STGM_WRITE
|
STGM_SHARE_EXCLUSIVE
,
0
,
0
,
&
pStream
);
stream_data
.
version_magic
=
version_magic
;
stream_data
.
flags
=
flags
;
memset
(
stream_data
.
padding
,
0
,
sizeof
(
stream_data
.
padding
)
);
if
(
hRes
==
S_OK
)
{
/* Write default Data */
hRes
=
IStream_Write
(
pStream
,
pOleStreamHeader
,
sizeof
(
pOleStreamHeader
),
NULL
);
IStream_Release
(
pStream
);
hr
=
IStream_Write
(
stream
,
&
stream_data
,
sizeof
(
stream_data
),
NULL
);
IStream_Release
(
stream
);
}
return
hr
;
}
/* write a string to a stream, preceded by its length */
...
...
@@ -9291,7 +9295,7 @@ HRESULT WINAPI OleConvertOLESTREAMToIStorage (
if
(
hRes
==
S_OK
)
{
/*Create the Ole Stream if necessary */
OLECONVERT_CreateOleStream
(
pstg
);
STORAGE_CreateOleStream
(
pstg
,
0
);
}
}
...
...
@@ -9418,33 +9422,16 @@ HRESULT WINAPI GetConvertStg(IStorage *stg)
*/
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
)
hr
=
STORAGE_CreateOleStream
(
storage
,
flags
);
if
(
hr
==
STG_E_FILEALREADYEXISTS
)
{
static
const
WCHAR
stream_1oleW
[]
=
{
1
,
'O'
,
'l'
,
'e'
,
0
};
IStream
*
stream
;
DWORD
header
[
2
];
hr
=
IStorage_OpenStream
(
storage
,
stream_1oleW
,
NULL
,
STGM_READWRITE
|
STGM_SHARE_EXCLUSIVE
,
0
,
&
stream
);
...
...
dlls/ole32/storage32.h
View file @
52ce30d2
...
...
@@ -160,7 +160,7 @@ HRESULT FileLockBytesImpl_Construct(HANDLE hFile, DWORD openFlags, LPCWSTR pwcsN
* Ole Convert support
*/
void
OLECONVERT_CreateOleStream
(
LPSTORAGE
pStorage
)
DECLSPEC_HIDDEN
;
HRESULT
STORAGE_CreateOleStream
(
IStorage
*
,
DWORD
)
DECLSPEC_HIDDEN
;
HRESULT
OLECONVERT_CreateCompObjStream
(
LPSTORAGE
pStorage
,
LPCSTR
strOleTypeName
)
DECLSPEC_HIDDEN
;
...
...
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