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
96bd8c5a
Commit
96bd8c5a
authored
Mar 17, 2009
by
Huw Davies
Committed by
Alexandre Julliard
Mar 23, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ole32: Add a helper function to retrieve the implementation ptr.
parent
e7ffa2ae
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
65 deletions
+29
-65
clipboard.c
dlls/ole32/clipboard.c
+29
-65
No files found.
dlls/ole32/clipboard.c
View file @
96bd8c5a
...
...
@@ -86,35 +86,24 @@ WINE_DEFAULT_DEBUG_CHANNEL(ole);
/****************************************************************************
* OLEClipbrd
* DO NOT add any members before the VTables declaration!
* ole_clipbrd
*/
struct
OLEC
lipbrd
struct
ole_c
lipbrd
{
/*
* List all interface VTables here
*/
const
IDataObjectVtbl
*
lpvtbl1
;
/* IDataObject VTable */
/*
* The hidden OLE clipboard window. This window is used as the bridge between the
* the OLE and windows clipboard API. (Windows creates one such window per process)
*/
HWND
hWndClipboard
;
/*
* Pointer to the source data object (via OleSetClipboard)
*/
IDataObject
*
pIDataObjectSrc
;
const
IDataObjectVtbl
*
lpvtbl
;
/* Exposed IDataObject vtable */
/*
* Reference count of this object
*/
LONG
ref
;
HWND
hWndClipboard
;
/* Hidden clipboard window */
IDataObject
*
pIDataObjectSrc
;
/* Source object passed to OleSetClipboard */
};
typedef
struct
OLEClipbrd
OLEC
lipbrd
;
typedef
struct
ole_clipbrd
ole_c
lipbrd
;
static
inline
ole_clipbrd
*
impl_from_IDataObject
(
IDataObject
*
iface
)
{
return
(
ole_clipbrd
*
)((
char
*
)
iface
-
FIELD_OFFSET
(
ole_clipbrd
,
lpvtbl
));
}
/****************************************************************************
* IEnumFORMATETC implementation
...
...
@@ -151,9 +140,9 @@ typedef struct PresentationDataHeader
}
PresentationDataHeader
;
/*
* The one and only
OLEC
lipbrd object which is created by OLEClipbrd_Initialize()
* The one and only
ole_c
lipbrd object which is created by OLEClipbrd_Initialize()
*/
static
OLEC
lipbrd
*
theOleClipboard
;
static
ole_c
lipbrd
*
theOleClipboard
;
/*
...
...
@@ -161,8 +150,8 @@ static OLEClipbrd* theOleClipboard;
*/
void
OLEClipbrd_Initialize
(
void
);
void
OLEClipbrd_UnInitialize
(
void
);
static
OLEC
lipbrd
*
OLEClipbrd_Construct
(
void
);
static
void
OLEClipbrd_Destroy
(
OLEC
lipbrd
*
ptrToDestroy
);
static
ole_c
lipbrd
*
OLEClipbrd_Construct
(
void
);
static
void
OLEClipbrd_Destroy
(
ole_c
lipbrd
*
ptrToDestroy
);
static
HWND
OLEClipbrd_CreateWindow
(
void
);
static
void
OLEClipbrd_DestroyWindow
(
HWND
hwnd
);
static
LRESULT
CALLBACK
OLEClipbrd_WndProc
(
HWND
hWnd
,
UINT
message
,
WPARAM
wParam
,
LPARAM
lParam
);
...
...
@@ -467,7 +456,7 @@ HRESULT WINAPI OleGetClipboard(IDataObject** ppDataObj)
return
E_OUTOFMEMORY
;
/* Return a reference counted IDataObject */
hr
=
IDataObject_QueryInterface
(
(
IDataObject
*
)
&
(
theOleClipboard
->
lpvtbl
1
),
hr
=
IDataObject_QueryInterface
(
(
IDataObject
*
)
&
(
theOleClipboard
->
lpvtbl
),
&
IID_IDataObject
,
(
void
**
)
ppDataObj
);
return
hr
;
}
...
...
@@ -635,14 +624,14 @@ void OLEClipbrd_UnInitialize(void)
/*********************************************************
* Construct the OLEClipbrd class.
*/
static
OLEC
lipbrd
*
OLEClipbrd_Construct
(
void
)
static
ole_c
lipbrd
*
OLEClipbrd_Construct
(
void
)
{
OLEC
lipbrd
*
This
;
ole_c
lipbrd
*
This
;
This
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
*
This
)
);
if
(
!
This
)
return
NULL
;
This
->
lpvtbl
1
=
&
OLEClipbrd_IDataObject_VTable
;
This
->
lpvtbl
=
&
OLEClipbrd_IDataObject_VTable
;
This
->
ref
=
1
;
This
->
hWndClipboard
=
NULL
;
...
...
@@ -652,7 +641,7 @@ static OLEClipbrd* OLEClipbrd_Construct(void)
return
This
;
}
static
void
OLEClipbrd_Destroy
(
OLEC
lipbrd
*
This
)
static
void
OLEClipbrd_Destroy
(
ole_c
lipbrd
*
This
)
{
TRACE
(
"()
\n
"
);
...
...
@@ -666,7 +655,6 @@ static void OLEClipbrd_Destroy(OLEClipbrd* This)
HeapFree
(
GetProcessHeap
(),
0
,
This
);
}
/***********************************************************************
* OLEClipbrd_CreateWindow()
* Create the clipboard window
...
...
@@ -773,7 +761,7 @@ static LRESULT CALLBACK OLEClipbrd_WndProc
* Render the clipboard data.
* (We must have a source data object or we wouldn't be in this WndProc)
*/
OLEClipbrd_RenderFormat
(
(
IDataObject
*
)
&
(
theOleClipboard
->
lpvtbl
1
),
&
rgelt
);
OLEClipbrd_RenderFormat
(
(
IDataObject
*
)
&
(
theOleClipboard
->
lpvtbl
),
&
rgelt
);
break
;
}
...
...
@@ -799,7 +787,7 @@ static LRESULT CALLBACK OLEClipbrd_WndProc
* Render all HGLOBAL formats supported by the source into
* the windows clipboard.
*/
if
(
FAILED
(
IDataObject_EnumFormatEtc
(
(
IDataObject
*
)
&
(
theOleClipboard
->
lpvtbl
1
),
if
(
FAILED
(
IDataObject_EnumFormatEtc
(
(
IDataObject
*
)
&
(
theOleClipboard
->
lpvtbl
),
DATADIR_GET
,
&
penumFormatetc
)
)
)
{
WARN
(
"(): WM_RENDERALLFORMATS failed to retrieve EnumFormatEtc!
\n
"
);
...
...
@@ -813,7 +801,7 @@ static LRESULT CALLBACK OLEClipbrd_WndProc
/*
* Render the clipboard data.
*/
if
(
FAILED
(
OLEClipbrd_RenderFormat
(
(
IDataObject
*
)
&
(
theOleClipboard
->
lpvtbl
1
),
&
rgelt
))
)
if
(
FAILED
(
OLEClipbrd_RenderFormat
(
(
IDataObject
*
)
&
(
theOleClipboard
->
lpvtbl
),
&
rgelt
))
)
continue
;
TRACE
(
"(): WM_RENDERALLFORMATS(cfFormat=%d)
\n
"
,
rgelt
.
cfFormat
);
...
...
@@ -1064,10 +1052,7 @@ static HRESULT WINAPI OLEClipbrd_IDataObject_QueryInterface(
REFIID
riid
,
void
**
ppvObject
)
{
/*
* Declare "This" pointer
*/
OLEClipbrd
*
This
=
(
OLEClipbrd
*
)
iface
;
ole_clipbrd
*
This
=
impl_from_IDataObject
(
iface
);
TRACE
(
"(%p)->(
\n\t
IID:
\t
%s,%p)
\n
"
,
This
,
debugstr_guid
(
riid
),
ppvObject
);
/*
...
...
@@ -1090,7 +1075,7 @@ static HRESULT WINAPI OLEClipbrd_IDataObject_QueryInterface(
}
else
if
(
memcmp
(
&
IID_IDataObject
,
riid
,
sizeof
(
IID_IDataObject
))
==
0
)
{
*
ppvObject
=
&
This
->
lpvtbl
1
;
*
ppvObject
=
&
This
->
lpvtbl
;
}
else
/* We only support IUnknown and IDataObject */
{
...
...
@@ -1115,15 +1100,11 @@ static HRESULT WINAPI OLEClipbrd_IDataObject_QueryInterface(
static
ULONG
WINAPI
OLEClipbrd_IDataObject_AddRef
(
IDataObject
*
iface
)
{
/*
* Declare "This" pointer
*/
OLEClipbrd
*
This
=
(
OLEClipbrd
*
)
iface
;
ole_clipbrd
*
This
=
impl_from_IDataObject
(
iface
);
TRACE
(
"(%p)->(count=%u)
\n
"
,
This
,
This
->
ref
);
return
InterlockedIncrement
(
&
This
->
ref
);
}
/************************************************************************
...
...
@@ -1134,22 +1115,13 @@ static ULONG WINAPI OLEClipbrd_IDataObject_AddRef(
static
ULONG
WINAPI
OLEClipbrd_IDataObject_Release
(
IDataObject
*
iface
)
{
/*
* Declare "This" pointer
*/
OLEClipbrd
*
This
=
(
OLEClipbrd
*
)
iface
;
ole_clipbrd
*
This
=
impl_from_IDataObject
(
iface
);
ULONG
ref
;
TRACE
(
"(%p)->(count=%u)
\n
"
,
This
,
This
->
ref
);
/*
* Decrease the reference count on this object.
*/
ref
=
InterlockedDecrement
(
&
This
->
ref
);
/*
* If the reference count goes down to 0, perform suicide.
*/
if
(
ref
==
0
)
{
OLEClipbrd_Destroy
(
This
);
...
...
@@ -1176,11 +1148,7 @@ static HRESULT WINAPI OLEClipbrd_IDataObject_GetData(
BOOL
bClipboardOpen
=
FALSE
;
HRESULT
hr
=
S_OK
;
LPVOID
src
;
/*
* Declare "This" pointer
*/
OLEClipbrd
*
This
=
(
OLEClipbrd
*
)
iface
;
ole_clipbrd
*
This
=
impl_from_IDataObject
(
iface
);
TRACE
(
"(%p,%p,%p)
\n
"
,
iface
,
pformatetcIn
,
pmedium
);
...
...
@@ -1346,11 +1314,7 @@ static HRESULT WINAPI OLEClipbrd_IDataObject_EnumFormatEtc(
int
cfmt
,
i
;
UINT
format
;
BOOL
bClipboardOpen
;
/*
* Declare "This" pointer
*/
OLEClipbrd
*
This
=
(
OLEClipbrd
*
)
iface
;
ole_clipbrd
*
This
=
impl_from_IDataObject
(
iface
);
TRACE
(
"(%p, %x, %p)
\n
"
,
iface
,
dwDirection
,
ppenumFormatEtc
);
...
...
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