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
eeb05e6e
Commit
eeb05e6e
authored
Nov 25, 2013
by
Nikolay Sivov
Committed by
Alexandre Julliard
Nov 25, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
qmgr: Implement IBackgroundCopyJob::SetDescription().
parent
d5b0232b
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
43 additions
and
8 deletions
+43
-8
job.c
dlls/qmgr/job.c
+42
-8
qmgr.h
dlls/qmgr/qmgr.h
+1
-0
No files found.
dlls/qmgr/job.c
View file @
eeb05e6e
...
...
@@ -25,9 +25,15 @@
#include "qmgr.h"
#include "wine/debug.h"
#include "wine/unicode.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
qmgr
);
static
inline
BOOL
is_job_done
(
const
BackgroundCopyJobImpl
*
job
)
{
return
job
->
state
==
BG_JOB_STATE_CANCELLED
||
job
->
state
==
BG_JOB_STATE_ACKNOWLEDGED
;
}
static
inline
BackgroundCopyJobImpl
*
impl_from_IBackgroundCopyJob2
(
IBackgroundCopyJob2
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
BackgroundCopyJobImpl
,
IBackgroundCopyJob2_iface
);
...
...
@@ -73,6 +79,7 @@ static ULONG WINAPI BITS_IBackgroundCopyJob_Release(IBackgroundCopyJob2 *iface)
This
->
cs
.
DebugInfo
->
Spare
[
0
]
=
0
;
DeleteCriticalSection
(
&
This
->
cs
);
HeapFree
(
GetProcessHeap
(),
0
,
This
->
displayName
);
HeapFree
(
GetProcessHeap
(),
0
,
This
->
description
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
}
...
...
@@ -147,8 +154,7 @@ static HRESULT WINAPI BITS_IBackgroundCopyJob_Resume(
HRESULT
rv
=
S_OK
;
EnterCriticalSection
(
&
globalMgr
.
cs
);
if
(
This
->
state
==
BG_JOB_STATE_CANCELLED
||
This
->
state
==
BG_JOB_STATE_ACKNOWLEDGED
)
if
(
is_job_done
(
This
))
{
rv
=
BG_E_INVALID_STATE
;
}
...
...
@@ -182,8 +188,7 @@ static HRESULT WINAPI BITS_IBackgroundCopyJob_Complete(
EnterCriticalSection
(
&
This
->
cs
);
if
(
This
->
state
==
BG_JOB_STATE_CANCELLED
||
This
->
state
==
BG_JOB_STATE_ACKNOWLEDGED
)
if
(
is_job_done
(
This
))
{
rv
=
BG_E_INVALID_STATE
;
}
...
...
@@ -313,7 +318,7 @@ static HRESULT WINAPI BITS_IBackgroundCopyJob_GetDisplayName(
if
(
!
pVal
)
return
E_INVALIDARG
;
n
=
(
l
strlenW
(
This
->
displayName
)
+
1
)
*
sizeof
**
pVal
;
n
=
(
strlenW
(
This
->
displayName
)
+
1
)
*
sizeof
**
pVal
;
*
pVal
=
CoTaskMemAlloc
(
n
);
if
(
*
pVal
==
NULL
)
return
E_OUTOFMEMORY
;
...
...
@@ -325,8 +330,36 @@ static HRESULT WINAPI BITS_IBackgroundCopyJob_SetDescription(
IBackgroundCopyJob2
*
iface
,
LPCWSTR
Val
)
{
FIXME
(
"Not implemented
\n
"
);
return
E_NOTIMPL
;
BackgroundCopyJobImpl
*
This
=
impl_from_IBackgroundCopyJob2
(
iface
);
static
const
int
max_description_len
=
1024
;
HRESULT
hr
=
S_OK
;
int
len
;
TRACE
(
"(%p)->(%s)
\n
"
,
This
,
debugstr_w
(
Val
));
if
(
!
Val
)
return
E_INVALIDARG
;
len
=
strlenW
(
Val
);
if
(
len
>
max_description_len
)
return
BG_E_STRING_TOO_LONG
;
EnterCriticalSection
(
&
This
->
cs
);
if
(
is_job_done
(
This
))
{
hr
=
BG_E_INVALID_STATE
;
}
else
{
HeapFree
(
GetProcessHeap
(),
0
,
This
->
description
);
if
((
This
->
description
=
HeapAlloc
(
GetProcessHeap
(),
0
,
(
len
+
1
)
*
sizeof
(
WCHAR
))))
strcpyW
(
This
->
description
,
Val
);
else
hr
=
E_OUTOFMEMORY
;
}
LeaveCriticalSection
(
&
This
->
cs
);
return
hr
;
}
static
HRESULT
WINAPI
BITS_IBackgroundCopyJob_GetDescription
(
...
...
@@ -588,7 +621,7 @@ HRESULT BackgroundCopyJobConstructor(LPCWSTR displayName, BG_JOB_TYPE type, GUID
This
->
ref
=
1
;
This
->
type
=
type
;
n
=
(
l
strlenW
(
displayName
)
+
1
)
*
sizeof
*
displayName
;
n
=
(
strlenW
(
displayName
)
+
1
)
*
sizeof
*
displayName
;
This
->
displayName
=
HeapAlloc
(
GetProcessHeap
(),
0
,
n
);
if
(
!
This
->
displayName
)
{
...
...
@@ -617,6 +650,7 @@ HRESULT BackgroundCopyJobConstructor(LPCWSTR displayName, BG_JOB_TYPE type, GUID
This
->
jobProgress
.
FilesTransferred
=
0
;
This
->
state
=
BG_JOB_STATE_SUSPENDED
;
This
->
description
=
NULL
;
*
job
=
This
;
return
S_OK
;
...
...
dlls/qmgr/qmgr.h
View file @
eeb05e6e
...
...
@@ -36,6 +36,7 @@ typedef struct
IBackgroundCopyJob2
IBackgroundCopyJob2_iface
;
LONG
ref
;
LPWSTR
displayName
;
LPWSTR
description
;
BG_JOB_TYPE
type
;
GUID
jobId
;
struct
list
files
;
...
...
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