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
618cf6fc
Commit
618cf6fc
authored
Apr 14, 2004
by
Martin Fuchs
Committed by
Alexandre Julliard
Apr 14, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Return "file not found" error values instead of E_INVALIDARG if
_ILCreateFromPathA() failed to find files.
parent
1cb0cf4c
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
32 additions
and
24 deletions
+32
-24
pidl.c
dlls/shell32/pidl.c
+11
-9
pidl.h
dlls/shell32/pidl.h
+1
-1
shfldr_desktop.c
dlls/shell32/shfldr_desktop.c
+4
-5
shfldr_fs.c
dlls/shell32/shfldr_fs.c
+16
-9
No files found.
dlls/shell32/pidl.c
View file @
618cf6fc
...
...
@@ -1616,19 +1616,21 @@ LPITEMIDLIST _ILCreateFromFindDataA(WIN32_FIND_DATAA * stffile )
return
pidl
;
}
LPITEMIDLIST
_ILCreateFromPathA
(
LPCSTR
szPath
)
HRESULT
_ILCreateFromPathA
(
LPCSTR
szPath
,
LPITEMIDLIST
*
ppidl
)
{
HANDLE
hFile
;
WIN32_FIND_DATAA
stffile
;
LPITEMIDLIST
pidl
=
NULL
;
hFile
=
FindFirstFileA
(
szPath
,
&
stffile
);
if
(
hFile
!=
INVALID_HANDLE_VALUE
)
{
pidl
=
_ILCreateFromFindDataA
(
&
stffile
);
FindClose
(
hFile
);
}
return
pidl
;
if
(
hFile
==
INVALID_HANDLE_VALUE
)
return
HRESULT_FROM_WIN32
(
ERROR_FILE_NOT_FOUND
);
FindClose
(
hFile
);
*
ppidl
=
_ILCreateFromFindDataA
(
&
stffile
);
return
S_OK
;
}
LPITEMIDLIST
_ILCreateDrive
(
LPCSTR
lpszNew
)
...
...
dlls/shell32/pidl.h
View file @
618cf6fc
...
...
@@ -211,7 +211,7 @@ LPITEMIDLIST _ILCreateGuidFromStrA(LPCSTR szGUID);
/* Commonly used PIDLs representing file system objects. */
LPITEMIDLIST
_ILCreateDesktop
(
void
);
LPITEMIDLIST
_ILCreateFromFindDataA
(
WIN32_FIND_DATAA
*
stffile
);
LPITEMIDLIST
_ILCreateFromPathA
(
LPCSTR
szPath
);
HRESULT
_ILCreateFromPathA
(
LPCSTR
szPath
,
LPITEMIDLIST
*
ppidl
);
/* Other helpers */
LPITEMIDLIST
_ILCreateMyComputer
(
void
);
...
...
dlls/shell32/shfldr_desktop.c
View file @
618cf6fc
...
...
@@ -197,7 +197,7 @@ static HRESULT WINAPI ISF_Desktop_fnParseDisplayName (IShellFolder2 * iface,
WCHAR
szElement
[
MAX_PATH
];
LPCWSTR
szNext
=
NULL
;
LPITEMIDLIST
pidlTemp
=
NULL
;
HRESULT
hr
=
E_INVALIDARG
;
HRESULT
hr
=
S_OK
;
char
szPath
[
MAX_PATH
];
DWORD
len
;
CLSID
clsid
;
...
...
@@ -234,7 +234,7 @@ static HRESULT WINAPI ISF_Desktop_fnParseDisplayName (IShellFolder2 * iface,
PathAddBackslashA
(
szPath
);
len
=
lstrlenA
(
szPath
);
WideCharToMultiByte
(
CP_ACP
,
0
,
lpszDisplayName
,
-
1
,
szPath
+
len
,
MAX_PATH
-
len
,
NULL
,
NULL
);
pidlTemp
=
_ILCreateFromPathA
(
szPath
);
hr
=
_ILCreateFromPathA
(
szPath
,
&
pidlTemp
);
}
else
{
pidlTemp
=
_ILCreateMyComputer
();
}
...
...
@@ -242,13 +242,12 @@ static HRESULT WINAPI ISF_Desktop_fnParseDisplayName (IShellFolder2 * iface,
szNext
=
NULL
;
}
if
(
pidlTemp
)
{
if
(
SUCCEEDED
(
hr
)
&&
pidlTemp
)
{
if
(
szNext
&&
*
szNext
)
{
hr
=
SHELL32_ParseNextElement
(
iface
,
hwndOwner
,
pbc
,
&
pidlTemp
,
(
LPOLESTR
)
szNext
,
pchEaten
,
pdwAttributes
);
}
else
{
hr
=
S_OK
;
if
(
pdwAttributes
&&
*
pdwAttributes
)
{
SHELL32_GetItemAttributes
(
_IShellFolder_
(
This
),
pidlTemp
,
pdwAttributes
);
hr
=
SHELL32_GetItemAttributes
(
_IShellFolder_
(
This
),
pidlTemp
,
pdwAttributes
);
}
}
}
...
...
dlls/shell32/shfldr_fs.c
View file @
618cf6fc
...
...
@@ -353,22 +353,22 @@ IShellFolder_fnParseDisplayName (IShellFolder2 * iface,
WideCharToMultiByte
(
CP_ACP
,
0
,
szElement
,
-
1
,
szPath
+
len
,
MAX_PATH
-
len
,
NULL
,
NULL
);
/* get the pidl */
pidlTemp
=
_ILCreateFromPathA
(
szPath
);
if
(
pidlTemp
)
{
hr
=
_ILCreateFromPathA
(
szPath
,
&
pidlTemp
);
if
(
SUCCEEDED
(
hr
))
{
if
(
szNext
&&
*
szNext
)
{
/* try to analyse the next element */
hr
=
SHELL32_ParseNextElement
(
iface
,
hwndOwner
,
pbc
,
&
pidlTemp
,
(
LPOLESTR
)
szNext
,
pchEaten
,
pdwAttributes
);
}
else
{
/* it's the last element */
if
(
pdwAttributes
&&
*
pdwAttributes
)
{
SHELL32_GetItemAttributes
(
_IShellFolder_
(
This
),
pidlTemp
,
pdwAttributes
);
hr
=
SHELL32_GetItemAttributes
(
_IShellFolder_
(
This
),
pidlTemp
,
pdwAttributes
);
}
hr
=
S_OK
;
}
}
}
if
(
!
hr
)
if
(
SUCCEEDED
(
hr
)
)
*
ppidl
=
pidlTemp
;
else
*
ppidl
=
NULL
;
...
...
@@ -748,11 +748,16 @@ static HRESULT WINAPI IShellFolder_fnSetNameOf (IShellFolder2 * iface, HWND hwnd
szDest
[
MAX_PATH
-
1
]
=
0
;
TRACE
(
"src=%s dest=%s
\n
"
,
szSrc
,
szDest
);
if
(
MoveFileA
(
szSrc
,
szDest
))
{
HRESULT
hr
=
S_OK
;
if
(
pPidlOut
)
*
pPidlOut
=
_ILCreateFromPathA
(
szDest
);
hr
=
_ILCreateFromPathA
(
szDest
,
pPidlOut
);
SHChangeNotify
(
bIsFolder
?
SHCNE_RENAMEFOLDER
:
SHCNE_RENAMEITEM
,
SHCNF_PATHA
,
szSrc
,
szDest
);
return
S_OK
;
return
hr
;
}
return
E_FAIL
;
}
...
...
@@ -977,9 +982,11 @@ static HRESULT WINAPI ISFHelper_fnAddFolder (ISFHelper * iface, HWND hwnd, LPCST
bRes
=
CreateDirectoryA
(
lpstrNewDir
,
NULL
);
if
(
bRes
)
{
SHChangeNotify
(
SHCNE_MKDIR
,
SHCNF_PATHA
,
lpstrNewDir
,
NULL
);
if
(
ppidlOut
)
*
ppidlOut
=
_ILCreateFromPathA
(
lpstrNewDir
);
hres
=
S_OK
;
if
(
ppidlOut
)
hres
=
_ILCreateFromPathA
(
lpstrNewDir
,
ppidlOut
);
}
else
{
char
lpstrText
[
128
+
MAX_PATH
];
char
lpstrTempText
[
128
];
...
...
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