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
d7533e28
Commit
d7533e28
authored
Nov 01, 2019
by
Hans Leidekker
Committed by
Alexandre Julliard
Nov 01, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shell32: Improve the stub for SHGetPropertyStoreForWindow.
Signed-off-by:
Hans Leidekker
<
hans@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
b21e50c0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
143 additions
and
1 deletion
+143
-1
shell32_main.c
dlls/shell32/shell32_main.c
+111
-1
appbar.c
dlls/shell32/tests/appbar.c
+32
-0
No files found.
dlls/shell32/shell32_main.c
View file @
d7533e28
...
@@ -691,13 +691,123 @@ VOID WINAPI Printers_UnregisterWindow(HANDLE hClassPidl, HWND hwnd)
...
@@ -691,13 +691,123 @@ VOID WINAPI Printers_UnregisterWindow(HANDLE hClassPidl, HWND hwnd)
FIXME
(
"(%p, %p) stub!
\n
"
,
hClassPidl
,
hwnd
);
FIXME
(
"(%p, %p) stub!
\n
"
,
hClassPidl
,
hwnd
);
}
}
struct
window_prop_store
{
IPropertyStore
IPropertyStore_iface
;
LONG
ref
;
};
static
inline
struct
window_prop_store
*
impl_from_IPropertyStore
(
IPropertyStore
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
struct
window_prop_store
,
IPropertyStore_iface
);
}
static
ULONG
WINAPI
window_prop_store_AddRef
(
IPropertyStore
*
iface
)
{
struct
window_prop_store
*
store
=
impl_from_IPropertyStore
(
iface
);
LONG
ref
=
InterlockedIncrement
(
&
store
->
ref
);
TRACE
(
"returning %d
\n
"
,
ref
);
return
ref
;
}
static
ULONG
WINAPI
window_prop_store_Release
(
IPropertyStore
*
iface
)
{
struct
window_prop_store
*
store
=
impl_from_IPropertyStore
(
iface
);
LONG
ref
=
InterlockedDecrement
(
&
store
->
ref
);
if
(
!
ref
)
heap_free
(
store
);
TRACE
(
"returning %d
\n
"
,
ref
);
return
ref
;
}
static
HRESULT
WINAPI
window_prop_store_QueryInterface
(
IPropertyStore
*
iface
,
REFIID
iid
,
void
**
obj
)
{
struct
window_prop_store
*
store
=
impl_from_IPropertyStore
(
iface
);
TRACE
(
"%p, %s, %p
\n
"
,
iface
,
debugstr_guid
(
iid
),
obj
);
if
(
!
obj
)
return
E_POINTER
;
if
(
IsEqualIID
(
iid
,
&
IID_IUnknown
)
||
IsEqualIID
(
iid
,
&
IID_IPropertyStore
))
{
*
obj
=
&
store
->
IPropertyStore_iface
;
}
else
{
FIXME
(
"no interface for %s
\n
"
,
debugstr_guid
(
iid
));
*
obj
=
NULL
;
return
E_NOINTERFACE
;
}
IUnknown_AddRef
((
IUnknown
*
)
*
obj
);
return
S_OK
;
}
static
HRESULT
WINAPI
window_prop_store_GetCount
(
IPropertyStore
*
iface
,
DWORD
*
count
)
{
FIXME
(
"%p, %p
\n
"
,
iface
,
count
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
window_prop_store_GetAt
(
IPropertyStore
*
iface
,
DWORD
prop
,
PROPERTYKEY
*
key
)
{
FIXME
(
"%p, %u,%p
\n
"
,
iface
,
prop
,
key
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
window_prop_store_GetValue
(
IPropertyStore
*
iface
,
const
PROPERTYKEY
*
key
,
PROPVARIANT
*
var
)
{
FIXME
(
"%p, {%s,%u}, %p
\n
"
,
iface
,
debugstr_guid
(
&
key
->
fmtid
),
key
->
pid
,
var
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
window_prop_store_SetValue
(
IPropertyStore
*
iface
,
const
PROPERTYKEY
*
key
,
const
PROPVARIANT
*
var
)
{
FIXME
(
"%p, {%s,%u}, %p
\n
"
,
iface
,
debugstr_guid
(
&
key
->
fmtid
),
key
->
pid
,
var
);
return
S_OK
;
}
static
HRESULT
WINAPI
window_prop_store_Commit
(
IPropertyStore
*
iface
)
{
FIXME
(
"%p
\n
"
,
iface
);
return
S_OK
;
}
static
const
IPropertyStoreVtbl
window_prop_store_vtbl
=
{
window_prop_store_QueryInterface
,
window_prop_store_AddRef
,
window_prop_store_Release
,
window_prop_store_GetCount
,
window_prop_store_GetAt
,
window_prop_store_GetValue
,
window_prop_store_SetValue
,
window_prop_store_Commit
};
static
HRESULT
create_window_prop_store
(
IPropertyStore
**
obj
)
{
struct
window_prop_store
*
store
;
if
(
!
(
store
=
heap_alloc
(
sizeof
(
*
store
))))
return
E_OUTOFMEMORY
;
store
->
IPropertyStore_iface
.
lpVtbl
=
&
window_prop_store_vtbl
;
store
->
ref
=
1
;
*
obj
=
&
store
->
IPropertyStore_iface
;
return
S_OK
;
}
/*************************************************************************
/*************************************************************************
* SHGetPropertyStoreForWindow [SHELL32.@]
* SHGetPropertyStoreForWindow [SHELL32.@]
*/
*/
HRESULT
WINAPI
SHGetPropertyStoreForWindow
(
HWND
hwnd
,
REFIID
riid
,
void
**
ppv
)
HRESULT
WINAPI
SHGetPropertyStoreForWindow
(
HWND
hwnd
,
REFIID
riid
,
void
**
ppv
)
{
{
IPropertyStore
*
store
;
HRESULT
hr
;
FIXME
(
"(%p %p %p) stub!
\n
"
,
hwnd
,
riid
,
ppv
);
FIXME
(
"(%p %p %p) stub!
\n
"
,
hwnd
,
riid
,
ppv
);
return
E_NOTIMPL
;
if
((
hr
=
create_window_prop_store
(
&
store
))
!=
S_OK
)
return
hr
;
hr
=
IPropertyStore_QueryInterface
(
store
,
riid
,
ppv
);
IPropertyStore_Release
(
store
);
return
hr
;
}
}
/*************************************************************************/
/*************************************************************************/
...
...
dlls/shell32/tests/appbar.c
View file @
d7533e28
...
@@ -21,6 +21,8 @@
...
@@ -21,6 +21,8 @@
#include <windows.h>
#include <windows.h>
#include "shellapi.h"
#include "shellapi.h"
#define COBJMACROS
#include "propsys.h"
#include "wine/test.h"
#include "wine/test.h"
...
@@ -30,6 +32,7 @@ static const CHAR testwindow_class[] = "testwindow";
...
@@ -30,6 +32,7 @@ static const CHAR testwindow_class[] = "testwindow";
static
HMONITOR
(
WINAPI
*
pMonitorFromWindow
)(
HWND
,
DWORD
);
static
HMONITOR
(
WINAPI
*
pMonitorFromWindow
)(
HWND
,
DWORD
);
static
HRESULT
(
WINAPI
*
pGetCurrentProcessExplicitAppUserModelID
)(
PWSTR
*
);
static
HRESULT
(
WINAPI
*
pGetCurrentProcessExplicitAppUserModelID
)(
PWSTR
*
);
static
HRESULT
(
WINAPI
*
pSHGetPropertyStoreForWindow
)(
HWND
,
REFIID
,
void
**
);
typedef
BOOL
(
*
boolean_function
)(
void
);
typedef
BOOL
(
*
boolean_function
)(
void
);
...
@@ -433,6 +436,33 @@ todo_wine
...
@@ -433,6 +436,33 @@ todo_wine
ok
(
appid
==
NULL
,
"got %p
\n
"
,
appid
);
ok
(
appid
==
NULL
,
"got %p
\n
"
,
appid
);
}
}
static
void
test_SHGetPropertyStoreForWindow
(
void
)
{
HRESULT
hr
;
IUnknown
*
unk
;
IPropertyStore
*
store
=
NULL
;
if
(
!
pSHGetPropertyStoreForWindow
)
{
win_skip
(
"SHGetPropertyStoreForWindow() is not supported.
\n
"
);
return
;
}
unk
=
(
IUnknown
*
)
0xdeadbeef
;
hr
=
pSHGetPropertyStoreForWindow
(
GetDesktopWindow
(),
&
IID_IDispatch
,
(
void
**
)
&
unk
);
ok
(
hr
==
E_NOINTERFACE
,
"got 0x%08x
\n
"
,
hr
);
ok
(
unk
==
NULL
,
"got %p
\n
"
,
unk
);
hr
=
pSHGetPropertyStoreForWindow
(
GetDesktopWindow
(),
&
IID_IUnknown
,
(
void
**
)
&
unk
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
hr
=
IUnknown_QueryInterface
(
unk
,
&
IID_IPropertyStore
,
(
void
**
)
&
store
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
if
(
store
)
IPropertyStore_Release
(
store
);
if
(
unk
)
IUnknown_Release
(
unk
);
}
START_TEST
(
appbar
)
START_TEST
(
appbar
)
{
{
HMODULE
huser32
,
hshell32
;
HMODULE
huser32
,
hshell32
;
...
@@ -441,10 +471,12 @@ START_TEST(appbar)
...
@@ -441,10 +471,12 @@ START_TEST(appbar)
hshell32
=
GetModuleHandleA
(
"shell32.dll"
);
hshell32
=
GetModuleHandleA
(
"shell32.dll"
);
pMonitorFromWindow
=
(
void
*
)
GetProcAddress
(
huser32
,
"MonitorFromWindow"
);
pMonitorFromWindow
=
(
void
*
)
GetProcAddress
(
huser32
,
"MonitorFromWindow"
);
pGetCurrentProcessExplicitAppUserModelID
=
(
void
*
)
GetProcAddress
(
hshell32
,
"GetCurrentProcessExplicitAppUserModelID"
);
pGetCurrentProcessExplicitAppUserModelID
=
(
void
*
)
GetProcAddress
(
hshell32
,
"GetCurrentProcessExplicitAppUserModelID"
);
pSHGetPropertyStoreForWindow
=
(
void
*
)
GetProcAddress
(
hshell32
,
"SHGetPropertyStoreForWindow"
);
register_testwindow_class
();
register_testwindow_class
();
test_setpos
();
test_setpos
();
test_appbarget
();
test_appbarget
();
test_GetCurrentProcessExplicitAppUserModelID
();
test_GetCurrentProcessExplicitAppUserModelID
();
test_SHGetPropertyStoreForWindow
();
}
}
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