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
d015d3b9
Commit
d015d3b9
authored
Feb 10, 2004
by
Jon Griffiths
Committed by
Alexandre Julliard
Feb 10, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add some missing prototypes, fix AssocIsDangerous.
Implement StrRetToBSTR, delay-import oleaut32.
parent
df24e106
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
94 additions
and
17 deletions
+94
-17
Makefile.in
dlls/shlwapi/Makefile.in
+1
-0
assoc.c
dlls/shlwapi/assoc.c
+12
-3
shlwapi.spec
dlls/shlwapi/shlwapi.spec
+5
-4
string.c
dlls/shlwapi/string.c
+67
-2
shlwapi.h
include/shlwapi.h
+9
-8
No files found.
dlls/shlwapi/Makefile.in
View file @
d015d3b9
...
...
@@ -5,6 +5,7 @@ SRCDIR = @srcdir@
VPATH
=
@srcdir@
MODULE
=
shlwapi.dll
IMPORTS
=
ole32 user32 gdi32 advapi32 kernel32
DELAYIMPORTS
=
oleaut32
EXTRALIBS
=
-luuid
$(LIBUNICODE)
C_SRCS
=
\
...
...
dlls/shlwapi/assoc.c
View file @
d015d3b9
...
...
@@ -414,11 +414,20 @@ HRESULT WINAPI AssocQueryStringByKeyA(ASSOCF cfFlags, ASSOCSTR str, HKEY hkAssoc
/**************************************************************************
* AssocIsDangerous (SHLWAPI.@)
*
* Determine if a file association is dangerous (potentially malware).
*
* PARAMS
* lpszAssoc [I] Name of file or file extention to check.
*
* RETURNS
* TRUE, if lpszAssoc may potentially be malware (executable),
* FALSE, Otherwise.
*/
HRESULT
WINAPI
AssocIsDangerous
(
ASSOCSTR
str
)
BOOL
WINAPI
AssocIsDangerous
(
LPCWSTR
lpszAssoc
)
{
FIXME
(
"%
08x
\n
"
,
str
);
return
S_
FALSE
;
FIXME
(
"%
s
\n
"
,
debugstr_w
(
lpszAssoc
)
);
return
FALSE
;
}
/**************************************************************************
...
...
dlls/shlwapi/shlwapi.spec
View file @
d015d3b9
...
...
@@ -796,10 +796,11 @@
# exported in later versions
@ stdcall AssocIsDangerous(long)
@ stdcall StrRetToBufA (ptr ptr ptr long)
@ stdcall StrRetToBufW (ptr ptr ptr long)
@ stdcall StrRetToStrA (ptr ptr ptr)
@ stdcall StrRetToStrW (ptr ptr ptr)
@ stdcall StrRetToBufA(ptr ptr ptr long)
@ stdcall StrRetToBufW(ptr ptr ptr long)
@ stdcall StrRetToBSTR(ptr ptr ptr)
@ stdcall StrRetToStrA(ptr ptr ptr)
@ stdcall StrRetToStrW(ptr ptr ptr)
@ stdcall SHRegGetPathA(long str str ptr long)
@ stdcall SHRegGetPathW(long wstr wstr ptr long)
@ stdcall PathIsDirectoryEmptyA(str)
...
...
dlls/shlwapi/string.c
View file @
d015d3b9
...
...
@@ -1333,7 +1333,7 @@ LPWSTR WINAPI StrCatBuffW(LPWSTR lpszStr, LPCWSTR lpszCat, INT cchMax)
*
* PARAMS
* lpStrRet [O] STRRET to convert
* pIdl [I] ITEMIDLIST for lpStrRet->uType =
STRRET_OFFSETA
* pIdl [I] ITEMIDLIST for lpStrRet->uType =
= STRRET_OFFSET
* lpszDest [O] Destination for normal string
* dwLen [I] Length of lpszDest
*
...
...
@@ -1444,7 +1444,7 @@ HRESULT WINAPI StrRetToBufW (LPSTRRET src, const ITEMIDLIST *pidl, LPWSTR dest,
*
* PARAMS
* lpStrRet [O] STRRET to convert
* pidl [I] ITEMIDLIST for lpStrRet->uType =
STRRET_OFFSETA
* pidl [I] ITEMIDLIST for lpStrRet->uType =
= STRRET_OFFSET
* ppszName [O] Destination for converted string
*
* RETURNS
...
...
@@ -1508,6 +1508,71 @@ HRESULT WINAPI StrRetToStrW(LPSTRRET lpStrRet, const ITEMIDLIST *pidl, LPWSTR *p
return
hRet
;
}
/* Create an ASCII string copy using SysAllocString() */
static
HRESULT
_SHStrDupAToBSTR
(
LPCSTR
src
,
BSTR
*
pBstrOut
)
{
*
pBstrOut
=
NULL
;
if
(
src
)
{
INT
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
src
,
-
1
,
NULL
,
0
);
WCHAR
*
szTemp
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
*
sizeof
(
WCHAR
));
if
(
szTemp
)
{
MultiByteToWideChar
(
CP_ACP
,
0
,
src
,
-
1
,
szTemp
,
len
);
*
pBstrOut
=
SysAllocString
(
szTemp
);
HeapFree
(
GetProcessHeap
(),
0
,
szTemp
);
if
(
*
pBstrOut
)
return
S_OK
;
}
}
return
E_OUTOFMEMORY
;
}
/*************************************************************************
* StrRetToBSTR [SHLWAPI.@]
*
* Converts a STRRET to a BSTR.
*
* PARAMS
* lpStrRet [O] STRRET to convert
* pidl [I] ITEMIDLIST for lpStrRet->uType = STRRET_OFFSET
* pBstrOut [O] Destination for converted BSTR
*
* RETURNS
* Success: S_OK. pBstrOut contains the new string.
* Failure: E_FAIL, if any parameters are invalid.
*/
HRESULT
WINAPI
StrRetToBSTR
(
STRRET
*
lpStrRet
,
LPCITEMIDLIST
pidl
,
BSTR
*
pBstrOut
)
{
HRESULT
hRet
=
E_FAIL
;
switch
(
lpStrRet
->
uType
)
{
case
STRRET_WSTR
:
*
pBstrOut
=
SysAllocString
(
lpStrRet
->
u
.
pOleStr
);
if
(
*
pBstrOut
)
hRet
=
S_OK
;
CoTaskMemFree
(
lpStrRet
->
u
.
pOleStr
);
break
;
case
STRRET_CSTR
:
hRet
=
_SHStrDupAToBSTR
(
lpStrRet
->
u
.
cStr
,
pBstrOut
);
break
;
case
STRRET_OFFSET
:
hRet
=
_SHStrDupAToBSTR
(((
LPCSTR
)
&
pidl
->
mkid
)
+
lpStrRet
->
u
.
uOffset
,
pBstrOut
);
break
;
default:
*
pBstrOut
=
NULL
;
}
return
hRet
;
}
/*************************************************************************
* StrFormatKBSizeA [SHLWAPI.@]
*
...
...
include/shlwapi.h
View file @
d015d3b9
...
...
@@ -22,6 +22,7 @@
#define __WINE_SHLWAPI_H
#include <objbase.h>
#include <shtypes.h>
#ifdef __cplusplus
extern
"C"
{
...
...
@@ -279,6 +280,8 @@ HRESULT WINAPI AssocQueryKeyA(ASSOCF,ASSOCKEY,LPCSTR,LPCSTR,PHKEY);
HRESULT
WINAPI
AssocQueryKeyW
(
ASSOCF
,
ASSOCKEY
,
LPCWSTR
,
LPCWSTR
,
PHKEY
);
#define AssocQueryKey WINELIB_NAME_AW(AssocQueryKey)
BOOL
WINAPI
AssocIsDangerous
(
LPCWSTR
);
#endif
/* NO_SHLWAPI_REG */
...
...
@@ -819,18 +822,16 @@ BOOL IntlStrEqWorkerW(BOOL,LPCWSTR,LPCWSTR,int);
#define IntlStrEqNIW(s1,s2,n) IntlStrEqWorkerW(FALSE,s1,s2,n)
#define IntlStrEqNI WINELIB_NAME_AW(IntlStrEqNI)
/* Undocumented */
struct
_STRRET
;
struct
_ITEMIDLIST
;
HRESULT
WINAPI
StrRetToStrA
(
struct
_STRRET
*
,
const
struct
_ITEMIDLIST
*
,
LPSTR
*
);
HRESULT
WINAPI
StrRetToStrW
(
struct
_STRRET
*
,
const
struct
_ITEMIDLIST
*
,
LPWSTR
*
);
HRESULT
WINAPI
StrRetToStrA
(
STRRET
*
,
LPCITEMIDLIST
,
LPSTR
*
);
HRESULT
WINAPI
StrRetToStrW
(
STRRET
*
,
LPCITEMIDLIST
,
LPWSTR
*
);
#define StrRetToStr WINELIB_NAME_AW(StrRetToStr)
HRESULT
WINAPI
StrRetToBufA
(
struct
_STRRET
*
,
const
struct
_ITEMIDLIST
*
,
LPSTR
,
UINT
);
HRESULT
WINAPI
StrRetToBufW
(
struct
_STRRET
*
,
const
struct
_ITEMIDLIST
*
,
LPWSTR
,
UINT
);
HRESULT
WINAPI
StrRetToBufA
(
STRRET
*
,
LPCITEMIDLIST
,
LPSTR
,
UINT
);
HRESULT
WINAPI
StrRetToBufW
(
STRRET
*
,
LPCITEMIDLIST
,
LPWSTR
,
UINT
);
#define StrRetToBuf WINELIB_NAME_AW(StrRetToBuf)
HRESULT
WINAPI
StrRetToBSTR
(
STRRET
*
,
LPCITEMIDLIST
,
BSTR
*
);
#endif
/* NO_SHLWAPI_STRFCNS */
...
...
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