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
316df99b
Commit
316df99b
authored
Mar 02, 2005
by
Juan Lang
Committed by
Alexandre Julliard
Mar 02, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Convert more API calls to Unicode.
parent
55f46aef
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
92 additions
and
48 deletions
+92
-48
shfldr.h
dlls/shell32/shfldr.h
+13
-0
shfldr_desktop.c
dlls/shell32/shfldr_desktop.c
+37
-17
shfldr_fs.c
dlls/shell32/shfldr_fs.c
+29
-25
shfldr_mycomp.c
dlls/shell32/shfldr_mycomp.c
+13
-6
No files found.
dlls/shell32/shfldr.h
View file @
316df99b
...
...
@@ -56,4 +56,17 @@ static inline int SHELL32_GUIDToStringA (REFGUID guid, LPSTR str)
guid
->
Data4
[
4
],
guid
->
Data4
[
5
],
guid
->
Data4
[
6
],
guid
->
Data4
[
7
]);
}
static
inline
int
SHELL32_GUIDToStringW
(
REFGUID
guid
,
LPWSTR
str
)
{
static
const
WCHAR
fmtW
[]
=
{
'{'
,
'%'
,
'0'
,
'8'
,
'l'
,
'x'
,
'-'
,
'%'
,
'0'
,
'4'
,
'x'
,
'-'
,
'%'
,
'0'
,
'4'
,
'x'
,
'-'
,
'%'
,
'0'
,
'2'
,
'x'
,
'%'
,
'0'
,
'2'
,
'x'
,
'-'
,
'%'
,
'0'
,
'2'
,
'x'
,
'%'
,
'0'
,
'2'
,
'x'
,
'%'
,
'0'
,
'2'
,
'x'
,
'%'
,
'0'
,
'2'
,
'x'
,
'%'
,
'0'
,
'2'
,
'x'
,
'%'
,
'0'
,
'2'
,
'x'
,
'}'
,
0
};
return
sprintfW
(
str
,
fmtW
,
guid
->
Data1
,
guid
->
Data2
,
guid
->
Data3
,
guid
->
Data4
[
0
],
guid
->
Data4
[
1
],
guid
->
Data4
[
2
],
guid
->
Data4
[
3
],
guid
->
Data4
[
4
],
guid
->
Data4
[
5
],
guid
->
Data4
[
6
],
guid
->
Data4
[
7
]);
}
void
SHELL_FS_ProcessDisplayFilename
(
LPSTR
szPath
,
DWORD
dwFlags
);
dlls/shell32/shfldr_desktop.c
View file @
316df99b
...
...
@@ -206,8 +206,6 @@ static HRESULT WINAPI ISF_Desktop_fnParseDisplayName (IShellFolder2 * iface,
LPCWSTR
szNext
=
NULL
;
LPITEMIDLIST
pidlTemp
=
NULL
;
HRESULT
hr
=
S_OK
;
char
szPath
[
MAX_PATH
];
DWORD
len
;
CLSID
clsid
;
TRACE
(
"(%p)->(HWND=%p,%p,%p=%s,%p,pidl=%p,%p)
\n
"
,
...
...
@@ -251,13 +249,24 @@ static HRESULT WINAPI ISF_Desktop_fnParseDisplayName (IShellFolder2 * iface,
if
(
*
lpszDisplayName
)
{
WCHAR
szPath
[
MAX_PATH
];
LPWSTR
pathPtr
;
/* build a complete path to create a simple pidl */
lstrcpyA
(
szPath
,
This
->
sPathTarget
);
PathAddBackslashA
(
szPath
);
len
=
lstrlenA
(
szPath
);
WideCharToMultiByte
(
CP_ACP
,
0
,
lpszDisplayName
,
-
1
,
szPath
+
len
,
MAX_PATH
-
len
,
NULL
,
NULL
);
hr
=
_ILCreateFromPathA
(
szPath
,
&
pidlTemp
);
MultiByteToWideChar
(
CP_ACP
,
0
,
This
->
sPathTarget
,
-
1
,
szPath
,
sizeof
(
szPath
)
/
sizeof
(
szPath
[
0
]));
pathPtr
=
PathAddBackslashW
(
szPath
);
if
(
pathPtr
)
{
lstrcpynW
(
pathPtr
,
lpszDisplayName
,
sizeof
(
szPath
)
/
sizeof
(
szPath
[
0
])
-
(
pathPtr
-
szPath
));
hr
=
_ILCreateFromPathW
(
szPath
,
&
pidlTemp
);
}
else
{
/* should never reach here, but for completeness */
hr
=
HRESULT_FROM_WIN32
(
ERROR_INSUFFICIENT_BUFFER
);
}
}
else
pidlTemp
=
_ILCreateMyComputer
();
...
...
@@ -290,6 +299,12 @@ static HRESULT WINAPI ISF_Desktop_fnParseDisplayName (IShellFolder2 * iface,
/**************************************************************************
* CreateDesktopEnumList()
*/
static
const
WCHAR
Desktop_NameSpaceW
[]
=
{
'S'
,
'O'
,
'F'
,
'T'
,
'W'
,
'A'
,
'R'
,
'E'
,
'\\'
,
'M'
,
'i'
,
'c'
,
'r'
,
'o'
,
's'
,
'o'
,
'f'
,
't'
,
'\\'
,
'W'
,
'i'
,
'n'
,
'd'
,
'o'
,
'w'
,
's'
,
'\\'
,
'C'
,
'u'
,
'r'
,
'r'
,
'e'
,
'n'
,
't'
,
'V'
,
'e'
,
'r'
,
's'
,
'i'
,
'o'
,
'n'
,
'\\'
,
'E'
,
'x'
,
'p'
,
'l'
,
'o'
,
'r'
,
'e'
,
'r'
,
'\\'
,
'D'
,
'e'
,
's'
,
'k'
,
't'
,
'o'
,
'p'
,
'\\'
,
'N'
,
'a'
,
'm'
,
'e'
,
's'
,
'p'
,
'a'
,
'c'
,
'e'
,
'\0'
};
static
BOOL
CreateDesktopEnumList
(
IEnumIDList
*
list
,
DWORD
dwFlags
)
{
BOOL
ret
=
TRUE
;
...
...
@@ -306,9 +321,7 @@ static BOOL CreateDesktopEnumList(IEnumIDList *list, DWORD dwFlags)
/* create the pidl for This item */
ret
=
AddToEnumList
(
list
,
_ILCreateMyComputer
());
r
=
RegOpenKeyExA
(
HKEY_LOCAL_MACHINE
,
"SOFTWARE
\\
Microsoft
\\
Windows
\\
"
"CurrentVersion
\\
explorer
\\
desktop
\\
NameSpace"
,
r
=
RegOpenKeyExW
(
HKEY_LOCAL_MACHINE
,
Desktop_NameSpaceW
,
0
,
KEY_READ
,
&
hkey
);
if
(
ret
&&
ERROR_SUCCESS
==
r
)
{
...
...
@@ -612,14 +625,21 @@ static HRESULT WINAPI ISF_Desktop_fnGetDisplayNameOf (IShellFolder2 * iface,
else
{
/* get the "WantsFORPARSING" flag from the registry */
char
szRegPath
[
100
];
static
const
WCHAR
clsidW
[]
=
{
'C'
,
'L'
,
'S'
,
'I'
,
'D'
,
'\\'
,
0
};
static
const
WCHAR
shellfolderW
[]
=
{
'\\'
,
's'
,
'h'
,
'e'
,
'l'
,
'l'
,
'f'
,
'o'
,
'l'
,
'd'
,
'e'
,
'r'
,
0
};
static
const
WCHAR
wantsForParsingW
[]
=
{
'W'
,
'a'
,
'n'
,
't'
,
's'
,
'F'
,
'o'
,
'r'
,
'P'
,
'a'
,
'r'
,
's'
,
'i'
,
'n'
,
'g'
,
0
};
WCHAR
szRegPath
[
100
];
LONG
r
;
lstrcpy
A
(
szRegPath
,
"CLSID
\\
"
);
SHELL32_GUIDToString
A
(
clsid
,
&
szRegPath
[
6
]);
lstrcat
A
(
szRegPath
,
"
\\
shellfolder"
);
r
=
SHGetValue
A
(
HKEY_CLASSES_ROOT
,
szRegPath
,
"WantsFORPARSING"
,
NULL
,
NULL
,
NULL
);
lstrcpy
W
(
szRegPath
,
clsidW
);
SHELL32_GUIDToString
W
(
clsid
,
&
szRegPath
[
6
]);
lstrcat
W
(
szRegPath
,
shellfolderW
);
r
=
SHGetValue
W
(
HKEY_CLASSES_ROOT
,
szRegPath
,
wantsForParsingW
,
NULL
,
NULL
,
NULL
);
if
(
r
==
ERROR_SUCCESS
)
bWantsForParsing
=
TRUE
;
else
...
...
dlls/shell32/shfldr_fs.c
View file @
316df99b
...
...
@@ -677,6 +677,15 @@ IShellFolder_fnGetUIObjectOf (IShellFolder2 * iface,
return
hr
;
}
static
const
WCHAR
AdvancedW
[]
=
{
'S'
,
'O'
,
'F'
,
'T'
,
'W'
,
'A'
,
'R'
,
'E'
,
'\\'
,
'M'
,
'i'
,
'c'
,
'r'
,
'o'
,
's'
,
'o'
,
'f'
,
't'
,
'\\'
,
'W'
,
'i'
,
'n'
,
'd'
,
'o'
,
'w'
,
's'
,
'\\'
,
'C'
,
'u'
,
'r'
,
'r'
,
'e'
,
'n'
,
't'
,
'V'
,
'e'
,
'r'
,
's'
,
'i'
,
'o'
,
'n'
,
'\\'
,
'E'
,
'x'
,
'p'
,
'l'
,
'o'
,
'r'
,
'e'
,
'r'
,
'\\'
,
'A'
,
'd'
,
'v'
,
'a'
,
'n'
,
'c'
,
'e'
,
'd'
,
0
};
static
const
WCHAR
HideFileExtW
[]
=
{
'H'
,
'i'
,
'd'
,
'e'
,
'F'
,
'i'
,
'l'
,
'e'
,
'E'
,
'x'
,
't'
,
0
};
static
const
WCHAR
NeverShowExtW
[]
=
{
'N'
,
'e'
,
'v'
,
'e'
,
'r'
,
'S'
,
'h'
,
'o'
,
'w'
,
'E'
,
'x'
,
't'
,
0
};
void
SHELL_FS_ProcessDisplayFilename
(
LPSTR
szPath
,
DWORD
dwFlags
)
{
/*FIXME: MSDN also mentions SHGDN_FOREDITING which is not yet handled. */
...
...
@@ -687,10 +696,9 @@ void SHELL_FS_ProcessDisplayFilename(LPSTR szPath, DWORD dwFlags)
DWORD
dwDataSize
=
sizeof
(
DWORD
);
BOOL
doHide
=
FALSE
;
/* The default value is FALSE (win98 at least) */
if
(
!
RegCreateKeyExA
(
HKEY_CURRENT_USER
,
"Software
\\
Microsoft
\\
Windows
\\
CurrentVersion
\\
Explorer
\\
Advanced"
,
if
(
!
RegCreateKeyExW
(
HKEY_CURRENT_USER
,
AdvancedW
,
0
,
0
,
0
,
KEY_ALL_ACCESS
,
0
,
&
hKey
,
0
))
{
if
(
!
RegQueryValueEx
A
(
hKey
,
"HideFileExt"
,
0
,
0
,
(
LPBYTE
)
&
dwData
,
if
(
!
RegQueryValueEx
W
(
hKey
,
HideFileExtW
,
0
,
0
,
(
LPBYTE
)
&
dwData
,
&
dwDataSize
))
doHide
=
dwData
;
...
...
@@ -701,18 +709,17 @@ void SHELL_FS_ProcessDisplayFilename(LPSTR szPath, DWORD dwFlags)
LPSTR
ext
=
PathFindExtensionA
(
szPath
);
if
(
ext
)
{
HKEY
hkey
;
char
classname
[
MAX_PATH
];
LONG
classlen
=
MAX_PATH
;
if
(
!
RegQueryValueA
(
HKEY_CLASSES_ROOT
,
ext
,
classname
,
&
classlen
))
if
(
!
RegOpenKeyA
(
HKEY_CLASSES_ROOT
,
classname
,
&
h
k
ey
))
{
if
(
!
RegQueryValueEx
A
(
hkey
,
"NeverShowExt"
,
0
,
NULL
,
if
(
!
RegOpenKeyA
(
HKEY_CLASSES_ROOT
,
classname
,
&
h
K
ey
))
{
if
(
!
RegQueryValueEx
W
(
hKey
,
NeverShowExtW
,
0
,
NULL
,
NULL
,
NULL
))
doHide
=
TRUE
;
RegCloseKey
(
h
k
ey
);
RegCloseKey
(
h
K
ey
);
}
}
}
...
...
@@ -813,9 +820,8 @@ static HRESULT WINAPI IShellFolder_fnSetNameOf (IShellFolder2 * iface,
LPITEMIDLIST
*
pPidlOut
)
{
_ICOM_THIS_From_IShellFolder2
(
IGenericSFImpl
,
iface
)
char
szSrc
[
MAX_PATH
],
szDest
[
MAX_PATH
];
int
len
;
WCHAR
szSrc
[
MAX_PATH
],
szDest
[
MAX_PATH
];
LPWSTR
ptr
;
BOOL
bIsFolder
=
_ILIsFolder
(
ILFindLastID
(
pidl
));
TRACE
(
"(%p)->(%p,pidl=%p,%s,%lu,%p)
\n
"
,
This
,
hwndOwner
,
pidl
,
...
...
@@ -823,31 +829,29 @@ static HRESULT WINAPI IShellFolder_fnSetNameOf (IShellFolder2 * iface,
/* build source path */
if
(
dwFlags
&
SHGDN_INFOLDER
)
{
strcpy
(
szSrc
,
This
->
sPathTarget
);
PathAddBackslashA
(
szSrc
);
len
=
strlen
(
szSrc
);
_ILSimpleGetText
(
pidl
,
szSrc
+
len
,
MAX_PATH
-
len
);
MultiByteToWideChar
(
CP_ACP
,
0
,
This
->
sPathTarget
,
-
1
,
szSrc
,
MAX_PATH
);
ptr
=
PathAddBackslashW
(
szSrc
);
if
(
ptr
)
_ILSimpleGetTextW
(
pidl
,
ptr
,
MAX_PATH
-
(
ptr
-
szSrc
)
);
}
else
{
/* FIXME: Can this work with a simple PIDL? */
SHGetPathFromIDList
A
(
pidl
,
szSrc
);
SHGetPathFromIDList
W
(
pidl
,
szSrc
);
}
/* build destination path */
strcpy
(
szDest
,
This
->
sPathTarget
);
PathAddBackslashA
(
szDest
);
len
=
strlen
(
szDest
);
WideCharToMultiByte
(
CP_ACP
,
0
,
lpName
,
-
1
,
szDest
+
len
,
MAX_PATH
-
len
,
NULL
,
NULL
);
szDest
[
MAX_PATH
-
1
]
=
0
;
TRACE
(
"src=%s dest=%s
\n
"
,
szSrc
,
szDest
);
if
(
MoveFileA
(
szSrc
,
szDest
))
{
MultiByteToWideChar
(
CP_ACP
,
0
,
This
->
sPathTarget
,
-
1
,
szDest
,
MAX_PATH
);
ptr
=
PathAddBackslashW
(
szDest
);
if
(
ptr
)
lstrcpynW
(
ptr
,
lpName
,
MAX_PATH
-
(
ptr
-
szDest
));
TRACE
(
"src=%s dest=%s
\n
"
,
debugstr_w
(
szSrc
),
debugstr_w
(
szDest
));
if
(
MoveFileW
(
szSrc
,
szDest
))
{
HRESULT
hr
=
S_OK
;
if
(
pPidlOut
)
hr
=
_ILCreateFromPath
A
(
szDest
,
pPidlOut
);
hr
=
_ILCreateFromPath
W
(
szDest
,
pPidlOut
);
SHChangeNotify
(
bIsFolder
?
SHCNE_RENAMEFOLDER
:
SHCNE_RENAMEITEM
,
SHCNF_PATH
A
,
szSrc
,
szDest
);
SHCNF_PATH
W
,
szSrc
,
szDest
);
return
hr
;
}
...
...
dlls/shell32/shfldr_mycomp.c
View file @
316df99b
...
...
@@ -569,8 +569,15 @@ static HRESULT WINAPI ISF_MyComputer_fnGetDisplayNameOf (IShellFolder2 *iface,
{
if
(
GET_SHGDN_FOR
(
dwFlags
)
==
SHGDN_FORPARSING
)
{
static
const
WCHAR
clsidW
[]
=
{
'C'
,
'L'
,
'S'
,
'I'
,
'D'
,
'\\'
,
0
};
static
const
WCHAR
shellfolderW
[]
=
{
'\\'
,
's'
,
'h'
,
'e'
,
'l'
,
'l'
,
'f'
,
'o'
,
'l'
,
'd'
,
'e'
,
'r'
,
0
};
static
const
WCHAR
wantsForParsingW
[]
=
{
'W'
,
'a'
,
'n'
,
't'
,
's'
,
'F'
,
'o'
,
'r'
,
'P'
,
'a'
,
'r'
,
's'
,
'i'
,
'n'
,
'g'
,
0
};
int
bWantsForParsing
=
FALSE
;
char
szRegPath
[
100
];
WCHAR
szRegPath
[
100
];
LONG
r
;
/*
...
...
@@ -584,11 +591,11 @@ static HRESULT WINAPI ISF_MyComputer_fnGetDisplayNameOf (IShellFolder2 *iface,
* Get the "WantsFORPARSING" flag from the registry
*/
lstrcpy
A
(
szRegPath
,
"CLSID
\\
"
);
SHELL32_GUIDToString
A
(
clsid
,
&
szRegPath
[
6
]);
lstrcat
A
(
szRegPath
,
"
\\
shellfolder"
);
r
=
SHGetValue
A
(
HKEY_CLASSES_ROOT
,
szRegPath
,
"WantsFORPARSING"
,
NULL
,
NULL
,
NULL
);
lstrcpy
W
(
szRegPath
,
clsidW
);
SHELL32_GUIDToString
W
(
clsid
,
&
szRegPath
[
6
]);
lstrcat
W
(
szRegPath
,
shellfolderW
);
r
=
SHGetValue
W
(
HKEY_CLASSES_ROOT
,
szRegPath
,
wantsForParsingW
,
NULL
,
NULL
,
NULL
);
if
(
r
==
ERROR_SUCCESS
)
bWantsForParsing
=
TRUE
;
...
...
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