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
128654ba
Commit
128654ba
authored
Feb 26, 2008
by
Roy Shea
Committed by
Alexandre Julliard
Feb 27, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
qmgr: Implement the IUnknown interface for IBackgroundCopyFile.
parent
a3a49149
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
152 additions
and
0 deletions
+152
-0
Makefile.in
dlls/qmgr/Makefile.in
+1
-0
file.c
dlls/qmgr/file.c
+143
-0
qmgr.h
dlls/qmgr/qmgr.h
+8
-0
No files found.
dlls/qmgr/Makefile.in
View file @
128654ba
...
...
@@ -9,6 +9,7 @@ EXTRALIBS = -luuid
C_SRCS
=
\
enum_jobs.c
\
factory.c
\
file.c
\
job.c
\
qmgr.c
\
qmgr_main.c
\
...
...
dlls/qmgr/file.c
0 → 100644
View file @
128654ba
/*
* Queue Manager (BITS) File
*
* Copyright 2007 Google (Roy Shea)
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "qmgr.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
qmgr
);
static
void
BackgroundCopyFileDestructor
(
BackgroundCopyFileImpl
*
This
)
{
HeapFree
(
GetProcessHeap
(),
0
,
This
->
info
.
LocalName
);
HeapFree
(
GetProcessHeap
(),
0
,
This
->
info
.
RemoteName
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
}
static
ULONG
WINAPI
BITS_IBackgroundCopyFile_AddRef
(
IBackgroundCopyFile
*
iface
)
{
BackgroundCopyFileImpl
*
This
=
(
BackgroundCopyFileImpl
*
)
iface
;
return
InterlockedIncrement
(
&
This
->
ref
);
}
static
HRESULT
WINAPI
BITS_IBackgroundCopyFile_QueryInterface
(
IBackgroundCopyFile
*
iface
,
REFIID
riid
,
void
**
ppvObject
)
{
BackgroundCopyFileImpl
*
This
=
(
BackgroundCopyFileImpl
*
)
iface
;
if
(
IsEqualGUID
(
riid
,
&
IID_IUnknown
)
||
IsEqualGUID
(
riid
,
&
IID_IBackgroundCopyFile
))
{
*
ppvObject
=
&
This
->
lpVtbl
;
BITS_IBackgroundCopyFile_AddRef
(
iface
);
return
S_OK
;
}
*
ppvObject
=
NULL
;
return
E_NOINTERFACE
;
}
static
ULONG
WINAPI
BITS_IBackgroundCopyFile_Release
(
IBackgroundCopyFile
*
iface
)
{
BackgroundCopyFileImpl
*
This
=
(
BackgroundCopyFileImpl
*
)
iface
;
ULONG
ref
=
InterlockedDecrement
(
&
This
->
ref
);
if
(
ref
==
0
)
BackgroundCopyFileDestructor
(
This
);
return
ref
;
}
/*** IBackgroundCopyFile methods ***/
static
HRESULT
WINAPI
BITS_IBackgroundCopyFile_GetRemoteName
(
IBackgroundCopyFile
*
iface
,
LPWSTR
*
pVal
)
{
FIXME
(
"Not implemented
\n
"
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
BITS_IBackgroundCopyFile_GetLocalName
(
IBackgroundCopyFile
*
iface
,
LPWSTR
*
pVal
)
{
FIXME
(
"Not implemented
\n
"
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
BITS_IBackgroundCopyFile_GetProgress
(
IBackgroundCopyFile
*
iface
,
BG_FILE_PROGRESS
*
pVal
)
{
FIXME
(
"Not implemented
\n
"
);
return
E_NOTIMPL
;
}
static
const
IBackgroundCopyFileVtbl
BITS_IBackgroundCopyFile_Vtbl
=
{
BITS_IBackgroundCopyFile_QueryInterface
,
BITS_IBackgroundCopyFile_AddRef
,
BITS_IBackgroundCopyFile_Release
,
BITS_IBackgroundCopyFile_GetRemoteName
,
BITS_IBackgroundCopyFile_GetLocalName
,
BITS_IBackgroundCopyFile_GetProgress
};
HRESULT
BackgroundCopyFileConstructor
(
LPCWSTR
remoteName
,
LPCWSTR
localName
,
LPVOID
*
ppObj
)
{
BackgroundCopyFileImpl
*
This
;
int
n
;
TRACE
(
"(%s,%s,%p)
\n
"
,
debugstr_w
(
remoteName
),
debugstr_w
(
localName
),
ppObj
);
This
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
*
This
);
if
(
!
This
)
return
E_OUTOFMEMORY
;
n
=
(
lstrlenW
(
remoteName
)
+
1
)
*
sizeof
(
WCHAR
);
This
->
info
.
RemoteName
=
HeapAlloc
(
GetProcessHeap
(),
0
,
n
);
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
);
if
(
!
This
->
info
.
LocalName
)
{
HeapFree
(
GetProcessHeap
(),
0
,
This
->
info
.
RemoteName
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
return
E_OUTOFMEMORY
;
}
memcpy
(
This
->
info
.
LocalName
,
localName
,
n
);
This
->
lpVtbl
=
&
BITS_IBackgroundCopyFile_Vtbl
;
This
->
ref
=
1
;
*
ppObj
=
&
This
->
lpVtbl
;
return
S_OK
;
}
dlls/qmgr/qmgr.h
View file @
128654ba
...
...
@@ -46,6 +46,14 @@ typedef struct
LONG
ref
;
}
EnumBackgroundCopyJobsImpl
;
/* Background copy file vtbl and related data */
typedef
struct
{
const
IBackgroundCopyFileVtbl
*
lpVtbl
;
LONG
ref
;
BG_FILE_INFO
info
;
}
BackgroundCopyFileImpl
;
/* Background copy manager vtbl and related data */
typedef
struct
{
...
...
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