- Add inseng, localspl, wuapi from Wine

svn path=/trunk/; revision=39751
This commit is contained in:
Dmitry Chapyshev 2009-02-25 15:26:49 +00:00
parent c7826cae81
commit eaa65d2024
41 changed files with 5875 additions and 0 deletions

View file

@ -14,6 +14,7 @@
<property name="BASEADDRESS_LOADPERF" value="0x4B920000" />
<property name="BASEADDRESS_MPRAPI" value="0x4C400000" />
<property name="BASEADDRESS_MSFTEDIT" value="0x4b460000" />
<property name="BASEADDRESS_WUAPI" value="0x506a0000" />
<property name="BASEADDRESS_SRCLIENT" value="0x512C0000" />
<property name="BASEADDRESS_PSTOREC" value="0x513D0000" />
<property name="BASEADDRESS_LPK" value="0x516C0000" />
@ -38,6 +39,7 @@
<property name="BASEADDRESS_DINPUT" value="0x5f580000" />
<property name="BASEADDRESS_NETID" value="0x5f660000" />
<property name="BASEADDRESS_NTPRINT" value="0x5f6a0000" />
<property name="BASEADDRESS_INSENG" value="0x61000000" />
<property name="BASEADDRESS_QEDIT" value="0x611c0000" />
<property name="BASEADDRESS_MODEMUI" value="0x61650000" />
<property name="BASEADDRESS_MAPI32" value="0x62250000" />
@ -147,6 +149,7 @@
<property name="BASEADDRESS_IPHLPAPI" value="0x75700000" />
<property name="BASEADDRESS_NDDEAPI" value="0x75940000" />
<property name="BASEADDRESS_MSGINA" value="0x75970000" />
<property name="BASEADDRESS_LOCALSPL" value="0x75b80000" />
<property name="BASEADDRESS_CRYPTNET" value="0x75e60000" />
<property name="BASEADDRESS_RPCRT4" value="0x76000000" />
<property name="BASEADDRESS_SHLWAPI" value="0x76120000" />

View file

@ -281,11 +281,13 @@ dll\win32\imagehlp\imagehlp.dll 1
dll\win32\imm32\imm32.dll 1
dll\win32\inetcomm\inetcomm.dll 1
dll\win32\inetmib1\inetmib1.dll 1
dll\win32\inseng\inseng.dll 1
dll\win32\iphlpapi\iphlpapi.dll 1
dll\win32\itss\itss.dll 1
dll\win32\jscript\jscript.dll 1
dll\win32\kernel32\kernel32.dll 1
dll\win32\loadperf\loadperf.dll 1
dll\win32\localspl\localspl.dll 1
dll\win32\localui\localui.dll 1
dll\win32\lsasrv\lsasrv.dll 1
dll\win32\lz32\lz32.dll 1
@ -406,6 +408,7 @@ dll\win32\wshirda\wshirda.dll 1
dll\win32\wshtcpip\wshtcpip.dll 1
dll\win32\wsock32\wsock32.dll 1
dll\win32\wtsapi32\wtsapi32.dll 1
dll\win32\wuapi\wuapi.dll 1
dll\win32\winmm\midimap\midimap.dll 1
dll\win32\winmm\wavemap\msacm32.drv 1 optional

View file

@ -0,0 +1,16 @@
<module name="inseng" type="win32dll" baseaddress="${BASEADDRESS_INSENG}" installbase="system32" installname="inseng.dll" allowwarnings="true">
<autoregister infsection="OleControlDlls" type="DllRegisterServer" />
<importlibrary definition="inseng.spec" />
<include base="inseng">.</include>
<include base="ReactOS">include/reactos/wine</include>
<define name="__WINESRC__" />
<define name="_WIN32_WINNT">0x600</define>
<file>inseng_main.c</file>
<file>regsvr.c</file>
<library>wine</library>
<library>uuid</library>
<library>ole32</library>
<library>advapi32</library>
<library>kernel32</library>
<library>ntdll</library>
</module>

View file

@ -0,0 +1,12 @@
@ stub CheckForVersionConflict
@ stub CheckTrust
@ stdcall CheckTrustEx(ptr ptr ptr ptr ptr)
@ stdcall -private DllCanUnloadNow()
@ stdcall -private DllGetClassObject(ptr ptr ptr)
@ stub DllInstall
@ stdcall -private DllRegisterServer()
@ stdcall -private DllUnregisterServer()
@ stub DownloadFile
@ stub GetICifFileFromFile
@ stub GetICifRWFileFromFile
@ stub PurgeDownloadDirectory

View file

@ -0,0 +1,72 @@
/*
* INSENG Implementation
*
* Copyright 2006 Mike McCormack
*
* 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
*/
#define COBJMACROS
#include "config.h"
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "winuser.h"
#include "ole2.h"
#include "initguid.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(inseng);
BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpv)
{
switch(fdwReason)
{
case DLL_WINE_PREATTACH:
return FALSE; /* prefer native version */
case DLL_PROCESS_ATTACH:
DisableThreadLibraryCalls(hInstDLL);
break;
case DLL_PROCESS_DETACH:
break;
}
return TRUE;
}
/***********************************************************************
* DllGetClassObject (INSENG.@)
*/
HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID iid, LPVOID *ppv)
{
FIXME("%s %s %p\n", debugstr_guid(rclsid), debugstr_guid(iid), ppv);
return CLASS_E_CLASSNOTAVAILABLE;
}
HRESULT WINAPI DllCanUnloadNow(void)
{
FIXME("\n");
return S_FALSE;
}
BOOL WINAPI CheckTrustEx( LPVOID a, LPVOID b, LPVOID c, LPVOID d, LPVOID e )
{
FIXME("%p %p %p %p %p\n", a, b, c, d, e );
return TRUE;
}

View file

@ -0,0 +1,501 @@
/*
* self-registerable dll functions for inseng.dll
*
* Copyright (C) 2003 John K. Hohm
* Copyright (C) 2004 Steven Edwards for ReactOS
*
* 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
*/
#include <stdarg.h>
#include <string.h>
#include "windef.h"
#include "winbase.h"
#include "winuser.h"
#include "wingdi.h"
#include "winreg.h"
#include "winerror.h"
#include "objbase.h"
#include "initguid.h"
#include "wine/debug.h"
#include "wine/unicode.h"
WINE_DEFAULT_DEBUG_CHANNEL(inseng);
DEFINE_GUID(CLSID_ActiveSetupEng, 0x6e449686,0xc509,0x11cf,0xaa,0xfa,0x00,0xaa,0x00,0xb6,0x01,0x5c );
DEFINE_GUID(CLSID_DLManager, 0xBFC880F1,0x7484,0x11D0,0x83,0x09,0x00,0xAA,0x00,0xB6,0x01,0x5C);
/*
* Near the bottom of this file are the exported DllRegisterServer and
* DllUnregisterServer, which make all this worthwhile.
*/
/***********************************************************************
* interface for self-registering
*/
struct regsvr_interface
{
IID const *iid; /* NULL for end of list */
LPCSTR name; /* can be NULL to omit */
IID const *base_iid; /* can be NULL to omit */
int num_methods; /* can be <0 to omit */
CLSID const *ps_clsid; /* can be NULL to omit */
CLSID const *ps_clsid32; /* can be NULL to omit */
};
static HRESULT register_interfaces(struct regsvr_interface const *list);
static HRESULT unregister_interfaces(struct regsvr_interface const *list);
struct regsvr_coclass
{
CLSID const *clsid; /* NULL for end of list */
LPCSTR name; /* can be NULL to omit */
LPCSTR ips; /* can be NULL to omit */
LPCSTR ips32; /* can be NULL to omit */
LPCSTR ips32_tmodel; /* can be NULL to omit */
LPCSTR progid; /* can be NULL to omit */
LPCSTR viprogid; /* can be NULL to omit */
LPCSTR progid_extra; /* can be NULL to omit */
};
static HRESULT register_coclasses(struct regsvr_coclass const *list);
static HRESULT unregister_coclasses(struct regsvr_coclass const *list);
/***********************************************************************
* static string constants
*/
static WCHAR const interface_keyname[10] = {
'I', 'n', 't', 'e', 'r', 'f', 'a', 'c', 'e', 0 };
static WCHAR const base_ifa_keyname[14] = {
'B', 'a', 's', 'e', 'I', 'n', 't', 'e', 'r', 'f', 'a', 'c',
'e', 0 };
static WCHAR const num_methods_keyname[11] = {
'N', 'u', 'm', 'M', 'e', 't', 'h', 'o', 'd', 's', 0 };
static WCHAR const ps_clsid_keyname[15] = {
'P', 'r', 'o', 'x', 'y', 'S', 't', 'u', 'b', 'C', 'l', 's',
'i', 'd', 0 };
static WCHAR const ps_clsid32_keyname[17] = {
'P', 'r', 'o', 'x', 'y', 'S', 't', 'u', 'b', 'C', 'l', 's',
'i', 'd', '3', '2', 0 };
static WCHAR const clsid_keyname[6] = {
'C', 'L', 'S', 'I', 'D', 0 };
static WCHAR const curver_keyname[7] = {
'C', 'u', 'r', 'V', 'e', 'r', 0 };
static WCHAR const ips_keyname[13] = {
'I', 'n', 'P', 'r', 'o', 'c', 'S', 'e', 'r', 'v', 'e', 'r',
0 };
static WCHAR const ips32_keyname[15] = {
'I', 'n', 'P', 'r', 'o', 'c', 'S', 'e', 'r', 'v', 'e', 'r',
'3', '2', 0 };
static WCHAR const progid_keyname[7] = {
'P', 'r', 'o', 'g', 'I', 'D', 0 };
static WCHAR const viprogid_keyname[25] = {
'V', 'e', 'r', 's', 'i', 'o', 'n', 'I', 'n', 'd', 'e', 'p',
'e', 'n', 'd', 'e', 'n', 't', 'P', 'r', 'o', 'g', 'I', 'D',
0 };
static char const tmodel_valuename[] = "ThreadingModel";
/***********************************************************************
* static helper functions
*/
static LONG register_key_guid(HKEY base, WCHAR const *name, GUID const *guid);
static LONG register_key_defvalueW(HKEY base, WCHAR const *name,
WCHAR const *value);
static LONG register_key_defvalueA(HKEY base, WCHAR const *name,
char const *value);
static LONG register_progid(WCHAR const *clsid,
char const *progid, char const *curver_progid,
char const *name, char const *extra);
/***********************************************************************
* register_interfaces
*/
static HRESULT register_interfaces(struct regsvr_interface const *list)
{
LONG res = ERROR_SUCCESS;
HKEY interface_key;
res = RegCreateKeyExW(HKEY_CLASSES_ROOT, interface_keyname, 0, NULL, 0,
KEY_READ | KEY_WRITE, NULL, &interface_key, NULL);
if (res != ERROR_SUCCESS) goto error_return;
for (; res == ERROR_SUCCESS && list->iid; ++list) {
WCHAR buf[39];
HKEY iid_key;
StringFromGUID2(list->iid, buf, 39);
res = RegCreateKeyExW(interface_key, buf, 0, NULL, 0,
KEY_READ | KEY_WRITE, NULL, &iid_key, NULL);
if (res != ERROR_SUCCESS) goto error_close_interface_key;
if (list->name) {
res = RegSetValueExA(iid_key, NULL, 0, REG_SZ,
(CONST BYTE*)(list->name),
strlen(list->name) + 1);
if (res != ERROR_SUCCESS) goto error_close_iid_key;
}
if (list->base_iid) {
res = register_key_guid(iid_key, base_ifa_keyname, list->base_iid);
if (res != ERROR_SUCCESS) goto error_close_iid_key;
}
if (0 <= list->num_methods) {
static WCHAR const fmt[3] = { '%', 'd', 0 };
HKEY key;
res = RegCreateKeyExW(iid_key, num_methods_keyname, 0, NULL, 0,
KEY_READ | KEY_WRITE, NULL, &key, NULL);
if (res != ERROR_SUCCESS) goto error_close_iid_key;
sprintfW(buf, fmt, list->num_methods);
res = RegSetValueExW(key, NULL, 0, REG_SZ,
(CONST BYTE*)buf,
(lstrlenW(buf) + 1) * sizeof(WCHAR));
RegCloseKey(key);
if (res != ERROR_SUCCESS) goto error_close_iid_key;
}
if (list->ps_clsid) {
res = register_key_guid(iid_key, ps_clsid_keyname, list->ps_clsid);
if (res != ERROR_SUCCESS) goto error_close_iid_key;
}
if (list->ps_clsid32) {
res = register_key_guid(iid_key, ps_clsid32_keyname, list->ps_clsid32);
if (res != ERROR_SUCCESS) goto error_close_iid_key;
}
error_close_iid_key:
RegCloseKey(iid_key);
}
error_close_interface_key:
RegCloseKey(interface_key);
error_return:
return res != ERROR_SUCCESS ? HRESULT_FROM_WIN32(res) : S_OK;
}
/***********************************************************************
* unregister_interfaces
*/
static HRESULT unregister_interfaces(struct regsvr_interface const *list)
{
LONG res = ERROR_SUCCESS;
HKEY interface_key;
res = RegOpenKeyExW(HKEY_CLASSES_ROOT, interface_keyname, 0,
KEY_READ | KEY_WRITE, &interface_key);
if (res == ERROR_FILE_NOT_FOUND) return S_OK;
if (res != ERROR_SUCCESS) goto error_return;
for (; res == ERROR_SUCCESS && list->iid; ++list) {
WCHAR buf[39];
StringFromGUID2(list->iid, buf, 39);
res = RegDeleteTreeW(interface_key, buf);
if (res == ERROR_FILE_NOT_FOUND) res = ERROR_SUCCESS;
}
RegCloseKey(interface_key);
error_return:
return res != ERROR_SUCCESS ? HRESULT_FROM_WIN32(res) : S_OK;
}
/***********************************************************************
* register_coclasses
*/
static HRESULT register_coclasses(struct regsvr_coclass const *list)
{
LONG res = ERROR_SUCCESS;
HKEY coclass_key;
res = RegCreateKeyExW(HKEY_CLASSES_ROOT, clsid_keyname, 0, NULL, 0,
KEY_READ | KEY_WRITE, NULL, &coclass_key, NULL);
if (res != ERROR_SUCCESS) goto error_return;
for (; res == ERROR_SUCCESS && list->clsid; ++list) {
WCHAR buf[39];
HKEY clsid_key;
StringFromGUID2(list->clsid, buf, 39);
res = RegCreateKeyExW(coclass_key, buf, 0, NULL, 0,
KEY_READ | KEY_WRITE, NULL, &clsid_key, NULL);
if (res != ERROR_SUCCESS) goto error_close_coclass_key;
if (list->name) {
res = RegSetValueExA(clsid_key, NULL, 0, REG_SZ,
(CONST BYTE*)(list->name),
strlen(list->name) + 1);
if (res != ERROR_SUCCESS) goto error_close_clsid_key;
}
if (list->ips) {
res = register_key_defvalueA(clsid_key, ips_keyname, list->ips);
if (res != ERROR_SUCCESS) goto error_close_clsid_key;
}
if (list->ips32) {
HKEY ips32_key;
res = RegCreateKeyExW(clsid_key, ips32_keyname, 0, NULL, 0,
KEY_READ | KEY_WRITE, NULL,
&ips32_key, NULL);
if (res != ERROR_SUCCESS) goto error_close_clsid_key;
res = RegSetValueExA(ips32_key, NULL, 0, REG_SZ,
(CONST BYTE*)list->ips32,
lstrlenA(list->ips32) + 1);
if (res == ERROR_SUCCESS && list->ips32_tmodel)
res = RegSetValueExA(ips32_key, tmodel_valuename, 0, REG_SZ,
(CONST BYTE*)list->ips32_tmodel,
strlen(list->ips32_tmodel) + 1);
RegCloseKey(ips32_key);
if (res != ERROR_SUCCESS) goto error_close_clsid_key;
}
if (list->progid) {
res = register_key_defvalueA(clsid_key, progid_keyname,
list->progid);
if (res != ERROR_SUCCESS) goto error_close_clsid_key;
res = register_progid(buf, list->progid, NULL,
list->name, list->progid_extra);
if (res != ERROR_SUCCESS) goto error_close_clsid_key;
}
if (list->viprogid) {
res = register_key_defvalueA(clsid_key, viprogid_keyname,
list->viprogid);
if (res != ERROR_SUCCESS) goto error_close_clsid_key;
res = register_progid(buf, list->viprogid, list->progid,
list->name, list->progid_extra);
if (res != ERROR_SUCCESS) goto error_close_clsid_key;
}
error_close_clsid_key:
RegCloseKey(clsid_key);
}
error_close_coclass_key:
RegCloseKey(coclass_key);
error_return:
return res != ERROR_SUCCESS ? HRESULT_FROM_WIN32(res) : S_OK;
}
/***********************************************************************
* unregister_coclasses
*/
static HRESULT unregister_coclasses(struct regsvr_coclass const *list)
{
LONG res = ERROR_SUCCESS;
HKEY coclass_key;
res = RegOpenKeyExW(HKEY_CLASSES_ROOT, clsid_keyname, 0,
KEY_READ | KEY_WRITE, &coclass_key);
if (res == ERROR_FILE_NOT_FOUND) return S_OK;
if (res != ERROR_SUCCESS) goto error_return;
for (; res == ERROR_SUCCESS && list->clsid; ++list) {
WCHAR buf[39];
StringFromGUID2(list->clsid, buf, 39);
res = RegDeleteTreeW(coclass_key, buf);
if (res == ERROR_FILE_NOT_FOUND) res = ERROR_SUCCESS;
if (res != ERROR_SUCCESS) goto error_close_coclass_key;
if (list->progid) {
res = RegDeleteTreeA(HKEY_CLASSES_ROOT, list->progid);
if (res == ERROR_FILE_NOT_FOUND) res = ERROR_SUCCESS;
if (res != ERROR_SUCCESS) goto error_close_coclass_key;
}
if (list->viprogid) {
res = RegDeleteTreeA(HKEY_CLASSES_ROOT, list->viprogid);
if (res == ERROR_FILE_NOT_FOUND) res = ERROR_SUCCESS;
if (res != ERROR_SUCCESS) goto error_close_coclass_key;
}
}
error_close_coclass_key:
RegCloseKey(coclass_key);
error_return:
return res != ERROR_SUCCESS ? HRESULT_FROM_WIN32(res) : S_OK;
}
/***********************************************************************
* regsvr_key_guid
*/
static LONG register_key_guid(HKEY base, WCHAR const *name, GUID const *guid)
{
WCHAR buf[39];
StringFromGUID2(guid, buf, 39);
return register_key_defvalueW(base, name, buf);
}
/***********************************************************************
* regsvr_key_defvalueW
*/
static LONG register_key_defvalueW(
HKEY base,
WCHAR const *name,
WCHAR const *value)
{
LONG res;
HKEY key;
res = RegCreateKeyExW(base, name, 0, NULL, 0,
KEY_READ | KEY_WRITE, NULL, &key, NULL);
if (res != ERROR_SUCCESS) return res;
res = RegSetValueExW(key, NULL, 0, REG_SZ, (CONST BYTE*)value,
(lstrlenW(value) + 1) * sizeof(WCHAR));
RegCloseKey(key);
return res;
}
/***********************************************************************
* regsvr_key_defvalueA
*/
static LONG register_key_defvalueA(
HKEY base,
WCHAR const *name,
char const *value)
{
LONG res;
HKEY key;
res = RegCreateKeyExW(base, name, 0, NULL, 0,
KEY_READ | KEY_WRITE, NULL, &key, NULL);
if (res != ERROR_SUCCESS) return res;
res = RegSetValueExA(key, NULL, 0, REG_SZ, (CONST BYTE*)value,
lstrlenA(value) + 1);
RegCloseKey(key);
return res;
}
/***********************************************************************
* regsvr_progid
*/
static LONG register_progid(
WCHAR const *clsid,
char const *progid,
char const *curver_progid,
char const *name,
char const *extra)
{
LONG res;
HKEY progid_key;
res = RegCreateKeyExA(HKEY_CLASSES_ROOT, progid, 0,
NULL, 0, KEY_READ | KEY_WRITE, NULL,
&progid_key, NULL);
if (res != ERROR_SUCCESS) return res;
if (name) {
res = RegSetValueExA(progid_key, NULL, 0, REG_SZ,
(CONST BYTE*)name, strlen(name) + 1);
if (res != ERROR_SUCCESS) goto error_close_progid_key;
}
if (clsid) {
res = register_key_defvalueW(progid_key, clsid_keyname, clsid);
if (res != ERROR_SUCCESS) goto error_close_progid_key;
}
if (curver_progid) {
res = register_key_defvalueA(progid_key, curver_keyname,
curver_progid);
if (res != ERROR_SUCCESS) goto error_close_progid_key;
}
if (extra) {
HKEY extra_key;
res = RegCreateKeyExA(progid_key, extra, 0,
NULL, 0, KEY_READ | KEY_WRITE, NULL,
&extra_key, NULL);
if (res == ERROR_SUCCESS)
RegCloseKey(extra_key);
}
error_close_progid_key:
RegCloseKey(progid_key);
return res;
}
/***********************************************************************
* coclass list
*/
static struct regsvr_coclass const coclass_list[] = {
{
&CLSID_ActiveSetupEng,
"Microsoft Active Setup Engine",
NULL,
"inseng.dll",
"Apartment"
},
{
&CLSID_DLManager,
"Download Site Manager",
NULL,
"inseng.dll",
"Apartment"
},
{ NULL } /* list terminator */
};
/***********************************************************************
* interface list
*/
static struct regsvr_interface const interface_list[] = {
{ NULL } /* list terminator */
};
/***********************************************************************
* DllRegisterServer (INSENG.@)
*/
HRESULT WINAPI DllRegisterServer(void)
{
HRESULT hr;
TRACE("\n");
hr = register_coclasses(coclass_list);
if (SUCCEEDED(hr))
hr = register_interfaces(interface_list);
return hr;
}
/***********************************************************************
* DllUnregisterServer (INSENG.@)
*/
HRESULT WINAPI DllUnregisterServer(void)
{
HRESULT hr;
TRACE("\n");
hr = unregister_coclasses(coclass_list);
if (SUCCEEDED(hr))
hr = unregister_interfaces(interface_list);
return hr;
}

View file

@ -0,0 +1,815 @@
/*
* Implementation of the Local Printmonitor
*
* Copyright 2006 Detlef Riekenberg
*
* 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
*/
#include <stdarg.h>
#define COBJMACROS
#define NONAMELESSUNION
#include "windef.h"
#include "winbase.h"
#include "wingdi.h"
#include "winuser.h"
#include "winreg.h"
#include "winspool.h"
#include "ddk/winsplp.h"
#include "localspl_private.h"
#include "wine/debug.h"
#include "wine/list.h"
#include "wine/unicode.h"
WINE_DEFAULT_DEBUG_CHANNEL(localspl);
/*****************************************************/
static CRITICAL_SECTION port_handles_cs;
static CRITICAL_SECTION_DEBUG port_handles_cs_debug =
{
0, 0, &port_handles_cs,
{ &port_handles_cs_debug.ProcessLocksList, &port_handles_cs_debug.ProcessLocksList },
0, 0, { (DWORD_PTR)(__FILE__ ": port_handles_cs") }
};
static CRITICAL_SECTION port_handles_cs = { &port_handles_cs_debug, -1, 0, 0, 0, 0 };
static CRITICAL_SECTION xcv_handles_cs;
static CRITICAL_SECTION_DEBUG xcv_handles_cs_debug =
{
0, 0, &xcv_handles_cs,
{ &xcv_handles_cs_debug.ProcessLocksList, &xcv_handles_cs_debug.ProcessLocksList },
0, 0, { (DWORD_PTR)(__FILE__ ": xcv_handles_cs") }
};
static CRITICAL_SECTION xcv_handles_cs = { &xcv_handles_cs_debug, -1, 0, 0, 0, 0 };
/* ############################### */
typedef struct {
struct list entry;
DWORD type;
WCHAR nameW[1];
} port_t;
typedef struct {
struct list entry;
ACCESS_MASK GrantedAccess;
WCHAR nameW[1];
} xcv_t;
static struct list port_handles = LIST_INIT( port_handles );
static struct list xcv_handles = LIST_INIT( xcv_handles );
/* ############################### */
static const WCHAR cmd_AddPortW[] = {'A','d','d','P','o','r','t',0};
static const WCHAR cmd_DeletePortW[] = {'D','e','l','e','t','e','P','o','r','t',0};
static const WCHAR cmd_ConfigureLPTPortCommandOKW[] = {'C','o','n','f','i','g','u','r','e',
'L','P','T','P','o','r','t',
'C','o','m','m','a','n','d','O','K',0};
static const WCHAR cmd_GetDefaultCommConfigW[] = {'G','e','t',
'D','e','f','a','u','l','t',
'C','o','m','m','C','o','n','f','i','g',0};
static const WCHAR cmd_GetTransmissionRetryTimeoutW[] = {'G','e','t',
'T','r','a','n','s','m','i','s','s','i','o','n',
'R','e','t','r','y','T','i','m','e','o','u','t',0};
static const WCHAR cmd_MonitorUIW[] = {'M','o','n','i','t','o','r','U','I',0};
static const WCHAR cmd_PortIsValidW[] = {'P','o','r','t','I','s','V','a','l','i','d',0};
static const WCHAR cmd_SetDefaultCommConfigW[] = {'S','e','t',
'D','e','f','a','u','l','t',
'C','o','m','m','C','o','n','f','i','g',0};
static const WCHAR dllnameuiW[] = {'l','o','c','a','l','u','i','.','d','l','l',0};
static const WCHAR emptyW[] = {0};
static const WCHAR LocalPortW[] = {'L','o','c','a','l',' ','P','o','r','t',0};
static const WCHAR portname_LPT[] = {'L','P','T',0};
static const WCHAR portname_COM[] = {'C','O','M',0};
static const WCHAR portname_FILE[] = {'F','I','L','E',':',0};
static const WCHAR portname_CUPS[] = {'C','U','P','S',':',0};
static const WCHAR portname_LPR[] = {'L','P','R',':',0};
static const WCHAR TransmissionRetryTimeoutW[] = {'T','r','a','n','s','m','i','s','s','i','o','n',
'R','e','t','r','y','T','i','m','e','o','u','t',0};
static const WCHAR WinNT_CV_PortsW[] = {'S','o','f','t','w','a','r','e','\\',
'M','i','c','r','o','s','o','f','t','\\',
'W','i','n','d','o','w','s',' ','N','T','\\',
'C','u','r','r','e','n','t','V','e','r','s','i','o','n','\\',
'P','o','r','t','s',0};
static const WCHAR WinNT_CV_WindowsW[] = {'S','o','f','t','w','a','r','e','\\',
'M','i','c','r','o','s','o','f','t','\\',
'W','i','n','d','o','w','s',' ','N','T','\\',
'C','u','r','r','e','n','t','V','e','r','s','i','o','n','\\',
'W','i','n','d','o','w','s',0};
/******************************************************************
* does_port_exist (internal)
*
* returns TRUE, when the Port already exists
*
*/
static BOOL does_port_exist(LPCWSTR myname)
{
LPPORT_INFO_1W pi;
DWORD needed = 0;
DWORD returned;
DWORD id;
TRACE("(%s)\n", debugstr_w(myname));
id = EnumPortsW(NULL, 1, NULL, 0, &needed, &returned);
pi = heap_alloc(needed);
returned = 0;
if (pi)
id = EnumPortsW(NULL, 1, (LPBYTE) pi, needed, &needed, &returned);
if (id && returned > 0) {
/* we got a number of valid names. */
for (id = 0; id < returned; id++)
{
if (lstrcmpiW(myname, pi[id].pName) == 0) {
TRACE("(%u) found %s\n", id, debugstr_w(pi[id].pName));
heap_free(pi);
return TRUE;
}
}
}
heap_free(pi);
return FALSE;
}
/******************************************************************
* enumerate the local Ports from the Registry (internal)
*
* See localmon_EnumPortsW.
*
* NOTES
* returns the needed size (in bytes) for pPorts
* and *lpreturned is set to number of entries returned in pPorts
*
*/
static DWORD get_ports_from_reg(DWORD level, LPBYTE pPorts, DWORD cbBuf, LPDWORD lpreturned)
{
HKEY hroot = 0;
LPWSTR ptr;
LPPORT_INFO_2W out;
WCHAR portname[MAX_PATH];
WCHAR res_PortW[IDS_LOCALPORT_MAXLEN];
WCHAR res_MonitorW[IDS_LOCALMONITOR_MAXLEN];
INT reslen_PortW;
INT reslen_MonitorW;
DWORD len;
DWORD res;
DWORD needed = 0;
DWORD numentries;
DWORD entrysize;
DWORD id = 0;
TRACE("(%d, %p, %d, %p)\n", level, pPorts, cbBuf, lpreturned);
entrysize = (level == 1) ? sizeof(PORT_INFO_1W) : sizeof(PORT_INFO_2W);
numentries = *lpreturned; /* this is 0, when we scan the registry */
needed = entrysize * numentries;
ptr = (LPWSTR) &pPorts[needed];
if (needed > cbBuf) pPorts = NULL; /* No buffer for the structs */
numentries = 0;
needed = 0;
/* we do not check more parameters as done in windows */
if ((level < 1) || (level > 2)) {
goto getports_cleanup;
}
/* "+1" for '\0' */
reslen_MonitorW = LoadStringW(LOCALSPL_hInstance, IDS_LOCALMONITOR, res_MonitorW, IDS_LOCALMONITOR_MAXLEN) + 1;
reslen_PortW = LoadStringW(LOCALSPL_hInstance, IDS_LOCALPORT, res_PortW, IDS_LOCALPORT_MAXLEN) + 1;
res = RegOpenKeyW(HKEY_LOCAL_MACHINE, WinNT_CV_PortsW, &hroot);
if (res == ERROR_SUCCESS) {
/* Scan all Port-Names */
while (res == ERROR_SUCCESS) {
len = MAX_PATH;
portname[0] = '\0';
res = RegEnumValueW(hroot, id, portname, &len, NULL, NULL, NULL, NULL);
if ((res == ERROR_SUCCESS) && (portname[0])) {
numentries++;
/* calculate the required size */
needed += entrysize;
needed += (len + 1) * sizeof(WCHAR);
if (level > 1) {
needed += (reslen_MonitorW + reslen_PortW) * sizeof(WCHAR);
}
/* Now fill the user-buffer, if available */
if (pPorts && (cbBuf >= needed)){
out = (LPPORT_INFO_2W) pPorts;
pPorts += entrysize;
TRACE("%p: writing PORT_INFO_%dW #%d (%s)\n", out, level, numentries, debugstr_w(portname));
out->pPortName = ptr;
lstrcpyW(ptr, portname); /* Name of the Port */
ptr += (len + 1);
if (level > 1) {
out->pMonitorName = ptr;
lstrcpyW(ptr, res_MonitorW); /* Name of the Monitor */
ptr += reslen_MonitorW;
out->pDescription = ptr;
lstrcpyW(ptr, res_PortW); /* Port Description */
ptr += reslen_PortW;
out->fPortType = PORT_TYPE_WRITE;
out->Reserved = 0;
}
}
id++;
}
}
RegCloseKey(hroot);
}
else
{
ERR("failed with %d for %s\n", res, debugstr_w(WinNT_CV_PortsW));
SetLastError(res);
}
getports_cleanup:
*lpreturned = numentries;
TRACE("need %d byte for %d entries (%d)\n", needed, numentries, GetLastError());
return needed;
}
/*****************************************************
* get_type_from_name (internal)
*
*/
static DWORD get_type_from_name(LPCWSTR name)
{
HANDLE hfile;
if (!strncmpW(name, portname_LPT, sizeof(portname_LPT) / sizeof(WCHAR) -1))
return PORT_IS_LPT;
if (!strncmpW(name, portname_COM, sizeof(portname_COM) / sizeof(WCHAR) -1))
return PORT_IS_COM;
if (!strcmpW(name, portname_FILE))
return PORT_IS_FILE;
if (name[0] == '/')
return PORT_IS_UNIXNAME;
if (name[0] == '|')
return PORT_IS_PIPE;
if (!strncmpW(name, portname_CUPS, sizeof(portname_CUPS) / sizeof(WCHAR) -1))
return PORT_IS_CUPS;
if (!strncmpW(name, portname_LPR, sizeof(portname_LPR) / sizeof(WCHAR) -1))
return PORT_IS_LPR;
/* Must be a file or a directory. Does the file exist ? */
hfile = CreateFileW(name, GENERIC_WRITE, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
TRACE("%p for OPEN_EXISTING on %s\n", hfile, debugstr_w(name));
if (hfile == INVALID_HANDLE_VALUE) {
/* Can we create the file? */
hfile = CreateFileW(name, GENERIC_WRITE, 0, NULL, OPEN_ALWAYS, FILE_FLAG_DELETE_ON_CLOSE, NULL);
TRACE("%p for OPEN_ALWAYS\n", hfile);
}
if (hfile != INVALID_HANDLE_VALUE) {
CloseHandle(hfile);
return PORT_IS_FILENAME;
}
/* We can't use the name. use GetLastError() for the reason */
return PORT_IS_UNKNOWN;
}
/*****************************************************
* get_type_from_local_name (internal)
*
*/
static DWORD get_type_from_local_name(LPCWSTR nameW)
{
LPPORT_INFO_1W pi;
LPWSTR myname = NULL;
DWORD needed = 0;
DWORD numentries = 0;
DWORD id = 0;
TRACE("(%s)\n", debugstr_w(myname));
needed = get_ports_from_reg(1, NULL, 0, &numentries);
pi = heap_alloc(needed);
if (pi)
needed = get_ports_from_reg(1, (LPBYTE) pi, needed, &numentries);
if (pi && needed && numentries > 0) {
/* we got a number of valid ports. */
while ((myname == NULL) && (id < numentries))
{
if (lstrcmpiW(nameW, pi[id].pName) == 0) {
TRACE("(%u) found %s\n", id, debugstr_w(pi[id].pName));
myname = pi[id].pName;
}
id++;
}
}
id = (myname) ? get_type_from_name(myname) : PORT_IS_UNKNOWN;
heap_free(pi);
return id;
}
/******************************************************************************
* localmon_AddPortExW [exported through MONITOREX]
*
* Add a Port, without presenting a user interface
*
* PARAMS
* pName [I] Servername or NULL (local Computer)
* level [I] Structure-Level (1) for pBuffer
* pBuffer [I] PTR to the Input-Data (PORT_INFO_1)
* pMonitorName [I] Name of the Monitor that manage the Port
*
* RETURNS
* Success: TRUE
* Failure: FALSE
*
* NOTES
* Level 2 is documented on MSDN for Portmonitors, but not supported by the
* "Local Port" Portmonitor (localspl.dll / localmon.dll)
*/
static BOOL WINAPI localmon_AddPortExW(LPWSTR pName, DWORD level, LPBYTE pBuffer, LPWSTR pMonitorName)
{
PORT_INFO_1W * pi;
HKEY hroot;
DWORD res;
pi = (PORT_INFO_1W *) pBuffer;
TRACE("(%s, %d, %p, %s) => %s\n", debugstr_w(pName), level, pBuffer,
debugstr_w(pMonitorName), debugstr_w(pi ? pi->pName : NULL));
if ((pMonitorName == NULL) || (lstrcmpiW(pMonitorName, LocalPortW) != 0 ) ||
(pi == NULL) || (pi->pName == NULL) || (pi->pName[0] == '\0') ) {
SetLastError(ERROR_INVALID_PARAMETER);
return FALSE;
}
if (level != 1) {
SetLastError(ERROR_INVALID_LEVEL);
return FALSE;
}
res = RegOpenKeyW(HKEY_LOCAL_MACHINE, WinNT_CV_PortsW, &hroot);
if (res == ERROR_SUCCESS) {
if (does_port_exist(pi->pName)) {
RegCloseKey(hroot);
TRACE("=> FALSE with %u\n", ERROR_INVALID_PARAMETER);
SetLastError(ERROR_INVALID_PARAMETER);
return FALSE;
}
res = RegSetValueExW(hroot, pi->pName, 0, REG_SZ, (const BYTE *) emptyW, sizeof(emptyW));
RegCloseKey(hroot);
}
if (res != ERROR_SUCCESS) SetLastError(ERROR_INVALID_PARAMETER);
TRACE("=> %u with %u\n", (res == ERROR_SUCCESS), GetLastError());
return (res == ERROR_SUCCESS);
}
/*****************************************************
* localmon_ClosePort [exported through MONITOREX]
*
* Close a
*
* PARAMS
* hPort [i] The Handle to close
*
* RETURNS
* Success: TRUE
* Failure: FALSE
*
*/
static BOOL WINAPI localmon_ClosePort(HANDLE hPort)
{
port_t * port = hPort;
TRACE("(%p)\n", port);
EnterCriticalSection(&port_handles_cs);
list_remove(&port->entry);
LeaveCriticalSection(&port_handles_cs);
heap_free(port);
return TRUE;
}
/*****************************************************
* localmon_EnumPortsW [exported through MONITOREX]
*
* Enumerate all local Ports
*
* PARAMS
* pName [I] Servername (ignored)
* level [I] Structure-Level (1 or 2)
* pPorts [O] PTR to Buffer that receives the Result
* cbBuf [I] Size of Buffer at pPorts
* pcbNeeded [O] PTR to DWORD that receives the size in Bytes used / required for pPorts
* pcReturned [O] PTR to DWORD that receives the number of Ports in pPorts
*
* RETURNS
* Success: TRUE
* Failure: FALSE and in pcbNeeded the Bytes required for pPorts, if cbBuf is too small
*
* NOTES
*| Windows ignores pName
*| Windows crash the app, when pPorts, pcbNeeded or pcReturned are NULL
*| Windows >NT4.0 does not check for illegal levels (TRUE is returned)
*
* ToDo
* "HCU\Software\Wine\Spooler\<portname>" - redirection
*
*/
static BOOL WINAPI localmon_EnumPortsW(LPWSTR pName, DWORD level, LPBYTE pPorts,
DWORD cbBuf, LPDWORD pcbNeeded, LPDWORD pcReturned)
{
BOOL res = FALSE;
DWORD needed;
DWORD numentries;
TRACE("(%s, %d, %p, %d, %p, %p)\n",
debugstr_w(pName), level, pPorts, cbBuf, pcbNeeded, pcReturned);
numentries = 0;
needed = get_ports_from_reg(level, NULL, 0, &numentries);
/* we calculated the needed buffersize. now do the error-checks */
if (cbBuf < needed) {
SetLastError(ERROR_INSUFFICIENT_BUFFER);
goto cleanup;
}
/* fill the buffer with the Port-Names */
needed = get_ports_from_reg(level, pPorts, cbBuf, &numentries);
res = TRUE;
if (pcReturned) *pcReturned = numentries;
cleanup:
if (pcbNeeded) *pcbNeeded = needed;
TRACE("returning %d with %d (%d byte for %d entries)\n",
res, GetLastError(), needed, numentries);
return (res);
}
/*****************************************************
* localmon_OpenPort [exported through MONITOREX]
*
* Open a Data-Channel for a Port
*
* PARAMS
* pName [i] Name of selected Object
* phPort [o] The resulting Handle is stored here
*
* RETURNS
* Success: TRUE
* Failure: FALSE
*
*/
static BOOL WINAPI localmon_OpenPortW(LPWSTR pName, PHANDLE phPort)
{
port_t * port;
DWORD len;
DWORD type;
TRACE("%s, %p)\n", debugstr_w(pName), phPort);
/* an empty name is invalid */
if (!pName[0]) return FALSE;
/* does the port exist? */
type = get_type_from_local_name(pName);
if (!type) return FALSE;
len = (lstrlenW(pName) + 1) * sizeof(WCHAR);
port = heap_alloc(sizeof(port_t) + len);
if (!port) return FALSE;
port->type = type;
memcpy(port->nameW, pName, len);
*phPort = port;
EnterCriticalSection(&port_handles_cs);
list_add_tail(&port_handles, &port->entry);
LeaveCriticalSection(&port_handles_cs);
TRACE("=> %p\n", port);
return TRUE;
}
/*****************************************************
* localmon_XcvClosePort [exported through MONITOREX]
*
* Close a Communication-Channel
*
* PARAMS
* hXcv [i] The Handle to close
*
* RETURNS
* Success: TRUE
* Failure: FALSE
*
*/
static BOOL WINAPI localmon_XcvClosePort(HANDLE hXcv)
{
xcv_t * xcv = hXcv;
TRACE("(%p)\n", xcv);
/* No checks are done in Windows */
EnterCriticalSection(&xcv_handles_cs);
list_remove(&xcv->entry);
LeaveCriticalSection(&xcv_handles_cs);
heap_free(xcv);
return TRUE;
}
/*****************************************************
* localmon_XcvDataPort [exported through MONITOREX]
*
* Execute command through a Communication-Channel
*
* PARAMS
* hXcv [i] The Handle to work with
* pszDataName [i] Name of the command to execute
* pInputData [i] Buffer for extra Input Data (needed only for some commands)
* cbInputData [i] Size in Bytes of Buffer at pInputData
* pOutputData [o] Buffer to receive additional Data (needed only for some commands)
* cbOutputData [i] Size in Bytes of Buffer at pOutputData
* pcbOutputNeeded [o] PTR to receive the minimal Size in Bytes of the Buffer at pOutputData
*
* RETURNS
* Success: ERROR_SUCCESS
* Failure: win32 error code
*
* NOTES
*
* Minimal List of commands, that every Printmonitor DLL should support:
*
*| "MonitorUI" : Return the Name of the Userinterface-DLL as WSTR in pOutputData
*| "AddPort" : Add a Port (Name as WSTR in pInputData)
*| "DeletePort": Delete a Port (Name as WSTR in pInputData)
*
*
*/
static DWORD WINAPI localmon_XcvDataPort(HANDLE hXcv, LPCWSTR pszDataName, PBYTE pInputData, DWORD cbInputData,
PBYTE pOutputData, DWORD cbOutputData, PDWORD pcbOutputNeeded)
{
WCHAR buffer[16]; /* buffer for a decimal number */
LPWSTR ptr;
DWORD res;
DWORD needed;
HKEY hroot;
TRACE("(%p, %s, %p, %d, %p, %d, %p)\n", hXcv, debugstr_w(pszDataName),
pInputData, cbInputData, pOutputData, cbOutputData, pcbOutputNeeded);
if (!lstrcmpW(pszDataName, cmd_AddPortW)) {
TRACE("InputData (%d): %s\n", cbInputData, debugstr_w( (LPWSTR) pInputData));
res = RegOpenKeyW(HKEY_LOCAL_MACHINE, WinNT_CV_PortsW, &hroot);
if (res == ERROR_SUCCESS) {
if (does_port_exist((LPWSTR) pInputData)) {
RegCloseKey(hroot);
TRACE("=> %u\n", ERROR_ALREADY_EXISTS);
return ERROR_ALREADY_EXISTS;
}
res = RegSetValueExW(hroot, (LPWSTR) pInputData, 0, REG_SZ, (const BYTE *) emptyW, sizeof(emptyW));
RegCloseKey(hroot);
}
TRACE("=> %u\n", res);
return res;
}
if (!lstrcmpW(pszDataName, cmd_ConfigureLPTPortCommandOKW)) {
TRACE("InputData (%d): %s\n", cbInputData, debugstr_w( (LPWSTR) pInputData));
res = RegCreateKeyW(HKEY_LOCAL_MACHINE, WinNT_CV_WindowsW, &hroot);
if (res == ERROR_SUCCESS) {
res = RegSetValueExW(hroot, TransmissionRetryTimeoutW, 0, REG_SZ, pInputData, cbInputData);
RegCloseKey(hroot);
}
return res;
}
if (!lstrcmpW(pszDataName, cmd_DeletePortW)) {
TRACE("InputData (%d): %s\n", cbInputData, debugstr_w( (LPWSTR) pInputData));
res = RegOpenKeyW(HKEY_LOCAL_MACHINE, WinNT_CV_PortsW, &hroot);
if (res == ERROR_SUCCESS) {
res = RegDeleteValueW(hroot, (LPWSTR) pInputData);
RegCloseKey(hroot);
TRACE("=> %u with %u\n", res, GetLastError() );
return res;
}
return ERROR_FILE_NOT_FOUND;
}
if (!lstrcmpW(pszDataName, cmd_GetDefaultCommConfigW)) {
TRACE("InputData (%d): %s\n", cbInputData, debugstr_w( (LPWSTR) pInputData));
*pcbOutputNeeded = cbOutputData;
res = GetDefaultCommConfigW((LPWSTR) pInputData, (LPCOMMCONFIG) pOutputData, pcbOutputNeeded);
TRACE("got %u with %u\n", res, GetLastError() );
return res ? ERROR_SUCCESS : GetLastError();
}
if (!lstrcmpW(pszDataName, cmd_GetTransmissionRetryTimeoutW)) {
* pcbOutputNeeded = sizeof(DWORD);
if (cbOutputData >= sizeof(DWORD)) {
/* the w2k resource kit documented a default of 90, but that's wrong */
*((LPDWORD) pOutputData) = 45;
res = RegOpenKeyW(HKEY_LOCAL_MACHINE, WinNT_CV_WindowsW, &hroot);
if (res == ERROR_SUCCESS) {
needed = sizeof(buffer) - sizeof(WCHAR);
res = RegQueryValueExW(hroot, TransmissionRetryTimeoutW, NULL, NULL, (LPBYTE) buffer, &needed);
if ((res == ERROR_SUCCESS) && (buffer[0])) {
*((LPDWORD) pOutputData) = strtoulW(buffer, NULL, 0);
}
RegCloseKey(hroot);
}
return ERROR_SUCCESS;
}
return ERROR_INSUFFICIENT_BUFFER;
}
if (!lstrcmpW(pszDataName, cmd_MonitorUIW)) {
* pcbOutputNeeded = sizeof(dllnameuiW);
if (cbOutputData >= sizeof(dllnameuiW)) {
memcpy(pOutputData, dllnameuiW, sizeof(dllnameuiW));
return ERROR_SUCCESS;
}
return ERROR_INSUFFICIENT_BUFFER;
}
if (!lstrcmpW(pszDataName, cmd_PortIsValidW)) {
TRACE("InputData (%d): %s\n", cbInputData, debugstr_w( (LPWSTR) pInputData));
res = get_type_from_name((LPCWSTR) pInputData);
TRACE("detected as %u\n", res);
/* names, that we have recognized, are valid */
if (res) return ERROR_SUCCESS;
/* ERROR_ACCESS_DENIED, ERROR_PATH_NOT_FOUND or something else */
TRACE("=> %u\n", GetLastError());
return GetLastError();
}
if (!lstrcmpW(pszDataName, cmd_SetDefaultCommConfigW)) {
/* get the portname from the Handle */
ptr = strchrW(((xcv_t *)hXcv)->nameW, ' ');
if (ptr) {
ptr++; /* skip the space */
}
else
{
ptr = ((xcv_t *)hXcv)->nameW;
}
lstrcpynW(buffer, ptr, sizeof(buffer)/sizeof(WCHAR));
if (buffer[0]) buffer[lstrlenW(buffer)-1] = '\0'; /* remove the ':' */
res = SetDefaultCommConfigW(buffer, (LPCOMMCONFIG) pInputData, cbInputData);
TRACE("got %u with %u\n", res, GetLastError() );
return res ? ERROR_SUCCESS : GetLastError();
}
FIXME("command not supported: %s\n", debugstr_w(pszDataName));
return ERROR_INVALID_PARAMETER;
}
/*****************************************************
* localmon_XcvOpenPort [exported through MONITOREX]
*
* Open a Communication-Channel
*
* PARAMS
* pName [i] Name of selected Object
* GrantedAccess [i] Access-Rights to use
* phXcv [o] The resulting Handle is stored here
*
* RETURNS
* Success: TRUE
* Failure: FALSE
*
*/
static BOOL WINAPI localmon_XcvOpenPort(LPCWSTR pName, ACCESS_MASK GrantedAccess, PHANDLE phXcv)
{
DWORD len;
xcv_t * xcv;
TRACE("%s, 0x%x, %p)\n", debugstr_w(pName), GrantedAccess, phXcv);
/* No checks for any field is done in Windows */
len = (lstrlenW(pName) + 1) * sizeof(WCHAR);
xcv = heap_alloc( sizeof(xcv_t) + len);
if (xcv) {
xcv->GrantedAccess = GrantedAccess;
memcpy(xcv->nameW, pName, len);
*phXcv = xcv;
EnterCriticalSection(&xcv_handles_cs);
list_add_tail(&xcv_handles, &xcv->entry);
LeaveCriticalSection(&xcv_handles_cs);
TRACE("=> %p\n", xcv);
return TRUE;
}
else
{
*phXcv = NULL;
return FALSE;
}
}
/*****************************************************
* InitializePrintMonitor (LOCALSPL.@)
*
* Initialize the Monitor for the Local Ports
*
* PARAMS
* regroot [I] Registry-Path, where the settings are stored
*
* RETURNS
* Success: Pointer to a MONITOREX Structure
* Failure: NULL
*
* NOTES
* The fixed location "HKLM\Software\Microsoft\Windows NT\CurrentVersion\Ports"
* is used to store the Ports (IniFileMapping from "win.ini", Section "Ports").
* Native localspl.dll fails, when no valid Port-Entry is present.
*
*/
LPMONITOREX WINAPI InitializePrintMonitor(LPWSTR regroot)
{
static MONITOREX mymonitorex =
{
sizeof(MONITOREX) - sizeof(DWORD),
{
localmon_EnumPortsW,
localmon_OpenPortW,
NULL, /* localmon_OpenPortExW */
NULL, /* localmon_StartDocPortW */
NULL, /* localmon_WritePortW */
NULL, /* localmon_ReadPortW */
NULL, /* localmon_EndDocPortW */
localmon_ClosePort,
NULL, /* Use AddPortUI in localui.dll */
localmon_AddPortExW,
NULL, /* Use ConfigurePortUI in localui.dll */
NULL, /* Use DeletePortUI in localui.dll */
NULL, /* localmon_GetPrinterDataFromPort */
NULL, /* localmon_SetPortTimeOuts */
localmon_XcvOpenPort,
localmon_XcvDataPort,
localmon_XcvClosePort
}
};
TRACE("(%s)\n", debugstr_w(regroot));
/* Parameter "regroot" is ignored on NT4.0 (localmon.dll) */
if (!regroot || !regroot[0]) {
SetLastError(ERROR_INVALID_PARAMETER);
return NULL;
}
TRACE("=> %p\n", &mymonitorex);
/* Native windows returns always the same pointer on success */
return &mymonitorex;
}

View file

@ -0,0 +1,17 @@
<module name="localspl" type="win32dll" baseaddress="${BASEADDRESS_LOCALSPL}" installbase="system32" installname="localspl.dll" allowwarnings="true">
<importlibrary definition="localspl.spec" />
<include base="localspl">.</include>
<include base="ReactOS">include/reactos/wine</include>
<define name="__WINESRC__" />
<define name="_WIN32_WINNT">0x600</define>
<file>localmon.c</file>
<file>localspl_main.c</file>
<file>provider.c</file>
<file>localspl.rc</file>
<library>wine</library>
<library>spoolss</library>
<library>user32</library>
<library>advapi32</library>
<library>kernel32</library>
<library>ntdll</library>
</module>

View file

@ -0,0 +1,52 @@
/*
* Top level resource file for localspl
*
* Copyright 2006 Detlef Riekenberg
*
* 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
*
*/
#include "windef.h"
#include "winbase.h"
#include "winver.h"
#include "localspl_private.h"
#define WINE_FILENAME_STR "localspl.dll"
#define WINE_FILEDESCRIPTION_STR "Wine Printer spooler component"
/* Same Version as WinXP_sp2 */
#define WINE_FILEVERSION 5,1,2600,2180
#define WINE_FILEVERSION_STR "5.1.2600.2180"
#define WINE_PRODUCTVERSION 5,1,2600,2180
#define WINE_PRODUCTVERSION_STR "5.1.2600.2180"
#include "wine/wine_common_ver.rc"
#include "spl_En.rc"
#include "spl_Da.rc"
#include "spl_De.rc"
#include "spl_Fr.rc"
#include "spl_Ko.rc"
#include "spl_Nl.rc"
#include "spl_No.rc"
#include "spl_Pl.rc"
#include "spl_Pt.rc"
#include "spl_Ro.rc"
#include "spl_Ru.rc"
#include "spl_Si.rc"
#include "spl_Sv.rc"
#include "spl_Zh.rc"

View file

@ -0,0 +1,64 @@
@ stub ClosePrintProcessor
@ stub ControlPrintProcessor
@ stub EnumPrintProcessorDatatypesW
@ stub GetPrintProcessorCapabilities
@ stdcall InitializePrintMonitor(wstr)
# "Providor" is no typo here
@ stdcall InitializePrintProvidor(ptr long wstr)
@ stub OpenPrintProcessor
@ stub PrintDocumentOnPrintProcessor
@ stub PrintProcLogEvent
@ stub SplAddForm
@ stub SplAddMonitor
@ stub SplAddPort
@ stub SplAddPortEx
@ stub SplAddPrinter
@ stub SplAddPrinterDriverEx
@ stub SplAddPrintProcessor
@ stub SplBroadcastChange
@ stub SplClosePrinter
@ stub SplCloseSpooler
@ stub SplConfigChange
@ stub SplCopyFileEvent
@ stub SplCopyNumberOfFiles
@ stub SplCreateSpooler
@ stub SplDeleteForm
@ stub SplDeleteMonitor
@ stub SplDeletePort
@ stub SplDeletePrinter
@ stub SplDeletePrinterDriverEx
@ stub SplDeletePrinterKey
@ stub SplDeletePrintProcessor
@ stub SplDeleteSpooler
@ stub SplDriverEvent
@ stub SplEnumForms
@ stub SplEnumMonitors
@ stub SplEnumPorts
@ stub SplEnumPrinterDataEx
@ stub SplEnumPrinterKey
@ stub SplEnumPrinters
@ stub SplEnumPrintProcessorDatatypes
@ stub SplEnumPrintProcessors
@ stub SplGetDriverDir
@ stub SplGetForm
@ stub SplGetPrinter
@ stub SplGetPrinterData
@ stub SplGetPrinterDataEx
@ stub SplGetPrinterDriver
@ stub SplGetPrinterDriverDirectory
@ stub SplGetPrinterDriverEx
@ stub SplGetPrinterExtra
@ stub SplGetPrinterExtraEx
@ stub SplGetPrintProcessorDirectory
@ stub SplLoadLibraryTheCopyFileModule
@ stub SplMonitorIsInstalled
@ stub SplOpenPrinter
@ stub SplReenumeratePorts
@ stub SplResetPrinter
@ stub SplSetForm
@ stub SplSetPrinter
@ stub SplSetPrinterData
@ stub SplSetPrinterDataEx
@ stub SplSetPrinterExtra
@ stub SplSetPrinterExtraEx
@ stub SplXcvData

View file

@ -0,0 +1,56 @@
/*
* Implementation of the Local Printprovider/ Printmonitor/ Prontprocessor
*
* Copyright 2006-2009 Detlef Riekenberg
*
* 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
*/
#include <stdarg.h>
#define COBJMACROS
#define NONAMELESSUNION
#include "windef.h"
#include "winbase.h"
#include "wine/debug.h"
#include "localspl_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(localspl);
HINSTANCE LOCALSPL_hInstance = NULL;
/*****************************************************
* DllMain
*/
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
{
TRACE("(%p, %d, %p)\n",hinstDLL, fdwReason, lpvReserved);
switch(fdwReason)
{
case DLL_WINE_PREATTACH:
return FALSE; /* prefer native version */
case DLL_PROCESS_ATTACH:
DisableThreadLibraryCalls( hinstDLL );
LOCALSPL_hInstance = hinstDLL;
setup_provider();
break;
}
return TRUE;
}

View file

@ -0,0 +1,71 @@
/*
* Implementation of the Local Printmonitor: internal include file
*
* Copyright 2006 Detlef Riekenberg
*
* 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
*/
#ifndef __WINE_LOCALSPL_PRIVATE__
#define __WINE_LOCALSPL_PRIVATE__
/* ## DLL-wide Globals ## */
extern HINSTANCE LOCALSPL_hInstance;
void setup_provider(void);
/* ## Resource-ID ## */
#define IDS_LOCALPORT 500
#define IDS_LOCALMONITOR 507
/* ## Reserved memorysize for the strings (in WCHAR) ## */
#define IDS_LOCALMONITOR_MAXLEN 64
#define IDS_LOCALPORT_MAXLEN 32
/* ## Type of Ports ## */
/* windows types */
#define PORT_IS_UNKNOWN 0
#define PORT_IS_LPT 1
#define PORT_IS_COM 2
#define PORT_IS_FILE 3
#define PORT_IS_FILENAME 4
/* wine extensions */
#define PORT_IS_WINE 5
#define PORT_IS_UNIXNAME 5
#define PORT_IS_PIPE 6
#define PORT_IS_CUPS 7
#define PORT_IS_LPR 8
/* ## Memory allocation functions ## */
static inline void * __WINE_ALLOC_SIZE(1) heap_alloc( size_t len )
{
return HeapAlloc( GetProcessHeap(), 0, len );
}
static inline void * __WINE_ALLOC_SIZE(1) heap_alloc_zero( size_t len )
{
return HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, len );
}
static inline BOOL heap_free( void *mem )
{
return HeapFree( GetProcessHeap(), 0, mem );
}
#endif /* __WINE_LOCALSPL_PRIVATE__ */

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,27 @@
/*
* Danish resources for localspl
*
* Copyright 2008 Jens Albretsen <jens@albretsen.dk>
*
* 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
*/
LANGUAGE LANG_DANISH, SUBLANG_DEFAULT
STRINGTABLE DISCARDABLE
{
IDS_LOCALPORT "Lokal port"
IDS_LOCALMONITOR "Lokal overvåger"
}

View file

@ -0,0 +1,28 @@
/*
* German resources for localspl
*
* Copyright 2005 Henning Gerhardt
* Copyright 2006 Detlef Riekenberg
*
* 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
*/
LANGUAGE LANG_GERMAN, SUBLANG_NEUTRAL
STRINGTABLE DISCARDABLE
{
IDS_LOCALPORT "Lokaler Anschluss"
IDS_LOCALMONITOR "Lokaler Monitor"
}

View file

@ -0,0 +1,28 @@
/*
* English resources for localspl
*
* Copyright 2005 Huw Davies
* Copyright 2006 Detlef Riekenberg
*
* 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
*/
LANGUAGE LANG_ENGLISH, SUBLANG_DEFAULT
STRINGTABLE DISCARDABLE
{
IDS_LOCALPORT "Local Port"
IDS_LOCALMONITOR "Local Monitor"
}

View file

@ -0,0 +1,27 @@
/*
* French resources for localspl
*
* Copyright 2007 Jonathan Ernst
*
* 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
*/
LANGUAGE LANG_FRENCH, SUBLANG_NEUTRAL
STRINGTABLE DISCARDABLE
{
IDS_LOCALPORT "Port local"
IDS_LOCALMONITOR "Moniteur local"
}

View file

@ -0,0 +1,29 @@
/*
* Korean resources for localspl
*
* Copyright 2005 Huw Davies
* Copyright 2006 Detlef Riekenberg
* Copyright 2006 YunSong Hwang
*
* 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
*/
LANGUAGE LANG_KOREAN, SUBLANG_DEFAULT
STRINGTABLE DISCARDABLE
{
IDS_LOCALPORT "Áö¿ª Æ÷Æ®"
IDS_LOCALMONITOR "Áö¿ª ¸ð´ÏÅÍ"
}

View file

@ -0,0 +1,27 @@
/*
* Dutch resources for localspl
*
* Copyright 2008 Frans Kool
*
* 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
*/
LANGUAGE LANG_DUTCH, SUBLANG_NEUTRAL
STRINGTABLE DISCARDABLE
{
IDS_LOCALPORT "Lokale Poort"
IDS_LOCALMONITOR "Lokale Monitor"
}

View file

@ -0,0 +1,27 @@
/*
* Norwegian Bokmål resources for localspl
*
* Copyright 2006 Alexander N. Sørnes <alex@thehandofagony.com>
*
* 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
*/
LANGUAGE LANG_NORWEGIAN, SUBLANG_NORWEGIAN_BOKMAL
STRINGTABLE DISCARDABLE
{
IDS_LOCALPORT "Lokal port"
IDS_LOCALMONITOR "Lokal overvåker"
}

View file

@ -0,0 +1,29 @@
/*
* Polish resources for localspl
*
* Copyright 2005 Huw Davies
* Copyright 2006 Detlef Riekenberg
* Copyright 2007 Mikolaj Zalewski
*
* 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
*/
LANGUAGE LANG_POLISH, SUBLANG_DEFAULT
STRINGTABLE DISCARDABLE
{
IDS_LOCALPORT "Port lokalny"
IDS_LOCALMONITOR "Monitor lokalny"
}

View file

@ -0,0 +1,27 @@
/*
* Portuguese resources for localspl
*
* Copyright 2008 Ricardo Filipe
*
* 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
*/
LANGUAGE LANG_PORTUGUESE, SUBLANG_NEUTRAL
STRINGTABLE DISCARDABLE
{
IDS_LOCALPORT "Porta local"
IDS_LOCALMONITOR "Monitor Local"
}

View file

@ -0,0 +1,27 @@
/*
* Copyright 2005 Huw Davies
* Copyright 2006 Detlef Riekenberg
* Copyright 2008 Michael Stefaniuc
*
* 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
*/
LANGUAGE LANG_ROMANIAN, SUBLANG_NEUTRAL
STRINGTABLE DISCARDABLE
{
IDS_LOCALPORT "Port local"
IDS_LOCALMONITOR "Monitor local"
}

View file

@ -0,0 +1,27 @@
/*
* Russian resources for localspl
*
* Copyright 2008 Vitaliy Margolen
*
* 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
*/
LANGUAGE LANG_RUSSIAN, SUBLANG_DEFAULT
STRINGTABLE DISCARDABLE
{
IDS_LOCALPORT "Ëîêàëüíûé ïîðò"
IDS_LOCALMONITOR "Ëîêàëüíûé ìîíèòîð"
}

View file

@ -0,0 +1,31 @@
/*
* Slovenian resources for localspl
*
* Copyright 2008 Rok Mandeljc
*
* 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
*/
#pragma code_page(65001)
LANGUAGE LANG_SLOVENIAN, SUBLANG_DEFAULT
STRINGTABLE DISCARDABLE
{
IDS_LOCALPORT "Lokalna vrata"
IDS_LOCALMONITOR "Lokalen monitor"
}
#pragma code_page(default)

View file

@ -0,0 +1,27 @@
/*
* English resources for localspl
*
* Copyright 2007 Daniel Nylander
*
* 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
*/
LANGUAGE LANG_SWEDISH, SUBLANG_NEUTRAL
STRINGTABLE DISCARDABLE
{
IDS_LOCALPORT "Lokal port"
IDS_LOCALMONITOR "Lokal skärm"
}

View file

@ -0,0 +1,40 @@
/*
* localspl (Simplified and Traditional Chinese Resources)
*
* Copyright 2008 Hongbo Ni <hongbo.at.njstar.com>
*
* 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
*/
/* Chinese text is encoded in UTF-8 */
#pragma code_page(65001)
LANGUAGE LANG_CHINESE, SUBLANG_CHINESE_SIMPLIFIED
STRINGTABLE DISCARDABLE
{
IDS_LOCALPORT "本地端口"
IDS_LOCALMONITOR "本地监视器"
}
LANGUAGE LANG_CHINESE, SUBLANG_CHINESE_TRADITIONAL
STRINGTABLE DISCARDABLE
{
IDS_LOCALPORT "本地端口"
IDS_LOCALMONITOR "本地監視器"
}
#pragma code_page(default)

View file

@ -139,6 +139,9 @@
<directory name="inetmib1">
<xi:include href="inetmib1/inetmib1.rbuild" />
</directory>
<directory name="inseng">
<xi:include href="inseng/inseng.rbuild" />
</directory>
<directory name="iphlpapi">
<xi:include href="iphlpapi/iphlpapi.rbuild" />
</directory>
@ -154,6 +157,9 @@
<directory name="loadperf">
<xi:include href="loadperf/loadperf.rbuild" />
</directory>
<directory name="localspl">
<xi:include href="localspl/localspl.rbuild" />
</directory>
<directory name="localui">
<xi:include href="localui/localui.rbuild" />
</directory>
@ -523,4 +529,7 @@
<directory name="wtsapi32">
<xi:include href="wtsapi32/wtsapi32.rbuild" />
</directory>
<directory name="wuapi">
<xi:include href="wuapi/wuapi.rbuild" />
</directory>
</group>

View file

@ -0,0 +1,267 @@
/*
* IUpdateDownloader implementation
*
* Copyright 2008 Hans Leidekker
*
* 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
*/
#define COBJMACROS
#include "config.h"
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "winuser.h"
#include "ole2.h"
#include "initguid.h"
#include "wuapi.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(wuapi);
typedef struct _update_downloader
{
const struct IUpdateDownloaderVtbl *vtbl;
LONG refs;
} update_downloader;
static inline update_downloader *impl_from_IUpdateDownloader( IUpdateDownloader *iface )
{
return (update_downloader *)((char *)iface - FIELD_OFFSET( update_downloader, vtbl ));
}
static ULONG WINAPI update_downloader_AddRef(
IUpdateDownloader *iface )
{
update_downloader *update_downloader = impl_from_IUpdateDownloader( iface );
return InterlockedIncrement( &update_downloader->refs );
}
static ULONG WINAPI update_downloader_Release(
IUpdateDownloader *iface )
{
update_downloader *update_downloader = impl_from_IUpdateDownloader( iface );
LONG refs = InterlockedDecrement( &update_downloader->refs );
if (!refs)
{
TRACE("destroying %p\n", update_downloader);
HeapFree( GetProcessHeap(), 0, update_downloader );
}
return refs;
}
static HRESULT WINAPI update_downloader_QueryInterface(
IUpdateDownloader *iface,
REFIID riid,
void **ppvObject )
{
update_downloader *This = impl_from_IUpdateDownloader( iface );
TRACE("%p %s %p\n", This, debugstr_guid( riid ), ppvObject );
if ( IsEqualGUID( riid, &IID_IUpdateDownloader ) ||
IsEqualGUID( riid, &IID_IDispatch ) ||
IsEqualGUID( riid, &IID_IUnknown ) )
{
*ppvObject = iface;
}
else
{
FIXME("interface %s not implemented\n", debugstr_guid(riid));
return E_NOINTERFACE;
}
IUpdateDownloader_AddRef( iface );
return S_OK;
}
static HRESULT WINAPI update_downloader_GetTypeInfoCount(
IUpdateDownloader *iface,
UINT *pctinfo )
{
FIXME("\n");
return E_NOTIMPL;
}
static HRESULT WINAPI update_downloader_GetTypeInfo(
IUpdateDownloader *iface,
UINT iTInfo,
LCID lcid,
ITypeInfo **ppTInfo )
{
FIXME("\n");
return E_NOTIMPL;
}
static HRESULT WINAPI update_downloader_GetIDsOfNames(
IUpdateDownloader *iface,
REFIID riid,
LPOLESTR *rgszNames,
UINT cNames,
LCID lcid,
DISPID *rgDispId )
{
FIXME("\n");
return E_NOTIMPL;
}
static HRESULT WINAPI update_downloader_Invoke(
IUpdateDownloader *iface,
DISPID dispIdMember,
REFIID riid,
LCID lcid,
WORD wFlags,
DISPPARAMS *pDispParams,
VARIANT *pVarResult,
EXCEPINFO *pExcepInfo,
UINT *puArgErr )
{
FIXME("\n");
return E_NOTIMPL;
}
static HRESULT WINAPI update_downloader_get_IsForced(
IUpdateDownloader *This,
VARIANT_BOOL *retval )
{
FIXME("\n");
return E_NOTIMPL;
}
static HRESULT WINAPI update_downloader_put_IsForced(
IUpdateDownloader *This,
VARIANT_BOOL value )
{
FIXME("%p, %d\n", This, value);
return S_OK;
}
static HRESULT WINAPI update_downloader_get_ClientApplicationID(
IUpdateDownloader *This,
BSTR *retval )
{
FIXME("\n");
return E_NOTIMPL;
}
static HRESULT WINAPI update_downloader_put_ClientApplicationID(
IUpdateDownloader *This,
BSTR value )
{
FIXME("%p, %s\n", This, debugstr_w(value));
return E_NOTIMPL;
}
static HRESULT WINAPI update_downloader_get_Priority(
IUpdateDownloader *This,
DownloadPriority *retval )
{
FIXME("\n");
return E_NOTIMPL;
}
static HRESULT WINAPI update_downloader_put_Priority(
IUpdateDownloader *This,
DownloadPriority value )
{
FIXME("\n");
return E_NOTIMPL;
}
static HRESULT WINAPI update_downloader_get_Updates(
IUpdateDownloader *This,
IUpdateCollection **retval )
{
FIXME("\n");
return E_NOTIMPL;
}
static HRESULT WINAPI update_downloader_put_Updates(
IUpdateDownloader *This,
IUpdateCollection *value )
{
FIXME("\n");
return E_NOTIMPL;
}
static HRESULT WINAPI update_downloader_BeginDownload(
IUpdateDownloader *This,
IUnknown *onProgressChanged,
IUnknown *onCompleted,
VARIANT state,
IDownloadJob **retval )
{
FIXME("\n");
return E_NOTIMPL;
}
static HRESULT WINAPI update_downloader_Download(
IUpdateDownloader *This,
IDownloadResult **retval )
{
FIXME("\n");
return E_NOTIMPL;
}
static HRESULT WINAPI update_downloader_EndDownload(
IUpdateDownloader *This,
IDownloadJob *value,
IDownloadResult **retval )
{
FIXME("\n");
return E_NOTIMPL;
}
static const struct IUpdateDownloaderVtbl update_downloader_vtbl =
{
update_downloader_QueryInterface,
update_downloader_AddRef,
update_downloader_Release,
update_downloader_GetTypeInfoCount,
update_downloader_GetTypeInfo,
update_downloader_GetIDsOfNames,
update_downloader_Invoke,
update_downloader_get_ClientApplicationID,
update_downloader_put_ClientApplicationID,
update_downloader_get_IsForced,
update_downloader_put_IsForced,
update_downloader_get_Priority,
update_downloader_put_Priority,
update_downloader_get_Updates,
update_downloader_put_Updates,
update_downloader_BeginDownload,
update_downloader_Download,
update_downloader_EndDownload
};
HRESULT UpdateDownloader_create( IUnknown *pUnkOuter, LPVOID *ppObj )
{
update_downloader *downloader;
TRACE("(%p,%p)\n", pUnkOuter, ppObj);
downloader = HeapAlloc( GetProcessHeap(), 0, sizeof(*downloader) );
if (!downloader) return E_OUTOFMEMORY;
downloader->vtbl = &update_downloader_vtbl;
downloader->refs = 1;
*ppObj = &downloader->vtbl;
TRACE("returning iface %p\n", *ppObj);
return S_OK;
}

View file

@ -0,0 +1,253 @@
/*
* IUpdateInstaller implementation
*
* Copyright 2008 Hans Leidekker
*
* 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
*/
#define COBJMACROS
#include "config.h"
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "winuser.h"
#include "ole2.h"
#include "wuapi.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(wuapi);
typedef struct _update_installer
{
const struct IUpdateInstallerVtbl *vtbl;
LONG refs;
} update_installer;
static inline update_installer *impl_from_IUpdateInstaller( IUpdateInstaller *iface )
{
return (update_installer *)((char *)iface - FIELD_OFFSET( update_installer, vtbl ));
}
static ULONG WINAPI update_installer_AddRef(
IUpdateInstaller *iface )
{
update_installer *update_installer = impl_from_IUpdateInstaller( iface );
return InterlockedIncrement( &update_installer->refs );
}
static ULONG WINAPI update_installer_Release(
IUpdateInstaller *iface )
{
update_installer *update_installer = impl_from_IUpdateInstaller( iface );
LONG refs = InterlockedDecrement( &update_installer->refs );
if (!refs)
{
TRACE("destroying %p\n", update_installer);
HeapFree( GetProcessHeap(), 0, update_installer );
}
return refs;
}
static HRESULT WINAPI update_installer_QueryInterface(
IUpdateInstaller *iface,
REFIID riid,
void **ppvObject )
{
update_installer *This = impl_from_IUpdateInstaller( iface );
TRACE("%p %s %p\n", This, debugstr_guid( riid ), ppvObject );
if ( IsEqualGUID( riid, &IID_IUpdateInstaller ) ||
IsEqualGUID( riid, &IID_IDispatch ) ||
IsEqualGUID( riid, &IID_IUnknown ) )
{
*ppvObject = iface;
}
else
{
FIXME("interface %s not implemented\n", debugstr_guid(riid));
return E_NOINTERFACE;
}
IUpdateInstaller_AddRef( iface );
return S_OK;
}
static HRESULT WINAPI update_installer_GetTypeInfoCount(
IUpdateInstaller *iface,
UINT *pctinfo )
{
FIXME("\n");
return E_NOTIMPL;
}
static HRESULT WINAPI update_installer_GetTypeInfo(
IUpdateInstaller *iface,
UINT iTInfo,
LCID lcid,
ITypeInfo **ppTInfo )
{
FIXME("\n");
return E_NOTIMPL;
}
static HRESULT WINAPI update_installer_GetIDsOfNames(
IUpdateInstaller *iface,
REFIID riid,
LPOLESTR *rgszNames,
UINT cNames,
LCID lcid,
DISPID *rgDispId )
{
FIXME("\n");
return E_NOTIMPL;
}
static HRESULT WINAPI update_installer_Invoke(
IUpdateInstaller *iface,
DISPID dispIdMember,
REFIID riid,
LCID lcid,
WORD wFlags,
DISPPARAMS *pDispParams,
VARIANT *pVarResult,
EXCEPINFO *pExcepInfo,
UINT *puArgErr )
{
FIXME("\n");
return E_NOTIMPL;
}
static HRESULT WINAPI update_installer_get_ClientApplicationID(
IUpdateInstaller *This,
BSTR *retval )
{
FIXME("\n");
return E_NOTIMPL;
}
static HRESULT WINAPI update_installer_put_ClientApplicationID(
IUpdateInstaller *This,
BSTR value )
{
FIXME("%p, %s\n", This, debugstr_w(value));
return E_NOTIMPL;
}
static HRESULT WINAPI update_installer_get_IsForced(
IUpdateInstaller *This,
VARIANT_BOOL *retval )
{
FIXME("\n");
return E_NOTIMPL;
}
static HRESULT WINAPI update_installer_put_IsForced(
IUpdateInstaller *This,
VARIANT_BOOL value )
{
FIXME("\n");
return E_NOTIMPL;
}
static HRESULT WINAPI update_installer_get_ParentHwnd(
IUpdateInstaller *This,
HWND *retval )
{
FIXME("\n");
return E_NOTIMPL;
}
static HRESULT WINAPI update_installer_put_ParentHwnd(
IUpdateInstaller *This,
HWND value )
{
FIXME("\n");
return E_NOTIMPL;
}
static HRESULT WINAPI update_installer_put_ParentWindow(
IUpdateInstaller *This,
IUnknown *value )
{
FIXME("\n");
return E_NOTIMPL;
}
static HRESULT WINAPI update_installer_get_ParentWindow(
IUpdateInstaller *This,
IUnknown **retval )
{
FIXME("\n");
return E_NOTIMPL;
}
static HRESULT WINAPI update_installer_get_Updates(
IUpdateInstaller *This,
IUpdateCollection **retval )
{
FIXME("\n");
return E_NOTIMPL;
}
static HRESULT WINAPI update_installer_put_Updates(
IUpdateInstaller *This,
IUpdateCollection *value )
{
FIXME("\n");
return E_NOTIMPL;
}
static const struct IUpdateInstallerVtbl update_installer_vtbl =
{
update_installer_QueryInterface,
update_installer_AddRef,
update_installer_Release,
update_installer_GetTypeInfoCount,
update_installer_GetTypeInfo,
update_installer_GetIDsOfNames,
update_installer_Invoke,
update_installer_get_ClientApplicationID,
update_installer_put_ClientApplicationID,
update_installer_get_IsForced,
update_installer_put_IsForced,
update_installer_get_ParentHwnd,
update_installer_put_ParentHwnd,
update_installer_put_ParentWindow,
update_installer_get_ParentWindow,
update_installer_get_Updates,
update_installer_put_Updates,
};
HRESULT UpdateInstaller_create( IUnknown *pUnkOuter, LPVOID *ppObj )
{
update_installer *installer;
TRACE("(%p,%p)\n", pUnkOuter, ppObj);
installer = HeapAlloc( GetProcessHeap(), 0, sizeof(*installer) );
if (!installer) return E_OUTOFMEMORY;
installer->vtbl = &update_installer_vtbl;
installer->refs = 1;
*ppObj = &installer->vtbl;
TRACE("returning iface %p\n", *ppObj);
return S_OK;
}

View file

@ -0,0 +1,154 @@
/*
* WUAPI implementation
*
* Copyright 2008 Hans Leidekker
*
* 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
*/
#define COBJMACROS
#include "config.h"
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "winuser.h"
#include "ole2.h"
#include "wuapi.h"
#include "wine/debug.h"
#include "wuapi_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(wuapi);
typedef HRESULT (*fnCreateInstance)( IUnknown *pUnkOuter, LPVOID *ppObj );
typedef struct _wucf
{
const struct IClassFactoryVtbl *vtbl;
fnCreateInstance pfnCreateInstance;
} wucf;
static inline wucf *impl_from_IClassFactory( IClassFactory *iface )
{
return (wucf *)((char *)iface - FIELD_OFFSET( wucf, vtbl ));
}
static HRESULT WINAPI wucf_QueryInterface( IClassFactory *iface, REFIID riid, LPVOID *ppobj )
{
if (IsEqualGUID(riid, &IID_IUnknown) ||
IsEqualGUID(riid, &IID_IClassFactory))
{
IClassFactory_AddRef( iface );
*ppobj = iface;
return S_OK;
}
FIXME("interface %s not implemented\n", debugstr_guid(riid));
return E_NOINTERFACE;
}
static ULONG WINAPI wucf_AddRef( IClassFactory *iface )
{
return 2;
}
static ULONG WINAPI wucf_Release( IClassFactory *iface )
{
return 1;
}
static HRESULT WINAPI wucf_CreateInstance( IClassFactory *iface, LPUNKNOWN pOuter,
REFIID riid, LPVOID *ppobj )
{
wucf *This = impl_from_IClassFactory( iface );
HRESULT r;
IUnknown *punk;
TRACE("%p %s %p\n", pOuter, debugstr_guid(riid), ppobj);
*ppobj = NULL;
if (pOuter)
return CLASS_E_NOAGGREGATION;
r = This->pfnCreateInstance( pOuter, (LPVOID *)&punk );
if (FAILED(r))
return r;
r = IUnknown_QueryInterface( punk, riid, ppobj );
if (FAILED(r))
return r;
IUnknown_Release( punk );
return r;
}
static HRESULT WINAPI wucf_LockServer( IClassFactory *iface, BOOL dolock )
{
FIXME("(%p)->(%d)\n", iface, dolock);
return S_OK;
}
static const struct IClassFactoryVtbl wucf_vtbl =
{
wucf_QueryInterface,
wucf_AddRef,
wucf_Release,
wucf_CreateInstance,
wucf_LockServer
};
static wucf sessioncf = { &wucf_vtbl, UpdateSession_create };
static wucf updatescf = { &wucf_vtbl, AutomaticUpdates_create };
BOOL WINAPI DllMain( HINSTANCE hinst, DWORD reason, LPVOID lpv )
{
switch(reason)
{
case DLL_WINE_PREATTACH:
return FALSE; /* prefer native version */
case DLL_PROCESS_ATTACH:
DisableThreadLibraryCalls( hinst );
break;
case DLL_PROCESS_DETACH:
break;
}
return TRUE;
}
HRESULT WINAPI DllGetClassObject( REFCLSID rclsid, REFIID iid, LPVOID *ppv )
{
IClassFactory *cf = NULL;
TRACE("%s %s %p\n", debugstr_guid(rclsid), debugstr_guid(iid), ppv);
if (IsEqualGUID( rclsid, &CLSID_UpdateSession ))
{
cf = (IClassFactory *)&sessioncf.vtbl;
}
else if (IsEqualGUID( rclsid, &CLSID_AutomaticUpdates ))
{
cf = (IClassFactory *)&updatescf.vtbl;
}
if (!cf) return CLASS_E_CLASSNOTAVAILABLE;
return IClassFactory_QueryInterface( cf, iid, ppv );
}
HRESULT WINAPI DllCanUnloadNow( void )
{
FIXME("\n");
return S_FALSE;
}

View file

@ -0,0 +1,430 @@
/*
* self-registerable dll functions for wuapi.dll
*
* Copyright (C) 2003 John K. Hohm
*
* 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
*/
#include <stdarg.h>
#include <string.h>
#include "windef.h"
#include "winbase.h"
#include "winuser.h"
#include "winreg.h"
#include "winerror.h"
#include "objbase.h"
#include "wuapi.h"
#include "wine/debug.h"
#include "wine/unicode.h"
WINE_DEFAULT_DEBUG_CHANNEL(wuapi);
/*
* Near the bottom of this file are the exported DllRegisterServer and
* DllUnregisterServer, which make all this worthwhile.
*/
/***********************************************************************
* interface for self-registering
*/
struct regsvr_interface
{
IID const *iid; /* NULL for end of list */
LPCSTR name; /* can be NULL to omit */
IID const *base_iid; /* can be NULL to omit */
int num_methods; /* can be <0 to omit */
CLSID const *ps_clsid; /* can be NULL to omit */
CLSID const *ps_clsid32; /* can be NULL to omit */
};
static HRESULT register_interfaces(struct regsvr_interface const *list);
static HRESULT unregister_interfaces(struct regsvr_interface const *list);
struct regsvr_coclass
{
CLSID const *clsid; /* NULL for end of list */
LPCSTR name; /* can be NULL to omit */
LPCSTR ips; /* can be NULL to omit */
LPCSTR ips32; /* can be NULL to omit */
LPCSTR ips32_tmodel; /* can be NULL to omit */
LPCSTR clsid_str; /* can be NULL to omit */
LPCSTR progid; /* can be NULL to omit */
};
static HRESULT register_coclasses(struct regsvr_coclass const *list);
static HRESULT unregister_coclasses(struct regsvr_coclass const *list);
/***********************************************************************
* static string constants
*/
static WCHAR const interface_keyname[10] = {
'I', 'n', 't', 'e', 'r', 'f', 'a', 'c', 'e', 0 };
static WCHAR const base_ifa_keyname[14] = {
'B', 'a', 's', 'e', 'I', 'n', 't', 'e', 'r', 'f', 'a', 'c',
'e', 0 };
static WCHAR const num_methods_keyname[11] = {
'N', 'u', 'm', 'M', 'e', 't', 'h', 'o', 'd', 's', 0 };
static WCHAR const ps_clsid_keyname[15] = {
'P', 'r', 'o', 'x', 'y', 'S', 't', 'u', 'b', 'C', 'l', 's',
'i', 'd', 0 };
static WCHAR const ps_clsid32_keyname[17] = {
'P', 'r', 'o', 'x', 'y', 'S', 't', 'u', 'b', 'C', 'l', 's',
'i', 'd', '3', '2', 0 };
static WCHAR const clsid_keyname[6] = {
'C', 'L', 'S', 'I', 'D', 0 };
static WCHAR const ips_keyname[13] = {
'I', 'n', 'P', 'r', 'o', 'c', 'S', 'e', 'r', 'v', 'e', 'r',
0 };
static WCHAR const ips32_keyname[15] = {
'I', 'n', 'P', 'r', 'o', 'c', 'S', 'e', 'r', 'v', 'e', 'r',
'3', '2', 0 };
static WCHAR const progid_keyname[7] = {
'P', 'r', 'o', 'g', 'I', 'D', 0 };
static char const tmodel_valuename[] = "ThreadingModel";
/***********************************************************************
* static helper functions
*/
static LONG register_key_guid(HKEY base, WCHAR const *name, GUID const *guid);
static LONG register_key_defvalueW(HKEY base, WCHAR const *name,
WCHAR const *value);
static LONG register_key_defvalueA(HKEY base, WCHAR const *name,
char const *value);
/***********************************************************************
* register_interfaces
*/
static HRESULT register_interfaces(struct regsvr_interface const *list)
{
LONG res = ERROR_SUCCESS;
HKEY interface_key;
res = RegCreateKeyExW(HKEY_CLASSES_ROOT, interface_keyname, 0, NULL, 0,
KEY_READ | KEY_WRITE, NULL, &interface_key, NULL);
if (res != ERROR_SUCCESS) goto error_return;
for (; res == ERROR_SUCCESS && list->iid; ++list) {
WCHAR buf[39];
HKEY iid_key;
StringFromGUID2(list->iid, buf, 39);
res = RegCreateKeyExW(interface_key, buf, 0, NULL, 0,
KEY_READ | KEY_WRITE, NULL, &iid_key, NULL);
if (res != ERROR_SUCCESS) goto error_close_interface_key;
if (list->name) {
res = RegSetValueExA(iid_key, NULL, 0, REG_SZ,
(CONST BYTE*)(list->name),
strlen(list->name) + 1);
if (res != ERROR_SUCCESS) goto error_close_iid_key;
}
if (list->base_iid) {
res = register_key_guid(iid_key, base_ifa_keyname, list->base_iid);
if (res != ERROR_SUCCESS) goto error_close_iid_key;
}
if (0 <= list->num_methods) {
static WCHAR const fmt[3] = { '%', 'd', 0 };
HKEY key;
res = RegCreateKeyExW(iid_key, num_methods_keyname, 0, NULL, 0,
KEY_READ | KEY_WRITE, NULL, &key, NULL);
if (res != ERROR_SUCCESS) goto error_close_iid_key;
sprintfW(buf, fmt, list->num_methods);
res = RegSetValueExW(key, NULL, 0, REG_SZ,
(CONST BYTE*)buf,
(lstrlenW(buf) + 1) * sizeof(WCHAR));
RegCloseKey(key);
if (res != ERROR_SUCCESS) goto error_close_iid_key;
}
if (list->ps_clsid) {
res = register_key_guid(iid_key, ps_clsid_keyname, list->ps_clsid);
if (res != ERROR_SUCCESS) goto error_close_iid_key;
}
if (list->ps_clsid32) {
res = register_key_guid(iid_key, ps_clsid32_keyname, list->ps_clsid32);
if (res != ERROR_SUCCESS) goto error_close_iid_key;
}
error_close_iid_key:
RegCloseKey(iid_key);
}
error_close_interface_key:
RegCloseKey(interface_key);
error_return:
return res != ERROR_SUCCESS ? HRESULT_FROM_WIN32(res) : S_OK;
}
/***********************************************************************
* unregister_interfaces
*/
static HRESULT unregister_interfaces(struct regsvr_interface const *list)
{
LONG res = ERROR_SUCCESS;
HKEY interface_key;
res = RegOpenKeyExW(HKEY_CLASSES_ROOT, interface_keyname, 0,
KEY_READ | KEY_WRITE, &interface_key);
if (res == ERROR_FILE_NOT_FOUND) return S_OK;
if (res != ERROR_SUCCESS) goto error_return;
for (; res == ERROR_SUCCESS && list->iid; ++list) {
WCHAR buf[39];
StringFromGUID2(list->iid, buf, 39);
res = RegDeleteTreeW(interface_key, buf);
if (res == ERROR_FILE_NOT_FOUND) res = ERROR_SUCCESS;
}
RegCloseKey(interface_key);
error_return:
return res != ERROR_SUCCESS ? HRESULT_FROM_WIN32(res) : S_OK;
}
/***********************************************************************
* register_coclasses
*/
static HRESULT register_coclasses(struct regsvr_coclass const *list)
{
LONG res = ERROR_SUCCESS;
HKEY coclass_key;
res = RegCreateKeyExW(HKEY_CLASSES_ROOT, clsid_keyname, 0, NULL, 0,
KEY_READ | KEY_WRITE, NULL, &coclass_key, NULL);
if (res != ERROR_SUCCESS) goto error_return;
for (; res == ERROR_SUCCESS && list->clsid; ++list) {
WCHAR buf[39];
HKEY clsid_key;
StringFromGUID2(list->clsid, buf, 39);
res = RegCreateKeyExW(coclass_key, buf, 0, NULL, 0,
KEY_READ | KEY_WRITE, NULL, &clsid_key, NULL);
if (res != ERROR_SUCCESS) goto error_close_coclass_key;
if (list->name) {
res = RegSetValueExA(clsid_key, NULL, 0, REG_SZ,
(CONST BYTE*)(list->name),
strlen(list->name) + 1);
if (res != ERROR_SUCCESS) goto error_close_clsid_key;
}
if (list->ips) {
res = register_key_defvalueA(clsid_key, ips_keyname, list->ips);
if (res != ERROR_SUCCESS) goto error_close_clsid_key;
}
if (list->ips32) {
HKEY ips32_key;
res = RegCreateKeyExW(clsid_key, ips32_keyname, 0, NULL, 0,
KEY_READ | KEY_WRITE, NULL,
&ips32_key, NULL);
if (res != ERROR_SUCCESS) goto error_close_clsid_key;
res = RegSetValueExA(ips32_key, NULL, 0, REG_SZ,
(CONST BYTE*)list->ips32,
lstrlenA(list->ips32) + 1);
if (res == ERROR_SUCCESS && list->ips32_tmodel)
res = RegSetValueExA(ips32_key, tmodel_valuename, 0, REG_SZ,
(CONST BYTE*)list->ips32_tmodel,
strlen(list->ips32_tmodel) + 1);
RegCloseKey(ips32_key);
if (res != ERROR_SUCCESS) goto error_close_clsid_key;
}
if (list->clsid_str) {
res = register_key_defvalueA(clsid_key, clsid_keyname,
list->clsid_str);
if (res != ERROR_SUCCESS) goto error_close_clsid_key;
}
if (list->progid) {
HKEY progid_key;
res = register_key_defvalueA(clsid_key, progid_keyname,
list->progid);
if (res != ERROR_SUCCESS) goto error_close_clsid_key;
res = RegCreateKeyExA(HKEY_CLASSES_ROOT, list->progid, 0,
NULL, 0, KEY_READ | KEY_WRITE, NULL,
&progid_key, NULL);
if (res != ERROR_SUCCESS) goto error_close_clsid_key;
res = register_key_defvalueW(progid_key, clsid_keyname, buf);
RegCloseKey(progid_key);
if (res != ERROR_SUCCESS) goto error_close_clsid_key;
}
error_close_clsid_key:
RegCloseKey(clsid_key);
}
error_close_coclass_key:
RegCloseKey(coclass_key);
error_return:
return res != ERROR_SUCCESS ? HRESULT_FROM_WIN32(res) : S_OK;
}
/***********************************************************************
* unregister_coclasses
*/
static HRESULT unregister_coclasses(struct regsvr_coclass const *list)
{
LONG res = ERROR_SUCCESS;
HKEY coclass_key;
res = RegOpenKeyExW(HKEY_CLASSES_ROOT, clsid_keyname, 0,
KEY_READ | KEY_WRITE, &coclass_key);
if (res == ERROR_FILE_NOT_FOUND) return S_OK;
if (res != ERROR_SUCCESS) goto error_return;
for (; res == ERROR_SUCCESS && list->clsid; ++list) {
WCHAR buf[39];
StringFromGUID2(list->clsid, buf, 39);
res = RegDeleteTreeW(coclass_key, buf);
if (res == ERROR_FILE_NOT_FOUND) res = ERROR_SUCCESS;
if (res != ERROR_SUCCESS) goto error_close_coclass_key;
if (list->progid) {
res = RegDeleteTreeA(HKEY_CLASSES_ROOT, list->progid);
if (res == ERROR_FILE_NOT_FOUND) res = ERROR_SUCCESS;
if (res != ERROR_SUCCESS) goto error_close_coclass_key;
}
}
error_close_coclass_key:
RegCloseKey(coclass_key);
error_return:
return res != ERROR_SUCCESS ? HRESULT_FROM_WIN32(res) : S_OK;
}
/***********************************************************************
* regsvr_key_guid
*/
static LONG register_key_guid(HKEY base, WCHAR const *name, GUID const *guid)
{
WCHAR buf[39];
StringFromGUID2(guid, buf, 39);
return register_key_defvalueW(base, name, buf);
}
/***********************************************************************
* regsvr_key_defvalueW
*/
static LONG register_key_defvalueW(
HKEY base,
WCHAR const *name,
WCHAR const *value)
{
LONG res;
HKEY key;
res = RegCreateKeyExW(base, name, 0, NULL, 0,
KEY_READ | KEY_WRITE, NULL, &key, NULL);
if (res != ERROR_SUCCESS) return res;
res = RegSetValueExW(key, NULL, 0, REG_SZ, (CONST BYTE*)value,
(lstrlenW(value) + 1) * sizeof(WCHAR));
RegCloseKey(key);
return res;
}
/***********************************************************************
* regsvr_key_defvalueA
*/
static LONG register_key_defvalueA(
HKEY base,
WCHAR const *name,
char const *value)
{
LONG res;
HKEY key;
res = RegCreateKeyExW(base, name, 0, NULL, 0,
KEY_READ | KEY_WRITE, NULL, &key, NULL);
if (res != ERROR_SUCCESS) return res;
res = RegSetValueExA(key, NULL, 0, REG_SZ, (CONST BYTE*)value,
lstrlenA(value) + 1);
RegCloseKey(key);
return res;
}
/***********************************************************************
* coclass list
*/
static struct regsvr_coclass const coclass_list[] = {
{ &CLSID_UpdateSession,
"CLSID_UpdateSession",
NULL,
"wuapi.dll",
"Both"
},
{ &CLSID_AutomaticUpdates,
"CLSID_AutomaticUpdates",
NULL,
"wuapi.dll",
"Both"
},
{ NULL } /* list terminator */
};
/***********************************************************************
* interface list
*/
static struct regsvr_interface const interface_list[] = {
{ NULL } /* list terminator */
};
/***********************************************************************
* DllRegisterServer (INETCOMM.@)
*/
HRESULT WINAPI DllRegisterServer(void)
{
HRESULT hr;
TRACE("\n");
hr = register_coclasses(coclass_list);
if (SUCCEEDED(hr))
hr = register_interfaces(interface_list);
return hr;
}
/***********************************************************************
* DllUnregisterServer (INETCOMM.@)
*/
HRESULT WINAPI DllUnregisterServer(void)
{
HRESULT hr;
TRACE("\n");
hr = unregister_coclasses(coclass_list);
if (SUCCEEDED(hr))
hr = unregister_interfaces(interface_list);
return hr;
}

View file

@ -0,0 +1,257 @@
/*
* IUpdateSearcher implementation
*
* Copyright 2008 Hans Leidekker
*
* 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
*/
#define COBJMACROS
#include "config.h"
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "winuser.h"
#include "ole2.h"
#include "wuapi.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(wuapi);
typedef struct _update_searcher
{
const struct IUpdateSearcherVtbl *vtbl;
LONG refs;
} update_searcher;
static inline update_searcher *impl_from_IUpdateSearcher( IUpdateSearcher *iface )
{
return (update_searcher *)((char *)iface - FIELD_OFFSET( update_searcher, vtbl ));
}
static ULONG WINAPI update_searcher_AddRef(
IUpdateSearcher *iface )
{
update_searcher *update_searcher = impl_from_IUpdateSearcher( iface );
return InterlockedIncrement( &update_searcher->refs );
}
static ULONG WINAPI update_searcher_Release(
IUpdateSearcher *iface )
{
update_searcher *update_searcher = impl_from_IUpdateSearcher( iface );
LONG refs = InterlockedDecrement( &update_searcher->refs );
if (!refs)
{
TRACE("destroying %p\n", update_searcher);
HeapFree( GetProcessHeap(), 0, update_searcher );
}
return refs;
}
static HRESULT WINAPI update_searcher_QueryInterface(
IUpdateSearcher *iface,
REFIID riid,
void **ppvObject )
{
update_searcher *This = impl_from_IUpdateSearcher( iface );
TRACE("%p %s %p\n", This, debugstr_guid( riid ), ppvObject );
if ( IsEqualGUID( riid, &IID_IUpdateSearcher ) ||
IsEqualGUID( riid, &IID_IDispatch ) ||
IsEqualGUID( riid, &IID_IUnknown ) )
{
*ppvObject = iface;
}
else
{
FIXME("interface %s not implemented\n", debugstr_guid(riid));
return E_NOINTERFACE;
}
IUpdateSearcher_AddRef( iface );
return S_OK;
}
static HRESULT WINAPI update_searcher_GetTypeInfoCount(
IUpdateSearcher *iface,
UINT *pctinfo )
{
FIXME("\n");
return E_NOTIMPL;
}
static HRESULT WINAPI update_searcher_GetTypeInfo(
IUpdateSearcher *iface,
UINT iTInfo,
LCID lcid,
ITypeInfo **ppTInfo )
{
FIXME("\n");
return E_NOTIMPL;
}
static HRESULT WINAPI update_searcher_GetIDsOfNames(
IUpdateSearcher *iface,
REFIID riid,
LPOLESTR *rgszNames,
UINT cNames,
LCID lcid,
DISPID *rgDispId )
{
FIXME("\n");
return E_NOTIMPL;
}
static HRESULT WINAPI update_searcher_Invoke(
IUpdateSearcher *iface,
DISPID dispIdMember,
REFIID riid,
LCID lcid,
WORD wFlags,
DISPPARAMS *pDispParams,
VARIANT *pVarResult,
EXCEPINFO *pExcepInfo,
UINT *puArgErr )
{
FIXME("\n");
return E_NOTIMPL;
}
static HRESULT WINAPI update_searcher_get_CanAutomaticallyUpgradeService(
IUpdateSearcher *This,
VARIANT_BOOL *retval )
{
FIXME("\n");
return E_NOTIMPL;
}
static HRESULT WINAPI update_searcher_put_CanAutomaticallyUpgradeService(
IUpdateSearcher *This,
VARIANT_BOOL value )
{
FIXME("%p, %d\n", This, value);
return S_OK;
}
static HRESULT WINAPI update_searcher_get_ClientApplicationID(
IUpdateSearcher *This,
BSTR *retval )
{
FIXME("\n");
return E_NOTIMPL;
}
static HRESULT WINAPI update_searcher_put_ClientApplicationID(
IUpdateSearcher *This,
BSTR value )
{
FIXME("%p, %s\n", This, debugstr_w(value));
return E_NOTIMPL;
}
static HRESULT WINAPI update_searcher_get_IncludePotentiallySupersededUpdates(
IUpdateSearcher *This,
VARIANT_BOOL *retval )
{
FIXME("\n");
return E_NOTIMPL;
}
static HRESULT WINAPI update_searcher_put_IncludePotentiallySupersededUpdates(
IUpdateSearcher *This,
VARIANT_BOOL value )
{
FIXME("\n");
return E_NOTIMPL;
}
static HRESULT WINAPI update_searcher_get_ServerSelection(
IUpdateSearcher *This,
ServerSelection *retval )
{
FIXME("\n");
return E_NOTIMPL;
}
static HRESULT WINAPI update_searcher_put_ServerSelection(
IUpdateSearcher *This,
ServerSelection value )
{
FIXME("\n");
return E_NOTIMPL;
}
static HRESULT WINAPI update_searcher_BeginSearch(
IUpdateSearcher *This,
BSTR criteria,
IUnknown *onCompleted,
VARIANT state,
ISearchJob **retval )
{
FIXME("\n");
return E_NOTIMPL;
}
static HRESULT WINAPI update_searcher_EndSearch(
IUpdateSearcher *This,
ISearchJob *searchJob,
ISearchResult **retval )
{
FIXME("\n");
return E_NOTIMPL;
}
static const struct IUpdateSearcherVtbl update_searcher_vtbl =
{
update_searcher_QueryInterface,
update_searcher_AddRef,
update_searcher_Release,
update_searcher_GetTypeInfoCount,
update_searcher_GetTypeInfo,
update_searcher_GetIDsOfNames,
update_searcher_Invoke,
update_searcher_get_CanAutomaticallyUpgradeService,
update_searcher_put_CanAutomaticallyUpgradeService,
update_searcher_get_ClientApplicationID,
update_searcher_put_ClientApplicationID,
update_searcher_get_IncludePotentiallySupersededUpdates,
update_searcher_put_IncludePotentiallySupersededUpdates,
update_searcher_get_ServerSelection,
update_searcher_put_ServerSelection,
update_searcher_BeginSearch,
update_searcher_EndSearch
};
HRESULT UpdateSearcher_create( IUnknown *pUnkOuter, LPVOID *ppObj )
{
update_searcher *searcher;
TRACE("(%p,%p)\n", pUnkOuter, ppObj);
searcher = HeapAlloc( GetProcessHeap(), 0, sizeof(*searcher) );
if (!searcher) return E_OUTOFMEMORY;
searcher->vtbl = &update_searcher_vtbl;
searcher->refs = 1;
*ppObj = &searcher->vtbl;
TRACE("returning iface %p\n", *ppObj);
return S_OK;
}

View file

@ -0,0 +1,236 @@
/*
* IUpdateSession implementation
*
* Copyright 2008 Hans Leidekker
*
* 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
*/
#define COBJMACROS
#include "config.h"
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "winuser.h"
#include "ole2.h"
#include "wuapi.h"
#include "wine/debug.h"
#include "wuapi_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(wuapi);
typedef struct _update_session
{
const struct IUpdateSessionVtbl *vtbl;
LONG refs;
} update_session;
static inline update_session *impl_from_IUpdateSession( IUpdateSession *iface )
{
return (update_session *)((char *)iface - FIELD_OFFSET( update_session, vtbl ));
}
static ULONG WINAPI update_session_AddRef(
IUpdateSession *iface )
{
update_session *update_session = impl_from_IUpdateSession( iface );
return InterlockedIncrement( &update_session->refs );
}
static ULONG WINAPI update_session_Release(
IUpdateSession *iface )
{
update_session *update_session = impl_from_IUpdateSession( iface );
LONG refs = InterlockedDecrement( &update_session->refs );
if (!refs)
{
TRACE("destroying %p\n", update_session);
HeapFree( GetProcessHeap(), 0, update_session );
}
return refs;
}
static HRESULT WINAPI update_session_QueryInterface(
IUpdateSession *iface,
REFIID riid,
void **ppvObject )
{
update_session *This = impl_from_IUpdateSession( iface );
TRACE("%p %s %p\n", This, debugstr_guid( riid ), ppvObject );
if ( IsEqualGUID( riid, &IID_IUpdateSession ) ||
IsEqualGUID( riid, &IID_IDispatch ) ||
IsEqualGUID( riid, &IID_IUnknown ) )
{
*ppvObject = iface;
}
else
{
FIXME("interface %s not implemented\n", debugstr_guid(riid));
return E_NOINTERFACE;
}
IUpdateSession_AddRef( iface );
return S_OK;
}
static HRESULT WINAPI update_session_GetTypeInfoCount(
IUpdateSession *iface,
UINT *pctinfo )
{
FIXME("\n");
return E_NOTIMPL;
}
static HRESULT WINAPI update_session_GetTypeInfo(
IUpdateSession *iface,
UINT iTInfo,
LCID lcid,
ITypeInfo **ppTInfo )
{
FIXME("\n");
return E_NOTIMPL;
}
static HRESULT WINAPI update_session_GetIDsOfNames(
IUpdateSession *iface,
REFIID riid,
LPOLESTR *rgszNames,
UINT cNames,
LCID lcid,
DISPID *rgDispId )
{
FIXME("\n");
return E_NOTIMPL;
}
static HRESULT WINAPI update_session_Invoke(
IUpdateSession *iface,
DISPID dispIdMember,
REFIID riid,
LCID lcid,
WORD wFlags,
DISPPARAMS *pDispParams,
VARIANT *pVarResult,
EXCEPINFO *pExcepInfo,
UINT *puArgErr )
{
FIXME("\n");
return E_NOTIMPL;
}
static HRESULT WINAPI update_session_get_ClientApplicationID(
IUpdateSession *This,
BSTR *retval )
{
FIXME("\n");
return E_NOTIMPL;
}
static HRESULT WINAPI update_session_put_ClientApplicationID(
IUpdateSession *This,
BSTR value )
{
FIXME("%p, %s\n", This, debugstr_w(value));
return S_OK;
}
static HRESULT WINAPI update_session_get_ReadOnly(
IUpdateSession *This,
VARIANT_BOOL *retval )
{
FIXME("\n");
return E_NOTIMPL;
}
static HRESULT WINAPI update_session_get_WebProxy(
IUpdateSession *This,
IWebProxy **retval )
{
FIXME("\n");
return E_NOTIMPL;
}
static HRESULT WINAPI update_session_put_WebProxy(
IUpdateSession *This,
IWebProxy *value )
{
FIXME("\n");
return E_NOTIMPL;
}
static HRESULT WINAPI update_session_CreateUpdateSearcher(
IUpdateSession *This,
IUpdateSearcher **retval )
{
TRACE("%p\n", This);
return UpdateSearcher_create( NULL, (LPVOID *)retval );
}
static HRESULT WINAPI update_session_CreateUpdateDownloader(
IUpdateSession *This,
IUpdateDownloader **retval )
{
TRACE("%p\n", This);
return UpdateDownloader_create( NULL, (LPVOID *)retval );
}
static HRESULT WINAPI update_session_CreateUpdateInstaller(
IUpdateSession *This,
IUpdateInstaller **retval )
{
TRACE("%p\n", This);
return UpdateInstaller_create( NULL, (LPVOID *)retval );
}
static const struct IUpdateSessionVtbl update_session_vtbl =
{
update_session_QueryInterface,
update_session_AddRef,
update_session_Release,
update_session_GetTypeInfoCount,
update_session_GetTypeInfo,
update_session_GetIDsOfNames,
update_session_Invoke,
update_session_get_ClientApplicationID,
update_session_put_ClientApplicationID,
update_session_get_ReadOnly,
update_session_get_WebProxy,
update_session_put_WebProxy,
update_session_CreateUpdateSearcher,
update_session_CreateUpdateDownloader,
update_session_CreateUpdateInstaller
};
HRESULT UpdateSession_create( IUnknown *pUnkOuter, LPVOID *ppObj )
{
update_session *session;
TRACE("(%p,%p)\n", pUnkOuter, ppObj);
session = HeapAlloc( GetProcessHeap(), 0, sizeof(*session) );
if (!session) return E_OUTOFMEMORY;
session->vtbl = &update_session_vtbl;
session->refs = 1;
*ppObj = &session->vtbl;
TRACE("returning iface %p\n", *ppObj);
return S_OK;
}

View file

@ -0,0 +1,221 @@
/*
* IAutomaticUpdates implementation
*
* Copyright 2008 Hans Leidekker
*
* 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
*/
#define COBJMACROS
#include "config.h"
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "winuser.h"
#include "ole2.h"
#include "wuapi.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(wuapi);
typedef struct _automatic_updates
{
const struct IAutomaticUpdatesVtbl *vtbl;
LONG refs;
} automatic_updates;
static inline automatic_updates *impl_from_IAutomaticUpdates( IAutomaticUpdates *iface )
{
return (automatic_updates *)((char*)iface - FIELD_OFFSET( automatic_updates, vtbl ));
}
static ULONG WINAPI automatic_updates_AddRef(
IAutomaticUpdates *iface )
{
automatic_updates *automatic_updates = impl_from_IAutomaticUpdates( iface );
return InterlockedIncrement( &automatic_updates->refs );
}
static ULONG WINAPI automatic_updates_Release(
IAutomaticUpdates *iface )
{
automatic_updates *automatic_updates = impl_from_IAutomaticUpdates( iface );
LONG refs = InterlockedDecrement( &automatic_updates->refs );
if (!refs)
{
TRACE("destroying %p\n", automatic_updates);
HeapFree( GetProcessHeap(), 0, automatic_updates );
}
return refs;
}
static HRESULT WINAPI automatic_updates_QueryInterface(
IAutomaticUpdates *iface,
REFIID riid,
void **ppvObject )
{
automatic_updates *This = impl_from_IAutomaticUpdates( iface );
TRACE("%p %s %p\n", This, debugstr_guid( riid ), ppvObject );
if ( IsEqualGUID( riid, &IID_IAutomaticUpdates ) ||
IsEqualGUID( riid, &IID_IDispatch ) ||
IsEqualGUID( riid, &IID_IUnknown ) )
{
*ppvObject = iface;
}
else
{
FIXME("interface %s not implemented\n", debugstr_guid(riid));
return E_NOINTERFACE;
}
IAutomaticUpdates_AddRef( iface );
return S_OK;
}
static HRESULT WINAPI automatic_updates_GetTypeInfoCount(
IAutomaticUpdates *iface,
UINT *pctinfo )
{
FIXME("\n");
return E_NOTIMPL;
}
static HRESULT WINAPI automatic_updates_GetTypeInfo(
IAutomaticUpdates *iface,
UINT iTInfo,
LCID lcid,
ITypeInfo **ppTInfo )
{
FIXME("\n");
return E_NOTIMPL;
}
static HRESULT WINAPI automatic_updates_GetIDsOfNames(
IAutomaticUpdates *iface,
REFIID riid,
LPOLESTR *rgszNames,
UINT cNames,
LCID lcid,
DISPID *rgDispId )
{
FIXME("\n");
return E_NOTIMPL;
}
static HRESULT WINAPI automatic_updates_Invoke(
IAutomaticUpdates *iface,
DISPID dispIdMember,
REFIID riid,
LCID lcid,
WORD wFlags,
DISPPARAMS *pDispParams,
VARIANT *pVarResult,
EXCEPINFO *pExcepInfo,
UINT *puArgErr )
{
FIXME("\n");
return E_NOTIMPL;
}
static HRESULT WINAPI automatic_updates_DetectNow(
IAutomaticUpdates *This )
{
FIXME("\n");
return E_NOTIMPL;
}
static HRESULT WINAPI automatic_updates_Pause(
IAutomaticUpdates *This )
{
FIXME("\n");
return E_NOTIMPL;
}
static HRESULT WINAPI automatic_updates_Resume(
IAutomaticUpdates *This )
{
FIXME("\n");
return E_NOTIMPL;
}
static HRESULT WINAPI automatic_updates_ShowSettingsDialog(
IAutomaticUpdates *This )
{
FIXME("\n");
return E_NOTIMPL;
}
static HRESULT WINAPI automatic_updates_EnableService(
IAutomaticUpdates *This )
{
FIXME("\n");
return E_NOTIMPL;
}
static HRESULT WINAPI automatic_updates_get_ServiceEnabled(
IAutomaticUpdates *This,
VARIANT_BOOL *retval )
{
FIXME("%p\n", retval);
return E_NOTIMPL;
}
static HRESULT WINAPI automatic_updates_get_Settings(
IAutomaticUpdates *This,
IAutomaticUpdatesSettings **retval )
{
FIXME("%p\n", retval);
return E_NOTIMPL;
}
static const struct IAutomaticUpdatesVtbl automatic_updates_vtbl =
{
automatic_updates_QueryInterface,
automatic_updates_AddRef,
automatic_updates_Release,
automatic_updates_GetTypeInfoCount,
automatic_updates_GetTypeInfo,
automatic_updates_GetIDsOfNames,
automatic_updates_Invoke,
automatic_updates_DetectNow,
automatic_updates_Pause,
automatic_updates_Resume,
automatic_updates_ShowSettingsDialog,
automatic_updates_get_Settings,
automatic_updates_get_ServiceEnabled,
automatic_updates_EnableService
};
HRESULT AutomaticUpdates_create( IUnknown *pUnkOuter, LPVOID *ppObj )
{
automatic_updates *updates;
TRACE("(%p,%p)\n", pUnkOuter, ppObj);
updates = HeapAlloc( GetProcessHeap(), 0, sizeof(*updates) );
if (!updates) return E_OUTOFMEMORY;
updates->vtbl = &automatic_updates_vtbl;
updates->refs = 1;
*ppObj = &updates->vtbl;
TRACE("returning iface %p\n", *ppObj);
return S_OK;
}

View file

@ -0,0 +1,21 @@
<module name="wuapi" type="win32dll" baseaddress="${BASEADDRESS_WUAPI}" installbase="system32" installname="wuapi.dll" allowwarnings="true">
<autoregister infsection="OleControlDlls" type="DllRegisterServer" />
<importlibrary definition="wuapi.spec" />
<include base="wuapi">.</include>
<include base="ReactOS">include/reactos/wine</include>
<define name="__WINESRC__" />
<define name="_WIN32_WINNT">0x600</define>
<file>downloader.c</file>
<file>installer.c</file>
<file>main.c</file>
<file>regsvr.c</file>
<file>searcher.c</file>
<file>session.c</file>
<file>updates.c</file>
<library>wine</library>
<library>uuid</library>
<library>ole32</library>
<library>advapi32</library>
<library>kernel32</library>
<library>ntdll</library>
</module>

View file

@ -0,0 +1,4 @@
@ stdcall -private DllCanUnloadNow()
@ stdcall -private DllGetClassObject(ptr ptr ptr)
@ stdcall -private DllRegisterServer()
@ stdcall -private DllUnregisterServer()

View file

@ -0,0 +1,23 @@
/*
* Copyright 2008 Hans Leidekker 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
*/
extern HRESULT AutomaticUpdates_create( IUnknown *pUnkOuter, LPVOID *ppObj );
extern HRESULT UpdateSession_create( IUnknown *pUnkOuter, LPVOID *ppObj );
extern HRESULT UpdateSearcher_create( IUnknown *pUnkOuter, LPVOID *ppObj );
extern HRESULT UpdateDownloader_create( IUnknown *pUnkOuter, LPVOID *ppObj );
extern HRESULT UpdateInstaller_create( IUnknown *pUnkOuter, LPVOID *ppObj );

View file

@ -52,6 +52,7 @@
<file>mshtmhst.idl</file>
<file>exdisp.idl</file>
<file>wtypes.idl</file>
<file>wuapi.idl</file>
<file>comcat.idl</file>
<file>xmldso.idl</file>
<file>xmldom.idl</file>

View file

@ -0,0 +1,359 @@
/*
* Copyright 2008 Hans Leidekker 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
*/
cpp_quote("DEFINE_GUID(CLSID_AutomaticUpdates, 0xbfe18e9c,0x6d87,0x4450,0xb3,0x7c,0xe0,0x2f,0x0b,0x37,0x38,0x03);")
cpp_quote("DEFINE_GUID(CLSID_UpdateSession, 0x4cb43d7f,0x7eee,0x4906,0x86,0x98,0x60,0xda,0x1c,0x38,0xf2,0xfe);")
import "oaidl.idl";
interface IAutomaticUpdates;
interface IAutomaticUpdatesSettings;
interface IDownloadJob;
interface IDownloadResult;
interface IInstallationJob;
interface IInstallationResult;
interface ISearchJob;
interface ISearchResult;
interface IUpdateCollection;
interface IUpdateDownloader;
interface IUpdateHistoryEntryCollection;
interface IUpdateInstaller;
interface IUpdateSearcher;
interface IUpdateSession;
interface IWebProxy;
typedef [public] enum tagDownloadPriority
{
dpLow = 1,
dpNormal = 2,
dpHigh = 3,
} DownloadPriority;
typedef [public] enum tagServerSelection
{
ssDefault = 0,
ssManagedServer = 1,
ssWindowsUpdate = 2,
ssOthers = 3,
} ServerSelection;
[
object,
uuid(673425bf-c082-4c7c-bdfd-569464b8e0ce),
oleautomation,
dual,
nonextensible,
pointer_default(unique),
hidden
]
interface IAutomaticUpdates : IDispatch
{
HRESULT DetectNow();
HRESULT Pause();
HRESULT Resume();
HRESULT ShowSettingsDialog();
[propget]
HRESULT Settings(
[out, retval] IAutomaticUpdatesSettings **retval);
[propget]
HRESULT ServiceEnabled(
[out, retval] VARIANT_BOOL *retval);
HRESULT EnableService();
}
[
object,
uuid(816858a4-260d-4260-933a-2585f1abc76b),
oleautomation,
dual,
nonextensible,
pointer_default(unique),
]
interface IUpdateSession : IDispatch
{
[propget]
HRESULT ClientApplicationID(
[out, retval] BSTR *retval);
[propput]
HRESULT ClientApplicationID(
[in] BSTR value);
[propget]
HRESULT ReadOnly(
[out, retval] VARIANT_BOOL *retval);
[propget]
HRESULT WebProxy(
[out, retval] IWebProxy **retval);
[propput]
HRESULT WebProxy(
[in, unique] IWebProxy *value);
HRESULT CreateUpdateSearcher(
[out, retval] IUpdateSearcher **retval);
HRESULT CreateUpdateDownloader(
[out, retval] IUpdateDownloader **retval);
HRESULT CreateUpdateInstaller(
[out, retval] IUpdateInstaller **retval);
}
[
object,
uuid(8f45abf1-f9ae-4b95-a933-f0f66e5056ea),
oleautomation,
dual,
nonextensible,
pointer_default(unique),
]
interface IUpdateSearcher : IDispatch
{
[propget]
HRESULT CanAutomaticallyUpgradeService(
[out, retval] VARIANT_BOOL *retval);
[propput]
HRESULT CanAutomaticallyUpgradeService(
[in] VARIANT_BOOL value);
[propget]
HRESULT ClientApplicationID(
[out, retval] BSTR *retval);
[propput]
HRESULT ClientApplicationID(
[in] BSTR value);
[propget]
HRESULT IncludePotentiallySupersededUpdates(
[out, retval] VARIANT_BOOL *retval);
[propput]
HRESULT IncludePotentiallySupersededUpdates(
[in] VARIANT_BOOL value);
[propget]
HRESULT ServerSelection(
[out, retval] ServerSelection *retval);
[propput]
HRESULT ServerSelection(
[in] ServerSelection value);
HRESULT BeginSearch(
[in] BSTR criteria,
[in] IUnknown *onCompleted,
[in] VARIANT state,
[out, retval] ISearchJob **retval);
HRESULT EndSearch(
[in] ISearchJob *searchJob,
[out, retval] ISearchResult **retval);
HRESULT EscapeString(
[in] BSTR unescaped,
[out, retval] BSTR *retval);
HRESULT QueryHistory(
[in] LONG startIndex,
[in] LONG count,
[out, retval] IUpdateHistoryEntryCollection **retval);
HRESULT Search(
[in] BSTR criteria,
[out, retval] ISearchResult **retval);
[propget]
HRESULT Online(
[out, retval] VARIANT_BOOL *retval);
[propput]
HRESULT Online(
[in] VARIANT_BOOL value);
HRESULT GetTotalHistoryCount(
[out, retval] LONG *retval);
[propget]
HRESULT ServiceID(
[out, retval] BSTR *retval);
[propput]
HRESULT ServiceID(
[in] BSTR value);
}
[
object,
uuid(68f1c6f9-7ecc-4666-a464-247fe12496c3),
oleautomation,
dual,
nonextensible,
pointer_default(unique),
hidden
]
interface IUpdateDownloader : IDispatch
{
[propget]
HRESULT ClientApplicationID(
[out, retval] BSTR *retval);
[propput]
HRESULT ClientApplicationID(
[in] BSTR value);
[propget]
HRESULT IsForced(
[out, retval] VARIANT_BOOL *retval);
[propput]
HRESULT IsForced(
[in] VARIANT_BOOL value);
[propget]
HRESULT Priority(
[out, retval] DownloadPriority *retval);
[propput]
HRESULT Priority(
[in] DownloadPriority value);
[propget]
HRESULT Updates(
[out, retval] IUpdateCollection **retval);
[propput]
HRESULT Updates(
[in] IUpdateCollection *value);
HRESULT BeginDownload(
[in] IUnknown *onProgressChanged,
[in] IUnknown *onCompleted,
[in] VARIANT state,
[out, retval] IDownloadJob **retval);
HRESULT Download(
[out, retval] IDownloadResult **retval);
HRESULT EndDownload(
[in] IDownloadJob *value,
[out, retval] IDownloadResult **retval);
}
[
object,
uuid(7b929c68-ccdc-4226-96b1-8724600b54c2),
oleautomation,
dual,
nonextensible,
pointer_default(unique),
]
interface IUpdateInstaller : IDispatch
{
[propget]
HRESULT ClientApplicationID(
[out, retval] BSTR *retval);
[propput]
HRESULT ClientApplicationID(
[in] BSTR value);
[propget]
HRESULT IsForced(
[out, retval] VARIANT_BOOL *retval);
[propput]
HRESULT IsForced(
[in] VARIANT_BOOL value);
[propget, restricted]
HRESULT ParentHwnd(
[out, retval] HWND *retval);
[propput, restricted]
HRESULT ParentHwnd(
[in, unique] HWND value);
[propput]
HRESULT ParentWindow(
[in, unique] IUnknown *value);
[propget]
HRESULT ParentWindow(
[out, retval] IUnknown **retval);
[propget]
HRESULT Updates(
[out, retval] IUpdateCollection **retval);
[propput]
HRESULT Updates(
[in] IUpdateCollection *value);
HRESULT BeginInstall(
[in] IUnknown *onProgressChanged,
[in] IUnknown *onCompleted,
[in] VARIANT state,
[out, retval] IInstallationJob **retval);
HRESULT BeginUninstall(
[in] IUnknown *onProgressChanged,
[in] IUnknown *onCompleted,
[in] VARIANT state,
[out, retval] IInstallationJob **retval);
HRESULT EndInstall(
[in] IInstallationJob *value,
[out, retval] IInstallationResult **retval);
HRESULT EndUninstall(
[in] IInstallationJob *value,
[out, retval] IInstallationResult **retval);
HRESULT Install(
[out, retval] IInstallationResult **retval);
HRESULT RunWizard(
[in, defaultvalue("")] BSTR dialogTitle,
[out, retval] IInstallationResult **retval);
[propget]
HRESULT IsBusy(
[out, retval] VARIANT_BOOL *retval);
HRESULT Uninstall(
[out, retval] IInstallationResult **retval);
[propget]
HRESULT AllowSourcePrompts(
[out, retval] VARIANT_BOOL *retval);
[propput]
HRESULT AllowSourcePrompts(
[in] VARIANT_BOOL value);
[propget]
HRESULT RebootRequiredBeforeInstallation(
[out, retval] VARIANT_BOOL *retval);
}

View file

@ -55,9 +55,11 @@ reactos/dll/win32/imm32 # Autosync
reactos/dll/win32/imagehlp # Patches for BindImage need review and submission to winehq.
reactos/dll/win32/inetcomm # Autosync
reactos/dll/win32/inetmib1 # Autosync
reactos/dll/win32/inseng # Autosync
reactos/dll/win32/iphlpapi # Out of sync
reactos/dll/win32/itss # Autosync
reactos/dll/win32/jscript # Autosync
reactos/dll/win32/localspl # Autosync
reactos/dll/win32/localui # Autosync
reactos/dll/win32/lz32 # Autosync
reactos/dll/win32/mapi32 # Autosync
@ -129,6 +131,7 @@ reactos/dll/win32/winmm/wavemap # Forked at Wine-20050628
reactos/dll/win32/wldap32 # Autosync
reactos/dll/win32/wmi # Autosync
reactos/dll/win32/wtsapi32 # Autosync
reactos/dll/win32/wuapi # Autosync
reactos/dll/directx/dinput # Synced to Wine-1_1_4
reactos/dll/directx/dinput8 # Synced to Wine-1_1_4
reactos/dll/directx/dplay # Synced to Wine-0_9_5