ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

regsvr.c
Go to the documentation of this file.
00001 /*
00002  *  MSXML3 self-registerable dll functions
00003  *
00004  * Copyright (C) 2003 John K. Hohm
00005  * Copyright (C) 2006 Robert Shearman
00006  * Copyright (C) 2008 Alistair Leslie-Hughes
00007  *
00008  * This library is free software; you can redistribute it and/or
00009  * modify it under the terms of the GNU Lesser General Public
00010  * License as published by the Free Software Foundation; either
00011  * version 2.1 of the License, or (at your option) any later version.
00012  *
00013  * This library is distributed in the hope that it will be useful,
00014  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00015  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00016  * Lesser General Public License for more details.
00017  *
00018  * You should have received a copy of the GNU Lesser General Public
00019  * License along with this library; if not, write to the Free Software
00020  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
00021  */
00022 
00023 #include "config.h"
00024 
00025 #include <stdarg.h>
00026 #include <string.h>
00027 
00028 #define COBJMACROS
00029 
00030 #include "windef.h"
00031 #include "winbase.h"
00032 #include "winuser.h"
00033 #include "winreg.h"
00034 #include "winerror.h"
00035 #include "ole2.h"
00036 #include "msxml.h"
00037 #include "xmldom.h"
00038 #include "xmldso.h"
00039 #include "msxml2.h"
00040 
00041 /* undef the #define in msxml2 so that we can access the v.2 version
00042    independent CLSID as well as the v.3 one. */
00043 #undef CLSID_DOMDocument
00044 
00045 #include "msxml_private.h"
00046 
00047 #include "wine/debug.h"
00048 #include "wine/unicode.h"
00049 
00050 WINE_DEFAULT_DEBUG_CHANNEL(msxml);
00051 
00052 /*
00053  * Near the bottom of this file are the exported DllRegisterServer and
00054  * DllUnregisterServer, which make all this worthwhile.
00055  */
00056 
00057 /***********************************************************************
00058  *      interface for self-registering
00059  */
00060 struct regsvr_interface
00061 {
00062     IID const *iid;     /* NULL for end of list */
00063     LPCSTR name;        /* can be NULL to omit */
00064     IID const *base_iid;    /* can be NULL to omit */
00065     int num_methods;        /* can be <0 to omit */
00066     CLSID const *ps_clsid;  /* can be NULL to omit */
00067     CLSID const *ps_clsid32;    /* can be NULL to omit */
00068 };
00069 
00070 static HRESULT register_interfaces(struct regsvr_interface const *list);
00071 static HRESULT unregister_interfaces(struct regsvr_interface const *list);
00072 
00073 struct regsvr_coclass
00074 {
00075     CLSID const *clsid;     /* NULL for end of list */
00076     LPCSTR name;        /* can be NULL to omit */
00077     LPCSTR ips;         /* can be NULL to omit */
00078     LPCSTR ips32;       /* can be NULL to omit */
00079     LPCSTR ips32_tmodel;    /* can be NULL to omit */
00080     LPCSTR progid;      /* can be NULL to omit */
00081     LPCSTR version;     /* can be NULL to omit */
00082 };
00083 
00084 static HRESULT register_coclasses(struct regsvr_coclass const *list);
00085 static HRESULT unregister_coclasses(struct regsvr_coclass const *list);
00086 
00087 struct progid
00088 {
00089     LPCSTR name;        /* NULL for end of list */
00090     LPCSTR description;     /* can be NULL to omit */
00091     CLSID const *clsid;
00092     LPCSTR curver;      /* can be NULL to omit */
00093 };
00094 
00095 static HRESULT register_progids(struct progid const *list);
00096 static HRESULT unregister_progids(struct progid const *list);
00097 
00098 /***********************************************************************
00099  *      static string constants
00100  */
00101 static WCHAR const interface_keyname[10] = {
00102     'I', 'n', 't', 'e', 'r', 'f', 'a', 'c', 'e', 0 };
00103 static WCHAR const base_ifa_keyname[14] = {
00104     'B', 'a', 's', 'e', 'I', 'n', 't', 'e', 'r', 'f', 'a', 'c',
00105     'e', 0 };
00106 static WCHAR const num_methods_keyname[11] = {
00107     'N', 'u', 'm', 'M', 'e', 't', 'h', 'o', 'd', 's', 0 };
00108 static WCHAR const ps_clsid_keyname[15] = {
00109     'P', 'r', 'o', 'x', 'y', 'S', 't', 'u', 'b', 'C', 'l', 's',
00110     'i', 'd', 0 };
00111 static WCHAR const ps_clsid32_keyname[17] = {
00112     'P', 'r', 'o', 'x', 'y', 'S', 't', 'u', 'b', 'C', 'l', 's',
00113     'i', 'd', '3', '2', 0 };
00114 static WCHAR const clsid_keyname[6] = {
00115     'C', 'L', 'S', 'I', 'D', 0 };
00116 static WCHAR const ips_keyname[13] = {
00117     'I', 'n', 'P', 'r', 'o', 'c', 'S', 'e', 'r', 'v', 'e', 'r',
00118     0 };
00119 static WCHAR const ips32_keyname[15] = {
00120     'I', 'n', 'P', 'r', 'o', 'c', 'S', 'e', 'r', 'v', 'e', 'r',
00121     '3', '2', 0 };
00122 static WCHAR const progid_keyname[7] = {
00123     'P', 'r', 'o', 'g', 'I', 'D', 0 };
00124 static WCHAR const versionindependentprogid_keyname[] = {
00125     'V', 'e', 'r', 's', 'i', 'o', 'n',
00126     'I', 'n', 'd', 'e', 'p', 'e', 'n', 'd', 'e', 'n', 't',
00127     'P', 'r', 'o', 'g', 'I', 'D', 0 };
00128 static WCHAR const version_keyname[] = {
00129     'V', 'e', 'r', 's', 'i', 'o', 'n', 0 };
00130 static WCHAR const curver_keyname[] = {
00131     'C', 'u', 'r', 'V', 'e', 'r', 0 };
00132 static char const tmodel_valuename[] = "ThreadingModel";
00133 
00134 /***********************************************************************
00135  *      static helper functions
00136  */
00137 static LONG register_key_guid(HKEY base, WCHAR const *name, GUID const *guid);
00138 static LONG register_key_defvalueW(HKEY base, WCHAR const *name,
00139                    WCHAR const *value);
00140 static LONG register_key_defvalueA(HKEY base, WCHAR const *name,
00141                    char const *value);
00142 
00143 /***********************************************************************
00144  *      register_interfaces
00145  */
00146 static HRESULT register_interfaces(struct regsvr_interface const *list)
00147 {
00148     LONG res = ERROR_SUCCESS;
00149     HKEY interface_key;
00150 
00151     res = RegCreateKeyExW(HKEY_CLASSES_ROOT, interface_keyname, 0, NULL, 0,
00152               KEY_READ | KEY_WRITE, NULL, &interface_key, NULL);
00153     if (res != ERROR_SUCCESS) goto error_return;
00154 
00155     for (; res == ERROR_SUCCESS && list->iid; ++list) {
00156     WCHAR buf[39];
00157     HKEY iid_key;
00158 
00159     StringFromGUID2(list->iid, buf, 39);
00160     res = RegCreateKeyExW(interface_key, buf, 0, NULL, 0,
00161                   KEY_READ | KEY_WRITE, NULL, &iid_key, NULL);
00162     if (res != ERROR_SUCCESS) goto error_close_interface_key;
00163 
00164     if (list->name) {
00165         res = RegSetValueExA(iid_key, NULL, 0, REG_SZ,
00166                  (CONST BYTE*)(list->name),
00167                  strlen(list->name) + 1);
00168         if (res != ERROR_SUCCESS) goto error_close_iid_key;
00169     }
00170 
00171     if (list->base_iid) {
00172         res = register_key_guid(iid_key, base_ifa_keyname, list->base_iid);
00173         if (res != ERROR_SUCCESS) goto error_close_iid_key;
00174     }
00175 
00176     if (0 <= list->num_methods) {
00177         static WCHAR const fmt[3] = { '%', 'd', 0 };
00178         HKEY key;
00179 
00180         res = RegCreateKeyExW(iid_key, num_methods_keyname, 0, NULL, 0,
00181                   KEY_READ | KEY_WRITE, NULL, &key, NULL);
00182         if (res != ERROR_SUCCESS) goto error_close_iid_key;
00183 
00184         sprintfW(buf, fmt, list->num_methods);
00185         res = RegSetValueExW(key, NULL, 0, REG_SZ,
00186                  (CONST BYTE*)buf,
00187                  (lstrlenW(buf) + 1) * sizeof(WCHAR));
00188         RegCloseKey(key);
00189 
00190         if (res != ERROR_SUCCESS) goto error_close_iid_key;
00191     }
00192 
00193     if (list->ps_clsid) {
00194         res = register_key_guid(iid_key, ps_clsid_keyname, list->ps_clsid);
00195         if (res != ERROR_SUCCESS) goto error_close_iid_key;
00196     }
00197 
00198     if (list->ps_clsid32) {
00199         res = register_key_guid(iid_key, ps_clsid32_keyname, list->ps_clsid32);
00200         if (res != ERROR_SUCCESS) goto error_close_iid_key;
00201     }
00202 
00203     error_close_iid_key:
00204     RegCloseKey(iid_key);
00205     }
00206 
00207 error_close_interface_key:
00208     RegCloseKey(interface_key);
00209 error_return:
00210     return res != ERROR_SUCCESS ? HRESULT_FROM_WIN32(res) : S_OK;
00211 }
00212 
00213 /***********************************************************************
00214  *      unregister_interfaces
00215  */
00216 static HRESULT unregister_interfaces(struct regsvr_interface const *list)
00217 {
00218     LONG res = ERROR_SUCCESS;
00219     HKEY interface_key;
00220 
00221     res = RegOpenKeyExW(HKEY_CLASSES_ROOT, interface_keyname, 0,
00222             KEY_READ | KEY_WRITE, &interface_key);
00223     if (res == ERROR_FILE_NOT_FOUND) return S_OK;
00224     if (res != ERROR_SUCCESS) goto error_return;
00225 
00226     for (; res == ERROR_SUCCESS && list->iid; ++list) {
00227     WCHAR buf[39];
00228 
00229     StringFromGUID2(list->iid, buf, 39);
00230     res = RegDeleteTreeW(interface_key, buf);
00231     if (res == ERROR_FILE_NOT_FOUND) res = ERROR_SUCCESS;
00232     }
00233 
00234     RegCloseKey(interface_key);
00235 error_return:
00236     return res != ERROR_SUCCESS ? HRESULT_FROM_WIN32(res) : S_OK;
00237 }
00238 
00239 /***********************************************************************
00240  *      register_coclasses
00241  */
00242 static HRESULT register_coclasses(struct regsvr_coclass const *list)
00243 {
00244     LONG res = ERROR_SUCCESS;
00245     HKEY coclass_key;
00246 
00247     res = RegCreateKeyExW(HKEY_CLASSES_ROOT, clsid_keyname, 0, NULL, 0,
00248               KEY_READ | KEY_WRITE, NULL, &coclass_key, NULL);
00249     if (res != ERROR_SUCCESS) goto error_return;
00250 
00251     for (; res == ERROR_SUCCESS && list->clsid; ++list) {
00252     WCHAR buf[39];
00253     HKEY clsid_key;
00254 
00255     StringFromGUID2(list->clsid, buf, 39);
00256     res = RegCreateKeyExW(coclass_key, buf, 0, NULL, 0,
00257                   KEY_READ | KEY_WRITE, NULL, &clsid_key, NULL);
00258     if (res != ERROR_SUCCESS) goto error_close_coclass_key;
00259 
00260     if (list->name) {
00261         res = RegSetValueExA(clsid_key, NULL, 0, REG_SZ,
00262                  (CONST BYTE*)(list->name),
00263                  strlen(list->name) + 1);
00264         if (res != ERROR_SUCCESS) goto error_close_clsid_key;
00265     }
00266 
00267     if (list->ips) {
00268         res = register_key_defvalueA(clsid_key, ips_keyname, list->ips);
00269         if (res != ERROR_SUCCESS) goto error_close_clsid_key;
00270     }
00271 
00272     if (list->ips32) {
00273         HKEY ips32_key;
00274 
00275         res = RegCreateKeyExW(clsid_key, ips32_keyname, 0, NULL, 0,
00276                   KEY_READ | KEY_WRITE, NULL,
00277                   &ips32_key, NULL);
00278         if (res != ERROR_SUCCESS) goto error_close_clsid_key;
00279 
00280         res = RegSetValueExA(ips32_key, NULL, 0, REG_SZ,
00281                  (CONST BYTE*)list->ips32,
00282                  lstrlenA(list->ips32) + 1);
00283         if (res == ERROR_SUCCESS && list->ips32_tmodel)
00284         res = RegSetValueExA(ips32_key, tmodel_valuename, 0, REG_SZ,
00285                      (CONST BYTE*)list->ips32_tmodel,
00286                      strlen(list->ips32_tmodel) + 1);
00287         RegCloseKey(ips32_key);
00288         if (res != ERROR_SUCCESS) goto error_close_clsid_key;
00289     }
00290 
00291     if (list->progid) {
00292             char *buffer = NULL;
00293             LPCSTR progid;
00294 
00295         if (list->version) {
00296         buffer = HeapAlloc(GetProcessHeap(), 0, strlen(list->progid) + strlen(list->version) + 2);
00297         if (!buffer) {
00298             res = ERROR_OUTOFMEMORY;
00299             goto error_close_clsid_key;
00300         }
00301         strcpy(buffer, list->progid);
00302         strcat(buffer, ".");
00303         strcat(buffer, list->version);
00304         progid = buffer;
00305         } else
00306         progid = list->progid;
00307         res = register_key_defvalueA(clsid_key, progid_keyname,
00308                      progid);
00309         HeapFree(GetProcessHeap(), 0, buffer);
00310         if (res != ERROR_SUCCESS) goto error_close_clsid_key;
00311 
00312         if (list->version) {
00313             res = register_key_defvalueA(clsid_key, versionindependentprogid_keyname,
00314                          list->progid);
00315         if (res != ERROR_SUCCESS) goto error_close_clsid_key;
00316         }
00317     }
00318 
00319     if (list->version) {
00320         res = register_key_defvalueA(clsid_key, version_keyname,
00321                      list->version);
00322         if (res != ERROR_SUCCESS) goto error_close_clsid_key;
00323     }
00324 
00325     error_close_clsid_key:
00326     RegCloseKey(clsid_key);
00327     }
00328 
00329 error_close_coclass_key:
00330     RegCloseKey(coclass_key);
00331 error_return:
00332     return res != ERROR_SUCCESS ? HRESULT_FROM_WIN32(res) : S_OK;
00333 }
00334 
00335 /***********************************************************************
00336  *      unregister_coclasses
00337  */
00338 static HRESULT unregister_coclasses(struct regsvr_coclass const *list)
00339 {
00340     LONG res = ERROR_SUCCESS;
00341     HKEY coclass_key;
00342 
00343     res = RegOpenKeyExW(HKEY_CLASSES_ROOT, clsid_keyname, 0,
00344             KEY_READ | KEY_WRITE, &coclass_key);
00345     if (res == ERROR_FILE_NOT_FOUND) return S_OK;
00346     if (res != ERROR_SUCCESS) goto error_return;
00347 
00348     for (; res == ERROR_SUCCESS && list->clsid; ++list) {
00349     WCHAR buf[39];
00350 
00351     StringFromGUID2(list->clsid, buf, 39);
00352     res = RegDeleteTreeW(coclass_key, buf);
00353     if (res == ERROR_FILE_NOT_FOUND) res = ERROR_SUCCESS;
00354     if (res != ERROR_SUCCESS) goto error_close_coclass_key;
00355     }
00356 
00357 error_close_coclass_key:
00358     RegCloseKey(coclass_key);
00359 error_return:
00360     return res != ERROR_SUCCESS ? HRESULT_FROM_WIN32(res) : S_OK;
00361 }
00362 
00363 /***********************************************************************
00364  *      register_progids
00365  */
00366 static HRESULT register_progids(struct progid const *list)
00367 {
00368     LONG res = ERROR_SUCCESS;
00369 
00370     for (; res == ERROR_SUCCESS && list->name; ++list) {
00371     WCHAR buf[39];
00372     HKEY progid_key;
00373 
00374     res = RegCreateKeyExA(HKEY_CLASSES_ROOT, list->name, 0,
00375               NULL, 0, KEY_READ | KEY_WRITE, NULL,
00376               &progid_key, NULL);
00377     if (res != ERROR_SUCCESS) goto error_close_clsid_key;
00378 
00379     res = RegSetValueExA(progid_key, NULL, 0, REG_SZ,
00380              (CONST BYTE*)list->description,
00381              strlen(list->description) + 1);
00382     if (res != ERROR_SUCCESS) goto error_close_clsid_key;
00383 
00384     StringFromGUID2(list->clsid, buf, 39);
00385 
00386     res = register_key_defvalueW(progid_key, clsid_keyname, buf);
00387     if (res != ERROR_SUCCESS) goto error_close_clsid_key;
00388 
00389     if (list->curver) {
00390         res = register_key_defvalueA(progid_key, curver_keyname, list->curver);
00391         if (res != ERROR_SUCCESS) goto error_close_clsid_key;
00392     }
00393 
00394     error_close_clsid_key:
00395     RegCloseKey(progid_key);
00396     }
00397 
00398     return res != ERROR_SUCCESS ? HRESULT_FROM_WIN32(res) : S_OK;
00399 }
00400 
00401 /***********************************************************************
00402  *      unregister_progids
00403  */
00404 static HRESULT unregister_progids(struct progid const *list)
00405 {
00406     LONG res = ERROR_SUCCESS;
00407 
00408     for (; res == ERROR_SUCCESS && list->name; ++list) {
00409     res = RegDeleteTreeA(HKEY_CLASSES_ROOT, list->name);
00410     if (res == ERROR_FILE_NOT_FOUND) res = ERROR_SUCCESS;
00411     }
00412 
00413     return res != ERROR_SUCCESS ? HRESULT_FROM_WIN32(res) : S_OK;
00414 }
00415 
00416 /***********************************************************************
00417  *      regsvr_key_guid
00418  */
00419 static LONG register_key_guid(HKEY base, WCHAR const *name, GUID const *guid)
00420 {
00421     WCHAR buf[39];
00422 
00423     StringFromGUID2(guid, buf, 39);
00424     return register_key_defvalueW(base, name, buf);
00425 }
00426 
00427 /***********************************************************************
00428  *      regsvr_key_defvalueW
00429  */
00430 static LONG register_key_defvalueW(
00431     HKEY base,
00432     WCHAR const *name,
00433     WCHAR const *value)
00434 {
00435     LONG res;
00436     HKEY key;
00437 
00438     res = RegCreateKeyExW(base, name, 0, NULL, 0,
00439               KEY_READ | KEY_WRITE, NULL, &key, NULL);
00440     if (res != ERROR_SUCCESS) return res;
00441     res = RegSetValueExW(key, NULL, 0, REG_SZ, (CONST BYTE*)value,
00442              (lstrlenW(value) + 1) * sizeof(WCHAR));
00443     RegCloseKey(key);
00444     return res;
00445 }
00446 
00447 /***********************************************************************
00448  *      regsvr_key_defvalueA
00449  */
00450 static LONG register_key_defvalueA(
00451     HKEY base,
00452     WCHAR const *name,
00453     char const *value)
00454 {
00455     LONG res;
00456     HKEY key;
00457 
00458     res = RegCreateKeyExW(base, name, 0, NULL, 0,
00459               KEY_READ | KEY_WRITE, NULL, &key, NULL);
00460     if (res != ERROR_SUCCESS) return res;
00461     res = RegSetValueExA(key, NULL, 0, REG_SZ, (CONST BYTE*)value,
00462              lstrlenA(value) + 1);
00463     RegCloseKey(key);
00464     return res;
00465 }
00466 
00467 /***********************************************************************
00468  *      coclass list
00469  */
00470 static struct regsvr_coclass const coclass_list[] = {
00471     {   &CLSID_DOMDocument,
00472     "XML DOM Document",
00473     NULL,
00474     "msxml3.dll",
00475     "Both",
00476     "Microsoft.XMLDOM",
00477     "1.0"
00478     },
00479     {   &CLSID_DOMDocument2,
00480         "XML DOM Document",
00481         NULL,
00482         "msxml3.dll",
00483         "Both",
00484         "Msxml2.DOMDocument",
00485         "3.0"
00486     },
00487     {   &CLSID_DOMDocument30,
00488         "XML DOM Document 3.0",
00489         NULL,
00490         "msxml3.dll",
00491         "Both",
00492         "Msxml2.DOMDocument",
00493         "3.0"
00494     },
00495     {   &CLSID_DOMFreeThreadedDocument,
00496     "Free threaded XML DOM Document",
00497     NULL,
00498     "msxml3.dll",
00499     "Both",
00500     "Microsoft.FreeThreadedXMLDOM",
00501     "1.0"
00502     },
00503     {   &CLSID_DOMFreeThreadedDocument,
00504         "Free threaded XML DOM Document",
00505         NULL,
00506         "msxml3.dll",
00507         "Both",
00508         "Microsoft.FreeThreadedXMLDOM",
00509         NULL
00510     },
00511     {   &CLSID_FreeThreadedDOMDocument,
00512         "Free Threaded XML DOM Document",
00513         NULL,
00514         "msxml3.dll",
00515         "Both",
00516         "Microsoft.FreeThreadedXMLDOM.1.0",
00517         "1.0"
00518     },
00519     {   &CLSID_FreeThreadedDOMDocument26,
00520         "Free Threaded XML DOM Document 2.6",
00521         NULL,
00522         "msxml3.dll",
00523         "Both",
00524         "Microsoft.FreeThreadedXMLDOM.1.0",
00525         "1.0"
00526      },
00527     {   &CLSID_FreeThreadedDOMDocument30,
00528         "Free Threaded XML DOM Document 3.0",
00529         NULL,
00530         "msxml3.dll",
00531         "Both",
00532         "Microsoft.FreeThreadedDOMDocument.1.0",
00533         "1.0"
00534      },
00535     {   &CLSID_XMLHTTPRequest,
00536     "XML HTTP Request",
00537     NULL,
00538     "msxml3.dll",
00539     "Apartment",
00540     "Microsoft.XMLHTTP",
00541     "1.0"
00542     },
00543     {   &CLSID_XMLDSOControl,
00544     "XML Data Source Object",
00545     NULL,
00546     "msxml3.dll",
00547     "Apartment",
00548     "Microsoft.XMLDSO",
00549     "1.0"
00550     },
00551     {   &CLSID_XMLDocument,
00552     "Msxml",
00553     NULL,
00554     "msxml3.dll",
00555     "Both",
00556     "Msxml"
00557     },
00558     {   &CLSID_XMLSchemaCache,
00559     "XML Schema Cache",
00560     NULL,
00561     "msxml3.dll",
00562     "Both",
00563     "Msxml2.XMLSchemaCache",
00564         "3.0"
00565     },
00566     {   &CLSID_XMLSchemaCache26,
00567     "XML Schema Cache 2.6",
00568     NULL,
00569     "msxml3.dll",
00570     "Both",
00571     "Msxml2.XMLSchemaCache",
00572     "2.6"
00573     },
00574     {   &CLSID_XMLSchemaCache30,
00575     "XML Schema Cache 3.0",
00576     NULL,
00577     "msxml3.dll",
00578     "Both",
00579     "Msxml2.XMLSchemaCache",
00580         "3.0"
00581     },
00582     {   &CLSID_SAXXMLReader,
00583         "SAX XML Reader",
00584         NULL,
00585         "msxml3.dll",
00586         "Both",
00587         "Msxml2.SAXXMLReader",
00588         "3.0"
00589     },
00590     {   &CLSID_SAXXMLReader30,
00591         "SAX XML Reader 3.0",
00592         NULL,
00593         "msxml3.dll",
00594         "Both",
00595         "Msxml2.SAXXMLReader",
00596         "3.0"
00597     },
00598     {   &CLSID_MXXMLWriter,
00599         "IMXWriter interface",
00600         NULL,
00601         "msxml3.dll",
00602         "Both",
00603         "Msxml2.MXXMLWriter",
00604         "3.0"
00605     },
00606     {   &CLSID_MXXMLWriter30,
00607         "IMXWriter interface 3.0",
00608         NULL,
00609         "msxml3.dll",
00610         "Both",
00611         "Msxml2.MXXMLWriter",
00612         "3.0"
00613     },
00614     {   &CLSID_SAXAttributes,
00615         "SAX Attribute",
00616         NULL,
00617         "msxml3.dll",
00618         "Both",
00619         "Msxml2.SAXAttributes",
00620         NULL
00621     },
00622     {   &CLSID_SAXAttributes30,
00623         "SAX Attribute 3.0",
00624         NULL,
00625         "msxml3.dll",
00626         "Both",
00627         "Msxml2.SAXAttributes",
00628         "3.0"
00629     },
00630     { NULL }            /* list terminator */
00631 };
00632 
00633 /***********************************************************************
00634  *      interface list
00635  */
00636 static struct regsvr_interface const interface_list[] = {
00637     { NULL }            /* list terminator */
00638 };
00639 
00640 /***********************************************************************
00641  *      progid list
00642  */
00643 static struct progid const progid_list[] = {
00644     {   "Microsoft.XMLDOM",
00645     "XML DOM Document",
00646     &CLSID_DOMDocument,
00647     "Microsoft.XMLDOM.1.0"
00648     },
00649     {   "Microsoft.XMLDOM.1.0",
00650     "XML DOM Document",
00651     &CLSID_DOMDocument,
00652     NULL
00653     },
00654     {   "MSXML.DOMDocument",
00655     "XML DOM Document",
00656     &CLSID_DOMDocument,
00657     "Microsoft.XMLDOM.1.0"
00658     },
00659     {   "Msxml2.DOMDocument",
00660         "XML DOM Document",
00661         &CLSID_DOMDocument2,
00662         "Msxml2.DOMDocument.3.0"
00663     },
00664     {   "Msxml2.DOMDocument.3.0",
00665         "XML DOM Document 3.0",
00666         &CLSID_DOMDocument30,
00667         NULL
00668     },
00669     {   "Microsoft.FreeThreadedXMLDOM",
00670     "Free threaded XML DOM Document",
00671     &CLSID_DOMFreeThreadedDocument,
00672     "Microsoft.FreeThreadedXMLDOM.1.0"
00673     },
00674     {   "Microsoft.FreeThreadedXMLDOM.1.0",
00675     "Free threaded XML DOM Document",
00676     &CLSID_DOMFreeThreadedDocument,
00677     NULL
00678     },
00679     {   "MSXML.FreeThreadedDOMDocument",
00680     "Free threaded XML DOM Document",
00681     &CLSID_DOMFreeThreadedDocument,
00682     "Microsoft.FreeThreadedXMLDOM.1.0"
00683     },
00684     {   "MSXML.FreeThreadedDOMDocument26",
00685     "Free threaded XML DOM Document 2.6",
00686     &CLSID_FreeThreadedDOMDocument26,
00687     NULL
00688     },
00689     {   "MSXML.FreeThreadedDOMDocument30",
00690     "Free threaded XML DOM Document 3.0",
00691     &CLSID_FreeThreadedDOMDocument30,
00692     NULL
00693     },
00694     {   "Microsoft.XMLHTTP",
00695     "XML HTTP Request",
00696     &CLSID_XMLHTTPRequest,
00697     "Microsoft.XMLHTTP.1.0"
00698     },
00699     {   "Microsoft.XMLHTTP.1.0",
00700     "XML HTTP Request",
00701     &CLSID_XMLHTTPRequest,
00702     NULL
00703     },
00704     {   "Microsoft.XMLDSO",
00705     "XML Data Source Object",
00706     &CLSID_XMLDSOControl,
00707     "Microsoft.XMLDSO.1.0"
00708     },
00709     {   "Microsoft.XMLDSO.1.0",
00710     "XML Data Source Object",
00711     &CLSID_XMLDSOControl,
00712     NULL
00713     },
00714     {   "Msxml",
00715     "Msxml",
00716     &CLSID_XMLDocument,
00717     NULL
00718     },
00719     {   "Msxml2.XMLSchemaCache",
00720         "XML Schema Cache",
00721         &CLSID_XMLSchemaCache,
00722         "Msxml2.XMLSchemaCache.3.0"
00723     },
00724     {   "Msxml2.XMLSchemaCache.2.6",
00725         "XML Schema Cache 2.6",
00726         &CLSID_XMLSchemaCache26,
00727         "Msxml2.XMLSchemaCache.2.6"
00728     },
00729     {   "Msxml2.XMLSchemaCache.3.0",
00730         "XML Schema Cache 3.0",
00731         &CLSID_XMLSchemaCache30,
00732         NULL
00733     },
00734     {   "Msxml2.SAXXMLReader",
00735         "SAX XML Reader",
00736         &CLSID_SAXXMLReader,
00737         "Msxml2.SAXXMLReader.3.0"
00738     },
00739     {   "Msxml2.SAXXMLReader.3.0",
00740         "SAX XML Reader 3.0",
00741         &CLSID_SAXXMLReader30,
00742         NULL
00743     },
00744     {   "Msxml2.MXXMLWriter",
00745         "MXXMLWriter",
00746         &CLSID_MXXMLWriter,
00747         "Msxml2.MXXMLWriter.3.0"
00748     },
00749     {   "Msxml2.MXXMLWriter.3.0",
00750         "MXXMLWriter 3.0",
00751         &CLSID_MXXMLWriter30,
00752         NULL
00753     },
00754     {   "Msxml2.SAXAttributes",
00755         "SAX Attribute",
00756         &CLSID_SAXAttributes,
00757         NULL
00758     },
00759     {   "Msxml2.SAXAttributes.3.0",
00760         "SAX Attribute 3.0",
00761         &CLSID_SAXAttributes30,
00762         NULL
00763     },
00764     { NULL }            /* list terminator */
00765 };
00766 
00767 /***********************************************************************
00768  *      DllRegisterServer (MSXML3.@)
00769  */
00770 HRESULT WINAPI DllRegisterServer(void)
00771 {
00772     HRESULT hr;
00773     ITypeLib *tl;
00774     static const WCHAR wszMsXml3[] = {'m','s','x','m','l','3','.','d','l','l',0};
00775 
00776     TRACE("\n");
00777 
00778     hr = register_coclasses(coclass_list);
00779     if (SUCCEEDED(hr))
00780     hr = register_interfaces(interface_list);
00781     if (SUCCEEDED(hr))
00782     hr = register_progids(progid_list);
00783 
00784     if(SUCCEEDED(hr)) {
00785 
00786         hr = LoadTypeLibEx(wszMsXml3, REGKIND_REGISTER, &tl);
00787         if(SUCCEEDED(hr))
00788             ITypeLib_Release(tl);
00789     }
00790 
00791     return hr;
00792 }
00793 
00794 /***********************************************************************
00795  *      DllUnregisterServer (MSXML3.@)
00796  */
00797 HRESULT WINAPI DllUnregisterServer(void)
00798 {
00799     HRESULT hr;
00800 
00801     TRACE("\n");
00802 
00803     hr = unregister_coclasses(coclass_list);
00804     if (SUCCEEDED(hr))
00805     hr = unregister_interfaces(interface_list);
00806     if (SUCCEEDED(hr))
00807     hr = unregister_progids(progid_list);
00808     if (SUCCEEDED(hr))
00809         hr = UnRegisterTypeLib(&LIBID_MSXML2, 3, 0, LOCALE_SYSTEM_DEFAULT, SYS_WIN32);
00810 
00811     return hr;
00812 }

Generated on Sat May 26 2012 04:20:04 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.