Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
c9779ca1
Commit
c9779ca1
authored
Jun 05, 2006
by
Robert Shearman
Committed by
Alexandre Julliard
Jun 05, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rpcrt4: Implement varying array NDR functions.
parent
cd19c992
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
245 additions
and
7 deletions
+245
-7
ndr_marshall.c
dlls/rpcrt4/ndr_marshall.c
+245
-7
No files found.
dlls/rpcrt4/ndr_marshall.c
View file @
c9779ca1
...
...
@@ -21,7 +21,6 @@
* TODO:
* - Non-conformant strings
* - String structs
* - Varying arrays
* - Encapsulated unions
* - Byte count pointers
* - transmit_as/represent as
...
...
@@ -3532,7 +3531,59 @@ unsigned char * WINAPI NdrVaryingArrayMarshall(PMIDL_STUB_MESSAGE pStubMsg,
unsigned
char
*
pMemory
,
PFORMAT_STRING
pFormat
)
{
FIXME
(
"stub
\n
"
);
unsigned
char
alignment
;
DWORD
elements
,
esize
;
TRACE
(
"(%p, %p, %p)
\n
"
,
pStubMsg
,
pMemory
,
pFormat
);
if
((
pFormat
[
0
]
!=
RPC_FC_SMVARRAY
)
&&
(
pFormat
[
0
]
!=
RPC_FC_LGVARRAY
))
{
ERR
(
"invalid format type %x
\n
"
,
pFormat
[
0
]);
RpcRaiseException
(
RPC_S_INTERNAL_ERROR
);
return
NULL
;
}
alignment
=
pFormat
[
1
]
+
1
;
if
(
pFormat
[
0
]
==
RPC_FC_SMVARRAY
)
{
pFormat
+=
2
;
pFormat
+=
sizeof
(
WORD
);
elements
=
*
(
const
WORD
*
)
pFormat
;
pFormat
+=
sizeof
(
WORD
);
}
else
{
pFormat
+=
2
;
pFormat
+=
sizeof
(
DWORD
);
elements
=
*
(
const
DWORD
*
)
pFormat
;
pFormat
+=
sizeof
(
DWORD
);
}
esize
=
*
(
const
WORD
*
)
pFormat
;
pFormat
+=
sizeof
(
WORD
);
pFormat
=
ComputeVariance
(
pStubMsg
,
pMemory
,
pFormat
,
0
);
if
((
pStubMsg
->
ActualCount
>
elements
)
||
(
pStubMsg
->
ActualCount
+
pStubMsg
->
Offset
>
elements
))
{
RpcRaiseException
(
RPC_S_INVALID_BOUND
);
return
NULL
;
}
WriteVariance
(
pStubMsg
);
ALIGN_POINTER
(
pStubMsg
->
Buffer
,
alignment
);
memcpy
(
pStubMsg
->
Buffer
,
pMemory
+
pStubMsg
->
Offset
,
pStubMsg
->
ActualCount
*
esize
);
pStubMsg
->
BufferMark
=
pStubMsg
->
Buffer
;
pStubMsg
->
Buffer
+=
pStubMsg
->
ActualCount
*
esize
;
EmbeddedPointerMarshall
(
pStubMsg
,
pMemory
,
pFormat
);
STD_OVERFLOW_CHECK
(
pStubMsg
);
return
NULL
;
}
...
...
@@ -3544,7 +3595,58 @@ unsigned char * WINAPI NdrVaryingArrayUnmarshall(PMIDL_STUB_MESSAGE pStubMsg,
PFORMAT_STRING
pFormat
,
unsigned
char
fMustAlloc
)
{
FIXME
(
"stub
\n
"
);
unsigned
char
alignment
;
DWORD
size
,
elements
,
esize
;
TRACE
(
"(%p, %p, %p, %d)
\n
"
,
pStubMsg
,
ppMemory
,
pFormat
,
fMustAlloc
);
if
((
pFormat
[
0
]
!=
RPC_FC_SMVARRAY
)
&&
(
pFormat
[
0
]
!=
RPC_FC_LGVARRAY
))
{
ERR
(
"invalid format type %x
\n
"
,
pFormat
[
0
]);
RpcRaiseException
(
RPC_S_INTERNAL_ERROR
);
return
NULL
;
}
alignment
=
pFormat
[
1
]
+
1
;
if
(
pFormat
[
0
]
==
RPC_FC_SMVARRAY
)
{
pFormat
+=
2
;
size
=
*
(
const
WORD
*
)
pFormat
;
pFormat
+=
sizeof
(
WORD
);
elements
=
*
(
const
WORD
*
)
pFormat
;
pFormat
+=
sizeof
(
WORD
);
}
else
{
pFormat
+=
2
;
size
=
*
(
const
DWORD
*
)
pFormat
;
pFormat
+=
sizeof
(
DWORD
);
elements
=
*
(
const
DWORD
*
)
pFormat
;
pFormat
+=
sizeof
(
DWORD
);
}
esize
=
*
(
const
WORD
*
)
pFormat
;
pFormat
+=
sizeof
(
WORD
);
pFormat
=
ReadVariance
(
pStubMsg
,
pFormat
);
if
((
pStubMsg
->
ActualCount
>
elements
)
||
(
pStubMsg
->
ActualCount
+
pStubMsg
->
Offset
>
elements
))
{
RpcRaiseException
(
RPC_S_INVALID_BOUND
);
return
NULL
;
}
ALIGN_POINTER
(
pStubMsg
->
Buffer
,
alignment
);
if
(
!*
ppMemory
||
fMustAlloc
)
*
ppMemory
=
NdrAllocate
(
pStubMsg
,
size
);
memcpy
(
*
ppMemory
+
pStubMsg
->
Offset
,
pStubMsg
->
Buffer
,
pStubMsg
->
ActualCount
*
esize
);
pStubMsg
->
Buffer
+=
pStubMsg
->
ActualCount
*
esize
;
EmbeddedPointerUnmarshall
(
pStubMsg
,
ppMemory
,
pFormat
,
fMustAlloc
);
return
NULL
;
}
...
...
@@ -3555,7 +3657,54 @@ void WINAPI NdrVaryingArrayBufferSize(PMIDL_STUB_MESSAGE pStubMsg,
unsigned
char
*
pMemory
,
PFORMAT_STRING
pFormat
)
{
FIXME
(
"stub
\n
"
);
unsigned
char
alignment
;
DWORD
elements
,
esize
;
TRACE
(
"(%p, %p, %p)
\n
"
,
pStubMsg
,
pMemory
,
pFormat
);
if
((
pFormat
[
0
]
!=
RPC_FC_SMVARRAY
)
&&
(
pFormat
[
0
]
!=
RPC_FC_LGVARRAY
))
{
ERR
(
"invalid format type %x
\n
"
,
pFormat
[
0
]);
RpcRaiseException
(
RPC_S_INTERNAL_ERROR
);
return
;
}
alignment
=
pFormat
[
1
]
+
1
;
if
(
pFormat
[
0
]
==
RPC_FC_SMVARRAY
)
{
pFormat
+=
2
;
pFormat
+=
sizeof
(
WORD
);
elements
=
*
(
const
WORD
*
)
pFormat
;
pFormat
+=
sizeof
(
WORD
);
}
else
{
pFormat
+=
2
;
pFormat
+=
sizeof
(
DWORD
);
elements
=
*
(
const
DWORD
*
)
pFormat
;
pFormat
+=
sizeof
(
DWORD
);
}
esize
=
*
(
const
WORD
*
)
pFormat
;
pFormat
+=
sizeof
(
WORD
);
pFormat
=
ComputeVariance
(
pStubMsg
,
pMemory
,
pFormat
,
0
);
if
((
pStubMsg
->
ActualCount
>
elements
)
||
(
pStubMsg
->
ActualCount
+
pStubMsg
->
Offset
>
elements
))
{
RpcRaiseException
(
RPC_S_INVALID_BOUND
);
return
;
}
SizeVariance
(
pStubMsg
);
ALIGN_LENGTH
(
pStubMsg
->
BufferLength
,
alignment
);
pStubMsg
->
BufferLength
+=
pStubMsg
->
ActualCount
*
esize
;
EmbeddedPointerBufferSize
(
pStubMsg
,
pMemory
,
pFormat
);
}
/***********************************************************************
...
...
@@ -3564,8 +3713,57 @@ void WINAPI NdrVaryingArrayBufferSize(PMIDL_STUB_MESSAGE pStubMsg,
unsigned
long
WINAPI
NdrVaryingArrayMemorySize
(
PMIDL_STUB_MESSAGE
pStubMsg
,
PFORMAT_STRING
pFormat
)
{
FIXME
(
"stub
\n
"
);
return
0
;
unsigned
char
alignment
;
DWORD
size
,
elements
,
esize
;
TRACE
(
"(%p, %p)
\n
"
,
pStubMsg
,
pFormat
);
if
((
pFormat
[
0
]
!=
RPC_FC_SMVARRAY
)
&&
(
pFormat
[
0
]
!=
RPC_FC_LGVARRAY
))
{
ERR
(
"invalid format type %x
\n
"
,
pFormat
[
0
]);
RpcRaiseException
(
RPC_S_INTERNAL_ERROR
);
return
0
;
}
alignment
=
pFormat
[
1
]
+
1
;
if
(
pFormat
[
0
]
==
RPC_FC_SMVARRAY
)
{
pFormat
+=
2
;
size
=
*
(
const
WORD
*
)
pFormat
;
pFormat
+=
sizeof
(
WORD
);
elements
=
*
(
const
WORD
*
)
pFormat
;
pFormat
+=
sizeof
(
WORD
);
}
else
{
pFormat
+=
2
;
size
=
*
(
const
DWORD
*
)
pFormat
;
pFormat
+=
sizeof
(
DWORD
);
elements
=
*
(
const
DWORD
*
)
pFormat
;
pFormat
+=
sizeof
(
DWORD
);
}
esize
=
*
(
const
WORD
*
)
pFormat
;
pFormat
+=
sizeof
(
WORD
);
pFormat
=
ReadVariance
(
pStubMsg
,
pFormat
);
if
((
pStubMsg
->
ActualCount
>
elements
)
||
(
pStubMsg
->
ActualCount
+
pStubMsg
->
Offset
>
elements
))
{
RpcRaiseException
(
RPC_S_INVALID_BOUND
);
return
0
;
}
ALIGN_POINTER
(
pStubMsg
->
Buffer
,
alignment
);
pStubMsg
->
Buffer
+=
pStubMsg
->
ActualCount
*
esize
;
pStubMsg
->
MemorySize
+=
size
;
EmbeddedPointerMemorySize
(
pStubMsg
,
pFormat
);
return
pStubMsg
->
MemorySize
;
}
/***********************************************************************
...
...
@@ -3575,7 +3773,47 @@ void WINAPI NdrVaryingArrayFree(PMIDL_STUB_MESSAGE pStubMsg,
unsigned
char
*
pMemory
,
PFORMAT_STRING
pFormat
)
{
FIXME
(
"stub
\n
"
);
unsigned
char
alignment
;
DWORD
elements
;
TRACE
(
"(%p, %p, %p)
\n
"
,
pStubMsg
,
pMemory
,
pFormat
);
if
((
pFormat
[
0
]
!=
RPC_FC_SMVARRAY
)
&&
(
pFormat
[
0
]
!=
RPC_FC_LGVARRAY
))
{
ERR
(
"invalid format type %x
\n
"
,
pFormat
[
0
]);
RpcRaiseException
(
RPC_S_INTERNAL_ERROR
);
return
;
}
alignment
=
pFormat
[
1
]
+
1
;
if
(
pFormat
[
0
]
==
RPC_FC_SMVARRAY
)
{
pFormat
+=
2
;
pFormat
+=
sizeof
(
WORD
);
elements
=
*
(
const
WORD
*
)
pFormat
;
pFormat
+=
sizeof
(
WORD
);
}
else
{
pFormat
+=
2
;
pFormat
+=
sizeof
(
DWORD
);
elements
=
*
(
const
DWORD
*
)
pFormat
;
pFormat
+=
sizeof
(
DWORD
);
}
pFormat
+=
sizeof
(
WORD
);
pFormat
=
ComputeVariance
(
pStubMsg
,
pMemory
,
pFormat
,
0
);
if
((
pStubMsg
->
ActualCount
>
elements
)
||
(
pStubMsg
->
ActualCount
+
pStubMsg
->
Offset
>
elements
))
{
RpcRaiseException
(
RPC_S_INVALID_BOUND
);
return
;
}
EmbeddedPointerFree
(
pStubMsg
,
pMemory
,
pFormat
);
}
/***********************************************************************
...
...
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