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
b791a521
Commit
b791a521
authored
Feb 24, 1999
by
Juergen Schmied
Committed by
Alexandre Julliard
Feb 24, 1999
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Changed pidl structure to match the pidl's used in lnk-files.
parent
671c8846
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
80 additions
and
141 deletions
+80
-141
enumidlist.c
dlls/shell32/enumidlist.c
+2
-4
pidl.c
dlls/shell32/pidl.c
+69
-12
pidl.h
dlls/shell32/pidl.h
+6
-7
shlfolder.c
dlls/shell32/shlfolder.c
+2
-2
shlobj.h
include/shlobj.h
+1
-116
No files found.
dlls/shell32/enumidlist.c
View file @
b791a521
...
...
@@ -258,13 +258,12 @@ static BOOL32 WINAPI IEnumIDList_CreateEnumList(LPENUMIDLIST this, LPCSTR lpszPa
if
(
hFile
!=
INVALID_HANDLE_VALUE32
)
{
do
{
if
(
(
stffile
.
dwFileAttributes
&
FILE_ATTRIBUTE_DIRECTORY
)
&&
strcmp
(
stffile
.
cFileName
,
"."
)
&&
strcmp
(
stffile
.
cFileName
,
".."
))
{
pidl
=
_ILCreateFolder
(
stffile
.
cFileName
);
{
pidl
=
_ILCreateFolder
(
stffile
.
c
AlternateFileName
,
stffile
.
c
FileName
);
if
(
pidl
)
{
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
;
strncpy
(
pData
->
u
.
folder
.
szAlternateName
,
stffile
.
cAlternateFileName
,
14
);
if
(
!
IEnumIDList_AddToEnumList
(
this
,
pidl
))
{
return
FALSE
;
}
...
...
@@ -286,13 +285,12 @@ static BOOL32 WINAPI IEnumIDList_CreateEnumList(LPENUMIDLIST this, LPCSTR lpszPa
if
(
hFile
!=
INVALID_HANDLE_VALUE32
)
{
do
{
if
(
!
(
stffile
.
dwFileAttributes
&
FILE_ATTRIBUTE_DIRECTORY
)
)
{
pidl
=
_ILCreateValue
(
stffile
.
cFileName
);
{
pidl
=
_ILCreateValue
(
stffile
.
c
AlternateFileName
,
stffile
.
c
FileName
);
if
(
pidl
)
{
pData
=
_ILGetDataPointer
(
pidl
);
FileTimeToDosDateTime
(
&
stffile
.
ftLastWriteTime
,
&
pData
->
u
.
file
.
uFileDate
,
&
pData
->
u
.
file
.
uFileTime
);
pData
->
u
.
file
.
dwFileSize
=
stffile
.
nFileSizeLow
;
pData
->
u
.
file
.
uFileAttribs
=
stffile
.
dwFileAttributes
;
strncpy
(
pData
->
u
.
file
.
szAlternateName
,
stffile
.
cAlternateFileName
,
14
);
if
(
!
IEnumIDList_AddToEnumList
(
this
,
pidl
))
{
return
FALSE
;
}
...
...
dlls/shell32/pidl.c
View file @
b791a521
...
...
@@ -28,6 +28,7 @@
void
pdump
(
LPCITEMIDLIST
pidl
)
{
DWORD
type
;
CHAR
*
szData
;
CHAR
*
szShortName
;
LPITEMIDLIST
pidltemp
=
pidl
;
if
(
!
pidltemp
)
{
TRACE
(
pidl
,
"-------- pidl = NULL (Root)
\n
"
);
...
...
@@ -38,8 +39,10 @@ void pdump (LPCITEMIDLIST pidl)
{
do
{
type
=
_ILGetDataPointer
(
pidltemp
)
->
type
;
szData
=
_ILGetTextPointer
(
type
,
_ILGetDataPointer
(
pidltemp
));
szShortName
=
_ILGetSTextPointer
(
type
,
_ILGetDataPointer
(
pidltemp
));
TRACE
(
pidl
,
"---- pidl=%p size=%u type=%lx %s
\n
"
,
pidltemp
,
pidltemp
->
mkid
.
cb
,
type
,
debugstr_a
(
szData
));
TRACE
(
pidl
,
"---- pidl=%p size=%u type=%lx %s, (%s)
\n
"
,
pidltemp
,
pidltemp
->
mkid
.
cb
,
type
,
debugstr_a
(
szData
),
debugstr_a
(
szShortName
));
pidltemp
=
ILGetNext
(
pidltemp
);
}
while
(
pidltemp
->
mkid
.
cb
);
...
...
@@ -509,9 +512,9 @@ LPITEMIDLIST WINAPI SHSimpleIDListFromPath32AW (LPVOID lpszPath)
lpszElement
=
PathFindFilename32A
(
lpszTemp
);
if
(
GetFileAttributes32A
(
lpszTemp
)
&
FILE_ATTRIBUTE_DIRECTORY
)
{
return
_ILCreateFolder
(
lpszElement
);
{
return
_ILCreateFolder
(
NULL
,
lpszElement
);
/*FIXME: fill shortname */
}
return
_ILCreateValue
(
lpszElement
);
return
_ILCreateValue
(
NULL
,
lpszElement
);
/*FIXME: fill shortname */
}
/*************************************************************************
* SHGetDataFromIDListA [SHELL32.247]
...
...
@@ -521,7 +524,7 @@ HRESULT WINAPI SHGetDataFromIDList32A(LPSHELLFOLDER psf, LPCITEMIDLIST pidl, int
{
FIXME
(
shell
,
"sf=%p pidl=%p 0x%04x %p 0x%04x stub
\n
"
,
psf
,
pidl
,
nFormat
,
dest
,
len
);
switch
(
nFormat
)
{
case
SHGDFIL_FINDDATA
:
case
SHGDFIL_NETRESOURCE
:
case
SHGDFIL_NETRESOURCE
:
case
SHGDFIL_DESCRIPTIONID
:
break
;
default:
...
...
@@ -565,13 +568,47 @@ LPITEMIDLIST WINAPI _ILCreateDrive( LPCSTR lpszNew)
TRACE
(
pidl
,
"(%s)
\n
"
,
sTemp
);
return
_ILCreate
(
PT_DRIVE
,(
LPVOID
)
&
sTemp
[
0
],
4
);
}
LPITEMIDLIST
WINAPI
_ILCreateFolder
(
LPCSTR
lpszNew
)
{
TRACE
(
pidl
,
"(%s)
\n
"
,
lpszNew
);
return
_ILCreate
(
PT_FOLDER
,
(
LPVOID
)
lpszNew
,
strlen
(
lpszNew
)
+
1
);
LPITEMIDLIST
WINAPI
_ILCreateFolder
(
LPCSTR
lpszShortName
,
LPCSTR
lpszName
)
{
char
buff
[
MAX_PATH
];
char
*
pbuff
=
buff
;
ULONG
len
,
len1
;
TRACE
(
pidl
,
"(%s, %s)
\n
"
,
lpszShortName
,
lpszName
);
len
=
strlen
(
lpszName
)
+
1
;
memcpy
(
pbuff
,
lpszName
,
len
);
pbuff
+=
len
;
if
(
lpszShortName
)
{
len1
=
strlen
(
lpszShortName
)
+
1
;
memcpy
(
pbuff
,
lpszShortName
,
len1
);
}
else
{
len1
=
1
;
*
pbuff
=
0x00
;
}
return
_ILCreate
(
PT_FOLDER
,
(
LPVOID
)
buff
,
len
+
len1
);
}
LPITEMIDLIST
WINAPI
_ILCreateValue
(
LPCSTR
lpszNew
)
{
TRACE
(
pidl
,
"(%s)
\n
"
,
lpszNew
);
return
_ILCreate
(
PT_VALUE
,
(
LPVOID
)
lpszNew
,
strlen
(
lpszNew
)
+
1
);
LPITEMIDLIST
WINAPI
_ILCreateValue
(
LPCSTR
lpszShortName
,
LPCSTR
lpszName
)
{
char
buff
[
MAX_PATH
];
char
*
pbuff
=
buff
;
ULONG
len
,
len1
;
TRACE
(
pidl
,
"(%s, %s)
\n
"
,
lpszShortName
,
lpszName
);
len
=
strlen
(
lpszName
)
+
1
;
memcpy
(
pbuff
,
lpszName
,
len
);
pbuff
+=
len
;
if
(
lpszShortName
)
{
len1
=
strlen
(
lpszShortName
)
+
1
;
memcpy
(
pbuff
,
lpszShortName
,
len1
);
}
else
{
len1
=
1
;
*
pbuff
=
0x00
;
}
return
_ILCreate
(
PT_VALUE
,
(
LPVOID
)
buff
,
len
+
len1
);
}
/**************************************************************************
...
...
@@ -926,7 +963,7 @@ LPPIDLDATA WINAPI _ILGetDataPointer(LPITEMIDLIST pidl)
}
/**************************************************************************
* _ILGetTextPointer()
* gets a pointer to the string stored in the pidl
* gets a pointer to the
long filename
string stored in the pidl
*/
LPSTR
WINAPI
_ILGetTextPointer
(
PIDLTYPE
type
,
LPPIDLDATA
pidldata
)
{
/* TRACE(pidl,"(type=%x data=%p)\n", type, pidldata);*/
...
...
@@ -940,7 +977,27 @@ LPSTR WINAPI _ILGetTextPointer(PIDLTYPE type, LPPIDLDATA pidldata)
case
PT_MYCOMP
:
case
PT_FOLDER
:
case
PT_VALUE
:
return
(
LPSTR
)
&
(
pidldata
->
u
.
file
.
szText
);
return
(
LPSTR
)
&
(
pidldata
->
u
.
file
.
szNames
);
}
return
NULL
;
}
/**************************************************************************
* _ILGetSTextPointer()
* gets a pointer to the long filename string stored in the pidl
*/
LPSTR
WINAPI
_ILGetSTextPointer
(
PIDLTYPE
type
,
LPPIDLDATA
pidldata
)
{
/* TRACE(pidl,"(type=%x data=%p)\n", type, pidldata);*/
if
(
!
pidldata
)
{
return
NULL
;
}
switch
(
type
)
{
case
PT_MYCOMP
:
case
PT_DRIVE
:
return
NULL
;
case
PT_FOLDER
:
case
PT_VALUE
:
return
(
LPSTR
)(
pidldata
->
u
.
file
.
szNames
+
strlen
(
pidldata
->
u
.
file
.
szNames
)
+
1
);
}
return
NULL
;
}
...
...
dlls/shell32/pidl.h
View file @
b791a521
...
...
@@ -60,11 +60,9 @@ typedef struct tagPIDLDATA
WORD
uFileDate
;
/*06*/
WORD
uFileTime
;
/*08*/
WORD
uFileAttribs
;
/*10*/
/* end of MS compatible. Here are comming just one or two
strings. The first is the long name. The second the dos name
when needed. */
CHAR
szAlternateName
[
14
];
/* the 8.3 Name*/
CHAR
szText
[
1
];
/* last entry, variable size */
CHAR
szNames
[
1
];
/*12*/
/* Here are comming two strings. The first is the long name.
The second the dos name when needed or just 0x00 */
}
file
,
folder
,
generic
;
}
u
;
}
PIDLDATA
,
*
LPPIDLDATA
;
...
...
@@ -104,8 +102,8 @@ BOOL32 WINAPI _ILIsValue(LPCITEMIDLIST);
LPITEMIDLIST
WINAPI
_ILCreateDesktop
(
void
);
LPITEMIDLIST
WINAPI
_ILCreateMyComputer
(
void
);
LPITEMIDLIST
WINAPI
_ILCreateDrive
(
LPCSTR
);
LPITEMIDLIST
WINAPI
_ILCreateFolder
(
LPCSTR
);
LPITEMIDLIST
WINAPI
_ILCreateValue
(
LPCSTR
);
LPITEMIDLIST
WINAPI
_ILCreateFolder
(
LPCSTR
,
LPCSTR
);
LPITEMIDLIST
WINAPI
_ILCreateValue
(
LPCSTR
,
LPCSTR
);
/*
* raw pidl handling (binary)
...
...
@@ -120,6 +118,7 @@ LPITEMIDLIST WINAPI _ILCreate(PIDLTYPE,LPVOID,UINT16);
*/
LPPIDLDATA
WINAPI
_ILGetDataPointer
(
LPCITEMIDLIST
);
LPSTR
WINAPI
_ILGetTextPointer
(
PIDLTYPE
type
,
LPPIDLDATA
pidldata
);
LPSTR
WINAPI
_ILGetSTextPointer
(
PIDLTYPE
type
,
LPPIDLDATA
pidldata
);
void
pdump
(
LPCITEMIDLIST
pidl
);
#endif
dlls/shell32/shlfolder.c
View file @
b791a521
...
...
@@ -424,10 +424,10 @@ static HRESULT WINAPI IShellFolder_ParseDisplayName(
if
(
pidlFull
)
{
while
((
pszNext
=
GetNextElement
(
pszNext
,
szElement
,
MAX_PATH
)))
{
if
(
!*
pszNext
&&
bIsFile
)
{
pidlTemp
=
_ILCreateValue
(
szElement
);
{
pidlTemp
=
_ILCreateValue
(
NULL
,
szElement
);
/* FIXME: shortname */
}
else
{
pidlTemp
=
_ILCreateFolder
(
szElement
);
{
pidlTemp
=
_ILCreateFolder
(
NULL
,
szElement
);
/* FIXME: shortname */
}
pidlOld
=
pidlFull
;
pidlFull
=
ILCombine
(
pidlFull
,
pidlTemp
);
...
...
include/shlobj.h
View file @
b791a521
...
...
@@ -3,6 +3,7 @@
#include "wintypes.h"
#include "wine/obj_base.h"
#include "wine/obj_shelllink.h"
#include "shell.h"
#include "oleobj.h"
#include "commctrl.h"
...
...
@@ -688,122 +689,6 @@ struct tagCOMMDLGBROWSER
DWORD
ref
;
};
#undef THIS
/****************************************************************************
* IShellLink interface
*/
#define THIS LPSHELLLINK this
/* IShellLink::Resolve fFlags */
typedef
enum
{
SLR_NO_UI
=
0x0001
,
SLR_ANY_MATCH
=
0x0002
,
SLR_UPDATE
=
0x0004
}
SLR_FLAGS
;
/* IShellLink::GetPath fFlags */
typedef
enum
{
SLGP_SHORTPATH
=
0x0001
,
SLGP_UNCPRIORITY
=
0x0002
}
SLGP_FLAGS
;
typedef
struct
IShellLink
IShellLink
,
*
LPSHELLLINK
;
typedef
struct
IShellLink_VTable
{
/* *** IUnknown methods *** */
STDMETHOD
(
QueryInterface
)
(
THIS_
REFIID
riid
,
LPVOID
*
ppvObj
)
PURE
;
STDMETHOD_
(
ULONG
,
AddRef
)
(
THIS
)
PURE
;
STDMETHOD_
(
ULONG
,
Release
)
(
THIS
)
PURE
;
STDMETHOD
(
GetPath
)(
THIS_
LPSTR
pszFile
,
INT32
cchMaxPath
,
WIN32_FIND_DATA32A
*
pfd
,
DWORD
fFlags
)
PURE
;
STDMETHOD
(
GetIDList
)(
THIS_
LPITEMIDLIST
*
ppidl
)
PURE
;
STDMETHOD
(
SetIDList
)(
THIS_
LPCITEMIDLIST
pidl
)
PURE
;
STDMETHOD
(
GetDescription
)(
THIS_
LPSTR
pszName
,
INT32
cchMaxName
)
PURE
;
STDMETHOD
(
SetDescription
)(
THIS_
LPCSTR
pszName
)
PURE
;
STDMETHOD
(
GetWorkingDirectory
)(
THIS_
LPSTR
pszDir
,
INT32
cchMaxPath
)
PURE
;
STDMETHOD
(
SetWorkingDirectory
)(
THIS_
LPCSTR
pszDir
)
PURE
;
STDMETHOD
(
GetArguments
)(
THIS_
LPSTR
pszArgs
,
INT32
cchMaxPath
)
PURE
;
STDMETHOD
(
SetArguments
)(
THIS_
LPCSTR
pszArgs
)
PURE
;
STDMETHOD
(
GetHotkey
)(
THIS_
WORD
*
pwHotkey
)
PURE
;
STDMETHOD
(
SetHotkey
)(
THIS_
WORD
wHotkey
)
PURE
;
STDMETHOD
(
GetShowCmd
)(
THIS_
INT32
*
piShowCmd
)
PURE
;
STDMETHOD
(
SetShowCmd
)(
THIS_
INT32
iShowCmd
)
PURE
;
STDMETHOD
(
GetIconLocation
)(
THIS_
LPSTR
pszIconPath
,
INT32
cchIconPath
,
INT32
*
piIcon
)
PURE
;
STDMETHOD
(
SetIconLocation
)(
THIS_
LPCSTR
pszIconPath
,
INT32
iIcon
)
PURE
;
STDMETHOD
(
SetRelativePath
)(
THIS_
LPCSTR
pszPathRel
,
DWORD
dwReserved
)
PURE
;
STDMETHOD
(
Resolve
)(
THIS_
HWND32
hwnd
,
DWORD
fFlags
)
PURE
;
STDMETHOD
(
SetPath
)(
THIS_
LPCSTR
pszFile
)
PURE
;
}
IShellLink_VTable
,
*
LPSHELLLINK_VTABLE
;
struct
IShellLink
{
LPSHELLLINK_VTABLE
lpvtbl
;
DWORD
ref
;
/* IPersistfile interface */
LPPERSISTFILE
lppf
;
};
#define IShellLinkA IShellLink
#undef THIS
#define THIS LPSHELLLINKW this
typedef
struct
IShellLinkW
IShellLinkW
,
*
LPSHELLLINKW
;
typedef
struct
IShellLinkW_VTable
{
/* *** IUnknown methods *** */
STDMETHOD
(
QueryInterface
)
(
THIS_
REFIID
riid
,
LPVOID
*
ppvObj
)
PURE
;
STDMETHOD_
(
ULONG
,
AddRef
)
(
THIS
)
PURE
;
STDMETHOD_
(
ULONG
,
Release
)
(
THIS
)
PURE
;
STDMETHOD
(
GetPath
)(
THIS_
LPWSTR
pszFile
,
INT32
cchMaxPath
,
WIN32_FIND_DATA32A
*
pfd
,
DWORD
fFlags
)
PURE
;
STDMETHOD
(
GetIDList
)(
THIS_
LPITEMIDLIST
*
ppidl
)
PURE
;
STDMETHOD
(
SetIDList
)(
THIS_
LPCITEMIDLIST
pidl
)
PURE
;
STDMETHOD
(
GetDescription
)(
THIS_
LPWSTR
pszName
,
INT32
cchMaxName
)
PURE
;
STDMETHOD
(
SetDescription
)(
THIS_
LPCWSTR
pszName
)
PURE
;
STDMETHOD
(
GetWorkingDirectory
)(
THIS_
LPWSTR
pszDir
,
INT32
cchMaxPath
)
PURE
;
STDMETHOD
(
SetWorkingDirectory
)(
THIS_
LPCWSTR
pszDir
)
PURE
;
STDMETHOD
(
GetArguments
)(
THIS_
LPWSTR
pszArgs
,
INT32
cchMaxPath
)
PURE
;
STDMETHOD
(
SetArguments
)(
THIS_
LPCWSTR
pszArgs
)
PURE
;
STDMETHOD
(
GetHotkey
)(
THIS_
WORD
*
pwHotkey
)
PURE
;
STDMETHOD
(
SetHotkey
)(
THIS_
WORD
wHotkey
)
PURE
;
STDMETHOD
(
GetShowCmd
)(
THIS_
INT32
*
piShowCmd
)
PURE
;
STDMETHOD
(
SetShowCmd
)(
THIS_
INT32
iShowCmd
)
PURE
;
STDMETHOD
(
GetIconLocation
)(
THIS_
LPWSTR
pszIconPath
,
INT32
cchIconPath
,
INT32
*
piIcon
)
PURE
;
STDMETHOD
(
SetIconLocation
)(
THIS_
LPCWSTR
pszIconPath
,
INT32
iIcon
)
PURE
;
STDMETHOD
(
SetRelativePath
)(
THIS_
LPCWSTR
pszPathRel
,
DWORD
dwReserved
)
PURE
;
STDMETHOD
(
Resolve
)(
THIS_
HWND32
hwnd
,
DWORD
fFlags
)
PURE
;
STDMETHOD
(
SetPath
)(
THIS_
LPCWSTR
pszFile
)
PURE
;
}
IShellLinkW_VTable
,
*
LPSHELLLINKW_VTABLE
;
struct
IShellLinkW
{
LPSHELLLINKW_VTABLE
lpvtbl
;
DWORD
ref
;
/* IPersistfile interface */
LPPERSISTFILE
lppf
;
};
#undef THIS
/****************************************************************************
* IExtractIconinterface
...
...
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