Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Zsolt Vadász
wine
Commits
ff9fd9c4
Commit
ff9fd9c4
authored
18 years ago
by
Robert Shearman
Committed by
Alexandre Julliard
18 years ago
Browse files
Options
Downloads
Patches
Plain Diff
rpcrt4: Handle marshaling/unmarshaling full pointers.
parent
bf985900
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dlls/rpcrt4/ndr_marshall.c
+53
-5
53 additions, 5 deletions
dlls/rpcrt4/ndr_marshall.c
with
53 additions
and
5 deletions
dlls/rpcrt4/ndr_marshall.c
+
53
−
5
View file @
ff9fd9c4
...
...
@@ -749,6 +749,8 @@ static void PointerMarshall(PMIDL_STUB_MESSAGE pStubMsg,
unsigned
type
=
pFormat
[
0
],
attr
=
pFormat
[
1
];
PFORMAT_STRING
desc
;
NDR_MARSHALL
m
;
unsigned
long
pointer_id
;
int
pointer_needs_marshaling
;
TRACE
(
"(%p,%p,%p,%p)
\n
"
,
pStubMsg
,
Buffer
,
Pointer
,
pFormat
);
TRACE
(
"type=0x%x, attr="
,
type
);
dump_pointer_attr
(
attr
);
...
...
@@ -762,21 +764,33 @@ static void PointerMarshall(PMIDL_STUB_MESSAGE pStubMsg,
if (!Pointer)
RpcRaiseException(RPC_X_NULL_REF_POINTER);
#endif
pointer_needs_marshaling
=
1
;
break
;
case
RPC_FC_UP
:
/* unique pointer */
case
RPC_FC_OP
:
/* object pointer - same as unique here */
TRACE
(
"writing %p to buffer
\n
"
,
Pointer
);
NDR_LOCAL_UINT32_WRITE
(
Buffer
,
(
unsigned
long
)
Pointer
);
if
(
Pointer
)
pointer_needs_marshaling
=
1
;
else
pointer_needs_marshaling
=
0
;
pointer_id
=
(
unsigned
long
)
Pointer
;
TRACE
(
"writing 0x%08lx to buffer
\n
"
,
pointer_id
);
NDR_LOCAL_UINT32_WRITE
(
Buffer
,
pointer_id
);
break
;
case
RPC_FC_FP
:
pointer_needs_marshaling
=
!
NdrFullPointerQueryPointer
(
pStubMsg
->
FullPtrXlatTables
,
Pointer
,
1
,
&
pointer_id
);
TRACE
(
"writing 0x%08lx to buffer
\n
"
,
pointer_id
);
NDR_LOCAL_UINT32_WRITE
(
Buffer
,
pointer_id
);
break
;
default:
FIXME
(
"unhandled ptr type=%02x
\n
"
,
type
);
RpcRaiseException
(
RPC_X_BAD_STUB_DATA
);
return
;
}
TRACE
(
"calling marshaller for type 0x%x
\n
"
,
(
int
)
*
desc
);
if
(
P
ointer
)
{
if
(
p
ointer
_needs_marshaling
)
{
if
(
attr
&
RPC_FC_P_DEREF
)
{
Pointer
=
*
(
unsigned
char
**
)
Pointer
;
TRACE
(
"deref => %p
\n
"
,
Pointer
);
...
...
@@ -802,6 +816,7 @@ static void PointerUnmarshall(PMIDL_STUB_MESSAGE pStubMsg,
PFORMAT_STRING
desc
;
NDR_UNMARSHALL
m
;
DWORD
pointer_id
=
0
;
int
pointer_needs_unmarshaling
;
TRACE
(
"(%p,%p,%p,%p,%d)
\n
"
,
pStubMsg
,
Buffer
,
pPointer
,
pFormat
,
fMustAlloc
);
TRACE
(
"type=0x%x, attr="
,
type
);
dump_pointer_attr
(
attr
);
...
...
@@ -811,25 +826,39 @@ static void PointerUnmarshall(PMIDL_STUB_MESSAGE pStubMsg,
switch
(
type
)
{
case
RPC_FC_RP
:
/* ref pointer (always non-null) */
pointer_
id
=
~
0UL
;
pointer_
needs_unmarshaling
=
1
;
break
;
case
RPC_FC_UP
:
/* unique pointer */
pointer_id
=
NDR_LOCAL_UINT32_READ
(
Buffer
);
TRACE
(
"pointer_id is 0x%08lx
\n
"
,
pointer_id
);
if
(
pointer_id
)
pointer_needs_unmarshaling
=
1
;
else
pointer_needs_unmarshaling
=
0
;
break
;
case
RPC_FC_OP
:
/* object pointer - we must free data before overwriting it */
pointer_id
=
NDR_LOCAL_UINT32_READ
(
Buffer
);
TRACE
(
"pointer_id is 0x%08lx
\n
"
,
pointer_id
);
if
(
!
fMustAlloc
&&
*
pPointer
)
FIXME
(
"free object pointer %p
\n
"
,
*
pPointer
);
if
(
pointer_id
)
pointer_needs_unmarshaling
=
1
;
else
pointer_needs_unmarshaling
=
0
;
break
;
case
RPC_FC_FP
:
pointer_id
=
NDR_LOCAL_UINT32_READ
(
Buffer
);
TRACE
(
"pointer_id is 0x%08lx
\n
"
,
pointer_id
);
pointer_needs_unmarshaling
=
!
NdrFullPointerQueryRefId
(
pStubMsg
->
FullPtrXlatTables
,
pointer_id
,
1
,
(
void
**
)
pPointer
);
break
;
default:
FIXME
(
"unhandled ptr type=%02x
\n
"
,
type
);
RpcRaiseException
(
RPC_X_BAD_STUB_DATA
);
return
;
}
if
(
pointer_
id
)
{
if
(
pointer_
needs_unmarshaling
)
{
if
(
attr
&
RPC_FC_P_DEREF
)
{
if
(
!*
pPointer
||
fMustAlloc
)
*
pPointer
=
NdrAllocate
(
pStubMsg
,
sizeof
(
void
*
));
...
...
@@ -839,6 +868,10 @@ static void PointerUnmarshall(PMIDL_STUB_MESSAGE pStubMsg,
m
=
NdrUnmarshaller
[
*
desc
&
NDR_TABLE_MASK
];
if
(
m
)
m
(
pStubMsg
,
pPointer
,
desc
,
fMustAlloc
);
else
FIXME
(
"no unmarshaller for data type=%02x
\n
"
,
*
desc
);
if
(
type
==
RPC_FC_FP
)
NdrFullPointerInsertRefId
(
pStubMsg
->
FullPtrXlatTables
,
pointer_id
,
*
pPointer
);
}
TRACE
(
"pointer=%p
\n
"
,
*
pPointer
);
...
...
@@ -854,6 +887,8 @@ static void PointerBufferSize(PMIDL_STUB_MESSAGE pStubMsg,
unsigned
type
=
pFormat
[
0
],
attr
=
pFormat
[
1
];
PFORMAT_STRING
desc
;
NDR_BUFFERSIZE
m
;
int
pointer_needs_sizing
;
unsigned
long
pointer_id
;
TRACE
(
"(%p,%p,%p)
\n
"
,
pStubMsg
,
Pointer
,
pFormat
);
TRACE
(
"type=0x%x, attr="
,
type
);
dump_pointer_attr
(
attr
);
...
...
@@ -871,9 +906,15 @@ static void PointerBufferSize(PMIDL_STUB_MESSAGE pStubMsg,
return
;
break
;
case
RPC_FC_FP
:
pointer_needs_sizing
=
!
NdrFullPointerQueryPointer
(
pStubMsg
->
FullPtrXlatTables
,
Pointer
,
0
,
&
pointer_id
);
if
(
!
pointer_needs_sizing
)
return
;
break
;
default:
FIXME
(
"unhandled ptr type=%02x
\n
"
,
type
);
RpcRaiseException
(
RPC_X_BAD_STUB_DATA
);
return
;
}
if
(
attr
&
RPC_FC_P_DEREF
)
{
...
...
@@ -942,6 +983,13 @@ static void PointerFree(PMIDL_STUB_MESSAGE pStubMsg,
if
(
!
Pointer
)
return
;
if
(
type
==
RPC_FC_FP
)
{
int
pointer_needs_freeing
=
NdrFullPointerFree
(
pStubMsg
->
FullPtrXlatTables
,
Pointer
);
if
(
!
pointer_needs_freeing
)
return
;
}
if
(
attr
&
RPC_FC_P_DEREF
)
{
Pointer
=
*
(
unsigned
char
**
)
Pointer
;
TRACE
(
"deref => %p
\n
"
,
Pointer
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment