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
9fef3848
Commit
9fef3848
authored
Jul 05, 2005
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Authors: Michael Lin <mlin@corvu.com.au>, Michael Jung <mjung@iss.tu-darmstadt.de>
Implemented UnixFolder's IShellFolder::SetNameOf.
parent
b9786d5c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
58 additions
and
4 deletions
+58
-4
shfldr_unixfs.c
dlls/shell32/shfldr_unixfs.c
+58
-4
No files found.
dlls/shell32/shfldr_unixfs.c
View file @
9fef3848
...
...
@@ -365,7 +365,10 @@ static char* UNIXFS_build_shitemid(char *pszUnixPath, BOOL bParentIsFS, void *pI
pStatStruct
->
st_mode
=
fileStat
.
st_mode
;
pStatStruct
->
st_uid
=
fileStat
.
st_uid
;
pStatStruct
->
st_gid
=
fileStat
.
st_gid
;
pStatStruct
->
sfAttr
=
S_ISDIR
(
fileStat
.
st_mode
)
?
(
SFGAO_FOLDER
|
SFGAO_HASSUBFOLDER
|
SFGAO_FILESYSANCESTOR
)
:
0
;
if
(
S_ISDIR
(
fileStat
.
st_mode
))
pStatStruct
->
sfAttr
=
SFGAO_FOLDER
|
SFGAO_HASSUBFOLDER
|
SFGAO_FILESYSANCESTOR
|
SFGAO_CANRENAME
;
else
pStatStruct
->
sfAttr
=
SFGAO_CANRENAME
;
if
(
bParentIsFS
||
UNIXFS_is_dos_device
(
&
fileStat
))
pStatStruct
->
sfAttr
|=
SFGAO_FILESYSTEM
;
/* Set shell32's standard SHITEMID data fields. */
...
...
@@ -1034,11 +1037,62 @@ static HRESULT WINAPI UnixFolder_IShellFolder2_GetDisplayNameOf(IShellFolder2* i
return
hr
;
}
static
HRESULT
WINAPI
UnixFolder_IShellFolder2_SetNameOf
(
IShellFolder2
*
This
,
HWND
hwnd
,
static
HRESULT
WINAPI
UnixFolder_IShellFolder2_SetNameOf
(
IShellFolder2
*
iface
,
HWND
hwnd
,
LPCITEMIDLIST
pidl
,
LPCOLESTR
lpszName
,
SHGDNF
uFlags
,
LPITEMIDLIST
*
ppidlOut
)
{
TRACE
(
"stub
\n
"
);
return
E_NOTIMPL
;
UnixFolder
*
This
=
ADJUST_THIS
(
UnixFolder
,
IShellFolder2
,
iface
);
char
szSrc
[
FILENAME_MAX
],
szDest
[
FILENAME_MAX
];
int
cBasePathLen
=
lstrlenA
(
This
->
m_pszPath
);
struct
stat
statDest
;
LPITEMIDLIST
pidlNew
;
TRACE
(
"(iface=%p, hwnd=%p, pidl=%p, lpszName=%s, uFlags=0x%08lx, ppidlOut=%p)
\n
"
,
iface
,
hwnd
,
pidl
,
debugstr_w
(
lpszName
),
uFlags
,
ppidlOut
);
/* pidl has to contain a single non-empty SHITEMID */
if
(
_ILIsDesktop
(
pidl
)
||
!
_ILIsPidlSimple
(
pidl
)
||
!
_ILGetTextPointer
(
pidl
))
return
E_INVALIDARG
;
if
(
ppidlOut
)
*
ppidlOut
=
NULL
;
/* build source path */
memcpy
(
szSrc
,
This
->
m_pszPath
,
cBasePathLen
);
lstrcpyA
(
szSrc
+
cBasePathLen
,
_ILGetTextPointer
(
pidl
));
/* build destination path */
if
(
uFlags
&
SHGDN_FORPARSING
)
{
/* absolute path in lpszName */
WideCharToMultiByte
(
CP_ACP
,
0
,
lpszName
,
-
1
,
szDest
,
FILENAME_MAX
,
NULL
,
NULL
);
}
else
{
memcpy
(
szDest
,
This
->
m_pszPath
,
cBasePathLen
);
WideCharToMultiByte
(
CP_ACP
,
0
,
lpszName
,
-
1
,
szDest
+
cBasePathLen
,
FILENAME_MAX
-
cBasePathLen
,
NULL
,
NULL
);
}
TRACE
(
"src=%s dest=%s
\n
"
,
szSrc
,
szDest
);
/* Fail, if destination does already exist */
if
(
!
stat
(
szDest
,
&
statDest
))
return
E_FAIL
;
/* Rename the file and inform the shell */
if
(
!
rename
(
szSrc
,
szDest
)
&&
UNIXFS_path_to_pidl
(
This
,
lpszName
,
&
pidlNew
))
{
LPITEMIDLIST
pidlSrc
=
ILCombine
(
This
->
m_pidlLocation
,
pidl
);
LPITEMIDLIST
pidlDest
=
ILCombine
(
This
->
m_pidlLocation
,
pidlNew
);
if
(
_ILIsFolder
(
pidlNew
))
SHChangeNotify
(
SHCNE_RENAMEFOLDER
,
SHCNF_IDLIST
,
pidlSrc
,
pidlDest
);
else
SHChangeNotify
(
SHCNE_RENAMEITEM
,
SHCNF_IDLIST
,
pidlSrc
,
pidlDest
);
ILFree
(
pidlSrc
);
ILFree
(
pidlDest
);
if
(
ppidlOut
)
*
ppidlOut
=
pidlNew
;
else
ILFree
(
pidlNew
);
return
S_OK
;
}
return
E_FAIL
;
}
static
HRESULT
WINAPI
UnixFolder_IShellFolder2_EnumSearches
(
IShellFolder2
*
iface
,
...
...
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