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
23d54615
Commit
23d54615
authored
May 03, 2015
by
Nikolay Sivov
Committed by
Alexandre Julliard
May 04, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shell32: Better handle creation/destruction of shellview window.
parent
eeabe96a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
171 additions
and
14 deletions
+171
-14
shlview.c
dlls/shell32/shlview.c
+18
-11
shlview.c
dlls/shell32/tests/shlview.c
+153
-3
No files found.
dlls/shell32/shlview.c
View file @
23d54615
...
...
@@ -1923,22 +1923,29 @@ static HRESULT WINAPI IShellView_fnCreateViewWindow(IShellView3 *iface, IShellVi
static
HRESULT
WINAPI
IShellView_fnDestroyViewWindow
(
IShellView3
*
iface
)
{
IShellViewImpl
*
This
=
impl_from_IShellView3
(
iface
);
IShellViewImpl
*
This
=
impl_from_IShellView3
(
iface
);
TRACE
(
"(%p)
\n
"
,
This
);
TRACE
(
"(%p)
\n
"
,
This
);
/*Make absolutely sure all our UI is cleaned up.*/
IShellView3_UIActivate
(
iface
,
SVUIA_DEACTIVATE
)
;
if
(
!
This
->
hWnd
)
return
S_OK
;
if
(
This
->
hMenu
)
DestroyMenu
(
This
->
hMenu
);
/* Make absolutely sure all our UI is cleaned up. */
IShellView3_UIActivate
(
iface
,
SVUIA_DEACTIVATE
);
DestroyWindow
(
This
->
hWnd
);
if
(
This
->
pShellBrowser
)
IShellBrowser_Release
(
This
->
pShellBrowser
);
if
(
This
->
pCommDlgBrowser
)
ICommDlgBrowser_Release
(
This
->
pCommDlgBrowser
);
if
(
This
->
hMenu
)
DestroyMenu
(
This
->
hMenu
);
DestroyWindow
(
This
->
hWnd
);
if
(
This
->
pShellBrowser
)
IShellBrowser_Release
(
This
->
pShellBrowser
);
if
(
This
->
pCommDlgBrowser
)
ICommDlgBrowser_Release
(
This
->
pCommDlgBrowser
);
return
S_OK
;
This
->
hMenu
=
NULL
;
This
->
hWnd
=
NULL
;
This
->
pShellBrowser
=
NULL
;
This
->
pCommDlgBrowser
=
NULL
;
return
S_OK
;
}
static
HRESULT
WINAPI
IShellView_fnGetCurrentInfo
(
IShellView3
*
iface
,
LPFOLDERSETTINGS
lpfs
)
...
...
@@ -2068,7 +2075,7 @@ static HRESULT WINAPI IShellView3_fnCreateViewWindow3(IShellView3 *iface, IShell
*
hwnd
=
NULL
;
if
(
!
owner
)
if
(
!
owner
||
This
->
hWnd
)
return
E_UNEXPECTED
;
if
(
view_flags
!=
SV3CVW3_DEFAULT
)
...
...
dlls/shell32/tests/shlview.c
View file @
23d54615
...
...
@@ -485,13 +485,153 @@ static const struct message folderview_getfocused_seq[] = {
{
0
}
};
static
void
test_IShellView_CreateViewWindow
(
void
)
static
HRESULT
WINAPI
shellbrowser_QueryInterface
(
IShellBrowser
*
iface
,
REFIID
riid
,
void
**
ppv
)
{
*
ppv
=
NULL
;
if
(
IsEqualGUID
(
&
IID_IShellBrowser
,
riid
)
||
IsEqualGUID
(
&
IID_IOleWindow
,
riid
)
||
IsEqualGUID
(
&
IID_IUnknown
,
riid
))
{
*
ppv
=
iface
;
}
if
(
*
ppv
)
{
IUnknown_AddRef
((
IUnknown
*
)
*
ppv
);
return
S_OK
;
}
return
E_NOINTERFACE
;
}
static
ULONG
WINAPI
shellbrowser_AddRef
(
IShellBrowser
*
iface
)
{
return
2
;
}
static
ULONG
WINAPI
shellbrowser_Release
(
IShellBrowser
*
iface
)
{
return
1
;
}
static
HRESULT
WINAPI
shellbrowser_GetWindow
(
IShellBrowser
*
iface
,
HWND
*
phwnd
)
{
*
phwnd
=
GetDesktopWindow
();
return
S_OK
;
}
static
HRESULT
WINAPI
shellbrowser_ContextSensitiveHelp
(
IShellBrowser
*
iface
,
BOOL
mode
)
{
ok
(
0
,
"unexpected
\n
"
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
shellbrowser_InsertMenusSB
(
IShellBrowser
*
iface
,
HMENU
hmenuShared
,
OLEMENUGROUPWIDTHS
*
menuwidths
)
{
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
shellbrowser_SetMenuSB
(
IShellBrowser
*
iface
,
HMENU
hmenuShared
,
HOLEMENU
holemenuReserved
,
HWND
hwndActiveObject
)
{
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
shellbrowser_RemoveMenusSB
(
IShellBrowser
*
iface
,
HMENU
hmenuShared
)
{
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
shellbrowser_SetStatusTextSB
(
IShellBrowser
*
iface
,
LPCOLESTR
text
)
{
ok
(
0
,
"unexpected
\n
"
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
shellbrowser_EnableModelessSB
(
IShellBrowser
*
iface
,
BOOL
enable
)
{
ok
(
0
,
"unexpected
\n
"
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
shellbrowser_TranslateAcceleratorSB
(
IShellBrowser
*
iface
,
MSG
*
pmsg
,
WORD
wID
)
{
ok
(
0
,
"unexpected
\n
"
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
shellbrowser_BrowseObject
(
IShellBrowser
*
iface
,
LPCITEMIDLIST
pidl
,
UINT
flags
)
{
ok
(
0
,
"unexpected
\n
"
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
shellbrowser_GetViewStateStream
(
IShellBrowser
*
iface
,
DWORD
mode
,
IStream
**
stream
)
{
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
shellbrowser_GetControlWindow
(
IShellBrowser
*
iface
,
UINT
id
,
HWND
*
phwnd
)
{
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
shellbrowser_SendControlMsg
(
IShellBrowser
*
iface
,
UINT
id
,
UINT
uMsg
,
WPARAM
wParam
,
LPARAM
lParam
,
LRESULT
*
pret
)
{
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
shellbrowser_QueryActiveShellView
(
IShellBrowser
*
iface
,
IShellView
**
view
)
{
ok
(
0
,
"unexpected
\n
"
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
shellbrowser_OnViewWindowActive
(
IShellBrowser
*
iface
,
IShellView
*
view
)
{
ok
(
0
,
"unexpected
\n
"
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
shellbrowser_SetToolbarItems
(
IShellBrowser
*
iface
,
LPTBBUTTONSB
buttons
,
UINT
count
,
UINT
flags
)
{
return
E_NOTIMPL
;
}
static
const
IShellBrowserVtbl
shellbrowservtbl
=
{
shellbrowser_QueryInterface
,
shellbrowser_AddRef
,
shellbrowser_Release
,
shellbrowser_GetWindow
,
shellbrowser_ContextSensitiveHelp
,
shellbrowser_InsertMenusSB
,
shellbrowser_SetMenuSB
,
shellbrowser_RemoveMenusSB
,
shellbrowser_SetStatusTextSB
,
shellbrowser_EnableModelessSB
,
shellbrowser_TranslateAcceleratorSB
,
shellbrowser_BrowseObject
,
shellbrowser_GetViewStateStream
,
shellbrowser_GetControlWindow
,
shellbrowser_SendControlMsg
,
shellbrowser_QueryActiveShellView
,
shellbrowser_OnViewWindowActive
,
shellbrowser_SetToolbarItems
};
static
IShellBrowser
test_shellbrowser
=
{
&
shellbrowservtbl
};
static
void
test_CreateViewWindow
(
void
)
{
IShellFolder
*
desktop
;
HWND
hwnd_view
,
hwnd2
;
FOLDERSETTINGS
settings
;
IShellView
*
view
;
IDropTarget
*
dt
;
HWND
hwnd_view
;
HRESULT
hr
;
RECT
r
=
{
0
};
...
...
@@ -519,6 +659,16 @@ if (0)
ok
(
hr
==
E_UNEXPECTED
,
"got (0x%08x)
\n
"
,
hr
);
ok
(
hwnd_view
==
0
,
"got %p
\n
"
,
hwnd_view
);
hwnd_view
=
NULL
;
hr
=
IShellView_CreateViewWindow
(
view
,
NULL
,
&
settings
,
&
test_shellbrowser
,
&
r
,
&
hwnd_view
);
ok
(
hr
==
S_OK
,
"got (0x%08x)
\n
"
,
hr
);
ok
(
hwnd_view
!=
0
,
"got %p
\n
"
,
hwnd_view
);
hwnd2
=
(
HWND
)
0xdeadbeef
;
hr
=
IShellView_CreateViewWindow
(
view
,
NULL
,
&
settings
,
&
test_shellbrowser
,
&
r
,
&
hwnd2
);
ok
(
hr
==
E_UNEXPECTED
,
"got (0x%08x)
\n
"
,
hr
);
ok
(
hwnd2
==
NULL
,
"got %p
\n
"
,
hwnd_view
);
/* ::DragLeave without drag operation */
hr
=
IShellView_QueryInterface
(
view
,
&
IID_IDropTarget
,
(
void
**
)
&
dt
);
ok
(
hr
==
S_OK
,
"got (0x%08x)
\n
"
,
hr
);
...
...
@@ -1158,7 +1308,7 @@ START_TEST(shlview)
init_msg_sequences
(
sequences
,
NUM_MSG_SEQUENCES
);
test_
IShellView_
CreateViewWindow
();
test_CreateViewWindow
();
test_IFolderView
();
test_GetItemObject
();
test_IShellFolderView
();
...
...
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