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
bb19a58a
Commit
bb19a58a
authored
Jun 14, 2005
by
Michael Jung
Committed by
Alexandre Julliard
Jun 14, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Return the correct attributes for the desktop folder.
Corresponding tests.
parent
f95ef09b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
52 additions
and
7 deletions
+52
-7
shfldr_desktop.c
dlls/shell32/shfldr_desktop.c
+9
-7
shlfolder.c
dlls/shell32/tests/shlfolder.c
+43
-0
No files found.
dlls/shell32/shfldr_desktop.c
View file @
bb19a58a
...
...
@@ -427,6 +427,9 @@ static HRESULT WINAPI ISF_Desktop_fnGetAttributesOf (IShellFolder2 * iface,
{
IGenericSFImpl
*
This
=
(
IGenericSFImpl
*
)
iface
;
HRESULT
hr
=
S_OK
;
const
static
DWORD
dwDesktopAttributes
=
SFGAO_STORAGE
|
SFGAO_HASPROPSHEET
|
SFGAO_STORAGE_ANCESTOR
|
SFGAO_FILESYSANCESTOR
|
SFGAO_FOLDER
|
SFGAO_FILESYSTEM
|
SFGAO_HASSUBFOLDER
;
TRACE
(
"(%p)->(cidl=%d apidl=%p mask=%p (0x%08lx))
\n
"
,
This
,
cidl
,
apidl
,
rgfInOut
,
rgfInOut
?
*
rgfInOut
:
0
);
...
...
@@ -440,16 +443,15 @@ static HRESULT WINAPI ISF_Desktop_fnGetAttributesOf (IShellFolder2 * iface,
*
rgfInOut
=
~
0
;
if
(
cidl
==
0
)
{
IShellFolder
*
psfParent
=
NULL
;
LPCITEMIDLIST
rpidl
=
NULL
;
hr
=
SHBindToParent
(
This
->
pidlRoot
,
&
IID_IShellFolder
,
(
LPVOID
*
)
&
psfParent
,
(
LPCITEMIDLIST
*
)
&
rpidl
);
if
(
SUCCEEDED
(
hr
))
SHELL32_GetItemAttributes
(
psfParent
,
rpidl
,
rgfInOut
);
*
rgfInOut
&=
dwDesktopAttributes
;
}
else
{
while
(
cidl
>
0
&&
*
apidl
)
{
pdump
(
*
apidl
);
SHELL32_GetItemAttributes
(
_IShellFolder_
(
This
),
*
apidl
,
rgfInOut
);
if
(
_ILIsDesktop
(
*
apidl
))
{
*
rgfInOut
&=
dwDesktopAttributes
;
}
else
{
SHELL32_GetItemAttributes
(
_IShellFolder_
(
This
),
*
apidl
,
rgfInOut
);
}
apidl
++
;
cidl
--
;
}
...
...
dlls/shell32/tests/shlfolder.c
View file @
bb19a58a
...
...
@@ -224,6 +224,7 @@ static void test_GetDisplayName(void)
WCHAR
wszTestFile
[
MAX_PATH
],
wszTestFile2
[
MAX_PATH
],
wszTestDir
[
MAX_PATH
];
STRRET
strret
;
LPSHELLFOLDER
psfDesktop
,
psfPersonal
;
IUnknown
*
psfFile
;
LPITEMIDLIST
pidlTestFile
;
LPCITEMIDLIST
pidlLast
;
static
const
WCHAR
wszFileName
[]
=
{
'w'
,
'i'
,
'n'
,
'e'
,
't'
,
'e'
,
's'
,
't'
,
'.'
,
'f'
,
'o'
,
'o'
,
0
};
...
...
@@ -269,6 +270,15 @@ static void test_GetDisplayName(void)
return
;
}
/* It seems as if we can not bind to regular files on windows, but only directories.
* XP sp2 returns 0x80070002, which is not defined in the PSDK
*/
hr
=
IShellFolder_BindToObject
(
psfDesktop
,
pidlTestFile
,
NULL
,
&
IID_IUnknown
,
(
VOID
**
)
&
psfFile
);
todo_wine
{
ok
(
hr
==
0x80070002
,
"hr = %08lx
\n
"
,
hr
);
}
if
(
SUCCEEDED
(
hr
))
{
IShellFolder_Release
(
psfFile
);
}
/* Deleting the file and the directory */
DeleteFileW
(
wszTestFile
);
RemoveDirectoryW
(
wszTestDir
);
...
...
@@ -302,6 +312,38 @@ static void test_GetDisplayName(void)
IShellFolder_Release
(
psfPersonal
);
}
static
void
test_GetAttributesOf
(
void
)
{
HRESULT
hr
;
LPSHELLFOLDER
psfDesktop
;
SHITEMID
emptyitem
=
{
0
,
{
0
}
};
LPCITEMIDLIST
pidlEmpty
=
(
LPCITEMIDLIST
)
&
emptyitem
;
DWORD
dwFlags
;
const
static
DWORD
dwDesktopFlags
=
/* As observed on WinXP SP2 */
SFGAO_STORAGE
|
SFGAO_HASPROPSHEET
|
SFGAO_STORAGE_ANCESTOR
|
SFGAO_FILESYSANCESTOR
|
SFGAO_FOLDER
|
SFGAO_FILESYSTEM
|
SFGAO_HASSUBFOLDER
;
hr
=
SHGetDesktopFolder
(
&
psfDesktop
);
ok
(
SUCCEEDED
(
hr
),
"SHGetDesktopFolder failed! hr = %08lx
\n
"
,
hr
);
if
(
FAILED
(
hr
))
return
;
/* The Desktop attributes can be queried with a single empty itemidlist, .. */
dwFlags
=
0xffffffff
;
hr
=
IShellFolder_GetAttributesOf
(
psfDesktop
,
1
,
&
pidlEmpty
,
&
dwFlags
);
ok
(
SUCCEEDED
(
hr
),
"Desktop->GetAttributesOf failed! hr = %08lx
\n
"
,
hr
);
ok
(
dwFlags
==
dwDesktopFlags
,
"Wrong Desktop attributes: %08lx, expected: %08lx
\n
"
,
dwFlags
,
dwDesktopFlags
);
/* .. or with no itemidlist at all. */
dwFlags
=
0xffffffff
;
hr
=
IShellFolder_GetAttributesOf
(
psfDesktop
,
0
,
NULL
,
&
dwFlags
);
ok
(
SUCCEEDED
(
hr
),
"Desktop->GetAttributesOf failed! hr = %08lx
\n
"
,
hr
);
ok
(
dwFlags
==
dwDesktopFlags
,
"Wrong Desktop attributes: %08lx, expected: %08lx
\n
"
,
dwFlags
,
dwDesktopFlags
);
IShellFolder_Release
(
psfDesktop
);
}
START_TEST
(
shlfolder
)
{
ITEMIDLIST
*
newPIDL
;
...
...
@@ -334,6 +376,7 @@ START_TEST(shlfolder)
test_EnumObjects
(
testIShellFolder
);
test_BindToObject
();
test_GetDisplayName
();
test_GetAttributesOf
();
hr
=
IShellFolder_Release
(
testIShellFolder
);
ok
(
hr
==
S_OK
,
"IShellFolder_Release failed %08lx
\n
"
,
hr
);
...
...
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