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
8aecfff8
Commit
8aecfff8
authored
Jun 07, 2005
by
Robert Shearman
Committed by
Alexandre Julliard
Jun 07, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make NdrInterfacePointer* more reliable.
parent
d50ae025
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
11 deletions
+26
-11
ndr_ole.c
dlls/rpcrt4/ndr_ole.c
+26
-11
No files found.
dlls/rpcrt4/ndr_ole.c
View file @
8aecfff8
...
...
@@ -126,13 +126,18 @@ static HRESULT WINAPI RpcStream_Read(LPSTREAM iface,
ULONG
*
pcbRead
)
{
RpcStreamImpl
*
This
=
(
RpcStreamImpl
*
)
iface
;
if
(
This
->
pos
+
cb
>
*
This
->
size
)
cb
=
*
This
->
size
-
This
->
pos
;
HRESULT
hr
=
S_OK
;
if
(
This
->
pos
+
cb
>
*
This
->
size
)
{
cb
=
*
This
->
size
-
This
->
pos
;
hr
=
S_FALSE
;
}
if
(
cb
)
{
memcpy
(
pv
,
This
->
data
+
This
->
pos
,
cb
);
This
->
pos
+=
cb
;
}
if
(
pcbRead
)
*
pcbRead
=
cb
;
return
S_OK
;
return
hr
;
}
static
HRESULT
WINAPI
RpcStream_Write
(
LPSTREAM
iface
,
...
...
@@ -141,6 +146,8 @@ static HRESULT WINAPI RpcStream_Write(LPSTREAM iface,
ULONG
*
pcbWritten
)
{
RpcStreamImpl
*
This
=
(
RpcStreamImpl
*
)
iface
;
if
(
This
->
data
+
cb
>
(
char
*
)
This
->
pMsg
->
BufferEnd
)
return
STG_E_MEDIUMFULL
;
memcpy
(
This
->
data
+
This
->
pos
,
pv
,
cb
);
This
->
pos
+=
cb
;
if
(
This
->
pos
>
*
This
->
size
)
*
This
->
size
=
This
->
pos
;
...
...
@@ -247,11 +254,15 @@ unsigned char * WINAPI NdrInterfacePointerMarshall(PMIDL_STUB_MESSAGE pStubMsg,
TRACE
(
"(%p,%p,%p)
\n
"
,
pStubMsg
,
pMemory
,
pFormat
);
pStubMsg
->
MaxCount
=
0
;
if
(
!
LoadCOM
())
return
NULL
;
stream
=
RpcStream_Create
(
pStubMsg
,
TRUE
);
hr
=
COM_MarshalInterface
(
stream
,
riid
,
(
LPUNKNOWN
)
pMemory
,
pStubMsg
->
dwDestContext
,
pStubMsg
->
pvDestContext
,
MSHLFLAGS_NORMAL
);
IStream_Release
(
stream
);
if
(
pStubMsg
->
Buffer
+
sizeof
(
DWORD
)
<
pStubMsg
->
BufferEnd
)
{
stream
=
RpcStream_Create
(
pStubMsg
,
TRUE
);
if
(
stream
)
{
hr
=
COM_MarshalInterface
(
stream
,
riid
,
(
LPUNKNOWN
)
pMemory
,
pStubMsg
->
dwDestContext
,
pStubMsg
->
pvDestContext
,
MSHLFLAGS_NORMAL
);
IStream_Release
(
stream
);
}
}
return
NULL
;
}
...
...
@@ -269,9 +280,13 @@ unsigned char * WINAPI NdrInterfacePointerUnmarshall(PMIDL_STUB_MESSAGE pStubMsg
TRACE
(
"(%p,%p,%p,%d)
\n
"
,
pStubMsg
,
ppMemory
,
pFormat
,
fMustAlloc
);
if
(
!
LoadCOM
())
return
NULL
;
*
(
LPVOID
*
)
ppMemory
=
NULL
;
stream
=
RpcStream_Create
(
pStubMsg
,
FALSE
);
hr
=
COM_UnmarshalInterface
(
stream
,
&
IID_NULL
,
(
LPVOID
*
)
ppMemory
);
IStream_Release
(
stream
);
if
(
pStubMsg
->
Buffer
+
sizeof
(
DWORD
)
<
pStubMsg
->
BufferEnd
)
{
stream
=
RpcStream_Create
(
pStubMsg
,
FALSE
);
if
(
stream
)
{
hr
=
COM_UnmarshalInterface
(
stream
,
&
IID_NULL
,
(
LPVOID
*
)
ppMemory
);
IStream_Release
(
stream
);
}
}
return
NULL
;
}
...
...
@@ -292,7 +307,7 @@ void WINAPI NdrInterfacePointerBufferSize(PMIDL_STUB_MESSAGE pStubMsg,
pStubMsg
->
dwDestContext
,
pStubMsg
->
pvDestContext
,
MSHLFLAGS_NORMAL
);
TRACE
(
"size=%ld
\n
"
,
size
);
pStubMsg
->
BufferLength
+=
sizeof
(
DWORD
)
+
size
;
if
(
size
)
pStubMsg
->
BufferLength
+=
sizeof
(
DWORD
)
+
size
;
}
/***********************************************************************
...
...
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