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
73354ef9
Commit
73354ef9
authored
Dec 19, 2011
by
Nikolay Sivov
Committed by
Alexandre Julliard
Dec 20, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32: Fix parameter validation for CreateMRUListLazyA().
parent
d9d4a06c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
43 additions
and
27 deletions
+43
-27
comctl32undoc.c
dlls/comctl32/comctl32undoc.c
+1
-2
mru.c
dlls/comctl32/tests/mru.c
+42
-25
No files found.
dlls/comctl32/comctl32undoc.c
View file @
73354ef9
...
...
@@ -777,8 +777,7 @@ HANDLE WINAPI CreateMRUListLazyA (const MRUINFOA *lpcml, DWORD dwParam2,
/* Native does not check for a NULL lpcml */
if
(
lpcml
->
cbSize
!=
sizeof
(
MRUINFOA
)
||
!
lpcml
->
hKey
||
IsBadStringPtrA
(
lpcml
->
lpszSubKey
,
-
1
))
if
(
!
lpcml
->
hKey
||
IsBadStringPtrA
(
lpcml
->
lpszSubKey
,
-
1
))
return
0
;
mp
=
Alloc
(
sizeof
(
WINEMRULIST
));
...
...
dlls/comctl32/tests/mru.c
View file @
73354ef9
...
...
@@ -447,12 +447,37 @@ static void test_MRUListA(void)
/* FreeMRUList(NULL) crashes on Win98 OSR0 */
}
/*
typedef struct tagMRUINFOA
{
DWORD cbSize;
UINT uMax;
UINT fFlags;
HKEY hKey;
LPCSTR lpszSubKey;
PROC lpfnCompare;
} MRUINFOA;
*/
typedef
struct
{
MRUINFOA
mruA
;
BOOL
ret
;
}
create_lazya_t
;
static
const
create_lazya_t
create_lazyA
[]
=
{
{{
sizeof
(
MRUINFOA
)
+
1
,
0
,
0
,
HKEY_CURRENT_USER
,
NULL
,
NULL
},
FALSE
},
{{
sizeof
(
MRUINFOA
)
-
1
,
0
,
0
,
HKEY_CURRENT_USER
,
NULL
,
NULL
},
FALSE
},
{{
sizeof
(
MRUINFOA
)
+
1
,
0
,
0
,
HKEY_CURRENT_USER
,
"WineTest"
,
NULL
},
TRUE
},
{{
sizeof
(
MRUINFOA
)
-
1
,
0
,
0
,
HKEY_CURRENT_USER
,
"WineTest"
,
NULL
},
TRUE
},
{{
sizeof
(
MRUINFOA
),
0
,
0
,
HKEY_CURRENT_USER
,
"WineTest"
,
NULL
},
TRUE
},
{{
sizeof
(
MRUINFOA
),
0
,
0
,
HKEY_CURRENT_USER
,
NULL
,
NULL
},
FALSE
},
{{
sizeof
(
MRUINFOA
),
0
,
0
,
NULL
,
"WineTest"
,
NULL
},
FALSE
},
{{
0
,
0
,
0
,
NULL
,
"WineTest"
,
NULL
},
FALSE
},
{{
0
,
0
,
0
,
HKEY_CURRENT_USER
,
"WineTest"
,
NULL
},
TRUE
}
};
static
void
test_CreateMRUListLazyA
(
void
)
{
HANDLE
hMRU
;
HKEY
hKey
;
MRUINFOA
listA
=
{
0
};
int
i
;
if
(
!
pCreateMRUListLazyA
||
!
pFreeMRUList
)
{
...
...
@@ -460,28 +485,20 @@ static void test_CreateMRUListLazyA(void)
return
;
}
/* wrong size */
listA
.
cbSize
=
sizeof
(
listA
)
+
1
;
hMRU
=
pCreateMRUListLazyA
(
&
listA
,
0
,
0
,
0
);
ok
(
hMRU
==
NULL
,
"Expected NULL handle, got %p
\n
"
,
hMRU
);
listA
.
cbSize
=
4
;
hMRU
=
pCreateMRUListLazyA
(
&
listA
,
0
,
0
,
0
);
ok
(
hMRU
==
NULL
,
"Expected NULL handle, got %p
\n
"
,
hMRU
);
/* NULL hKey */
listA
.
cbSize
=
sizeof
(
listA
);
listA
.
hKey
=
NULL
;
hMRU
=
pCreateMRUListLazyA
(
&
listA
,
0
,
0
,
0
);
ok
(
hMRU
==
NULL
,
"Expected NULL handle, got %p
\n
"
,
hMRU
);
/* NULL subkey */
ok
(
!
RegCreateKeyA
(
HKEY_CURRENT_USER
,
REG_TEST_KEYA
,
&
hKey
),
"Couldn't create test key
\"
%s
\"\n
"
,
REG_TEST_KEYA
);
listA
.
cbSize
=
sizeof
(
listA
);
listA
.
hKey
=
hKey
;
listA
.
lpszSubKey
=
NULL
;
hMRU
=
pCreateMRUListLazyA
(
&
listA
,
0
,
0
,
0
);
ok
(
hMRU
==
NULL
||
broken
(
hMRU
!=
NULL
),
/* Win9x */
"Expected NULL handle, got %p
\n
"
,
hMRU
);
if
(
hMRU
)
pFreeMRUList
(
hMRU
);
for
(
i
=
0
;
i
<
sizeof
(
create_lazyA
)
/
sizeof
(
create_lazya_t
);
i
++
)
{
const
create_lazya_t
*
ptr
=
&
create_lazyA
[
i
];
HANDLE
hMRU
;
hMRU
=
pCreateMRUListLazyA
((
MRUINFOA
*
)
&
ptr
->
mruA
,
0
,
0
,
0
);
if
(
ptr
->
ret
)
{
ok
(
hMRU
!=
NULL
,
"%d: got %p
\n
"
,
i
,
hMRU
);
pFreeMRUList
(
hMRU
);
}
else
ok
(
hMRU
==
NULL
,
"%d: got %p
\n
"
,
i
,
hMRU
);
}
}
static
void
test_EnumMRUList
(
void
)
...
...
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