Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
da40f95e
Commit
da40f95e
authored
Aug 19, 2010
by
Jerome Leclanche
Committed by
Alexandre Julliard
Aug 20, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Properly set ERROR_NOACCESS when GetObject receives invalid arguments.
parent
7d7586d3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
2 deletions
+20
-2
gdiobj.c
dlls/gdi32/gdiobj.c
+12
-2
gdiobj.c
dlls/gdi32/tests/gdiobj.c
+8
-0
No files found.
dlls/gdi32/gdiobj.c
View file @
da40f95e
...
...
@@ -973,7 +973,12 @@ INT WINAPI GetObjectA( HGDIOBJ handle, INT count, LPVOID buffer )
GDI_ReleaseObj
(
handle
);
if
(
funcs
&&
funcs
->
pGetObjectA
)
result
=
funcs
->
pGetObjectA
(
handle
,
count
,
buffer
);
{
if
(
buffer
&&
((
ULONG_PTR
)
buffer
>>
16
)
==
0
)
/* catch apps getting argument order wrong */
SetLastError
(
ERROR_NOACCESS
);
else
result
=
funcs
->
pGetObjectA
(
handle
,
count
,
buffer
);
}
else
SetLastError
(
ERROR_INVALID_HANDLE
);
...
...
@@ -995,7 +1000,12 @@ INT WINAPI GetObjectW( HGDIOBJ handle, INT count, LPVOID buffer )
GDI_ReleaseObj
(
handle
);
if
(
funcs
&&
funcs
->
pGetObjectW
)
result
=
funcs
->
pGetObjectW
(
handle
,
count
,
buffer
);
{
if
(
buffer
&&
((
ULONG_PTR
)
buffer
>>
16
)
==
0
)
/* catch apps getting argument order wrong */
SetLastError
(
ERROR_NOACCESS
);
else
result
=
funcs
->
pGetObjectW
(
handle
,
count
,
buffer
);
}
else
SetLastError
(
ERROR_INVALID_HANDLE
);
...
...
dlls/gdi32/tests/gdiobj.c
View file @
da40f95e
...
...
@@ -81,6 +81,14 @@ static void test_gdi_objects(void)
"GetObject(NULL obj), expected 0, NO_ERROR, got %d, %u
\n
"
,
i
,
GetLastError
());
/* GetObject expects ERROR_NOACCESS when passed an invalid buffer */
hp
=
SelectObject
(
hdc
,
GetStockObject
(
BLACK_PEN
));
SetLastError
(
0
);
i
=
GetObjectA
(
hp
,
(
INT_PTR
)
buff
,
(
LPVOID
)
sizeof
(
buff
));
ok
(
!
i
&&
GetLastError
()
==
ERROR_NOACCESS
,
"GetObject(invalid buff), expected 0, ERROR_NOACCESS, got %d, %u
\n
"
,
i
,
GetLastError
());
/* GetObjectType does SetLastError() on a null object */
SetLastError
(
0
);
i
=
GetObjectType
(
NULL
);
...
...
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