Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
21b9a50e
Commit
21b9a50e
authored
Apr 10, 2008
by
Rob Shearman
Committed by
Alexandre Julliard
Apr 11, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shell32: Implement ParseDisplayName for EntireNetwork in the Network Places shell folder.
Add a test for this behaviour.
parent
ac0db114
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
124 additions
and
5 deletions
+124
-5
pidl.c
dlls/shell32/pidl.c
+17
-0
pidl.h
dlls/shell32/pidl.h
+1
-0
shfldr_netplaces.c
dlls/shell32/shfldr_netplaces.c
+42
-5
Makefile.in
dlls/shell32/tests/Makefile.in
+1
-0
shfldr_netplaces.c
dlls/shell32/tests/shfldr_netplaces.c
+63
-0
No files found.
dlls/shell32/pidl.c
View file @
21b9a50e
...
...
@@ -1570,6 +1570,23 @@ LPITEMIDLIST _ILCreateDrive(LPCWSTR lpszNew)
return
pidlOut
;
}
LPITEMIDLIST
_ILCreateEntireNetwork
(
void
)
{
LPITEMIDLIST
pidlOut
;
TRACE
(
"
\n
"
);
pidlOut
=
_ILAlloc
(
PT_NETWORK
,
FIELD_OFFSET
(
PIDLDATA
,
u
.
network
.
szNames
[
sizeof
(
"Entire Network"
)]));
if
(
pidlOut
)
{
LPPIDLDATA
pData
=
_ILGetDataPointer
(
pidlOut
);
pData
->
u
.
network
.
dummy
=
0
;
strcpy
(
pData
->
u
.
network
.
szNames
,
"Entire Network"
);
}
return
pidlOut
;
}
/**************************************************************************
* _ILGetDrive()
*
...
...
dlls/shell32/pidl.h
View file @
21b9a50e
...
...
@@ -255,6 +255,7 @@ LPITEMIDLIST _ILCreateNetwork (void);
LPITEMIDLIST
_ILCreateNetHood
(
void
);
LPITEMIDLIST
_ILCreateBitBucket
(
void
);
LPITEMIDLIST
_ILCreateDrive
(
LPCWSTR
);
LPITEMIDLIST
_ILCreateEntireNetwork
(
void
);
/*
* helper functions (getting struct-pointer)
...
...
dlls/shell32/shfldr_netplaces.c
View file @
21b9a50e
...
...
@@ -43,6 +43,7 @@
#include "shell32_main.h"
#include "shresdef.h"
#include "wine/debug.h"
#include "wine/unicode.h"
#include "debughlp.h"
#include "shfldr.h"
...
...
@@ -181,17 +182,53 @@ static HRESULT WINAPI ISF_NetworkPlaces_fnParseDisplayName (IShellFolder2 * ifac
HWND
hwndOwner
,
LPBC
pbcReserved
,
LPOLESTR
lpszDisplayName
,
DWORD
*
pchEaten
,
LPITEMIDLIST
*
ppidl
,
DWORD
*
pdwAttributes
)
{
static
const
WCHAR
wszEntireNetwork
[]
=
{
'E'
,
'n'
,
't'
,
'i'
,
'r'
,
'e'
,
'N'
,
'e'
,
't'
,
'w'
,
'o'
,
'r'
,
'k'
};
/* not nul-terminated */
IGenericSFImpl
*
This
=
(
IGenericSFImpl
*
)
iface
;
HRESULT
hr
=
E_UNEXPECTED
;
HRESULT
hr
=
E_INVALIDARG
;
LPCWSTR
szNext
=
NULL
;
WCHAR
szElement
[
MAX_PATH
];
LPITEMIDLIST
pidlTemp
=
NULL
;
int
len
;
TRACE
(
"(%p)->(HWND=%p,%p,%p=%s,%p,pidl=%p,%p)
\n
"
,
This
,
hwndOwner
,
pbcReserved
,
lpszDisplayName
,
debugstr_w
(
lpszDisplayName
),
pchEaten
,
ppidl
,
pdwAttributes
);
*
ppidl
=
0
;
if
(
pchEaten
)
*
pchEaten
=
0
;
/* strange but like the original */
*
ppidl
=
NULL
;
szNext
=
GetNextElementW
(
lpszDisplayName
,
szElement
,
MAX_PATH
);
len
=
strlenW
(
szElement
);
if
(
len
==
sizeof
(
wszEntireNetwork
)
/
sizeof
(
wszEntireNetwork
[
0
])
&&
!
strncmpiW
(
szElement
,
wszEntireNetwork
,
sizeof
(
wszEntireNetwork
)
/
sizeof
(
wszEntireNetwork
[
0
])))
{
pidlTemp
=
_ILCreateEntireNetwork
();
if
(
pidlTemp
)
hr
=
S_OK
;
else
hr
=
E_OUTOFMEMORY
;
}
else
FIXME
(
"not implemented for %s
\n
"
,
debugstr_w
(
lpszDisplayName
));
if
(
SUCCEEDED
(
hr
)
&&
pidlTemp
)
{
if
(
szNext
&&
*
szNext
)
{
hr
=
SHELL32_ParseNextElement
(
iface
,
hwndOwner
,
pbcReserved
,
&
pidlTemp
,
(
LPOLESTR
)
szNext
,
pchEaten
,
pdwAttributes
);
}
else
{
if
(
pdwAttributes
&&
*
pdwAttributes
)
hr
=
SHELL32_GetItemAttributes
(
_IShellFolder_
(
This
),
pidlTemp
,
pdwAttributes
);
}
}
if
(
SUCCEEDED
(
hr
))
*
ppidl
=
pidlTemp
;
else
ILFree
(
pidlTemp
);
TRACE
(
"(%p)->(-- ret=0x%08x)
\n
"
,
This
,
hr
);
...
...
dlls/shell32/tests/Makefile.in
View file @
21b9a50e
...
...
@@ -10,6 +10,7 @@ CTESTS = \
generated.c
\
shelllink.c
\
shellpath.c
\
shfldr_netplaces.c
\
shlexec.c
\
shlfileop.c
\
shlfolder.c
\
...
...
dlls/shell32/tests/shfldr_netplaces.c
0 → 100644
View file @
21b9a50e
/*
* Tests for My Network Places shell folder
*
* Copyright 2008 Robert Shearman for CodeWeavers
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <stdarg.h>
#include <stdio.h>
#define COBJMACROS
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include "shellapi.h"
#include "shlobj.h"
#include "wine/test.h"
static
void
test_parse_for_entire_network
(
void
)
{
static
const
WCHAR
entire_network_path
[]
=
{
':'
,
':'
,
'{'
,
'2'
,
'0'
,
'8'
,
'D'
,
'2'
,
'C'
,
'6'
,
'0'
,
'-'
,
'3'
,
'A'
,
'E'
,
'A'
,
'-'
,
'1'
,
'0'
,
'6'
,
'9'
,
'-'
,
'A'
,
'2'
,
'D'
,
'7'
,
'-'
,
'0'
,
'8'
,
'0'
,
'0'
,
'2'
,
'B'
,
'3'
,
'0'
,
'3'
,
'0'
,
'9'
,
'D'
,
'}'
,
'\\'
,
'E'
,
'n'
,
't'
,
'i'
,
'r'
,
'e'
,
'N'
,
'e'
,
't'
,
'w'
,
'o'
,
'r'
,
'k'
,
0
};
IShellFolder
*
psfDesktop
;
HRESULT
hr
;
DWORD
eaten
=
0xdeadbeef
;
LPITEMIDLIST
pidl
;
DWORD
attr
=
~
0
;
DWORD
expected_attr
;
hr
=
SHGetDesktopFolder
(
&
psfDesktop
);
ok
(
hr
==
S_OK
,
"SHGetDesktopFolder failed with error 0x%x
\n
"
,
hr
);
hr
=
IShellFolder_ParseDisplayName
(
psfDesktop
,
NULL
,
NULL
,
(
LPWSTR
)
entire_network_path
,
&
eaten
,
&
pidl
,
&
attr
);
ok
(
hr
==
S_OK
,
"IShellFolder_ParseDisplayName failed with error 0x%x
\n
"
,
hr
);
todo_wine
ok
(
eaten
==
0xdeadbeef
,
"eaten should not have been set to %u
\n
"
,
eaten
);
expected_attr
=
SFGAO_HASSUBFOLDER
|
SFGAO_FOLDER
|
SFGAO_FILESYSANCESTOR
|
SFGAO_STORAGEANCESTOR
|
SFGAO_HASPROPSHEET
|
SFGAO_CANLINK
;
todo_wine
ok
(
attr
==
expected_attr
,
"attr should be 0x%x, not 0x%x
\n
"
,
expected_attr
,
attr
);
ILFree
(
pidl
);
}
START_TEST
(
shfldr_netplaces
)
{
test_parse_for_entire_network
();
}
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