ReactOS 0.4.15-dev-7958-gcd0bb1a
atl.c File Reference
#include "wine/atlbase.h"
#include "wine/atlcom.h"
#include "wine/debug.h"
#include "wine/heap.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

HINSTANCE atl_instance
 
static ICatRegistercatreg
 

Macro Definition Documentation

◆ ATLVer1Size

#define ATLVer1Size   FIELD_OFFSET(_ATL_MODULEW, dwAtlBuildVer)

Definition at line 34 of file atl.c.

◆ COBJMACROS

#define COBJMACROS

Definition at line 20 of file atl.c.

Typedef Documentation

◆ cpp_bool

Definition at line 38 of file atl.c.

Function Documentation

◆ AtlAdvise()

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

Definition at line 45 of file atl.c.

46{
50
51 TRACE("%p %p %p %p\n", pUnkCP, pUnk, iid, pdw);
52
53 if(!pUnkCP)
54 return E_INVALIDARG;
55
56 hres = IUnknown_QueryInterface(pUnkCP, &IID_IConnectionPointContainer, (void**)&container);
57 if(FAILED(hres))
58 return hres;
59
60 hres = IConnectionPointContainer_FindConnectionPoint(container, iid, &cp);
61 IConnectionPointContainer_Release(container);
62 if(FAILED(hres))
63 return hres;
64
65 hres = IConnectionPoint_Advise(cp, pUnk, pdw);
66 IConnectionPoint_Release(cp);
67 return hres;
68}
#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 CAddressEditBox::Init(), CExplorerBand::InitializeExplorerBand(), CSearchBar::OnInitDialog(), CBrandBand::SetSite(), CInternetToolbar::SetSite(), test_cp(), and CSearchBar::TrySubscribeToSearchEvents().

◆ AtlComPtrAssign()

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

Definition at line 176 of file atl.c.

177{
178 TRACE("(%p %p)\n", pp, p);
179
180 if (p) IUnknown_AddRef(p);
181 if (*pp) IUnknown_Release(*pp);
182 *pp = p;
183 return p;
184}
GLfloat GLfloat p
Definition: glext.h:8902

◆ AtlComQIPtrAssign()

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

Definition at line 189 of file atl.c.

190{
191 IUnknown *new_p = NULL;
192
193 TRACE("(%p %p %s)\n", pp, p, debugstr_guid(riid));
194
195 if (p) IUnknown_QueryInterface(p, riid, (void **)&new_p);
196 if (*pp) IUnknown_Release(*pp);
197 *pp = new_p;
198 return new_p;
199}
#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 128 of file atl.c.

129{
130 static const WCHAR displayW[] = {'d','i','s','p','l','a','y',0};
131 const WCHAR *driver = NULL, *device = NULL, *port = NULL;
133
134 TRACE( "(%p, %p)\n", hdc, dv );
135
136 if (dv)
137 {
138 if (dv->tdDriverNameOffset) driver = (WCHAR *)((char *)dv + dv->tdDriverNameOffset);
139 if (dv->tdDeviceNameOffset) device = (WCHAR *)((char *)dv + dv->tdDeviceNameOffset);
140 if (dv->tdPortNameOffset) port = (WCHAR *)((char *)dv + dv->tdPortNameOffset);
141 if (dv->tdExtDevmodeOffset) devmode = (DEVMODEW *)((char *)dv + dv->tdExtDevmodeOffset);
142 }
143 else
144 {
145 if (hdc) return hdc;
147 }
148 return CreateDCW( driver, device, port, devmode );
149}
DEVMODEW devmode
USHORT port
Definition: uri.c:228
HDC hdc
Definition: main.c:9
static const WCHAR displayW[]
Definition: icm.c:30
struct @1669::@1670 driver
Definition: devices.h:37
HDC WINAPI CreateDCW(_In_opt_ LPCWSTR pszDriver, _In_opt_ LPCWSTR pszDevice, _In_opt_ LPCWSTR psz, _In_opt_ const DEVMODEW *pdmInit)
__wchar_t WCHAR
Definition: xmlstorage.h:180

◆ AtlFreeMarshalStream()

HRESULT WINAPI AtlFreeMarshalStream ( IStream stm)

Definition at line 101 of file atl.c.

102{
103 FIXME("%p\n", stm);
104 return S_OK;
105}
#define FIXME(fmt,...)
Definition: debug.h:111
#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 888 of file atl.c.

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

Referenced by test_source_iface().

◆ AtlGetPerUserRegistration()

HRESULT WINAPI AtlGetPerUserRegistration ( cpp_bool pbEnabled)

Definition at line 961 of file atl.c.

962{
963 FIXME("stub: returning false\n");
964 *pbEnabled = 0;
965 return S_OK;
966}

Referenced by test_regcat().

◆ AtlGetVersion()

DWORD WINAPI AtlGetVersion ( void pReserved)

Definition at line 973 of file atl.c.

974{
975 TRACE("version %04x (%p)\n", _ATL_VER, pReserved);
976 return _ATL_VER;
977}
#define _ATL_VER
Definition: atlbase.h:36

◆ AtlHiMetricToPixel()

void WINAPI AtlHiMetricToPixel ( const SIZEL lpHiMetric,
SIZEL lpPix 
)

Definition at line 154 of file atl.c.

155{
156 HDC dc = GetDC(NULL);
157 lpPix->cx = lpHiMetric->cx * GetDeviceCaps( dc, LOGPIXELSX ) / 100;
158 lpPix->cy = lpHiMetric->cy * GetDeviceCaps( dc, LOGPIXELSY ) / 100;
159 ReleaseDC( NULL, dc );
160}
static const WCHAR dc[]
static HDC
Definition: imagelist.c:92
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 204 of file atl.c.

205{
206 int i = 0;
208 TRACE("(%p, %p, %s, %p)\n",this, pEntries, debugstr_guid(iid), ppvObject);
209
210 if (IsEqualGUID(iid,&IID_IUnknown))
211 {
212 TRACE("Returning IUnknown\n");
213 *ppvObject = ((LPSTR)this+pEntries[0].dw);
214 IUnknown_AddRef((IUnknown*)*ppvObject);
215 return S_OK;
216 }
217
218 while (pEntries[i].pFunc != 0)
219 {
220 TRACE("Trying entry %i (%s %lx %p)\n",i,debugstr_guid(pEntries[i].piid),
221 pEntries[i].dw, pEntries[i].pFunc);
222
223 if (!pEntries[i].piid || IsEqualGUID(iid,pEntries[i].piid))
224 {
225 TRACE("MATCH\n");
226 if (pEntries[i].pFunc == (_ATL_CREATORARGFUNC*)1)
227 {
228 TRACE("Offset\n");
229 *ppvObject = ((LPSTR)this+pEntries[i].dw);
230 IUnknown_AddRef((IUnknown*)*ppvObject);
231 return S_OK;
232 }
233 else
234 {
235 TRACE("Function\n");
236 rc = pEntries[i].pFunc(this, iid, ppvObject, pEntries[i].dw);
237 if(rc==S_OK || pEntries[i].piid)
238 return rc;
239 }
240 }
241 i++;
242 }
243 TRACE("Done returning (0x%x)\n",rc);
244 return rc;
245}
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
_In_ void _In_ PCCERT_CONTEXT _In_opt_ LPFILETIME _In_ DWORD _In_ DWORD _Outptr_opt_ void ** ppvObject
Definition: wincrypt.h:6082
#define E_NOINTERFACE
Definition: winerror.h:2364
char * LPSTR
Definition: xmlstorage.h:182

◆ AtlIPersistPropertyBag_Load()

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

Definition at line 273 of file atl.c.

276{
277 FIXME("(%p, %p, %p, %p, %p)\n", pPropBag, pErrorLog, pMap, pThis, pUnk);
278
279 return S_OK;
280}

◆ AtlIPersistPropertyBag_Save()

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

Definition at line 285 of file atl.c.

288{
289 FIXME("(%p, %d, %d, %p, %p, %p)\n", pPropBag, fClearDirty, fSaveAll, pMap, pThis, pUnk);
290
291 return S_OK;
292}

◆ AtlIPersistStreamInit_Load()

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

Definition at line 250 of file atl.c.

252{
253 FIXME("(%p, %p, %p, %p)\n", pStm, pMap, pThis, pUnk);
254
255 return S_OK;
256}

◆ AtlIPersistStreamInit_Save()

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

Definition at line 261 of file atl.c.

264{
265 FIXME("(%p, %d, %p, %p, %p)\n", pStm, fClearDirty, pMap, pThis, pUnk);
266
267 return S_OK;
268}

◆ AtlLoadTypeLib()

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

Definition at line 341 of file atl.c.

343{
344 size_t path_len, index_len;
346 WCHAR *path;
348
349 static const WCHAR tlb_extW[] = {'.','t','l','b',0};
350
351 TRACE("(%p %s %p %p)\n", inst, debugstr_w(lpszIndex), pbstrPath, ppTypeLib);
352
353 index_len = lpszIndex ? lstrlenW(lpszIndex) : 0;
354 path = heap_alloc((MAX_PATH+index_len)*sizeof(WCHAR) + sizeof(tlb_extW));
355 if(!path)
356 return E_OUTOFMEMORY;
357
359 if(!path_len) {
362 }
363
364 if(index_len)
365 memcpy(path+path_len, lpszIndex, (index_len+1)*sizeof(WCHAR));
366
368 if(FAILED(hres)) {
369 WCHAR *ptr;
370
371 for(ptr = path+path_len-1; ptr > path && *ptr != '\\' && *ptr != '.'; ptr--);
372 if(*ptr != '.')
373 ptr = path+path_len;
374 memcpy(ptr, tlb_extW, sizeof(tlb_extW));
376 }
377
378 if(SUCCEEDED(hres)) {
379 *pbstrPath = SysAllocString(path);
380 if(!*pbstrPath) {
381 ITypeLib_Release(typelib);
383 }
384 }
385
387 if(FAILED(hres))
388 return hres;
389
390 *ppTypeLib = typelib;
391 return S_OK;
392}
static void * heap_alloc(size_t len)
Definition: appwiz.h:66
static BOOL heap_free(void *mem)
Definition: appwiz.h:76
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define MAX_PATH
Definition: compat.h:34
#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:458
#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:238
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
#define HRESULT_FROM_WIN32(x)
Definition: winerror.h:92

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

◆ AtlMarshalPtrInProc()

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

Definition at line 110 of file atl.c.

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

◆ AtlModuleAddTermFunc()

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

Definition at line 297 of file atl.c.

298{
299 _ATL_TERMFUNC_ELEM *termfunc_elem;
300
301 TRACE("version %04x (%p %p %ld)\n", _ATL_VER, pM, pFunc, dw);
302
303 if (_ATL_VER > _ATL_VER_30 || pM->cbSize > ATLVer1Size) {
304 termfunc_elem = HeapAlloc(GetProcessHeap(), 0, sizeof(_ATL_TERMFUNC_ELEM));
305 termfunc_elem->pFunc = pFunc;
306 termfunc_elem->dw = dw;
307 termfunc_elem->pNext = pM->m_pTermFuncs;
308
309 pM->m_pTermFuncs = termfunc_elem;
310 }
311
312 return S_OK;
313}
#define ATLVer1Size
Definition: atl.c:34
#define GetProcessHeap()
Definition: compat.h:736
#define HeapAlloc
Definition: compat.h:733
#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 165 of file atl.c.

166{
167 HDC dc = GetDC(NULL);
168 lpHiMetric->cx = 100 * lpPix->cx / GetDeviceCaps( dc, LOGPIXELSX );
169 lpHiMetric->cy = 100 * lpPix->cy / GetDeviceCaps( dc, LOGPIXELSY );
170 ReleaseDC( NULL, dc );
171}

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] = {'C','L','S','I','D','\\'}, *ptr = reg_path+6;
789
790 static const WCHAR implemented_catW[] =
791 {'I','m','p','l','e','m','e','n','t','e','d',' ','C','a','t','e','g','o','r','i','e','s',0};
792 static const WCHAR required_catW[] =
793 {'R','e','q','u','i','r','e','d',' ','C','a','t','e','g','o','r','i','e','s',0};
794
795 ptr += StringFromGUID2(clsid, ptr, 64)-1;
796 *ptr++ = '\\';
797
798 memcpy(ptr, implemented_catW, sizeof(implemented_catW));
800
801 memcpy(ptr, required_catW, sizeof(required_catW));
803 }
804
805 return S_OK;
806}
LONG WINAPI RegDeleteKeyW(_In_ HKEY hKey, _In_ LPCWSTR lpSubKey)
Definition: reg.c:1239
static ICatRegister * catreg
Definition: atl.c:40
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
Definition: compobj.c:3325
INT WINAPI StringFromGUID2(REFGUID id, LPOLESTR str, INT cmax)
Definition: compobj.c:2434
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:129
GUID catid
Definition: msctf.idl:647
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 399 of file atl.c.

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

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

◆ AtlSetPerUserRegistration()

HRESULT WINAPI AtlSetPerUserRegistration ( cpp_bool  bEnable)

Definition at line 952 of file atl.c.

953{
954 FIXME("stub: bEnable: %d\n", bEnable);
955 return E_NOTIMPL;
956}
#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 73 of file atl.c.

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

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

◆ AtlUnmarshalPtr()

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

Definition at line 119 of file atl.c.

120{
121 FIXME("%p %p %p\n", stm, iid, ppUnk);
122 return E_FAIL;
123}

◆ AtlWaitWithMessageLoop()

BOOL WINAPI AtlWaitWithMessageLoop ( HANDLE  handle)

Definition at line 811 of file atl.c.

812{
813 MSG msg;
814 DWORD res;
815
816 TRACE("(%p)\n", handle);
817
818 while(1) {
820 switch(res) {
821 case WAIT_OBJECT_0:
822 return TRUE;
823 case WAIT_OBJECT_0+1:
824 if(GetMessageW(&msg, NULL, 0, 0) < 0)
825 return FALSE;
826
829 break;
830 default:
831 return FALSE;
832 }
833 }
834}
#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:406
BOOL WINAPI TranslateMessage(_In_ const MSG *)
BOOL WINAPI GetMessageW(_Out_ LPMSG, _In_opt_ HWND, _In_ UINT, _In_ UINT)
#define QS_ALLINPUT
Definition: winuser.h:903
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 979 of file atl.c.

980{
981 TRACE("(0x%p, %d, %p)\n", hinstDLL, fdwReason, lpvReserved);
982
983 switch(fdwReason) {
985 atl_instance = hinstDLL;
987 break;
989 if (lpvReserved) break;
990 if(catreg)
991 ICatRegister_Release(catreg);
992 }
993
994 return TRUE;
995}
HINSTANCE atl_instance
Definition: atl.c:36
#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 836 of file atl.c.

837{
838 ITypeInfo *typeinfo, *src_typeinfo = NULL;
839 TYPEATTR *attr;
840 int type_flags;
841 unsigned i;
843
844 hres = ITypeLib_GetTypeInfoOfGuid(typelib, clsid, &typeinfo);
845 if(FAILED(hres))
846 return hres;
847
848 hres = ITypeInfo_GetTypeAttr(typeinfo, &attr);
849 if(FAILED(hres)) {
850 ITypeInfo_Release(typeinfo);
851 return hres;
852 }
853
854 for(i=0; i < attr->cImplTypes; i++) {
855 hres = ITypeInfo_GetImplTypeFlags(typeinfo, i, &type_flags);
856 if(SUCCEEDED(hres) && type_flags == (IMPLTYPEFLAG_FSOURCE|IMPLTYPEFLAG_FDEFAULT)) {
857 HREFTYPE ref;
858
859 hres = ITypeInfo_GetRefTypeOfImplType(typeinfo, i, &ref);
860 if(SUCCEEDED(hres))
861 hres = ITypeInfo_GetRefTypeInfo(typeinfo, ref, &src_typeinfo);
862 break;
863 }
864 }
865
866 ITypeInfo_ReleaseTypeAttr(typeinfo, attr);
867 ITypeInfo_Release(typeinfo);
868 if(FAILED(hres))
869 return hres;
870
871 if(!src_typeinfo) {
872 *iid = IID_NULL;
873 return S_OK;
874 }
875
876 hres = ITypeInfo_GetTypeAttr(src_typeinfo, &attr);
877 if(SUCCEEDED(hres)) {
878 *iid = attr->guid;
879 ITypeInfo_ReleaseTypeAttr(src_typeinfo, attr);
880 }
881 ITypeInfo_Release(src_typeinfo);
882 return hres;
883}
#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

◆ atl_instance

HINSTANCE atl_instance

Definition at line 36 of file atl.c.

Referenced by DllMain(), DllRegisterServer(), and DllUnregisterServer().

◆ catreg

ICatRegister* catreg
static