From 49ef4f1c7501262c4e4f8bbf84053ae48f62c682 Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Tue, 2 Aug 2011 21:48:37 +0200 Subject: [PATCH] wiaservc: Register the service from wine.inf. --- dlls/wiaservc/wiaservc.inf | 4 ---- dlls/wiaservc/wiaservc_main.c | 35 ----------------------------------- tools/wine.inf.in | 16 ++++++++++++++++ 3 files changed, 16 insertions(+), 39 deletions(-) diff --git a/dlls/wiaservc/wiaservc.inf b/dlls/wiaservc/wiaservc.inf index 7adc6da3153..b46eb14208a 100644 --- a/dlls/wiaservc/wiaservc.inf +++ b/dlls/wiaservc/wiaservc.inf @@ -11,7 +11,3 @@ DelReg = WiaServc.Reg HKCR,"AppID\%CLSID_WiaDevMgr%",,,"WIA Device Manager" HKCR,"AppID\%CLSID_WiaDevMgr%","LocalService",,"stisvc" HKCR,"CLSID\%CLSID_WiaDevMgr%","AppID",,"%CLSID_WiaDevMgr%" - -HKLM,"Software\Microsoft\Windows NT\CurrentVersion\SvcHost","imgsvc",0x00010000,"StiSvc" - -HKLM,"System\CurrentControlSet\Services\stisvc\Parameters","ServiceDll",0x00020000,"wiaservc.dll" diff --git a/dlls/wiaservc/wiaservc_main.c b/dlls/wiaservc/wiaservc_main.c index 8ffb2158b42..a190f318aeb 100644 --- a/dlls/wiaservc/wiaservc_main.c +++ b/dlls/wiaservc/wiaservc_main.c @@ -102,35 +102,6 @@ static void cleanup_register_strtable(STRTABLEA *strtable) } } -static HRESULT register_service(BOOL do_register) -{ - static const WCHAR name[] = { 's','t','i','s','v','c', 0 }; - static const WCHAR path[] = { 's','v','c','h','o','s','t','.','e','x','e', - ' ','-','k',' ','i','m','g','s','v','c', 0 }; - SC_HANDLE scm, service; - - scm = OpenSCManagerW(NULL, NULL, SC_MANAGER_ALL_ACCESS); - if (!scm) - return SELFREG_E_CLASS; - - if (do_register) - service = CreateServiceW(scm, name, name, SERVICE_ALL_ACCESS, - SERVICE_WIN32_OWN_PROCESS, - SERVICE_DEMAND_START, SERVICE_ERROR_NORMAL, - path, NULL, NULL, NULL, NULL, NULL); - else - service = OpenServiceW(scm, name, DELETE); - - - CloseServiceHandle(scm); - if (service) - { - if (!do_register) DeleteService(service); - CloseServiceHandle(service); - } - return S_OK; -} - /* Use an INF file to register or unregister the DLL */ static HRESULT register_server(BOOL do_register) { @@ -142,12 +113,6 @@ static HRESULT register_server(BOOL do_register) TRACE("(%x)\n", do_register); - hr = register_service(do_register); - if (FAILED(hr)) { - ERR("register_service failed: %d\n", GetLastError()); - return hr; - } - hAdvpack = LoadLibraryW(wszAdvpack); pRegInstall = (void *)GetProcAddress(hAdvpack, "RegInstall"); diff --git a/tools/wine.inf.in b/tools/wine.inf.in index c27524dea5f..ad891c45424 100644 --- a/tools/wine.inf.in +++ b/tools/wine.inf.in @@ -126,18 +126,21 @@ AddReg=\ [DefaultInstall.Services] AddService=MountMgr,0x800,MountMgrService AddService=Spooler,0,SpoolerService +AddService=StiSvc,0,StiService AddService=TermService,0,TerminalServices AddService=PlugPlay,0,PlugPlayService [DefaultInstall.NT.Services] AddService=MountMgr,0x800,MountMgrService AddService=Spooler,0,SpoolerService +AddService=StiSvc,0,StiService AddService=TermService,0,TerminalServices AddService=PlugPlay,0,PlugPlayService [DefaultInstall.ntamd64.Services] AddService=MountMgr,0x800,MountMgrService AddService=Spooler,0,SpoolerService +AddService=StiSvc,0,StiService AddService=TermService,0,TerminalServices AddService=PlugPlay,0,PlugPlayService @@ -2980,6 +2983,19 @@ ServiceType=32 StartType=3 ErrorControl=1 +[StiService] +AddReg=StiServiceKeys +Description="WIA Service" +DisplayName="WIA Service" +ServiceBinary="%11%\svchost.exe -k imgsvc" +ServiceType=16 +StartType=3 +ErrorControl=1 + +[StiServiceKeys] +HKR,Parameters,"ServiceDll",,"%11%\wiaservc.dll" +HKLM,%CurrentVersionNT%\SvcHost,"imgsvc",0x00010000,"StiSvc" + [PlugPlayService] Description="Enables automatic configuration of devices" DisplayName="Plug and Play Service"