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
1c481f3d
Commit
1c481f3d
authored
Mar 26, 2003
by
Rolf Kalbermatter
Committed by
Alexandre Julliard
Mar 26, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add new helper function to create a relative file or folder ItemIDList
for a path and change usage of SHSimpleIDListFromPath to call new function instead.
parent
b59bf98b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
24 deletions
+34
-24
pidl.c
dlls/shell32/pidl.c
+19
-1
pidl.h
dlls/shell32/pidl.h
+3
-1
shfldr_fs.c
dlls/shell32/shfldr_fs.c
+12
-22
No files found.
dlls/shell32/pidl.c
View file @
1c481f3d
...
...
@@ -1116,7 +1116,7 @@ LPITEMIDLIST _ILCreateFolder( WIN32_FIND_DATAA * stffile )
pData
=
_ILGetDataPointer
(
pidl
);
FileTimeToDosDateTime
(
&
(
stffile
->
ftLastWriteTime
),
&
pData
->
u
.
folder
.
uFileDate
,
&
pData
->
u
.
folder
.
uFileTime
);
pData
->
u
.
folder
.
dwFileSize
=
stffile
->
nFileSizeLow
;
pData
->
u
.
folder
.
uFileAttribs
=
stffile
->
dwFileAttributes
;
pData
->
u
.
folder
.
uFileAttribs
=
stffile
->
dwFileAttributes
;
}
return
pidl
;
...
...
@@ -1162,6 +1162,24 @@ LPITEMIDLIST _ILCreateValue(WIN32_FIND_DATAA * stffile)
return
pidl
;
}
LPITEMIDLIST
_ILCreateFromPathA
(
LPCSTR
szPath
)
{
HANDLE
hFile
;
WIN32_FIND_DATAA
stffile
;
LPITEMIDLIST
pidl
=
NULL
;
hFile
=
FindFirstFileA
(
szPath
,
&
stffile
);
if
(
hFile
!=
INVALID_HANDLE_VALUE
)
{
if
(
stffile
.
dwFileAttributes
&
FILE_ATTRIBUTE_DIRECTORY
)
pidl
=
_ILCreateFolder
(
&
stffile
);
else
pidl
=
_ILCreateValue
(
&
stffile
);
FindClose
(
hFile
);
}
return
pidl
;
}
LPITEMIDLIST
_ILCreateSpecial
(
LPCSTR
szGUID
)
{
IID
iid
;
...
...
dlls/shell32/pidl.h
View file @
1c481f3d
...
...
@@ -58,7 +58,8 @@
* drive 0x2F drive (lnk/persistant)
* folder/file 0x30 folder/file (1) (lnk/persistant)
* folder 0x31 folder (usual)
* value 0x32 file (usual)
* valueA 0x32 file (ANSI file name)
* valueW 0x34 file (Unicode file name)
* workgroup 0x41 network (3)
* computer 0x42 network (4)
* whole network 0x47 network (5)
...
...
@@ -174,6 +175,7 @@ LPITEMIDLIST _ILCreateDrive (LPCSTR);
LPITEMIDLIST
_ILCreateFolder
(
WIN32_FIND_DATAA
*
stffile
);
LPITEMIDLIST
_ILCreateValue
(
WIN32_FIND_DATAA
*
stffile
);
LPITEMIDLIST
_ILCreateSpecial
(
LPCSTR
szGUID
);
LPITEMIDLIST
_ILCreateFromPathA
(
LPCSTR
szPath
);
/*
* helper functions (getting struct-pointer)
...
...
dlls/shell32/shfldr_fs.c
View file @
1c481f3d
...
...
@@ -324,9 +324,9 @@ IShellFolder_fnParseDisplayName (IShellFolder2 * iface,
HRESULT
hr
=
E_OUTOFMEMORY
;
LPCWSTR
szNext
=
NULL
;
WCHAR
szElement
[
MAX_PATH
];
CHAR
szTempA
[
MAX_PATH
],
szPath
[
MAX_PATH
];
CHAR
szPath
[
MAX_PATH
];
LPITEMIDLIST
pidlTemp
=
NULL
;
DWORD
len
;
TRACE
(
"(%p)->(HWND=%p,%p,%p=%s,%p,pidl=%p,%p)
\n
"
,
This
,
hwndOwner
,
pbcReserved
,
lpszDisplayName
,
debugstr_w
(
lpszDisplayName
),
pchEaten
,
ppidl
,
pdwAttributes
);
...
...
@@ -342,14 +342,13 @@ IShellFolder_fnParseDisplayName (IShellFolder2 * iface,
szNext
=
GetNextElementW
(
lpszDisplayName
,
szElement
,
MAX_PATH
);
/* build the full pathname to the element */
WideCharToMultiByte
(
CP_ACP
,
0
,
szElement
,
-
1
,
szTempA
,
MAX_PATH
,
NULL
,
NULL
);
lstrcpyA
(
szPath
,
This
->
sPathTarget
);
PathAddBackslashA
(
szPath
);
lstrcatA
(
szPath
,
szTempA
);
lstrcpyA
(
szPath
,
This
->
sPathTarget
);
PathAddBackslashA
(
szPath
);
len
=
lstrlenA
(
szPath
);
WideCharToMultiByte
(
CP_ACP
,
0
,
szElement
,
-
1
,
szPath
+
len
,
MAX_PATH
-
len
,
NULL
,
NULL
);
/* get the pidl */
pidlTemp
=
SHSimpleIDListFromPathA
(
szPath
);
pidlTemp
=
_ILCreateFromPathA
(
szPath
);
if
(
pidlTemp
)
{
if
(
szNext
&&
*
szNext
)
{
/* try to analyse the next element */
...
...
@@ -696,6 +695,7 @@ static HRESULT WINAPI IShellFolder_fnSetNameOf (IShellFolder2 * iface, HWND hwnd
len
=
strlen
(
szSrc
);
_ILSimpleGetText
(
pidl
,
szSrc
+
len
,
MAX_PATH
-
len
);
}
else
{
/* FIXME: Can this work with a simple PIDL? */
SHGetPathFromIDListA
(
pidl
,
szSrc
);
}
...
...
@@ -708,7 +708,7 @@ static HRESULT WINAPI IShellFolder_fnSetNameOf (IShellFolder2 * iface, HWND hwnd
TRACE
(
"src=%s dest=%s
\n
"
,
szSrc
,
szDest
);
if
(
MoveFileA
(
szSrc
,
szDest
))
{
if
(
pPidlOut
)
*
pPidlOut
=
SHSimpleIDListFromPathA
(
szDest
);
*
pPidlOut
=
_ILCreateFromPathA
(
szDest
);
SHChangeNotify
(
bIsFolder
?
SHCNE_RENAMEFOLDER
:
SHCNE_RENAMEITEM
,
SHCNF_PATHA
,
szSrc
,
szDest
);
return
S_OK
;
}
...
...
@@ -931,23 +931,13 @@ static HRESULT WINAPI ISFHelper_fnAddFolder (ISFHelper * iface, HWND hwnd, LPCST
TRACE
(
"(%p)(%s %p)
\n
"
,
This
,
lpName
,
ppidlOut
);
strcpy
(
lpstrNewDir
,
This
->
sPathTarget
);
PathAddBackslashA
(
lpstrNewDir
);
strcat
(
lpstrNewDir
,
lpName
);
PathAppendA
(
lpstrNewDir
,
lpName
);
bRes
=
CreateDirectoryA
(
lpstrNewDir
,
NULL
);
if
(
bRes
)
{
LPITEMIDLIST
pidl
,
pidlitem
;
pidlitem
=
SHSimpleIDListFromPathA
(
lpstrNewDir
);
pidl
=
ILCombine
(
This
->
pidlRoot
,
pidlitem
);
SHChangeNotify
(
SHCNE_MKDIR
,
SHCNF_IDLIST
,
pidl
,
NULL
);
SHFree
(
pidl
);
SHChangeNotify
(
SHCNE_MKDIR
,
SHCNF_PATHA
,
lpstrNewDir
,
NULL
);
if
(
ppidlOut
)
*
ppidlOut
=
pidlitem
;
*
ppidlOut
=
_ILCreateFromPathA
(
lpstrNewDir
)
;
hres
=
S_OK
;
}
else
{
char
lpstrText
[
128
+
MAX_PATH
];
...
...
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