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
fc17683f
Commit
fc17683f
authored
Nov 28, 2005
by
Robert Shearman
Committed by
Alexandre Julliard
Nov 28, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Extend conformance computation function to also compute variances.
MSDN suggests that conformance and variance are pretty much the same, but there may be some subtleties to it.
parent
fea8a762
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
9 deletions
+22
-9
ndr_marshall.c
dlls/rpcrt4/ndr_marshall.c
+17
-7
ndr_misc.h
dlls/rpcrt4/ndr_misc.h
+5
-2
No files found.
dlls/rpcrt4/ndr_marshall.c
View file @
fc17683f
...
@@ -286,17 +286,27 @@ PFORMAT_STRING ReadConformance(MIDL_STUB_MESSAGE *pStubMsg, PFORMAT_STRING pForm
...
@@ -286,17 +286,27 @@ PFORMAT_STRING ReadConformance(MIDL_STUB_MESSAGE *pStubMsg, PFORMAT_STRING pForm
return
pFormat
+
4
;
return
pFormat
+
4
;
}
}
PFORMAT_STRING
ComputeConformance
(
MIDL_STUB_MESSAGE
*
pStubMsg
,
unsigned
char
*
pMemory
,
static
inline
PFORMAT_STRING
ReadVariance
(
MIDL_STUB_MESSAGE
*
pStubMsg
,
PFORMAT_STRING
pFormat
)
PFORMAT_STRING
pFormat
,
ULONG_PTR
def
)
{
pStubMsg
->
ActualCount
=
NDR_LOCAL_UINT32_READ
(
pStubMsg
->
Buffer
);
pStubMsg
->
Buffer
+=
4
;
TRACE
(
"unmarshalled variance is %ld
\n
"
,
pStubMsg
->
ActualCount
);
return
pFormat
+
4
;
}
PFORMAT_STRING
ComputeConformanceOrVariance
(
MIDL_STUB_MESSAGE
*
pStubMsg
,
unsigned
char
*
pMemory
,
PFORMAT_STRING
pFormat
,
ULONG_PTR
def
,
ULONG
*
pCount
)
{
{
BYTE
dtype
=
pFormat
[
0
]
&
0xf
;
BYTE
dtype
=
pFormat
[
0
]
&
0xf
;
short
ofs
=
*
(
short
*
)
&
pFormat
[
2
];
short
ofs
=
*
(
short
*
)
&
pFormat
[
2
];
LPVOID
ptr
=
NULL
;
LPVOID
ptr
=
NULL
;
DWORD
data
=
0
;
DWORD
data
=
0
;
/* FIXME: is this correct? */
if
(
pFormat
[
0
]
==
0xff
)
{
if
(
pFormat
[
0
]
==
0xff
)
{
/* null descriptor */
/* null descriptor */
pStubMsg
->
Max
Count
=
def
;
*
p
Count
=
def
;
goto
finish_conf
;
goto
finish_conf
;
}
}
...
@@ -315,14 +325,14 @@ PFORMAT_STRING ComputeConformance(MIDL_STUB_MESSAGE *pStubMsg, unsigned char *pM
...
@@ -315,14 +325,14 @@ PFORMAT_STRING ComputeConformance(MIDL_STUB_MESSAGE *pStubMsg, unsigned char *pM
ptr
=
pStubMsg
->
StackTop
+
ofs
;
ptr
=
pStubMsg
->
StackTop
+
ofs
;
}
}
else
{
else
{
/* -Os mode,
Max
Count is already set */
/* -Os mode,
*p
Count is already set */
goto
finish_conf
;
goto
finish_conf
;
}
}
break
;
break
;
case
RPC_FC_CONSTANT_CONFORMANCE
:
case
RPC_FC_CONSTANT_CONFORMANCE
:
data
=
ofs
|
((
DWORD
)
pFormat
[
1
]
<<
16
);
data
=
ofs
|
((
DWORD
)
pFormat
[
1
]
<<
16
);
TRACE
(
"constant conformance, val=%ld
\n
"
,
data
);
TRACE
(
"constant conformance, val=%ld
\n
"
,
data
);
pStubMsg
->
Max
Count
=
data
;
*
p
Count
=
data
;
goto
finish_conf
;
goto
finish_conf
;
case
RPC_FC_TOP_LEVEL_MULTID_CONFORMANCE
:
case
RPC_FC_TOP_LEVEL_MULTID_CONFORMANCE
:
FIXME
(
"toplevel multidimensional conformance, ofs=%d
\n
"
,
ofs
);
FIXME
(
"toplevel multidimensional conformance, ofs=%d
\n
"
,
ofs
);
...
@@ -376,7 +386,7 @@ PFORMAT_STRING ComputeConformance(MIDL_STUB_MESSAGE *pStubMsg, unsigned char *pM
...
@@ -376,7 +386,7 @@ PFORMAT_STRING ComputeConformance(MIDL_STUB_MESSAGE *pStubMsg, unsigned char *pM
done_conf_grab:
done_conf_grab:
switch
(
pFormat
[
1
])
{
switch
(
pFormat
[
1
])
{
case
0
:
/* no op */
case
0
:
/* no op */
pStubMsg
->
Max
Count
=
data
;
*
p
Count
=
data
;
break
;
break
;
case
RPC_FC_DEREFERENCE
:
case
RPC_FC_DEREFERENCE
:
/* already handled */
/* already handled */
...
@@ -387,7 +397,7 @@ done_conf_grab:
...
@@ -387,7 +397,7 @@ done_conf_grab:
}
}
finish_conf:
finish_conf:
TRACE
(
"resulting conformance is %ld
\n
"
,
pStubMsg
->
Max
Count
);
TRACE
(
"resulting conformance is %ld
\n
"
,
*
p
Count
);
return
pFormat
+
4
;
return
pFormat
+
4
;
}
}
...
...
dlls/rpcrt4/ndr_misc.h
View file @
fc17683f
...
@@ -35,8 +35,11 @@ LONG_PTR RPCRT4_NdrClientCall2(PMIDL_STUB_DESC pStubDesc,
...
@@ -35,8 +35,11 @@ LONG_PTR RPCRT4_NdrClientCall2(PMIDL_STUB_DESC pStubDesc,
HRESULT
RPCRT4_GetPSFactory
(
REFIID
riid
,
struct
IPSFactoryBuffer
**
ppPS
);
HRESULT
RPCRT4_GetPSFactory
(
REFIID
riid
,
struct
IPSFactoryBuffer
**
ppPS
);
PFORMAT_STRING
ComputeConformance
(
MIDL_STUB_MESSAGE
*
pStubMsg
,
unsigned
char
*
pMemory
,
#define ComputeConformance(pStubMsg, pMemory, pFormat, def) ComputeConformanceOrVariance(pStubMsg, pMemory, pFormat, def, &pStubMsg->MaxCount)
PFORMAT_STRING
pFormat
,
ULONG_PTR
def
);
#define ComputeVariance(pStubMsg, pMemory, pFormat, def) ComputeConformanceOrVariance(pStubMsg, pMemory, pFormat, def, &pStubMsg->ActualCount)
PFORMAT_STRING
ComputeConformanceOrVariance
(
MIDL_STUB_MESSAGE
*
pStubMsg
,
unsigned
char
*
pMemory
,
PFORMAT_STRING
pFormat
,
ULONG_PTR
def
,
ULONG
*
pCount
);
typedef
unsigned
char
*
(
WINAPI
*
NDR_MARSHALL
)
(
PMIDL_STUB_MESSAGE
,
unsigned
char
*
,
PFORMAT_STRING
);
typedef
unsigned
char
*
(
WINAPI
*
NDR_MARSHALL
)
(
PMIDL_STUB_MESSAGE
,
unsigned
char
*
,
PFORMAT_STRING
);
typedef
unsigned
char
*
(
WINAPI
*
NDR_UNMARSHALL
)(
PMIDL_STUB_MESSAGE
,
unsigned
char
**
,
PFORMAT_STRING
,
unsigned
char
);
typedef
unsigned
char
*
(
WINAPI
*
NDR_UNMARSHALL
)(
PMIDL_STUB_MESSAGE
,
unsigned
char
**
,
PFORMAT_STRING
,
unsigned
char
);
...
...
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