wiaservc: Register the service from wine.inf.

This commit is contained in:
Alexandre Julliard 2011-08-02 21:48:37 +02:00
parent 380abdeb10
commit 49ef4f1c75
3 changed files with 16 additions and 39 deletions

View File

@ -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"

View File

@ -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");

View File

@ -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"