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
8ae20154
Commit
8ae20154
authored
Jun 23, 2015
by
Nikolay Sivov
Committed by
Alexandre Julliard
Jun 23, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
qmgr: Simplify string duplication using a helper.
parent
74e37bc3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
11 deletions
+3
-11
file.c
dlls/qmgr/file.c
+2
-7
job.c
dlls/qmgr/job.c
+1
-4
No files found.
dlls/qmgr/file.c
View file @
8ae20154
...
...
@@ -166,7 +166,6 @@ HRESULT BackgroundCopyFileConstructor(BackgroundCopyJobImpl *owner,
BackgroundCopyFileImpl
**
file
)
{
BackgroundCopyFileImpl
*
This
;
int
n
;
TRACE
(
"(%s, %s, %p)
\n
"
,
debugstr_w
(
remoteName
),
debugstr_w
(
localName
),
file
);
...
...
@@ -174,24 +173,20 @@ HRESULT BackgroundCopyFileConstructor(BackgroundCopyJobImpl *owner,
if
(
!
This
)
return
E_OUTOFMEMORY
;
n
=
(
lstrlenW
(
remoteName
)
+
1
)
*
sizeof
(
WCHAR
);
This
->
info
.
RemoteName
=
HeapAlloc
(
GetProcessHeap
(),
0
,
n
);
This
->
info
.
RemoteName
=
strdupW
(
remoteName
);
if
(
!
This
->
info
.
RemoteName
)
{
HeapFree
(
GetProcessHeap
(),
0
,
This
);
return
E_OUTOFMEMORY
;
}
memcpy
(
This
->
info
.
RemoteName
,
remoteName
,
n
);
n
=
(
lstrlenW
(
localName
)
+
1
)
*
sizeof
(
WCHAR
);
This
->
info
.
LocalName
=
HeapAlloc
(
GetProcessHeap
(),
0
,
n
);
This
->
info
.
LocalName
=
strdupW
(
localName
);
if
(
!
This
->
info
.
LocalName
)
{
HeapFree
(
GetProcessHeap
(),
0
,
This
->
info
.
RemoteName
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
return
E_OUTOFMEMORY
;
}
memcpy
(
This
->
info
.
LocalName
,
localName
,
n
);
This
->
IBackgroundCopyFile2_iface
.
lpVtbl
=
&
BackgroundCopyFile2Vtbl
;
This
->
ref
=
1
;
...
...
dlls/qmgr/job.c
View file @
8ae20154
...
...
@@ -1194,7 +1194,6 @@ HRESULT BackgroundCopyJobConstructor(LPCWSTR displayName, BG_JOB_TYPE type, GUID
{
HRESULT
hr
;
BackgroundCopyJobImpl
*
This
;
int
n
;
TRACE
(
"(%s,%d,%p)
\n
"
,
debugstr_w
(
displayName
),
type
,
job
);
...
...
@@ -1210,8 +1209,7 @@ HRESULT BackgroundCopyJobConstructor(LPCWSTR displayName, BG_JOB_TYPE type, GUID
This
->
ref
=
1
;
This
->
type
=
type
;
n
=
(
strlenW
(
displayName
)
+
1
)
*
sizeof
*
displayName
;
This
->
displayName
=
HeapAlloc
(
GetProcessHeap
(),
0
,
n
);
This
->
displayName
=
strdupW
(
displayName
);
if
(
!
This
->
displayName
)
{
This
->
cs
.
DebugInfo
->
Spare
[
0
]
=
0
;
...
...
@@ -1219,7 +1217,6 @@ HRESULT BackgroundCopyJobConstructor(LPCWSTR displayName, BG_JOB_TYPE type, GUID
HeapFree
(
GetProcessHeap
(),
0
,
This
);
return
E_OUTOFMEMORY
;
}
memcpy
(
This
->
displayName
,
displayName
,
n
);
hr
=
CoCreateGuid
(
&
This
->
jobId
);
if
(
FAILED
(
hr
))
...
...
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