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
567b52cd
Commit
567b52cd
authored
Nov 22, 2016
by
Hans Leidekker
Committed by
Alexandre Julliard
Nov 22, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shell32: Implement IKnownFolderManager::GetFolderByName.
Signed-off-by:
Hans Leidekker
<
hans@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
f8450fae
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
62 additions
and
3 deletions
+62
-3
shellpath.c
dlls/shell32/shellpath.c
+43
-2
shellpath.c
dlls/shell32/tests/shellpath.c
+19
-1
No files found.
dlls/shell32/shellpath.c
View file @
567b52cd
...
...
@@ -5549,8 +5549,49 @@ static HRESULT WINAPI foldermanager_GetFolderByName(
LPCWSTR
pszCanonicalName
,
IKnownFolder
**
ppkf
)
{
FIXME
(
"%s, %p
\n
"
,
debugstr_w
(
pszCanonicalName
),
ppkf
);
return
E_NOTIMPL
;
struct
foldermanager
*
fm
=
impl_from_IKnownFolderManager
(
iface
);
struct
knownfolder
*
kf
;
BOOL
found
=
FALSE
;
HRESULT
hr
;
UINT
i
;
TRACE
(
"%s, %p
\n
"
,
debugstr_w
(
pszCanonicalName
),
ppkf
);
for
(
i
=
0
;
i
<
fm
->
num_ids
;
i
++
)
{
WCHAR
*
path
,
*
name
;
hr
=
get_known_folder_registry_path
(
&
fm
->
ids
[
i
],
NULL
,
&
path
);
if
(
FAILED
(
hr
))
return
hr
;
hr
=
get_known_folder_wstr
(
path
,
szName
,
&
name
);
HeapFree
(
GetProcessHeap
(),
0
,
path
);
if
(
FAILED
(
hr
))
return
hr
;
found
=
!
strcmpiW
(
pszCanonicalName
,
name
);
CoTaskMemFree
(
name
);
if
(
found
)
break
;
}
if
(
found
)
{
hr
=
knownfolder_create
(
&
kf
);
if
(
FAILED
(
hr
))
return
hr
;
hr
=
knownfolder_set_id
(
kf
,
&
fm
->
ids
[
i
]
);
if
(
FAILED
(
hr
))
{
IKnownFolder_Release
(
&
kf
->
IKnownFolder_iface
);
return
hr
;
}
*
ppkf
=
&
kf
->
IKnownFolder_iface
;
}
else
{
hr
=
HRESULT_FROM_WIN32
(
ERROR_FILE_NOT_FOUND
);
*
ppkf
=
NULL
;
}
return
hr
;
}
static
HRESULT
register_folder
(
const
KNOWNFOLDERID
*
rfid
,
const
KNOWNFOLDER_DEFINITION
*
pKFD
)
...
...
dlls/shell32/tests/shellpath.c
View file @
567b52cd
...
...
@@ -2033,9 +2033,11 @@ static void check_known_folder(IKnownFolderManager *mgr, KNOWNFOLDERID *folderId
static
void
test_knownFolders
(
void
)
{
static
const
WCHAR
sWindows
[]
=
{
'W'
,
'i'
,
'n'
,
'd'
,
'o'
,
'w'
,
's'
,
0
};
static
const
WCHAR
sWindows2
[]
=
{
'w'
,
'i'
,
'n'
,
'd'
,
'o'
,
'w'
,
's'
,
0
};
static
const
WCHAR
sExample
[]
=
{
'E'
,
'x'
,
'a'
,
'm'
,
'p'
,
'l'
,
'e'
,
0
};
static
const
WCHAR
sExample2
[]
=
{
'E'
,
'x'
,
'a'
,
'm'
,
'p'
,
'l'
,
'e'
,
'2'
,
0
};
static
const
WCHAR
sSubFolder
[]
=
{
'S'
,
'u'
,
'b'
,
'F'
,
'o'
,
'l'
,
'd'
,
'e'
,
'r'
,
0
};
static
const
WCHAR
sNoSuch
[]
=
{
'N'
,
'o'
,
'S'
,
'u'
,
'c'
,
'h'
,
0
};
static
const
WCHAR
sBackslash
[]
=
{
'\\'
,
0
};
static
const
KNOWNFOLDERID
newFolderId
=
{
0x01234567
,
0x89AB
,
0xCDEF
,
{
0xFE
,
0xDC
,
0xBA
,
0x98
,
0x76
,
0x54
,
0x32
,
0x01
}
};
static
const
KNOWNFOLDERID
subFolderId
=
{
0xFEDCBA98
,
0x7654
,
0x3210
,
{
0x01
,
0x23
,
0x45
,
0x67
,
0x89
,
0xAB
,
0xCD
,
0xEF
}
};
...
...
@@ -2137,7 +2139,6 @@ static void test_knownFolders(void)
}
hr
=
IKnownFolderManager_GetFolderByName
(
mgr
,
sWindows
,
&
folder
);
todo_wine
ok
(
hr
==
S_OK
,
"failed to get known folder: 0x%08x
\n
"
,
hr
);
if
(
SUCCEEDED
(
hr
))
{
...
...
@@ -2149,6 +2150,23 @@ static void test_knownFolders(void)
ok
(
hr
==
S_OK
,
"failed to release KnownFolder instance: 0x%08x
\n
"
,
hr
);
}
hr
=
IKnownFolderManager_GetFolderByName
(
mgr
,
sWindows2
,
&
folder
);
ok
(
hr
==
S_OK
,
"failed to get known folder: 0x%08x
\n
"
,
hr
);
if
(
SUCCEEDED
(
hr
))
{
hr
=
IKnownFolder_GetId
(
folder
,
&
folderId
);
ok
(
hr
==
S_OK
,
"failed to get folder id: 0x%08x
\n
"
,
hr
);
ok
(
IsEqualGUID
(
&
folderId
,
&
FOLDERID_Windows
)
==
TRUE
,
"invalid KNOWNFOLDERID returned
\n
"
);
hr
=
IKnownFolder_Release
(
folder
);
ok
(
hr
==
S_OK
,
"failed to release KnownFolder instance: 0x%08x
\n
"
,
hr
);
}
folder
=
(
IKnownFolder
*
)
0xdeadbeef
;
hr
=
IKnownFolderManager_GetFolderByName
(
mgr
,
sNoSuch
,
&
folder
);
ok
(
hr
==
HRESULT_FROM_WIN32
(
ERROR_FILE_NOT_FOUND
),
"got 0x%08x
\n
"
,
hr
);
ok
(
folder
==
NULL
,
"got %p
\n
"
,
folder
);
for
(
i
=
0
;
i
<
sizeof
(
known_folder_found
)
/
sizeof
(
known_folder_found
[
0
]);
++
i
)
known_folder_found
[
i
]
=
FALSE
;
...
...
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