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
c0db9e57
Commit
c0db9e57
authored
Apr 09, 2007
by
Aric Stewart
Committed by
Alexandre Julliard
Apr 11, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shell32: Update the debug functions to handle Unicode value pidl.
Add _ILIsUnicode as a simple pidl test.
parent
3533be81
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
112 additions
and
0 deletions
+112
-0
debughlp.c
dlls/shell32/debughlp.c
+101
-0
pidl.c
dlls/shell32/pidl.c
+10
-0
pidl.h
dlls/shell32/pidl.h
+1
-0
No files found.
dlls/shell32/debughlp.c
View file @
c0db9e57
...
...
@@ -104,6 +104,51 @@ LPSTR _dbg_ILGetTextPointer(LPCITEMIDLIST pidl)
}
static
LPWSTR
_dbg_ILGetTextPointerW
(
LPCITEMIDLIST
pidl
)
{
LPPIDLDATA
pdata
=
_dbg_ILGetDataPointer
(
pidl
);
if
(
pdata
)
{
switch
(
pdata
->
type
)
{
case
PT_GUID
:
case
PT_SHELLEXT
:
case
PT_YAGUID
:
return
NULL
;
case
PT_DRIVE
:
case
PT_DRIVE1
:
case
PT_DRIVE2
:
case
PT_DRIVE3
:
/* return (LPSTR)&(pdata->u.drive.szDriveName);*/
return
NULL
;
case
PT_FOLDER
:
case
PT_FOLDER1
:
case
PT_VALUE
:
case
PT_IESPECIAL1
:
case
PT_IESPECIAL2
:
/* return (LPSTR)&(pdata->u.file.szNames); */
return
NULL
;
case
PT_WORKGRP
:
case
PT_COMP
:
case
PT_NETWORK
:
case
PT_NETPROVIDER
:
case
PT_SHARE
:
/* return (LPSTR)&(pdata->u.network.szNames); */
return
NULL
;
case
PT_VALUEW
:
return
(
LPWSTR
)
&
(
pdata
->
u
.
file
.
szNames
);
}
}
return
NULL
;
}
static
LPSTR
_dbg_ILGetSTextPointer
(
LPCITEMIDLIST
pidl
)
{
LPPIDLDATA
pdata
=
_dbg_ILGetDataPointer
(
pidl
);
...
...
@@ -126,6 +171,34 @@ LPSTR _dbg_ILGetSTextPointer(LPCITEMIDLIST pidl)
}
static
LPWSTR
_dbg_ILGetSTextPointerW
(
LPCITEMIDLIST
pidl
)
{
LPPIDLDATA
pdata
=
_dbg_ILGetDataPointer
(
pidl
);
if
(
pdata
)
{
switch
(
pdata
->
type
)
{
case
PT_FOLDER
:
case
PT_VALUE
:
case
PT_IESPECIAL1
:
case
PT_IESPECIAL2
:
/*return (LPSTR)(pdata->u.file.szNames + strlen (pdata->u.file.szNames) + 1); */
return
NULL
;
case
PT_WORKGRP
:
/* return (LPSTR)(pdata->u.network.szNames + strlen (pdata->u.network.szNames) + 1); */
return
NULL
;
case
PT_VALUEW
:
return
(
LPWSTR
)(
pdata
->
u
.
file
.
szNames
+
lstrlenW
((
LPWSTR
)
pdata
->
u
.
file
.
szNames
)
+
1
);
}
}
return
NULL
;
}
static
IID
*
_dbg_ILGetGUIDPointer
(
LPCITEMIDLIST
pidl
)
{
LPPIDLDATA
pdata
=
_ILGetDataPointer
(
pidl
);
...
...
@@ -147,6 +220,7 @@ static
void
_dbg_ILSimpleGetText
(
LPCITEMIDLIST
pidl
,
LPSTR
szOut
,
UINT
uOutSize
)
{
LPSTR
szSrc
;
LPWSTR
szSrcW
;
GUID
const
*
riid
;
if
(
!
pidl
)
return
;
...
...
@@ -164,6 +238,13 @@ void _dbg_ILSimpleGetText (LPCITEMIDLIST pidl, LPSTR szOut, UINT uOutSize)
/* filesystem */
if
(
szOut
)
lstrcpynA
(
szOut
,
szSrc
,
uOutSize
);
}
else
if
((
szSrcW
=
_dbg_ILGetTextPointerW
(
pidl
)
))
{
CHAR
tmp
[
MAX_PATH
];
/* unicode filesystem */
WideCharToMultiByte
(
CP_ACP
,
0
,
szSrcW
,
-
1
,
tmp
,
MAX_PATH
,
NULL
,
NULL
);
if
(
szOut
)
lstrcpynA
(
szOut
,
tmp
,
uOutSize
);
}
else
if
((
riid
=
_dbg_ILGetGUIDPointer
(
pidl
)
))
{
if
(
szOut
)
...
...
@@ -194,6 +275,25 @@ void pdump (LPCITEMIDLIST pidl)
{
do
{
if
(
_ILIsUnicode
(
pidltemp
))
{
DWORD
dwAttrib
=
0
;
LPPIDLDATA
pData
=
_dbg_ILGetDataPointer
(
pidltemp
);
DWORD
type
=
pData
?
pData
->
type
:
0
;
LPWSTR
szLongName
=
_dbg_ILGetTextPointerW
(
pidltemp
);
LPWSTR
szShortName
=
_dbg_ILGetSTextPointerW
(
pidltemp
);
char
szName
[
MAX_PATH
];
_dbg_ILSimpleGetText
(
pidltemp
,
szName
,
MAX_PATH
);
if
(
pData
&&
(
PT_FOLDER
==
type
||
PT_VALUE
==
type
)
)
dwAttrib
=
pData
->
u
.
file
.
uFileAttribs
;
MESSAGE
(
"[%p] size=%04u type=%x attr=0x%08x name=%s (%s,%s)
\n
"
,
pidltemp
,
pidltemp
->
mkid
.
cb
,
type
,
dwAttrib
,
debugstr_a
(
szName
),
debugstr_w
(
szLongName
),
debugstr_w
(
szShortName
));
}
else
{
DWORD
dwAttrib
=
0
;
LPPIDLDATA
pData
=
_dbg_ILGetDataPointer
(
pidltemp
);
DWORD
type
=
pData
?
pData
->
type
:
0
;
...
...
@@ -208,6 +308,7 @@ void pdump (LPCITEMIDLIST pidl)
MESSAGE
(
"[%p] size=%04u type=%x attr=0x%08x name=%s (%s,%s)
\n
"
,
pidltemp
,
pidltemp
->
mkid
.
cb
,
type
,
dwAttrib
,
debugstr_a
(
szName
),
debugstr_a
(
szLongName
),
debugstr_a
(
szShortName
));
}
pidltemp
=
_dbg_ILGetNext
(
pidltemp
);
...
...
dlls/shell32/pidl.c
View file @
c0db9e57
...
...
@@ -1642,6 +1642,7 @@ DWORD _ILGetDrive(LPCITEMIDLIST pidl,LPSTR pOut, UINT uSize)
* ### 2. section testing pidls ###
*
**************************************************************************
* _ILIsUnicode()
* _ILIsDesktop()
* _ILIsMyComputer()
* _ILIsSpecialFolder()
...
...
@@ -1650,6 +1651,15 @@ DWORD _ILGetDrive(LPCITEMIDLIST pidl,LPSTR pOut, UINT uSize)
* _ILIsValue()
* _ILIsPidlSimple()
*/
BOOL
_ILIsUnicode
(
LPCITEMIDLIST
pidl
)
{
LPPIDLDATA
lpPData
=
_ILGetDataPointer
(
pidl
);
TRACE
(
"(%p)
\n
"
,
pidl
);
return
(
pidl
&&
lpPData
&&
PT_VALUEW
==
lpPData
->
type
);
}
BOOL
_ILIsDesktop
(
LPCITEMIDLIST
pidl
)
{
TRACE
(
"(%p)
\n
"
,
pidl
);
...
...
dlls/shell32/pidl.h
View file @
c0db9e57
...
...
@@ -201,6 +201,7 @@ DWORD _ILGetDrive (LPCITEMIDLIST, LPSTR, UINT);
/*
* testing simple pidls
*/
BOOL
_ILIsUnicode
(
LPCITEMIDLIST
pidl
);
BOOL
_ILIsDesktop
(
LPCITEMIDLIST
pidl
);
BOOL
_ILIsMyComputer
(
LPCITEMIDLIST
pidl
);
BOOL
_ILIsDrive
(
LPCITEMIDLIST
pidl
);
...
...
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