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
1f42005b
Commit
1f42005b
authored
Apr 26, 2018
by
Louis Lenders
Committed by
Alexandre Julliard
Apr 27, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shell32/tests: Add a test for SHGetSetFolderCustomSettings.
Signed-off-by:
Louis Lenders
<
xerox.xerox2000x@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
a9105269
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
57 additions
and
0 deletions
+57
-0
shlfolder.c
dlls/shell32/tests/shlfolder.c
+55
-0
shlobj.h
include/shlobj.h
+2
-0
No files found.
dlls/shell32/tests/shlfolder.c
View file @
1f42005b
...
...
@@ -65,6 +65,7 @@ static HRESULT (WINAPI *pSHGetItemFromObject)(IUnknown*,REFIID,void**);
static
BOOL
(
WINAPI
*
pIsWow64Process
)(
HANDLE
,
PBOOL
);
static
HRESULT
(
WINAPI
*
pSHCreateDefaultContextMenu
)(
const
DEFCONTEXTMENU
*
,
REFIID
,
void
**
);
static
BOOL
(
WINAPI
*
pSHGetPathFromIDListEx
)(
PCIDLIST_ABSOLUTE
,
WCHAR
*
,
DWORD
,
GPFIDL_FLAGS
);
static
HRESULT
(
WINAPI
*
pSHGetSetFolderCustomSettings
)(
LPSHFOLDERCUSTOMSETTINGS
,
PCWSTR
,
DWORD
);
static
WCHAR
*
make_wstr
(
const
char
*
str
)
{
...
...
@@ -118,6 +119,7 @@ static void init_function_pointers(void)
MAKEFUNC
(
SHGetItemFromObject
);
MAKEFUNC
(
SHCreateDefaultContextMenu
);
MAKEFUNC
(
SHGetPathFromIDListEx
);
MAKEFUNC
(
SHGetSetFolderCustomSettings
);
#undef MAKEFUNC
/* test named exports */
...
...
@@ -5246,6 +5248,58 @@ todo_wine
IShellFolder_Release
(
desktop
);
}
static
void
test_SHGetSetFolderCustomSettings
(
void
)
{
HRESULT
hr
;
SHFOLDERCUSTOMSETTINGS
fcs
;
WCHAR
pathW
[
MAX_PATH
];
WCHAR
bufferW
[
MAX_PATH
];
WCHAR
iconpathW
[
MAX_PATH
];
static
const
WCHAR
somedirW
[]
=
{
's'
,
'o'
,
'm'
,
'e'
,
'_'
,
'd'
,
'i'
,
'r'
,
0
};
static
const
WCHAR
iconW
[]
=
{
'\\'
,
's'
,
'o'
,
'm'
,
'e'
,
'_'
,
'i'
,
'c'
,
'o'
,
'n'
,
'.'
,
'i'
,
'c'
,
'o'
,
0
};
static
const
WCHAR
desktop_iniW
[]
=
{
'\\'
,
'D'
,
'e'
,
's'
,
'k'
,
't'
,
'o'
,
'p'
,
'.'
,
'i'
,
'n'
,
'i'
,
0
};
if
(
!
pSHGetSetFolderCustomSettings
)
{
win_skip
(
"SHGetSetFolderCustomSetting not exported by name (only by ordinal) for version XP/win2003
\n
"
);
return
;
}
GetTempPathW
(
MAX_PATH
,
pathW
);
lstrcatW
(
pathW
,
somedirW
);
CreateDirectoryW
(
pathW
,
NULL
);
lstrcpyW
(
iconpathW
,
pathW
);
lstrcatW
(
iconpathW
,
iconW
);
memset
(
&
fcs
,
0
,
sizeof
(
fcs
));
fcs
.
dwSize
=
sizeof
(
fcs
);
fcs
.
dwMask
=
FCSM_ICONFILE
;
fcs
.
pszIconFile
=
iconpathW
;
hr
=
pSHGetSetFolderCustomSettings
(
&
fcs
,
pathW
,
FCS_FORCEWRITE
);
/*creates and writes to a Desktop.ini*/
todo_wine
ok
(
hr
==
S_OK
,
"Expected S_OK, got %#x
\n
"
,
hr
);
memset
(
&
fcs
,
0
,
sizeof
(
fcs
));
fcs
.
dwSize
=
sizeof
(
fcs
);
fcs
.
dwMask
=
FCSM_ICONFILE
;
fcs
.
cchIconFile
=
MAX_PATH
;
fcs
.
pszIconFile
=
bufferW
;
bufferW
[
0
]
=
0
;
hr
=
pSHGetSetFolderCustomSettings
(
&
fcs
,
pathW
,
FCS_READ
);
todo_wine
ok
(
hr
==
S_OK
,
"Expected S_OK, got %#x
\n
"
,
hr
);
todo_wine
ok
(
!
lstrcmpiW
(
iconpathW
,
fcs
.
pszIconFile
),
"Expected %s, got %s
\n
"
,
wine_dbgstr_w
(
iconpathW
),
wine_dbgstr_w
(
fcs
.
pszIconFile
));
hr
=
pSHGetSetFolderCustomSettings
(
&
fcs
,
NULL
,
FCS_READ
);
todo_wine
ok
(
hr
==
E_FAIL
,
"Expected E_FAIL, got %#x
\n
"
,
hr
);
lstrcpyW
(
bufferW
,
pathW
);
lstrcatW
(
bufferW
,
desktop_iniW
);
DeleteFileW
(
bufferW
);
RemoveDirectoryW
(
pathW
);
}
START_TEST
(
shlfolder
)
{
init_function_pointers
();
...
...
@@ -5288,6 +5342,7 @@ START_TEST(shlfolder)
test_GetDefaultColumn
();
test_GetDefaultSearchGUID
();
test_SHLimitInputEdit
();
test_SHGetSetFolderCustomSettings
();
OleUninitialize
();
}
include/shlobj.h
View file @
1f42005b
...
...
@@ -1490,6 +1490,7 @@ int WINAPI SHCreateDirectoryExW(HWND, LPCWSTR, LPSECURITY_ATTRIBUTES);
#define FCSM_LOGO 0x00000020
#define FCSM_FLAGS 0x00000040
#include <pshpack8.h>
typedef
struct
{
DWORD
dwSize
;
DWORD
dwMask
;
...
...
@@ -1507,6 +1508,7 @@ typedef struct {
LPWSTR
pszLogo
;
DWORD
cchLogo
;
}
SHFOLDERCUSTOMSETTINGS
,
*
LPSHFOLDERCUSTOMSETTINGS
;
#include <poppack.h>
HRESULT
WINAPI
SHGetSetFolderCustomSettings
(
LPSHFOLDERCUSTOMSETTINGS
pfcs
,
PCWSTR
pszPath
,
DWORD
dwReadWrite
);
...
...
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