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
369f4ccd
Commit
369f4ccd
authored
Mar 05, 2008
by
Francois Gouget
Committed by
Alexandre Julliard
Mar 05, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll/tests: Don't use 0x55/0xaa to avoid any confusion when running with +heap.
parent
891e3d17
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
atom.c
dlls/ntdll/tests/atom.c
+6
-6
No files found.
dlls/ntdll/tests/atom.c
View file @
369f4ccd
...
...
@@ -198,13 +198,13 @@ static void test_NtAtom(void)
ok
((
lstrlenW
(
testAtom2
)
*
sizeof
(
WCHAR
))
==
Len
,
"Returned wrong length %d
\n
"
,
Len
);
Len
=
8
;
Name
[
0
]
=
Name
[
1
]
=
Name
[
2
]
=
Name
[
3
]
=
Name
[
4
]
=
0x
55AA
;
Name
[
0
]
=
Name
[
1
]
=
Name
[
2
]
=
Name
[
3
]
=
Name
[
4
]
=
0x
1337
;
res
=
pRtlQueryAtomInAtomTable
(
AtomTable
,
Atom2
,
NULL
,
NULL
,
Name
,
&
Len
);
ok
(
!
res
,
"query atom %x
\n
"
,
res
);
ok
(
Len
==
6
,
"wrong length %u
\n
"
,
Len
);
ok
(
!
memcmp
(
Name
,
testAtom2
,
Len
),
"wrong atom string
\n
"
);
ok
(
!
Name
[
3
],
"wrong string termination
\n
"
);
ok
(
Name
[
4
]
==
0x
55AA
,
"buffer overwrite
\n
"
);
ok
(
Name
[
4
]
==
0x
1337
,
"buffer overwrite
\n
"
);
Len
=
lstrlenW
(
testAtom2
)
*
sizeof
(
WCHAR
);
memset
(
Name
,
'.'
,
sizeof
(
Name
));
...
...
@@ -436,27 +436,27 @@ static void test_Global(void)
res
=
pNtAddAtom
(
testAtom1
,
lstrlenW
(
testAtom1
)
*
sizeof
(
WCHAR
),
&
atom
);
ok
(
!
res
,
"Added atom (%x)
\n
"
,
res
);
memset
(
abi
->
Name
,
0x
55
,
255
*
sizeof
(
WCHAR
));
memset
(
abi
->
Name
,
0x
cc
,
255
*
sizeof
(
WCHAR
));
res
=
pNtQueryInformationAtom
(
atom
,
AtomBasicInformation
,
(
void
*
)
ptr
,
ptr_size
,
NULL
);
ok
(
!
res
,
"atom lookup
\n
"
);
ok
(
!
lstrcmpW
(
abi
->
Name
,
testAtom1
),
"ok strings
\n
"
);
ok
(
abi
->
NameLength
==
lstrlenW
(
testAtom1
)
*
sizeof
(
WCHAR
),
"wrong string length
\n
"
);
ok
(
abi
->
Name
[
lstrlenW
(
testAtom1
)]
==
0
,
"wrong string termination %x
\n
"
,
abi
->
Name
[
lstrlenW
(
testAtom1
)]);
ok
(
abi
->
Name
[
lstrlenW
(
testAtom1
)
+
1
]
==
0x
5555
,
"buffer overwrite %x
\n
"
,
abi
->
Name
[
lstrlenW
(
testAtom1
)
+
1
]);
ok
(
abi
->
Name
[
lstrlenW
(
testAtom1
)
+
1
]
==
0x
cccc
,
"buffer overwrite %x
\n
"
,
abi
->
Name
[
lstrlenW
(
testAtom1
)
+
1
]);
ptr_size
=
sizeof
(
ATOM_BASIC_INFORMATION
);
res
=
pNtQueryInformationAtom
(
atom
,
AtomBasicInformation
,
(
void
*
)
ptr
,
ptr_size
,
NULL
);
ok
(
res
==
STATUS_BUFFER_TOO_SMALL
,
"wrong return status (%x)
\n
"
,
res
);
ok
(
abi
->
NameLength
==
lstrlenW
(
testAtom1
)
*
sizeof
(
WCHAR
),
"ok string length
\n
"
);
memset
(
abi
->
Name
,
0x
55
,
lstrlenW
(
testAtom1
)
*
sizeof
(
WCHAR
));
memset
(
abi
->
Name
,
0x
cc
,
lstrlenW
(
testAtom1
)
*
sizeof
(
WCHAR
));
ptr_size
=
sizeof
(
ATOM_BASIC_INFORMATION
)
+
lstrlenW
(
testAtom1
)
*
sizeof
(
WCHAR
);
res
=
pNtQueryInformationAtom
(
atom
,
AtomBasicInformation
,
(
void
*
)
ptr
,
ptr_size
,
NULL
);
ok
(
!
res
,
"atom lookup %x
\n
"
,
res
);
ok
(
!
lstrcmpW
(
abi
->
Name
,
testAtom1
),
"strings don't match
\n
"
);
ok
(
abi
->
NameLength
==
lstrlenW
(
testAtom1
)
*
sizeof
(
WCHAR
),
"wrong string length
\n
"
);
ok
(
abi
->
Name
[
lstrlenW
(
testAtom1
)]
==
0
,
"buffer overwrite %x
\n
"
,
abi
->
Name
[
lstrlenW
(
testAtom1
)]);
ok
(
abi
->
Name
[
lstrlenW
(
testAtom1
)
+
1
]
==
0x
5555
,
"buffer overwrite %x
\n
"
,
abi
->
Name
[
lstrlenW
(
testAtom1
)
+
1
]);
ok
(
abi
->
Name
[
lstrlenW
(
testAtom1
)
+
1
]
==
0x
cccc
,
"buffer overwrite %x
\n
"
,
abi
->
Name
[
lstrlenW
(
testAtom1
)
+
1
]);
ptr_size
=
sizeof
(
ATOM_BASIC_INFORMATION
)
+
4
*
sizeof
(
WCHAR
);
abi
->
Name
[
0
]
=
abi
->
Name
[
1
]
=
abi
->
Name
[
2
]
=
abi
->
Name
[
3
]
=
'\0'
;
...
...
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