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
dc3d4751
Commit
dc3d4751
authored
Aug 02, 2006
by
Mike McCormack
Committed by
Alexandre Julliard
Aug 01, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
hlink: Create a strdupW function and use it.
parent
88cc410f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
28 deletions
+17
-28
link.c
dlls/hlink/link.c
+17
-28
No files found.
dlls/hlink/link.c
View file @
dc3d4751
...
...
@@ -68,6 +68,18 @@ static inline HlinkImpl* HlinkImpl_from_IDataObject( IDataObject* iface)
return
(
HlinkImpl
*
)
((
CHAR
*
)
iface
-
FIELD_OFFSET
(
HlinkImpl
,
lpDOVtbl
));
}
static
inline
LPWSTR
strdupW
(
LPCWSTR
str
)
{
LPWSTR
r
;
if
(
!
str
)
return
NULL
;
r
=
HeapAlloc
(
GetProcessHeap
(),
0
,
(
lstrlenW
(
str
)
+
1
)
*
sizeof
(
WCHAR
));
if
(
r
)
lstrcpyW
(
r
,
str
);
return
r
;
}
static
inline
void
__GetMoniker
(
HlinkImpl
*
This
,
IMoniker
**
moniker
)
{
*
moniker
=
NULL
;
...
...
@@ -216,13 +228,7 @@ static HRESULT WINAPI IHlink_fnSetMonikerReference( IHlink* iface,
IMoniker_AddRef
(
This
->
Moniker
);
HeapFree
(
GetProcessHeap
(),
0
,
This
->
Location
);
This
->
Location
=
NULL
;
if
(
pwzLocation
)
{
This
->
Location
=
HeapAlloc
(
GetProcessHeap
(),
0
,
(
lstrlenW
(
pwzLocation
)
+
1
)
*
sizeof
(
WCHAR
));
lstrcpyW
(
This
->
Location
,
pwzLocation
);
}
This
->
Location
=
strdupW
(
pwzLocation
);
return
S_OK
;
}
...
...
@@ -238,25 +244,12 @@ static HRESULT WINAPI IHlink_fnSetStringReference(IHlink* iface,
if
(
grfHLSETF
&
HLINKSETF_TARGET
)
{
HeapFree
(
GetProcessHeap
(),
0
,
This
->
Target
);
This
->
Target
=
NULL
;
if
(
pwzTarget
)
{
This
->
Target
=
HeapAlloc
(
GetProcessHeap
(),
0
,
(
lstrlenW
(
pwzTarget
)
+
1
)
*
sizeof
(
WCHAR
));
lstrcpyW
(
This
->
Target
,
pwzTarget
);
}
This
->
Target
=
strdupW
(
pwzTarget
);
}
if
(
grfHLSETF
&
HLINKSETF_LOCATION
)
{
HeapFree
(
GetProcessHeap
(),
0
,
This
->
Location
);
This
->
Location
=
NULL
;
if
(
pwzLocation
)
{
This
->
Location
=
HeapAlloc
(
GetProcessHeap
(),
0
,
(
lstrlenW
(
pwzLocation
)
+
1
)
*
sizeof
(
WCHAR
));
lstrcpyW
(
This
->
Location
,
pwzLocation
);
}
This
->
Location
=
strdupW
(
pwzLocation
);
}
return
S_OK
;
...
...
@@ -347,9 +340,7 @@ static HRESULT WINAPI IHlink_fnSetFriendlyName (IHlink *iface,
TRACE
(
"(%p) -> (%s)
\n
"
,
This
,
debugstr_w
(
pwzFriendlyName
));
HeapFree
(
GetProcessHeap
(),
0
,
This
->
FriendlyName
);
This
->
FriendlyName
=
HeapAlloc
(
GetProcessHeap
(),
0
,
(
lstrlenW
(
pwzFriendlyName
)
+
1
)
*
sizeof
(
WCHAR
));
lstrcpyW
(
This
->
FriendlyName
,
pwzFriendlyName
);
This
->
FriendlyName
=
strdupW
(
pwzFriendlyName
);
return
S_OK
;
}
...
...
@@ -396,9 +387,7 @@ static HRESULT WINAPI IHlink_fnSetTargetFrameName(IHlink* iface,
TRACE
(
"(%p)->(%s)
\n
"
,
This
,
debugstr_w
(
pwzTargetFramename
));
HeapFree
(
GetProcessHeap
(),
0
,
This
->
TargetFrameName
);
This
->
TargetFrameName
=
HeapAlloc
(
GetProcessHeap
(),
0
,
(
lstrlenW
(
pwzTargetFramename
)
+
1
)
*
sizeof
(
WCHAR
));
lstrcpyW
(
This
->
TargetFrameName
,
pwzTargetFramename
);
This
->
TargetFrameName
=
strdupW
(
pwzTargetFramename
);
return
S_OK
;
}
...
...
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