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
abf52403
Commit
abf52403
authored
Nov 29, 2007
by
Stefan Dösinger
Committed by
Alexandre Julliard
Nov 30, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Destroying the current cursor results in an error.
parent
94cd8c27
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
48 additions
and
1 deletion
+48
-1
cursoricon.c
dlls/user32/cursoricon.c
+1
-1
cursoricon.c
dlls/user32/tests/cursoricon.c
+47
-0
No files found.
dlls/user32/cursoricon.c
View file @
abf52403
...
...
@@ -1347,7 +1347,7 @@ WORD WINAPI DestroyIcon32( HGLOBAL16 handle, UINT16 flags )
if
(
get_user_thread_info
()
->
cursor
==
HICON_32
(
handle
)
)
{
WARN_
(
cursor
)(
"Destroying active cursor!
\n
"
);
SetCursor
(
0
)
;
return
FALSE
;
}
/* Try shared cursor/icon first */
...
...
dlls/user32/tests/cursoricon.c
View file @
abf52403
...
...
@@ -373,6 +373,52 @@ static void test_CreateIcon(void)
DeleteObject
(
hbmColor
);
}
static
void
test_DestroyCursor
(
void
)
{
static
const
BYTE
bmp_bits
[
4096
];
ICONINFO
cursorInfo
;
HCURSOR
cursor
,
cursor2
;
BOOL
ret
;
DWORD
error
;
UINT
display_bpp
;
HDC
hdc
;
hdc
=
GetDC
(
0
);
display_bpp
=
GetDeviceCaps
(
hdc
,
BITSPIXEL
);
ReleaseDC
(
0
,
hdc
);
cursorInfo
.
fIcon
=
FALSE
;
cursorInfo
.
xHotspot
=
0
;
cursorInfo
.
yHotspot
=
0
;
cursorInfo
.
hbmMask
=
CreateBitmap
(
32
,
32
,
1
,
1
,
bmp_bits
);
cursorInfo
.
hbmColor
=
CreateBitmap
(
32
,
32
,
1
,
display_bpp
,
bmp_bits
);
cursor
=
CreateIconIndirect
(
&
cursorInfo
);
ok
(
cursor
!=
NULL
,
"CreateIconIndirect returned %p
\n
"
,
cursor
);
if
(
!
cursor
)
{
return
;
}
SetCursor
(
cursor
);
SetLastError
(
0xdeadbeef
);
ret
=
DestroyCursor
(
cursor
);
ok
(
!
ret
,
"DestroyCursor on the active cursor succeeded
\n
"
);
error
=
GetLastError
();
ok
(
error
==
0xdeadbeef
,
"Last error: %u
\n
"
,
error
);
cursor2
=
GetCursor
();
ok
(
cursor2
==
cursor
,
"Active was set to %p when trying to destroy it
\n
"
,
cursor2
);
SetCursor
(
NULL
);
/* Trying to destroy the cursor properly fails now for some reason with ERROR_INVALID_CURSOR_HANDLE */
ret
=
DestroyCursor
(
cursor
);
/* ok(ret, "DestroyCursor failed, GetLastError=%d\n", GetLastError()); */
DeleteObject
(
cursorInfo
.
hbmMask
);
DeleteObject
(
cursorInfo
.
hbmColor
);
}
START_TEST
(
cursoricon
)
{
test_CopyImage_Bitmap
(
1
);
...
...
@@ -382,4 +428,5 @@ START_TEST(cursoricon)
test_CopyImage_Bitmap
(
24
);
test_CopyImage_Bitmap
(
32
);
test_CreateIcon
();
test_DestroyCursor
();
}
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