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
f471883a
Commit
f471883a
authored
Nov 10, 2010
by
Andrew Bogott
Committed by
Alexandre Julliard
Dec 02, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shdocvw: Test read/write of a couple of properties on IUniformResourceLocator.
parent
1a5607b4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
75 additions
and
0 deletions
+75
-0
intshcut.c
dlls/shdocvw/tests/intshcut.c
+58
-0
shlobj.h
include/shlobj.h
+17
-0
No files found.
dlls/shdocvw/tests/intshcut.c
View file @
f471883a
...
...
@@ -173,6 +173,63 @@ static BOOL check_ie(void)
return
TRUE
;
}
static
void
test_ReadAndWriteProperties
(
void
)
{
HRESULT
hr
;
IUniformResourceLocatorA
*
urlA
;
IPropertySetStorage
*
pPropSetStg
;
hr
=
CoCreateInstance
(
&
CLSID_InternetShortcut
,
NULL
,
CLSCTX_ALL
,
&
IID_IUniformResourceLocatorA
,
(
void
**
)
&
urlA
);
if
(
hr
==
S_OK
)
{
WCHAR
iconPath
[]
=
{
'f'
,
'i'
,
'l'
,
'e'
,
':'
,
'/'
,
'/'
,
'/'
,
'C'
,
':'
,
'/'
,
'a'
,
'r'
,
'b'
,
'i'
,
't'
,
'r'
,
'a'
,
'r'
,
'y'
,
'/'
,
'i'
,
'c'
,
'o'
,
'n'
,
'/'
,
'p'
,
'a'
,
't'
,
'h'
,
0
};
int
iconIndex
=
7
;
IPropertyStorage
*
pPropStgWrite
;
IPropertyStorage
*
pPropStgRead
;
PROPSPEC
ps
[
2
];
PROPVARIANT
pv
[
2
];
PROPVARIANT
pvread
[
2
];
ps
[
0
].
ulKind
=
PRSPEC_PROPID
;
ps
[
0
].
propid
=
PID_IS_ICONFILE
;
ps
[
1
].
ulKind
=
PRSPEC_PROPID
;
ps
[
1
].
propid
=
PID_IS_ICONINDEX
;
pv
[
0
].
vt
=
VT_LPWSTR
;
pv
[
0
].
pwszVal
=
(
void
*
)
iconPath
;
pv
[
1
].
vt
=
VT_I4
;
pv
[
1
].
iVal
=
iconIndex
;
hr
=
urlA
->
lpVtbl
->
QueryInterface
(
urlA
,
&
IID_IPropertySetStorage
,
(
void
**
)
&
pPropSetStg
);
ok
(
hr
==
S_OK
,
"Unable to get an IPropertySetStorage, hr=0x%x
\n
"
,
hr
);
hr
=
IPropertySetStorage_Open
(
pPropSetStg
,
&
FMTID_Intshcut
,
STGM_READWRITE
|
STGM_SHARE_EXCLUSIVE
,
&
pPropStgWrite
);
ok
(
hr
==
S_OK
,
"Unable to get an IPropertyStorage for writing, hr=0x%x
\n
"
,
hr
);
hr
=
IPropertyStorage_WriteMultiple
(
pPropStgWrite
,
2
,
ps
,
pv
,
0
);
ok
(
hr
==
S_OK
,
"Unable to set properties, hr=0x%x
\n
"
,
hr
);
hr
=
IPropertyStorage_Commit
(
pPropStgWrite
,
STGC_DEFAULT
);
ok
(
hr
==
S_OK
,
"Failed to commit properties, hr=0x%x
\n
"
,
hr
);
pPropStgWrite
->
lpVtbl
->
Release
(
pPropStgWrite
);
hr
=
IPropertySetStorage_Open
(
pPropSetStg
,
&
FMTID_Intshcut
,
STGM_READ
|
STGM_SHARE_EXCLUSIVE
,
&
pPropStgRead
);
ok
(
hr
==
S_OK
,
"Unable to get an IPropertyStorage for reading, hr=0x%x
\n
"
,
hr
);
hr
=
IPropertyStorage_ReadMultiple
(
pPropStgRead
,
2
,
ps
,
pvread
);
ok
(
hr
==
S_OK
,
"Unable to read properties, hr=0x%x
\n
"
,
hr
);
ok
(
pvread
[
1
].
iVal
==
iconIndex
,
"Read wrong icon index: %d
\n
"
,
pvread
[
1
].
iVal
);
ok
(
lstrcmpW
(
pvread
[
0
].
pwszVal
,
iconPath
)
==
0
,
"Wrong icon path read: %s
\n
"
,
wine_dbgstr_w
(
pvread
[
0
].
pwszVal
));
IPropertyStorage_Release
(
pPropStgRead
);
IPropertySetStorage_Release
(
pPropSetStg
);
urlA
->
lpVtbl
->
Release
(
urlA
);
}
else
skip
(
"could not create a CLSID_InternetShortcut for property tests, hr=0x%x
\n
"
,
hr
);
}
static
void
test_NullURLs
(
void
)
{
HRESULT
hr
;
...
...
@@ -231,6 +288,7 @@ static void test_InternetShortcut(void)
test_QueryInterface
();
test_NullURLs
();
test_SetURLFlags
();
test_ReadAndWriteProperties
();
}
}
...
...
include/shlobj.h
View file @
f471883a
...
...
@@ -1661,6 +1661,23 @@ BOOL WINAPI DAD_DragLeave(void);
BOOL
WINAPI
DAD_AutoScroll
(
HWND
,
AUTO_SCROLL_DATA
*
,
LPPOINT
);
HRESULT
WINAPI
SHDoDragDrop
(
HWND
,
IDataObject
*
,
IDropSource
*
,
DWORD
,
LPDWORD
);
/****************************************************************************
* Internet shortcut properties
*/
#define PID_IS_URL 2
#define PID_IS_NAME 4
#define PID_IS_WORKINGDIR 5
#define PID_IS_HOTKEY 6
#define PID_IS_SHOWCMD 7
#define PID_IS_ICONINDEX 8
#define PID_IS_ICONFILE 9
#define PID_IS_WHATSNEW 10
#define PID_IS_AUTHOR 11
#define PID_IS_DESCRIPTION 12
#define PID_IS_COMMENT 13
LPITEMIDLIST
WINAPI
ILAppendID
(
LPITEMIDLIST
,
LPCSHITEMID
,
BOOL
);
LPITEMIDLIST
WINAPI
ILClone
(
LPCITEMIDLIST
);
LPITEMIDLIST
WINAPI
ILCloneFirst
(
LPCITEMIDLIST
);
...
...
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