ReactOS  0.4.14-dev-342-gdc047f9
displayattributemgr.c
Go to the documentation of this file.
1 /*
2  * ITfDisplayAttributeMgr implementation
3  *
4  * Copyright 2010 CodeWeavers, Aric Stewart
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19  */
20 
21 #define COBJMACROS
22 
23 #include "wine/debug.h"
24 #include "winbase.h"
25 #include "winreg.h"
26 #include "shlwapi.h"
27 
28 #include "msctf.h"
29 #include "msctf_internal.h"
30 
32 
33 typedef struct tagDisplayAttributeMgr {
35 
37 
39 
41 {
42  return CONTAINING_RECORD(iface, DisplayAttributeMgr, ITfDisplayAttributeMgr_iface);
43 }
44 
46 {
47  TRACE("destroying %p\n", This);
48 
50 }
51 
53 {
55  *ppvOut = NULL;
56 
57  if (IsEqualIID(iid, &IID_IUnknown) || IsEqualIID(iid, &IID_ITfDisplayAttributeMgr))
58  {
59  *ppvOut = &This->ITfDisplayAttributeMgr_iface;
60  }
61 
62  if (*ppvOut)
63  {
64  ITfDisplayAttributeMgr_AddRef(iface);
65  return S_OK;
66  }
67 
68  WARN("unsupported interface: %s\n", debugstr_guid(iid));
69  return E_NOINTERFACE;
70 }
71 
73 {
75  return InterlockedIncrement(&This->refCount);
76 }
77 
79 {
81  ULONG ret;
82 
83  ret = InterlockedDecrement(&This->refCount);
84  if (ret == 0)
86  return ret;
87 }
88 
89 /*****************************************************
90  * ITfDisplayAttributeMgr functions
91  *****************************************************/
92 
94 {
96 
97  FIXME("STUB:(%p)\n",This);
98  return E_NOTIMPL;
99 }
100 
102 {
104 
105  FIXME("STUB:(%p)\n",This);
106  return E_NOTIMPL;
107 }
108 
110 {
112 
113  FIXME("STUB:(%p)\n",This);
114  return E_NOTIMPL;
115 }
116 
117 static const ITfDisplayAttributeMgrVtbl DisplayAttributeMgrVtbl =
118 {
125 };
126 
128 {
130  if (pUnkOuter)
131  return CLASS_E_NOAGGREGATION;
132 
134  if (This == NULL)
135  return E_OUTOFMEMORY;
136 
137  This->ITfDisplayAttributeMgr_iface.lpVtbl = &DisplayAttributeMgrVtbl;
138  This->refCount = 1;
139 
140  *ppOut = (IUnknown *)&This->ITfDisplayAttributeMgr_iface;
141  TRACE("returning %p\n", *ppOut);
142  return S_OK;
143 }
static HRESULT WINAPI DisplayAttributeMgr_OnUpdateInfo(ITfDisplayAttributeMgr *iface)
HRESULT DisplayAttributeMgr_Constructor(IUnknown *pUnkOuter, IUnknown **ppOut)
#define REFIID
Definition: guiddef.h:118
#define E_NOINTERFACE
Definition: winerror.h:2364
Definition: scsiwmi.h:51
#define WARN(fmt,...)
Definition: debug.h:111
ITfDisplayAttributeMgr ITfDisplayAttributeMgr_iface
static const ITfDisplayAttributeMgrVtbl DisplayAttributeMgrVtbl
static ULONG WINAPI DisplayAttributeMgr_Release(ITfDisplayAttributeMgr *iface)
static DisplayAttributeMgr * impl_from_ITfDisplayAttributeMgr(ITfDisplayAttributeMgr *iface)
const GUID * guid
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
long LONG
Definition: pedump.c:60
#define FIXME(fmt,...)
Definition: debug.h:110
smooth NULL
Definition: ftsmooth.c:416
static HRESULT WINAPI DisplayAttributeMgr_EnumDisplayAttributeInfo(ITfDisplayAttributeMgr *iface, IEnumTfDisplayAttributeInfo **ppEnum)
#define debugstr_guid
Definition: kernel32.h:35
static HRESULT WINAPI DisplayAttributeMgr_QueryInterface(ITfDisplayAttributeMgr *iface, REFIID iid, LPVOID *ppvOut)
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
static ULONG WINAPI DisplayAttributeMgr_AddRef(ITfDisplayAttributeMgr *iface)
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:403
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
LONG HRESULT
Definition: typedefs.h:77
const GUID IID_IUnknown
#define WINAPI
Definition: msvc.h:8
int ret
#define InterlockedDecrement
Definition: armddk.h:52
WINE_DEFAULT_DEBUG_CHANNEL(msctf)
#define CLASS_E_NOAGGREGATION
Definition: winerror.h:2662
#define S_OK
Definition: intsafe.h:59
#define InterlockedIncrement
Definition: armddk.h:53
static HRESULT WINAPI DisplayAttributeMgr_GetDisplayAttributeInfo(ITfDisplayAttributeMgr *iface, REFGUID guid, ITfDisplayAttributeInfo **ppInfo, CLSID *pclsidOwner)
#define E_NOTIMPL
Definition: ddrawi.h:99
unsigned int ULONG
Definition: retypes.h:1
static void DisplayAttributeMgr_Destructor(DisplayAttributeMgr *This)
#define HeapFree(x, y, z)
Definition: compat.h:402
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95
struct tagDisplayAttributeMgr DisplayAttributeMgr