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
5b0b56fa
Commit
5b0b56fa
authored
Jul 22, 2010
by
David Hedberg
Committed by
Alexandre Julliard
Jul 23, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shell32: Implement SHCreateItemFromParsingName.
parent
b43bcdf5
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
73 additions
and
0 deletions
+73
-0
shell32.spec
dlls/shell32/shell32.spec
+1
-0
shellitem.c
dlls/shell32/shellitem.c
+27
-0
shlfolder.c
dlls/shell32/tests/shlfolder.c
+44
-0
shobjidl.idl
include/shobjidl.idl
+1
-0
No files found.
dlls/shell32/shell32.spec
View file @
5b0b56fa
...
@@ -330,6 +330,7 @@
...
@@ -330,6 +330,7 @@
@ stub SHChangeNotifySuspendResume
@ stub SHChangeNotifySuspendResume
@ stdcall SHCreateDirectoryExA(long str ptr)
@ stdcall SHCreateDirectoryExA(long str ptr)
@ stdcall SHCreateDirectoryExW(long wstr ptr)
@ stdcall SHCreateDirectoryExW(long wstr ptr)
@ stdcall SHCreateItemFromParsingName(wstr ptr ptr ptr)
@ stub SHCreateProcessAsUserW
@ stub SHCreateProcessAsUserW
@ stdcall SHCreateShellItem(ptr ptr ptr ptr)
@ stdcall SHCreateShellItem(ptr ptr ptr ptr)
@ stdcall SHEmptyRecycleBinA(long str long)
@ stdcall SHEmptyRecycleBinA(long str long)
...
...
dlls/shell32/shellitem.c
View file @
5b0b56fa
...
@@ -392,3 +392,30 @@ HRESULT WINAPI SHCreateShellItem(LPCITEMIDLIST pidlParent,
...
@@ -392,3 +392,30 @@ HRESULT WINAPI SHCreateShellItem(LPCITEMIDLIST pidlParent,
}
}
return
ret
;
return
ret
;
}
}
HRESULT
WINAPI
SHCreateItemFromParsingName
(
PCWSTR
pszPath
,
IBindCtx
*
pbc
,
REFIID
riid
,
void
**
ppv
)
{
LPITEMIDLIST
pidl
;
HRESULT
ret
;
*
ppv
=
NULL
;
ret
=
SHParseDisplayName
(
pszPath
,
pbc
,
&
pidl
,
0
,
NULL
);
if
(
SUCCEEDED
(
ret
))
{
ShellItem
*
This
;
ret
=
IShellItem_Constructor
(
NULL
,
riid
,
(
void
**
)
&
This
);
if
(
SUCCEEDED
(
ret
))
{
This
->
pidl
=
pidl
;
*
ppv
=
(
void
*
)
This
;
}
else
{
ILFree
(
pidl
);
}
}
return
ret
;
}
dlls/shell32/tests/shlfolder.c
View file @
5b0b56fa
...
@@ -53,6 +53,7 @@ static HRESULT (WINAPI *pStrRetToBufW)(STRRET*,LPCITEMIDLIST,LPWSTR,UINT);
...
@@ -53,6 +53,7 @@ static HRESULT (WINAPI *pStrRetToBufW)(STRRET*,LPCITEMIDLIST,LPWSTR,UINT);
static
LPITEMIDLIST
(
WINAPI
*
pILFindLastID
)(
LPCITEMIDLIST
);
static
LPITEMIDLIST
(
WINAPI
*
pILFindLastID
)(
LPCITEMIDLIST
);
static
void
(
WINAPI
*
pILFree
)(
LPITEMIDLIST
);
static
void
(
WINAPI
*
pILFree
)(
LPITEMIDLIST
);
static
BOOL
(
WINAPI
*
pILIsEqual
)(
LPCITEMIDLIST
,
LPCITEMIDLIST
);
static
BOOL
(
WINAPI
*
pILIsEqual
)(
LPCITEMIDLIST
,
LPCITEMIDLIST
);
static
HRESULT
(
WINAPI
*
pSHCreateItemFromParsingName
)(
PCWSTR
,
IBindCtx
*
,
REFIID
,
void
**
);
static
HRESULT
(
WINAPI
*
pSHCreateShellItem
)(
LPCITEMIDLIST
,
IShellFolder
*
,
LPCITEMIDLIST
,
IShellItem
**
);
static
HRESULT
(
WINAPI
*
pSHCreateShellItem
)(
LPCITEMIDLIST
,
IShellFolder
*
,
LPCITEMIDLIST
,
IShellItem
**
);
static
LPITEMIDLIST
(
WINAPI
*
pILCombine
)(
LPCITEMIDLIST
,
LPCITEMIDLIST
);
static
LPITEMIDLIST
(
WINAPI
*
pILCombine
)(
LPCITEMIDLIST
,
LPCITEMIDLIST
);
static
HRESULT
(
WINAPI
*
pSHParseDisplayName
)(
LPCWSTR
,
IBindCtx
*
,
LPITEMIDLIST
*
,
SFGAOF
,
SFGAOF
*
);
static
HRESULT
(
WINAPI
*
pSHParseDisplayName
)(
LPCWSTR
,
IBindCtx
*
,
LPITEMIDLIST
*
,
SFGAOF
,
SFGAOF
*
);
...
@@ -69,6 +70,7 @@ static void init_function_pointers(void)
...
@@ -69,6 +70,7 @@ static void init_function_pointers(void)
#define MAKEFUNC(f) (p##f = (void*)GetProcAddress(hmod, #f))
#define MAKEFUNC(f) (p##f = (void*)GetProcAddress(hmod, #f))
MAKEFUNC
(
SHBindToParent
);
MAKEFUNC
(
SHBindToParent
);
MAKEFUNC
(
SHCreateItemFromParsingName
);
MAKEFUNC
(
SHCreateShellItem
);
MAKEFUNC
(
SHCreateShellItem
);
MAKEFUNC
(
SHGetFolderPathA
);
MAKEFUNC
(
SHGetFolderPathA
);
MAKEFUNC
(
SHGetFolderPathAndSubDirA
);
MAKEFUNC
(
SHGetFolderPathAndSubDirA
);
...
@@ -1867,6 +1869,7 @@ static void test_SHCreateShellItem(void)
...
@@ -1867,6 +1869,7 @@ static void test_SHCreateShellItem(void)
HRESULT
ret
;
HRESULT
ret
;
char
curdirA
[
MAX_PATH
];
char
curdirA
[
MAX_PATH
];
WCHAR
curdirW
[
MAX_PATH
];
WCHAR
curdirW
[
MAX_PATH
];
WCHAR
fnbufW
[
MAX_PATH
];
IShellFolder
*
desktopfolder
=
NULL
,
*
currentfolder
=
NULL
;
IShellFolder
*
desktopfolder
=
NULL
,
*
currentfolder
=
NULL
;
static
WCHAR
testfileW
[]
=
{
't'
,
'e'
,
's'
,
't'
,
'f'
,
'i'
,
'l'
,
'e'
,
0
};
static
WCHAR
testfileW
[]
=
{
't'
,
'e'
,
's'
,
't'
,
'f'
,
'i'
,
'l'
,
'e'
,
0
};
...
@@ -2035,6 +2038,47 @@ static void test_SHCreateShellItem(void)
...
@@ -2035,6 +2038,47 @@ static void test_SHCreateShellItem(void)
IShellItem_Release
(
shellitem
);
IShellItem_Release
(
shellitem
);
}
}
/* SHCreateItemFromParsingName */
if
(
pSHCreateItemFromParsingName
)
{
if
(
0
)
{
/* Crashes under windows 7 */
ret
=
pSHCreateItemFromParsingName
(
NULL
,
NULL
,
&
IID_IShellItem
,
NULL
);
}
shellitem
=
(
void
*
)
0xdeadbeef
;
ret
=
pSHCreateItemFromParsingName
(
NULL
,
NULL
,
&
IID_IShellItem
,
(
void
**
)
&
shellitem
);
ok
(
ret
==
E_INVALIDARG
,
"SHCreateItemFromParsingName returned %x
\n
"
,
ret
);
ok
(
shellitem
==
NULL
,
"shellitem was %p.
\n
"
,
shellitem
);
ret
=
pSHCreateItemFromParsingName
(
testfileW
,
NULL
,
&
IID_IShellItem
,
(
void
**
)
&
shellitem
);
ok
(
ret
==
HRESULT_FROM_WIN32
(
ERROR_FILE_NOT_FOUND
),
"SHCreateItemFromParsingName returned %x
\n
"
,
ret
);
if
(
SUCCEEDED
(
ret
))
IShellItem_Release
(
shellitem
);
lstrcpyW
(
fnbufW
,
curdirW
);
myPathAddBackslashW
(
fnbufW
);
lstrcatW
(
fnbufW
,
testfileW
);
ret
=
pSHCreateItemFromParsingName
(
fnbufW
,
NULL
,
&
IID_IShellItem
,
(
void
**
)
&
shellitem
);
ok
(
ret
==
S_OK
,
"SHCreateItemFromParsingName returned %x
\n
"
,
ret
);
if
(
SUCCEEDED
(
ret
))
{
LPWSTR
tmp_fname
;
ret
=
IShellItem_GetDisplayName
(
shellitem
,
SIGDN_FILESYSPATH
,
&
tmp_fname
);
ok
(
ret
==
S_OK
,
"GetDisplayName returned %x
\n
"
,
ret
);
if
(
SUCCEEDED
(
ret
))
{
ok
(
!
lstrcmpW
(
fnbufW
,
tmp_fname
),
"strings not equal
\n
"
);
CoTaskMemFree
(
tmp_fname
);
}
IShellItem_Release
(
shellitem
);
}
}
else
win_skip
(
"No SHCreateItemFromParsingName
\n
"
);
DeleteFileA
(
".
\\
testfile"
);
DeleteFileA
(
".
\\
testfile"
);
pILFree
(
pidl_abstestfile
);
pILFree
(
pidl_abstestfile
);
pILFree
(
pidl_testfile
);
pILFree
(
pidl_testfile
);
...
...
include/shobjidl.idl
View file @
5b0b56fa
...
@@ -495,6 +495,7 @@ interface IShellItemArray : IUnknown
...
@@ -495,6 +495,7 @@ interface IShellItemArray : IUnknown
}
}
cpp_quote
(
"HRESULT WINAPI SHGetNameFromIDList(PCIDLIST_ABSOLUTE pidl, SIGDN sigdnName, PWSTR *ppszName);"
)
cpp_quote
(
"HRESULT WINAPI SHGetNameFromIDList(PCIDLIST_ABSOLUTE pidl, SIGDN sigdnName, PWSTR *ppszName);"
)
cpp_quote
(
"HRESULT WINAPI SHCreateItemFromParsingName(PCWSTR pszPath, IBindCtx *pbc, REFIID riid, void **ppv);"
)
/*****************************************************************************
/*****************************************************************************
*
IShellItemFilter
interface
*
IShellItemFilter
interface
...
...
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