ReactOS 0.4.17-dev-806-gffa4164
atl.c File Reference
#include "atlbase.h"
#include "atlcom.h"
#include "wine/debug.h"
Include dependency graph for atl.c:

Go to the source code of this file.

Macros

#define COBJMACROS
 
#define ATLVer1Size   FIELD_OFFSET(_ATL_MODULEW, dwAtlBuildVer)
 

Typedefs

typedef unsigned char cpp_bool
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (atl)
 
HRESULT WINAPI AtlAdvise (IUnknown *pUnkCP, IUnknown *pUnk, const IID *iid, DWORD *pdw)
 
HRESULT WINAPI AtlUnadvise (IUnknown *pUnkCP, const IID *iid, DWORD dw)
 
HRESULT WINAPI AtlFreeMarshalStream (IStream *stm)
 
HRESULT WINAPI AtlMarshalPtrInProc (IUnknown *pUnk, const IID *iid, IStream **pstm)
 
HRESULT WINAPI AtlUnmarshalPtr (IStream *stm, const IID *iid, IUnknown **ppUnk)
 
HDC WINAPI AtlCreateTargetDC (HDC hdc, DVTARGETDEVICE *dv)
 
void WINAPI AtlHiMetricToPixel (const SIZEL *lpHiMetric, SIZEL *lpPix)
 
void WINAPI AtlPixelToHiMetric (const SIZEL *lpPix, SIZEL *lpHiMetric)
 
IUnknown *WINAPI AtlComPtrAssign (IUnknown **pp, IUnknown *p)
 
IUnknown *WINAPI AtlComQIPtrAssign (IUnknown **pp, IUnknown *p, REFIID riid)
 
HRESULT WINAPI AtlInternalQueryInterface (void *this, const _ATL_INTMAP_ENTRY *pEntries, REFIID iid, void **ppvObject)
 
HRESULT WINAPI AtlIPersistStreamInit_Load (LPSTREAM pStm, ATL_PROPMAP_ENTRY *pMap, void *pThis, IUnknown *pUnk)
 
HRESULT WINAPI AtlIPersistStreamInit_Save (LPSTREAM pStm, BOOL fClearDirty, ATL_PROPMAP_ENTRY *pMap, void *pThis, IUnknown *pUnk)
 
HRESULT WINAPI AtlIPersistPropertyBag_Load (LPPROPERTYBAG pPropBag, LPERRORLOG pErrorLog, ATL_PROPMAP_ENTRY *pMap, void *pThis, IUnknown *pUnk)
 
HRESULT WINAPI AtlIPersistPropertyBag_Save (LPPROPERTYBAG pPropBag, BOOL fClearDirty, BOOL fSaveAll, ATL_PROPMAP_ENTRY *pMap, void *pThis, IUnknown *pUnk)
 
HRESULT WINAPI AtlModuleAddTermFunc (_ATL_MODULE *pM, _ATL_TERMFUNC *pFunc, DWORD_PTR dw)
 
HRESULT WINAPI AtlLoadTypeLib (HINSTANCE inst, LPCOLESTR lpszIndex, BSTR *pbstrPath, ITypeLib **ppTypeLib)
 
HRESULT WINAPI AtlRegisterTypeLib (HINSTANCE inst, const WCHAR *index)
 
HRESULT WINAPI AtlRegisterClassCategoriesHelper (REFCLSID clsid, const struct _ATL_CATMAP_ENTRY *catmap, BOOL reg)
 
BOOL WINAPI AtlWaitWithMessageLoop (HANDLE handle)
 
static HRESULT get_default_source (ITypeLib *typelib, const CLSID *clsid, IID *iid)
 
HRESULT WINAPI AtlGetObjectSourceInterface (IUnknown *unk, GUID *libid, IID *iid, unsigned short *major, unsigned short *minor)
 
HRESULT WINAPI AtlSetPerUserRegistration (cpp_bool bEnable)
 
HRESULT WINAPI AtlGetPerUserRegistration (cpp_bool *pbEnabled)
 
DWORD WINAPI AtlGetVersion (void *pReserved)
 
BOOL WINAPI DllMain (HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
 

Variables

static ICatRegistercatreg
 

Macro Definition Documentation

◆ ATLVer1Size

#define ATLVer1Size   FIELD_OFFSET(_ATL_MODULEW, dwAtlBuildVer)

Definition at line 33 of file atl.c.

◆ COBJMACROS

#define COBJMACROS

Definition at line 20 of file atl.c.

Typedef Documentation

◆ cpp_bool

Definition at line 35 of file atl.c.

Function Documentation

◆ AtlAdvise()

HRESULT WINAPI AtlAdvise ( IUnknown pUnkCP,
IUnknown pUnk,
const IID iid,
DWORD pdw 
)

Definition at line 42 of file atl.c.

43{
47
48 TRACE("%p %p %p %p\n", pUnkCP, pUnk, iid, pdw);
49
50 if(!pUnkCP)
51 return E_INVALIDARG;
52
53 hres = IUnknown_QueryInterface(pUnkCP, &IID_IConnectionPointContainer, (void**)&container);
54 if(FAILED(hres))
55 return hres;
56
57 hres = IConnectionPointContainer_FindConnectionPoint(container, iid, &cp);
58 IConnectionPointContainer_Release(container);
59 if(FAILED(hres))
60 return hres;
61
62 hres = IConnectionPoint_Advise(cp, pUnk, pdw);
63 IConnectionPoint_Release(cp);
64 return hres;
65}
#define E_INVALIDARG
Definition: ddrawi.h:101
static void *static void *static LPDIRECTPLAY IUnknown * pUnk
Definition: dplayx.c:30
#define FAILED(hr)
Definition: intsafe.h:51
POINT cp
Definition: magnifier.c:59
HRESULT hres
Definition: protocol.c:465
const GUID IID_IConnectionPointContainer
#define TRACE(s)
Definition: solgame.cpp:4

Referenced by CExplorerBand::_CreateTreeView(), CAddressEditBox::Init(), CSearchBar::OnInitDialog(), CBrandBand::SetSite(), CInternetToolbar::SetSite(), test_cp(), and CSearchBar::TrySubscribeToSearchEvents().

◆ AtlComPtrAssign()

IUnknown *WINAPI AtlComPtrAssign ( IUnknown **  pp,
IUnknown p 
)

Definition at line 172 of file atl.c.

173{
174 TRACE("(%p %p)\n", pp, p);
175
176 if (p) IUnknown_AddRef(p);
177 if (*pp) IUnknown_Release(*pp);
178 *pp = p;
179 return p;
180}
GLfloat GLfloat p
Definition: glext.h:8902

◆ AtlComQIPtrAssign()

IUnknown *WINAPI AtlComQIPtrAssign ( IUnknown **  pp,
IUnknown p,
REFIID  riid 
)

Definition at line 185 of file atl.c.

186{
187 IUnknown *new_p = NULL;
188
189 TRACE("(%p %p %s)\n", pp, p, debugstr_guid(riid));
190
191 if (p) IUnknown_QueryInterface(p, riid, (void **)&new_p);
192 if (*pp) IUnknown_Release(*pp);
193 *pp = new_p;
194 return new_p;
195}
#define NULL
Definition: types.h:112
REFIID riid
Definition: atlbase.h:39
#define debugstr_guid
Definition: kernel32.h:35

◆ AtlCreateTargetDC()

HDC WINAPI AtlCreateTargetDC ( HDC  hdc,
DVTARGETDEVICE *  dv 
)

Definition at line 125 of file atl.c.

126{
127 const WCHAR *driver = NULL, *device = NULL, *port = NULL;
129
130 TRACE( "(%p, %p)\n", hdc, dv );
131
132 if (dv)
133 {
134 if (dv->tdDriverNameOffset) driver = (WCHAR *)((char *)dv + dv->tdDriverNameOffset);
135 if (dv->tdDeviceNameOffset) device = (WCHAR *)((char *)dv + dv->tdDeviceNameOffset);
136 if (dv->tdPortNameOffset) port = (WCHAR *)((char *)dv + dv->tdPortNameOffset);
137 if (dv->tdExtDevmodeOffset) devmode = (DEVMODEW *)((char *)dv + dv->tdExtDevmodeOffset);
138 }
139 else
140 {
141 if (hdc) return hdc;
142 driver = L"display";
143 }
144 return CreateDCW( driver, device, port, devmode );
145}
DEVMODEW devmode
USHORT port
Definition: uri.c:210
#define L(x)
Definition: resources.c:13
HDC hdc
Definition: main.c:9
struct @1851::@1852 driver
short WCHAR
Definition: pedump.c:58
Definition: devices.h:37
HDC WINAPI CreateDCW(_In_opt_ LPCWSTR pszDriver, _In_opt_ LPCWSTR pszDevice, _In_opt_ LPCWSTR psz, _In_opt_ const DEVMODEW *pdmInit)

◆ AtlFreeMarshalStream()

HRESULT WINAPI AtlFreeMarshalStream ( IStream stm)

Definition at line 98 of file atl.c.

99{
100 FIXME("%p\n", stm);
101 return S_OK;
102}
#define FIXME(fmt,...)
Definition: precomp.h:53
#define S_OK
Definition: intsafe.h:52

◆ AtlGetObjectSourceInterface()

HRESULT WINAPI AtlGetObjectSourceInterface ( IUnknown unk,
GUID libid,
IID iid,
unsigned short major,
unsigned short minor 
)

Definition at line 883 of file atl.c.

884{
888 IPersist *persist;
889 IDispatch *disp;
891
892 TRACE("(%p %p %p %p %p)\n", unk, libid, iid, major, minor);
893
894 hres = IUnknown_QueryInterface(unk, &IID_IDispatch, (void**)&disp);
895 if(FAILED(hres))
896 return hres;
897
898 hres = IDispatch_GetTypeInfo(disp, 0, 0, &typeinfo);
899 IDispatch_Release(disp);
900 if(FAILED(hres))
901 return hres;
902
903 hres = ITypeInfo_GetContainingTypeLib(typeinfo, &typelib, 0);
904 ITypeInfo_Release(typeinfo);
905 if(SUCCEEDED(hres)) {
906 TLIBATTR *attr;
907
908 hres = ITypeLib_GetLibAttr(typelib, &attr);
909 if(SUCCEEDED(hres)) {
910 *libid = attr->guid;
911 *major = attr->wMajorVerNum;
912 *minor = attr->wMinorVerNum;
913 ITypeLib_ReleaseTLibAttr(typelib, attr);
914 }else {
915 ITypeLib_Release(typelib);
916 }
917 }
918 if(FAILED(hres))
919 return hres;
920
921 hres = IUnknown_QueryInterface(unk, &IID_IProvideClassInfo2, (void**)&classinfo);
922 if(SUCCEEDED(hres)) {
923 hres = IProvideClassInfo2_GetGUID(classinfo, GUIDKIND_DEFAULT_SOURCE_DISP_IID, iid);
924 IProvideClassInfo2_Release(classinfo);
925 ITypeLib_Release(typelib);
926 return hres;
927 }
928
929 hres = IUnknown_QueryInterface(unk, &IID_IPersist, (void**)&persist);
930 if(SUCCEEDED(hres)) {
931 CLSID clsid;
932
933 hres = IPersist_GetClassID(persist, &clsid);
934 if(SUCCEEDED(hres))
936 IPersist_Release(persist);
937 }
938
939 return hres;
940}
static HRESULT get_default_source(ITypeLib *typelib, const CLSID *clsid, IID *iid)
Definition: atl.c:831
#define SUCCEEDED(hr)
Definition: intsafe.h:50
const CLSID * clsid
Definition: msctf.cpp:50
const GUID IID_IProvideClassInfo2
const GUID IID_IDispatch
const GUID IID_IPersist
Definition: proxy.cpp:14
#define minor(rdev)
Definition: propsheet.cpp:929
#define major(rdev)
Definition: propsheet.cpp:928
Definition: cookie.c:202

Referenced by test_source_iface().

◆ AtlGetPerUserRegistration()

HRESULT WINAPI AtlGetPerUserRegistration ( cpp_bool pbEnabled)

Definition at line 956 of file atl.c.

957{
958 FIXME("stub: returning false\n");
959 *pbEnabled = 0;
960 return S_OK;
961}

Referenced by test_regcat().

◆ AtlGetVersion()

DWORD WINAPI AtlGetVersion ( void pReserved)

Definition at line 968 of file atl.c.

969{
970 TRACE("version %04x (%p)\n", _ATL_VER, pReserved);
971 return _ATL_VER;
972}
#define _ATL_VER
Definition: atlbase.h:36
_Out_ PVOID pReserved
Definition: netsh.h:77

◆ AtlHiMetricToPixel()

void WINAPI AtlHiMetricToPixel ( const SIZEL lpHiMetric,
SIZEL lpPix 
)

Definition at line 150 of file atl.c.

151{
152 HDC dc = GetDC(NULL);
153 lpPix->cx = lpHiMetric->cx * GetDeviceCaps( dc, LOGPIXELSX ) / 100;
154 lpPix->cy = lpHiMetric->cy * GetDeviceCaps( dc, LOGPIXELSY ) / 100;
155 ReleaseDC( NULL, dc );
156}
HDC dc
Definition: cylfrac.c:34
static HDC
Definition: imagelist.c:88
LONG cx
Definition: kdterminal.h:27
LONG cy
Definition: kdterminal.h:28
int WINAPI GetDeviceCaps(_In_opt_ HDC, _In_ int)
#define LOGPIXELSY
Definition: wingdi.h:719
#define LOGPIXELSX
Definition: wingdi.h:718
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
HDC WINAPI GetDC(_In_opt_ HWND)

◆ AtlInternalQueryInterface()

HRESULT WINAPI AtlInternalQueryInterface ( void this,
const _ATL_INTMAP_ENTRY pEntries,
REFIID  iid,
void **  ppvObject 
)

Definition at line 200 of file atl.c.

201{
202 int i = 0;
204 TRACE("(%p, %p, %s, %p)\n",this, pEntries, debugstr_guid(iid), ppvObject);
205
206 if (IsEqualGUID(iid,&IID_IUnknown))
207 {
208 TRACE("Returning IUnknown\n");
209 *ppvObject = ((LPSTR)this+pEntries[0].dw);
210 IUnknown_AddRef((IUnknown*)*ppvObject);
211 return S_OK;
212 }
213
214 while (pEntries[i].pFunc != 0)
215 {
216 TRACE("Trying entry %i (%s %Ix %p)\n",i,debugstr_guid(pEntries[i].piid),
217 pEntries[i].dw, pEntries[i].pFunc);
218
219 if (!pEntries[i].piid || IsEqualGUID(iid,pEntries[i].piid))
220 {
221 TRACE("MATCH\n");
222 if (pEntries[i].pFunc == (_ATL_CREATORARGFUNC*)1)
223 {
224 TRACE("Offset\n");
225 *ppvObject = ((LPSTR)this+pEntries[i].dw);
226 IUnknown_AddRef((IUnknown*)*ppvObject);
227 return S_OK;
228 }
229 else
230 {
231 TRACE("Function\n");
232 rc = pEntries[i].pFunc(this, iid, ppvObject, pEntries[i].dw);
233 if(rc==S_OK || pEntries[i].piid)
234 return rc;
235 }
236 }
237 i++;
238 }
239 TRACE("Done returning (0x%lx)\n",rc);
240 return rc;
241}
const GUID IID_IUnknown
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
REFIID LPVOID DWORD_PTR dw
Definition: atlbase.h:40
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147
_ATL_CREATORARGFUNC * pFunc
Definition: atlbase.h:238
char * LPSTR
Definition: typedefs.h:51
#define E_NOINTERFACE
Definition: winerror.h:3479

◆ AtlIPersistPropertyBag_Load()

HRESULT WINAPI AtlIPersistPropertyBag_Load ( LPPROPERTYBAG  pPropBag,
LPERRORLOG  pErrorLog,
ATL_PROPMAP_ENTRY pMap,
void pThis,
IUnknown pUnk 
)

Definition at line 269 of file atl.c.

272{
273 FIXME("(%p, %p, %p, %p, %p)\n", pPropBag, pErrorLog, pMap, pThis, pUnk);
274
275 return S_OK;
276}

◆ AtlIPersistPropertyBag_Save()

HRESULT WINAPI AtlIPersistPropertyBag_Save ( LPPROPERTYBAG  pPropBag,
BOOL  fClearDirty,
BOOL  fSaveAll,
ATL_PROPMAP_ENTRY pMap,
void pThis,
IUnknown pUnk 
)

Definition at line 281 of file atl.c.

284{
285 FIXME("(%p, %d, %d, %p, %p, %p)\n", pPropBag, fClearDirty, fSaveAll, pMap, pThis, pUnk);
286
287 return S_OK;
288}

◆ AtlIPersistStreamInit_Load()

HRESULT WINAPI AtlIPersistStreamInit_Load ( LPSTREAM  pStm,
ATL_PROPMAP_ENTRY pMap,
void pThis,
IUnknown pUnk 
)

Definition at line 246 of file atl.c.

248{
249 FIXME("(%p, %p, %p, %p)\n", pStm, pMap, pThis, pUnk);
250
251 return S_OK;
252}

◆ AtlIPersistStreamInit_Save()

HRESULT WINAPI AtlIPersistStreamInit_Save ( LPSTREAM  pStm,
BOOL  fClearDirty,
ATL_PROPMAP_ENTRY pMap,
void pThis,
IUnknown pUnk 
)

Definition at line 257 of file atl.c.

260{
261 FIXME("(%p, %d, %p, %p, %p)\n", pStm, fClearDirty, pMap, pThis, pUnk);
262
263 return S_OK;
264}

◆ AtlLoadTypeLib()

HRESULT WINAPI AtlLoadTypeLib ( HINSTANCE  inst,
LPCOLESTR  lpszIndex,
BSTR pbstrPath,
ITypeLib **  ppTypeLib 
)

Definition at line 337 of file atl.c.

339{
340 size_t path_len, index_len;
342 WCHAR *path;
344
345 TRACE("(%p %s %p %p)\n", inst, debugstr_w(lpszIndex), pbstrPath, ppTypeLib);
346
347 index_len = lpszIndex ? lstrlenW(lpszIndex) : 0;
348 path = malloc((MAX_PATH+index_len)*sizeof(WCHAR) + sizeof(L".tlb"));
349 if(!path)
350 return E_OUTOFMEMORY;
351
353 if(!path_len) {
354 free(path);
356 }
357
358 if(index_len)
359 memcpy(path+path_len, lpszIndex, (index_len+1)*sizeof(WCHAR));
360
362 if(FAILED(hres)) {
363 WCHAR *ptr;
364
365 for(ptr = path+path_len-1; ptr > path && *ptr != '\\' && *ptr != '.'; ptr--);
366 if(*ptr != '.')
367 ptr = path+path_len;
368 lstrcpyW(ptr, L".tlb");
370 }
371
372 if(SUCCEEDED(hres)) {
373 *pbstrPath = SysAllocString(path);
374 if(!*pbstrPath) {
375 ITypeLib_Release(typelib);
377 }
378 }
379
380 free(path);
381 if(FAILED(hres))
382 return hres;
383
384 *ppTypeLib = typelib;
385 return S_OK;
386}
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define free
Definition: debug_ros.c:5
#define malloc
Definition: debug_ros.c:4
#define MAX_PATH
Definition: compat.h:34
#define lstrcpyW
Definition: compat.h:749
#define lstrlenW
Definition: compat.h:750
DWORD WINAPI GetModuleFileNameW(HINSTANCE hModule, LPWSTR lpFilename, DWORD nSize)
Definition: loader.c:600
HRESULT WINAPI LoadTypeLib(const OLECHAR *szFile, ITypeLib **pptLib)
Definition: typelib.c:434
#define debugstr_w
Definition: kernel32.h:32
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
static PVOID ptr
Definition: dispmode.c:27
static DWORD path_len
Definition: batch.c:31
BSTR WINAPI SysAllocString(LPCOLESTR str)
Definition: oleaut.c:240
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
static HRESULT HRESULT_FROM_WIN32(unsigned int x)
Definition: winerror.h:210

Referenced by AtlModuleLoadTypeLib(), AtlRegisterTypeLib(), and test_typelib().

◆ AtlMarshalPtrInProc()

HRESULT WINAPI AtlMarshalPtrInProc ( IUnknown pUnk,
const IID iid,
IStream **  pstm 
)

Definition at line 107 of file atl.c.

108{
109 FIXME("%p %p %p\n", pUnk, iid, pstm);
110 return E_FAIL;
111}
#define E_FAIL
Definition: ddrawi.h:102

◆ AtlModuleAddTermFunc()

HRESULT WINAPI AtlModuleAddTermFunc ( _ATL_MODULE pM,
_ATL_TERMFUNC *  pFunc,
DWORD_PTR  dw 
)

Definition at line 293 of file atl.c.

294{
295 _ATL_TERMFUNC_ELEM *termfunc_elem;
296
297 TRACE("version %04x (%p %p %Id)\n", _ATL_VER, pM, pFunc, dw);
298
299 if (_ATL_VER > _ATL_VER_30 || pM->cbSize > ATLVer1Size) {
300 termfunc_elem = malloc(sizeof(*termfunc_elem));
301 termfunc_elem->pFunc = pFunc;
302 termfunc_elem->dw = dw;
303 termfunc_elem->pNext = pM->m_pTermFuncs;
304
305 pM->m_pTermFuncs = termfunc_elem;
306 }
307
308 return S_OK;
309}
#define ATLVer1Size
Definition: atl.c:33
#define _ATL_VER_30
Definition: atlbase.h:28
UINT cbSize
Definition: atlbase.h:192
_ATL_TERMFUNC_ELEM * m_pTermFuncs
Definition: atlbase.h:194
struct _ATL_TERMFUNC_ELEM_TAG * pNext
Definition: atlbase.h:119
_ATL_TERMFUNC * pFunc
Definition: atlbase.h:117

Referenced by test_term().

◆ AtlPixelToHiMetric()

void WINAPI AtlPixelToHiMetric ( const SIZEL lpPix,
SIZEL lpHiMetric 
)

Definition at line 161 of file atl.c.

162{
163 HDC dc = GetDC(NULL);
164 lpHiMetric->cx = 100 * lpPix->cx / GetDeviceCaps( dc, LOGPIXELSX );
165 lpHiMetric->cy = 100 * lpPix->cy / GetDeviceCaps( dc, LOGPIXELSY );
166 ReleaseDC( NULL, dc );
167}

Referenced by IOCS_OnSize().

◆ AtlRegisterClassCategoriesHelper()

HRESULT WINAPI AtlRegisterClassCategoriesHelper ( REFCLSID  clsid,
const struct _ATL_CATMAP_ENTRY catmap,
BOOL  reg 
)

Definition at line 747 of file atl.c.

748{
749 const struct _ATL_CATMAP_ENTRY *iter;
751
752 TRACE("(%s %p %x)\n", debugstr_guid(clsid), catmap, reg);
753
754 if(!catmap)
755 return S_OK;
756
757 if(!catreg) {
758 ICatRegister *new_catreg;
759
760 hres = CoCreateInstance(&CLSID_StdComponentCategoriesMgr, NULL, CLSCTX_INPROC_SERVER,
761 &IID_ICatRegister, (void**)&new_catreg);
762 if(FAILED(hres))
763 return hres;
764
765 if(InterlockedCompareExchangePointer((void**)&catreg, new_catreg, NULL))
766 ICatRegister_Release(new_catreg);
767 }
768
769 for(iter = catmap; iter->iType != _ATL_CATMAP_ENTRY_END; iter++) {
770 CATID catid = *iter->pcatid; /* For stupid lack of const in ICatRegister declaration. */
771
773 if(reg)
774 hres = ICatRegister_RegisterClassImplCategories(catreg, clsid, 1, &catid);
775 else
776 hres = ICatRegister_UnRegisterClassImplCategories(catreg, clsid, 1, &catid);
777 }else {
778 if(reg)
779 hres = ICatRegister_RegisterClassReqCategories(catreg, clsid, 1, &catid);
780 else
781 hres = ICatRegister_UnRegisterClassReqCategories(catreg, clsid, 1, &catid);
782 }
783 if(FAILED(hres))
784 return hres;
785 }
786
787 if(!reg) {
788 WCHAR reg_path[256] = L"CLSID\\", *ptr = reg_path+6;
789
790 ptr += StringFromGUID2(clsid, ptr, 64)-1;
791 *ptr++ = '\\';
792
793 lstrcpyW(ptr, L"Implemented Categories");
795
796 lstrcpyW(ptr, L"Required Categories");
798 }
799
800 return S_OK;
801}
LONG WINAPI RegDeleteKeyW(_In_ HKEY hKey, _In_ LPCWSTR lpSubKey)
Definition: reg.c:1239
static ICatRegister * catreg
Definition: atl.c:37
INT WINAPI StringFromGUID2(REFGUID guid, LPOLESTR str, INT cmax)
Definition: combase.c:1525
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, IUnknown *outer, DWORD cls_context, REFIID riid, void **obj)
Definition: combase.c:1685
static int reg
Definition: i386-dis.c:1290
#define _ATL_CATMAP_ENTRY_END
Definition: atlbase.h:253
#define _ATL_CATMAP_ENTRY_IMPLEMENTED
Definition: atlbase.h:254
#define InterlockedCompareExchangePointer
Definition: interlocked.h:144
GUID catid
Definition: msctf.idl:629
Definition: atlbase.h:248
const CATID * pcatid
Definition: atlbase.h:250
int iType
Definition: atlbase.h:249
#define HKEY_CLASSES_ROOT
Definition: winreg.h:10

Referenced by AtlComModuleRegisterServer(), AtlModuleRegisterServer(), and test_regcat().

◆ AtlRegisterTypeLib()

HRESULT WINAPI AtlRegisterTypeLib ( HINSTANCE  inst,
const WCHAR index 
)

Definition at line 393 of file atl.c.

394{
396 BSTR path;
398
399 TRACE("(%p %s)\n", inst, debugstr_w(index));
400
401 hres = AtlLoadTypeLib(inst, index, &path, &typelib);
402 if(FAILED(hres))
403 return hres;
404
405 hres = RegisterTypeLib(typelib, path, NULL); /* FIXME: pass help directory */
406 ITypeLib_Release(typelib);
408 return hres;
409}
HRESULT WINAPI AtlLoadTypeLib(HINSTANCE inst, LPCOLESTR lpszIndex, BSTR *pbstrPath, ITypeLib **ppTypeLib)
Definition: atl.c:337
OLECHAR * BSTR
Definition: compat.h:2293
HRESULT WINAPI RegisterTypeLib(ITypeLib *ptlib, const WCHAR *szFullPath, const WCHAR *szHelpDir)
Definition: typelib.c:612
GLuint index
Definition: glext.h:6031
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
Definition: oleaut.c:273

Referenced by AtlComModuleRegisterServer(), AtlModuleRegisterServer(), and AtlModuleRegisterTypeLib().

◆ AtlSetPerUserRegistration()

HRESULT WINAPI AtlSetPerUserRegistration ( cpp_bool  bEnable)

Definition at line 947 of file atl.c.

948{
949 FIXME("stub: bEnable: %d\n", bEnable);
950 return E_NOTIMPL;
951}
#define E_NOTIMPL
Definition: ddrawi.h:99
_In_ BOOL bEnable
Definition: winddi.h:3426

◆ AtlUnadvise()

HRESULT WINAPI AtlUnadvise ( IUnknown pUnkCP,
const IID iid,
DWORD  dw 
)

Definition at line 70 of file atl.c.

71{
75
76 TRACE("%p %p %ld\n", pUnkCP, iid, dw);
77
78 if(!pUnkCP)
79 return E_INVALIDARG;
80
81 hres = IUnknown_QueryInterface(pUnkCP, &IID_IConnectionPointContainer, (void**)&container);
82 if(FAILED(hres))
83 return hres;
84
85 hres = IConnectionPointContainer_FindConnectionPoint(container, iid, &cp);
86 IConnectionPointContainer_Release(container);
87 if(FAILED(hres))
88 return hres;
89
90 hres = IConnectionPoint_Unadvise(cp, dw);
91 IConnectionPoint_Release(cp);
92 return hres;
93}

Referenced by CExplorerBand::_DestroyTreeView(), CAddressEditBox::SetOwner(), CBrandBand::SetSite(), CInternetToolbar::SetSite(), and test_cp().

◆ AtlUnmarshalPtr()

HRESULT WINAPI AtlUnmarshalPtr ( IStream stm,
const IID iid,
IUnknown **  ppUnk 
)

Definition at line 116 of file atl.c.

117{
118 FIXME("%p %p %p\n", stm, iid, ppUnk);
119 return E_FAIL;
120}

◆ AtlWaitWithMessageLoop()

BOOL WINAPI AtlWaitWithMessageLoop ( HANDLE  handle)

Definition at line 806 of file atl.c.

807{
808 MSG msg;
809 DWORD res;
810
811 TRACE("(%p)\n", handle);
812
813 while(1) {
815 switch(res) {
816 case WAIT_OBJECT_0:
817 return TRUE;
818 case WAIT_OBJECT_0+1:
819 if(GetMessageW(&msg, NULL, 0, 0) < 0)
820 return FALSE;
821
824 break;
825 default:
826 return FALSE;
827 }
828 }
829}
#define msg(x)
Definition: auth_time.c:54
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define INFINITE
Definition: serial.h:102
unsigned long DWORD
Definition: ntddk_ex.h:95
GLuint res
Definition: glext.h:9613
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1829
#define WAIT_OBJECT_0
Definition: winbase.h:383
BOOL WINAPI TranslateMessage(_In_ const MSG *)
BOOL WINAPI GetMessageW(_Out_ LPMSG, _In_opt_ HWND, _In_ UINT, _In_ UINT)
#define QS_ALLINPUT
Definition: winuser.h:914
DWORD WINAPI MsgWaitForMultipleObjects(_In_ DWORD nCount, _In_reads_opt_(nCount) CONST HANDLE *pHandles, _In_ BOOL fWaitAll, _In_ DWORD dwMilliseconds, _In_ DWORD dwWakeMask)
LRESULT WINAPI DispatchMessageW(_In_ const MSG *)

◆ DllMain()

BOOL WINAPI DllMain ( HINSTANCE  hinstDLL,
DWORD  fdwReason,
LPVOID  lpvReserved 
)

Definition at line 974 of file atl.c.

975{
976 TRACE("(0x%p, %ld, %p)\n", hinstDLL, fdwReason, lpvReserved);
977
978 switch(fdwReason) {
981 break;
983 if (lpvReserved) break;
984 if(catreg)
985 ICatRegister_Release(catreg);
986 }
987
988 return TRUE;
989}
static DWORD const fdwReason
#define DLL_PROCESS_ATTACH
Definition: compat.h:131
#define DLL_PROCESS_DETACH
Definition: compat.h:130
BOOL WINAPI DisableThreadLibraryCalls(IN HMODULE hLibModule)
Definition: loader.c:85
static IN DWORD IN LPVOID lpvReserved

◆ get_default_source()

static HRESULT get_default_source ( ITypeLib typelib,
const CLSID clsid,
IID iid 
)
static

Definition at line 831 of file atl.c.

832{
833 ITypeInfo *typeinfo, *src_typeinfo = NULL;
834 TYPEATTR *attr;
835 int type_flags;
836 unsigned i;
838
839 hres = ITypeLib_GetTypeInfoOfGuid(typelib, clsid, &typeinfo);
840 if(FAILED(hres))
841 return hres;
842
843 hres = ITypeInfo_GetTypeAttr(typeinfo, &attr);
844 if(FAILED(hres)) {
845 ITypeInfo_Release(typeinfo);
846 return hres;
847 }
848
849 for(i=0; i < attr->cImplTypes; i++) {
850 hres = ITypeInfo_GetImplTypeFlags(typeinfo, i, &type_flags);
851 if(SUCCEEDED(hres) && type_flags == (IMPLTYPEFLAG_FSOURCE|IMPLTYPEFLAG_FDEFAULT)) {
852 HREFTYPE ref;
853
854 hres = ITypeInfo_GetRefTypeOfImplType(typeinfo, i, &ref);
855 if(SUCCEEDED(hres))
856 hres = ITypeInfo_GetRefTypeInfo(typeinfo, ref, &src_typeinfo);
857 break;
858 }
859 }
860
861 ITypeInfo_ReleaseTypeAttr(typeinfo, attr);
862 ITypeInfo_Release(typeinfo);
863 if(FAILED(hres))
864 return hres;
865
866 if(!src_typeinfo) {
867 *iid = IID_NULL;
868 return S_OK;
869 }
870
871 hres = ITypeInfo_GetTypeAttr(src_typeinfo, &attr);
872 if(SUCCEEDED(hres)) {
873 *iid = attr->guid;
874 ITypeInfo_ReleaseTypeAttr(src_typeinfo, attr);
875 }
876 ITypeInfo_Release(src_typeinfo);
877 return hres;
878}
#define IID_NULL
Definition: guiddef.h:98
Definition: send.c:48

Referenced by AtlGetObjectSourceInterface().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( atl  )

Variable Documentation

◆ catreg

ICatRegister* catreg
static