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
cf50aa91
Commit
cf50aa91
authored
Apr 07, 2010
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rpcrt4: Clean up handling of enum16 types.
parent
4f62b090
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
14 deletions
+21
-14
ndr_marshall.c
dlls/rpcrt4/ndr_marshall.c
+21
-14
No files found.
dlls/rpcrt4/ndr_marshall.c
View file @
cf50aa91
...
...
@@ -2822,12 +2822,15 @@ static unsigned char * ComplexMarshall(PMIDL_STUB_MESSAGE pStubMsg,
pMemory
+=
2
;
break
;
case
RPC_FC_ENUM16
:
{
USHORT
val
=
*
(
DWORD
*
)
pMemory
;
TRACE
(
"enum16=%d <= %p
\n
"
,
*
(
DWORD
*
)
pMemory
,
pMemory
);
if
(
32767
<
*
(
DWORD
*
)
pMemory
)
RpcRaiseException
(
RPC_X_ENUM_VALUE_OUT_OF_RANGE
);
safe_copy_to_buffer
(
pStubMsg
,
pMemory
,
2
);
safe_copy_to_buffer
(
pStubMsg
,
&
val
,
2
);
pMemory
+=
4
;
break
;
}
case
RPC_FC_LONG
:
case
RPC_FC_ULONG
:
case
RPC_FC_ENUM32
:
...
...
@@ -2969,13 +2972,16 @@ static unsigned char * ComplexUnmarshall(PMIDL_STUB_MESSAGE pStubMsg,
pMemory
+=
2
;
break
;
case
RPC_FC_ENUM16
:
safe_copy_from_buffer
(
pStubMsg
,
pMemory
,
2
);
*
(
DWORD
*
)
pMemory
&=
0xffff
;
{
WORD
val
;
safe_copy_from_buffer
(
pStubMsg
,
&
val
,
2
);
*
(
DWORD
*
)
pMemory
=
val
;
TRACE
(
"enum16=%d => %p
\n
"
,
*
(
DWORD
*
)
pMemory
,
pMemory
);
if
(
32767
<
*
(
DWORD
*
)
pMemory
)
RpcRaiseException
(
RPC_X_ENUM_VALUE_OUT_OF_RANGE
);
pMemory
+=
4
;
break
;
}
case
RPC_FC_LONG
:
case
RPC_FC_ULONG
:
case
RPC_FC_ENUM32
:
...
...
@@ -6544,16 +6550,16 @@ static unsigned char *WINAPI NdrBaseTypeMarshall(
TRACE
(
"value: %s
\n
"
,
wine_dbgstr_longlong
(
*
(
ULONGLONG
*
)
pMemory
));
break
;
case
RPC_FC_ENUM16
:
{
USHORT
val
=
*
(
UINT
*
)
pMemory
;
/* only 16-bits on the wire, so do a sanity check */
if
(
*
(
UINT
*
)
pMemory
>
SHRT_MAX
)
RpcRaiseException
(
RPC_X_ENUM_VALUE_OUT_OF_RANGE
);
align_pointer_clear
(
&
pStubMsg
->
Buffer
,
sizeof
(
USHORT
));
if
(
pStubMsg
->
Buffer
+
sizeof
(
USHORT
)
>
(
unsigned
char
*
)
pStubMsg
->
RpcMsg
->
Buffer
+
pStubMsg
->
BufferLength
)
RpcRaiseException
(
RPC_X_BAD_STUB_DATA
);
*
(
USHORT
*
)
pStubMsg
->
Buffer
=
*
(
UINT
*
)
pMemory
;
pStubMsg
->
Buffer
+=
sizeof
(
USHORT
);
safe_copy_to_buffer
(
pStubMsg
,
&
val
,
sizeof
(
val
));
TRACE
(
"value: 0x%04x
\n
"
,
*
(
UINT
*
)
pMemory
);
break
;
}
case
RPC_FC_IGNORE
:
break
;
default:
...
...
@@ -6575,7 +6581,7 @@ static unsigned char *WINAPI NdrBaseTypeUnmarshall(
{
TRACE
(
"pStubMsg: %p, ppMemory: %p, type: 0x%02x, fMustAlloc: %s
\n
"
,
pStubMsg
,
ppMemory
,
*
pFormat
,
fMustAlloc
?
"true"
:
"false"
);
#define BASE_TYPE_UNMARSHALL(type) \
#define BASE_TYPE_UNMARSHALL(type)
do {
\
align_pointer(&pStubMsg->Buffer, sizeof(type)); \
if (!fMustAlloc && !pStubMsg->IsClient && !*ppMemory) \
{ \
...
...
@@ -6589,7 +6595,8 @@ static unsigned char *WINAPI NdrBaseTypeUnmarshall(
*ppMemory = NdrAllocate(pStubMsg, sizeof(type)); \
TRACE("*ppMemory: %p\n", *ppMemory); \
safe_copy_from_buffer(pStubMsg, *ppMemory, sizeof(type)); \
}
} \
} while (0)
switch
(
*
pFormat
)
{
...
...
@@ -6626,19 +6633,19 @@ static unsigned char *WINAPI NdrBaseTypeUnmarshall(
TRACE
(
"value: %s
\n
"
,
wine_dbgstr_longlong
(
**
(
ULONGLONG
**
)
ppMemory
));
break
;
case
RPC_FC_ENUM16
:
{
USHORT
val
;
align_pointer
(
&
pStubMsg
->
Buffer
,
sizeof
(
USHORT
));
if
(
!
fMustAlloc
&&
!*
ppMemory
)
fMustAlloc
=
TRUE
;
if
(
fMustAlloc
)
*
ppMemory
=
NdrAllocate
(
pStubMsg
,
sizeof
(
UINT
));
if
(
pStubMsg
->
Buffer
+
sizeof
(
USHORT
)
>
pStubMsg
->
BufferEnd
)
RpcRaiseException
(
RPC_X_BAD_STUB_DATA
);
TRACE
(
"*ppMemory: %p
\n
"
,
*
ppMemory
);
safe_copy_from_buffer
(
pStubMsg
,
&
val
,
sizeof
(
USHORT
));
/* 16-bits on the wire, but int in memory */
**
(
UINT
**
)
ppMemory
=
*
(
USHORT
*
)
pStubMsg
->
Buffer
;
pStubMsg
->
Buffer
+=
sizeof
(
USHORT
);
**
(
UINT
**
)
ppMemory
=
val
;
TRACE
(
"value: 0x%08x
\n
"
,
**
(
UINT
**
)
ppMemory
);
break
;
}
case
RPC_FC_IGNORE
:
break
;
default:
...
...
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