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
fae0f678
Commit
fae0f678
authored
Apr 28, 2015
by
Nikolay Sivov
Committed by
Alexandre Julliard
Apr 29, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shell32/tests: Some tests for IShellWindows.
parent
ef585842
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
97 additions
and
0 deletions
+97
-0
shelldispatch.c
dlls/shell32/tests/shelldispatch.c
+97
-0
No files found.
dlls/shell32/tests/shelldispatch.c
View file @
fae0f678
...
...
@@ -385,6 +385,102 @@ static void test_ShellFolderView(void)
IShellFolder_Release
(
desktop
);
}
static
void
test_ShellWindows
(
void
)
{
IShellWindows
*
shellwindows
;
LONG
cookie
,
cookie2
,
ret
;
IDispatch
*
disp
;
VARIANT
v
,
v2
;
HRESULT
hr
;
HWND
hwnd
;
hr
=
CoCreateInstance
(
&
CLSID_ShellWindows
,
NULL
,
CLSCTX_LOCAL_SERVER
,
&
IID_IShellWindows
,
(
void
**
)
&
shellwindows
);
todo_wine
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
if
(
hr
!=
S_OK
)
return
;
/* NULL out argument */
hr
=
IShellWindows_Register
(
shellwindows
,
NULL
,
0
,
SWC_EXPLORER
,
NULL
);
ok
(
hr
==
HRESULT_FROM_WIN32
(
RPC_X_NULL_REF_POINTER
),
"got 0x%08x
\n
"
,
hr
);
hr
=
IShellWindows_Register
(
shellwindows
,
NULL
,
0
,
SWC_EXPLORER
,
&
cookie
);
ok
(
hr
==
E_POINTER
,
"got 0x%08x
\n
"
,
hr
);
hr
=
IShellWindows_Register
(
shellwindows
,
(
IDispatch
*
)
shellwindows
,
0
,
SWC_EXPLORER
,
&
cookie
);
ok
(
hr
==
E_POINTER
,
"got 0x%08x
\n
"
,
hr
);
hr
=
IShellWindows_Register
(
shellwindows
,
(
IDispatch
*
)
shellwindows
,
0
,
SWC_EXPLORER
,
&
cookie
);
ok
(
hr
==
E_POINTER
,
"got 0x%08x
\n
"
,
hr
);
hwnd
=
CreateWindowExA
(
0
,
"button"
,
"test"
,
BS_CHECKBOX
|
WS_VISIBLE
|
WS_POPUP
,
0
,
0
,
50
,
14
,
0
,
0
,
0
,
NULL
);
ok
(
hwnd
!=
NULL
,
"got %p, error %d
\n
"
,
hwnd
,
GetLastError
());
cookie
=
0
;
hr
=
IShellWindows_Register
(
shellwindows
,
NULL
,
HandleToLong
(
hwnd
),
SWC_EXPLORER
,
&
cookie
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
cookie
!=
0
,
"got %d
\n
"
,
cookie
);
cookie2
=
0
;
hr
=
IShellWindows_Register
(
shellwindows
,
NULL
,
HandleToLong
(
hwnd
),
SWC_EXPLORER
,
&
cookie2
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
cookie2
!=
0
&&
cookie2
!=
cookie
,
"got %d
\n
"
,
cookie2
);
hr
=
IShellWindows_Revoke
(
shellwindows
,
cookie
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
hr
=
IShellWindows_Revoke
(
shellwindows
,
cookie2
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
hr
=
IShellWindows_Revoke
(
shellwindows
,
0
);
ok
(
hr
==
S_FALSE
,
"got 0x%08x
\n
"
,
hr
);
/* we can register ourselves as desktop, but FindWindowSW still returns real desktop window */
cookie
=
0
;
hr
=
IShellWindows_Register
(
shellwindows
,
NULL
,
HandleToLong
(
hwnd
),
SWC_DESKTOP
,
&
cookie
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
cookie
!=
0
,
"got %d
\n
"
,
cookie
);
disp
=
(
void
*
)
0xdeadbeef
;
ret
=
0xdead
;
VariantInit
(
&
v
);
hr
=
IShellWindows_FindWindowSW
(
shellwindows
,
&
v
,
&
v
,
SWC_DESKTOP
,
&
ret
,
SWFO_NEEDDISPATCH
,
&
disp
);
ok
(
hr
==
S_OK
||
broken
(
hr
==
S_FALSE
),
"got 0x%08x
\n
"
,
hr
);
if
(
hr
==
S_FALSE
)
/* winxp and earlier */
{
/* older versions allowed to regiser SWC_DESKTOP and access it with FindWindowSW */
ok
(
disp
==
NULL
,
"got %p
\n
"
,
disp
);
ok
(
ret
==
0
,
"got %d
\n
"
,
ret
);
}
else
{
ok
(
disp
!=
NULL
,
"got %p
\n
"
,
disp
);
ok
(
ret
!=
HandleToUlong
(
hwnd
),
"got %d
\n
"
,
ret
);
if
(
disp
)
IDispatch_Release
(
disp
);
}
disp
=
(
void
*
)
0xdeadbeef
;
ret
=
0xdead
;
VariantInit
(
&
v
);
hr
=
IShellWindows_FindWindowSW
(
shellwindows
,
&
v
,
&
v
,
SWC_DESKTOP
,
&
ret
,
0
,
&
disp
);
ok
(
hr
==
S_OK
||
broken
(
hr
==
S_FALSE
)
/* winxp */
,
"got 0x%08x
\n
"
,
hr
);
ok
(
disp
==
NULL
,
"got %p
\n
"
,
disp
);
ok
(
ret
!=
HandleToUlong
(
hwnd
),
"got %d
\n
"
,
ret
);
disp
=
(
void
*
)
0xdeadbeef
;
ret
=
0xdead
;
V_VT
(
&
v
)
=
VT_I4
;
V_I4
(
&
v
)
=
cookie
;
VariantInit
(
&
v2
);
hr
=
IShellWindows_FindWindowSW
(
shellwindows
,
&
v
,
&
v2
,
SWC_BROWSER
,
&
ret
,
SWFO_COOKIEPASSED
,
&
disp
);
ok
(
hr
==
S_FALSE
,
"got 0x%08x
\n
"
,
hr
);
ok
(
disp
==
NULL
,
"got %p
\n
"
,
disp
);
ok
(
ret
==
0
,
"got %d
\n
"
,
ret
);
hr
=
IShellWindows_Revoke
(
shellwindows
,
cookie
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
DestroyWindow
(
hwnd
);
IShellWindows_Release
(
shellwindows
);
}
START_TEST
(
shelldispatch
)
{
HRESULT
r
;
...
...
@@ -398,6 +494,7 @@ START_TEST(shelldispatch)
test_namespace
();
test_service
();
test_ShellFolderView
();
test_ShellWindows
();
CoUninitialize
();
}
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