4 * Copyright 2002 Lionel Ulmer
5 * Copyright 2003 Mike McCormack
6 * Copyright 2005 Jacek Caban
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
11 * version 2.1 of the License, or (at your option) any later version.
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this library; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
41 #include "wine/debug.h"
44 #include "mshtml_private.h"
46 #include "pluginhost.h"
49 WINE_DEFAULT_DEBUG_CHANNEL(mshtml
);
52 DWORD mshtml_tls
= TLS_OUT_OF_INDEXES
;
54 static HINSTANCE shdoclc
= NULL
;
55 static WCHAR
*status_strings
[IDS_STATUS_LAST
-IDS_STATUS_FIRST
+1];
56 static IMultiLanguage2
*mlang
;
57 static IInternetSecurityManager
*security_manager
;
58 static unsigned global_max_compat_mode
= COMPAT_MODE_IE11
;
59 static struct list compat_config
= LIST_INIT(compat_config
);
63 compat_mode_t max_compat_mode
;
67 static BOOL
ensure_mlang(void)
69 IMultiLanguage2
*new_mlang
;
75 hres
= CoCreateInstance(&CLSID_CMultiLanguage
, NULL
, CLSCTX_INPROC_SERVER
,
76 &IID_IMultiLanguage2
, (void**)&new_mlang
);
78 ERR("Could not create CMultiLanguage instance\n");
82 if(InterlockedCompareExchangePointer((void**)&mlang
, new_mlang
, NULL
))
83 IMultiLanguage2_Release(new_mlang
);
88 UINT
cp_from_charset_string(BSTR charset
)
96 hres
= IMultiLanguage2_GetCharsetInfo(mlang
, charset
, &info
);
98 FIXME("GetCharsetInfo failed: %08x\n", hres
);
102 return info
.uiInternetEncoding
;
105 BSTR
charset_string_from_cp(UINT cp
)
111 return SysAllocString(NULL
);
113 hres
= IMultiLanguage2_GetCodePageInfo(mlang
, cp
, GetUserDefaultUILanguage(), &info
);
115 ERR("GetCodePageInfo failed: %08x\n", hres
);
116 return SysAllocString(NULL
);
119 return SysAllocString(info
.wszWebCharset
);
122 IInternetSecurityManager
*get_security_manager(void)
124 if(!security_manager
) {
125 IInternetSecurityManager
*manager
;
128 hres
= CoInternetCreateSecurityManager(NULL
, &manager
, 0);
132 if(InterlockedCompareExchangePointer((void**)&security_manager
, manager
, NULL
))
133 IInternetSecurityManager_Release(manager
);
136 return security_manager
;
139 static BOOL
read_compat_mode(HKEY key
, compat_mode_t
*r
)
145 static const WCHAR max_compat_modeW
[] = {'M','a','x','C','o','m','p','a','t','M','o','d','e',0};
147 size
= sizeof(version
);
148 status
= RegQueryValueExW(key
, max_compat_modeW
, NULL
, &type
, (BYTE
*)version
, &size
);
149 if(status
!= ERROR_SUCCESS
|| type
!= REG_SZ
)
152 return parse_compat_version(version
, r
);
155 static BOOL WINAPI
load_compat_settings(INIT_ONCE
*once
, void *param
, void **context
)
157 WCHAR key_name
[INTERNET_MAX_HOST_NAME_LENGTH
];
158 DWORD index
= 0, name_size
;
159 compat_config_t
*new_entry
;
160 compat_mode_t max_compat_mode
;
164 static const WCHAR key_nameW
[] = {
165 'S','o','f','t','w','a','r','e',
166 '\\','W','i','n','e',
167 '\\','M','S','H','T','M','L',
168 '\\','C','o','m','p','a','t','M','o','d','e',0};
170 /* @@ Wine registry key: HKCU\Software\Wine\MSHTML\CompatMode */
171 res
= RegOpenKeyW(HKEY_CURRENT_USER
, key_nameW
, &key
);
172 if(res
!= ERROR_SUCCESS
)
175 if(read_compat_mode(key
, &max_compat_mode
)) {
176 TRACE("Setting global max compat mode to %u\n", max_compat_mode
);
177 global_max_compat_mode
= max_compat_mode
;
181 res
= RegEnumKeyW(key
, index
, key_name
, ARRAY_SIZE(key_name
));
182 if(res
== ERROR_NO_MORE_ITEMS
)
185 if(res
!= ERROR_SUCCESS
) {
186 WARN("RegEnumKey failed: %u\n", GetLastError());
190 name_size
= lstrlenW(key_name
) + 1;
191 new_entry
= heap_alloc(FIELD_OFFSET(compat_config_t
, host
[name_size
]));
195 new_entry
->max_compat_mode
= COMPAT_MODE_IE11
;
196 memcpy(new_entry
->host
, key_name
, name_size
* sizeof(WCHAR
));
197 list_add_tail(&compat_config
, &new_entry
->entry
);
199 res
= RegOpenKeyW(key
, key_name
, &host_key
);
200 if(res
!= ERROR_SUCCESS
)
203 if(read_compat_mode(host_key
, &max_compat_mode
)) {
204 TRACE("Setting max compat mode for %s to %u\n", debugstr_w(key_name
), max_compat_mode
);
205 new_entry
->max_compat_mode
= max_compat_mode
;
208 RegCloseKey(host_key
);
215 compat_mode_t
get_max_compat_mode(IUri
*uri
)
217 compat_config_t
*iter
;
218 size_t len
, iter_len
;
222 static INIT_ONCE init_once
= INIT_ONCE_STATIC_INIT
;
223 InitOnceExecuteOnce(&init_once
, load_compat_settings
, NULL
, NULL
);
226 return global_max_compat_mode
;
227 hres
= IUri_GetHost(uri
, &host
);
229 return global_max_compat_mode
;
230 len
= SysStringLen(host
);
232 LIST_FOR_EACH_ENTRY(iter
, &compat_config
, compat_config_t
, entry
) {
233 iter_len
= lstrlenW(iter
->host
);
234 /* If configured host starts with '.', we also match subdomains */
235 if((len
== iter_len
|| (iter
->host
[0] == '.' && len
> iter_len
))
236 && !memcmp(host
+ len
- iter_len
, iter
->host
, iter_len
* sizeof(WCHAR
))) {
237 TRACE("Found max mode %u\n", iter
->max_compat_mode
);
238 return iter
->max_compat_mode
;
243 TRACE("Using global max mode %u\n", global_max_compat_mode
);
244 return global_max_compat_mode
;
247 static void thread_detach(void)
249 thread_data_t
*thread_data
;
251 thread_data
= get_thread_data(FALSE
);
255 if(thread_data
->thread_hwnd
)
256 DestroyWindow(thread_data
->thread_hwnd
);
258 heap_free(thread_data
);
261 static void free_strings(void)
264 for(i
= 0; i
< ARRAY_SIZE(status_strings
); i
++)
265 heap_free(status_strings
[i
]);
268 static void process_detach(void)
270 compat_config_t
*config
;
275 while(!list_empty(&compat_config
)) {
276 config
= LIST_ENTRY(list_head(&compat_config
), compat_config_t
, entry
);
277 list_remove(&config
->entry
);
282 FreeLibrary(shdoclc
);
283 if(mshtml_tls
!= TLS_OUT_OF_INDEXES
)
286 IMultiLanguage2_Release(mlang
);
288 IInternetSecurityManager_Release(security_manager
);
293 void set_statustext(HTMLDocumentObj
* doc
, INT id
, LPCWSTR arg
)
295 int index
= id
- IDS_STATUS_FIRST
;
296 WCHAR
*p
= status_strings
[index
];
304 p
= heap_alloc(len
* sizeof(WCHAR
));
305 len
= LoadStringW(hInst
, id
, p
, len
) + 1;
306 p
= heap_realloc(p
, len
* sizeof(WCHAR
));
307 if(InterlockedCompareExchangePointer((void**)&status_strings
[index
], p
, NULL
)) {
309 p
= status_strings
[index
];
316 len
= lstrlenW(p
) + lstrlenW(arg
) - 1;
317 buf
= heap_alloc(len
* sizeof(WCHAR
));
319 swprintf(buf
, len
, p
, arg
);
324 IOleInPlaceFrame_SetStatusText(doc
->frame
, p
);
330 HRESULT
do_query_service(IUnknown
*unk
, REFGUID guid_service
, REFIID riid
, void **ppv
)
332 IServiceProvider
*sp
;
335 hres
= IUnknown_QueryInterface(unk
, &IID_IServiceProvider
, (void**)&sp
);
339 hres
= IServiceProvider_QueryService(sp
, guid_service
, riid
, ppv
);
340 IServiceProvider_Release(sp
);
344 HINSTANCE
get_shdoclc(void)
346 static const WCHAR wszShdoclc
[] =
347 {'s','h','d','o','c','l','c','.','d','l','l',0};
352 return shdoclc
= LoadLibraryExW(wszShdoclc
, NULL
, LOAD_LIBRARY_AS_DATAFILE
);
355 BOOL WINAPI
DllMain(HINSTANCE hInstDLL
, DWORD fdwReason
, LPVOID reserved
)
358 case DLL_PROCESS_ATTACH
:
361 case DLL_PROCESS_DETACH
:
365 case DLL_THREAD_DETACH
:
372 /***********************************************************
373 * ClassFactory implementation
375 typedef HRESULT (*CreateInstanceFunc
)(IUnknown
*,REFIID
,void**);
377 IClassFactory IClassFactory_iface
;
379 CreateInstanceFunc fnCreateInstance
;
382 static inline ClassFactory
*impl_from_IClassFactory(IClassFactory
*iface
)
384 return CONTAINING_RECORD(iface
, ClassFactory
, IClassFactory_iface
);
387 static HRESULT WINAPI
ClassFactory_QueryInterface(IClassFactory
*iface
, REFGUID riid
, void **ppvObject
)
389 if(IsEqualGUID(&IID_IClassFactory
, riid
) || IsEqualGUID(&IID_IUnknown
, riid
)) {
390 IClassFactory_AddRef(iface
);
395 WARN("not supported iid %s\n", debugstr_mshtml_guid(riid
));
397 return E_NOINTERFACE
;
400 static ULONG WINAPI
ClassFactory_AddRef(IClassFactory
*iface
)
402 ClassFactory
*This
= impl_from_IClassFactory(iface
);
403 ULONG ref
= InterlockedIncrement(&This
->ref
);
404 TRACE("(%p) ref = %u\n", This
, ref
);
408 static ULONG WINAPI
ClassFactory_Release(IClassFactory
*iface
)
410 ClassFactory
*This
= impl_from_IClassFactory(iface
);
411 ULONG ref
= InterlockedDecrement(&This
->ref
);
413 TRACE("(%p) ref = %u\n", This
, ref
);
422 static HRESULT WINAPI
ClassFactory_CreateInstance(IClassFactory
*iface
, IUnknown
*pUnkOuter
,
423 REFIID riid
, void **ppvObject
)
425 ClassFactory
*This
= impl_from_IClassFactory(iface
);
426 return This
->fnCreateInstance(pUnkOuter
, riid
, ppvObject
);
429 static HRESULT WINAPI
ClassFactory_LockServer(IClassFactory
*iface
, BOOL dolock
)
431 TRACE("(%p)->(%x)\n", iface
, dolock
);
433 /* We never unload the DLL. See DllCanUnloadNow(). */
437 static const IClassFactoryVtbl HTMLClassFactoryVtbl
= {
438 ClassFactory_QueryInterface
,
440 ClassFactory_Release
,
441 ClassFactory_CreateInstance
,
442 ClassFactory_LockServer
445 static HRESULT
ClassFactory_Create(REFIID riid
, void **ppv
, CreateInstanceFunc fnCreateInstance
)
447 ClassFactory
*ret
= heap_alloc(sizeof(ClassFactory
));
450 ret
->IClassFactory_iface
.lpVtbl
= &HTMLClassFactoryVtbl
;
452 ret
->fnCreateInstance
= fnCreateInstance
;
454 hres
= IClassFactory_QueryInterface(&ret
->IClassFactory_iface
, riid
, ppv
);
462 /******************************************************************
463 * DllGetClassObject (MSHTML.@)
465 HRESULT WINAPI
DllGetClassObject(REFCLSID rclsid
, REFIID riid
, LPVOID
*ppv
)
467 if(IsEqualGUID(&CLSID_HTMLDocument
, rclsid
)) {
468 TRACE("(CLSID_HTMLDocument %s %p)\n", debugstr_mshtml_guid(riid
), ppv
);
469 return ClassFactory_Create(riid
, ppv
, HTMLDocument_Create
);
470 }else if(IsEqualGUID(&CLSID_MHTMLDocument
, rclsid
)) {
471 TRACE("(CLSID_MHTMLDocument %s %p)\n", debugstr_mshtml_guid(riid
), ppv
);
472 return ClassFactory_Create(riid
, ppv
, MHTMLDocument_Create
);
473 }else if(IsEqualGUID(&CLSID_AboutProtocol
, rclsid
)) {
474 TRACE("(CLSID_AboutProtocol %s %p)\n", debugstr_mshtml_guid(riid
), ppv
);
475 return ProtocolFactory_Create(rclsid
, riid
, ppv
);
476 }else if(IsEqualGUID(&CLSID_JSProtocol
, rclsid
)) {
477 TRACE("(CLSID_JSProtocol %s %p)\n", debugstr_mshtml_guid(riid
), ppv
);
478 return ProtocolFactory_Create(rclsid
, riid
, ppv
);
479 }else if(IsEqualGUID(&CLSID_MailtoProtocol
, rclsid
)) {
480 TRACE("(CLSID_MailtoProtocol %s %p)\n", debugstr_mshtml_guid(riid
), ppv
);
481 return ProtocolFactory_Create(rclsid
, riid
, ppv
);
482 }else if(IsEqualGUID(&CLSID_ResProtocol
, rclsid
)) {
483 TRACE("(CLSID_ResProtocol %s %p)\n", debugstr_mshtml_guid(riid
), ppv
);
484 return ProtocolFactory_Create(rclsid
, riid
, ppv
);
485 }else if(IsEqualGUID(&CLSID_SysimageProtocol
, rclsid
)) {
486 TRACE("(CLSID_SysimageProtocol %s %p)\n", debugstr_mshtml_guid(riid
), ppv
);
487 return ProtocolFactory_Create(rclsid
, riid
, ppv
);
488 }else if(IsEqualGUID(&CLSID_HTMLLoadOptions
, rclsid
)) {
489 TRACE("(CLSID_HTMLLoadOptions %s %p)\n", debugstr_mshtml_guid(riid
), ppv
);
490 return ClassFactory_Create(riid
, ppv
, HTMLLoadOptions_Create
);
493 FIXME("Unknown class %s\n", debugstr_guid(rclsid
));
494 return CLASS_E_CLASSNOTAVAILABLE
;
497 /******************************************************************
498 * DllCanUnloadNow (MSHTML.@)
500 HRESULT WINAPI
DllCanUnloadNow(void)
503 /* The cost of keeping this DLL in memory is small. */
507 /***********************************************************************
508 * RunHTMLApplication (MSHTML.@)
510 * Appears to have the same prototype as WinMain.
512 HRESULT WINAPI
RunHTMLApplication( HINSTANCE hinst
, HINSTANCE hPrevInst
,
513 LPSTR szCmdLine
, INT nCmdShow
)
515 FIXME("%p %p %s %d\n", hinst
, hPrevInst
, debugstr_a(szCmdLine
), nCmdShow
);
519 /***********************************************************************
520 * RNIGetCompatibleVersion (MSHTML.@)
522 DWORD WINAPI
RNIGetCompatibleVersion(void)
528 /***********************************************************************
529 * DllInstall (MSHTML.@)
531 HRESULT WINAPI
DllInstall(BOOL bInstall
, LPCWSTR cmdline
)
533 FIXME("stub %d %s: returning S_OK\n", bInstall
, debugstr_w(cmdline
));
537 /***********************************************************************
538 * ShowHTMLDialog (MSHTML.@)
540 HRESULT WINAPI
ShowHTMLDialog(HWND hwndParent
, IMoniker
*pMk
, VARIANT
*pvarArgIn
,
541 WCHAR
*pchOptions
, VARIANT
*pvarArgOut
)
543 FIXME("(%p %p %p %s %p)\n", hwndParent
, pMk
, pvarArgIn
, debugstr_w(pchOptions
), pvarArgOut
);
547 /***********************************************************************
548 * PrintHTML (MSHTML.@)
550 void WINAPI
PrintHTML(HWND hwnd
, HINSTANCE handle
, LPCSTR cmdline
, INT show
)
552 FIXME("(%p %p %s %x)\n", hwnd
, handle
, debugstr_a(cmdline
), show
);
555 DEFINE_GUID(CLSID_CBackgroundPropertyPage
, 0x3050F232, 0x98B5, 0x11CF, 0xBB,0x82, 0x00,0xAA,0x00,0xBD,0xCE,0x0B);
556 DEFINE_GUID(CLSID_CCDAnchorPropertyPage
, 0x3050F1FC, 0x98B5, 0x11CF, 0xBB,0x82, 0x00,0xAA,0x00,0xBD,0xCE,0x0B);
557 DEFINE_GUID(CLSID_CCDGenericPropertyPage
, 0x3050F17F, 0x98B5, 0x11CF, 0xBB,0x82, 0x00,0xAA,0x00,0xBD,0xCE,0x0B);
558 DEFINE_GUID(CLSID_CDwnBindInfo
, 0x3050F3C2, 0x98B5, 0x11CF, 0xBB,0x82, 0x00,0xAA,0x00,0xBD,0xCE,0x0B);
559 DEFINE_GUID(CLSID_CHiFiUses
, 0x5AAF51B3, 0xB1F0, 0x11D1, 0xB6,0xAB, 0x00,0xA0,0xC9,0x08,0x33,0xE9);
560 DEFINE_GUID(CLSID_CHtmlComponentConstructor
, 0x3050F4F8, 0x98B5, 0x11CF, 0xBB,0x82, 0x00,0xAA,0x00,0xBD,0xCE,0x0B);
561 DEFINE_GUID(CLSID_CInlineStylePropertyPage
, 0x3050F296, 0x98B5, 0x11CF, 0xBB,0x82, 0x00,0xAA,0x00,0xBD,0xCE,0x0B);
562 DEFINE_GUID(CLSID_CPeerHandler
, 0x5AAF51B2, 0xB1F0, 0x11D1, 0xB6,0xAB, 0x00,0xA0,0xC9,0x08,0x33,0xE9);
563 DEFINE_GUID(CLSID_CRecalcEngine
, 0x3050F499, 0x98B5, 0x11CF, 0xBB,0x82, 0x00,0xAA,0x00,0xBD,0xCE,0x0B);
564 DEFINE_GUID(CLSID_CSvrOMUses
, 0x3050F4F0, 0x98B5, 0x11CF, 0xBB,0x82, 0x00,0xAA,0x00,0xBD,0xCE,0x0B);
565 DEFINE_GUID(CLSID_CrSource
, 0x65014010, 0x9F62, 0x11D1, 0xA6,0x51, 0x00,0x60,0x08,0x11,0xD5,0xCE);
566 DEFINE_GUID(CLSID_ExternalFrameworkSite
, 0x3050F163, 0x98B5, 0x11CF, 0xBB,0x82, 0x00,0xAA,0x00,0xBD,0xCE,0x0B);
567 DEFINE_GUID(CLSID_HTADocument
, 0x3050F5C8, 0x98B5, 0x11CF, 0xBB,0x82, 0x00,0xAA,0x00,0xBD,0xCE,0x0B);
568 DEFINE_GUID(CLSID_HTMLPluginDocument
, 0x25336921, 0x03F9, 0x11CF, 0x8F,0xD0, 0x00,0xAA,0x00,0x68,0x6F,0x13);
569 DEFINE_GUID(CLSID_HTMLPopup
, 0x3050F667, 0x98B5, 0x11CF, 0xBB,0x82, 0x00,0xAA,0x00,0xBD,0xCE,0x0B);
570 DEFINE_GUID(CLSID_HTMLPopupDoc
, 0x3050F67D, 0x98B5, 0x11CF, 0xBB,0x82, 0x00,0xAA,0x00,0xBD,0xCE,0x0B);
571 DEFINE_GUID(CLSID_HTMLServerDoc
, 0x3050F4E7, 0x98B5, 0x11CF, 0xBB,0x82, 0x00,0xAA,0x00,0xBD,0xCE,0x0B);
572 DEFINE_GUID(CLSID_IImageDecodeFilter
, 0x607FD4E8, 0x0A03, 0x11D1, 0xAB,0x1D, 0x00,0xC0,0x4F,0xC9,0xB3,0x04);
573 DEFINE_GUID(CLSID_IImgCtx
, 0x3050F3D6, 0x98B5, 0x11CF, 0xBB,0x82, 0x00,0xAA,0x00,0xBD,0xCE,0x0B);
574 DEFINE_GUID(CLSID_IntDitherer
, 0x05F6FE1A, 0xECEF, 0x11D0, 0xAA,0xE7, 0x00,0xC0,0x4F,0xC9,0xB3,0x04);
575 DEFINE_GUID(CLSID_TridentAPI
, 0x429AF92C, 0xA51F, 0x11D2, 0x86,0x1E, 0x00,0xC0,0x4F,0xA3,0x5C,0x89);
577 #define INF_SET_ID(id) \
580 static CHAR name[] = #id; \
582 pse[i].pszName = name; \
586 #define INF_SET_CLSID(clsid) INF_SET_ID(CLSID_ ## clsid)
588 static HRESULT
register_server(BOOL do_register
)
592 HRESULT (WINAPI
*pRegInstall
)(HMODULE hm
, LPCSTR pszSection
, const STRTABLEA
* pstTable
);
595 static CLSID
const *clsids
[35];
598 static const WCHAR wszAdvpack
[] = {'a','d','v','p','a','c','k','.','d','l','l',0};
600 TRACE("(%x)\n", do_register
);
602 INF_SET_CLSID(AboutProtocol
);
603 INF_SET_CLSID(CAnchorBrowsePropertyPage
);
604 INF_SET_CLSID(CBackgroundPropertyPage
);
605 INF_SET_CLSID(CCDAnchorPropertyPage
);
606 INF_SET_CLSID(CCDGenericPropertyPage
);
607 INF_SET_CLSID(CDocBrowsePropertyPage
);
608 INF_SET_CLSID(CDwnBindInfo
);
609 INF_SET_CLSID(CHiFiUses
);
610 INF_SET_CLSID(CHtmlComponentConstructor
);
611 INF_SET_CLSID(CImageBrowsePropertyPage
);
612 INF_SET_CLSID(CInlineStylePropertyPage
);
613 INF_SET_CLSID(CPeerHandler
);
614 INF_SET_CLSID(CRecalcEngine
);
615 INF_SET_CLSID(CSvrOMUses
);
616 INF_SET_CLSID(CrSource
);
617 INF_SET_CLSID(ExternalFrameworkSite
);
618 INF_SET_CLSID(HTADocument
);
619 INF_SET_CLSID(HTMLDocument
);
620 INF_SET_CLSID(HTMLLoadOptions
);
621 INF_SET_CLSID(HTMLPluginDocument
);
622 INF_SET_CLSID(HTMLPopup
);
623 INF_SET_CLSID(HTMLPopupDoc
);
624 INF_SET_CLSID(HTMLServerDoc
);
625 INF_SET_CLSID(HTMLWindowProxy
);
626 INF_SET_CLSID(IImageDecodeFilter
);
627 INF_SET_CLSID(IImgCtx
);
628 INF_SET_CLSID(IntDitherer
);
629 INF_SET_CLSID(JSProtocol
);
630 INF_SET_CLSID(MHTMLDocument
);
631 INF_SET_CLSID(MailtoProtocol
);
632 INF_SET_CLSID(ResProtocol
);
633 INF_SET_CLSID(Scriptlet
);
634 INF_SET_CLSID(SysimageProtocol
);
635 INF_SET_CLSID(TridentAPI
);
636 INF_SET_ID(LIBID_MSHTML
);
638 for(i
=0; i
< ARRAY_SIZE(pse
); i
++) {
639 pse
[i
].pszValue
= heap_alloc(39);
640 sprintf(pse
[i
].pszValue
, "{%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X}",
641 clsids
[i
]->Data1
, clsids
[i
]->Data2
, clsids
[i
]->Data3
, clsids
[i
]->Data4
[0],
642 clsids
[i
]->Data4
[1], clsids
[i
]->Data4
[2], clsids
[i
]->Data4
[3], clsids
[i
]->Data4
[4],
643 clsids
[i
]->Data4
[5], clsids
[i
]->Data4
[6], clsids
[i
]->Data4
[7]);
646 strtable
.cEntries
= ARRAY_SIZE(pse
);
649 hAdvpack
= LoadLibraryW(wszAdvpack
);
650 pRegInstall
= (void *)GetProcAddress(hAdvpack
, "RegInstall");
652 hres
= pRegInstall(hInst
, do_register
? "RegisterDll" : "UnregisterDll", &strtable
);
654 FreeLibrary(hAdvpack
);
656 for(i
=0; i
< ARRAY_SIZE(pse
); i
++)
657 heap_free(pse
[i
].pszValue
);
660 ERR("RegInstall failed: %08x\n", hres
);
668 /***********************************************************************
669 * DllRegisterServer (MSHTML.@)
671 HRESULT WINAPI
DllRegisterServer(void)
675 hres
= __wine_register_resources( hInst
);
677 hres
= register_server(TRUE
);
684 /***********************************************************************
685 * DllUnregisterServer (MSHTML.@)
687 HRESULT WINAPI
DllUnregisterServer(void)
689 HRESULT hres
= __wine_unregister_resources( hInst
);
690 if(SUCCEEDED(hres
)) hres
= register_server(FALSE
);
694 const char *debugstr_mshtml_guid(const GUID
*iid
)
696 #define X(x) if(IsEqualGUID(iid, &x)) return #x
697 X(DIID_HTMLDocumentEvents
);
698 X(DIID_HTMLDocumentEvents2
);
699 X(DIID_HTMLTableEvents
);
700 X(DIID_HTMLTextContainerEvents
);
701 X(IID_HTMLPluginContainer
);
702 X(IID_IConnectionPoint
);
703 X(IID_IConnectionPointContainer
);
708 X(IID_IDisplayServices
);
709 X(IID_UndocumentedScriptIface
);
710 X(IID_IEnumConnections
);
713 X(IID_IHTMLDocument6
);
714 X(IID_IHTMLDocument7
);
715 X(IID_IHTMLEditServices
);
716 X(IID_IHTMLFramesCollection2
);
717 X(IID_IHTMLPrivateWindow
);
718 X(IID_IHtmlLoadOptions
);
719 X(IID_IInternetHostSecurityManager
);
720 X(IID_IInternetProtocol
);
721 X(IID_IInternetProtocolRoot
);
722 X(IID_IManagedObject
);
723 X(IID_IMarkupContainer
);
724 X(IID_IMarkupServices
);
727 X(IID_IObjectIdentity
);
728 X(IID_IObjectSafety
);
729 X(IID_IObjectWithSite
);
730 X(IID_IOleContainer
);
731 X(IID_IOleCommandTarget
);
734 X(IID_IOleDocumentView
);
735 X(IID_IOleInPlaceActiveObject
);
736 X(IID_IOleInPlaceFrame
);
737 X(IID_IOleInPlaceObject
);
738 X(IID_IOleInPlaceObjectWindowless
);
739 X(IID_IOleInPlaceUIWindow
);
745 X(IID_IPersistHistory
);
746 X(IID_IPersistMoniker
);
747 X(IID_IPersistStreamInit
);
748 X(IID_IPropertyNotifySink
);
749 X(IID_IProvideClassInfo
);
750 X(IID_IProvideClassInfo2
);
751 X(IID_IProvideMultipleClassInfo
);
752 X(IID_IServiceProvider
);
753 X(IID_ISupportErrorInfo
);
754 X(IID_ITargetContainer
);
755 X(IID_ITravelLogClient
);
759 X(IID_IViewObjectEx
);
760 X(IID_nsCycleCollectionISupports
);
761 X(IID_nsXPCOMCycleCollectionParticipant
);
762 #define XIID(x) X(IID_##x);
763 #define XDIID(x) X(DIID_##x);
769 return debugstr_guid(iid
);