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
4a068c64
Commit
4a068c64
authored
Dec 31, 2011
by
Nikolay Sivov
Committed by
Alexandre Julliard
Jan 03, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wshom.ocx: Implement IWshCollection::Item() for Desktop folder case.
parent
3149386b
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
74 additions
and
6 deletions
+74
-6
Makefile.in
dlls/wshom.ocx/Makefile.in
+1
-1
shell.c
dlls/wshom.ocx/shell.c
+42
-2
Makefile.in
dlls/wshom.ocx/tests/Makefile.in
+1
-1
wshom.c
dlls/wshom.ocx/tests/wshom.c
+30
-2
No files found.
dlls/wshom.ocx/Makefile.in
View file @
4a068c64
MODULE
=
wshom.ocx
IMPORTS
=
uuid oleaut32
IMPORTS
=
uuid oleaut32
ole32 shell32
C_SRCS
=
\
shell.c
\
...
...
dlls/wshom.ocx/shell.c
View file @
4a068c64
...
...
@@ -19,7 +19,10 @@
#include "wshom_private.h"
#include "wshom.h"
#include "shlobj.h"
#include "wine/debug.h"
#include "wine/unicode.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
wshom
);
...
...
@@ -167,8 +170,45 @@ static HRESULT WINAPI WshCollection_Invoke(IWshCollection *iface, DISPID dispIdM
static
HRESULT
WINAPI
WshCollection_Item
(
IWshCollection
*
iface
,
VARIANT
*
index
,
VARIANT
*
value
)
{
WshCollection
*
This
=
impl_from_IWshCollection
(
iface
);
FIXME
(
"(%p)->(%s %p): stub
\n
"
,
This
,
debugstr_variant
(
index
),
value
);
return
E_NOTIMPL
;
static
const
WCHAR
desktopW
[]
=
{
'D'
,
'e'
,
's'
,
'k'
,
't'
,
'o'
,
'p'
,
0
};
PIDLIST_ABSOLUTE
pidl
;
WCHAR
pathW
[
MAX_PATH
];
int
kind
=
0
;
BSTR
folder
;
HRESULT
hr
;
TRACE
(
"(%p)->(%s %p)
\n
"
,
This
,
debugstr_variant
(
index
),
value
);
if
(
V_VT
(
index
)
!=
VT_BSTR
)
{
FIXME
(
"only BSTR index supported, got %d
\n
"
,
V_VT
(
index
));
return
E_NOTIMPL
;
}
folder
=
V_BSTR
(
index
);
if
(
!
strcmpiW
(
folder
,
desktopW
))
kind
=
CSIDL_DESKTOP
;
else
{
FIXME
(
"folder kind %s not supported
\n
"
,
debugstr_w
(
folder
));
return
E_NOTIMPL
;
}
hr
=
SHGetSpecialFolderLocation
(
NULL
,
kind
,
&
pidl
);
if
(
hr
!=
S_OK
)
return
hr
;
if
(
SHGetPathFromIDListW
(
pidl
,
pathW
))
{
V_VT
(
value
)
=
VT_BSTR
;
V_BSTR
(
value
)
=
SysAllocString
(
pathW
);
hr
=
V_BSTR
(
value
)
?
S_OK
:
E_OUTOFMEMORY
;
}
else
hr
=
E_FAIL
;
CoTaskMemFree
(
pidl
);
return
hr
;
}
static
HRESULT
WINAPI
WshCollection_Count
(
IWshCollection
*
iface
,
LONG
*
count
)
...
...
dlls/wshom.ocx/tests/Makefile.in
View file @
4a068c64
TESTDLL
=
wshom.ocx
IMPORTS
=
ole32
IMPORTS
=
ole
aut32 ole
32
C_SRCS
=
\
wshom.c
...
...
dlls/wshom.ocx/tests/wshom.c
View file @
4a068c64
...
...
@@ -26,11 +26,14 @@
#include "wshom.h"
#include "wine/test.h"
DEFINE_GUID
(
GUID_NULL
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
);
#define EXPECT_HR(hr,hr_exp) \
ok(hr == hr_exp, "got 0x%08x, expected 0x%08x\n", hr, hr_exp)
static
void
test_wshshell
(
void
)
{
static
const
WCHAR
desktopW
[]
=
{
'D'
,
'e'
,
's'
,
'k'
,
't'
,
'o'
,
'p'
,
0
};
IWshShell3
*
sh3
;
IDispatchEx
*
dispex
;
IWshCollection
*
coll
;
...
...
@@ -40,6 +43,11 @@ static void test_wshshell(void)
ITypeInfo
*
ti
;
HRESULT
hr
;
TYPEATTR
*
tattr
;
DISPPARAMS
dp
;
EXCEPINFO
ei
;
VARIANT
arg
,
res
;
BSTR
str
;
UINT
err
;
hr
=
CoCreateInstance
(
&
CLSID_WshShell
,
NULL
,
CLSCTX_INPROC_SERVER
|
CLSCTX_INPROC_HANDLER
,
&
IID_IDispatch
,
(
void
**
)
&
disp
);
...
...
@@ -72,11 +80,31 @@ static void test_wshshell(void)
hr
=
ITypeInfo_GetTypeAttr
(
ti
,
&
tattr
);
EXPECT_HR
(
hr
,
S_OK
);
ok
(
IsEqualIID
(
&
tattr
->
guid
,
&
IID_IWshCollection
),
"got
\n
"
);
ok
(
IsEqualIID
(
&
tattr
->
guid
,
&
IID_IWshCollection
),
"got
wrong type guid
\n
"
);
ITypeInfo_ReleaseTypeAttr
(
ti
,
tattr
);
IWshShell3_Release
(
sh3
);
/* try to call Item() with normal IDispatch procedure */
str
=
SysAllocString
(
desktopW
);
V_VT
(
&
arg
)
=
VT_BSTR
;
V_BSTR
(
&
arg
)
=
str
;
dp
.
rgvarg
=
&
arg
;
dp
.
rgdispidNamedArgs
=
NULL
;
dp
.
cArgs
=
1
;
dp
.
cNamedArgs
=
0
;
hr
=
IDispatch_Invoke
(
disp
,
DISPID_VALUE
,
&
IID_NULL
,
1033
,
DISPATCH_PROPERTYGET
,
&
dp
,
&
res
,
&
ei
,
&
err
);
EXPECT_HR
(
hr
,
DISP_E_MEMBERNOTFOUND
);
/* try Item() directly, it returns directory path apparently */
V_VT
(
&
res
)
=
VT_EMPTY
;
hr
=
IWshCollection_Item
(
coll
,
&
arg
,
&
res
);
EXPECT_HR
(
hr
,
S_OK
);
SysFreeString
(
str
);
ok
(
V_VT
(
&
res
)
==
VT_BSTR
,
"got res type %d
\n
"
,
V_VT
(
&
res
));
VariantClear
(
&
res
);
IWshCollection_Release
(
coll
);
IDispatch_Release
(
disp
);
IWshShell3_Release
(
sh3
);
IUnknown_Release
(
shell
);
}
...
...
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