2 * Copyright 2012 Stefan Leichter
3 * Copyright 2012 Jacek Caban for CodeWeavers
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
24 WINE_DEFAULT_DEBUG_CHANNEL(atl100
);
26 typedef unsigned char cpp_bool
;
28 static inline void *heap_alloc(size_t len
)
30 return HeapAlloc(GetProcessHeap(), 0, len
);
33 static inline BOOL
heap_free(void *mem
)
35 return HeapFree(GetProcessHeap(), 0, mem
);
38 static ICatRegister
*catreg
;
40 /***********************************************************************
41 * AtlAdvise [atl100.@]
43 HRESULT WINAPI
AtlAdvise(IUnknown
*pUnkCP
, IUnknown
*pUnk
, const IID
*iid
, DWORD
*pdw
)
45 IConnectionPointContainer
*container
;
49 TRACE("%p %p %p %p\n", pUnkCP
, pUnk
, iid
, pdw
);
54 hres
= IUnknown_QueryInterface(pUnkCP
, &IID_IConnectionPointContainer
, (void**)&container
);
58 hres
= IConnectionPointContainer_FindConnectionPoint(container
, iid
, &cp
);
59 IConnectionPointContainer_Release(container
);
63 hres
= IConnectionPoint_Advise(cp
, pUnk
, pdw
);
64 IConnectionPoint_Release(cp
);
68 /***********************************************************************
69 * AtlUnadvise [atl100.@]
71 HRESULT WINAPI
AtlUnadvise(IUnknown
*pUnkCP
, const IID
*iid
, DWORD dw
)
73 IConnectionPointContainer
*container
;
77 TRACE("%p %p %d\n", pUnkCP
, iid
, dw
);
82 hres
= IUnknown_QueryInterface(pUnkCP
, &IID_IConnectionPointContainer
, (void**)&container
);
86 hres
= IConnectionPointContainer_FindConnectionPoint(container
, iid
, &cp
);
87 IConnectionPointContainer_Release(container
);
91 hres
= IConnectionPoint_Unadvise(cp
, dw
);
92 IConnectionPoint_Release(cp
);
96 /***********************************************************************
97 * AtlFreeMarshalStream [atl100.@]
99 HRESULT WINAPI
AtlFreeMarshalStream(IStream
*stm
)
105 /***********************************************************************
106 * AtlMarshalPtrInProc [atl100.@]
108 HRESULT WINAPI
AtlMarshalPtrInProc(IUnknown
*pUnk
, const IID
*iid
, IStream
**pstm
)
110 FIXME("%p %p %p\n", pUnk
, iid
, pstm
);
114 /***********************************************************************
115 * AtlUnmarshalPtr [atl100.@]
117 HRESULT WINAPI
AtlUnmarshalPtr(IStream
*stm
, const IID
*iid
, IUnknown
**ppUnk
)
119 FIXME("%p %p %p\n", stm
, iid
, ppUnk
);
123 /***********************************************************************
124 * AtlCreateTargetDC [atl100.@]
126 HDC WINAPI
AtlCreateTargetDC( HDC hdc
, DVTARGETDEVICE
*dv
)
128 static const WCHAR displayW
[] = {'d','i','s','p','l','a','y',0};
129 const WCHAR
*driver
= NULL
, *device
= NULL
, *port
= NULL
;
130 DEVMODEW
*devmode
= NULL
;
132 TRACE( "(%p, %p)\n", hdc
, dv
);
136 if (dv
->tdDriverNameOffset
) driver
= (WCHAR
*)((char *)dv
+ dv
->tdDriverNameOffset
);
137 if (dv
->tdDeviceNameOffset
) device
= (WCHAR
*)((char *)dv
+ dv
->tdDeviceNameOffset
);
138 if (dv
->tdPortNameOffset
) port
= (WCHAR
*)((char *)dv
+ dv
->tdPortNameOffset
);
139 if (dv
->tdExtDevmodeOffset
) devmode
= (DEVMODEW
*)((char *)dv
+ dv
->tdExtDevmodeOffset
);
146 return CreateDCW( driver
, device
, port
, devmode
);
149 /***********************************************************************
150 * AtlHiMetricToPixel [atl100.@]
152 void WINAPI
AtlHiMetricToPixel(const SIZEL
* lpHiMetric
, SIZEL
* lpPix
)
154 HDC dc
= GetDC(NULL
);
155 lpPix
->cx
= lpHiMetric
->cx
* GetDeviceCaps( dc
, LOGPIXELSX
) / 100;
156 lpPix
->cy
= lpHiMetric
->cy
* GetDeviceCaps( dc
, LOGPIXELSY
) / 100;
157 ReleaseDC( NULL
, dc
);
160 /***********************************************************************
161 * AtlPixelToHiMetric [atl100.@]
163 void WINAPI
AtlPixelToHiMetric(const SIZEL
* lpPix
, SIZEL
* lpHiMetric
)
165 HDC dc
= GetDC(NULL
);
166 lpHiMetric
->cx
= 100 * lpPix
->cx
/ GetDeviceCaps( dc
, LOGPIXELSX
);
167 lpHiMetric
->cy
= 100 * lpPix
->cy
/ GetDeviceCaps( dc
, LOGPIXELSY
);
168 ReleaseDC( NULL
, dc
);
171 /***********************************************************************
172 * AtlComPtrAssign [atl100.@]
174 IUnknown
* WINAPI
AtlComPtrAssign(IUnknown
** pp
, IUnknown
*p
)
176 TRACE("(%p %p)\n", pp
, p
);
178 if (p
) IUnknown_AddRef(p
);
179 if (*pp
) IUnknown_Release(*pp
);
184 /***********************************************************************
185 * AtlComQIPtrAssign [atl100.@]
187 IUnknown
* WINAPI
AtlComQIPtrAssign(IUnknown
** pp
, IUnknown
*p
, REFIID riid
)
189 IUnknown
*new_p
= NULL
;
191 TRACE("(%p %p %s)\n", pp
, p
, debugstr_guid(riid
));
193 if (p
) IUnknown_QueryInterface(p
, riid
, (void **)&new_p
);
194 if (*pp
) IUnknown_Release(*pp
);
199 /***********************************************************************
200 * AtlInternalQueryInterface [atl100.@]
202 HRESULT WINAPI
AtlInternalQueryInterface(void* this, const _ATL_INTMAP_ENTRY
* pEntries
, REFIID iid
, void** ppvObject
)
205 HRESULT rc
= E_NOINTERFACE
;
206 TRACE("(%p, %p, %s, %p)\n",this, pEntries
, debugstr_guid(iid
), ppvObject
);
208 if (IsEqualGUID(iid
,&IID_IUnknown
))
210 TRACE("Returning IUnknown\n");
211 *ppvObject
= ((LPSTR
)this+pEntries
[0].dw
);
212 IUnknown_AddRef((IUnknown
*)*ppvObject
);
216 while (pEntries
[i
].pFunc
!= 0)
218 TRACE("Trying entry %i (%s %i %p)\n",i
,debugstr_guid(pEntries
[i
].piid
),
219 pEntries
[i
].dw
, pEntries
[i
].pFunc
);
221 if (!pEntries
[i
].piid
|| IsEqualGUID(iid
,pEntries
[i
].piid
))
224 if (pEntries
[i
].pFunc
== (_ATL_CREATORARGFUNC
*)1)
227 *ppvObject
= ((LPSTR
)this+pEntries
[i
].dw
);
228 IUnknown_AddRef((IUnknown
*)*ppvObject
);
234 rc
= pEntries
[i
].pFunc(this, iid
, ppvObject
, pEntries
[i
].dw
);
235 if(rc
==S_OK
|| pEntries
[i
].piid
)
241 TRACE("Done returning (0x%x)\n",rc
);
245 /* FIXME: should be in a header file */
246 typedef struct ATL_PROPMAP_ENTRY
250 const CLSID
* pclsidPropPage
;
251 const IID
* piidDispatch
;
257 /***********************************************************************
258 * AtlIPersistStreamInit_Load [atl100.@]
260 HRESULT WINAPI
AtlIPersistStreamInit_Load( LPSTREAM pStm
, ATL_PROPMAP_ENTRY
*pMap
,
261 void *pThis
, IUnknown
*pUnk
)
263 FIXME("(%p, %p, %p, %p)\n", pStm
, pMap
, pThis
, pUnk
);
268 /***********************************************************************
269 * AtlIPersistStreamInit_Save [atl100.@]
271 HRESULT WINAPI
AtlIPersistStreamInit_Save(LPSTREAM pStm
, BOOL fClearDirty
,
272 ATL_PROPMAP_ENTRY
*pMap
, void *pThis
,
275 FIXME("(%p, %d, %p, %p, %p)\n", pStm
, fClearDirty
, pMap
, pThis
, pUnk
);
280 /***********************************************************************
281 * AtlIPersistPropertyBag_Load [atl100.@]
283 HRESULT WINAPI
AtlIPersistPropertyBag_Load(LPPROPERTYBAG pPropBag
, LPERRORLOG pErrorLog
,
284 ATL_PROPMAP_ENTRY
*pMap
, void *pThis
,
287 FIXME("(%p, %p, %p, %p, %p)\n", pPropBag
, pErrorLog
, pMap
, pThis
, pUnk
);
292 /***********************************************************************
293 * AtlModuleAddTermFunc [atl100.@]
295 HRESULT WINAPI
AtlModuleAddTermFunc(_ATL_MODULE
*pM
, _ATL_TERMFUNC
*pFunc
, DWORD_PTR dw
)
297 _ATL_TERMFUNC_ELEM
*termfunc_elem
;
299 TRACE("(%p %p %ld)\n", pM
, pFunc
, dw
);
301 termfunc_elem
= HeapAlloc(GetProcessHeap(), 0, sizeof(_ATL_TERMFUNC_ELEM
));
302 termfunc_elem
->pFunc
= pFunc
;
303 termfunc_elem
->dw
= dw
;
304 termfunc_elem
->pNext
= pM
->m_pTermFuncs
;
306 pM
->m_pTermFuncs
= termfunc_elem
;
311 /***********************************************************************
312 * AtlCallTermFunc [atl100.@]
314 void WINAPI
AtlCallTermFunc(_ATL_MODULE
*pM
)
316 _ATL_TERMFUNC_ELEM
*iter
= pM
->m_pTermFuncs
, *tmp
;
321 iter
->pFunc(iter
->dw
);
324 HeapFree(GetProcessHeap(), 0, tmp
);
327 pM
->m_pTermFuncs
= NULL
;
330 /***********************************************************************
331 * AtlLoadTypeLib [atl100.56]
333 HRESULT WINAPI
AtlLoadTypeLib(HINSTANCE inst
, LPCOLESTR lpszIndex
,
334 BSTR
*pbstrPath
, ITypeLib
**ppTypeLib
)
336 size_t path_len
, index_len
;
337 ITypeLib
*typelib
= NULL
;
341 static const WCHAR tlb_extW
[] = {'.','t','l','b',0};
343 TRACE("(%p %s %p %p)\n", inst
, debugstr_w(lpszIndex
), pbstrPath
, ppTypeLib
);
345 index_len
= lpszIndex
? strlenW(lpszIndex
) : 0;
346 path
= heap_alloc((MAX_PATH
+index_len
)*sizeof(WCHAR
) + sizeof(tlb_extW
));
348 return E_OUTOFMEMORY
;
350 path_len
= GetModuleFileNameW(inst
, path
, MAX_PATH
);
353 return HRESULT_FROM_WIN32(GetLastError());
357 memcpy(path
+path_len
, lpszIndex
, (index_len
+1)*sizeof(WCHAR
));
359 hres
= LoadTypeLib(path
, &typelib
);
363 for(ptr
= path
+path_len
-1; ptr
> path
&& *ptr
!= '\\' && *ptr
!= '.'; ptr
--);
366 memcpy(ptr
, tlb_extW
, sizeof(tlb_extW
));
367 hres
= LoadTypeLib(path
, &typelib
);
370 if(SUCCEEDED(hres
)) {
371 *pbstrPath
= SysAllocString(path
);
373 ITypeLib_Release(typelib
);
374 hres
= E_OUTOFMEMORY
;
382 *ppTypeLib
= typelib
;
386 /***********************************************************************
387 * AtlWinModuleInit [atl100.65]
389 HRESULT WINAPI
AtlWinModuleInit(_ATL_WIN_MODULE
*winmod
)
391 TRACE("(%p\n", winmod
);
393 if(winmod
->cbSize
!= sizeof(*winmod
))
396 InitializeCriticalSection(&winmod
->m_csWindowCreate
);
397 winmod
->m_pCreateWndList
= NULL
;
401 /***********************************************************************
402 * AtlWinModuleAddCreateWndData [atl100.43]
404 void WINAPI
AtlWinModuleAddCreateWndData(_ATL_WIN_MODULE
*pM
, _AtlCreateWndData
*pData
, void *pvObject
)
406 TRACE("(%p, %p, %p)\n", pM
, pData
, pvObject
);
408 pData
->m_pThis
= pvObject
;
409 pData
->m_dwThreadID
= GetCurrentThreadId();
411 EnterCriticalSection(&pM
->m_csWindowCreate
);
412 pData
->m_pNext
= pM
->m_pCreateWndList
;
413 pM
->m_pCreateWndList
= pData
;
414 LeaveCriticalSection(&pM
->m_csWindowCreate
);
417 /***********************************************************************
418 * AtlWinModuleExtractCreateWndData [atl100.44]
420 void* WINAPI
AtlWinModuleExtractCreateWndData(_ATL_WIN_MODULE
*winmod
)
422 _AtlCreateWndData
*iter
, *prev
= NULL
;
425 TRACE("(%p)\n", winmod
);
427 thread_id
= GetCurrentThreadId();
429 EnterCriticalSection(&winmod
->m_csWindowCreate
);
431 for(iter
= winmod
->m_pCreateWndList
; iter
&& iter
->m_dwThreadID
!= thread_id
; iter
= iter
->m_pNext
)
435 prev
->m_pNext
= iter
->m_pNext
;
437 winmod
->m_pCreateWndList
= iter
->m_pNext
;
440 LeaveCriticalSection(&winmod
->m_csWindowCreate
);
442 return iter
? iter
->m_pThis
: NULL
;
445 /***********************************************************************
446 * AtlComModuleGetClassObject [atl100.15]
448 HRESULT WINAPI
AtlComModuleGetClassObject(_ATL_COM_MODULE
*pm
, REFCLSID rclsid
, REFIID riid
, void **ppv
)
450 _ATL_OBJMAP_ENTRY
**iter
;
453 TRACE("(%p %s %s %p)\n", pm
, debugstr_guid(rclsid
), debugstr_guid(riid
), ppv
);
458 for(iter
= pm
->m_ppAutoObjMapFirst
; iter
< pm
->m_ppAutoObjMapLast
; iter
++) {
459 if(IsEqualCLSID((*iter
)->pclsid
, rclsid
) && (*iter
)->pfnGetClassObject
) {
461 hres
= (*iter
)->pfnGetClassObject((*iter
)->pfnCreateInstance
, &IID_IUnknown
, (void**)&(*iter
)->pCF
);
463 hres
= IUnknown_QueryInterface((*iter
)->pCF
, riid
, ppv
);
464 TRACE("returning %p (%08x)\n", *ppv
, hres
);
469 WARN("Class %s not found\n", debugstr_guid(rclsid
));
470 return CLASS_E_CLASSNOTAVAILABLE
;
473 /***********************************************************************
474 * AtlComModuleRegisterClassObjects [atl100.17]
476 HRESULT WINAPI
AtlComModuleRegisterClassObjects(_ATL_COM_MODULE
*module
, DWORD context
, DWORD flags
)
478 _ATL_OBJMAP_ENTRY
**iter
;
482 TRACE("(%p %x %x)\n", module
, context
, flags
);
487 for(iter
= module
->m_ppAutoObjMapFirst
; iter
< module
->m_ppAutoObjMapLast
; iter
++) {
488 if(!(*iter
)->pfnGetClassObject
)
491 hres
= (*iter
)->pfnGetClassObject((*iter
)->pfnCreateInstance
, &IID_IUnknown
, (void**)&unk
);
495 hres
= CoRegisterClassObject((*iter
)->pclsid
, unk
, context
, flags
, &(*iter
)->dwRegister
);
496 IUnknown_Release(unk
);
505 /***********************************************************************
506 * AtlComModuleUnregisterServer [atl100.22]
508 HRESULT WINAPI
AtlComModuleUnregisterServer(_ATL_COM_MODULE
*mod
, BOOL bRegTypeLib
, const CLSID
*clsid
)
510 const struct _ATL_CATMAP_ENTRY
*catmap
;
511 _ATL_OBJMAP_ENTRY
**iter
;
514 TRACE("(%p %x %s)\n", mod
, bRegTypeLib
, debugstr_guid(clsid
));
516 for(iter
= mod
->m_ppAutoObjMapFirst
; iter
< mod
->m_ppAutoObjMapLast
; iter
++) {
517 if(!*iter
|| (clsid
&& !IsEqualCLSID((*iter
)->pclsid
, clsid
)))
520 TRACE("Unregistering clsid %s\n", debugstr_guid((*iter
)->pclsid
));
522 catmap
= (*iter
)->pfnGetCategoryMap();
524 hres
= AtlRegisterClassCategoriesHelper((*iter
)->pclsid
, catmap
, FALSE
);
529 hres
= (*iter
)->pfnUpdateRegistry(FALSE
);
539 hres
= AtlLoadTypeLib(mod
->m_hInstTypeLib
, NULL
, &path
, &typelib
);
544 hres
= ITypeLib_GetLibAttr(typelib
, &attr
);
545 if(SUCCEEDED(hres
)) {
546 hres
= UnRegisterTypeLib(&attr
->guid
, attr
->wMajorVerNum
, attr
->wMinorVerNum
, attr
->lcid
, attr
->syskind
);
547 ITypeLib_ReleaseTLibAttr(typelib
, attr
);
549 ITypeLib_Release(typelib
);
557 /***********************************************************************
558 * AtlRegisterClassCategoriesHelper [atl100.49]
560 HRESULT WINAPI
AtlRegisterClassCategoriesHelper(REFCLSID clsid
, const struct _ATL_CATMAP_ENTRY
*catmap
, BOOL reg
)
562 const struct _ATL_CATMAP_ENTRY
*iter
;
565 TRACE("(%s %p %x)\n", debugstr_guid(clsid
), catmap
, reg
);
571 ICatRegister
*new_catreg
;
573 hres
= CoCreateInstance(&CLSID_StdComponentCategoriesMgr
, NULL
, CLSCTX_INPROC_SERVER
,
574 &IID_ICatRegister
, (void**)&new_catreg
);
578 if(InterlockedCompareExchangePointer((void**)&catreg
, new_catreg
, NULL
))
579 ICatRegister_Release(new_catreg
);
582 for(iter
= catmap
; iter
->iType
!= _ATL_CATMAP_ENTRY_END
; iter
++) {
583 CATID catid
= *iter
->pcatid
; /* For stupid lack of const in ICatRegister declaration. */
585 if(iter
->iType
== _ATL_CATMAP_ENTRY_IMPLEMENTED
) {
587 hres
= ICatRegister_RegisterClassImplCategories(catreg
, clsid
, 1, &catid
);
589 hres
= ICatRegister_UnRegisterClassImplCategories(catreg
, clsid
, 1, &catid
);
592 hres
= ICatRegister_RegisterClassReqCategories(catreg
, clsid
, 1, &catid
);
594 hres
= ICatRegister_UnRegisterClassReqCategories(catreg
, clsid
, 1, &catid
);
601 WCHAR reg_path
[256] = {'C','L','S','I','D','\\'}, *ptr
= reg_path
+6;
603 static const WCHAR implemented_catW
[] =
604 {'I','m','p','l','e','m','e','n','t','e','d',' ','C','a','t','e','g','o','r','i','e','s',0};
605 static const WCHAR required_catW
[] =
606 {'R','e','q','u','i','r','e','d',' ','C','a','t','e','g','o','r','i','e','s',0};
608 ptr
+= StringFromGUID2(clsid
, ptr
, 64)-1;
611 memcpy(ptr
, implemented_catW
, sizeof(implemented_catW
));
612 RegDeleteKeyW(HKEY_CLASSES_ROOT
, reg_path
);
614 memcpy(ptr
, required_catW
, sizeof(required_catW
));
615 RegDeleteKeyW(HKEY_CLASSES_ROOT
, reg_path
);
621 /***********************************************************************
622 * AtlWaitWithMessageLoop [atl100.24]
624 BOOL WINAPI
AtlWaitWithMessageLoop(HANDLE handle
)
629 TRACE("(%p)\n", handle
);
632 res
= MsgWaitForMultipleObjects(1, &handle
, FALSE
, INFINITE
, QS_ALLINPUT
);
636 case WAIT_OBJECT_0
+1:
637 if(GetMessageW(&msg
, NULL
, 0, 0) < 0)
640 TranslateMessage(&msg
);
641 DispatchMessageW(&msg
);
649 static HRESULT
get_default_source(ITypeLib
*typelib
, const CLSID
*clsid
, IID
*iid
)
651 ITypeInfo
*typeinfo
, *src_typeinfo
= NULL
;
657 hres
= ITypeLib_GetTypeInfoOfGuid(typelib
, clsid
, &typeinfo
);
661 hres
= ITypeInfo_GetTypeAttr(typeinfo
, &attr
);
663 ITypeInfo_Release(typeinfo
);
667 for(i
=0; i
< attr
->cImplTypes
; i
++) {
668 hres
= ITypeInfo_GetImplTypeFlags(typeinfo
, i
, &type_flags
);
669 if(SUCCEEDED(hres
) && type_flags
== (IMPLTYPEFLAG_FSOURCE
|IMPLTYPEFLAG_FDEFAULT
)) {
672 hres
= ITypeInfo_GetRefTypeOfImplType(typeinfo
, i
, &ref
);
674 hres
= ITypeInfo_GetRefTypeInfo(typeinfo
, ref
, &src_typeinfo
);
679 ITypeInfo_ReleaseTypeAttr(typeinfo
, attr
);
680 ITypeInfo_Release(typeinfo
);
689 hres
= ITypeInfo_GetTypeAttr(src_typeinfo
, &attr
);
690 if(SUCCEEDED(hres
)) {
692 ITypeInfo_ReleaseTypeAttr(src_typeinfo
, attr
);
694 ITypeInfo_Release(src_typeinfo
);
698 /***********************************************************************
699 * AtlGetObjectSourceInterface [atl100.54]
701 HRESULT WINAPI
AtlGetObjectSourceInterface(IUnknown
*unk
, GUID
*libid
, IID
*iid
, unsigned short *major
, unsigned short *minor
)
703 IProvideClassInfo2
*classinfo
;
710 TRACE("(%p %p %p %p %p)\n", unk
, libid
, iid
, major
, minor
);
712 hres
= IUnknown_QueryInterface(unk
, &IID_IDispatch
, (void**)&disp
);
716 hres
= IDispatch_GetTypeInfo(disp
, 0, 0, &typeinfo
);
717 IDispatch_Release(disp
);
721 hres
= ITypeInfo_GetContainingTypeLib(typeinfo
, &typelib
, 0);
722 ITypeInfo_Release(typeinfo
);
723 if(SUCCEEDED(hres
)) {
726 hres
= ITypeLib_GetLibAttr(typelib
, &attr
);
727 if(SUCCEEDED(hres
)) {
729 *major
= attr
->wMajorVerNum
;
730 *minor
= attr
->wMinorVerNum
;
731 ITypeLib_ReleaseTLibAttr(typelib
, attr
);
733 ITypeLib_Release(typelib
);
739 hres
= IUnknown_QueryInterface(unk
, &IID_IProvideClassInfo2
, (void**)&classinfo
);
740 if(SUCCEEDED(hres
)) {
741 hres
= IProvideClassInfo2_GetGUID(classinfo
, GUIDKIND_DEFAULT_SOURCE_DISP_IID
, iid
);
742 IProvideClassInfo2_Release(classinfo
);
743 ITypeLib_Release(typelib
);
747 hres
= IUnknown_QueryInterface(unk
, &IID_IPersist
, (void**)&persist
);
748 if(SUCCEEDED(hres
)) {
751 hres
= IPersist_GetClassID(persist
, &clsid
);
753 hres
= get_default_source(typelib
, &clsid
, iid
);
754 IPersist_Release(persist
);
760 /***********************************************************************
761 * AtlSetPerUserRegistration [atl100.67]
763 HRESULT WINAPI
AtlSetPerUserRegistration(cpp_bool bEnable
)
765 FIXME("stub: bEnable: %d\n", bEnable
);
769 /***********************************************************************
770 * AtlGetPerUserRegistration [atl100.68]
772 HRESULT WINAPI
AtlGetPerUserRegistration(cpp_bool
*pbEnabled
)
774 FIXME("stub: returning false\n");
779 /***********************************************************************
780 * AtlGetVersion [atl100.@]
782 DWORD WINAPI
AtlGetVersion(void *pReserved
)
787 BOOL WINAPI
DllMain(HINSTANCE hinstDLL
, DWORD fdwReason
, LPVOID lpvReserved
)
789 TRACE("(0x%p, %d, %p)\n", hinstDLL
, fdwReason
, lpvReserved
);
792 case DLL_PROCESS_ATTACH
:
793 DisableThreadLibraryCalls(hinstDLL
);
795 case DLL_PROCESS_DETACH
:
796 if (lpvReserved
) break;
798 ICatRegister_Release(catreg
);