Commit b79fa300 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

itss: Move registration code to inf file and add missing registry.

parent e6fd4d42
......@@ -12,9 +12,12 @@ C_SRCS = \
lzx.c \
itss.c \
moniker.c \
regsvr.c \
storage.c
RC_SRCS = rsrc.rc
@MAKE_DLL_RULES@
rsrc.res: itss.inf
@DEPENDENCIES@ # everything below this line is overwritten by make depend
......@@ -34,6 +34,7 @@
#include "winnls.h"
#include "winreg.h"
#include "ole2.h"
#include "advpub.h"
#include "uuids.h"
......@@ -50,12 +51,14 @@ WINE_DEFAULT_DEBUG_CHANNEL(itss);
static HRESULT ITSS_create(IUnknown *pUnkOuter, LPVOID *ppObj);
LONG dll_count = 0;
static HINSTANCE hInst;
BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpv)
{
switch(fdwReason) {
case DLL_PROCESS_ATTACH:
DisableThreadLibraryCalls(hInstDLL);
hInst = hInstDLL;
break;
case DLL_PROCESS_DETACH:
break;
......@@ -373,3 +376,72 @@ HRESULT WINAPI DllCanUnloadNow(void)
TRACE("dll_count = %u\n", dll_count);
return dll_count ? S_FALSE : S_OK;
}
#define INF_SET_ID(id) \
do \
{ \
static CHAR name[] = #id; \
\
pse[i].pszName = name; \
clsids[i++] = &id; \
} while (0)
#define INF_SET_CLSID(clsid) INF_SET_ID(CLSID_ ## clsid)
static HRESULT register_server(BOOL do_register)
{
HRESULT hres;
HMODULE hAdvpack;
typeof(RegInstallA) *pRegInstall;
STRTABLEA strtable;
STRENTRYA pse[4];
static CLSID const *clsids[4];
int i = 0;
static const WCHAR wszAdvpack[] = {'a','d','v','p','a','c','k','.','d','l','l',0};
INF_SET_CLSID(ITStorage);
INF_SET_CLSID(MSFSStore);
INF_SET_CLSID(MSITStore);
INF_SET_CLSID(ITSProtocol);
strtable.cEntries = sizeof(pse)/sizeof(pse[0]);
strtable.pse = pse;
for(i=0; i < strtable.cEntries; i++) {
pse[i].pszValue = HeapAlloc(GetProcessHeap(), 0, 39);
sprintf(pse[i].pszValue, "{%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X}",
clsids[i]->Data1, clsids[i]->Data2, clsids[i]->Data3, clsids[i]->Data4[0],
clsids[i]->Data4[1], clsids[i]->Data4[2], clsids[i]->Data4[3], clsids[i]->Data4[4],
clsids[i]->Data4[5], clsids[i]->Data4[6], clsids[i]->Data4[7]);
}
hAdvpack = LoadLibraryW(wszAdvpack);
pRegInstall = (typeof(RegInstallA)*)GetProcAddress(hAdvpack, "RegInstall");
hres = pRegInstall(hInst, do_register ? "RegisterDll" : "UnregisterDll", &strtable);
for(i=0; i < sizeof(pse)/sizeof(pse[0]); i++)
HeapFree(GetProcessHeap(), 0, pse[i].pszValue);
return hres;
}
#undef INF_SET_CLSID
#undef INF_SET_ID
/***********************************************************************
* DllRegisterServer (ITSS.@)
*/
HRESULT WINAPI DllRegisterServer(void)
{
return register_server(TRUE);
}
/***********************************************************************
* DllUnregisterServer (ITSS.@)
*/
HRESULT WINAPI DllUnregisterServer(void)
{
return register_server(FALSE);
}
[version]
Signature="$CHICAGO$"
[RegisterDll]
AddReg=Classes.Reg, Misc.Reg
[UnregisterDll]
DelReg=Classes.Reg, Misc.Reg
[Classes.Reg]
;; ITStorage
HKCR,"CLSID\%CLSID_ITStorage%",,,"Microsoft InfoTech IStorage System"
HKCR,"CLSID\%CLSID_ITStorage%\InProcServer32",,,"itss.dll"
HKCR,"CLSID\%CLSID_ITStorage%\InProcServer32","ThreadingModel",,"Both"
HKCR,"CLSID\%CLSID_ITStorage%\NotInsertable",,,""
HKCR,"CLSID\%CLSID_ITStorage%\ProgID",,,"MSITFS1.0"
HKCR,"CLSID\%CLSID_ITStorage%\VersionIndependentProgID",,,"MSITFS"
HKCR,"MSITFS",,,"Microsoft InfoTech IStorage System"
HKCR,"MSITFS\CLSID",,,"%CLSID_ITStorage%"
HKCR,"MSITFS\CurVer",,,"MSITFS1.0"
;; ITSProtocol for IE 3.0
HKCR,"CLSID\%CLSID_MSITStore%",,,"Microsoft InfoTech Protocol for IE 3.0"
HKCR,"CLSID\%CLSID_MSITStore%\InProcServer32",,,"itss.dll"
HKCR,"CLSID\%CLSID_MSITStore%\InProcServer32","ThreadingModel",,"Both"
HKCR,"CLSID\%CLSID_MSITStore%\NotInsertable",,,""
HKCR,"CLSID\%CLSID_MSITStore%\ProgID",,,"MSITFS1.0"
HKCR,"CLSID\%CLSID_MSITStore%\VersionIndependentProgID",,,"MSITFS"
HKCR,"MSITStore",,,"Microsoft InfoTech Protocol for IE 3.0"
HKCR,"MSITStore\CLSID",,,"%CLSID_MSITStore%"
HKCR,"MSITStore\CurVer",,,"MSITStore1.0"
;; ITSProtocol for IE 4.0
HKCR,"CLSID\%CLSID_ITSProtocol%",,,"Microsoft InfoTech Protocol for IE 4.0"
HKCR,"CLSID\%CLSID_ITSProtocol%\InProcServer32",,,"itss.dll"
HKCR,"CLSID\%CLSID_ITSProtocol%\InProcServer32","ThreadingModel",,"Both"
HKCR,"CLSID\%CLSID_ITSProtocol%\NotInsertable",,,""
HKCR,"CLSID\%CLSID_ITSProtocol%\ProgID",,,"MSITFS1.0"
HKCR,"CLSID\%CLSID_ITSProtocol%%\VersionIndependentProgID",,,"MSITFS"
HKCR,"ITSProtocol","Microsoft InfoTech Protocols for IE 4.0"
HKCR,"ITSProtocol\CLSID",,,"%CLSID_ITSProtocol%"
HKCR,"ITSProtocol\CurVer",,,"ITSProtocol1.0"
;; MSFSStore
HKCR,"CLSID\%CLSID_MSFSStore%",,,"Microsoft InfoTech IStorage for Win32 Files"
HKCR,"CLSID\%CLSID_MSFSStore%\InProcServer32",,,"itss.dll"
HKCR,"CLSID\%CLSID_MSFSStore%\InProcServer32","ThreadingModel",,"Both"
HKCR,"CLSID\%CLSID_MSFSStore%\NotInsertable",,,""
HKCR,"CLSID\%CLSID_MSFSStore%\ProgID",,,"MSITFS1.0"
HKCR,"CLSID\%CLSID_MSFSStore%\VersionIndependentProgID",,,"MSITFS"
HKCR,"MSFSStore",,,"Microsoft InfoTech IStorage for Win32 Files"
HKCR,"MSFSStore\CLSID",,,"%CLSID_MSFSStore%"
HKCR,"MSFSStore\CurVer",,,"MSFSStore1.0"
[Misc.Reg]
HKCR,".its",,,"ITS File"
HKCR,"ITS FILE",,,"Internet Document Set"
HKCR,"ITS FILE\DefaultIcon",,,"itss.dll,0"
;; HKCR "ITS FILE\shell\open\command",,,"FIXME"
HKCR,"PROTOCOLS\Handler\its",,,"its: Asychronous Pluggable Protocol Handler"
HKCR,"PROTOCOLS\Handler\its","CLSID",,"%CLSID_ITSProtocol%"
HKCR,"PROTOCOLS\Handler\ms-its",,,"ms-its: Asychronous Pluggable Protocol Handler"
HKCR,"PROTOCOLS\Handler\ms-its","CLSID",,"%CLSID_ITSProtocol%"
HKCR,"PROTOCOLS\Name-Space Handler\mk",,,"NameSpace Filter for MK:@MSITStore:..."
HKCR,"PROTOCOLS\Name-Space Handler\mk\*","CLSID",,"%CLSID_ITSProtocol%"
/*
* Copyright 2006 Jacek Caban for CodeWeavers
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
REGINST REGINST itss.inf
......@@ -90,4 +90,6 @@ interface IITStorage : IUnknown
}
cpp_quote("DEFINE_GUID(CLSID_ITStorage,0x5d02926a,0x212e,0x11d0,0x9d,0xf9,0x00,0xa0,0xc9,0x22,0xe6,0xec);")
cpp_quote("DEFINE_GUID(CLSID_MSFSStore,0xd54eee56,0xaaab,0x11d0,0x9e,0x1d,0x00,0xa0,0xc9,0x22,0xe6,0xec);")
cpp_quote("DEFINE_GUID(CLSID_MSITStore,0x9d148290,0xb9c8,0x11d0,0xa4,0xcc,0x00,0x00,0xf8,0x01,0x49,0xf6);")
cpp_quote("DEFINE_GUID(CLSID_ITSProtocol,0x9d148291,0xb9c8,0x11d0,0xa4,0xcc,0x00,0x00,0xf8,0x01,0x49,0xf6);")
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment