msi: Return the error from OpenSourceKey.
[wine] / dlls / msxml3 / regsvr.c
1 /*
2  *      MSXML3 self-registerable dll functions
3  *
4  * Copyright (C) 2003 John K. Hohm
5  * Copyright (C) 2006 Robert Shearman
6  *
7  * This library is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public
9  * License as published by the Free Software Foundation; either
10  * version 2.1 of the License, or (at your option) any later version.
11  *
12  * This library is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with this library; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
20  */
21
22 #include "config.h"
23
24 #include <stdarg.h>
25 #include <string.h>
26
27 #include "windef.h"
28 #include "winbase.h"
29 #include "winuser.h"
30 #include "winreg.h"
31 #include "winerror.h"
32 #include "ole2.h"
33 #include "msxml.h"
34 #include "xmldom.h"
35 #include "xmldso.h"
36 #include "msxml2.h"
37
38 /* undef the #define in msxml2 so that we can access the v.2 version
39    independent CLSID as well as the v.3 one. */
40 #undef CLSID_DOMDocument
41
42 #include "msxml_private.h"
43
44 #include "wine/debug.h"
45
46 WINE_DEFAULT_DEBUG_CHANNEL(ole);
47
48 /*
49  * Near the bottom of this file are the exported DllRegisterServer and
50  * DllUnregisterServer, which make all this worthwhile.
51  */
52
53 /***********************************************************************
54  *              interface for self-registering
55  */
56 struct regsvr_interface
57 {
58     IID const *iid;             /* NULL for end of list */
59     LPCSTR name;                /* can be NULL to omit */
60     IID const *base_iid;        /* can be NULL to omit */
61     int num_methods;            /* can be <0 to omit */
62     CLSID const *ps_clsid;      /* can be NULL to omit */
63     CLSID const *ps_clsid32;    /* can be NULL to omit */
64 };
65
66 static HRESULT register_interfaces(struct regsvr_interface const *list);
67 static HRESULT unregister_interfaces(struct regsvr_interface const *list);
68
69 struct regsvr_coclass
70 {
71     CLSID const *clsid;         /* NULL for end of list */
72     LPCSTR name;                /* can be NULL to omit */
73     LPCSTR ips;                 /* can be NULL to omit */
74     LPCSTR ips32;               /* can be NULL to omit */
75     LPCSTR ips32_tmodel;        /* can be NULL to omit */
76     LPCSTR progid;              /* can be NULL to omit */
77     LPCSTR version;             /* can be NULL to omit */
78 };
79
80 static HRESULT register_coclasses(struct regsvr_coclass const *list);
81 static HRESULT unregister_coclasses(struct regsvr_coclass const *list);
82
83 struct progid
84 {
85     LPCSTR name;                /* NULL for end of list */
86     LPCSTR description;         /* can be NULL to omit */
87     CLSID const *clsid;
88     LPCSTR curver;              /* can be NULL to omit */
89 };
90
91 static HRESULT register_progids(struct progid const *list);
92 static HRESULT unregister_progids(struct progid const *list);
93
94 /***********************************************************************
95  *              static string constants
96  */
97 static WCHAR const interface_keyname[10] = {
98     'I', 'n', 't', 'e', 'r', 'f', 'a', 'c', 'e', 0 };
99 static WCHAR const base_ifa_keyname[14] = {
100     'B', 'a', 's', 'e', 'I', 'n', 't', 'e', 'r', 'f', 'a', 'c',
101     'e', 0 };
102 static WCHAR const num_methods_keyname[11] = {
103     'N', 'u', 'm', 'M', 'e', 't', 'h', 'o', 'd', 's', 0 };
104 static WCHAR const ps_clsid_keyname[15] = {
105     'P', 'r', 'o', 'x', 'y', 'S', 't', 'u', 'b', 'C', 'l', 's',
106     'i', 'd', 0 };
107 static WCHAR const ps_clsid32_keyname[17] = {
108     'P', 'r', 'o', 'x', 'y', 'S', 't', 'u', 'b', 'C', 'l', 's',
109     'i', 'd', '3', '2', 0 };
110 static WCHAR const clsid_keyname[6] = {
111     'C', 'L', 'S', 'I', 'D', 0 };
112 static WCHAR const ips_keyname[13] = {
113     'I', 'n', 'P', 'r', 'o', 'c', 'S', 'e', 'r', 'v', 'e', 'r',
114     0 };
115 static WCHAR const ips32_keyname[15] = {
116     'I', 'n', 'P', 'r', 'o', 'c', 'S', 'e', 'r', 'v', 'e', 'r',
117     '3', '2', 0 };
118 static WCHAR const progid_keyname[7] = {
119     'P', 'r', 'o', 'g', 'I', 'D', 0 };
120 static WCHAR const versionindependentprogid_keyname[] = {
121     'V', 'e', 'r', 's', 'i', 'o', 'n',
122     'I', 'n', 'd', 'e', 'p', 'e', 'n', 'd', 'e', 'n', 't',
123     'P', 'r', 'o', 'g', 'I', 'D', 0 };
124 static WCHAR const version_keyname[] = {
125     'V', 'e', 'r', 's', 'i', 'o', 'n', 0 };
126 static WCHAR const curver_keyname[] = {
127     'C', 'u', 'r', 'V', 'e', 'r', 0 };
128 static char const tmodel_valuename[] = "ThreadingModel";
129
130 /***********************************************************************
131  *              static helper functions
132  */
133 static LONG register_key_guid(HKEY base, WCHAR const *name, GUID const *guid);
134 static LONG register_key_defvalueW(HKEY base, WCHAR const *name,
135                                    WCHAR const *value);
136 static LONG register_key_defvalueA(HKEY base, WCHAR const *name,
137                                    char const *value);
138
139 /***********************************************************************
140  *              register_interfaces
141  */
142 static HRESULT register_interfaces(struct regsvr_interface const *list)
143 {
144     LONG res = ERROR_SUCCESS;
145     HKEY interface_key;
146
147     res = RegCreateKeyExW(HKEY_CLASSES_ROOT, interface_keyname, 0, NULL, 0,
148                           KEY_READ | KEY_WRITE, NULL, &interface_key, NULL);
149     if (res != ERROR_SUCCESS) goto error_return;
150
151     for (; res == ERROR_SUCCESS && list->iid; ++list) {
152         WCHAR buf[39];
153         HKEY iid_key;
154
155         StringFromGUID2(list->iid, buf, 39);
156         res = RegCreateKeyExW(interface_key, buf, 0, NULL, 0,
157                               KEY_READ | KEY_WRITE, NULL, &iid_key, NULL);
158         if (res != ERROR_SUCCESS) goto error_close_interface_key;
159
160         if (list->name) {
161             res = RegSetValueExA(iid_key, NULL, 0, REG_SZ,
162                                  (CONST BYTE*)(list->name),
163                                  strlen(list->name) + 1);
164             if (res != ERROR_SUCCESS) goto error_close_iid_key;
165         }
166
167         if (list->base_iid) {
168             res = register_key_guid(iid_key, base_ifa_keyname, list->base_iid);
169             if (res != ERROR_SUCCESS) goto error_close_iid_key;
170         }
171
172         if (0 <= list->num_methods) {
173             static WCHAR const fmt[3] = { '%', 'd', 0 };
174             HKEY key;
175
176             res = RegCreateKeyExW(iid_key, num_methods_keyname, 0, NULL, 0,
177                                   KEY_READ | KEY_WRITE, NULL, &key, NULL);
178             if (res != ERROR_SUCCESS) goto error_close_iid_key;
179
180             wsprintfW(buf, fmt, list->num_methods);
181             res = RegSetValueExW(key, NULL, 0, REG_SZ,
182                                  (CONST BYTE*)buf,
183                                  (lstrlenW(buf) + 1) * sizeof(WCHAR));
184             RegCloseKey(key);
185
186             if (res != ERROR_SUCCESS) goto error_close_iid_key;
187         }
188
189         if (list->ps_clsid) {
190             res = register_key_guid(iid_key, ps_clsid_keyname, list->ps_clsid);
191             if (res != ERROR_SUCCESS) goto error_close_iid_key;
192         }
193
194         if (list->ps_clsid32) {
195             res = register_key_guid(iid_key, ps_clsid32_keyname, list->ps_clsid32);
196             if (res != ERROR_SUCCESS) goto error_close_iid_key;
197         }
198
199     error_close_iid_key:
200         RegCloseKey(iid_key);
201     }
202
203 error_close_interface_key:
204     RegCloseKey(interface_key);
205 error_return:
206     return res != ERROR_SUCCESS ? HRESULT_FROM_WIN32(res) : S_OK;
207 }
208
209 /***********************************************************************
210  *              unregister_interfaces
211  */
212 static HRESULT unregister_interfaces(struct regsvr_interface const *list)
213 {
214     LONG res = ERROR_SUCCESS;
215     HKEY interface_key;
216
217     res = RegOpenKeyExW(HKEY_CLASSES_ROOT, interface_keyname, 0,
218                         KEY_READ | KEY_WRITE, &interface_key);
219     if (res == ERROR_FILE_NOT_FOUND) return S_OK;
220     if (res != ERROR_SUCCESS) goto error_return;
221
222     for (; res == ERROR_SUCCESS && list->iid; ++list) {
223         WCHAR buf[39];
224
225         StringFromGUID2(list->iid, buf, 39);
226         res = RegDeleteTreeW(interface_key, buf);
227         if (res == ERROR_FILE_NOT_FOUND) res = ERROR_SUCCESS;
228     }
229
230     RegCloseKey(interface_key);
231 error_return:
232     return res != ERROR_SUCCESS ? HRESULT_FROM_WIN32(res) : S_OK;
233 }
234
235 /***********************************************************************
236  *              register_coclasses
237  */
238 static HRESULT register_coclasses(struct regsvr_coclass const *list)
239 {
240     LONG res = ERROR_SUCCESS;
241     HKEY coclass_key;
242
243     res = RegCreateKeyExW(HKEY_CLASSES_ROOT, clsid_keyname, 0, NULL, 0,
244                           KEY_READ | KEY_WRITE, NULL, &coclass_key, NULL);
245     if (res != ERROR_SUCCESS) goto error_return;
246
247     for (; res == ERROR_SUCCESS && list->clsid; ++list) {
248         WCHAR buf[39];
249         HKEY clsid_key;
250
251         StringFromGUID2(list->clsid, buf, 39);
252         res = RegCreateKeyExW(coclass_key, buf, 0, NULL, 0,
253                               KEY_READ | KEY_WRITE, NULL, &clsid_key, NULL);
254         if (res != ERROR_SUCCESS) goto error_close_coclass_key;
255
256         if (list->name) {
257             res = RegSetValueExA(clsid_key, NULL, 0, REG_SZ,
258                                  (CONST BYTE*)(list->name),
259                                  strlen(list->name) + 1);
260             if (res != ERROR_SUCCESS) goto error_close_clsid_key;
261         }
262
263         if (list->ips) {
264             res = register_key_defvalueA(clsid_key, ips_keyname, list->ips);
265             if (res != ERROR_SUCCESS) goto error_close_clsid_key;
266         }
267
268         if (list->ips32) {
269             HKEY ips32_key;
270
271             res = RegCreateKeyExW(clsid_key, ips32_keyname, 0, NULL, 0,
272                                   KEY_READ | KEY_WRITE, NULL,
273                                   &ips32_key, NULL);
274             if (res != ERROR_SUCCESS) goto error_close_clsid_key;
275
276             res = RegSetValueExA(ips32_key, NULL, 0, REG_SZ,
277                                  (CONST BYTE*)list->ips32,
278                                  lstrlenA(list->ips32) + 1);
279             if (res == ERROR_SUCCESS && list->ips32_tmodel)
280                 res = RegSetValueExA(ips32_key, tmodel_valuename, 0, REG_SZ,
281                                      (CONST BYTE*)list->ips32_tmodel,
282                                      strlen(list->ips32_tmodel) + 1);
283             RegCloseKey(ips32_key);
284             if (res != ERROR_SUCCESS) goto error_close_clsid_key;
285         }
286
287         if (list->progid) {
288             char *buffer = NULL;
289             LPCSTR progid;
290
291             if (list->version) {
292                 buffer = HeapAlloc(GetProcessHeap(), 0, strlen(list->progid) + strlen(list->version) + 2);
293                 if (!buffer) {
294                     res = ERROR_OUTOFMEMORY;
295                     goto error_close_clsid_key;
296                 }
297                 strcpy(buffer, list->progid);
298                 strcat(buffer, ".");
299                 strcat(buffer, list->version);
300                 progid = buffer;
301             } else
302                 progid = list->progid;
303             res = register_key_defvalueA(clsid_key, progid_keyname,
304                                          progid);
305             HeapFree(GetProcessHeap(), 0, buffer);
306             if (res != ERROR_SUCCESS) goto error_close_clsid_key;
307
308             if (list->version) {
309                 res = register_key_defvalueA(clsid_key, versionindependentprogid_keyname,
310                                              list->progid);
311                 if (res != ERROR_SUCCESS) goto error_close_clsid_key;
312             }
313         }
314
315         if (list->version) {
316             res = register_key_defvalueA(clsid_key, version_keyname,
317                                          list->version);
318             if (res != ERROR_SUCCESS) goto error_close_clsid_key;
319         }
320
321     error_close_clsid_key:
322         RegCloseKey(clsid_key);
323     }
324
325 error_close_coclass_key:
326     RegCloseKey(coclass_key);
327 error_return:
328     return res != ERROR_SUCCESS ? HRESULT_FROM_WIN32(res) : S_OK;
329 }
330
331 /***********************************************************************
332  *              unregister_coclasses
333  */
334 static HRESULT unregister_coclasses(struct regsvr_coclass const *list)
335 {
336     LONG res = ERROR_SUCCESS;
337     HKEY coclass_key;
338
339     res = RegOpenKeyExW(HKEY_CLASSES_ROOT, clsid_keyname, 0,
340                         KEY_READ | KEY_WRITE, &coclass_key);
341     if (res == ERROR_FILE_NOT_FOUND) return S_OK;
342     if (res != ERROR_SUCCESS) goto error_return;
343
344     for (; res == ERROR_SUCCESS && list->clsid; ++list) {
345         WCHAR buf[39];
346
347         StringFromGUID2(list->clsid, buf, 39);
348         res = RegDeleteTreeW(coclass_key, buf);
349         if (res == ERROR_FILE_NOT_FOUND) res = ERROR_SUCCESS;
350         if (res != ERROR_SUCCESS) goto error_close_coclass_key;
351     }
352
353 error_close_coclass_key:
354     RegCloseKey(coclass_key);
355 error_return:
356     return res != ERROR_SUCCESS ? HRESULT_FROM_WIN32(res) : S_OK;
357 }
358
359 /***********************************************************************
360  *              register_progids
361  */
362 static HRESULT register_progids(struct progid const *list)
363 {
364     LONG res = ERROR_SUCCESS;
365
366     for (; res == ERROR_SUCCESS && list->name; ++list) {
367         WCHAR buf[39];
368         HKEY progid_key;
369
370         res = RegCreateKeyExA(HKEY_CLASSES_ROOT, list->name, 0,
371                           NULL, 0, KEY_READ | KEY_WRITE, NULL,
372                           &progid_key, NULL);
373         if (res != ERROR_SUCCESS) goto error_close_clsid_key;
374
375         res = RegSetValueExA(progid_key, NULL, 0, REG_SZ,
376                          (CONST BYTE*)list->description,
377                          strlen(list->description) + 1);
378         if (res != ERROR_SUCCESS) goto error_close_clsid_key;
379
380         StringFromGUID2(list->clsid, buf, 39);
381
382         res = register_key_defvalueW(progid_key, clsid_keyname, buf);
383         if (res != ERROR_SUCCESS) goto error_close_clsid_key;
384
385         if (list->curver) {
386             res = register_key_defvalueA(progid_key, curver_keyname, list->curver);
387             if (res != ERROR_SUCCESS) goto error_close_clsid_key;
388         }
389
390     error_close_clsid_key:
391         RegCloseKey(progid_key);
392     }
393
394     return res != ERROR_SUCCESS ? HRESULT_FROM_WIN32(res) : S_OK;
395 }
396
397 /***********************************************************************
398  *              unregister_progids
399  */
400 static HRESULT unregister_progids(struct progid const *list)
401 {
402     LONG res = ERROR_SUCCESS;
403
404     for (; res == ERROR_SUCCESS && list->name; ++list) {
405         res = RegDeleteTreeA(HKEY_CLASSES_ROOT, list->name);
406         if (res == ERROR_FILE_NOT_FOUND) res = ERROR_SUCCESS;
407     }
408
409     return res != ERROR_SUCCESS ? HRESULT_FROM_WIN32(res) : S_OK;
410 }
411
412 /***********************************************************************
413  *              regsvr_key_guid
414  */
415 static LONG register_key_guid(HKEY base, WCHAR const *name, GUID const *guid)
416 {
417     WCHAR buf[39];
418
419     StringFromGUID2(guid, buf, 39);
420     return register_key_defvalueW(base, name, buf);
421 }
422
423 /***********************************************************************
424  *              regsvr_key_defvalueW
425  */
426 static LONG register_key_defvalueW(
427     HKEY base,
428     WCHAR const *name,
429     WCHAR const *value)
430 {
431     LONG res;
432     HKEY key;
433
434     res = RegCreateKeyExW(base, name, 0, NULL, 0,
435                           KEY_READ | KEY_WRITE, NULL, &key, NULL);
436     if (res != ERROR_SUCCESS) return res;
437     res = RegSetValueExW(key, NULL, 0, REG_SZ, (CONST BYTE*)value,
438                          (lstrlenW(value) + 1) * sizeof(WCHAR));
439     RegCloseKey(key);
440     return res;
441 }
442
443 /***********************************************************************
444  *              regsvr_key_defvalueA
445  */
446 static LONG register_key_defvalueA(
447     HKEY base,
448     WCHAR const *name,
449     char const *value)
450 {
451     LONG res;
452     HKEY key;
453
454     res = RegCreateKeyExW(base, name, 0, NULL, 0,
455                           KEY_READ | KEY_WRITE, NULL, &key, NULL);
456     if (res != ERROR_SUCCESS) return res;
457     res = RegSetValueExA(key, NULL, 0, REG_SZ, (CONST BYTE*)value,
458                          lstrlenA(value) + 1);
459     RegCloseKey(key);
460     return res;
461 }
462
463 /***********************************************************************
464  *              coclass list
465  */
466 static struct regsvr_coclass const coclass_list[] = {
467     {   &CLSID_DOMDocument,
468         "XML DOM Document",
469         NULL,
470         "msxml3.dll",
471         "Both",
472         "Microsoft.XMLDOM",
473         "1.0"
474     },
475     {   &CLSID_DOMDocument2,
476         "XML DOM Document",
477         NULL,
478         "msxml3.dll",
479         "Both",
480         "Msxml2.DOMDocument",
481         "3.0"
482     },
483     {   &CLSID_DOMDocument30,
484         "XML DOM Document 3.0",
485         NULL,
486         "msxml3.dll",
487         "Both",
488         "Msxml2.DOMDocument",
489         "3.0"
490     },
491     {   &CLSID_DOMFreeThreadedDocument,
492         "Free threaded XML DOM Document",
493         NULL,
494         "msxml3.dll",
495         "Both",
496         "Microsoft.FreeThreadedXMLDOM",
497         "1.0"
498     },
499     {   &CLSID_XMLHTTPRequest,
500         "XML HTTP Request",
501         NULL,
502         "msxml3.dll",
503         "Apartment",
504         "Microsoft.XMLHTTP",
505         "1.0"
506     },
507     {   &CLSID_XMLDSOControl,
508         "XML Data Source Object",
509         NULL,
510         "msxml3.dll",
511         "Apartment",
512         "Microsoft.XMLDSO",
513         "1.0"
514     },
515     {   &CLSID_XMLDocument,
516         "Msxml",
517         NULL,
518         "msxml3.dll",
519         "Both",
520         "Msxml"
521     },
522     {   &CLSID_XMLSchemaCache,
523         "XML Schema Cache",
524         NULL,
525         "msxml3.dll",
526         "Both",
527         "Msxml2.XMLSchemaCache",
528         "3.0"
529     },
530     {   &CLSID_XMLSchemaCache30,
531         "XML Schema Cache 3.0",
532         NULL,
533         "msxml3.dll",
534         "Both",
535         "Msxml2.XMLSchemaCache",
536         "3.0"
537     },
538     { NULL }                    /* list terminator */
539 };
540
541 /***********************************************************************
542  *              interface list
543  */
544 static struct regsvr_interface const interface_list[] = {
545     { NULL }                    /* list terminator */
546 };
547
548 /***********************************************************************
549  *              progid list
550  */
551 static struct progid const progid_list[] = {
552     {   "Microsoft.XMLDOM",
553         "XML DOM Document",
554         &CLSID_DOMDocument,
555         "Microsoft.XMLDOM.1.0"
556     },
557     {   "Microsoft.XMLDOM.1.0",
558         "XML DOM Document",
559         &CLSID_DOMDocument,
560         NULL
561     },
562     {   "MSXML.DOMDocument",
563         "XML DOM Document",
564         &CLSID_DOMDocument,
565         "Microsoft.XMLDOM.1.0"
566     },
567     {   "Msxml2.DOMDocument",
568         "XML DOM Document",
569         &CLSID_DOMDocument2,
570         "Msxml2.DOMDocument.3.0"
571     },
572     {   "Msxml2.DOMDocument.3.0",
573         "XML DOM Document 3.0",
574         &CLSID_DOMDocument30,
575         NULL
576     },
577     {   "Microsoft.FreeThreadedXMLDOM",
578         "Free threaded XML DOM Document",
579         &CLSID_DOMFreeThreadedDocument,
580         "Microsoft.FreeThreadedXMLDOM.1.0"
581     },
582     {   "Microsoft.FreeThreadedXMLDOM.1.0",
583         "Free threaded XML DOM Document",
584         &CLSID_DOMFreeThreadedDocument,
585         NULL
586     },
587     {   "MSXML.FreeThreadedDOMDocument",
588         "Free threaded XML DOM Document",
589         &CLSID_DOMFreeThreadedDocument,
590         "Microsoft.FreeThreadedXMLDOM.1.0"
591     },
592     {   "Microsoft.XMLHTTP",
593         "XML HTTP Request",
594         &CLSID_XMLHTTPRequest,
595         "Microsoft.XMLHTTP.1.0"
596     },
597     {   "Microsoft.XMLHTTP.1.0",
598         "XML HTTP Request",
599         &CLSID_XMLHTTPRequest,
600         NULL
601     },
602     {   "Microsoft.XMLDSO",
603         "XML Data Source Object",
604         &CLSID_XMLDSOControl,
605         "Microsoft.XMLDSO.1.0"
606     },
607     {   "Microsoft.XMLDSO.1.0",
608         "XML Data Source Object",
609         &CLSID_XMLDSOControl,
610         NULL
611     },
612     {   "Msxml",
613         "Msxml",
614         &CLSID_XMLDocument,
615         NULL
616     },
617     {   "Msxml2.XMLSchemaCache",
618         "XML Schema Cache",
619         &CLSID_XMLSchemaCache,
620         "Msxml2.XMLSchemaCache.3.0"
621     },
622     {   "Msxml2.XMLSchemaCache.3.0",
623         "XML Schema Cache 3.0",
624         &CLSID_XMLSchemaCache30,
625         NULL
626     },
627
628     { NULL }                    /* list terminator */
629 };
630
631 /***********************************************************************
632  *              DllRegisterServer (OLEAUT32.@)
633  */
634 HRESULT WINAPI DllRegisterServer(void)
635 {
636     HRESULT hr;
637
638     TRACE("\n");
639
640     hr = register_coclasses(coclass_list);
641     if (SUCCEEDED(hr))
642         hr = register_interfaces(interface_list);
643     if (SUCCEEDED(hr))
644         hr = register_progids(progid_list);
645     return hr;
646 }
647
648 /***********************************************************************
649  *              DllUnregisterServer (OLEAUT32.@)
650  */
651 HRESULT WINAPI DllUnregisterServer(void)
652 {
653     HRESULT hr;
654
655     TRACE("\n");
656
657     hr = unregister_coclasses(coclass_list);
658     if (SUCCEEDED(hr))
659         hr = unregister_interfaces(interface_list);
660     if (SUCCEEDED(hr))
661         hr = unregister_progids(progid_list);
662     return hr;
663 }