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
cc15fcc4
Commit
cc15fcc4
authored
Mar 05, 2006
by
Michael Jung
Committed by
Alexandre Julliard
Mar 06, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shell32: Unicode'ify ISFHelper interface.
parent
46ecb15c
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
56 additions
and
47 deletions
+56
-47
shellfolder.h
dlls/shell32/shellfolder.h
+2
-2
shfldr_fs.c
dlls/shell32/shfldr_fs.c
+29
-27
shfldr_unixfs.c
dlls/shell32/shfldr_unixfs.c
+22
-15
shv_bg_cmenu.c
dlls/shell32/shv_bg_cmenu.c
+3
-3
No files found.
dlls/shell32/shellfolder.h
View file @
cc15fcc4
...
...
@@ -46,8 +46,8 @@ DECLARE_INTERFACE_(ISFHelper,IUnknown)
STDMETHOD_
(
ULONG
,
AddRef
)(
THIS
)
PURE
;
STDMETHOD_
(
ULONG
,
Release
)(
THIS
)
PURE
;
/*** ISFHelper methods ***/
STDMETHOD
(
GetUniqueName
)(
THIS_
LPSTR
lpName
,
UINT
uLen
)
PURE
;
STDMETHOD
(
AddFolder
)(
THIS_
HWND
hwnd
,
LPCSTR
lpName
,
LPITEMIDLIST
*
ppidlOut
)
PURE
;
STDMETHOD
(
GetUniqueName
)(
THIS_
LP
W
STR
lpName
,
UINT
uLen
)
PURE
;
STDMETHOD
(
AddFolder
)(
THIS_
HWND
hwnd
,
LPC
W
STR
lpName
,
LPITEMIDLIST
*
ppidlOut
)
PURE
;
STDMETHOD
(
DeleteItems
)(
THIS_
UINT
cidl
,
LPCITEMIDLIST
*
apidl
)
PURE
;
STDMETHOD
(
CopyItems
)(
THIS_
IShellFolder
*
pSFFrom
,
UINT
cidl
,
LPCITEMIDLIST
*
apidl
)
PURE
;
};
...
...
dlls/shell32/shfldr_fs.c
View file @
cc15fcc4
...
...
@@ -1064,20 +1064,21 @@ static ULONG WINAPI ISFHelper_fnRelease (ISFHelper * iface)
*/
static
HRESULT
WINAPI
ISFHelper_fnGetUniqueName
(
ISFHelper
*
iface
,
LP
STR
lp
Name
,
UINT
uLen
)
ISFHelper_fnGetUniqueName
(
ISFHelper
*
iface
,
LP
WSTR
pwsz
Name
,
UINT
uLen
)
{
IGenericSFImpl
*
This
=
impl_from_ISFHelper
(
iface
);
IEnumIDList
*
penum
;
HRESULT
hr
;
char
szText
[
MAX_PATH
];
const
char
*
szNewFolder
=
"New Folder"
;
WCHAR
wszText
[
MAX_PATH
];
const
WCHAR
wszNewFolder
[]
=
{
'N'
,
'e'
,
'w'
,
' '
,
'F'
,
'o'
,
'l'
,
'd'
,
'e'
,
'r'
,
0
};
const
WCHAR
wszFormat
[]
=
{
'%'
,
's'
,
' '
,
'%'
,
'd'
,
0
};
TRACE
(
"(%p)(%
s %u)
\n
"
,
This
,
lp
Name
,
uLen
);
TRACE
(
"(%p)(%
p %u)
\n
"
,
This
,
pwsz
Name
,
uLen
);
if
(
uLen
<
s
trlen
(
szNewFolder
)
+
4
)
if
(
uLen
<
s
izeof
(
wszNewFolder
)
/
sizeof
(
WCHAR
)
+
3
)
return
E_POINTER
;
strcpy
(
lpName
,
szNewFolder
);
lstrcpynW
(
pwszName
,
wszNewFolder
,
uLen
);
hr
=
IShellFolder_fnEnumObjects
(
_IShellFolder2_
(
This
),
0
,
SHCONTF_FOLDERS
|
SHCONTF_NONFOLDERS
|
SHCONTF_INCLUDEHIDDEN
,
&
penum
);
...
...
@@ -1090,9 +1091,9 @@ next:
IEnumIDList_Reset
(
penum
);
while
(
S_OK
==
IEnumIDList_Next
(
penum
,
1
,
&
pidl
,
&
dwFetched
)
&&
dwFetched
)
{
_ILSimpleGetText
(
pidl
,
szText
,
MAX_PATH
);
if
(
0
==
strcasecmp
(
szText
,
lp
Name
))
{
s
printf
(
lpName
,
"%s %d"
,
szNewFolder
,
i
++
);
_ILSimpleGetText
W
(
pidl
,
w
szText
,
MAX_PATH
);
if
(
0
==
lstrcmpiW
(
wszText
,
pwsz
Name
))
{
s
nprintfW
(
pwszName
,
uLen
,
wszFormat
,
w
szNewFolder
,
i
++
);
if
(
i
>
99
)
{
hr
=
E_FAIL
;
break
;
...
...
@@ -1113,40 +1114,41 @@ next:
*/
static
HRESULT
WINAPI
ISFHelper_fnAddFolder
(
ISFHelper
*
iface
,
HWND
hwnd
,
LPC
STR
lp
Name
,
ISFHelper_fnAddFolder
(
ISFHelper
*
iface
,
HWND
hwnd
,
LPC
WSTR
pwsz
Name
,
LPITEMIDLIST
*
ppidlOut
)
{
IGenericSFImpl
*
This
=
impl_from_ISFHelper
(
iface
);
char
lpstr
NewDir
[
MAX_PATH
];
WCHAR
wsz
NewDir
[
MAX_PATH
];
DWORD
bRes
;
HRESULT
hres
=
E_FAIL
;
TRACE
(
"(%p)(%s %p)
\n
"
,
This
,
lpName
,
ppidlOut
);
TRACE
(
"(%p)(%s %p)
\n
"
,
This
,
debugstr_w
(
pwszName
)
,
ppidlOut
);
if
(
!
WideCharToMultiByte
(
CP_ACP
,
0
,
This
->
sPathTarget
,
-
1
,
lpstrNewDir
,
MAX_PATH
,
NULL
,
NULL
))
lpstrNewDir
[
0
]
=
'\0'
;
PathAppendA
(
lpstrNewDir
,
lpName
);
wszNewDir
[
0
]
=
0
;
if
(
This
->
sPathTarget
)
lstrcpynW
(
wszNewDir
,
This
->
sPathTarget
,
MAX_PATH
);
PathAppendW
(
wszNewDir
,
pwszName
);
bRes
=
CreateDirectory
A
(
lpstr
NewDir
,
NULL
);
bRes
=
CreateDirectory
W
(
wsz
NewDir
,
NULL
);
if
(
bRes
)
{
SHChangeNotify
(
SHCNE_MKDIR
,
SHCNF_PATH
A
,
lpstr
NewDir
,
NULL
);
SHChangeNotify
(
SHCNE_MKDIR
,
SHCNF_PATH
W
,
wsz
NewDir
,
NULL
);
hres
=
S_OK
;
if
(
ppidlOut
)
hres
=
_ILCreateFromPath
A
(
lpstr
NewDir
,
ppidlOut
);
hres
=
_ILCreateFromPath
W
(
wsz
NewDir
,
ppidlOut
);
}
else
{
char
lpstr
Text
[
128
+
MAX_PATH
];
char
lpstr
TempText
[
128
];
char
lpstr
Caption
[
256
];
WCHAR
wsz
Text
[
128
+
MAX_PATH
];
WCHAR
wsz
TempText
[
128
];
WCHAR
wsz
Caption
[
256
];
/* Cannot Create folder because of permissions */
LoadString
A
(
shell32_hInstance
,
IDS_CREATEFOLDER_DENIED
,
lpstr
TempText
,
sizeof
(
lpstr
TempText
));
LoadString
A
(
shell32_hInstance
,
IDS_CREATEFOLDER_CAPTION
,
lpstr
Caption
,
sizeof
(
lpstr
Caption
));
sprintf
(
lpstrText
,
lpstrTempText
,
lpstr
NewDir
);
MessageBox
A
(
hwnd
,
lpstrText
,
lpstr
Caption
,
MB_OK
|
MB_ICONEXCLAMATION
);
LoadString
W
(
shell32_hInstance
,
IDS_CREATEFOLDER_DENIED
,
wsz
TempText
,
sizeof
(
wsz
TempText
));
LoadString
W
(
shell32_hInstance
,
IDS_CREATEFOLDER_CAPTION
,
wsz
Caption
,
sizeof
(
wsz
Caption
));
sprintf
W
(
wszText
,
wszTempText
,
wsz
NewDir
);
MessageBox
W
(
hwnd
,
wszText
,
wsz
Caption
,
MB_OK
|
MB_ICONEXCLAMATION
);
}
return
hres
;
...
...
dlls/shell32/shfldr_unixfs.c
View file @
cc15fcc4
...
...
@@ -1680,7 +1680,7 @@ static ULONG WINAPI UnixFolder_ISFHelper_Release(ISFHelper* iface)
STATIC_CAST
(
IShellFolder2
,
ADJUST_THIS
(
UnixFolder
,
ISFHelper
,
iface
)));
}
static
HRESULT
WINAPI
UnixFolder_ISFHelper_GetUniqueName
(
ISFHelper
*
iface
,
LP
STR
lp
Name
,
UINT
uLen
)
static
HRESULT
WINAPI
UnixFolder_ISFHelper_GetUniqueName
(
ISFHelper
*
iface
,
LP
WSTR
pwsz
Name
,
UINT
uLen
)
{
UnixFolder
*
This
=
ADJUST_THIS
(
UnixFolder
,
ISFHelper
,
iface
);
IEnumIDList
*
pEnum
;
...
...
@@ -1688,23 +1688,26 @@ static HRESULT WINAPI UnixFolder_ISFHelper_GetUniqueName(ISFHelper* iface, LPSTR
LPITEMIDLIST
pidlElem
;
DWORD
dwFetched
;
int
i
;
static
const
char
szNewFolder
[]
=
"New Folder"
;
static
const
WCHAR
wszNewFolder
[]
=
{
'N'
,
'e'
,
'w'
,
' '
,
'F'
,
'o'
,
'l'
,
'd'
,
'e'
,
'r'
,
0
};
static
const
WCHAR
wszFormat
[]
=
{
'%'
,
's'
,
' '
,
'%'
,
'd'
,
0
};
TRACE
(
"(iface=%p,
lpName=%p, uLen=%u)
\n
"
,
iface
,
lp
Name
,
uLen
);
TRACE
(
"(iface=%p,
pwszName=%p, uLen=%u)
\n
"
,
iface
,
pwsz
Name
,
uLen
);
if
(
uLen
<
sizeof
(
szNewFolder
)
+
3
)
if
(
uLen
<
sizeof
(
wszNewFolder
)
/
sizeof
(
WCHAR
)
+
3
)
return
E_INVALIDARG
;
hr
=
IShellFolder2_EnumObjects
(
STATIC_CAST
(
IShellFolder2
,
This
),
0
,
SHCONTF_FOLDERS
|
SHCONTF_NONFOLDERS
|
SHCONTF_INCLUDEHIDDEN
,
&
pEnum
);
if
(
SUCCEEDED
(
hr
))
{
lstrcpy
A
(
lpName
,
szNewFolder
);
lstrcpy
nW
(
pwszName
,
wszNewFolder
,
uLen
);
IEnumIDList_Reset
(
pEnum
);
i
=
2
;
while
((
IEnumIDList_Next
(
pEnum
,
1
,
&
pidlElem
,
&
dwFetched
)
==
S_OK
)
&&
(
dwFetched
==
1
))
{
if
(
!
strcasecmp
(
_ILGetTextPointer
(
pidlElem
),
lpName
))
{
WCHAR
wszTemp
[
MAX_PATH
];
_ILSimpleGetTextW
(
pidlElem
,
wszTemp
,
MAX_PATH
);
if
(
!
lstrcmpiW
(
wszTemp
,
pwszName
))
{
IEnumIDList_Reset
(
pEnum
);
s
printf
(
lpName
,
"%s %d"
,
szNewFolder
,
i
++
);
s
nprintfW
(
pwszName
,
uLen
,
wszFormat
,
w
szNewFolder
,
i
++
);
if
(
i
>
99
)
{
hr
=
E_FAIL
;
break
;
...
...
@@ -1716,20 +1719,26 @@ static HRESULT WINAPI UnixFolder_ISFHelper_GetUniqueName(ISFHelper* iface, LPSTR
return
hr
;
}
static
HRESULT
WINAPI
UnixFolder_ISFHelper_AddFolder
(
ISFHelper
*
iface
,
HWND
hwnd
,
LPC
STR
p
szName
,
static
HRESULT
WINAPI
UnixFolder_ISFHelper_AddFolder
(
ISFHelper
*
iface
,
HWND
hwnd
,
LPC
WSTR
pw
szName
,
LPITEMIDLIST
*
ppidlOut
)
{
UnixFolder
*
This
=
ADJUST_THIS
(
UnixFolder
,
ISFHelper
,
iface
);
char
szNewDir
[
FILENAME_MAX
];
int
cBaseLen
;
TRACE
(
"(iface=%p, hwnd=%p, pszName=%s, ppidlOut=%p)
\n
"
,
iface
,
hwnd
,
pszName
,
ppidlOut
);
TRACE
(
"(iface=%p, hwnd=%p, pwszName=%s, ppidlOut=%p)
\n
"
,
iface
,
hwnd
,
debugstr_w
(
pwszName
),
ppidlOut
);
if
(
ppidlOut
)
*
ppidlOut
=
NULL
;
lstrcpyA
(
szNewDir
,
This
->
m_pszPath
);
lstrcatA
(
szNewDir
,
pszName
);
if
(
!
This
->
m_pszPath
||
!
(
This
->
m_dwAttributes
&
SFGAO_FILESYSTEM
))
return
E_FAIL
;
lstrcpynA
(
szNewDir
,
This
->
m_pszPath
,
FILENAME_MAX
);
cBaseLen
=
lstrlenA
(
szNewDir
);
WideCharToMultiByte
(
CP_UNIXCP
,
0
,
pwszName
,
-
1
,
szNewDir
+
cBaseLen
,
FILENAME_MAX
-
cBaseLen
,
0
,
0
);
if
(
mkdir
(
szNewDir
,
0755
))
{
char
szMessage
[
256
+
FILENAME_MAX
];
char
szCaption
[
256
];
...
...
@@ -1742,11 +1751,9 @@ static HRESULT WINAPI UnixFolder_ISFHelper_AddFolder(ISFHelper* iface, HWND hwnd
return
E_FAIL
;
}
else
{
LPITEMIDLIST
pidlRelative
;
WCHAR
wszName
[
MAX_PATH
];
/* Inform the shell */
MultiByteToWideChar
(
CP_UNIXCP
,
0
,
pszName
,
-
1
,
wszName
,
MAX_PATH
);
if
(
UNIXFS_path_to_pidl
(
This
,
wszName
,
&
pidlRelative
))
{
if
(
UNIXFS_path_to_pidl
(
This
,
pwszName
,
&
pidlRelative
))
{
LPITEMIDLIST
pidlAbsolute
=
ILCombine
(
This
->
m_pidlLocation
,
pidlRelative
);
if
(
ppidlOut
)
*
ppidlOut
=
pidlRelative
;
...
...
dlls/shell32/shv_bg_cmenu.c
View file @
cc15fcc4
...
...
@@ -193,14 +193,14 @@ static void DoNewFolder(
{
BgCmImpl
*
This
=
(
BgCmImpl
*
)
iface
;
ISFHelper
*
psfhlp
;
char
szName
[
MAX_PATH
];
WCHAR
w
szName
[
MAX_PATH
];
IShellFolder_QueryInterface
(
This
->
pSFParent
,
&
IID_ISFHelper
,
(
LPVOID
*
)
&
psfhlp
);
if
(
psfhlp
)
{
LPITEMIDLIST
pidl
;
ISFHelper_GetUniqueName
(
psfhlp
,
szName
,
MAX_PATH
);
ISFHelper_AddFolder
(
psfhlp
,
0
,
szName
,
&
pidl
);
ISFHelper_GetUniqueName
(
psfhlp
,
w
szName
,
MAX_PATH
);
ISFHelper_AddFolder
(
psfhlp
,
0
,
w
szName
,
&
pidl
);
if
(
psv
)
{
...
...
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