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
80d28abd
Commit
80d28abd
authored
May 09, 2015
by
Nikolay Sivov
Committed by
Alexandre Julliard
May 11, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shell32: Partially implement SHGetKnownFolderIDList().
parent
4367f4b2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
77 additions
and
2 deletions
+77
-2
shellpath.c
dlls/shell32/shellpath.c
+42
-2
shellpath.c
dlls/shell32/tests/shellpath.c
+35
-0
No files found.
dlls/shell32/shellpath.c
View file @
80d28abd
...
...
@@ -5727,8 +5727,48 @@ HRESULT WINAPI KnownFolderManager_Constructor( IUnknown *punk, REFIID riid, void
HRESULT
WINAPI
SHGetKnownFolderIDList
(
REFKNOWNFOLDERID
rfid
,
DWORD
flags
,
HANDLE
token
,
PIDLIST_ABSOLUTE
*
pidl
)
{
FIXME
(
"%s, 0x%08x, %p, %p
\n
"
,
debugstr_guid
(
rfid
),
flags
,
token
,
pidl
);
return
E_NOTIMPL
;
TRACE
(
"%s, 0x%08x, %p, %p
\n
"
,
debugstr_guid
(
rfid
),
flags
,
token
,
pidl
);
if
(
!
pidl
)
return
E_INVALIDARG
;
if
(
flags
)
FIXME
(
"unsupported flags: 0x%08x
\n
"
,
flags
);
if
(
token
)
FIXME
(
"user token is not used.
\n
"
);
*
pidl
=
NULL
;
if
(
IsEqualIID
(
rfid
,
&
FOLDERID_Desktop
))
*
pidl
=
_ILCreateDesktop
();
else
if
(
IsEqualIID
(
rfid
,
&
FOLDERID_RecycleBinFolder
))
*
pidl
=
_ILCreateBitBucket
();
else
if
(
IsEqualIID
(
rfid
,
&
FOLDERID_ComputerFolder
))
*
pidl
=
_ILCreateMyComputer
();
else
if
(
IsEqualIID
(
rfid
,
&
FOLDERID_PrintersFolder
))
*
pidl
=
_ILCreatePrinters
();
else
if
(
IsEqualIID
(
rfid
,
&
FOLDERID_ControlPanelFolder
))
*
pidl
=
_ILCreateControlPanel
();
else
if
(
IsEqualIID
(
rfid
,
&
FOLDERID_NetworkFolder
))
*
pidl
=
_ILCreateNetwork
();
else
if
(
IsEqualIID
(
rfid
,
&
FOLDERID_Documents
))
*
pidl
=
_ILCreateMyDocuments
();
else
{
DWORD
attributes
=
0
;
WCHAR
*
pathW
;
HRESULT
hr
;
hr
=
SHGetKnownFolderPath
(
rfid
,
flags
,
token
,
&
pathW
);
if
(
FAILED
(
hr
))
return
hr
;
hr
=
SHILCreateFromPathW
(
pathW
,
pidl
,
&
attributes
);
CoTaskMemFree
(
pathW
);
return
hr
;
}
return
*
pidl
?
S_OK
:
E_FAIL
;
}
HRESULT
WINAPI
SHGetKnownFolderItem
(
REFKNOWNFOLDERID
rfid
,
KNOWN_FOLDER_FLAG
flags
,
HANDLE
hToken
,
...
...
dlls/shell32/tests/shellpath.c
View file @
80d28abd
...
...
@@ -102,6 +102,7 @@ static HRESULT (WINAPI *pSHGetKnownFolderPath)(REFKNOWNFOLDERID, DWORD, HANDLE,
static
HRESULT
(
WINAPI
*
pSHSetKnownFolderPath
)(
REFKNOWNFOLDERID
,
DWORD
,
HANDLE
,
PWSTR
);
static
HRESULT
(
WINAPI
*
pSHGetFolderPathEx
)(
REFKNOWNFOLDERID
,
DWORD
,
HANDLE
,
LPWSTR
,
DWORD
);
static
BOOL
(
WINAPI
*
pPathYetAnotherMakeUniqueName
)(
PWSTR
,
PCWSTR
,
PCWSTR
,
PCWSTR
);
static
HRESULT
(
WINAPI
*
pSHGetKnownFolderIDList
)(
REFKNOWNFOLDERID
,
DWORD
,
HANDLE
,
PIDLIST_ABSOLUTE
*
);
static
DLLVERSIONINFO
shellVersion
=
{
0
};
static
LPMALLOC
pMalloc
;
...
...
@@ -209,6 +210,7 @@ static void loadShell32(void)
GET_PROC
(
SHFileOperationA
)
GET_PROC
(
SHGetMalloc
)
GET_PROC
(
PathYetAnotherMakeUniqueName
)
GET_PROC
(
SHGetKnownFolderIDList
)
ok
(
pSHGetMalloc
!=
NULL
,
"shell32 is missing SHGetMalloc
\n
"
);
if
(
pSHGetMalloc
)
...
...
@@ -2728,6 +2730,38 @@ if (0)
ok
(
!
lstrcmpW
(
nameW
,
buffW
),
"got %s, expected %s
\n
"
,
wine_dbgstr_w
(
nameW
),
wine_dbgstr_w
(
buffW
));
}
static
void
test_SHGetKnownFolderIDList
(
void
)
{
PIDLIST_ABSOLUTE
pidl
;
HRESULT
hr
;
if
(
!
pSHGetKnownFolderIDList
)
{
win_skip
(
"SHGetKnownFolderIDList is not available.
\n
"
);
return
;
}
hr
=
pSHGetKnownFolderIDList
(
NULL
,
0
,
NULL
,
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"got 0x%08x
\n
"
,
hr
);
if
(
0
)
{
/* crashes on native */
pidl
=
(
void
*
)
0xdeadbeef
;
hr
=
pSHGetKnownFolderIDList
(
NULL
,
0
,
NULL
,
&
pidl
);
}
/* not a known folder */
pidl
=
(
void
*
)
0xdeadbeef
;
hr
=
pSHGetKnownFolderIDList
(
&
IID_IUnknown
,
0
,
NULL
,
&
pidl
);
ok
(
hr
==
HRESULT_FROM_WIN32
(
ERROR_FILE_NOT_FOUND
),
"got 0x%08x
\n
"
,
hr
);
ok
(
pidl
==
NULL
,
"got %p
\n
"
,
pidl
);
hr
=
pSHGetKnownFolderIDList
(
&
FOLDERID_Desktop
,
0
,
NULL
,
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"got 0x%08x
\n
"
,
hr
);
hr
=
pSHGetKnownFolderIDList
(
&
FOLDERID_Desktop
,
0
,
NULL
,
&
pidl
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
CoTaskMemFree
(
pidl
);
}
START_TEST
(
shellpath
)
{
if
(
!
init
())
return
;
...
...
@@ -2757,5 +2791,6 @@ START_TEST(shellpath)
test_knownFolders
();
test_DoEnvironmentSubst
();
test_PathYetAnotherMakeUniqueName
();
test_SHGetKnownFolderIDList
();
}
}
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