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
33c4c25d
Commit
33c4c25d
authored
Dec 12, 2007
by
Rob Shearman
Committed by
Alexandre Julliard
Dec 12, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rpcrt4: Make the NdrAllocate tests pass on XP SP2 and greater.
parent
f3e59a3d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
45 additions
and
15 deletions
+45
-15
ndr_marshall.c
dlls/rpcrt4/tests/ndr_marshall.c
+45
-15
No files found.
dlls/rpcrt4/tests/ndr_marshall.c
View file @
33c4c25d
...
...
@@ -952,12 +952,19 @@ static void test_ndr_allocate(void)
MIDL_STUB_MESSAGE
StubMsg
;
MIDL_STUB_DESC
StubDesc
;
void
*
p1
,
*
p2
;
struct
tag_mem_list_t
struct
tag_mem_list_
v1_
t
{
DWORD
magic
;
void
*
ptr
;
struct
tag_mem_list_t
*
next
;
}
*
mem_list
;
struct
tag_mem_list_v1_t
*
next
;
}
*
mem_list_v1
;
struct
tag_mem_list_v2_t
{
DWORD
magic
;
DWORD
size
;
DWORD
unknown
;
struct
tag_mem_list_v2_t
*
next
;
}
*
mem_list_v2
;
const
DWORD
magic_MEML
=
'M'
<<
24
|
'E'
<<
16
|
'M'
<<
8
|
'L'
;
StubDesc
=
Object_StubDesc
;
...
...
@@ -966,23 +973,46 @@ static void test_ndr_allocate(void)
ok
(
StubMsg
.
pMemoryList
==
NULL
,
"memlist %p
\n
"
,
StubMsg
.
pMemoryList
);
my_alloc_called
=
my_free_called
=
0
;
p1
=
NdrAllocate
(
&
StubMsg
,
10
);
p2
=
NdrAllocate
(
&
StubMsg
,
2
0
);
p2
=
NdrAllocate
(
&
StubMsg
,
2
4
);
ok
(
my_alloc_called
==
2
,
"alloc called %d
\n
"
,
my_alloc_called
);
mem_list
=
StubMsg
.
pMemoryList
;
todo_wine
{
ok
(
mem_list
!=
NULL
,
"mem_l
ist NULL
\n
"
);
ok
(
StubMsg
.
pMemoryList
!=
NULL
,
"StubMsg.pMemoryL
ist NULL
\n
"
);
}
if
(
mem_l
ist
)
if
(
StubMsg
.
pMemoryL
ist
)
{
ok
(
mem_list
->
magic
==
magic_MEML
,
"magic %08x
\n
"
,
mem_list
->
magic
);
ok
(
mem_list
->
ptr
==
p2
,
"ptr != p2
\n
"
);
ok
(
mem_list
->
next
!=
NULL
,
"next NULL
\n
"
);
mem_list
=
mem_list
->
next
;
if
(
mem_list
)
mem_list_v2
=
StubMsg
.
pMemoryList
;
if
(
mem_list_v2
->
size
==
24
)
{
trace
(
"v2 mem list format
\n
"
);
ok
((
char
*
)
mem_list_v2
==
(
char
*
)
p2
+
24
,
"expected mem_list_v2 pointer %p, but got %p
\n
"
,
(
char
*
)
p2
+
24
,
mem_list_v2
);
ok
(
mem_list_v2
->
magic
==
magic_MEML
,
"magic %08x
\n
"
,
mem_list_v2
->
magic
);
ok
(
mem_list_v2
->
size
==
24
,
"wrong size for p2 %d
\n
"
,
mem_list_v2
->
size
);
ok
(
mem_list_v2
->
unknown
==
0
,
"wrong unknown for p2 0x%x
\n
"
,
mem_list_v2
->
unknown
);
ok
(
mem_list_v2
->
next
!=
NULL
,
"next NULL
\n
"
);
mem_list_v2
=
mem_list_v2
->
next
;
if
(
mem_list_v2
)
{
ok
((
char
*
)
mem_list_v2
==
(
char
*
)
p1
+
16
,
"expected mem_list_v2 pointer %p, but got %p
\n
"
,
(
char
*
)
p1
+
16
,
mem_list_v2
);
ok
(
mem_list_v2
->
magic
==
magic_MEML
,
"magic %08x
\n
"
,
mem_list_v2
->
magic
);
ok
(
mem_list_v2
->
size
==
16
,
"wrong size for p1 %d
\n
"
,
mem_list_v2
->
size
);
ok
(
mem_list_v2
->
unknown
==
0
,
"wrong unknown for p1 0x%x
\n
"
,
mem_list_v2
->
unknown
);
ok
(
mem_list_v2
->
next
==
NULL
,
"next %p
\n
"
,
mem_list_v2
->
next
);
}
}
else
{
ok
(
mem_list
->
magic
==
magic_MEML
,
"magic %08x
\n
"
,
mem_list
->
magic
);
ok
(
mem_list
->
ptr
==
p1
,
"ptr != p2
\n
"
);
ok
(
mem_list
->
next
==
NULL
,
"next %p
\n
"
,
mem_list
->
next
);
trace
(
"v1 mem list format
\n
"
);
mem_list_v1
=
StubMsg
.
pMemoryList
;
ok
(
mem_list_v1
->
magic
==
magic_MEML
,
"magic %08x
\n
"
,
mem_list_v1
->
magic
);
ok
(
mem_list_v1
->
ptr
==
p2
,
"ptr != p2
\n
"
);
ok
(
mem_list_v1
->
next
!=
NULL
,
"next NULL
\n
"
);
mem_list_v1
=
mem_list_v1
->
next
;
if
(
mem_list_v1
)
{
ok
(
mem_list_v1
->
magic
==
magic_MEML
,
"magic %08x
\n
"
,
mem_list_v1
->
magic
);
ok
(
mem_list_v1
->
ptr
==
p1
,
"ptr != p1
\n
"
);
ok
(
mem_list_v1
->
next
==
NULL
,
"next %p
\n
"
,
mem_list_v1
->
next
);
}
}
}
/* NdrFree isn't exported so we can't test free'ing */
...
...
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