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
251bab8a
Commit
251bab8a
authored
Mar 19, 2007
by
Rob Shearman
Committed by
Alexandre Julliard
Mar 20, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ole32: Implement TYMED_FILE for STGMEDIUM marshaling and unmarshaling.
parent
05e99099
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
65 additions
and
4 deletions
+65
-4
usrmarshal.c
dlls/ole32/usrmarshal.c
+65
-4
No files found.
dlls/ole32/usrmarshal.c
View file @
251bab8a
...
@@ -35,6 +35,8 @@
...
@@ -35,6 +35,8 @@
#include "ole2.h"
#include "ole2.h"
#include "oleauto.h"
#include "oleauto.h"
#include "rpcproxy.h"
#include "rpcproxy.h"
#include "wine/unicode.h"
#include "wine/debug.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
ole
);
WINE_DEFAULT_DEBUG_CHANNEL
(
ole
);
...
@@ -1471,7 +1473,13 @@ ULONG __RPC_USER STGMEDIUM_UserSize(ULONG *pFlags, ULONG StartingSize, STGMEDIUM
...
@@ -1471,7 +1473,13 @@ ULONG __RPC_USER STGMEDIUM_UserSize(ULONG *pFlags, ULONG StartingSize, STGMEDIUM
size
=
HGLOBAL_UserSize
(
pFlags
,
size
,
&
pStgMedium
->
u
.
hGlobal
);
size
=
HGLOBAL_UserSize
(
pFlags
,
size
,
&
pStgMedium
->
u
.
hGlobal
);
break
;
break
;
case
TYMED_FILE
:
case
TYMED_FILE
:
FIXME
(
"TYMED_FILE
\n
"
);
TRACE
(
"TYMED_FILE
\n
"
);
if
(
pStgMedium
->
u
.
lpszFileName
)
{
TRACE
(
"file name is %s
\n
"
,
debugstr_w
(
pStgMedium
->
u
.
lpszFileName
));
size
+=
3
*
sizeof
(
DWORD
)
+
(
strlenW
(
pStgMedium
->
u
.
lpszFileName
)
+
1
)
*
sizeof
(
WCHAR
);
}
break
;
break
;
case
TYMED_ISTREAM
:
case
TYMED_ISTREAM
:
FIXME
(
"TYMED_ISTREAM
\n
"
);
FIXME
(
"TYMED_ISTREAM
\n
"
);
...
@@ -1545,7 +1553,24 @@ unsigned char * __RPC_USER STGMEDIUM_UserMarshal(ULONG *pFlags, unsigned char *p
...
@@ -1545,7 +1553,24 @@ unsigned char * __RPC_USER STGMEDIUM_UserMarshal(ULONG *pFlags, unsigned char *p
pBuffer
=
HGLOBAL_UserMarshal
(
pFlags
,
pBuffer
,
&
pStgMedium
->
u
.
hGlobal
);
pBuffer
=
HGLOBAL_UserMarshal
(
pFlags
,
pBuffer
,
&
pStgMedium
->
u
.
hGlobal
);
break
;
break
;
case
TYMED_FILE
:
case
TYMED_FILE
:
FIXME
(
"TYMED_FILE
\n
"
);
TRACE
(
"TYMED_FILE
\n
"
);
if
(
pStgMedium
->
u
.
lpszFileName
)
{
DWORD
len
;
len
=
strlenW
(
pStgMedium
->
u
.
lpszFileName
);
/* conformance */
*
(
DWORD
*
)
pBuffer
=
len
+
1
;
pBuffer
+=
sizeof
(
DWORD
);
/* offset */
*
(
DWORD
*
)
pBuffer
=
0
;
pBuffer
+=
sizeof
(
DWORD
);
/* variance */
*
(
DWORD
*
)
pBuffer
=
len
+
1
;
pBuffer
+=
sizeof
(
DWORD
);
TRACE
(
"file name is %s
\n
"
,
debugstr_w
(
pStgMedium
->
u
.
lpszFileName
));
memcpy
(
pBuffer
,
pStgMedium
->
u
.
lpszFileName
,
(
len
+
1
)
*
sizeof
(
WCHAR
));
}
break
;
break
;
case
TYMED_ISTREAM
:
case
TYMED_ISTREAM
:
FIXME
(
"TYMED_ISTREAM
\n
"
);
FIXME
(
"TYMED_ISTREAM
\n
"
);
...
@@ -1595,7 +1620,7 @@ unsigned char * __RPC_USER STGMEDIUM_UserMarshal(ULONG *pFlags, unsigned char *p
...
@@ -1595,7 +1620,7 @@ unsigned char * __RPC_USER STGMEDIUM_UserMarshal(ULONG *pFlags, unsigned char *p
*/
*/
unsigned
char
*
__RPC_USER
STGMEDIUM_UserUnmarshal
(
ULONG
*
pFlags
,
unsigned
char
*
pBuffer
,
STGMEDIUM
*
pStgMedium
)
unsigned
char
*
__RPC_USER
STGMEDIUM_UserUnmarshal
(
ULONG
*
pFlags
,
unsigned
char
*
pBuffer
,
STGMEDIUM
*
pStgMedium
)
{
{
DWORD
content
;
DWORD
content
=
0
;
DWORD
releaseunk
;
DWORD
releaseunk
;
ALIGN_POINTER
(
pBuffer
,
3
);
ALIGN_POINTER
(
pBuffer
,
3
);
...
@@ -1622,7 +1647,43 @@ unsigned char * __RPC_USER STGMEDIUM_UserUnmarshal(ULONG *pFlags, unsigned char
...
@@ -1622,7 +1647,43 @@ unsigned char * __RPC_USER STGMEDIUM_UserUnmarshal(ULONG *pFlags, unsigned char
pBuffer
=
HGLOBAL_UserUnmarshal
(
pFlags
,
pBuffer
,
&
pStgMedium
->
u
.
hGlobal
);
pBuffer
=
HGLOBAL_UserUnmarshal
(
pFlags
,
pBuffer
,
&
pStgMedium
->
u
.
hGlobal
);
break
;
break
;
case
TYMED_FILE
:
case
TYMED_FILE
:
FIXME
(
"TYMED_FILE
\n
"
);
TRACE
(
"TYMED_FILE
\n
"
);
if
(
content
)
{
DWORD
conformance
;
DWORD
variance
;
conformance
=
*
(
DWORD
*
)
pBuffer
;
pBuffer
+=
sizeof
(
DWORD
);
if
(
*
(
DWORD
*
)
pBuffer
!=
0
)
{
ERR
(
"invalid offset %d
\n
"
,
*
(
DWORD
*
)
pBuffer
);
RpcRaiseException
(
RPC_S_INVALID_BOUND
);
return
NULL
;
}
pBuffer
+=
sizeof
(
DWORD
);
variance
=
*
(
DWORD
*
)
pBuffer
;
pBuffer
+=
sizeof
(
DWORD
);
if
(
conformance
!=
variance
)
{
ERR
(
"conformance (%d) and variance (%d) should be equal
\n
"
,
conformance
,
variance
);
RpcRaiseException
(
RPC_S_INVALID_BOUND
);
return
NULL
;
}
if
(
conformance
>
0x7fffffff
)
{
ERR
(
"conformance 0x%x too large
\n
"
,
conformance
);
RpcRaiseException
(
RPC_S_INVALID_BOUND
);
return
NULL
;
}
pStgMedium
->
u
.
lpszFileName
=
CoTaskMemAlloc
(
conformance
*
sizeof
(
WCHAR
));
if
(
!
pStgMedium
->
u
.
lpszFileName
)
RpcRaiseException
(
ERROR_OUTOFMEMORY
);
TRACE
(
"unmarshalled file name is %s
\n
"
,
debugstr_wn
((
const
WCHAR
*
)
pBuffer
,
variance
));
memcpy
(
pStgMedium
->
u
.
lpszFileName
,
pBuffer
,
variance
*
sizeof
(
WCHAR
));
pBuffer
+=
variance
*
sizeof
(
WCHAR
);
}
else
pStgMedium
->
u
.
lpszFileName
=
NULL
;
break
;
break
;
case
TYMED_ISTREAM
:
case
TYMED_ISTREAM
:
FIXME
(
"TYMED_ISTREAM
\n
"
);
FIXME
(
"TYMED_ISTREAM
\n
"
);
...
...
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