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
2b0ad6e6
Commit
2b0ad6e6
authored
Nov 05, 2007
by
Rob Shearman
Committed by
Alexandre Julliard
Jul 14, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rpcrt4: Implement MesDecodeBufferHandleCreate and MesEncodeFixedBufferHandleCreate.
parent
734094ed
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
72 additions
and
2 deletions
+72
-2
ndr_es.c
dlls/rpcrt4/ndr_es.c
+70
-0
rpcrt4.spec
dlls/rpcrt4/rpcrt4.spec
+2
-2
No files found.
dlls/rpcrt4/ndr_es.c
View file @
2b0ad6e6
...
...
@@ -132,6 +132,58 @@ RPC_STATUS WINAPI MesHandleFree(handle_t Handle)
return
RPC_S_OK
;
}
/***********************************************************************
* MesEncodeFixedBufferHandleCreate [RPCRT4.@]
*/
RPC_STATUS
RPC_ENTRY
MesEncodeFixedBufferHandleCreate
(
char
*
Buffer
,
ULONG
BufferSize
,
ULONG
*
pEncodedSize
,
handle_t
*
pHandle
)
{
MIDL_ES_MESSAGE
*
pEsMsg
;
TRACE
(
"(%p, %d, %p, %p)
\n
"
,
Buffer
,
BufferSize
,
pEncodedSize
,
pHandle
);
pEsMsg
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
*
pEsMsg
));
if
(
!
pEsMsg
)
return
ERROR_OUTOFMEMORY
;
init_MIDL_ES_MESSAGE
(
pEsMsg
);
pEsMsg
->
Operation
=
MES_ENCODE
;
pEsMsg
->
HandleStyle
=
MES_FIXED_BUFFER_HANDLE
;
pEsMsg
->
Buffer
=
(
unsigned
char
*
)
Buffer
;
pEsMsg
->
BufferSize
=
BufferSize
;
pEsMsg
->
pEncodedSize
=
pEncodedSize
;
*
pHandle
=
(
handle_t
)
pEsMsg
;
return
RPC_S_OK
;}
/***********************************************************************
* MesDecodeBufferHandleCreate [RPCRT4.@]
*/
RPC_STATUS
RPC_ENTRY
MesDecodeBufferHandleCreate
(
char
*
Buffer
,
ULONG
BufferSize
,
handle_t
*
pHandle
)
{
MIDL_ES_MESSAGE
*
pEsMsg
;
TRACE
(
"(%p, %d, %p)
\n
"
,
Buffer
,
BufferSize
,
pHandle
);
pEsMsg
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
*
pEsMsg
));
if
(
!
pEsMsg
)
return
ERROR_OUTOFMEMORY
;
init_MIDL_ES_MESSAGE
(
pEsMsg
);
pEsMsg
->
Operation
=
MES_DECODE
;
pEsMsg
->
HandleStyle
=
MES_FIXED_BUFFER_HANDLE
;
pEsMsg
->
Buffer
=
(
unsigned
char
*
)
Buffer
;
pEsMsg
->
BufferSize
=
BufferSize
;
*
pHandle
=
(
handle_t
)
pEsMsg
;
return
RPC_S_OK
;
}
static
void
es_data_alloc
(
MIDL_ES_MESSAGE
*
pEsMsg
,
ULONG
size
)
{
if
(
pEsMsg
->
HandleStyle
==
MES_INCREMENTAL_HANDLE
)
...
...
@@ -145,6 +197,11 @@ static void es_data_alloc(MIDL_ES_MESSAGE *pEsMsg, ULONG size)
RpcRaiseException
(
ERROR_OUTOFMEMORY
);
}
}
else
if
(
pEsMsg
->
HandleStyle
==
MES_FIXED_BUFFER_HANDLE
)
{
TRACE
(
"%d with fixed buffer handle
\n
"
,
size
);
pEsMsg
->
StubMsg
.
Buffer
=
pEsMsg
->
Buffer
;
}
pEsMsg
->
StubMsg
.
RpcMsg
->
Buffer
=
pEsMsg
->
StubMsg
.
BufferStart
=
pEsMsg
->
StubMsg
.
Buffer
;
}
...
...
@@ -161,6 +218,14 @@ static void es_data_read(MIDL_ES_MESSAGE *pEsMsg, ULONG size)
RpcRaiseException
(
ERROR_OUTOFMEMORY
);
}
}
else
{
TRACE
(
"%d from fixed or dynamic buffer handle
\n
"
,
size
);
/* FIXME: validate BufferSize? */
pEsMsg
->
StubMsg
.
Buffer
=
pEsMsg
->
Buffer
;
pEsMsg
->
Buffer
+=
size
;
pEsMsg
->
BufferSize
-=
size
;
}
pEsMsg
->
StubMsg
.
BufferLength
=
size
;
pEsMsg
->
StubMsg
.
RpcMsg
->
Buffer
=
pEsMsg
->
StubMsg
.
BufferStart
=
pEsMsg
->
StubMsg
.
Buffer
;
pEsMsg
->
StubMsg
.
BufferEnd
=
pEsMsg
->
StubMsg
.
Buffer
+
size
;
...
...
@@ -173,6 +238,11 @@ static void es_data_write(MIDL_ES_MESSAGE *pEsMsg, ULONG size)
TRACE
(
"%d to incremental handle
\n
"
,
size
);
pEsMsg
->
Write
(
pEsMsg
->
UserState
,
(
char
*
)
pEsMsg
->
StubMsg
.
BufferStart
,
size
);
}
else
{
TRACE
(
"%d to dynamic or fixed buffer handle
\n
"
,
size
);
*
pEsMsg
->
pEncodedSize
+=
size
;
}
}
static
inline
ULONG
mes_proc_header_buffer_size
(
void
)
...
...
dlls/rpcrt4/rpcrt4.spec
View file @
2b0ad6e6
...
...
@@ -97,10 +97,10 @@
@ stub MIDL_wchar_strcpy
@ stub MIDL_wchar_strlen
@ stub MesBufferHandleReset
@ st
ub MesDecodeBufferHandleCreate
@ st
dcall MesDecodeBufferHandleCreate(ptr long ptr)
@ stdcall MesDecodeIncrementalHandleCreate(ptr ptr ptr)
@ stub MesEncodeDynBufferHandleCreate
@ st
ub MesEncodeFixedBufferHandleCreate
@ st
dcall MesEncodeFixedBufferHandleCreate(ptr long ptr ptr)
@ stdcall MesEncodeIncrementalHandleCreate(ptr ptr ptr ptr)
@ stdcall MesHandleFree(ptr)
@ stdcall MesIncrementalHandleReset(ptr ptr ptr ptr ptr long)
...
...
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