ReactOS.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
January 2012
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
19 participants
559 discussions
Start a n
N
ew thread
[akhaldi] 55257: [MSTASK] * Sync to Wine 1.3.37.
by akhaldi@svn.reactos.org
Author: akhaldi Date: Fri Jan 27 18:48:31 2012 New Revision: 55257 URL:
http://svn.reactos.org/svn/reactos?rev=55257&view=rev
Log: [MSTASK] * Sync to Wine 1.3.37. Added: trunk/reactos/dll/win32/mstask/mstask.rgs (with props) Removed: trunk/reactos/dll/win32/mstask/mstask.inf Modified: trunk/reactos/dll/win32/mstask/factory.c trunk/reactos/dll/win32/mstask/mstask_main.c trunk/reactos/dll/win32/mstask/mstask_private.h trunk/reactos/dll/win32/mstask/rsrc.rc trunk/reactos/dll/win32/mstask/task.c trunk/reactos/dll/win32/mstask/task_scheduler.c trunk/reactos/dll/win32/mstask/task_trigger.c trunk/reactos/media/doc/README.WINE Modified: trunk/reactos/dll/win32/mstask/factory.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mstask/factory.c…
============================================================================== --- trunk/reactos/dll/win32/mstask/factory.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/mstask/factory.c [iso-8859-1] Fri Jan 27 18:48:31 2012 @@ -21,12 +21,23 @@ WINE_DEFAULT_DEBUG_CHANNEL(mstask); +struct ClassFactoryImpl +{ + IClassFactory IClassFactory_iface; + LONG ref; +}; + +static inline ClassFactoryImpl *impl_from_IClassFactory(IClassFactory *iface) +{ + return CONTAINING_RECORD(iface, ClassFactoryImpl, IClassFactory_iface); +} + static HRESULT WINAPI MSTASK_IClassFactory_QueryInterface( LPCLASSFACTORY iface, REFIID riid, LPVOID *ppvObj) { - ClassFactoryImpl *This = (ClassFactoryImpl *)iface; + ClassFactoryImpl *This = impl_from_IClassFactory(iface); TRACE("IID: %s\n",debugstr_guid(riid)); if (ppvObj == NULL) @@ -35,7 +46,7 @@ if (IsEqualGUID(riid, &IID_IUnknown) || IsEqualGUID(riid, &IID_IClassFactory)) { - *ppvObj = &This->lpVtbl; + *ppvObj = &This->IClassFactory_iface; IClassFactory_AddRef(iface); return S_OK; } @@ -105,4 +116,4 @@ MSTASK_IClassFactory_LockServer }; -ClassFactoryImpl MSTASK_ClassFactory = { &IClassFactory_Vtbl }; +ClassFactoryImpl MSTASK_ClassFactory = { { &IClassFactory_Vtbl } }; Removed: trunk/reactos/dll/win32/mstask/mstask.inf URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mstask/mstask.in…
============================================================================== --- trunk/reactos/dll/win32/mstask/mstask.inf [iso-8859-1] (original) +++ trunk/reactos/dll/win32/mstask/mstask.inf (removed) @@ -1,16 +1,0 @@ -[version] -Signature="$CHICAGO$" - -[RegisterDll] -AddReg=Classes.Reg - -[UnregisterDll] -DelReg=Classes.Reg - -[Classes.Reg] -HKCR,"CLSID\%CLSID_CTaskScheduler%",,,"CTaskScheduler" -HKCR,"CLSID\%CLSID_CTaskScheduler%\InProcServer32",,,"mstask.dll" -HKCR,"CLSID\%CLSID_CTaskScheduler%\InProcServer32","ThreadingModel",,"Both" -HKCR,"CLSID\%CLSID_CTask%",,,"CTask" -HKCR,"CLSID\%CLSID_CTask%\InProcServer32",,,"mstask.dll" -HKCR,"CLSID\%CLSID_CTask%\InProcServer32","ThreadingModel",,"Both" Added: trunk/reactos/dll/win32/mstask/mstask.rgs URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mstask/mstask.rg…
============================================================================== --- trunk/reactos/dll/win32/mstask/mstask.rgs (added) +++ trunk/reactos/dll/win32/mstask/mstask.rgs [iso-8859-1] Fri Jan 27 18:48:31 2012 @@ -1,0 +1,17 @@ +HKCR +{ + NoRemove Interface + { + } + NoRemove CLSID + { + '{148BD52A-A2AB-11CE-B11F-00AA00530503}' = s 'CTaskScheduler' + { + InprocServer32 = s '%MODULE%' { val ThreadingModel = s 'Both' } + } + '{148BD520-A2AB-11CE-B11F-00AA00530503}' = s 'CTask' + { + InprocServer32 = s '%MODULE%' { val ThreadingModel = s 'Both' } + } + } +} Propchange: trunk/reactos/dll/win32/mstask/mstask.rgs ------------------------------------------------------------------------------ svn:eol-style = native Modified: trunk/reactos/dll/win32/mstask/mstask_main.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mstask/mstask_ma…
============================================================================== --- trunk/reactos/dll/win32/mstask/mstask_main.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/mstask/mstask_main.c [iso-8859-1] Fri Jan 27 18:48:31 2012 @@ -19,8 +19,8 @@ #include <stdio.h> #include "mstask_private.h" -#include "winreg.h" -#include "advpub.h" +#include "objbase.h" +#include "rpcproxy.h" #include "wine/debug.h" @@ -66,97 +66,12 @@ return dll_ref != 0 ? S_FALSE : S_OK; } -static inline char *mstask_strdup(const char *s) -{ - size_t n = strlen(s) + 1; - char *d = HeapAlloc(GetProcessHeap(), 0, n); - return d ? memcpy(d, s, n) : NULL; -} - -static HRESULT init_register_strtable(STRTABLEA *strtable) -{ -#define CLSID_EXPANSION_ENTRY(id) { "CLSID_" #id, &CLSID_ ## id } - static const struct - { - const char *name; - const CLSID *clsid; - } - expns[] = - { - CLSID_EXPANSION_ENTRY(CTaskScheduler), - CLSID_EXPANSION_ENTRY(CTask) - }; -#undef CLSID_EXPANSION_ENTRY - static STRENTRYA pse[sizeof expns / sizeof expns[0]]; - unsigned int i; - - strtable->cEntries = sizeof pse / sizeof pse[0]; - strtable->pse = pse; - for (i = 0; i < strtable->cEntries; i++) - { - static const char dummy_sample[] = - "{12345678-1234-1234-1234-123456789012}"; - const CLSID *clsid = expns[i].clsid; - pse[i].pszName = mstask_strdup(expns[i].name); - pse[i].pszValue = HeapAlloc(GetProcessHeap(), 0, sizeof dummy_sample); - if (!pse[i].pszName || !pse[i].pszValue) - return E_OUTOFMEMORY; - sprintf(pse[i].pszValue, - "{%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X}", - clsid->Data1, clsid->Data2, clsid->Data3, clsid->Data4[0], - clsid->Data4[1], clsid->Data4[2], clsid->Data4[3], - clsid->Data4[4], clsid->Data4[5], clsid->Data4[6], - clsid->Data4[7]); - } - - return S_OK; -} - -static void cleanup_register_strtable(STRTABLEA *strtable) -{ - unsigned int i; - for (i = 0; i < strtable->cEntries; i++) - { - HeapFree(GetProcessHeap(), 0, strtable->pse[i].pszName); - HeapFree(GetProcessHeap(), 0, strtable->pse[i].pszValue); - if (!strtable->pse[i].pszName || !strtable->pse[i].pszValue) - return; - } -} - -static HRESULT register_mstask(BOOL do_register) -{ - HRESULT hr; - STRTABLEA strtable; - HMODULE hAdvpack; - HRESULT (WINAPI *pRegInstall)(HMODULE hm, - LPCSTR pszSection, const STRTABLEA* pstTable); - static const WCHAR wszAdvpack[] = - {'a','d','v','p','a','c','k','.','d','l','l',0}; - - TRACE("(%x)\n", do_register); - - hAdvpack = LoadLibraryW(wszAdvpack); - pRegInstall = (void *)GetProcAddress(hAdvpack, "RegInstall"); - - hr = init_register_strtable(&strtable); - if (SUCCEEDED(hr)) - hr = pRegInstall(hInst, do_register ? "RegisterDll" : "UnregisterDll", - &strtable); - cleanup_register_strtable(&strtable); - - if (FAILED(hr)) - WINE_ERR("RegInstall failed: %08x\n", hr); - - return hr; -} - HRESULT WINAPI DllRegisterServer(void) { - return register_mstask(TRUE); + return __wine_register_resources( hInst ); } HRESULT WINAPI DllUnregisterServer(void) { - return register_mstask(FALSE); + return __wine_unregister_resources( hInst ); } Modified: trunk/reactos/dll/win32/mstask/mstask_private.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mstask/mstask_pr…
============================================================================== --- trunk/reactos/dll/win32/mstask/mstask_private.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/mstask/mstask_private.h [iso-8859-1] Fri Jan 27 18:48:31 2012 @@ -29,42 +29,13 @@ #include "ole2.h" #include "mstask.h" -extern LONG dll_ref; +extern LONG dll_ref DECLSPEC_HIDDEN; -typedef struct -{ - const IClassFactoryVtbl *lpVtbl; - LONG ref; -} ClassFactoryImpl; -extern ClassFactoryImpl MSTASK_ClassFactory; +typedef struct ClassFactoryImpl ClassFactoryImpl; +extern ClassFactoryImpl MSTASK_ClassFactory DECLSPEC_HIDDEN; -typedef struct -{ - const ITaskTriggerVtbl *lpVtbl; - LONG ref; - TASK_TRIGGER triggerCond; -} TaskTriggerImpl; -extern HRESULT TaskTriggerConstructor(LPVOID *ppObj); - -typedef struct -{ - const ITaskSchedulerVtbl *lpVtbl; - LONG ref; -} TaskSchedulerImpl; -extern HRESULT TaskSchedulerConstructor(LPVOID *ppObj); - -typedef struct -{ - const ITaskVtbl *lpVtbl; - const IPersistFileVtbl *persistVtbl; - LONG ref; - LPWSTR taskName; - LPWSTR applicationName; - LPWSTR parameters; - LPWSTR comment; - DWORD maxRunTime; - LPWSTR accountName; -} TaskImpl; -extern HRESULT TaskConstructor(LPCWSTR pwszTaskName, LPVOID *ppObj); +extern HRESULT TaskTriggerConstructor(LPVOID *ppObj) DECLSPEC_HIDDEN; +extern HRESULT TaskSchedulerConstructor(LPVOID *ppObj) DECLSPEC_HIDDEN; +extern HRESULT TaskConstructor(LPCWSTR pwszTaskName, LPVOID *ppObj) DECLSPEC_HIDDEN; #endif /* __MSTASK_PRIVATE_H__ */ Modified: trunk/reactos/dll/win32/mstask/rsrc.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mstask/rsrc.rc?r…
============================================================================== --- trunk/reactos/dll/win32/mstask/rsrc.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/mstask/rsrc.rc [iso-8859-1] Fri Jan 27 18:48:31 2012 @@ -1,20 +1,1 @@ -/* - * Copyright 2008 Google (Roy Shea) - * - * 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 - */ - -/* @makedep: mstask.inf */ -REGINST REGINST mstask.inf +1 WINE_REGISTRY mstask.rgs Modified: trunk/reactos/dll/win32/mstask/task.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mstask/task.c?re…
============================================================================== --- trunk/reactos/dll/win32/mstask/task.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/mstask/task.c [iso-8859-1] Fri Jan 27 18:48:31 2012 @@ -21,9 +21,27 @@ WINE_DEFAULT_DEBUG_CHANNEL(mstask); +typedef struct +{ + ITask ITask_iface; + IPersistFile IPersistFile_iface; + LONG ref; + LPWSTR taskName; + LPWSTR applicationName; + LPWSTR parameters; + LPWSTR comment; + DWORD maxRunTime; + LPWSTR accountName; +} TaskImpl; + +static inline TaskImpl *impl_from_ITask(ITask *iface) +{ + return CONTAINING_RECORD(iface, TaskImpl, ITask_iface); +} + static inline TaskImpl *impl_from_IPersistFile( IPersistFile *iface ) { - return (TaskImpl*) ((char*)(iface) - FIELD_OFFSET(TaskImpl, persistVtbl)); + return CONTAINING_RECORD(iface, TaskImpl, IPersistFile_iface); } static void TaskDestructor(TaskImpl *This) @@ -42,7 +60,7 @@ REFIID riid, void **ppvObject) { - TaskImpl * This = (TaskImpl *)iface; + TaskImpl * This = impl_from_ITask(iface); TRACE("IID: %s\n", debugstr_guid(riid)); if (ppvObject == NULL) @@ -51,13 +69,13 @@ if (IsEqualGUID(riid, &IID_IUnknown) || IsEqualGUID(riid, &IID_ITask)) { - *ppvObject = &This->lpVtbl; + *ppvObject = &This->ITask_iface; ITask_AddRef(iface); return S_OK; } else if (IsEqualGUID(riid, &IID_IPersistFile)) { - *ppvObject = &This->persistVtbl; + *ppvObject = &This->IPersistFile_iface; ITask_AddRef(iface); return S_OK; } @@ -70,7 +88,7 @@ static ULONG WINAPI MSTASK_ITask_AddRef( ITask* iface) { - TaskImpl *This = (TaskImpl *)iface; + TaskImpl *This = impl_from_ITask(iface); ULONG ref; TRACE("\n"); ref = InterlockedIncrement(&This->ref); @@ -80,7 +98,7 @@ static ULONG WINAPI MSTASK_ITask_Release( ITask* iface) { - TaskImpl * This = (TaskImpl *)iface; + TaskImpl * This = impl_from_ITask(iface); ULONG ref; TRACE("\n"); ref = InterlockedDecrement(&This->ref); @@ -222,7 +240,7 @@ LPCWSTR pwszComment) { DWORD n; - TaskImpl *This = (TaskImpl *)iface; + TaskImpl *This = impl_from_ITask(iface); LPWSTR tmp_comment; TRACE("(%p, %s)\n", iface, debugstr_w(pwszComment)); @@ -252,7 +270,7 @@ LPWSTR *ppwszComment) { DWORD n; - TaskImpl *This = (TaskImpl *)iface; + TaskImpl *This = impl_from_ITask(iface); TRACE("(%p, %p)\n", iface, ppwszComment); @@ -357,7 +375,7 @@ LPCWSTR pwszPassword) { DWORD n; - TaskImpl *This = (TaskImpl *)iface; + TaskImpl *This = impl_from_ITask(iface); LPWSTR tmp_account_name; TRACE("(%p, %s, %s): partial stub\n", iface, debugstr_w(pwszAccountName), @@ -381,7 +399,7 @@ LPWSTR *ppwszAccountName) { DWORD n; - TaskImpl *This = (TaskImpl *)iface; + TaskImpl *This = impl_from_ITask(iface); TRACE("(%p, %p): partial stub\n", iface, ppwszAccountName); @@ -403,7 +421,7 @@ LPCWSTR pwszApplicationName) { DWORD n; - TaskImpl *This = (TaskImpl *)iface; + TaskImpl *This = impl_from_ITask(iface); LPWSTR tmp_name; TRACE("(%p, %s)\n", iface, debugstr_w(pwszApplicationName)); @@ -450,7 +468,7 @@ LPWSTR *ppwszApplicationName) { DWORD n; - TaskImpl *This = (TaskImpl *)iface; + TaskImpl *This = impl_from_ITask(iface); TRACE("(%p, %p)\n", iface, ppwszApplicationName); @@ -472,7 +490,7 @@ LPCWSTR pwszParameters) { DWORD n; - TaskImpl *This = (TaskImpl *)iface; + TaskImpl *This = impl_from_ITask(iface); LPWSTR tmp_parameters; TRACE("(%p, %s)\n", iface, debugstr_w(pwszParameters)); @@ -501,7 +519,7 @@ LPWSTR *ppwszParameters) { DWORD n; - TaskImpl *This = (TaskImpl *)iface; + TaskImpl *This = impl_from_ITask(iface); TRACE("(%p, %p)\n", iface, ppwszParameters); @@ -570,7 +588,7 @@ ITask* iface, DWORD dwMaxRunTime) { - TaskImpl *This = (TaskImpl *)iface; + TaskImpl *This = impl_from_ITask(iface); TRACE("(%p, %d)\n", iface, dwMaxRunTime); @@ -582,7 +600,7 @@ ITask* iface, DWORD *pdwMaxRunTime) { - TaskImpl *This = (TaskImpl *)iface; + TaskImpl *This = impl_from_ITask(iface); TRACE("(%p, %p)\n", iface, pdwMaxRunTime); @@ -597,7 +615,7 @@ { TaskImpl *This = impl_from_IPersistFile(iface); TRACE("(%p, %s, %p)\n", iface, debugstr_guid(riid), ppvObject); - return ITask_QueryInterface((ITask *) This, riid, ppvObject); + return ITask_QueryInterface(&This->ITask_iface, riid, ppvObject); } static ULONG WINAPI MSTASK_IPersistFile_AddRef( @@ -746,8 +764,8 @@ if (!This) return E_OUTOFMEMORY; - This->lpVtbl = &MSTASK_ITaskVtbl; - This->persistVtbl = &MSTASK_IPersistFileVtbl; + This->ITask_iface.lpVtbl = &MSTASK_ITaskVtbl; + This->IPersistFile_iface.lpVtbl = &MSTASK_IPersistFileVtbl; This->ref = 1; n = (lstrlenW(pwszTaskName) + 1) * sizeof(WCHAR); This->taskName = HeapAlloc(GetProcessHeap(), 0, n); @@ -765,7 +783,7 @@ /* Default time is 3 days = 259200000 ms */ This->maxRunTime = 259200000; - *ppObj = &This->lpVtbl; + *ppObj = &This->ITask_iface; InterlockedIncrement(&dll_ref); return S_OK; } Modified: trunk/reactos/dll/win32/mstask/task_scheduler.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mstask/task_sche…
============================================================================== --- trunk/reactos/dll/win32/mstask/task_scheduler.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/mstask/task_scheduler.c [iso-8859-1] Fri Jan 27 18:48:31 2012 @@ -22,6 +22,17 @@ WINE_DEFAULT_DEBUG_CHANNEL(mstask); +typedef struct +{ + ITaskScheduler ITaskScheduler_iface; + LONG ref; +} TaskSchedulerImpl; + +static inline TaskSchedulerImpl *impl_from_ITaskScheduler(ITaskScheduler *iface) +{ + return CONTAINING_RECORD(iface, TaskSchedulerImpl, ITaskScheduler_iface); +} + static void TaskSchedulerDestructor(TaskSchedulerImpl *This) { TRACE("%p\n", This); @@ -34,14 +45,14 @@ REFIID riid, void **ppvObject) { - TaskSchedulerImpl * This = (TaskSchedulerImpl *)iface; + TaskSchedulerImpl * This = impl_from_ITaskScheduler(iface); TRACE("IID: %s\n", debugstr_guid(riid)); if (IsEqualGUID(riid, &IID_IUnknown) || IsEqualGUID(riid, &IID_ITaskScheduler)) { - *ppvObject = &This->lpVtbl; + *ppvObject = &This->ITaskScheduler_iface; ITaskScheduler_AddRef(iface); return S_OK; } @@ -53,7 +64,7 @@ static ULONG WINAPI MSTASK_ITaskScheduler_AddRef( ITaskScheduler* iface) { - TaskSchedulerImpl *This = (TaskSchedulerImpl *)iface; + TaskSchedulerImpl *This = impl_from_ITaskScheduler(iface); TRACE("\n"); return InterlockedIncrement(&This->ref); } @@ -61,7 +72,7 @@ static ULONG WINAPI MSTASK_ITaskScheduler_Release( ITaskScheduler* iface) { - TaskSchedulerImpl * This = (TaskSchedulerImpl *)iface; + TaskSchedulerImpl * This = impl_from_ITaskScheduler(iface); ULONG ref; TRACE("\n"); ref = InterlockedDecrement(&This->ref); @@ -178,10 +189,10 @@ if (!This) return E_OUTOFMEMORY; - This->lpVtbl = &MSTASK_ITaskSchedulerVtbl; + This->ITaskScheduler_iface.lpVtbl = &MSTASK_ITaskSchedulerVtbl; This->ref = 1; - *ppObj = &This->lpVtbl; + *ppObj = &This->ITaskScheduler_iface; InterlockedIncrement(&dll_ref); return S_OK; } Modified: trunk/reactos/dll/win32/mstask/task_trigger.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mstask/task_trig…
============================================================================== --- trunk/reactos/dll/win32/mstask/task_trigger.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/mstask/task_trigger.c [iso-8859-1] Fri Jan 27 18:48:31 2012 @@ -23,12 +23,24 @@ WINE_DEFAULT_DEBUG_CHANNEL(mstask); +typedef struct +{ + ITaskTrigger ITaskTrigger_iface; + LONG ref; + TASK_TRIGGER triggerCond; +} TaskTriggerImpl; + +static inline TaskTriggerImpl *impl_from_ITaskTrigger(ITaskTrigger *iface) +{ + return CONTAINING_RECORD(iface, TaskTriggerImpl, ITaskTrigger_iface); +} + static HRESULT WINAPI MSTASK_ITaskTrigger_QueryInterface( ITaskTrigger* iface, REFIID riid, void **ppvObject) { - TaskTriggerImpl *This = (TaskTriggerImpl *)iface; + TaskTriggerImpl *This = impl_from_ITaskTrigger(iface); TRACE("IID: %s\n", debugstr_guid(riid)); if (ppvObject == NULL) @@ -37,7 +49,7 @@ if (IsEqualGUID(riid, &IID_IUnknown) || IsEqualGUID(riid, &IID_ITaskTrigger)) { - *ppvObject = &This->lpVtbl; + *ppvObject = &This->ITaskTrigger_iface; ITaskTrigger_AddRef(iface); return S_OK; } @@ -50,7 +62,7 @@ static ULONG WINAPI MSTASK_ITaskTrigger_AddRef( ITaskTrigger* iface) { - TaskTriggerImpl *This = (TaskTriggerImpl *)iface; + TaskTriggerImpl *This = impl_from_ITaskTrigger(iface); ULONG ref; TRACE("\n"); ref = InterlockedIncrement(&This->ref); @@ -60,7 +72,7 @@ static ULONG WINAPI MSTASK_ITaskTrigger_Release( ITaskTrigger* iface) { - TaskTriggerImpl *This = (TaskTriggerImpl *)iface; + TaskTriggerImpl *This = impl_from_ITaskTrigger(iface); ULONG ref; TRACE("\n"); ref = InterlockedDecrement(&This->ref); @@ -76,7 +88,7 @@ ITaskTrigger* iface, const PTASK_TRIGGER pTrigger) { - TaskTriggerImpl * This = (TaskTriggerImpl *)iface; + TaskTriggerImpl * This = impl_from_ITaskTrigger(iface); TIME_FIELDS field_time; LARGE_INTEGER sys_time; TASK_TRIGGER tmp_trigger_cond; @@ -187,7 +199,7 @@ ITaskTrigger* iface, PTASK_TRIGGER pTrigger) { - TaskTriggerImpl * This = (TaskTriggerImpl *)iface; + TaskTriggerImpl * This = impl_from_ITaskTrigger(iface); TRACE("(%p, %p)\n", iface, pTrigger); @@ -274,7 +286,7 @@ if (!This) return E_OUTOFMEMORY; - This->lpVtbl = &MSTASK_ITaskTriggerVtbl; + This->ITaskTrigger_iface.lpVtbl = &MSTASK_ITaskTriggerVtbl; This->ref = 1; /* Most fields of triggerCond default to zero. Initialize other @@ -291,7 +303,7 @@ This->triggerCond.TriggerType = TASK_TIME_TRIGGER_DAILY, This->triggerCond.Type.Daily.DaysInterval = 1; - *ppObj = &This->lpVtbl; + *ppObj = &This->ITaskTrigger_iface; InterlockedIncrement(&dll_ref); return S_OK; } Modified: trunk/reactos/media/doc/README.WINE URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=…
============================================================================== --- trunk/reactos/media/doc/README.WINE [iso-8859-1] (original) +++ trunk/reactos/media/doc/README.WINE [iso-8859-1] Fri Jan 27 18:48:31 2012 @@ -110,7 +110,7 @@ reactos/dll/win32/msrle32 # Autosync reactos/dll/win32/mssign32 # Autosync reactos/dll/win32/mssip32 # Autosync -reactos/dll/win32/mstask # Autosync +reactos/dll/win32/mstask # Synced to Wine-1.3.37 reactos/dll/win32/msvcrt20 # Autosync reactos/dll/win32/msvfw32 # Autosync reactos/dll/win32/msvidc32 # Autosync
12 years, 11 months
1
0
0
0
[akhaldi] 55256: [MOUNTMGR] * Fix build.
by akhaldi@svn.reactos.org
Author: akhaldi Date: Fri Jan 27 18:45:54 2012 New Revision: 55256 URL:
http://svn.reactos.org/svn/reactos?rev=55256&view=rev
Log: [MOUNTMGR] * Fix build. Modified: branches/usb-bringup-trunk/drivers/filters/mountmgr/CMakeLists.txt Modified: branches/usb-bringup-trunk/drivers/filters/mountmgr/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/branches/usb-bringup-trunk/drivers/filte…
============================================================================== --- branches/usb-bringup-trunk/drivers/filters/mountmgr/CMakeLists.txt [iso-8859-1] (original) +++ branches/usb-bringup-trunk/drivers/filters/mountmgr/CMakeLists.txt [iso-8859-1] Fri Jan 27 18:45:54 2012 @@ -10,10 +10,9 @@ mountmgr.rc) add_library(mountmgr SHARED ${SOURCE}) +target_link_libraries(mountmgr wdmguid ioevent) allow_warnings(mountmgr) set_module_type(mountmgr kernelmodedriver) add_importlibs(mountmgr ntoskrnl hal) - add_pch(mountmgr mntmgr.h) - #add_cd_file(TARGET mountmgr DESTINATION reactos/system32/drivers NO_CAB FOR all)
12 years, 11 months
1
0
0
0
[janderwald] 55255: [USBCCGP] - Use Function index than interface number. Fixes invalid hardware ids - Fix construction of compatible id - USB Audio device now installs on XP when usbccgp is used -...
by janderwald@svn.reactos.org
Author: janderwald Date: Fri Jan 27 18:33:41 2012 New Revision: 55255 URL:
http://svn.reactos.org/svn/reactos?rev=55255&view=rev
Log: [USBCCGP] - Use Function index than interface number. Fixes invalid hardware ids - Fix construction of compatible id - USB Audio device now installs on XP when usbccgp is used - Now asserts in sb-bringup-trunk\drivers\usb\usbccgp\pdo.c:343) PDO_Dispatch Function f not implemented, which is implemented next Modified: branches/usb-bringup-trunk/drivers/usb/usbccgp/function.c Modified: branches/usb-bringup-trunk/drivers/usb/usbccgp/function.c URL:
http://svn.reactos.org/svn/reactos/branches/usb-bringup-trunk/drivers/usb/u…
============================================================================== --- branches/usb-bringup-trunk/drivers/usb/usbccgp/function.c [iso-8859-1] (original) +++ branches/usb-bringup-trunk/drivers/usb/usbccgp/function.c [iso-8859-1] Fri Jan 27 18:33:41 2012 @@ -514,6 +514,7 @@ USBCCG_InitIdsWithInterfaceDescriptor( IN PFDO_DEVICE_EXTENSION FDODeviceExtension, IN PUSB_INTERFACE_DESCRIPTOR Descriptor, + IN ULONG FunctionIndex, OUT PUSBC_FUNCTION_DESCRIPTOR FunctionDescriptor) { ULONG Index; @@ -553,17 +554,16 @@ } - // // now init hardware id // Index = swprintf(Buffer, L"USB\\VID_%04x&PID_%04x&Rev_%04x&MI_%02x", FDODeviceExtension->DeviceDescriptor->idVendor, FDODeviceExtension->DeviceDescriptor->idProduct, FDODeviceExtension->DeviceDescriptor->bcdDevice, - Descriptor->bInterfaceNumber) + 1; + FunctionIndex) + 1; Index += swprintf(&Buffer[Index], L"USB\\VID_%04x&PID_%04x&MI_%02x", FDODeviceExtension->DeviceDescriptor->idVendor, FDODeviceExtension->DeviceDescriptor->idProduct, - Descriptor->bInterfaceNumber) + 1; + FunctionIndex) + 1; // allocate result buffer DescriptionBuffer = AllocateItem(NonPagedPool, (Index + 1) * sizeof(WCHAR)); @@ -581,13 +581,12 @@ FunctionDescriptor->HardwareId.Length = Index * sizeof(WCHAR); FunctionDescriptor->HardwareId.MaximumLength = (Index + 1) * sizeof(WCHAR); - // // now init the compatible id // Index = swprintf(Buffer, L"USB\\Class_%02x&SubClass_%02x&Prot_%02x", Descriptor->bInterfaceClass, Descriptor->bInterfaceSubClass, Descriptor->bInterfaceProtocol) + 1; - Index += swprintf(&Buffer[Index], L"USB\\Class_%04x&SubClass_%04x", Descriptor->bInterfaceClass, Descriptor->bInterfaceSubClass) + 1; - Index += swprintf(&Buffer[Index], L"USB\\Class_%04x", Descriptor->bInterfaceClass) + 1; + Index += swprintf(&Buffer[Index], L"USB\\Class_%02x&SubClass_%02x", Descriptor->bInterfaceClass, Descriptor->bInterfaceSubClass) + 1; + Index += swprintf(&Buffer[Index], L"USB\\Class_%02x", Descriptor->bInterfaceClass) + 1; // allocate result buffer DescriptionBuffer = AllocateItem(NonPagedPool, (Index + 1) * sizeof(WCHAR)); @@ -604,6 +603,11 @@ FunctionDescriptor->CompatibleId.Buffer = DescriptionBuffer; FunctionDescriptor->CompatibleId.Length = Index * sizeof(WCHAR); FunctionDescriptor->CompatibleId.MaximumLength = (Index + 1) * sizeof(WCHAR); + + // + // done + // + return STATUS_SUCCESS; } @@ -678,7 +682,7 @@ // // now init the device ids // - Status = USBCCG_InitIdsWithInterfaceDescriptor(FDODeviceExtension, InterfaceDescriptor, &FDODeviceExtension->FunctionDescriptor[Index]); + Status = USBCCG_InitIdsWithInterfaceDescriptor(FDODeviceExtension, InterfaceDescriptor, Index, &FDODeviceExtension->FunctionDescriptor[Index]); if (!NT_SUCCESS(Status)) { // @@ -803,7 +807,7 @@ // // now init the device ids // - Status = USBCCG_InitIdsWithInterfaceDescriptor(FDODeviceExtension, InterfaceDescriptor, &FDODeviceExtension->FunctionDescriptor[0]); + Status = USBCCG_InitIdsWithInterfaceDescriptor(FDODeviceExtension, FirstDescriptor, 0, &FDODeviceExtension->FunctionDescriptor[0]); if (!NT_SUCCESS(Status)) { //
12 years, 11 months
1
0
0
0
[jimtabor] 55254: [ComCtl32] - Partial sync to wine 1.3.37 without the ComCtl32 diff applied. This fixes the hangs and the exceptions during testing. Researching DrawFocusRect issues. Please Develo...
by jimtabor@svn.reactos.org
Author: jimtabor Date: Fri Jan 27 18:25:24 2012 New Revision: 55254 URL:
http://svn.reactos.org/svn/reactos?rev=55254&view=rev
Log: [ComCtl32] - Partial sync to wine 1.3.37 without the ComCtl32 diff applied. This fixes the hangs and the exceptions during testing. Researching DrawFocusRect issues. Please Developers, note any information for the diff other than what is posted on svn, also this is open to anyone to be synced. Removed: trunk/reactos/dll/win32/comctl32/imagelist.h Modified: trunk/reactos/dll/win32/comctl32/CMakeLists.txt trunk/reactos/dll/win32/comctl32/comctl32.rbuild trunk/reactos/dll/win32/comctl32/imagelist.c trunk/reactos/dll/win32/comctl32/propsheet.c trunk/reactos/dll/win32/comctl32/status.c Modified: trunk/reactos/dll/win32/comctl32/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comctl32/CMakeLi…
============================================================================== --- trunk/reactos/dll/win32/comctl32/CMakeLists.txt [iso-8859-1] (original) +++ trunk/reactos/dll/win32/comctl32/CMakeLists.txt [iso-8859-1] Fri Jan 27 18:25:24 2012 @@ -56,7 +56,7 @@ add_library(comctl32 SHARED ${SOURCE}) set_module_type(comctl32 win32dll UNICODE) -target_link_libraries(comctl32 uuid wine) +target_link_libraries(comctl32 uuid wine ${PSEH_LIB}) add_delay_importlibs(comctl32 winmm uxtheme) add_importlibs(comctl32 Modified: trunk/reactos/dll/win32/comctl32/comctl32.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comctl32/comctl3…
============================================================================== --- trunk/reactos/dll/win32/comctl32/comctl32.rbuild [iso-8859-1] (original) +++ trunk/reactos/dll/win32/comctl32/comctl32.rbuild [iso-8859-1] Fri Jan 27 18:25:24 2012 @@ -57,5 +57,6 @@ <library>winmm</library> <library>uxtheme</library> <library>ntdll</library> + <library>pseh</library> </module> </group> Modified: trunk/reactos/dll/win32/comctl32/imagelist.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comctl32/imageli…
============================================================================== --- trunk/reactos/dll/win32/comctl32/imagelist.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/comctl32/imagelist.c [iso-8859-1] Fri Jan 27 18:25:24 2012 @@ -52,13 +52,62 @@ #include "commctrl.h" #include "comctl32.h" #include "commoncontrols.h" -#include "imagelist.h" #include "wine/debug.h" +#include "wine/exception.h" WINE_DEFAULT_DEBUG_CHANNEL(imagelist); - #define MAX_OVERLAYIMAGE 15 + +struct _IMAGELIST +{ + const struct IImageListVtbl *lpVtbl; /* 00: IImageList vtable */ + + INT cCurImage; /* 04: ImageCount */ + INT cMaxImage; /* 08: maximages */ + INT cGrow; /* 0C: cGrow */ + INT cx; /* 10: cx */ + INT cy; /* 14: cy */ + DWORD x4; + UINT flags; /* 1C: flags */ + COLORREF clrFg; /* 20: foreground color */ + COLORREF clrBk; /* 24: background color */ + + + HBITMAP hbmImage; /* 28: images Bitmap */ + HBITMAP hbmMask; /* 2C: masks Bitmap */ + HDC hdcImage; /* 30: images MemDC */ + HDC hdcMask; /* 34: masks MemDC */ + INT nOvlIdx[MAX_OVERLAYIMAGE]; /* 38: overlay images index */ + + /* not yet found out */ + HBRUSH hbrBlend25; + HBRUSH hbrBlend50; + INT cInitial; + UINT uBitsPixel; + char *has_alpha; + + LONG ref; /* reference count */ +}; + +#define IMAGELIST_MAGIC 0x53414D58 + +/* Header used by ImageList_Read() and ImageList_Write() */ +#include "pshpack2.h" +typedef struct _ILHEAD +{ + USHORT usMagic; + USHORT usVersion; + WORD cCurImage; + WORD cMaxImage; + WORD cGrow; + WORD cx; + WORD cy; + COLORREF bkcolor; + WORD flags; + SHORT ovls[4]; +} ILHEAD; +#include "poppack.h" /* internal image list data used for Drag & Drop operations */ typedef struct @@ -113,6 +162,17 @@ sz->cy = imagelist_height( count ) * himl->cy; } +static inline int get_dib_stride( int width, int bpp ) +{ + return ((width * bpp + 31) >> 3) & ~3; +} + +static inline int get_dib_image_size( const BITMAPINFO *info ) +{ + return get_dib_stride( info->bmiHeader.biWidth, info->bmiHeader.biBitCount ) + * abs( info->bmiHeader.biHeight ); +} + /* * imagelist_copy_images() * @@ -135,6 +195,56 @@ BitBlt( hdcDest, ptDest.x, ptDest.y, sz.cx, sz.cy, hdcSrc, ptSrc.x, ptSrc.y, SRCCOPY ); + } +} + +static void add_dib_bits( HIMAGELIST himl, int pos, int count, int width, int height, + BITMAPINFO *info, BITMAPINFO *mask_info, DWORD *bits, BYTE *mask_bits ) +{ + int i, j, n; + POINT pt; + int stride = info->bmiHeader.biWidth; + int mask_stride = (info->bmiHeader.biWidth + 31) / 32 * 4; + + for (n = 0; n < count; n++) + { + int has_alpha = 0; + + imagelist_point_from_index( himl, pos + n, &pt ); + + /* check if bitmap has an alpha channel */ + for (i = 0; i < height && !has_alpha; i++) + for (j = n * width; j < (n + 1) * width; j++) + if ((has_alpha = ((bits[i * stride + j] & 0xff000000) != 0))) break; + + if (!has_alpha) /* generate alpha channel from the mask */ + { + for (i = 0; i < height; i++) + for (j = n * width; j < (n + 1) * width; j++) + if (!mask_info || !((mask_bits[i * mask_stride + j / 8] << (j % 8)) & 0x80)) + bits[i * stride + j] |= 0xff000000; + else + bits[i * stride + j] = 0; + } + else + { + himl->has_alpha[pos + n] = 1; + + if (mask_info && himl->hbmMask) /* generate the mask from the alpha channel */ + { + for (i = 0; i < height; i++) + for (j = n * width; j < (n + 1) * width; j++) + if ((bits[i * stride + j] >> 24) > 25) /* more than 10% alpha */ + mask_bits[i * mask_stride + j / 8] &= ~(0x80 >> (j % 8)); + else + mask_bits[i * mask_stride + j / 8] |= 0x80 >> (j % 8); + } + } + StretchDIBits( himl->hdcImage, pt.x, pt.y, himl->cx, himl->cy, + n * width, 0, width, height, bits, info, DIB_RGB_COLORS, SRCCOPY ); + if (mask_info) + StretchDIBits( himl->hdcMask, pt.x, pt.y, himl->cx, himl->cy, + n * width, 0, width, height, mask_bits, mask_info, DIB_RGB_COLORS, SRCCOPY ); } } @@ -147,8 +257,6 @@ BITMAPINFO *info, *mask_info = NULL; DWORD *bits = NULL; BYTE *mask_bits = NULL; - int i, j, n; - POINT pt; DWORD mask_width; if (!GetObjectW( hbmImage, sizeof(bm), &bm )) return FALSE; @@ -187,46 +295,7 @@ if (!GetDIBits( hdc, hbmMask, 0, height, mask_bits, mask_info, DIB_RGB_COLORS )) goto done; } - for (n = 0; n < count; n++) - { - int has_alpha = 0; - - imagelist_point_from_index( himl, pos + n, &pt ); - - /* check if bitmap has an alpha channel */ - for (i = 0; i < height && !has_alpha; i++) - for (j = n * width; j < (n + 1) * width; j++) - if ((has_alpha = ((bits[i * bm.bmWidth + j] & 0xff000000) != 0))) break; - - if (!has_alpha) /* generate alpha channel from the mask */ - { - for (i = 0; i < height; i++) - for (j = n * width; j < (n + 1) * width; j++) - if (!mask_bits || !((mask_bits[i * mask_width + j / 8] << (j % 8)) & 0x80)) - bits[i * bm.bmWidth + j] |= 0xff000000; - else - bits[i * bm.bmWidth + j] = 0; - } - else - { - himl->has_alpha[pos + n] = 1; - - if (mask_info && himl->hbmMask) /* generate the mask from the alpha channel */ - { - for (i = 0; i < height; i++) - for (j = n * width; j < (n + 1) * width; j++) - if ((bits[i * bm.bmWidth + j] >> 24) > 25) /* more than 10% alpha */ - mask_bits[i * mask_width + j / 8] &= ~(0x80 >> (j % 8)); - else - mask_bits[i * mask_width + j / 8] |= 0x80 >> (j % 8); - } - } - StretchDIBits( himl->hdcImage, pt.x, pt.y, himl->cx, himl->cy, - n * width, 0, width, height, bits, info, DIB_RGB_COLORS, SRCCOPY ); - if (mask_info) - StretchDIBits( himl->hdcMask, pt.x, pt.y, himl->cx, himl->cy, - n * width, 0, width, height, mask_bits, mask_info, DIB_RGB_COLORS, SRCCOPY ); - } + add_dib_bits( himl, pos, count, width, height, info, mask_info, bits, mask_bits ); ret = TRUE; done: @@ -473,8 +542,6 @@ bkColor = (clrMask != CLR_DEFAULT) ? clrMask : GetPixel (hdcBitmap, 0, 0); SetBkColor (hdcBitmap, bkColor); BitBlt (hdcMask, 0, 0, bmp.bmWidth, bmp.bmHeight, hdcBitmap, 0, 0, SRCCOPY); - - SetBkColor(hdcBitmap, RGB(255,255,255)); /* * Remove the background from the image @@ -489,7 +556,11 @@ * * Blt mode 0x220326 is NOTSRCAND */ - BitBlt(hdcBitmap, 0, 0, bmp.bmWidth, bmp.bmHeight, hdcMask, 0, 0, 0x220326); + if (bmp.bmBitsPixel > 8) /* NOTSRCAND can't work with palettes */ + { + SetBkColor(hdcBitmap, RGB(255,255,255)); + BitBlt(hdcBitmap, 0, 0, bmp.bmWidth, bmp.bmHeight, hdcMask, 0, 0, 0x220326); + } DeleteDC(hdcBitmap); DeleteDC(hdcMask); @@ -700,7 +771,14 @@ if (FAILED(ImageListImpl_CreateInstance(NULL, &IID_IImageList, (void **)&himl))) return NULL; - cGrow = (cGrow < 4) ? 4 : (cGrow + 3) & ~3; + cGrow = (WORD)((max( cGrow, 1 ) + 3) & ~3); + + if (cGrow > 256) + { + /* Windows doesn't limit the size here, but X11 doesn't let us allocate such huge bitmaps */ + WARN( "grow %d too large, limiting to 256\n", cGrow ); + cGrow = 256; + } himl->cx = cx; himl->cy = cy; @@ -727,7 +805,10 @@ /* Default to ILC_COLOR4 if none of the ILC_COLOR* flags are specified */ if (ilc == ILC_COLOR) + { ilc = ILC_COLOR4; + himl->flags |= ILC_COLOR4; + } if (ilc >= ILC_COLOR4 && ilc <= ILC_COLOR32) himl->uBitsPixel = ilc; @@ -1225,6 +1306,14 @@ /* generate alpha channel from the mask */ info->bmiHeader.biBitCount = 1; info->bmiHeader.biSizeImage = width_bytes * cy; + info->bmiColors[0].rgbRed = 0; + info->bmiColors[0].rgbGreen = 0; + info->bmiColors[0].rgbBlue = 0; + info->bmiColors[0].rgbReserved = 0; + info->bmiColors[1].rgbRed = 0xff; + info->bmiColors[1].rgbGreen = 0xff; + info->bmiColors[1].rgbBlue = 0xff; + info->bmiColors[1].rgbReserved = 0; if (!(mask = CreateDIBSection( himl->hdcMask, info, DIB_RGB_COLORS, &mask_bits, 0, 0 ))) goto done; SelectObject( hdc, mask ); @@ -2060,66 +2149,24 @@ } -/*********************************************************************** - * DIB_GetDIBWidthBytes - * - * Return the width of a DIB bitmap in bytes. DIB bitmap data is 32-bit aligned. - */ -static int DIB_GetDIBWidthBytes( int width, int depth ) -{ - int words; - - switch(depth) - { - case 1: words = (width + 31) / 32; break; - case 4: words = (width + 7) / 8; break; - case 8: words = (width + 3) / 4; break; - case 15: - case 16: words = (width + 1) / 2; break; - case 24: words = (width * 3 + 3)/4; break; - - default: - WARN("(%d): Unsupported depth\n", depth ); - /* fall through */ - case 32: - words = width; - break; - } - return 4 * words; -} - -/*********************************************************************** - * DIB_GetDIBImageBytes - * - * Return the number of bytes used to hold the image in a DIB bitmap. - */ -static int DIB_GetDIBImageBytes( int width, int height, int depth ) -{ - return DIB_GetDIBWidthBytes( width, depth ) * abs( height ); -} - - /* helper for ImageList_Read, see comments below */ -static BOOL _read_bitmap(HDC hdcIml, LPSTREAM pstm) +static void *read_bitmap(LPSTREAM pstm, BITMAPINFO *bmi) { BITMAPFILEHEADER bmfh; int bitsperpixel, palspace; - char bmi_buf[sizeof(BITMAPINFOHEADER) + sizeof(RGBQUAD) * 256]; - LPBITMAPINFO bmi = (LPBITMAPINFO)bmi_buf; - int result = FALSE; - LPBYTE bits = NULL; + void *bits; if (FAILED(IStream_Read ( pstm, &bmfh, sizeof(bmfh), NULL))) - return FALSE; + return NULL; if (bmfh.bfType != (('M'<<8)|'B')) - return FALSE; + return NULL; if (FAILED(IStream_Read ( pstm, &bmi->bmiHeader, sizeof(bmi->bmiHeader), NULL))) - return FALSE; + return NULL; if ((bmi->bmiHeader.biSize != sizeof(bmi->bmiHeader))) - return FALSE; + return NULL; TRACE("width %u, height %u, planes %u, bpp %u\n", bmi->bmiHeader.biWidth, bmi->bmiHeader.biHeight, @@ -2131,27 +2178,21 @@ else palspace = 0; - bmi->bmiHeader.biSizeImage = DIB_GetDIBImageBytes(bmi->bmiHeader.biWidth, bmi->bmiHeader.biHeight, bitsperpixel); + bmi->bmiHeader.biSizeImage = get_dib_image_size( bmi ); /* read the palette right after the end of the bitmapinfoheader */ if (palspace && FAILED(IStream_Read(pstm, bmi->bmiColors, palspace, NULL))) - goto error; + return NULL; bits = Alloc(bmi->bmiHeader.biSizeImage); - if (!bits) - goto error; + if (!bits) return NULL; + if (FAILED(IStream_Read(pstm, bits, bmi->bmiHeader.biSizeImage, NULL))) - goto error; - - if (!StretchDIBits(hdcIml, 0, 0, bmi->bmiHeader.biWidth, bmi->bmiHeader.biHeight, - 0, 0, bmi->bmiHeader.biWidth, bmi->bmiHeader.biHeight, - bits, bmi, DIB_RGB_COLORS, SRCCOPY)) - goto error; - result = TRUE; - -error: - Free(bits); - return result; + { + Free(bits); + return NULL; + } + return bits; } /************************************************************************* @@ -2187,6 +2228,11 @@ */ HIMAGELIST WINAPI ImageList_Read (LPSTREAM pstm) { + char image_buf[sizeof(BITMAPINFOHEADER) + sizeof(RGBQUAD) * 256]; + char mask_buf[sizeof(BITMAPINFOHEADER) + sizeof(RGBQUAD) * 256]; + BITMAPINFO *image_info = (BITMAPINFO *)image_buf; + BITMAPINFO *mask_info = (BITMAPINFO *)mask_buf; + void *image_bits, *mask_bits = NULL; ILHEAD ilHead; HIMAGELIST himl; int i; @@ -2207,19 +2253,56 @@ if (!himl) return NULL; - if (!_read_bitmap(himl->hdcImage, pstm)) + if (!(image_bits = read_bitmap(pstm, image_info))) { WARN("failed to read bitmap from stream\n"); return NULL; } if (ilHead.flags & ILC_MASK) { - if (!_read_bitmap(himl->hdcMask, pstm)) + if (!(mask_bits = read_bitmap(pstm, mask_info))) { WARN("failed to read mask bitmap from stream\n"); return NULL; } } + else mask_info = NULL; + + if (himl->has_alpha && image_info->bmiHeader.biBitCount == 32) + { + DWORD *ptr = image_bits; + BYTE *mask_ptr = mask_bits; + int stride = himl->cy * image_info->bmiHeader.biWidth; + + if (image_info->bmiHeader.biHeight > 0) /* bottom-up */ + { + ptr += image_info->bmiHeader.biHeight * image_info->bmiHeader.biWidth - stride; + mask_ptr += (image_info->bmiHeader.biHeight * image_info->bmiHeader.biWidth - stride) / 8; + stride = -stride; + image_info->bmiHeader.biHeight = himl->cy; + } + else image_info->bmiHeader.biHeight = -himl->cy; + + for (i = 0; i < ilHead.cCurImage; i += TILE_COUNT) + { + add_dib_bits( himl, i, min( ilHead.cCurImage - i, TILE_COUNT ), + himl->cx, himl->cy, image_info, mask_info, ptr, mask_ptr ); + ptr += stride; + mask_ptr += stride / 8; + } + } + else + { + StretchDIBits( himl->hdcImage, 0, 0, image_info->bmiHeader.biWidth, image_info->bmiHeader.biHeight, + 0, 0, image_info->bmiHeader.biWidth, image_info->bmiHeader.biHeight, + image_bits, image_info, DIB_RGB_COLORS, SRCCOPY); + if (mask_info) + StretchDIBits( himl->hdcMask, 0, 0, mask_info->bmiHeader.biWidth, mask_info->bmiHeader.biHeight, + 0, 0, mask_info->bmiHeader.biWidth, mask_info->bmiHeader.biHeight, + mask_bits, mask_info, DIB_RGB_COLORS, SRCCOPY); + } + Free( image_bits ); + Free( mask_bits ); himl->cCurImage = ilHead.cCurImage; himl->cMaxImage = ilHead.cMaxImage; @@ -2276,7 +2359,7 @@ return TRUE; } - himl->cMaxImage = himl->cInitial + himl->cGrow - 1; + himl->cMaxImage = himl->cGrow; himl->cCurImage = 0; for (nCount = 0; nCount < MAX_OVERLAYIMAGE; nCount++) himl->nOvlIdx[nCount] = -1; @@ -2455,7 +2538,6 @@ INT WINAPI ImageList_ReplaceIcon (HIMAGELIST himl, INT nIndex, HICON hIcon) { - HDC hdcImage; HICON hBestFitIcon; ICONINFO ii; BITMAP bmp; @@ -2487,38 +2569,19 @@ if (!hBestFitIcon) return -1; - ret = GetIconInfo (hBestFitIcon, &ii); - if (!ret) { - DestroyIcon(hBestFitIcon); - return -1; - } - - ret = GetObjectW (ii.hbmMask, sizeof(BITMAP), &bmp); - if (!ret) { - ERR("couldn't get mask bitmap info\n"); - if (ii.hbmColor) - DeleteObject (ii.hbmColor); - if (ii.hbmMask) - DeleteObject (ii.hbmMask); - DestroyIcon(hBestFitIcon); - return -1; - } - if (nIndex == -1) { - if (himl->cCurImage + 1 > himl->cMaxImage) + if (himl->cCurImage + 1 >= himl->cMaxImage) IMAGELIST_InternalExpandBitmaps(himl, 1); nIndex = himl->cCurImage; himl->cCurImage++; } - hdcImage = CreateCompatibleDC (0); - TRACE("hdcImage=%p\n", hdcImage); - if (hdcImage == 0) - ERR("invalid hdcImage!\n"); - - if (himl->has_alpha) - { + if (himl->has_alpha && GetIconInfo (hBestFitIcon, &ii)) + { + HDC hdcImage = CreateCompatibleDC( 0 ); + GetObjectW (ii.hbmMask, sizeof(BITMAP), &bmp); + if (!ii.hbmColor) { UINT height = bmp.bmHeight / 2; @@ -2530,48 +2593,38 @@ ret = add_with_alpha( himl, hdcImage, nIndex, 1, bmp.bmWidth, height, color, ii.hbmMask ); DeleteDC( hdcMask ); DeleteObject( color ); - if (ret) goto done; } - else if (add_with_alpha( himl, hdcImage, nIndex, 1, bmp.bmWidth, bmp.bmHeight, - ii.hbmColor, ii.hbmMask )) goto done; + else ret = add_with_alpha( himl, hdcImage, nIndex, 1, bmp.bmWidth, bmp.bmHeight, + ii.hbmColor, ii.hbmMask ); + + DeleteDC( hdcImage ); + DeleteObject (ii.hbmMask); + if (ii.hbmColor) DeleteObject (ii.hbmColor); + if (ret) goto done; } imagelist_point_from_index(himl, nIndex, &pt); - SetTextColor(himl->hdcImage, RGB(0,0,0)); - SetBkColor (himl->hdcImage, RGB(255,255,255)); - - if (ii.hbmColor) - { - SelectObject (hdcImage, ii.hbmColor); - StretchBlt (himl->hdcImage, pt.x, pt.y, himl->cx, himl->cy, - hdcImage, 0, 0, bmp.bmWidth, bmp.bmHeight, SRCCOPY); - if (himl->hbmMask) - { - SelectObject (hdcImage, ii.hbmMask); - StretchBlt (himl->hdcMask, pt.x, pt.y, himl->cx, himl->cy, - hdcImage, 0, 0, bmp.bmWidth, bmp.bmHeight, SRCCOPY); - } + if (himl->hbmMask) + { + DrawIconEx( himl->hdcImage, pt.x, pt.y, hBestFitIcon, himl->cx, himl->cy, 0, 0, DI_IMAGE ); + PatBlt( himl->hdcMask, pt.x, pt.y, himl->cx, himl->cy, WHITENESS ); + DrawIconEx( himl->hdcMask, pt.x, pt.y, hBestFitIcon, himl->cx, himl->cy, 0, 0, DI_MASK ); } else { - UINT height = bmp.bmHeight / 2; - SelectObject (hdcImage, ii.hbmMask); - StretchBlt (himl->hdcImage, pt.x, pt.y, himl->cx, himl->cy, - hdcImage, 0, height, bmp.bmWidth, height, SRCCOPY); - if (himl->hbmMask) - StretchBlt (himl->hdcMask, pt.x, pt.y, himl->cx, himl->cy, - hdcImage, 0, 0, bmp.bmWidth, height, SRCCOPY); + COLORREF color = himl->clrBk != CLR_NONE ? himl->clrBk : comctl32_color.clrWindow; + HBRUSH brush = CreateSolidBrush( GetNearestColor( himl->hdcImage, color )); + + SelectObject( himl->hdcImage, brush ); + PatBlt( himl->hdcImage, pt.x, pt.y, himl->cx, himl->cy, PATCOPY ); + SelectObject( himl->hdcImage, GetStockObject(BLACK_BRUSH) ); + DeleteObject( brush ); + DrawIconEx( himl->hdcImage, pt.x, pt.y, hBestFitIcon, himl->cx, himl->cy, 0, 0, DI_NORMAL ); } done: DestroyIcon(hBestFitIcon); - if (hdcImage) - DeleteDC (hdcImage); - if (ii.hbmColor) - DeleteObject (ii.hbmColor); - if (ii.hbmMask) - DeleteObject (ii.hbmMask); TRACE("Insert index = %d, himl->cCurImage = %d\n", nIndex, himl->cCurImage); return nIndex; @@ -2802,14 +2855,8 @@ if (!is_valid(himl)) return FALSE; - if (himl->cMaxImage > iImageCount) - { - himl->cCurImage = iImageCount; - /* TODO: shrink the bitmap when cMaxImage-cCurImage>cGrow ? */ - return TRUE; - } - - nNewCount = iImageCount + himl->cGrow; + + nNewCount = iImageCount + 1; nCopyCount = min(himl->cCurImage, iImageCount); hdcBitmap = CreateCompatibleDC (0); @@ -2920,11 +2967,11 @@ if (!GetObjectW(hBitmap, sizeof(BITMAP), &bm)) return FALSE; - bitCount = bm.bmBitsPixel == 1 ? 1 : 24; - sizeImage = DIB_GetDIBImageBytes(bm.bmWidth, bm.bmHeight, bitCount); + bitCount = bm.bmBitsPixel; + sizeImage = get_dib_stride(bm.bmWidth, bitCount) * bm.bmHeight; totalSize = sizeof(BITMAPFILEHEADER) + sizeof(BITMAPINFOHEADER); - if(bitCount != 24) + if(bitCount <= 8) totalSize += (1 << bitCount) * sizeof(RGBQUAD); offBits = totalSize; totalSize += sizeImage; @@ -2964,13 +3011,6 @@ bmih->biWidth, bmih->biHeight, bmih->biPlanes, bmih->biBitCount); - if(bitCount == 1) { - /* Hack. */ - LPBITMAPINFO inf = (LPBITMAPINFO)bmih; - inf->bmiColors[0].rgbRed = inf->bmiColors[0].rgbGreen = inf->bmiColors[0].rgbBlue = 0; - inf->bmiColors[1].rgbRed = inf->bmiColors[1].rgbGreen = inf->bmiColors[1].rgbBlue = 0xff; - } - if(FAILED(IStream_Write(pstm, data, totalSize, NULL))) goto failed; @@ -3054,54 +3094,28 @@ if ((ilc >= ILC_COLOR4 && ilc <= ILC_COLOR32) || ilc == ILC_COLOR) { - VOID* bits; - BITMAPINFO *bmi; + char buffer[FIELD_OFFSET( BITMAPINFO, bmiColors[256] )]; + BITMAPINFO *bmi = (BITMAPINFO *)buffer; TRACE("Creating DIBSection %d x %d, %d Bits per Pixel\n", sz.cx, sz.cy, himl->uBitsPixel); - if (himl->uBitsPixel <= ILC_COLOR8) - { - LPPALETTEENTRY pal; - ULONG i, colors; - BYTE temp; - - colors = 1 << himl->uBitsPixel; - bmi = Alloc(sizeof(BITMAPINFOHEADER) + - sizeof(PALETTEENTRY) * colors); - - pal = (LPPALETTEENTRY)bmi->bmiColors; - GetPaletteEntries(GetStockObject(DEFAULT_PALETTE), 0, colors, pal); - - /* Swap colors returned by GetPaletteEntries so we can use them for - * CreateDIBSection call. */ - for (i = 0; i < colors; i++) - { - temp = pal[i].peBlue; - bmi->bmiColors[i].rgbRed = pal[i].peRed; - bmi->bmiColors[i].rgbBlue = temp; - } - } - else - { - bmi = Alloc(sizeof(BITMAPINFOHEADER)); - } - + memset( buffer, 0, sizeof(buffer) ); bmi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); bmi->bmiHeader.biWidth = sz.cx; bmi->bmiHeader.biHeight = sz.cy; bmi->bmiHeader.biPlanes = 1; bmi->bmiHeader.biBitCount = himl->uBitsPixel; bmi->bmiHeader.biCompression = BI_RGB; - bmi->bmiHeader.biSizeImage = 0; - bmi->bmiHeader.biXPelsPerMeter = 0; - bmi->bmiHeader.biYPelsPerMeter = 0; - bmi->bmiHeader.biClrUsed = 0; - bmi->bmiHeader.biClrImportant = 0; - - hbmNewBitmap = CreateDIBSection(hdc, bmi, DIB_RGB_COLORS, &bits, 0, 0); - - Free (bmi); + + if (himl->uBitsPixel <= ILC_COLOR8) + { + /* retrieve the default color map */ + HBITMAP tmp = CreateBitmap( 1, 1, 1, 1, NULL ); + GetDIBits( hdc, tmp, 0, 0, NULL, bmi, DIB_RGB_COLORS ); + DeleteObject( tmp ); + } + hbmNewBitmap = CreateDIBSection(hdc, bmi, DIB_RGB_COLORS, NULL, 0, 0); } else /*if (ilc == ILC_COLORDDB)*/ { @@ -3613,9 +3627,19 @@ ImageListImpl_GetOverlayImage }; -static inline BOOL is_valid(HIMAGELIST himl) -{ - return himl && himl->lpVtbl == &ImageListImpl_Vtbl; +static BOOL is_valid(HIMAGELIST himl) +{ + BOOL valid; + __TRY + { + valid = himl && himl->lpVtbl == &ImageListImpl_Vtbl; + } + __EXCEPT_PAGE_FAULT + { + valid = FALSE; + } + __ENDTRY + return valid; } /************************************************************************* Removed: trunk/reactos/dll/win32/comctl32/imagelist.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comctl32/imageli…
============================================================================== --- trunk/reactos/dll/win32/comctl32/imagelist.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/comctl32/imagelist.h (removed) @@ -1,80 +1,0 @@ -/* - * ImageList definitions - * - * Copyright 1998 Eric Kohl - * - * 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_IMAGELIST_H -#define __WINE_IMAGELIST_H - -#include <stdarg.h> - -#include "windef.h" -#include "winbase.h" -#include "wingdi.h" - -struct _IMAGELIST -{ - const struct IImageListVtbl *lpVtbl; /* 00: IImageList vtable */ - - INT cCurImage; /* 04: ImageCount */ - INT cMaxImage; /* 08: maximages */ - INT cGrow; /* 0C: cGrow */ - INT cx; /* 10: cx */ - INT cy; /* 14: cy */ - DWORD x4; - UINT flags; /* 1C: flags */ - COLORREF clrFg; /* 20: foreground color */ - COLORREF clrBk; /* 24: background color */ - - - HBITMAP hbmImage; /* 28: images Bitmap */ - HBITMAP hbmMask; /* 2C: masks Bitmap */ - HDC hdcImage; /* 30: images MemDC */ - HDC hdcMask; /* 34: masks MemDC */ - INT nOvlIdx[15]; /* 38: overlay images index */ - - /* not yet found out */ - HBRUSH hbrBlend25; - HBRUSH hbrBlend50; - INT cInitial; - UINT uBitsPixel; - char *has_alpha; - - LONG ref; /* reference count */ -}; - -#define IMAGELIST_MAGIC 0x53414D58 - -/* Header used by ImageList_Read() and ImageList_Write() */ -#include "pshpack2.h" -typedef struct _ILHEAD -{ - USHORT usMagic; - USHORT usVersion; - WORD cCurImage; - WORD cMaxImage; - WORD cGrow; - WORD cx; - WORD cy; - COLORREF bkcolor; - WORD flags; - SHORT ovls[4]; -} ILHEAD; -#include "poppack.h" - -#endif /* __WINE_IMAGELIST_H */ Modified: trunk/reactos/dll/win32/comctl32/propsheet.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comctl32/propshe…
============================================================================== --- trunk/reactos/dll/win32/comctl32/propsheet.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/comctl32/propsheet.c [iso-8859-1] Fri Jan 27 18:25:24 2012 @@ -543,7 +543,6 @@ /* Extract the caption */ psInfo->proppage[index].pszText = p; TRACE("Tab %d %s\n",index,debugstr_w( p )); - p += lstrlenW( p ) + 1; if (dwFlags & PSP_USETITLE) { @@ -2412,28 +2411,6 @@ return FALSE; } -BOOL CALLBACK -EnumChildProc(HWND hwnd, LPARAM lParam) -{ - WCHAR szType[20]; - RealGetWindowClassW(hwnd, szType, 20); - - if (strcmpW(szType, WC_EDITW) == 0) - { - if (IsWindowEnabled(hwnd) && IsWindowVisible(hwnd)) - { - SetFocus(hwnd); - return FALSE; - } - } - else - { - EnumChildWindows(hwnd, EnumChildProc, 0); - } - - return TRUE; -} - /****************************************************************************** * PROPSHEET_SetWizButtons * @@ -2454,6 +2431,17 @@ EnableWindow(hwndBack, FALSE); EnableWindow(hwndNext, FALSE); EnableWindow(hwndFinish, FALSE); + + /* set the default pushbutton to an enabled button */ + if (((dwFlags & PSWIZB_FINISH) || psInfo->hasFinish) && !(dwFlags & PSWIZB_DISABLEDFINISH)) + SendMessageW(hwndDlg, DM_SETDEFID, IDC_FINISH_BUTTON, 0); + else if (dwFlags & PSWIZB_NEXT) + SendMessageW(hwndDlg, DM_SETDEFID, IDC_NEXT_BUTTON, 0); + else if (dwFlags & PSWIZB_BACK) + SendMessageW(hwndDlg, DM_SETDEFID, IDC_BACK_BUTTON, 0); + else + SendMessageW(hwndDlg, DM_SETDEFID, IDCANCEL, 0); + if (dwFlags & PSWIZB_BACK) EnableWindow(hwndBack, TRUE); @@ -2484,31 +2472,6 @@ } else if (!(dwFlags & PSWIZB_DISABLEDFINISH)) EnableWindow(hwndFinish, TRUE); - - /* set the default pushbutton to an enabled button and give it focus */ - if (((dwFlags & PSWIZB_FINISH) || psInfo->hasFinish) && !(dwFlags & PSWIZB_DISABLEDFINISH)) - { - SendMessageW(hwndDlg, DM_SETDEFID, IDC_FINISH_BUTTON, 0); - SetFocus(hwndFinish); - } - else if (dwFlags & PSWIZB_NEXT) - { - SendMessageW(hwndDlg, DM_SETDEFID, IDC_NEXT_BUTTON, 0); - SetFocus(hwndNext); - } - else if (dwFlags & PSWIZB_BACK) - { - SendMessageW(hwndDlg, DM_SETDEFID, IDC_BACK_BUTTON, 0); - SetFocus(hwndBack); - } - else - { - SendMessageW(hwndDlg, DM_SETDEFID, IDCANCEL, 0); - SetFocus(GetDlgItem(hwndDlg, IDCANCEL)); - } - - /* Now try to find an edit control that deserves focus */ - EnumChildWindows(PropSheet_GetCurrentPageHwnd(hwndDlg), EnumChildProc, 0); } /****************************************************************************** @@ -3100,6 +3063,12 @@ if ((psp->dwFlags & PSP_USETITLE) && !IS_INTRESOURCE( psp->pszTitle )) Free ((LPVOID)psp->pszTitle); + if ((psp->dwFlags & PSP_USEHEADERTITLE) && !IS_INTRESOURCE( psp->pszHeaderTitle )) + Free ((LPVOID)psp->pszHeaderTitle); + + if ((psp->dwFlags & PSP_USEHEADERSUBTITLE) && !IS_INTRESOURCE( psp->pszHeaderSubTitle )) + Free ((LPVOID)psp->pszHeaderSubTitle); + Free(hPropPage); return TRUE; @@ -3238,17 +3207,20 @@ WCHAR szBuffer[256]; int nLength; - if (psInfo->active_page < 0) return 1; hdc = hdcParam ? hdcParam : BeginPaint(hwnd, &ps); if (!hdc) return 1; hdcSrc = CreateCompatibleDC(0); - ppshpage = (LPCPROPSHEETPAGEW)psInfo->proppage[psInfo->active_page].hpage; if (psInfo->ppshheader.dwFlags & PSH_USEHPLWATERMARK) hOldPal = SelectPalette(hdc, psInfo->ppshheader.hplWatermark, FALSE); - if ( (!(ppshpage->dwFlags & PSP_HIDEHEADER)) && + if (psInfo->active_page < 0) + ppshpage = NULL; + else + ppshpage = (LPCPROPSHEETPAGEW)psInfo->proppage[psInfo->active_page].hpage; + + if ( (ppshpage && !(ppshpage->dwFlags & PSP_HIDEHEADER)) && (psInfo->ppshheader.dwFlags & (PSH_WIZARD97_OLD | PSH_WIZARD97_NEW)) && (psInfo->ppshheader.dwFlags & PSH_HEADER) ) { @@ -3355,7 +3327,7 @@ SelectObject(hdcSrc, hbmp); } - if ( (ppshpage->dwFlags & PSP_HIDEHEADER) && + if ( (ppshpage && (ppshpage->dwFlags & PSP_HIDEHEADER)) && (psInfo->ppshheader.dwFlags & (PSH_WIZARD97_OLD | PSH_WIZARD97_NEW)) && (psInfo->ppshheader.dwFlags & PSH_WATERMARK) ) { Modified: trunk/reactos/dll/win32/comctl32/status.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comctl32/status.…
============================================================================== --- trunk/reactos/dll/win32/comctl32/status.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/comctl32/status.c [iso-8859-1] Fri Jan 27 18:25:24 2012 @@ -52,6 +52,7 @@ #include "commctrl.h" #include "comctl32.h" #include "uxtheme.h" +//#include "vssym32.h" #include "tmschema.h" #include "wine/debug.h" @@ -207,6 +208,7 @@ UINT border = BDR_SUNKENOUTER; HTHEME theme = GetWindowTheme (infoPtr->Self); int themePart = SP_PANE; + int x = 0; TRACE("part bound %s\n", wine_dbgstr_rect(&r)); if (part->style & SBT_POPOUT) @@ -224,6 +226,12 @@ else DrawEdge(hdc, &r, border, BF_RECT|BF_ADJUST); + if (part->hIcon) { + INT cy = r.bottom - r.top; + DrawIconEx (hdc, r.left + 2, r.top, part->hIcon, cy, cy, 0, 0, DI_NORMAL); + x = 2 + cy; + } + if (part->style & SBT_OWNERDRAW) { DRAWITEMSTRUCT dis; @@ -233,15 +241,9 @@ dis.hDC = hdc; dis.rcItem = r; dis.itemData = (ULONG_PTR)part->text; - SendMessageW (infoPtr->Notify, WM_DRAWITEM, dis.CtlID, (LPARAM)&dis); + SendMessageW (infoPtr->Notify, WM_DRAWITEM, dis.CtlID, (LPARAM)&dis); } else { - if (part->hIcon) { - INT cy = r.bottom - r.top; - - r.left += 2; - DrawIconEx (hdc, r.left, r.top, part->hIcon, cy, cy, 0, 0, DI_NORMAL); - r.left += cy; - } + r.left += x; DrawStatusTextW (hdc, &r, part->text, SBT_NOBORDERS); } } @@ -661,9 +663,11 @@ STATUSBAR_SetParts (STATUS_INFO *infoPtr, INT count, LPINT parts) { STATUSWINDOWPART *tmp; - UINT i, oldNumParts; + INT i, oldNumParts; TRACE("(%d,%p)\n", count, parts); + + if(!count) return FALSE; oldNumParts = infoPtr->numParts; infoPtr->numParts = count; @@ -693,7 +697,7 @@ infoPtr->parts[i].x = parts[i]; if (infoPtr->hwndToolTip) { - UINT nTipCount; + INT nTipCount; TTTOOLINFOW ti; ZeroMemory (&ti, sizeof(TTTOOLINFOW)); @@ -1281,7 +1285,7 @@ return STATUSBAR_WMGetText (infoPtr, (INT)wParam, (LPWSTR)lParam); case WM_GETTEXTLENGTH: - return STATUSBAR_GetTextLength (infoPtr, 0); + return LOWORD(STATUSBAR_GetTextLength (infoPtr, 0)); case WM_LBUTTONDBLCLK: return STATUSBAR_SendMouseNotify(infoPtr, NM_DBLCLK, msg, wParam, lParam);
12 years, 11 months
1
0
0
0
[janderwald] 55253: [USBCCGP] - Implement counting interface descriptors - Fix allocating interface list - Fix multiple bugs when copying interface information - Implement support function to dump ...
by janderwald@svn.reactos.org
Author: janderwald Date: Fri Jan 27 18:04:39 2012 New Revision: 55253 URL:
http://svn.reactos.org/svn/reactos?rev=55253&view=rev
Log: [USBCCGP] - Implement counting interface descriptors - Fix allocating interface list - Fix multiple bugs when copying interface information - Implement support function to dump function descriptor - Fix multiple bugs when creating compatible / hardware id string - Implement legacy enumerator, which will be used for HID composite devices - Implement special enumerator for audio devices - Display static GenericCompositeUSBDeviceString, needs to be read from registry in order to be MUI aware - Device initializes and device wizard pops up - Tested in XP with Ros USB stack + USB Audio Microphone Modified: branches/usb-bringup-trunk/drivers/usb/usbccgp/descriptor.c branches/usb-bringup-trunk/drivers/usb/usbccgp/fdo.c branches/usb-bringup-trunk/drivers/usb/usbccgp/function.c branches/usb-bringup-trunk/drivers/usb/usbccgp/misc.c branches/usb-bringup-trunk/drivers/usb/usbccgp/pdo.c branches/usb-bringup-trunk/drivers/usb/usbccgp/usbccgp.h Modified: branches/usb-bringup-trunk/drivers/usb/usbccgp/descriptor.c URL:
http://svn.reactos.org/svn/reactos/branches/usb-bringup-trunk/drivers/usb/u…
============================================================================== --- branches/usb-bringup-trunk/drivers/usb/usbccgp/descriptor.c [iso-8859-1] (original) +++ branches/usb-bringup-trunk/drivers/usb/usbccgp/descriptor.c [iso-8859-1] Fri Jan 27 18:04:39 2012 @@ -162,6 +162,45 @@ return Status; } +ULONG +CountInterfaceDescriptors( + IN PUSB_CONFIGURATION_DESCRIPTOR ConfigurationDescriptor) +{ + PUSB_INTERFACE_DESCRIPTOR InterfaceDescriptor; + PVOID CurrentPosition; + ULONG Count = 0; + + // + // enumerate all interfaces + // + CurrentPosition = ConfigurationDescriptor; + do + { + // + // find next descriptor + // + InterfaceDescriptor = USBD_ParseConfigurationDescriptorEx(ConfigurationDescriptor, CurrentPosition, -1, -1, -1, -1, -1); + if (!InterfaceDescriptor) + break; + + // + // advance to next descriptor + // + CurrentPosition = (PVOID)((ULONG_PTR)InterfaceDescriptor + InterfaceDescriptor->bLength); + + // + // increment descriptor count + // + Count++; + + }while(TRUE); + + // + // done + // + return Count; +} + NTSTATUS NTAPI USBCCGP_ScanConfigurationDescriptor( @@ -170,6 +209,8 @@ { PUSB_INTERFACE_DESCRIPTOR InterfaceDescriptor; ULONG InterfaceIndex = 0; + PVOID CurrentPosition; + ULONG DescriptorCount; // // sanity checks @@ -178,9 +219,14 @@ ASSERT(ConfigurationDescriptor->bNumInterfaces); // + // count all interface descriptors + // + DescriptorCount = CountInterfaceDescriptors(ConfigurationDescriptor); + + // // allocate array holding the interface descriptors // - FDODeviceExtension->InterfaceList = AllocateItem(NonPagedPool, sizeof(USB_CONFIGURATION_DESCRIPTOR) * (ConfigurationDescriptor->bNumInterfaces + 1)); + FDODeviceExtension->InterfaceList = AllocateItem(NonPagedPool, sizeof(USBD_INTERFACE_LIST_ENTRY) * (DescriptorCount + 1)); if (!FDODeviceExtension->InterfaceList) { // @@ -189,12 +235,13 @@ return STATUS_INSUFFICIENT_RESOURCES; } + CurrentPosition = ConfigurationDescriptor; do { // // parse configuration descriptor // - InterfaceDescriptor = USBD_ParseConfigurationDescriptorEx(ConfigurationDescriptor, ConfigurationDescriptor, InterfaceIndex, 0, -1, -1, -1); + InterfaceDescriptor = USBD_ParseConfigurationDescriptorEx(ConfigurationDescriptor, CurrentPosition, -1, -1, -1, -1, -1); if (InterfaceDescriptor) { // @@ -202,6 +249,7 @@ // FDODeviceExtension->InterfaceList[FDODeviceExtension->InterfaceListCount].InterfaceDescriptor = InterfaceDescriptor; FDODeviceExtension->InterfaceListCount++; + CurrentPosition = (PVOID)((ULONG_PTR)InterfaceDescriptor + InterfaceDescriptor->bLength); } // @@ -209,7 +257,7 @@ // InterfaceIndex++; - }while(InterfaceIndex < ConfigurationDescriptor->bNumInterfaces); + }while(InterfaceIndex < DescriptorCount); // // sanity check @@ -347,13 +395,12 @@ // get interface information // InterfaceInformation = &Urb->UrbSelectConfiguration.Interface; - for(Index = 0; Index < DeviceExtension->InterfaceListCount; Index++) { // // allocate buffer to store interface information // - DeviceExtension->InterfaceList[Index].Interface = AllocateItem(NonPagedPool, InterfaceInformation[Index].Length); + DeviceExtension->InterfaceList[Index].Interface = AllocateItem(NonPagedPool, InterfaceInformation->Length); if (!DeviceExtension->InterfaceList[Index].Interface) { // @@ -366,7 +413,13 @@ // copy interface information // RtlCopyMemory(DeviceExtension->InterfaceList[Index].Interface, InterfaceInformation, InterfaceInformation->Length); - } + + // + // move to next interface + // + InterfaceInformation = (PUSBD_INTERFACE_INFORMATION)((ULONG_PTR)InterfaceInformation + InterfaceInformation->Length); + } + // // store pipe handle Modified: branches/usb-bringup-trunk/drivers/usb/usbccgp/fdo.c URL:
http://svn.reactos.org/svn/reactos/branches/usb-bringup-trunk/drivers/usb/u…
============================================================================== --- branches/usb-bringup-trunk/drivers/usb/usbccgp/fdo.c [iso-8859-1] (original) +++ branches/usb-bringup-trunk/drivers/usb/usbccgp/fdo.c [iso-8859-1] Fri Jan 27 18:04:39 2012 @@ -138,7 +138,6 @@ // FDODeviceExtension = (PFDO_DEVICE_EXTENSION)DeviceObject->DeviceExtension; - // // get current irp stack location // @@ -376,6 +375,7 @@ // ASSERT(FDODeviceExtension->FunctionDescriptorCount); ASSERT(FDODeviceExtension->FunctionDescriptor); + DumpFunctionDescriptor(FDODeviceExtension->FunctionDescriptor, FDODeviceExtension->FunctionDescriptorCount); // // now create the pdo Modified: branches/usb-bringup-trunk/drivers/usb/usbccgp/function.c URL:
http://svn.reactos.org/svn/reactos/branches/usb-bringup-trunk/drivers/usb/u…
============================================================================== --- branches/usb-bringup-trunk/drivers/usb/usbccgp/function.c [iso-8859-1] (original) +++ branches/usb-bringup-trunk/drivers/usb/usbccgp/function.c [iso-8859-1] Fri Jan 27 18:04:39 2012 @@ -411,7 +411,10 @@ // copy description RtlCopyMemory(DescriptionBuffer, Buffer, Index * sizeof(WCHAR)); - RtlInitUnicodeString(&FunctionDescriptor->HardwareId, DescriptionBuffer); + FunctionDescriptor->HardwareId.Buffer = DescriptionBuffer; + FunctionDescriptor->HardwareId.Length = Index * sizeof(WCHAR); + FunctionDescriptor->HardwareId.MaximumLength = (Index + 1) * sizeof(WCHAR); + // // now init the compatible id @@ -431,9 +434,10 @@ } // copy description - // copy description RtlCopyMemory(DescriptionBuffer, Buffer, Index * sizeof(WCHAR)); - RtlInitUnicodeString(&FunctionDescriptor->CompatibleId, DescriptionBuffer); + FunctionDescriptor->CompatibleId.Buffer = DescriptionBuffer; + FunctionDescriptor->CompatibleId.Length = Index * sizeof(WCHAR); + FunctionDescriptor->CompatibleId.MaximumLength = (Index + 1) * sizeof(WCHAR); // // done @@ -506,23 +510,319 @@ return Status; } +NTSTATUS +USBCCG_InitIdsWithInterfaceDescriptor( + IN PFDO_DEVICE_EXTENSION FDODeviceExtension, + IN PUSB_INTERFACE_DESCRIPTOR Descriptor, + OUT PUSBC_FUNCTION_DESCRIPTOR FunctionDescriptor) +{ + ULONG Index; + WCHAR Buffer[200]; + LPWSTR DescriptionBuffer; + NTSTATUS Status; + + // + // now init interface description + // + if (Descriptor->iInterface) + { + // + // get interface description + // + Status = USBCCGP_GetDescriptor(FDODeviceExtension->NextDeviceObject, + USB_STRING_DESCRIPTOR_TYPE, + 100 * sizeof(WCHAR), + Descriptor->iInterface, + 0x0409, //FIXME + (PVOID*)&DescriptionBuffer); + if (!NT_SUCCESS(Status)) + { + // + // no description + // + RtlInitUnicodeString(&FunctionDescriptor->FunctionDescription, L""); + } + else + { + // + // init description + // + RtlInitUnicodeString(&FunctionDescriptor->FunctionDescription, DescriptionBuffer); + } + DPRINT1("FunctionDescription %wZ\n", &FunctionDescriptor->FunctionDescription); + } + + + + // + // now init hardware id + // + Index = swprintf(Buffer, L"USB\\VID_%04x&PID_%04x&Rev_%04x&MI_%02x", FDODeviceExtension->DeviceDescriptor->idVendor, + FDODeviceExtension->DeviceDescriptor->idProduct, + FDODeviceExtension->DeviceDescriptor->bcdDevice, + Descriptor->bInterfaceNumber) + 1; + Index += swprintf(&Buffer[Index], L"USB\\VID_%04x&PID_%04x&MI_%02x", FDODeviceExtension->DeviceDescriptor->idVendor, + FDODeviceExtension->DeviceDescriptor->idProduct, + Descriptor->bInterfaceNumber) + 1; + + // allocate result buffer + DescriptionBuffer = AllocateItem(NonPagedPool, (Index + 1) * sizeof(WCHAR)); + if (!DescriptionBuffer) + { + // + // failed to allocate memory + // + return STATUS_INSUFFICIENT_RESOURCES; + } + + // copy description + RtlCopyMemory(DescriptionBuffer, Buffer, Index * sizeof(WCHAR)); + FunctionDescriptor->HardwareId.Buffer = DescriptionBuffer; + FunctionDescriptor->HardwareId.Length = Index * sizeof(WCHAR); + FunctionDescriptor->HardwareId.MaximumLength = (Index + 1) * sizeof(WCHAR); + + + // + // now init the compatible id + // + Index = swprintf(Buffer, L"USB\\Class_%02x&SubClass_%02x&Prot_%02x", Descriptor->bInterfaceClass, Descriptor->bInterfaceSubClass, Descriptor->bInterfaceProtocol) + 1; + Index += swprintf(&Buffer[Index], L"USB\\Class_%04x&SubClass_%04x", Descriptor->bInterfaceClass, Descriptor->bInterfaceSubClass) + 1; + Index += swprintf(&Buffer[Index], L"USB\\Class_%04x", Descriptor->bInterfaceClass) + 1; + + // allocate result buffer + DescriptionBuffer = AllocateItem(NonPagedPool, (Index + 1) * sizeof(WCHAR)); + if (!DescriptionBuffer) + { + // + // failed to allocate memory + // + return STATUS_INSUFFICIENT_RESOURCES; + } + + // copy description + RtlCopyMemory(DescriptionBuffer, Buffer, Index * sizeof(WCHAR)); + FunctionDescriptor->CompatibleId.Buffer = DescriptionBuffer; + FunctionDescriptor->CompatibleId.Length = Index * sizeof(WCHAR); + FunctionDescriptor->CompatibleId.MaximumLength = (Index + 1) * sizeof(WCHAR); +} + + +NTSTATUS +USBCCGP_LegacyEnum( + IN PDEVICE_OBJECT DeviceObject) +{ + ULONG Index; + PFDO_DEVICE_EXTENSION FDODeviceExtension; + NTSTATUS Status = STATUS_SUCCESS; + PUSB_INTERFACE_DESCRIPTOR InterfaceDescriptor; + + // + // get device extension + // + FDODeviceExtension = (PFDO_DEVICE_EXTENSION)DeviceObject->DeviceExtension; + ASSERT(FDODeviceExtension->Common.IsFDO); + + // + // sanity check + // + ASSERT(FDODeviceExtension->ConfigurationDescriptor->bNumInterfaces); + + // + // allocate function array + // + FDODeviceExtension->FunctionDescriptor = AllocateItem(NonPagedPool, sizeof(USBC_FUNCTION_DESCRIPTOR) * FDODeviceExtension->ConfigurationDescriptor->bNumInterfaces); + if (!FDODeviceExtension->FunctionDescriptor) + { + // + // no memory + // + DPRINT1("USBCCGP_EnumWithAssociationDescriptor failed to allocate function descriptor %lu\n", FDODeviceExtension->ConfigurationDescriptor->bNumInterfaces); + return STATUS_INSUFFICIENT_RESOURCES; + } + + // + // init function descriptors + // + for(Index = 0; Index < FDODeviceExtension->ConfigurationDescriptor->bNumInterfaces; Index++) + { + // get interface descriptor + InterfaceDescriptor = USBD_ParseConfigurationDescriptor(FDODeviceExtension->ConfigurationDescriptor, Index, 0); + if (InterfaceDescriptor == NULL) + { + // + // failed to find interface descriptor + // + DPRINT1("[USBCCGP] Failed to find interface descriptor index %lu\n", Index); + return STATUS_UNSUCCESSFUL; + } + + // + // init function descriptor + // + FDODeviceExtension->FunctionDescriptor[Index].FunctionNumber = Index; + FDODeviceExtension->FunctionDescriptor[Index].NumberOfInterfaces = 1; + FDODeviceExtension->FunctionDescriptor[Index].InterfaceDescriptorList = AllocateItem(NonPagedPool, sizeof(PUSB_INTERFACE_DESCRIPTOR) * 1); + if (!FDODeviceExtension->FunctionDescriptor[Index].InterfaceDescriptorList) + { + // + // no memory + // + return STATUS_INSUFFICIENT_RESOURCES; + } + + // + // store interface descriptor + // + FDODeviceExtension->FunctionDescriptor[Index].InterfaceDescriptorList[0] = InterfaceDescriptor; + + // + // now init the device ids + // + Status = USBCCG_InitIdsWithInterfaceDescriptor(FDODeviceExtension, InterfaceDescriptor, &FDODeviceExtension->FunctionDescriptor[Index]); + if (!NT_SUCCESS(Status)) + { + // + // failed to init ids + // + DPRINT1("[USBCCGP] Failed to init ids with %x\n", Status); + return Status; + } + + // + // store function count + // + FDODeviceExtension->FunctionDescriptorCount++; + } + + // + // done + // + return Status; +} + +NTSTATUS +USBCCGP_EnumWithUnionFunctionDescriptors( + IN PDEVICE_OBJECT DeviceObject) +{ + UNIMPLEMENTED + return STATUS_NOT_IMPLEMENTED; +} NTSTATUS USBCCGP_EnumWithAudioLegacy( IN PDEVICE_OBJECT DeviceObject) { - UNIMPLEMENTED - return STATUS_NOT_IMPLEMENTED; -} - -NTSTATUS -USBCCGP_EnumWithUnionFunctionDescriptors( - IN PDEVICE_OBJECT DeviceObject) -{ - UNIMPLEMENTED - return STATUS_NOT_IMPLEMENTED; -} - + ULONG Index; + PUSB_INTERFACE_DESCRIPTOR InterfaceDescriptor, FirstDescriptor = NULL; + PFDO_DEVICE_EXTENSION FDODeviceExtension; + NTSTATUS Status = STATUS_SUCCESS; + + // + // get device extension + // + FDODeviceExtension = (PFDO_DEVICE_EXTENSION)DeviceObject->DeviceExtension; + ASSERT(FDODeviceExtension->Common.IsFDO); + + + // + // first check if all interfaces belong to the same audio class + // + for(Index = 0; Index < FDODeviceExtension->ConfigurationDescriptor->bNumInterfaces; Index++) + { + // + // get interface descriptor + // + InterfaceDescriptor = USBD_ParseConfigurationDescriptorEx(FDODeviceExtension->ConfigurationDescriptor, FDODeviceExtension->ConfigurationDescriptor, Index, -1, -1, -1, -1); + if (InterfaceDescriptor->bInterfaceClass != 0x1) + { + // + // collection contains non audio class + // + return STATUS_UNSUCCESSFUL; + } + + if (FirstDescriptor == NULL) + { + // + // store interface descriptor + // + FirstDescriptor = InterfaceDescriptor; + continue; + } + + if (FirstDescriptor->bInterfaceSubClass == InterfaceDescriptor->bInterfaceSubClass) + { + // + // interface subclass must be different from the first interface + // + return STATUS_UNSUCCESSFUL; + } + } + + // + // this is an composite audio device + // + DPRINT1("[USBCCGP] Audio Composite Device detected\n"); + + // + // audio interfaces are all grouped into one single function + // + FDODeviceExtension->FunctionDescriptor = AllocateItem(NonPagedPool, sizeof(USBC_FUNCTION_DESCRIPTOR)); + if (!FDODeviceExtension->FunctionDescriptor) + { + // + // no memory + // + DPRINT1("USBCCGP_EnumWithAssociationDescriptor failed to allocate function descriptor count\n"); + return STATUS_INSUFFICIENT_RESOURCES; + } + + // + // init function number + // + FDODeviceExtension->FunctionDescriptor[0].FunctionNumber = 0; + + // + // FIXME: how many interfaces should be stored? + // + + FDODeviceExtension->FunctionDescriptor[0].InterfaceDescriptorList = AllocateItem(NonPagedPool, sizeof(PUSB_INTERFACE_DESCRIPTOR) * 1); + if (!FDODeviceExtension->FunctionDescriptor[0].InterfaceDescriptorList) + { + // + // no memory + // + return STATUS_INSUFFICIENT_RESOURCES; + } + + // + // store interface descriptor + // + FDODeviceExtension->FunctionDescriptor[0].InterfaceDescriptorList[0] = InterfaceDescriptor; + + // + // now init the device ids + // + Status = USBCCG_InitIdsWithInterfaceDescriptor(FDODeviceExtension, InterfaceDescriptor, &FDODeviceExtension->FunctionDescriptor[0]); + if (!NT_SUCCESS(Status)) + { + // + // failed to init ids + // + DPRINT1("[USBCCGP] Failed to init ids with %x\n", Status); + return Status; + } + + // + // store function count + // + FDODeviceExtension->FunctionDescriptorCount = 1; + + // + // done + // + return STATUS_SUCCESS; +} NTSTATUS USBCCGP_EnumerateFunctions( @@ -561,6 +861,7 @@ return Status; } +#if 0 // // try with union function descriptors // @@ -572,9 +873,22 @@ // return Status; } +#endif // // try with legacy audio methods // - return USBCCGP_EnumWithAudioLegacy(DeviceObject); -} + Status = USBCCGP_EnumWithAudioLegacy(DeviceObject); + if (NT_SUCCESS(Status)) + { + // + // succeeded + // + return Status; + } + + // + // try with legacy enumeration + // + return USBCCGP_LegacyEnum(DeviceObject); +} Modified: branches/usb-bringup-trunk/drivers/usb/usbccgp/misc.c URL:
http://svn.reactos.org/svn/reactos/branches/usb-bringup-trunk/drivers/usb/u…
============================================================================== --- branches/usb-bringup-trunk/drivers/usb/usbccgp/misc.c [iso-8859-1] (original) +++ branches/usb-bringup-trunk/drivers/usb/usbccgp/misc.c [iso-8859-1] Fri Jan 27 18:04:39 2012 @@ -195,3 +195,23 @@ ExFreePoolWithTag(Item, USBCCPG_TAG); } +VOID +DumpFunctionDescriptor( + IN PUSBC_FUNCTION_DESCRIPTOR FunctionDescriptor, + IN ULONG FunctionDescriptorCount) +{ + ULONG Index; + + + DPRINT1("FunctionCount %lu\n", FunctionDescriptorCount); + for(Index = 0; Index < FunctionDescriptorCount; Index++) + { + DPRINT1("Function %lu\n", Index); + DPRINT1("FunctionNumber %lu\n", FunctionDescriptor[Index].FunctionNumber); + DPRINT1("HardwareId %wZ\n", &FunctionDescriptor[Index].HardwareId); + DPRINT1("CompatibleId %wZ\n", &FunctionDescriptor[Index].CompatibleId); + DPRINT1("FunctionDescription %wZ\n", &FunctionDescriptor[Index].FunctionDescription); + DPRINT1("NumInterfaces %lu\n", FunctionDescriptor[Index].NumberOfInterfaces); + } + +} Modified: branches/usb-bringup-trunk/drivers/usb/usbccgp/pdo.c URL:
http://svn.reactos.org/svn/reactos/branches/usb-bringup-trunk/drivers/usb/u…
============================================================================== --- branches/usb-bringup-trunk/drivers/usb/usbccgp/pdo.c [iso-8859-1] (original) +++ branches/usb-bringup-trunk/drivers/usb/usbccgp/pdo.c [iso-8859-1] Fri Jan 27 18:04:39 2012 @@ -18,7 +18,7 @@ { LPWSTR Buffer; PPDO_DEVICE_EXTENSION PDODeviceExtension; - + LPWSTR GenericString = L"Composite USB Device"; // // get device extension // @@ -53,7 +53,18 @@ // FIXME use GenericCompositeUSBDeviceString // UNIMPLEMENTED - return Irp->IoStatus.Status; + Buffer = AllocateItem(PagedPool, (wcslen(GenericString) + 1) * sizeof(WCHAR)); + if (!Buffer) + { + // + // no memory + // + return STATUS_INSUFFICIENT_RESOURCES; + } + RtlCopyMemory(Buffer, GenericString, (wcslen(GenericString) + 1) * sizeof(WCHAR)); + Irp->IoStatus.Information = (ULONG_PTR)Buffer; + + return STATUS_SUCCESS; } NTSTATUS @@ -145,7 +156,7 @@ // // FIXME append interface id // - ASSERT(FALSE); + UNIMPLEMENTED return Status; } else if (IoStack->Parameters.QueryId.IdType == BusQueryHardwareIDs) Modified: branches/usb-bringup-trunk/drivers/usb/usbccgp/usbccgp.h URL:
http://svn.reactos.org/svn/reactos/branches/usb-bringup-trunk/drivers/usb/u…
============================================================================== --- branches/usb-bringup-trunk/drivers/usb/usbccgp/usbccgp.h [iso-8859-1] (original) +++ branches/usb-bringup-trunk/drivers/usb/usbccgp/usbccgp.h [iso-8859-1] Fri Jan 27 18:04:39 2012 @@ -95,6 +95,11 @@ FreeItem( IN PVOID Item); +VOID +DumpFunctionDescriptor( + IN PUSBC_FUNCTION_DESCRIPTOR FunctionDescriptor, + IN ULONG FunctionDescriptorCount); + /* fdo.c */ NTSTATUS
12 years, 11 months
1
0
0
0
[akhaldi] 55252: [DDK] * Update csq.h annotations.
by akhaldi@svn.reactos.org
Author: akhaldi Date: Fri Jan 27 17:34:49 2012 New Revision: 55252 URL:
http://svn.reactos.org/svn/reactos?rev=55252&view=rev
Log: [DDK] * Update csq.h annotations. Modified: trunk/reactos/include/ddk/csq.h Modified: trunk/reactos/include/ddk/csq.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ddk/csq.h?rev=5525…
============================================================================== --- trunk/reactos/include/ddk/csq.h [iso-8859-1] (original) +++ trunk/reactos/include/ddk/csq.h [iso-8859-1] Fri Jan 27 17:34:49 2012 @@ -112,8 +112,8 @@ */ typedef VOID (NTAPI IO_CSQ_INSERT_IRP)( - IN struct _IO_CSQ *Csq, - IN PIRP Irp); + _In_ struct _IO_CSQ *Csq, + _In_ PIRP Irp); typedef IO_CSQ_INSERT_IRP *PIO_CSQ_INSERT_IRP; /* @@ -130,8 +130,8 @@ */ typedef VOID (NTAPI IO_CSQ_REMOVE_IRP)( - IN struct _IO_CSQ *Csq, - IN PIRP Irp); + _In_ struct _IO_CSQ *Csq, + _In_ PIRP Irp); typedef IO_CSQ_REMOVE_IRP *PIO_CSQ_REMOVE_IRP; /* @@ -155,9 +155,9 @@ */ typedef PIRP (NTAPI IO_CSQ_PEEK_NEXT_IRP)( - IN struct _IO_CSQ *Csq, - IN PIRP Irp, - IN PVOID PeekContext); + _In_ struct _IO_CSQ *Csq, + _In_opt_ PIRP Irp, + _In_opt_ PVOID PeekContext); typedef IO_CSQ_PEEK_NEXT_IRP *PIO_CSQ_PEEK_NEXT_IRP; /* @@ -175,8 +175,8 @@ */ typedef VOID (NTAPI IO_CSQ_ACQUIRE_LOCK)( - IN struct _IO_CSQ *Csq, - OUT PKIRQL Irql); + _In_ struct _IO_CSQ *Csq, + _Out_ PKIRQL Irql); typedef IO_CSQ_ACQUIRE_LOCK *PIO_CSQ_ACQUIRE_LOCK; /* @@ -191,8 +191,8 @@ */ typedef VOID (NTAPI IO_CSQ_RELEASE_LOCK)( - IN struct _IO_CSQ *Csq, - IN KIRQL Irql); + _In_ struct _IO_CSQ *Csq, + _In_ KIRQL Irql); typedef IO_CSQ_RELEASE_LOCK *PIO_CSQ_RELEASE_LOCK; /* @@ -212,8 +212,8 @@ */ typedef VOID (NTAPI IO_CSQ_COMPLETE_CANCELED_IRP)( - IN struct _IO_CSQ *Csq, - IN PIRP Irp); + _In_ struct _IO_CSQ *Csq, + _In_ PIRP Irp); typedef IO_CSQ_COMPLETE_CANCELED_IRP *PIO_CSQ_COMPLETE_CANCELED_IRP; /* @@ -253,9 +253,9 @@ */ typedef NTSTATUS (NTAPI IO_CSQ_INSERT_IRP_EX)( - IN struct _IO_CSQ *Csq, - IN PIRP Irp, - IN PVOID InsertContext); + _In_ struct _IO_CSQ *Csq, + _In_ PIRP Irp, + _In_ PVOID InsertContext); typedef IO_CSQ_INSERT_IRP_EX *PIO_CSQ_INSERT_IRP_EX; #endif /* IO_TYPE_CSQ_EX */ @@ -275,13 +275,13 @@ * there are no IRQL restrictions. */ NTKERNELAPI -NTSTATUS NTAPI IoCsqInitialize(PIO_CSQ Csq, - PIO_CSQ_INSERT_IRP CsqInsertIrp, - PIO_CSQ_REMOVE_IRP CsqRemoveIrp, - PIO_CSQ_PEEK_NEXT_IRP CsqPeekNextIrp, - PIO_CSQ_ACQUIRE_LOCK CsqAcquireLock, - PIO_CSQ_RELEASE_LOCK CsqReleaseLock, - PIO_CSQ_COMPLETE_CANCELED_IRP CsqCompleteCanceledIrp); +NTSTATUS NTAPI IoCsqInitialize(_In_ PIO_CSQ Csq, + _In_ PIO_CSQ_INSERT_IRP CsqInsertIrp, + _In_ PIO_CSQ_REMOVE_IRP CsqRemoveIrp, + _In_ PIO_CSQ_PEEK_NEXT_IRP CsqPeekNextIrp, + _In_ PIO_CSQ_ACQUIRE_LOCK CsqAcquireLock, + _In_ PIO_CSQ_RELEASE_LOCK CsqReleaseLock, + _In_ PIO_CSQ_COMPLETE_CANCELED_IRP CsqCompleteCanceledIrp); /* * Same as above, except you provide a CsqInsertIrpEx routine instead of @@ -289,45 +289,45 @@ * information for use with the queue. */ NTKERNELAPI -NTSTATUS NTAPI IoCsqInitializeEx(PIO_CSQ Csq, - PIO_CSQ_INSERT_IRP_EX CsqInsertIrpEx, - PIO_CSQ_REMOVE_IRP CsqRemoveIrp, - PIO_CSQ_PEEK_NEXT_IRP CsqPeekNextIrp, - PIO_CSQ_ACQUIRE_LOCK CsqAcquireLock, - PIO_CSQ_RELEASE_LOCK CsqReleaseLock, - PIO_CSQ_COMPLETE_CANCELED_IRP CsqCompleteCanceledIrp); +NTSTATUS NTAPI IoCsqInitializeEx(_In_ PIO_CSQ Csq, + _In_ PIO_CSQ_INSERT_IRP_EX CsqInsertIrpEx, + _In_ PIO_CSQ_REMOVE_IRP CsqRemoveIrp, + _In_ PIO_CSQ_PEEK_NEXT_IRP CsqPeekNextIrp, + _In_ PIO_CSQ_ACQUIRE_LOCK CsqAcquireLock, + _In_ PIO_CSQ_RELEASE_LOCK CsqReleaseLock, + _In_ PIO_CSQ_COMPLETE_CANCELED_IRP CsqCompleteCanceledIrp); /* * Insert an IRP into the queue */ NTKERNELAPI -VOID NTAPI IoCsqInsertIrp(PIO_CSQ Csq, - PIRP Irp, - PIO_CSQ_IRP_CONTEXT Context); +VOID NTAPI IoCsqInsertIrp(_In_ PIO_CSQ Csq, + _In_ PIRP Irp, + _In_opt_ PIO_CSQ_IRP_CONTEXT Context); /* * Insert an IRP into the queue, with special context maintained that * makes it easy to find IRPs in the queue */ NTKERNELAPI -NTSTATUS NTAPI IoCsqInsertIrpEx(PIO_CSQ Csq, - PIRP Irp, - PIO_CSQ_IRP_CONTEXT Context, - PVOID InsertContext); +NTSTATUS NTAPI IoCsqInsertIrpEx(_In_ PIO_CSQ Csq, + _In_ PIRP Irp, + _In_opt_ PIO_CSQ_IRP_CONTEXT Context, + _In_opt_ PVOID InsertContext); /* * Remove a particular IRP from the queue */ NTKERNELAPI -PIRP NTAPI IoCsqRemoveIrp(PIO_CSQ Csq, - PIO_CSQ_IRP_CONTEXT Context); +PIRP NTAPI IoCsqRemoveIrp(_In_ PIO_CSQ Csq, + _In_ PIO_CSQ_IRP_CONTEXT Context); /* * Remove the next IRP from the queue */ NTKERNELAPI -PIRP NTAPI IoCsqRemoveNextIrp(PIO_CSQ Csq, - PVOID PeekContext); +PIRP NTAPI IoCsqRemoveNextIrp(_In_ PIO_CSQ Csq, + _In_opt_ PVOID PeekContext); #ifdef __cplusplus }
12 years, 11 months
1
0
0
0
[akhaldi] 55251: [MSCTF_WINETEST] * Sync to Wine 1.3.37.
by akhaldi@svn.reactos.org
Author: akhaldi Date: Fri Jan 27 17:32:46 2012 New Revision: 55251 URL:
http://svn.reactos.org/svn/reactos?rev=55251&view=rev
Log: [MSCTF_WINETEST] * Sync to Wine 1.3.37. Modified: trunk/rostests/winetests/msctf/inputprocessor.c Modified: trunk/rostests/winetests/msctf/inputprocessor.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/msctf/inputproc…
============================================================================== --- trunk/rostests/winetests/msctf/inputprocessor.c [iso-8859-1] (original) +++ trunk/rostests/winetests/msctf/inputprocessor.c [iso-8859-1] Fri Jan 27 17:32:46 2012 @@ -21,6 +21,7 @@ #include <stdio.h> #define COBJMACROS +#define CONST_VTABLE #include "wine/test.h" #include "winuser.h" #include "initguid.h" @@ -45,6 +46,7 @@ #define SINK_FIRED 2 #define SINK_IGNORE 3 #define SINK_OPTIONAL 4 +#define SINK_SAVE 5 #define SINK_ACTION_MASK 0xff #define SINK_OPTION_MASK 0xff00 @@ -53,6 +55,7 @@ #define SINK_OPTION_TODO 0x0100 #define FOCUS_IGNORE (ITfDocumentMgr*)0xffffffff +#define FOCUS_SAVE (ITfDocumentMgr*)0xfffffffe static BOOL test_ShouldActivate = FALSE; static BOOL test_ShouldDeactivate = FALSE; @@ -62,6 +65,8 @@ static DWORD documentStatus; static ITfDocumentMgr *test_CurrentFocus = NULL; static ITfDocumentMgr *test_PrevFocus = NULL; +static ITfDocumentMgr *test_LastCurrentFocus = FOCUS_SAVE; +static ITfDocumentMgr *test_FirstPrevFocus = FOCUS_SAVE; static INT test_OnSetFocus = SINK_UNEXPECTED; static INT test_OnInitDocumentMgr = SINK_UNEXPECTED; static INT test_OnPushContext = SINK_UNEXPECTED; @@ -107,6 +112,10 @@ case SINK_IGNORE: winetest_trace("Ignoring %s\n",name); return; + case SINK_SAVE: + count = expected_count(sink) + 1; + *sink = (*sink & ~SINK_EXPECTED_COUNT_MASK) + (count << 16); + return; default: if (todo) todo_wine winetest_ok(0, "Unexpected %s sink\n",name); @@ -122,6 +131,7 @@ { int action = *sink & SINK_ACTION_MASK; int todo = *sink & SINK_OPTION_TODO; + int count = expected_count(sink); switch (action) { @@ -132,6 +142,10 @@ break; case SINK_IGNORE: return; + case SINK_SAVE: + if (count == 0 && winetest_interactive) + winetest_trace("optional sink %s not fired\n",name); + break; default: if (todo) todo_wine winetest_ok(0, "%s not fired as expected, in state %x\n",name,*sink); @@ -143,16 +157,35 @@ #define sink_check_ok(a,b) (winetest_set_location(__FILE__,__LINE__), 0) ? 0 : _sink_check_ok(a,b) +static inline void _sink_check_saved(INT *sink, ITfDocumentMgr *PrevFocus, ITfDocumentMgr *CurrentFocus, const CHAR* name) +{ + int count = expected_count(sink); + _sink_check_ok(sink, name); + if (PrevFocus != FOCUS_IGNORE && count != 0) + winetest_ok(PrevFocus == test_FirstPrevFocus, "%s expected prev focus %p got %p\n", name, PrevFocus, test_FirstPrevFocus); + if (CurrentFocus != FOCUS_IGNORE && count != 0) + winetest_ok(CurrentFocus == test_LastCurrentFocus, "%s expected current focus %p got %p\n", name, CurrentFocus, test_LastCurrentFocus); + test_FirstPrevFocus = FOCUS_SAVE; + test_LastCurrentFocus = FOCUS_SAVE; +} + +#define sink_check_saved(s,p,c,n) (winetest_set_location(__FILE__,__LINE__), 0) ? 0 : _sink_check_saved(s,p,c,n) + /********************************************************************** * ITextStoreACP **********************************************************************/ typedef struct tagTextStoreACP { - const ITextStoreACPVtbl *TextStoreACPVtbl; + ITextStoreACP ITextStoreACP_iface; LONG refCount; } TextStoreACP; +static inline TextStoreACP *impl_from_ITextStoreACP(ITextStoreACP *iface) +{ + return CONTAINING_RECORD(iface, TextStoreACP, ITextStoreACP_iface); +} + static void TextStoreACP_Destructor(TextStoreACP *This) { HeapFree(GetProcessHeap(),0,This); @@ -160,7 +193,7 @@ static HRESULT WINAPI TextStoreACP_QueryInterface(ITextStoreACP *iface, REFIID iid, LPVOID *ppvOut) { - TextStoreACP *This = (TextStoreACP *)iface; + TextStoreACP *This = impl_from_ITextStoreACP(iface); *ppvOut = NULL; if (IsEqualIID(iid, &IID_IUnknown) || IsEqualIID(iid, &IID_ITextStoreACP)) @@ -179,13 +212,13 @@ static ULONG WINAPI TextStoreACP_AddRef(ITextStoreACP *iface) { - TextStoreACP *This = (TextStoreACP *)iface; + TextStoreACP *This = impl_from_ITextStoreACP(iface); return InterlockedIncrement(&This->refCount); } static ULONG WINAPI TextStoreACP_Release(ITextStoreACP *iface) { - TextStoreACP *This = (TextStoreACP *)iface; + TextStoreACP *This = impl_from_ITextStoreACP(iface); ULONG ret; ret = InterlockedDecrement(&This->refCount); @@ -421,7 +454,7 @@ if (This == NULL) return E_OUTOFMEMORY; - This->TextStoreACPVtbl = &TextStoreACP_TextStoreACPVtbl; + This->ITextStoreACP_iface.lpVtbl = &TextStoreACP_TextStoreACPVtbl; This->refCount = 1; *ppOut = (IUnknown *)This; @@ -433,10 +466,15 @@ **********************************************************************/ typedef struct tagThreadMgrEventSink { - const ITfThreadMgrEventSinkVtbl *ThreadMgrEventSinkVtbl; + ITfThreadMgrEventSink ITfThreadMgrEventSink_iface; LONG refCount; } ThreadMgrEventSink; +static inline ThreadMgrEventSink *impl_from_ITfThreadMgrEventSink(ITfThreadMgrEventSink *iface) +{ + return CONTAINING_RECORD(iface, ThreadMgrEventSink, ITfThreadMgrEventSink_iface); +} + static void ThreadMgrEventSink_Destructor(ThreadMgrEventSink *This) { HeapFree(GetProcessHeap(),0,This); @@ -444,7 +482,7 @@ static HRESULT WINAPI ThreadMgrEventSink_QueryInterface(ITfThreadMgrEventSink *iface, REFIID iid, LPVOID *ppvOut) { - ThreadMgrEventSink *This = (ThreadMgrEventSink *)iface; + ThreadMgrEventSink *This = impl_from_ITfThreadMgrEventSink(iface); *ppvOut = NULL; if (IsEqualIID(iid, &IID_IUnknown) || IsEqualIID(iid, &IID_ITfThreadMgrEventSink)) @@ -463,14 +501,14 @@ static ULONG WINAPI ThreadMgrEventSink_AddRef(ITfThreadMgrEventSink *iface) { - ThreadMgrEventSink *This = (ThreadMgrEventSink *)iface; + ThreadMgrEventSink *This = impl_from_ITfThreadMgrEventSink(iface); ok (tmSinkRefCount == This->refCount,"ThreadMgrEventSink refcount off %i vs %i\n",This->refCount,tmSinkRefCount); return InterlockedIncrement(&This->refCount); } static ULONG WINAPI ThreadMgrEventSink_Release(ITfThreadMgrEventSink *iface) { - ThreadMgrEventSink *This = (ThreadMgrEventSink *)iface; + ThreadMgrEventSink *This = impl_from_ITfThreadMgrEventSink(iface); ULONG ret; ok (tmSinkRefCount == This->refCount,"ThreadMgrEventSink refcount off %i vs %i\n",This->refCount,tmSinkRefCount); @@ -498,9 +536,16 @@ ITfDocumentMgr *pdimFocus, ITfDocumentMgr *pdimPrevFocus) { sink_fire_ok(&test_OnSetFocus,"ThreadMgrEventSink_OnSetFocus"); - if (test_CurrentFocus != FOCUS_IGNORE) + if (test_CurrentFocus == FOCUS_SAVE) + test_LastCurrentFocus = pdimFocus; + else if (test_CurrentFocus != FOCUS_IGNORE) ok(pdimFocus == test_CurrentFocus,"Sink reports wrong focus\n"); - if (test_PrevFocus != FOCUS_IGNORE) + if (test_PrevFocus == FOCUS_SAVE) + { + if (test_FirstPrevFocus == FOCUS_SAVE) + test_FirstPrevFocus = pdimPrevFocus; + } + else if (test_PrevFocus != FOCUS_IGNORE) ok(pdimPrevFocus == test_PrevFocus,"Sink reports wrong previous focus\n"); return S_OK; } @@ -513,7 +558,7 @@ ITfContext *test; hr = ITfContext_GetDocumentMgr(pic,&docmgr); - ok(SUCCEEDED(hr),"GetDocumenMgr failed\n"); + ok(SUCCEEDED(hr),"GetDocumentMgr failed\n"); test = (ITfContext*)0xdeadbeef; ITfDocumentMgr_Release(docmgr); hr = ITfDocumentMgr_GetTop(docmgr,&test); @@ -534,7 +579,7 @@ ITfContext *test; hr = ITfContext_GetDocumentMgr(pic,&docmgr); - ok(SUCCEEDED(hr),"GetDocumenMgr failed\n"); + ok(SUCCEEDED(hr),"GetDocumentMgr failed\n"); ITfDocumentMgr_Release(docmgr); test = (ITfContext*)0xdeadbeef; hr = ITfDocumentMgr_GetTop(docmgr,&test); @@ -568,7 +613,7 @@ if (This == NULL) return E_OUTOFMEMORY; - This->ThreadMgrEventSinkVtbl = &ThreadMgrEventSink_ThreadMgrEventSinkVtbl; + This->ITfThreadMgrEventSink_iface.lpVtbl = &ThreadMgrEventSink_ThreadMgrEventSinkVtbl; This->refCount = 1; *ppOut = (IUnknown *)This; @@ -588,16 +633,26 @@ typedef struct tagClassFactory { - const IClassFactoryVtbl *vtbl; + IClassFactory IClassFactory_iface; LONG ref; LPFNCONSTRUCTOR ctor; } ClassFactory; +static inline ClassFactory *impl_from_IClassFactory(IClassFactory *iface) +{ + return CONTAINING_RECORD(iface, ClassFactory, IClassFactory_iface); +} + typedef struct tagTextService { - const ITfTextInputProcessorVtbl *TextInputProcessorVtbl; + ITfTextInputProcessor ITfTextInputProcessor_iface; LONG refCount; } TextService; + +static inline TextService *impl_from_ITfTextInputProcessor(ITfTextInputProcessor *iface) +{ + return CONTAINING_RECORD(iface, TextService, ITfTextInputProcessor_iface); +} static void ClassFactory_Destructor(ClassFactory *This) { @@ -620,13 +675,13 @@ static ULONG WINAPI ClassFactory_AddRef(IClassFactory *iface) { - ClassFactory *This = (ClassFactory *)iface; + ClassFactory *This = impl_from_IClassFactory(iface); return InterlockedIncrement(&This->ref); } static ULONG WINAPI ClassFactory_Release(IClassFactory *iface) { - ClassFactory *This = (ClassFactory *)iface; + ClassFactory *This = impl_from_IClassFactory(iface); ULONG ret = InterlockedDecrement(&This->ref); if (ret == 0) @@ -636,7 +691,7 @@ static HRESULT WINAPI ClassFactory_CreateInstance(IClassFactory *iface, IUnknown *punkOuter, REFIID iid, LPVOID *ppvOut) { - ClassFactory *This = (ClassFactory *)iface; + ClassFactory *This = impl_from_IClassFactory(iface); HRESULT ret; IUnknown *obj; @@ -672,7 +727,7 @@ static HRESULT ClassFactory_Constructor(LPFNCONSTRUCTOR ctor, LPVOID *ppvOut) { ClassFactory *This = HeapAlloc(GetProcessHeap(),0,sizeof(ClassFactory)); - This->vtbl = &ClassFactoryVtbl; + This->IClassFactory_iface.lpVtbl = &ClassFactoryVtbl; This->ref = 1; This->ctor = ctor; *ppvOut = (LPVOID)This; @@ -687,7 +742,7 @@ static HRESULT WINAPI TextService_QueryInterface(ITfTextInputProcessor *iface, REFIID iid, LPVOID *ppvOut) { - TextService *This = (TextService *)iface; + TextService *This = impl_from_ITfTextInputProcessor(iface); *ppvOut = NULL; if (IsEqualIID(iid, &IID_IUnknown) || IsEqualIID(iid, &IID_ITfTextInputProcessor)) @@ -706,13 +761,13 @@ static ULONG WINAPI TextService_AddRef(ITfTextInputProcessor *iface) { - TextService *This = (TextService *)iface; + TextService *This = impl_from_ITfTextInputProcessor(iface); return InterlockedIncrement(&This->refCount); } static ULONG WINAPI TextService_Release(ITfTextInputProcessor *iface) { - TextService *This = (TextService *)iface; + TextService *This = impl_from_ITfTextInputProcessor(iface); ULONG ret; ret = InterlockedDecrement(&This->refCount); @@ -757,7 +812,7 @@ if (This == NULL) return E_OUTOFMEMORY; - This->TextInputProcessorVtbl= &TextService_TextInputProcessorVtbl; + This->ITfTextInputProcessor_iface.lpVtbl = &TextService_TextInputProcessorVtbl; This->refCount = 1; *ppOut = (IUnknown *)This; @@ -970,7 +1025,7 @@ ok(SUCCEEDED(hr),"Failed to Advise Sink\n"); ok(tmSinkCookie!=0,"Failed to get sink cookie\n"); - /* Advising the sink adds a ref, Relesing here lets the object be deleted + /* Advising the sink adds a ref, Releasing here lets the object be deleted when unadvised */ tmSinkRefCount = 2; IUnknown_Release(sink); @@ -998,10 +1053,15 @@ **********************************************************************/ typedef struct tagKeyEventSink { - const ITfKeyEventSinkVtbl *KeyEventSinkVtbl; + ITfKeyEventSink ITfKeyEventSink_iface; LONG refCount; } KeyEventSink; +static inline KeyEventSink *impl_from_ITfKeyEventSink(ITfKeyEventSink *iface) +{ + return CONTAINING_RECORD(iface, KeyEventSink, ITfKeyEventSink_iface); +} + static void KeyEventSink_Destructor(KeyEventSink *This) { HeapFree(GetProcessHeap(),0,This); @@ -1009,7 +1069,7 @@ static HRESULT WINAPI KeyEventSink_QueryInterface(ITfKeyEventSink *iface, REFIID iid, LPVOID *ppvOut) { - KeyEventSink *This = (KeyEventSink *)iface; + KeyEventSink *This = impl_from_ITfKeyEventSink(iface); *ppvOut = NULL; if (IsEqualIID(iid, &IID_IUnknown) || IsEqualIID(iid, &IID_ITfKeyEventSink)) @@ -1028,13 +1088,13 @@ static ULONG WINAPI KeyEventSink_AddRef(ITfKeyEventSink *iface) { - KeyEventSink *This = (KeyEventSink *)iface; + KeyEventSink *This = impl_from_ITfKeyEventSink(iface); return InterlockedIncrement(&This->refCount); } static ULONG WINAPI KeyEventSink_Release(ITfKeyEventSink *iface) { - KeyEventSink *This = (KeyEventSink *)iface; + KeyEventSink *This = impl_from_ITfKeyEventSink(iface); ULONG ret; ret = InterlockedDecrement(&This->refCount); @@ -1107,10 +1167,10 @@ if (This == NULL) return E_OUTOFMEMORY; - This->KeyEventSinkVtbl = &KeyEventSink_KeyEventSinkVtbl; + This->ITfKeyEventSink_iface.lpVtbl = &KeyEventSink_KeyEventSinkVtbl; This->refCount = 1; - *ppOut = (ITfKeyEventSink*)This; + *ppOut = &This->ITfKeyEventSink_iface; return S_OK; } @@ -1175,8 +1235,10 @@ { HRESULT hr; + test_ShouldActivate = TRUE; /* Win7 */ hr = ITfInputProcessorProfiles_ActivateLanguageProfile(g_ipp,&CLSID_FakeService,gLangid,&CLSID_FakeService); ok(SUCCEEDED(hr),"Failed to Activate text service\n"); + test_ShouldActivate = FALSE; } @@ -1253,10 +1315,15 @@ **********************************************************************/ typedef struct tagTextEditSink { - const ITfTextEditSinkVtbl *TextEditSinkVtbl; + ITfTextEditSink ITfTextEditSink_iface; LONG refCount; } TextEditSink; +static inline TextEditSink *impl_from_ITfTextEditSink(ITfTextEditSink *iface) +{ + return CONTAINING_RECORD(iface, TextEditSink, ITfTextEditSink_iface); +} + static void TextEditSink_Destructor(TextEditSink *This) { HeapFree(GetProcessHeap(),0,This); @@ -1264,7 +1331,7 @@ static HRESULT WINAPI TextEditSink_QueryInterface(ITfTextEditSink *iface, REFIID iid, LPVOID *ppvOut) { - TextEditSink *This = (TextEditSink *)iface; + TextEditSink *This = impl_from_ITfTextEditSink(iface); *ppvOut = NULL; if (IsEqualIID(iid, &IID_IUnknown) || IsEqualIID(iid, &IID_ITfTextEditSink)) @@ -1283,13 +1350,13 @@ static ULONG WINAPI TextEditSink_AddRef(ITfTextEditSink *iface) { - TextEditSink *This = (TextEditSink *)iface; + TextEditSink *This = impl_from_ITfTextEditSink(iface); return InterlockedIncrement(&This->refCount); } static ULONG WINAPI TextEditSink_Release(ITfTextEditSink *iface) { - TextEditSink *This = (TextEditSink *)iface; + TextEditSink *This = impl_from_ITfTextEditSink(iface); ULONG ret; ret = InterlockedDecrement(&This->refCount); @@ -1323,10 +1390,10 @@ if (This == NULL) return E_OUTOFMEMORY; - This->TextEditSinkVtbl = &TextEditSink_TextEditSinkVtbl; + This->ITfTextEditSink_iface.lpVtbl = &TextEditSink_TextEditSinkVtbl; This->refCount = 1; - *ppOut = (ITfTextEditSink*)This; + *ppOut = &This->ITfTextEditSink_iface; return S_OK; } @@ -1377,7 +1444,7 @@ test_CurrentFocus = g_dm; test_PrevFocus = NULL; - test_OnSetFocus = SINK_EXPECTED; + test_OnSetFocus = SINK_OPTIONAL; /* Doesn't always fire on Win7 */ hr = ITfThreadMgr_SetFocus(g_tm,g_dm); ok(SUCCEEDED(hr),"SetFocus Failed\n"); sink_check_ok(&test_OnSetFocus,"OnSetFocus"); @@ -1386,18 +1453,19 @@ ok(SUCCEEDED(hr),"GetFocus Failed\n"); ok(g_dm == dmtest,"Expected DocumentMgr not focused\n"); - cnt = ITfDocumentMgr_Release(g_dm); - ok(cnt == 2,"DocumentMgr refcount not expected (2 vs %i)\n",cnt); + ITfDocumentMgr_Release(g_dm); hr = ITfThreadMgr_GetFocus(g_tm,&dmtest); ok(SUCCEEDED(hr),"GetFocus Failed\n"); ok(g_dm == dmtest,"Expected DocumentMgr not focused\n"); ITfDocumentMgr_Release(dmtest); - TextStoreACP_Constructor((IUnknown**)&ts); - - hr = ITfDocumentMgr_CreateContext(g_dm, cid, 0, (IUnknown*)ts, &cxt, &editCookie); - ok(SUCCEEDED(hr),"CreateContext Failed\n"); + hr = TextStoreACP_Constructor((IUnknown**)&ts); + if (SUCCEEDED(hr)) + { + hr = ITfDocumentMgr_CreateContext(g_dm, cid, 0, (IUnknown*)ts, &cxt, &editCookie); + ok(SUCCEEDED(hr),"CreateContext Failed\n"); + } hr = ITfDocumentMgr_CreateContext(g_dm, cid, 0, NULL, &cxt2, &editCookie); ok(SUCCEEDED(hr),"CreateContext Failed\n"); @@ -1522,7 +1590,7 @@ test_ShouldDeactivate = TRUE; test_CurrentFocus = NULL; test_PrevFocus = g_dm; - test_OnSetFocus = SINK_EXPECTED; + test_OnSetFocus = SINK_OPTIONAL; /* Doesn't fire on Win7 */ hr = ITfThreadMgr_Deactivate(g_tm); ok(SUCCEEDED(hr),"Failed to Deactivate\n"); sink_check_ok(&test_OnSetFocus,"OnSetFocus"); @@ -1603,10 +1671,15 @@ **********************************************************************/ typedef struct tagEditSession { - const ITfEditSessionVtbl *EditSessionVtbl; + ITfEditSession ITfEditSession_iface; LONG refCount; } EditSession; +static inline EditSession *impl_from_ITfEditSession(ITfEditSession *iface) +{ + return CONTAINING_RECORD(iface, EditSession, ITfEditSession_iface); +} + static void EditSession_Destructor(EditSession *This) { HeapFree(GetProcessHeap(),0,This); @@ -1614,7 +1687,7 @@ static HRESULT WINAPI EditSession_QueryInterface(ITfEditSession *iface, REFIID iid, LPVOID *ppvOut) { - EditSession *This = (EditSession *)iface; + EditSession *This = impl_from_ITfEditSession(iface); *ppvOut = NULL; if (IsEqualIID(iid, &IID_IUnknown) || IsEqualIID(iid, &IID_ITfEditSession)) @@ -1633,13 +1706,13 @@ static ULONG WINAPI EditSession_AddRef(ITfEditSession *iface) { - EditSession *This = (EditSession *)iface; + EditSession *This = impl_from_ITfEditSession(iface); return InterlockedIncrement(&This->refCount); } static ULONG WINAPI EditSession_Release(ITfEditSession *iface) { - EditSession *This = (EditSession *)iface; + EditSession *This = impl_from_ITfEditSession(iface); ULONG ret; ret = InterlockedDecrement(&This->refCount); @@ -1734,6 +1807,7 @@ selection.style.fInterimChar = FALSE; test_ACP_SetSelection = SINK_EXPECTED; hr = ITfContext_SetSelection(cxt, ec, 1, &selection); + ok(SUCCEEDED(hr),"ITfContext_SetSelection failed\n"); sink_check_ok(&test_ACP_SetSelection,"SetSelection"); ITfRange_Release(range); @@ -1760,10 +1834,10 @@ if (This == NULL) return E_OUTOFMEMORY; - This->EditSessionVtbl = &EditSession_EditSessionVtbl; + This->ITfEditSession_iface.lpVtbl = &EditSession_EditSessionVtbl; This->refCount = 1; - *ppOut = (ITfEditSession*)This; + *ppOut = &This->ITfEditSession_iface; return S_OK; } @@ -1792,7 +1866,7 @@ } hrSession = 0xfeedface; - /* Test no premissions flags */ + /* Test no permissions flags */ hr = ITfContext_RequestEditSession(cxt, tid, es, TF_ES_SYNC, &hrSession); ok(hr == E_INVALIDARG,"RequestEditSession should have failed with %x not %x\n",E_INVALIDARG,hr); ok(hrSession == E_FAIL,"hrSession should be %x not %x\n",E_FAIL,hrSession); @@ -1919,9 +1993,20 @@ static void processPendingMessages(void) { MSG msg; - while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) { - TranslateMessage(&msg); - DispatchMessage(&msg); + int diff = 200; + int min_timeout = 100; + DWORD time = GetTickCount() + diff; + + while (diff > 0) + { + if (MsgWaitForMultipleObjects(0, NULL, FALSE, min_timeout, QS_ALLINPUT) == WAIT_TIMEOUT) + break; + while (PeekMessage(&msg, 0, 0, 0, PM_REMOVE)) + { + TranslateMessage(&msg); + DispatchMessage(&msg); + } + diff = time - GetTickCount(); } } @@ -1934,9 +2019,12 @@ ITfThreadMgr_GetFocus(g_tm, &dmorig); test_CurrentFocus = NULL; test_PrevFocus = dmorig; - test_OnSetFocus = SINK_EXPECTED; + test_OnSetFocus = SINK_OPTIONAL; /* Doesn't always fire on Win7 */ + test_ACP_GetStatus = SINK_OPTIONAL; hr = ITfThreadMgr_SetFocus(g_tm,NULL); + ok(SUCCEEDED(hr),"ITfThreadMgr_SetFocus failed\n"); sink_check_ok(&test_OnSetFocus,"OnSetFocus"); + test_ACP_GetStatus = SINK_UNEXPECTED; ITfDocumentMgr_Release(dmorig); hr = ITfThreadMgr_CreateDocumentMgr(g_tm,&dm1); @@ -1956,30 +2044,52 @@ test_OnInitDocumentMgr = SINK_OPTIONAL; /* Vista and greater */ test_OnPushContext = SINK_OPTIONAL; /* Vista and greater */ + test_OnSetFocus = SINK_OPTIONAL; /* Win7 */ + test_PrevFocus = NULL; + test_CurrentFocus = FOCUS_IGNORE; ShowWindow(wnd1,SW_SHOWNORMAL); + test_OnSetFocus = SINK_UNEXPECTED; SetFocus(wnd1); sink_check_ok(&test_OnInitDocumentMgr,"OnInitDocumentMgr"); sink_check_ok(&test_OnPushContext,"OnPushContext"); test_OnSetFocus = SINK_OPTIONAL; /* Vista and greater */ + test_ACP_RequestLock = SINK_OPTIONAL; /* Win7 x64 */ + test_ACP_GetSelection = SINK_OPTIONAL; /* Win7 x64 */ ITfThreadMgr_GetFocus(g_tm, &test_PrevFocus); test_CurrentFocus = FOCUS_IGNORE; /* This is a default system context */ processPendingMessages(); sink_check_ok(&test_OnSetFocus,"OnSetFocus"); + test_ACP_RequestLock = SINK_UNEXPECTED; + test_ACP_GetSelection = SINK_UNEXPECTED; test_CurrentFocus = dm1; test_PrevFocus = FOCUS_IGNORE; - test_OnSetFocus = SINK_EXPECTED; + test_OnSetFocus = SINK_OPTIONAL; + test_ShouldDeactivate = SINK_OPTIONAL; hr = ITfThreadMgr_AssociateFocus(g_tm,wnd1,dm1,&olddm); ok(SUCCEEDED(hr),"AssociateFocus failed\n"); sink_check_ok(&test_OnSetFocus,"OnSetFocus"); + test_ShouldDeactivate = SINK_UNEXPECTED; processPendingMessages(); ITfThreadMgr_GetFocus(g_tm, &dmcheck); - ok(dmcheck == dm1, "Expected DocumentMgr not focused\n"); - ITfDocumentMgr_Release(dmcheck); + if (dmcheck != NULL) + { + ok(dmcheck == dm1, "Expected DocumentMgr not focused\n"); + ITfDocumentMgr_Release(dmcheck); + } + else + { + /* Sometimes we need to explicitly set focus on Win7 */ + test_CurrentFocus = dm1; + test_PrevFocus = FOCUS_IGNORE; + test_OnSetFocus = SINK_EXPECTED; + ITfThreadMgr_SetFocus(g_tm, dm1); + sink_check_ok(&test_OnSetFocus,"OnSetFocus"); + } hr = ITfThreadMgr_AssociateFocus(g_tm,wnd2,dm2,&olddm); ok(SUCCEEDED(hr),"AssociateFocus failed\n"); @@ -1995,12 +2105,12 @@ ok(dmcheck == dm1, "Expected DocumentMgr not focused\n"); ITfDocumentMgr_Release(dmcheck); - test_CurrentFocus = dm2; - test_PrevFocus = dm1; - test_OnSetFocus = SINK_OPTIONAL; /* wine and Winxp */ + test_CurrentFocus = FOCUS_SAVE; + test_PrevFocus = FOCUS_SAVE; + test_OnSetFocus = SINK_SAVE; ShowWindow(wnd2,SW_SHOWNORMAL); SetFocus(wnd2); - sink_check_ok(&test_OnSetFocus,"OnSetFocus"); + sink_check_saved(&test_OnSetFocus,dm1,dm2,"OnSetFocus"); test_CurrentFocus = FOCUS_IGNORE; /* occasional wine race */ test_PrevFocus = FOCUS_IGNORE; /* occasional wine race */ test_OnSetFocus = SINK_IGNORE; /* occasional wine race */ @@ -2010,12 +2120,12 @@ SetFocus(wnd3); processPendingMessages(); - test_CurrentFocus = dm1; - test_PrevFocus = dm2; - test_OnSetFocus = SINK_EXPECTED; + test_CurrentFocus = FOCUS_SAVE; + test_PrevFocus = FOCUS_SAVE; + test_OnSetFocus = SINK_SAVE; SetFocus(wnd1); processPendingMessages(); - sink_check_ok(&test_OnSetFocus,"OnSetFocus"); + sink_check_saved(&test_OnSetFocus,dm2,dm1,"OnSetFocus"); hr = ITfThreadMgr_AssociateFocus(g_tm,wnd3,NULL,&olddm); ok(SUCCEEDED(hr),"AssociateFocus failed\n"); @@ -2025,16 +2135,16 @@ test_CurrentFocus = dmorig; test_PrevFocus = dm1; test_OnSetFocus = SINK_EXPECTED; - test_ACP_GetStatus = SINK_EXPECTED; + test_ACP_GetStatus = SINK_IGNORE; ITfThreadMgr_SetFocus(g_tm,dmorig); sink_check_ok(&test_OnSetFocus,"OnSetFocus"); - test_CurrentFocus = FOCUS_IGNORE; /* NULL on XP, system default on Vista */ - test_PrevFocus = dmorig; - test_OnSetFocus = SINK_EXPECTED; + test_CurrentFocus = FOCUS_SAVE; + test_PrevFocus = FOCUS_SAVE; + test_OnSetFocus = SINK_SAVE; SetFocus(wnd3); processPendingMessages(); - sink_check_ok(&test_OnSetFocus,"OnSetFocus"); + sink_check_saved(&test_OnSetFocus,dmorig,FOCUS_IGNORE,"OnSetFocus"); /* CurrentFocus NULL on XP, system default on Vista */ hr = ITfThreadMgr_AssociateFocus(g_tm,wnd2,NULL,&olddm); ok(SUCCEEDED(hr),"AssociateFocus failed\n"); @@ -2045,28 +2155,38 @@ ok(olddm == dm1, "incorrect old DocumentMgr returned\n"); ITfDocumentMgr_Release(olddm); + test_OnSetFocus = SINK_IGNORE; /* OnSetFocus fires a couple of times on Win7 */ + test_CurrentFocus = FOCUS_IGNORE; + test_PrevFocus = FOCUS_IGNORE; SetFocus(wnd2); processPendingMessages(); SetFocus(wnd1); processPendingMessages(); + test_OnSetFocus = SINK_UNEXPECTED; ITfDocumentMgr_Release(dm1); ITfDocumentMgr_Release(dm2); test_CurrentFocus = dmorig; test_PrevFocus = FOCUS_IGNORE; - test_OnSetFocus = SINK_EXPECTED; + test_OnSetFocus = SINK_OPTIONAL; test_ACP_GetStatus = SINK_IGNORE; ITfThreadMgr_SetFocus(g_tm,dmorig); sink_check_ok(&test_OnSetFocus,"OnSetFocus"); + test_OnSetFocus = SINK_IGNORE; /* OnSetFocus fires a couple of times on Win7 */ + test_CurrentFocus = FOCUS_IGNORE; + test_PrevFocus = FOCUS_IGNORE; DestroyWindow(wnd1); DestroyWindow(wnd2); + test_OnSetFocus = SINK_UNEXPECTED; test_OnPopContext = SINK_OPTIONAL; /* Vista and greater */ test_OnSetFocus = SINK_OPTIONAL; /* Vista and greater */ ITfThreadMgr_GetFocus(g_tm, &test_PrevFocus); test_CurrentFocus = NULL; + test_ShouldDeactivate = TRUE; /* Win7 */ DestroyWindow(wnd3); + test_ShouldDeactivate = FALSE; sink_check_ok(&test_OnSetFocus,"OnSetFocus"); sink_check_ok(&test_OnPopContext,"OnPopContext"); } @@ -2077,6 +2197,8 @@ { test_Register(); test_RegisterCategory(); + Sleep(2000); /* Win7 needs some time before the registrations become active */ + processPendingMessages(); test_EnumLanguageProfiles(); test_EnumInputProcessorInfo(); test_Enable();
12 years, 11 months
1
0
0
0
[akhaldi] 55250: [MSCTF] * Sync to Wine 1.3.37.
by akhaldi@svn.reactos.org
Author: akhaldi Date: Fri Jan 27 17:31:52 2012 New Revision: 55250 URL:
http://svn.reactos.org/svn/reactos?rev=55250&view=rev
Log: [MSCTF] * Sync to Wine 1.3.37. Added: trunk/reactos/dll/win32/msctf/msctf.rgs (with props) trunk/reactos/dll/win32/msctf/msctf_classes.idl (with props) Modified: trunk/reactos/dll/win32/msctf/CMakeLists.txt trunk/reactos/dll/win32/msctf/categorymgr.c trunk/reactos/dll/win32/msctf/compartmentmgr.c trunk/reactos/dll/win32/msctf/context.c trunk/reactos/dll/win32/msctf/displayattributemgr.c trunk/reactos/dll/win32/msctf/documentmgr.c trunk/reactos/dll/win32/msctf/inputprocessor.c trunk/reactos/dll/win32/msctf/langbarmgr.c trunk/reactos/dll/win32/msctf/msctf.c trunk/reactos/dll/win32/msctf/msctf.rbuild trunk/reactos/dll/win32/msctf/msctf_internal.h trunk/reactos/dll/win32/msctf/range.c trunk/reactos/dll/win32/msctf/threadmgr.c trunk/reactos/dll/win32/msctf/version.rc trunk/reactos/media/doc/README.WINE Modified: trunk/reactos/dll/win32/msctf/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msctf/CMakeLists…
============================================================================== --- trunk/reactos/dll/win32/msctf/CMakeLists.txt [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msctf/CMakeLists.txt [iso-8859-1] Fri Jan 27 17:31:52 2012 @@ -20,7 +20,6 @@ langbarmgr.c msctf.c range.c - regsvr.c threadmgr.c version.rc ${CMAKE_CURRENT_BINARY_DIR}/msctf_stubs.c Modified: trunk/reactos/dll/win32/msctf/categorymgr.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msctf/categorymg…
============================================================================== --- trunk/reactos/dll/win32/msctf/categorymgr.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msctf/categorymgr.c [iso-8859-1] Fri Jan 27 17:31:52 2012 @@ -41,10 +41,15 @@ WINE_DEFAULT_DEBUG_CHANNEL(msctf); typedef struct tagCategoryMgr { - const ITfCategoryMgrVtbl *CategoryMgrVtbl; + ITfCategoryMgr ITfCategoryMgr_iface; LONG refCount; } CategoryMgr; +static inline CategoryMgr *impl_from_ITfCategoryMgr(ITfCategoryMgr *iface) +{ + return CONTAINING_RECORD(iface, CategoryMgr, ITfCategoryMgr_iface); +} + static void CategoryMgr_Destructor(CategoryMgr *This) { TRACE("destroying %p\n", This); @@ -53,7 +58,7 @@ static HRESULT WINAPI CategoryMgr_QueryInterface(ITfCategoryMgr *iface, REFIID iid, LPVOID *ppvOut) { - CategoryMgr *This = (CategoryMgr *)iface; + CategoryMgr *This = impl_from_ITfCategoryMgr(iface); *ppvOut = NULL; if (IsEqualIID(iid, &IID_IUnknown) || IsEqualIID(iid, &IID_ITfCategoryMgr)) @@ -73,13 +78,13 @@ static ULONG WINAPI CategoryMgr_AddRef(ITfCategoryMgr *iface) { - CategoryMgr *This = (CategoryMgr *)iface; + CategoryMgr *This = impl_from_ITfCategoryMgr(iface); return InterlockedIncrement(&This->refCount); } static ULONG WINAPI CategoryMgr_Release(ITfCategoryMgr *iface) { - CategoryMgr *This = (CategoryMgr *)iface; + CategoryMgr *This = impl_from_ITfCategoryMgr(iface); ULONG ret; ret = InterlockedDecrement(&This->refCount); @@ -100,7 +105,7 @@ WCHAR buf2[39]; ULONG res; HKEY tipkey,catkey,itmkey; - CategoryMgr *This = (CategoryMgr*)iface; + CategoryMgr *This = impl_from_ITfCategoryMgr(iface); static const WCHAR ctg[] = {'C','a','t','e','g','o','r','y',0}; static const WCHAR itm[] = {'I','t','e','m',0}; @@ -148,7 +153,7 @@ WCHAR buf[39]; WCHAR buf2[39]; HKEY tipkey; - CategoryMgr *This = (CategoryMgr*)iface; + CategoryMgr *This = impl_from_ITfCategoryMgr(iface); static const WCHAR ctg[] = {'C','a','t','e','g','o','r','y',0}; static const WCHAR itm[] = {'I','t','e','m',0}; @@ -180,7 +185,7 @@ static HRESULT WINAPI CategoryMgr_EnumCategoriesInItem ( ITfCategoryMgr *iface, REFGUID rguid, IEnumGUID **ppEnum) { - CategoryMgr *This = (CategoryMgr*)iface; + CategoryMgr *This = impl_from_ITfCategoryMgr(iface); FIXME("STUB:(%p)\n",This); return E_NOTIMPL; } @@ -188,7 +193,7 @@ static HRESULT WINAPI CategoryMgr_EnumItemsInCategory ( ITfCategoryMgr *iface, REFGUID rcatid, IEnumGUID **ppEnum) { - CategoryMgr *This = (CategoryMgr*)iface; + CategoryMgr *This = impl_from_ITfCategoryMgr(iface); FIXME("STUB:(%p)\n",This); return E_NOTIMPL; } @@ -198,12 +203,12 @@ { static const WCHAR fmt[] = { '%','s','\\','%','s','\\','C','a','t','e','g','o','r','y','\\','I','t','e','m','\\','%','s',0}; - WCHAR fullkey[110]; + WCHAR fullkey[120]; WCHAR buf[39]; HKEY key; HRESULT hr = S_FALSE; INT index = 0; - CategoryMgr *This = (CategoryMgr*)iface; + CategoryMgr *This = impl_from_ITfCategoryMgr(iface); TRACE("(%p)\n",This); @@ -263,7 +268,7 @@ ITfCategoryMgr *iface, REFCLSID rclsid, REFGUID rguid, const WCHAR *pchDesc, ULONG cch) { - CategoryMgr *This = (CategoryMgr*)iface; + CategoryMgr *This = impl_from_ITfCategoryMgr(iface); FIXME("STUB:(%p)\n",This); return E_NOTIMPL; } @@ -271,7 +276,7 @@ static HRESULT WINAPI CategoryMgr_UnregisterGUIDDescription ( ITfCategoryMgr *iface, REFCLSID rclsid, REFGUID rguid) { - CategoryMgr *This = (CategoryMgr*)iface; + CategoryMgr *This = impl_from_ITfCategoryMgr(iface); FIXME("STUB:(%p)\n",This); return E_NOTIMPL; } @@ -279,7 +284,7 @@ static HRESULT WINAPI CategoryMgr_GetGUIDDescription ( ITfCategoryMgr *iface, REFGUID rguid, BSTR *pbstrDesc) { - CategoryMgr *This = (CategoryMgr*)iface; + CategoryMgr *This = impl_from_ITfCategoryMgr(iface); FIXME("STUB:(%p)\n",This); return E_NOTIMPL; } @@ -287,7 +292,7 @@ static HRESULT WINAPI CategoryMgr_RegisterGUIDDWORD ( ITfCategoryMgr *iface, REFCLSID rclsid, REFGUID rguid, DWORD dw) { - CategoryMgr *This = (CategoryMgr*)iface; + CategoryMgr *This = impl_from_ITfCategoryMgr(iface); FIXME("STUB:(%p)\n",This); return E_NOTIMPL; } @@ -295,7 +300,7 @@ static HRESULT WINAPI CategoryMgr_UnregisterGUIDDWORD ( ITfCategoryMgr *iface, REFCLSID rclsid, REFGUID rguid) { - CategoryMgr *This = (CategoryMgr*)iface; + CategoryMgr *This = impl_from_ITfCategoryMgr(iface); FIXME("STUB:(%p)\n",This); return E_NOTIMPL; } @@ -303,7 +308,7 @@ static HRESULT WINAPI CategoryMgr_GetGUIDDWORD ( ITfCategoryMgr *iface, REFGUID rguid, DWORD *pdw) { - CategoryMgr *This = (CategoryMgr*)iface; + CategoryMgr *This = impl_from_ITfCategoryMgr(iface); FIXME("STUB:(%p)\n",This); return E_NOTIMPL; } @@ -315,7 +320,7 @@ DWORD index; GUID *checkguid; DWORD id; - CategoryMgr *This = (CategoryMgr*)iface; + CategoryMgr *This = impl_from_ITfCategoryMgr(iface); TRACE("(%p) %s %p\n",This,debugstr_guid(rguid),pguidatom); @@ -350,7 +355,7 @@ static HRESULT WINAPI CategoryMgr_GetGUID ( ITfCategoryMgr *iface, TfGuidAtom guidatom, GUID *pguid) { - CategoryMgr *This = (CategoryMgr*)iface; + CategoryMgr *This = impl_from_ITfCategoryMgr(iface); TRACE("(%p) %i\n",This,guidatom); @@ -368,7 +373,7 @@ static HRESULT WINAPI CategoryMgr_IsEqualTfGuidAtom ( ITfCategoryMgr *iface, TfGuidAtom guidatom, REFGUID rguid, BOOL *pfEqual) { - CategoryMgr *This = (CategoryMgr*)iface; + CategoryMgr *This = impl_from_ITfCategoryMgr(iface); TRACE("(%p) %i %s %p\n",This,guidatom,debugstr_guid(rguid),pfEqual); @@ -418,7 +423,7 @@ if (This == NULL) return E_OUTOFMEMORY; - This->CategoryMgrVtbl= &CategoryMgr_CategoryMgrVtbl; + This->ITfCategoryMgr_iface.lpVtbl = &CategoryMgr_CategoryMgrVtbl; This->refCount = 1; TRACE("returning %p\n", This); Modified: trunk/reactos/dll/win32/msctf/compartmentmgr.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msctf/compartmen…
============================================================================== --- trunk/reactos/dll/win32/msctf/compartmentmgr.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msctf/compartmentmgr.c [iso-8859-1] Fri Jan 27 17:31:52 2012 @@ -284,7 +284,7 @@ } /************************************************** - * IEnumGUID implementaion for ITfCompartmentMgr::EnumCompartments + * IEnumGUID implementation for ITfCompartmentMgr::EnumCompartments **************************************************/ static void CompartmentEnumGuid_Destructor(CompartmentEnumGuid *This) { Modified: trunk/reactos/dll/win32/msctf/context.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msctf/context.c?…
============================================================================== --- trunk/reactos/dll/win32/msctf/context.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msctf/context.c [iso-8859-1] Fri Jan 27 17:31:52 2012 @@ -262,7 +262,7 @@ if (!This->pITextStoreACP) { - FIXME("No ITextStoreACP avaliable\n"); + FIXME("No ITextStoreACP available\n"); *phrSession = E_FAIL; return E_FAIL; } Modified: trunk/reactos/dll/win32/msctf/displayattributemgr.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msctf/displayatt…
============================================================================== --- trunk/reactos/dll/win32/msctf/displayattributemgr.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msctf/displayattributemgr.c [iso-8859-1] Fri Jan 27 17:31:52 2012 @@ -31,11 +31,16 @@ WINE_DEFAULT_DEBUG_CHANNEL(msctf); typedef struct tagDisplayAttributeMgr { - const ITfDisplayAttributeMgrVtbl *DisplayAttributeMgrVtbl; + ITfDisplayAttributeMgr ITfDisplayAttributeMgr_iface; LONG refCount; } DisplayAttributeMgr; + +static inline DisplayAttributeMgr *impl_from_ITfDisplayAttributeMgr(ITfDisplayAttributeMgr *iface) +{ + return CONTAINING_RECORD(iface, DisplayAttributeMgr, ITfDisplayAttributeMgr_iface); +} static void DisplayAttributeMgr_Destructor(DisplayAttributeMgr *This) { @@ -46,7 +51,7 @@ static HRESULT WINAPI DisplayAttributeMgr_QueryInterface(ITfDisplayAttributeMgr *iface, REFIID iid, LPVOID *ppvOut) { - DisplayAttributeMgr *This = (DisplayAttributeMgr *)iface; + DisplayAttributeMgr *This = impl_from_ITfDisplayAttributeMgr(iface); *ppvOut = NULL; if (IsEqualIID(iid, &IID_IUnknown) || IsEqualIID(iid, &IID_ITfDisplayAttributeMgr)) @@ -66,13 +71,13 @@ static ULONG WINAPI DisplayAttributeMgr_AddRef(ITfDisplayAttributeMgr *iface) { - DisplayAttributeMgr *This = (DisplayAttributeMgr *)iface; + DisplayAttributeMgr *This = impl_from_ITfDisplayAttributeMgr(iface); return InterlockedIncrement(&This->refCount); } static ULONG WINAPI DisplayAttributeMgr_Release(ITfDisplayAttributeMgr *iface) { - DisplayAttributeMgr *This = (DisplayAttributeMgr *)iface; + DisplayAttributeMgr *This = impl_from_ITfDisplayAttributeMgr(iface); ULONG ret; ret = InterlockedDecrement(&This->refCount); @@ -87,7 +92,7 @@ static HRESULT WINAPI DisplayAttributeMgr_OnUpdateInfo(ITfDisplayAttributeMgr *iface) { - DisplayAttributeMgr *This = (DisplayAttributeMgr *)iface; + DisplayAttributeMgr *This = impl_from_ITfDisplayAttributeMgr(iface); FIXME("STUB:(%p)\n",This); return E_NOTIMPL; @@ -95,7 +100,7 @@ static HRESULT WINAPI DisplayAttributeMgr_EnumDisplayAttributeInfo(ITfDisplayAttributeMgr *iface, IEnumTfDisplayAttributeInfo **ppEnum) { - DisplayAttributeMgr *This = (DisplayAttributeMgr *)iface; + DisplayAttributeMgr *This = impl_from_ITfDisplayAttributeMgr(iface); FIXME("STUB:(%p)\n",This); return E_NOTIMPL; @@ -103,7 +108,7 @@ static HRESULT WINAPI DisplayAttributeMgr_GetDisplayAttributeInfo(ITfDisplayAttributeMgr *iface, REFGUID guid, ITfDisplayAttributeInfo **ppInfo, CLSID *pclsidOwner) { - DisplayAttributeMgr *This = (DisplayAttributeMgr *)iface; + DisplayAttributeMgr *This = impl_from_ITfDisplayAttributeMgr(iface); FIXME("STUB:(%p)\n",This); return E_NOTIMPL; @@ -130,7 +135,7 @@ if (This == NULL) return E_OUTOFMEMORY; - This->DisplayAttributeMgrVtbl= &DisplayAttributeMgr_DisplayAttributeMgrVtbl; + This->ITfDisplayAttributeMgr_iface.lpVtbl = &DisplayAttributeMgr_DisplayAttributeMgrVtbl; This->refCount = 1; TRACE("returning %p\n", This); Modified: trunk/reactos/dll/win32/msctf/documentmgr.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msctf/documentmg…
============================================================================== --- trunk/reactos/dll/win32/msctf/documentmgr.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msctf/documentmgr.c [iso-8859-1] Fri Jan 27 17:31:52 2012 @@ -41,8 +41,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(msctf); typedef struct tagDocumentMgr { - const ITfDocumentMgrVtbl *DocumentMgrVtbl; - const ITfSourceVtbl *SourceVtbl; + ITfDocumentMgr ITfDocumentMgr_iface; + ITfSource ITfSource_iface; LONG refCount; /* Aggregation */ @@ -53,7 +53,7 @@ } DocumentMgr; typedef struct tagEnumTfContext { - const IEnumTfContextsVtbl *Vtbl; + IEnumTfContexts IEnumTfContexts_iface; LONG refCount; DWORD index; @@ -62,9 +62,19 @@ static HRESULT EnumTfContext_Constructor(DocumentMgr* mgr, IEnumTfContexts **ppOut); -static inline DocumentMgr *impl_from_ITfSourceVtbl(ITfSource *iface) -{ - return (DocumentMgr *)((char *)iface - FIELD_OFFSET(DocumentMgr,SourceVtbl)); +static inline DocumentMgr *impl_from_ITfDocumentMgr(ITfDocumentMgr *iface) +{ + return CONTAINING_RECORD(iface, DocumentMgr, ITfDocumentMgr_iface); +} + +static inline DocumentMgr *impl_from_ITfSource(ITfSource *iface) +{ + return CONTAINING_RECORD(iface, DocumentMgr, ITfSource_iface); +} + +static inline EnumTfContext *impl_from_IEnumTfContexts(IEnumTfContexts *iface)\ +{ + return CONTAINING_RECORD(iface, EnumTfContext, IEnumTfContexts_iface); } static void DocumentMgr_Destructor(DocumentMgr *This) @@ -73,7 +83,7 @@ TRACE("destroying %p\n", This); TF_GetThreadMgr(&tm); - ThreadMgr_OnDocumentMgrDestruction(tm, (ITfDocumentMgr*)This); + ThreadMgr_OnDocumentMgrDestruction(tm, &This->ITfDocumentMgr_iface); if (This->contextStack[0]) ITfContext_Release(This->contextStack[0]); @@ -85,7 +95,7 @@ static HRESULT WINAPI DocumentMgr_QueryInterface(ITfDocumentMgr *iface, REFIID iid, LPVOID *ppvOut) { - DocumentMgr *This = (DocumentMgr *)iface; + DocumentMgr *This = impl_from_ITfDocumentMgr(iface); *ppvOut = NULL; if (IsEqualIID(iid, &IID_IUnknown) || IsEqualIID(iid, &IID_ITfDocumentMgr)) @@ -94,7 +104,7 @@ } else if (IsEqualIID(iid, &IID_ITfSource)) { - *ppvOut = &This->SourceVtbl; + *ppvOut = &This->ITfSource_iface; } else if (IsEqualIID(iid, &IID_ITfCompartmentMgr)) { @@ -113,13 +123,13 @@ static ULONG WINAPI DocumentMgr_AddRef(ITfDocumentMgr *iface) { - DocumentMgr *This = (DocumentMgr *)iface; + DocumentMgr *This = impl_from_ITfDocumentMgr(iface); return InterlockedIncrement(&This->refCount); } static ULONG WINAPI DocumentMgr_Release(ITfDocumentMgr *iface) { - DocumentMgr *This = (DocumentMgr *)iface; + DocumentMgr *This = impl_from_ITfDocumentMgr(iface); ULONG ret; ret = InterlockedDecrement(&This->refCount); @@ -136,14 +146,14 @@ DWORD dwFlags, IUnknown *punk, ITfContext **ppic, TfEditCookie *pecTextStore) { - DocumentMgr *This = (DocumentMgr *)iface; + DocumentMgr *This = impl_from_ITfDocumentMgr(iface); TRACE("(%p) 0x%x 0x%x %p %p %p\n",This,tidOwner,dwFlags,punk,ppic,pecTextStore); return Context_Constructor(tidOwner, punk, iface, ppic, pecTextStore); } static HRESULT WINAPI DocumentMgr_Push(ITfDocumentMgr *iface, ITfContext *pic) { - DocumentMgr *This = (DocumentMgr *)iface; + DocumentMgr *This = impl_from_ITfDocumentMgr(iface); ITfContext *check; TRACE("(%p) %p\n",This,pic); @@ -168,7 +178,7 @@ static HRESULT WINAPI DocumentMgr_Pop(ITfDocumentMgr *iface, DWORD dwFlags) { - DocumentMgr *This = (DocumentMgr *)iface; + DocumentMgr *This = impl_from_ITfDocumentMgr(iface); TRACE("(%p) 0x%x\n",This,dwFlags); if (dwFlags == TF_POPF_ALL) @@ -210,7 +220,7 @@ static HRESULT WINAPI DocumentMgr_GetTop(ITfDocumentMgr *iface, ITfContext **ppic) { - DocumentMgr *This = (DocumentMgr *)iface; + DocumentMgr *This = impl_from_ITfDocumentMgr(iface); TRACE("(%p)\n",This); if (!ppic) return E_INVALIDARG; @@ -225,7 +235,7 @@ static HRESULT WINAPI DocumentMgr_GetBase(ITfDocumentMgr *iface, ITfContext **ppic) { - DocumentMgr *This = (DocumentMgr *)iface; + DocumentMgr *This = impl_from_ITfDocumentMgr(iface); ITfContext *tgt; TRACE("(%p)\n",This); @@ -247,7 +257,7 @@ static HRESULT WINAPI DocumentMgr_EnumContexts(ITfDocumentMgr *iface, IEnumTfContexts **ppEnum) { - DocumentMgr *This = (DocumentMgr *)iface; + DocumentMgr *This = impl_from_ITfDocumentMgr(iface); TRACE("(%p) %p\n",This,ppEnum); return EnumTfContext_Constructor(This, ppEnum); } @@ -269,20 +279,20 @@ static HRESULT WINAPI Source_QueryInterface(ITfSource *iface, REFIID iid, LPVOID *ppvOut) { - DocumentMgr *This = impl_from_ITfSourceVtbl(iface); - return DocumentMgr_QueryInterface((ITfDocumentMgr*)This, iid, *ppvOut); + DocumentMgr *This = impl_from_ITfSource(iface); + return DocumentMgr_QueryInterface(&This->ITfDocumentMgr_iface, iid, *ppvOut); } static ULONG WINAPI Source_AddRef(ITfSource *iface) { - DocumentMgr *This = impl_from_ITfSourceVtbl(iface); - return DocumentMgr_AddRef((ITfDocumentMgr*)This); + DocumentMgr *This = impl_from_ITfSource(iface); + return DocumentMgr_AddRef(&This->ITfDocumentMgr_iface); } static ULONG WINAPI Source_Release(ITfSource *iface) { - DocumentMgr *This = impl_from_ITfSourceVtbl(iface); - return DocumentMgr_Release((ITfDocumentMgr*)This); + DocumentMgr *This = impl_from_ITfSource(iface); + return DocumentMgr_Release(&This->ITfDocumentMgr_iface); } /***************************************************** @@ -291,14 +301,14 @@ static HRESULT WINAPI DocumentMgrSource_AdviseSink(ITfSource *iface, REFIID riid, IUnknown *punk, DWORD *pdwCookie) { - DocumentMgr *This = impl_from_ITfSourceVtbl(iface); + DocumentMgr *This = impl_from_ITfSource(iface); FIXME("STUB:(%p)\n",This); return E_NOTIMPL; } static HRESULT WINAPI DocumentMgrSource_UnadviseSink(ITfSource *iface, DWORD pdwCookie) { - DocumentMgr *This = impl_from_ITfSourceVtbl(iface); + DocumentMgr *This = impl_from_ITfSource(iface); FIXME("STUB:(%p)\n",This); return E_NOTIMPL; } @@ -321,20 +331,20 @@ if (This == NULL) return E_OUTOFMEMORY; - This->DocumentMgrVtbl= &DocumentMgr_DocumentMgrVtbl; - This->SourceVtbl = &DocumentMgr_SourceVtbl; + This->ITfDocumentMgr_iface.lpVtbl = &DocumentMgr_DocumentMgrVtbl; + This->ITfSource_iface.lpVtbl = &DocumentMgr_SourceVtbl; This->refCount = 1; This->ThreadMgrSink = ThreadMgrSink; CompartmentMgr_Constructor((IUnknown*)This, &IID_IUnknown, (IUnknown**)&This->CompartmentMgr); TRACE("returning %p\n", This); - *ppOut = (ITfDocumentMgr*)This; + *ppOut = &This->ITfDocumentMgr_iface; return S_OK; } /************************************************** - * IEnumTfContexts implementaion + * IEnumTfContexts implementation **************************************************/ static void EnumTfContext_Destructor(EnumTfContext *This) { @@ -344,7 +354,7 @@ static HRESULT WINAPI EnumTfContext_QueryInterface(IEnumTfContexts *iface, REFIID iid, LPVOID *ppvOut) { - EnumTfContext *This = (EnumTfContext *)iface; + EnumTfContext *This = impl_from_IEnumTfContexts(iface); *ppvOut = NULL; if (IsEqualIID(iid, &IID_IUnknown) || IsEqualIID(iid, &IID_IEnumTfContexts)) @@ -364,13 +374,13 @@ static ULONG WINAPI EnumTfContext_AddRef(IEnumTfContexts *iface) { - EnumTfContext *This = (EnumTfContext*)iface; + EnumTfContext *This = impl_from_IEnumTfContexts(iface); return InterlockedIncrement(&This->refCount); } static ULONG WINAPI EnumTfContext_Release(IEnumTfContexts *iface) { - EnumTfContext *This = (EnumTfContext *)iface; + EnumTfContext *This = impl_from_IEnumTfContexts(iface); ULONG ret; ret = InterlockedDecrement(&This->refCount); @@ -382,7 +392,7 @@ static HRESULT WINAPI EnumTfContext_Next(IEnumTfContexts *iface, ULONG ulCount, ITfContext **rgContext, ULONG *pcFetched) { - EnumTfContext *This = (EnumTfContext *)iface; + EnumTfContext *This = impl_from_IEnumTfContexts(iface); ULONG fetched = 0; TRACE("(%p)\n",This); @@ -411,7 +421,7 @@ static HRESULT WINAPI EnumTfContext_Skip( IEnumTfContexts* iface, ULONG celt) { - EnumTfContext *This = (EnumTfContext *)iface; + EnumTfContext *This = impl_from_IEnumTfContexts(iface); TRACE("(%p)\n",This); This->index += celt; return S_OK; @@ -419,7 +429,7 @@ static HRESULT WINAPI EnumTfContext_Reset( IEnumTfContexts* iface) { - EnumTfContext *This = (EnumTfContext *)iface; + EnumTfContext *This = impl_from_IEnumTfContexts(iface); TRACE("(%p)\n",This); This->index = 0; return S_OK; @@ -428,7 +438,7 @@ static HRESULT WINAPI EnumTfContext_Clone( IEnumTfContexts *iface, IEnumTfContexts **ppenum) { - EnumTfContext *This = (EnumTfContext *)iface; + EnumTfContext *This = impl_from_IEnumTfContexts(iface); HRESULT res; TRACE("(%p)\n",This); @@ -438,7 +448,7 @@ res = EnumTfContext_Constructor(This->docmgr, ppenum); if (SUCCEEDED(res)) { - EnumTfContext *new_This = (EnumTfContext *)*ppenum; + EnumTfContext *new_This = impl_from_IEnumTfContexts(*ppenum); new_This->index = This->index; } return res; @@ -463,11 +473,11 @@ if (This == NULL) return E_OUTOFMEMORY; - This->Vtbl= &IEnumTfContexts_Vtbl; + This->IEnumTfContexts_iface.lpVtbl = &IEnumTfContexts_Vtbl; This->refCount = 1; This->docmgr = mgr; TRACE("returning %p\n", This); - *ppOut = (IEnumTfContexts*)This; - return S_OK; -} + *ppOut = &This->IEnumTfContexts_iface; + return S_OK; +} Modified: trunk/reactos/dll/win32/msctf/inputprocessor.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msctf/inputproce…
============================================================================== --- trunk/reactos/dll/win32/msctf/inputprocessor.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msctf/inputprocessor.c [iso-8859-1] Fri Jan 27 17:31:52 2012 @@ -782,7 +782,7 @@ } /************************************************** - * IEnumGUID implementaion for ITfInputProcessorProfiles::EnumInputProcessorInfo + * IEnumGUID implementation for ITfInputProcessorProfiles::EnumInputProcessorInfo **************************************************/ static void ProfilesEnumGuid_Destructor(ProfilesEnumGuid *This) { @@ -935,7 +935,7 @@ } /************************************************** - * IEnumTfLanguageProfiles implementaion + * IEnumTfLanguageProfiles implementation **************************************************/ static void EnumTfLanguageProfiles_Destructor(EnumTfLanguageProfiles *This) { Modified: trunk/reactos/dll/win32/msctf/langbarmgr.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msctf/langbarmgr…
============================================================================== --- trunk/reactos/dll/win32/msctf/langbarmgr.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msctf/langbarmgr.c [iso-8859-1] Fri Jan 27 17:31:52 2012 @@ -31,11 +31,16 @@ WINE_DEFAULT_DEBUG_CHANNEL(msctf); typedef struct tagLangBarMgr { - const ITfLangBarMgrVtbl *LangBarMgrVtbl; + ITfLangBarMgr ITfLangBarMgr_iface; LONG refCount; } LangBarMgr; + +static inline LangBarMgr *impl_from_ITfLangBarMgr(ITfLangBarMgr *iface) +{ + return CONTAINING_RECORD(iface, LangBarMgr, ITfLangBarMgr_iface); +} static void LangBarMgr_Destructor(LangBarMgr *This) { @@ -46,7 +51,7 @@ static HRESULT WINAPI LangBarMgr_QueryInterface(ITfLangBarMgr *iface, REFIID iid, LPVOID *ppvOut) { - LangBarMgr *This = (LangBarMgr *)iface; + LangBarMgr *This = impl_from_ITfLangBarMgr(iface); *ppvOut = NULL; if (IsEqualIID(iid, &IID_IUnknown) || IsEqualIID(iid, &IID_ITfLangBarMgr)) @@ -66,13 +71,13 @@ static ULONG WINAPI LangBarMgr_AddRef(ITfLangBarMgr *iface) { - LangBarMgr *This = (LangBarMgr *)iface; + LangBarMgr *This = impl_from_ITfLangBarMgr(iface); return InterlockedIncrement(&This->refCount); } static ULONG WINAPI LangBarMgr_Release(ITfLangBarMgr *iface) { - LangBarMgr *This = (LangBarMgr *)iface; + LangBarMgr *This = impl_from_ITfLangBarMgr(iface); ULONG ret; ret = InterlockedDecrement(&This->refCount); @@ -87,7 +92,7 @@ static HRESULT WINAPI LangBarMgr_AdviseEventSink( ITfLangBarMgr* iface, ITfLangBarEventSink *pSink, HWND hwnd, DWORD dwflags, DWORD *pdwCookie) { - LangBarMgr *This = (LangBarMgr *)iface; + LangBarMgr *This = impl_from_ITfLangBarMgr(iface); FIXME("STUB:(%p)\n",This); return E_NOTIMPL; @@ -95,7 +100,7 @@ static HRESULT WINAPI LangBarMgr_UnAdviseEventSink( ITfLangBarMgr* iface, DWORD dwCookie) { - LangBarMgr *This = (LangBarMgr *)iface; + LangBarMgr *This = impl_from_ITfLangBarMgr(iface); FIXME("STUB:(%p)\n",This); return E_NOTIMPL; @@ -103,7 +108,7 @@ static HRESULT WINAPI LangBarMgr_GetThreadMarshalInterface( ITfLangBarMgr* iface, DWORD dwThreadId, DWORD dwType, REFIID riid, IUnknown **ppunk) { - LangBarMgr *This = (LangBarMgr *)iface; + LangBarMgr *This = impl_from_ITfLangBarMgr(iface); FIXME("STUB:(%p)\n",This); return E_NOTIMPL; @@ -111,7 +116,7 @@ static HRESULT WINAPI LangBarMgr_GetThreadLangBarItemMgr( ITfLangBarMgr* iface, DWORD dwThreadId, ITfLangBarItemMgr **pplbi, DWORD *pdwThreadid) { - LangBarMgr *This = (LangBarMgr *)iface; + LangBarMgr *This = impl_from_ITfLangBarMgr(iface); FIXME("STUB:(%p)\n",This); return E_NOTIMPL; @@ -119,7 +124,7 @@ static HRESULT WINAPI LangBarMgr_GetInputProcessorProfiles( ITfLangBarMgr* iface, DWORD dwThreadId, ITfInputProcessorProfiles **ppaip, DWORD *pdwThreadid) { - LangBarMgr *This = (LangBarMgr *)iface; + LangBarMgr *This = impl_from_ITfLangBarMgr(iface); FIXME("STUB:(%p)\n",This); return E_NOTIMPL; @@ -127,7 +132,7 @@ static HRESULT WINAPI LangBarMgr_RestoreLastFocus( ITfLangBarMgr* iface, DWORD *dwThreadId, BOOL fPrev) { - LangBarMgr *This = (LangBarMgr *)iface; + LangBarMgr *This = impl_from_ITfLangBarMgr(iface); FIXME("STUB:(%p)\n",This); return E_NOTIMPL; @@ -135,7 +140,7 @@ static HRESULT WINAPI LangBarMgr_SetModalInput( ITfLangBarMgr* iface, ITfLangBarEventSink *pSink, DWORD dwThreadId, DWORD dwFlags) { - LangBarMgr *This = (LangBarMgr *)iface; + LangBarMgr *This = impl_from_ITfLangBarMgr(iface); FIXME("STUB:(%p)\n",This); return E_NOTIMPL; @@ -143,7 +148,7 @@ static HRESULT WINAPI LangBarMgr_ShowFloating( ITfLangBarMgr* iface, DWORD dwFlags) { - LangBarMgr *This = (LangBarMgr *)iface; + LangBarMgr *This = impl_from_ITfLangBarMgr(iface); FIXME("STUB:(%p)\n",This); return E_NOTIMPL; @@ -151,7 +156,7 @@ static HRESULT WINAPI LangBarMgr_GetShowFloatingStatus( ITfLangBarMgr* iface, DWORD *pdwFlags) { - LangBarMgr *This = (LangBarMgr *)iface; + LangBarMgr *This = impl_from_ITfLangBarMgr(iface); FIXME("STUB:(%p)\n",This); return E_NOTIMPL; @@ -184,7 +189,7 @@ if (This == NULL) return E_OUTOFMEMORY; - This->LangBarMgrVtbl= &LangBarMgr_LangBarMgrVtbl; + This->ITfLangBarMgr_iface.lpVtbl = &LangBarMgr_LangBarMgrVtbl; This->refCount = 1; TRACE("returning %p\n", This); Modified: trunk/reactos/dll/win32/msctf/msctf.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msctf/msctf.c?re…
============================================================================== --- trunk/reactos/dll/win32/msctf/msctf.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msctf/msctf.c [iso-8859-1] Fri Jan 27 17:31:52 2012 @@ -33,6 +33,7 @@ #include "shlwapi.h" #include "shlguid.h" #include "comcat.h" +#include "rpcproxy.h" #include "msctf.h" #include "msctf_internal.h" @@ -94,10 +95,15 @@ typedef struct tagClassFactory { - const IClassFactoryVtbl *vtbl; + IClassFactory IClassFactory_iface; LONG ref; LPFNCONSTRUCTOR ctor; } ClassFactory; + +static inline ClassFactory *impl_from_IClassFactory(IClassFactory *iface) +{ + return CONTAINING_RECORD(iface, ClassFactory, IClassFactory_iface); +} static void ClassFactory_Destructor(ClassFactory *This) { @@ -121,13 +127,13 @@ static ULONG WINAPI ClassFactory_AddRef(IClassFactory *iface) { - ClassFactory *This = (ClassFactory *)iface; + ClassFactory *This = impl_from_IClassFactory(iface); return InterlockedIncrement(&This->ref); } static ULONG WINAPI ClassFactory_Release(IClassFactory *iface) { - ClassFactory *This = (ClassFactory *)iface; + ClassFactory *This = impl_from_IClassFactory(iface); ULONG ret = InterlockedDecrement(&This->ref); if (ret == 0) @@ -137,7 +143,7 @@ static HRESULT WINAPI ClassFactory_CreateInstance(IClassFactory *iface, IUnknown *punkOuter, REFIID iid, LPVOID *ppvOut) { - ClassFactory *This = (ClassFactory *)iface; + ClassFactory *This = impl_from_IClassFactory(iface); HRESULT ret; IUnknown *obj; @@ -152,7 +158,7 @@ static HRESULT WINAPI ClassFactory_LockServer(IClassFactory *iface, BOOL fLock) { - ClassFactory *This = (ClassFactory *)iface; + ClassFactory *This = impl_from_IClassFactory(iface); TRACE("(%p)->(%x)\n", This, fLock); @@ -178,7 +184,7 @@ static HRESULT ClassFactory_Constructor(LPFNCONSTRUCTOR ctor, LPVOID *ppvOut) { ClassFactory *This = HeapAlloc(GetProcessHeap(),0,sizeof(ClassFactory)); - This->vtbl = &ClassFactoryVtbl; + This->IClassFactory_iface.lpVtbl = &ClassFactoryVtbl; This->ref = 1; This->ctor = ctor; *ppvOut = This; @@ -554,6 +560,22 @@ } /*********************************************************************** + * DllRegisterServer (MSCTF.@) + */ +HRESULT WINAPI DllRegisterServer(void) +{ + return __wine_register_resources( MSCTF_hinstance ); +} + +/*********************************************************************** + * DllUnregisterServer (MSCTF.@) + */ +HRESULT WINAPI DllUnregisterServer(void) +{ + return __wine_unregister_resources( MSCTF_hinstance ); +} + +/*********************************************************************** * TF_CreateThreadMgr (MSCTF.@) */ HRESULT WINAPI TF_CreateThreadMgr(ITfThreadMgr **pptim) Modified: trunk/reactos/dll/win32/msctf/msctf.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msctf/msctf.rbui…
============================================================================== --- trunk/reactos/dll/win32/msctf/msctf.rbuild [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msctf/msctf.rbuild [iso-8859-1] Fri Jan 27 17:31:52 2012 @@ -17,7 +17,6 @@ <file>langbarmgr.c</file> <file>msctf.c</file> <file>range.c</file> - <file>regsvr.c</file> <file>threadmgr.c</file> <file>version.rc</file> <library>wine</library> Added: trunk/reactos/dll/win32/msctf/msctf.rgs URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msctf/msctf.rgs?…
============================================================================== --- trunk/reactos/dll/win32/msctf/msctf.rgs (added) +++ trunk/reactos/dll/win32/msctf/msctf.rgs [iso-8859-1] Fri Jan 27 17:31:52 2012 @@ -1,0 +1,29 @@ +HKCR +{ + NoRemove Interface + { + } + NoRemove CLSID + { + '{529A9E6B-6587-4F23-AB9E-9C7D683E3C50}' = s 'TF_ThreadMgr' + { + InprocServer32 = s '%MODULE%' { val ThreadingModel = s 'Apartment' } + } + '{33C53A50-F456-4884-B049-85FD643ECFED}' = s 'TF_InputProcessorProfiles' + { + InprocServer32 = s '%MODULE%' { val ThreadingModel = s 'Apartment' } + } + '{A4B544A1-438D-4B41-9325-869523E2D6C7}' = s 'TF_CategoryMgr' + { + InprocServer32 = s '%MODULE%' { val ThreadingModel = s 'Apartment' } + } + '{EBB08C45-6C4A-4FDC-AE53-4EB8C4C7DB8E}' = s 'TF_LangBarMgr' + { + InprocServer32 = s '%MODULE%' { val ThreadingModel = s 'Apartment' } + } + '{3CE74DE4-53D3-4D74-8B83-431B3828BA53}' = s 'TF_DisplayAttributeMgr' + { + InprocServer32 = s '%MODULE%' { val ThreadingModel = s 'Apartment' } + } + } +} Propchange: trunk/reactos/dll/win32/msctf/msctf.rgs ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/dll/win32/msctf/msctf_classes.idl URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msctf/msctf_clas…
============================================================================== --- trunk/reactos/dll/win32/msctf/msctf_classes.idl (added) +++ trunk/reactos/dll/win32/msctf/msctf_classes.idl [iso-8859-1] Fri Jan 27 17:31:52 2012 @@ -1,0 +1,49 @@ +/* + * COM Classes for msctf + * + * Copyright 2010 Alexandre Julliard + * + * 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 + */ + +[ + threading(apartment), + uuid(529a9e6b-6587-4f23-ab9e-9c7d683e3c50) +] +coclass TF_ThreadMgr { interface ITfThreadMgr; } + +[ + threading(apartment), + uuid(33c53a50-f456-4884-b049-85fd643ecfed) +] +coclass TF_InputProcessorProfiles { interface ITfInputProcessorProfiles; } + +[ + threading(apartment), + uuid(a4b544a1-438d-4b41-9325-869523e2d6c7) +] +coclass TF_CategoryMgr { interface ITfCategoryMgr; } + +[ + threading(apartment), + uuid(ebb08c45-6c4a-4fdc-ae53-4eb8c4c7db8e) +] +coclass TF_LangBarMgr { interface ITfLangBarMgr; } + +[ + threading(apartment), + uuid(3ce74de4-53d3-4d74-8b83-431b3828ba53) +] +coclass TF_DisplayAttributeMgr { interface ITfDisplayAttributeMgr; } Propchange: trunk/reactos/dll/win32/msctf/msctf_classes.idl ------------------------------------------------------------------------------ svn:eol-style = native Modified: trunk/reactos/dll/win32/msctf/msctf_internal.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msctf/msctf_inte…
============================================================================== --- trunk/reactos/dll/win32/msctf/msctf_internal.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msctf/msctf_internal.h [iso-8859-1] Fri Jan 27 17:31:52 2012 @@ -28,42 +28,42 @@ #define COOKIE_MAGIC_EDITCOOKIE 0x0050 #define COOKIE_MAGIC_COMPARTMENTSINK 0x0060 -extern DWORD tlsIndex; -extern TfClientId processId; -extern ITfCompartmentMgr *globalCompartmentMgr; +extern DWORD tlsIndex DECLSPEC_HIDDEN; +extern TfClientId processId DECLSPEC_HIDDEN; +extern ITfCompartmentMgr *globalCompartmentMgr DECLSPEC_HIDDEN; -extern HRESULT ThreadMgr_Constructor(IUnknown *pUnkOuter, IUnknown **ppOut); -extern HRESULT DocumentMgr_Constructor(ITfThreadMgrEventSink*, ITfDocumentMgr **ppOut); -extern HRESULT Context_Constructor(TfClientId tidOwner, IUnknown *punk, ITfDocumentMgr *mgr, ITfContext **ppOut, TfEditCookie *pecTextStore); -extern HRESULT InputProcessorProfiles_Constructor(IUnknown *pUnkOuter, IUnknown **ppOut); -extern HRESULT CategoryMgr_Constructor(IUnknown *pUnkOuter, IUnknown **ppOut); -extern HRESULT Range_Constructor(ITfContext *context, ITextStoreACP *textstore, DWORD lockType, DWORD anchorStart, DWORD anchorEnd, ITfRange **ppOut); -extern HRESULT CompartmentMgr_Constructor(IUnknown *pUnkOuter, REFIID riid, IUnknown **ppOut); -extern HRESULT CompartmentMgr_Destructor(ITfCompartmentMgr *This); -extern HRESULT LangBarMgr_Constructor(IUnknown *pUnkOuter, IUnknown **ppOut); -extern HRESULT DisplayAttributeMgr_Constructor(IUnknown *pUnkOuter, IUnknown **ppOut); +extern HRESULT ThreadMgr_Constructor(IUnknown *pUnkOuter, IUnknown **ppOut) DECLSPEC_HIDDEN; +extern HRESULT DocumentMgr_Constructor(ITfThreadMgrEventSink*, ITfDocumentMgr **ppOut) DECLSPEC_HIDDEN; +extern HRESULT Context_Constructor(TfClientId tidOwner, IUnknown *punk, ITfDocumentMgr *mgr, ITfContext **ppOut, TfEditCookie *pecTextStore) DECLSPEC_HIDDEN; +extern HRESULT InputProcessorProfiles_Constructor(IUnknown *pUnkOuter, IUnknown **ppOut) DECLSPEC_HIDDEN; +extern HRESULT CategoryMgr_Constructor(IUnknown *pUnkOuter, IUnknown **ppOut) DECLSPEC_HIDDEN; +extern HRESULT Range_Constructor(ITfContext *context, ITextStoreACP *textstore, DWORD lockType, DWORD anchorStart, DWORD anchorEnd, ITfRange **ppOut) DECLSPEC_HIDDEN; +extern HRESULT CompartmentMgr_Constructor(IUnknown *pUnkOuter, REFIID riid, IUnknown **ppOut) DECLSPEC_HIDDEN; +extern HRESULT CompartmentMgr_Destructor(ITfCompartmentMgr *This) DECLSPEC_HIDDEN; +extern HRESULT LangBarMgr_Constructor(IUnknown *pUnkOuter, IUnknown **ppOut) DECLSPEC_HIDDEN; +extern HRESULT DisplayAttributeMgr_Constructor(IUnknown *pUnkOuter, IUnknown **ppOut) DECLSPEC_HIDDEN; -extern HRESULT Context_Initialize(ITfContext *cxt, ITfDocumentMgr *manager); -extern HRESULT Context_Uninitialize(ITfContext *cxt); -extern void ThreadMgr_OnDocumentMgrDestruction(ITfThreadMgr *tm, ITfDocumentMgr *mgr); -extern HRESULT TF_SELECTION_to_TS_SELECTION_ACP(const TF_SELECTION *tf, TS_SELECTION_ACP *tsAcp); +extern HRESULT Context_Initialize(ITfContext *cxt, ITfDocumentMgr *manager) DECLSPEC_HIDDEN; +extern HRESULT Context_Uninitialize(ITfContext *cxt) DECLSPEC_HIDDEN; +extern void ThreadMgr_OnDocumentMgrDestruction(ITfThreadMgr *tm, ITfDocumentMgr *mgr) DECLSPEC_HIDDEN; +extern HRESULT TF_SELECTION_to_TS_SELECTION_ACP(const TF_SELECTION *tf, TS_SELECTION_ACP *tsAcp) DECLSPEC_HIDDEN; /* cookie function */ -extern DWORD generate_Cookie(DWORD magic, LPVOID data); -extern DWORD get_Cookie_magic(DWORD id); -extern LPVOID get_Cookie_data(DWORD id); -extern LPVOID remove_Cookie(DWORD id); -extern DWORD enumerate_Cookie(DWORD magic, DWORD *index); +extern DWORD generate_Cookie(DWORD magic, LPVOID data) DECLSPEC_HIDDEN; +extern DWORD get_Cookie_magic(DWORD id) DECLSPEC_HIDDEN; +extern LPVOID get_Cookie_data(DWORD id) DECLSPEC_HIDDEN; +extern LPVOID remove_Cookie(DWORD id) DECLSPEC_HIDDEN; +extern DWORD enumerate_Cookie(DWORD magic, DWORD *index) DECLSPEC_HIDDEN; /* activated text services functions */ -extern HRESULT add_active_textservice(TF_LANGUAGEPROFILE *lp); -extern BOOL get_active_textservice(REFCLSID rclsid, TF_LANGUAGEPROFILE *lp); -extern HRESULT activate_textservices(ITfThreadMgr *tm); -extern HRESULT deactivate_textservices(void); +extern HRESULT add_active_textservice(TF_LANGUAGEPROFILE *lp) DECLSPEC_HIDDEN; +extern BOOL get_active_textservice(REFCLSID rclsid, TF_LANGUAGEPROFILE *lp) DECLSPEC_HIDDEN; +extern HRESULT activate_textservices(ITfThreadMgr *tm) DECLSPEC_HIDDEN; +extern HRESULT deactivate_textservices(void) DECLSPEC_HIDDEN; -extern CLSID get_textservice_clsid(TfClientId tid); -extern HRESULT get_textservice_sink(TfClientId tid, REFCLSID iid, IUnknown** sink); -extern HRESULT set_textservice_sink(TfClientId tid, REFCLSID iid, IUnknown* sink); +extern CLSID get_textservice_clsid(TfClientId tid) DECLSPEC_HIDDEN; +extern HRESULT get_textservice_sink(TfClientId tid, REFCLSID iid, IUnknown** sink) DECLSPEC_HIDDEN; +extern HRESULT set_textservice_sink(TfClientId tid, REFCLSID iid, IUnknown* sink) DECLSPEC_HIDDEN; extern const WCHAR szwSystemTIPKey[]; extern const WCHAR szwSystemCTFKey[]; Modified: trunk/reactos/dll/win32/msctf/range.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msctf/range.c?re…
============================================================================== --- trunk/reactos/dll/win32/msctf/range.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msctf/range.c [iso-8859-1] Fri Jan 27 17:31:52 2012 @@ -41,7 +41,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(msctf); typedef struct tagRange { - const ITfRangeVtbl *RangeVtbl; + ITfRange ITfRange_iface; /* const ITfRangeACPVtb *RangeACPVtbl; */ LONG refCount; @@ -54,6 +54,11 @@ } Range; +static inline Range *impl_from_ITfRange(ITfRange *iface) +{ + return CONTAINING_RECORD(iface, Range, ITfRange_iface); +} + static void Range_Destructor(Range *This) { TRACE("destroying %p\n", This); @@ -62,7 +67,7 @@ static HRESULT WINAPI Range_QueryInterface(ITfRange *iface, REFIID iid, LPVOID *ppvOut) { - Range *This = (Range*)iface; + Range *This = impl_from_ITfRange(iface); *ppvOut = NULL; if (IsEqualIID(iid, &IID_IUnknown) || IsEqualIID(iid, &IID_ITfRange)) @@ -82,13 +87,13 @@ static ULONG WINAPI Range_AddRef(ITfRange *iface) { - Range *This = (Range *)iface; + Range *This = impl_from_ITfRange(iface); return InterlockedIncrement(&This->refCount); } static ULONG WINAPI Range_Release(ITfRange *iface) { - Range *This = (Range *)iface; + Range *This = impl_from_ITfRange(iface); ULONG ret; ret = InterlockedDecrement(&This->refCount); @@ -104,7 +109,7 @@ static HRESULT WINAPI Range_GetText(ITfRange *iface, TfEditCookie ec, DWORD dwFlags, WCHAR *pchText, ULONG cchMax, ULONG *pcch) { - Range *This = (Range *)iface; + Range *This = impl_from_ITfRange(iface); FIXME("STUB:(%p)\n",This); return E_NOTIMPL; } @@ -112,7 +117,7 @@ static HRESULT WINAPI Range_SetText(ITfRange *iface, TfEditCookie ec, DWORD dwFlags, const WCHAR *pchText, LONG cch) { - Range *This = (Range *)iface; + Range *This = impl_from_ITfRange(iface); FIXME("STUB:(%p)\n",This); return E_NOTIMPL; } @@ -120,7 +125,7 @@ static HRESULT WINAPI Range_GetFormattedText(ITfRange *iface, TfEditCookie ec, IDataObject **ppDataObject) { - Range *This = (Range *)iface; + Range *This = impl_from_ITfRange(iface); FIXME("STUB:(%p)\n",This); return E_NOTIMPL; } @@ -128,7 +133,7 @@ static HRESULT WINAPI Range_GetEmbedded(ITfRange *iface, TfEditCookie ec, REFGUID rguidService, REFIID riid, IUnknown **ppunk) { - Range *This = (Range *)iface; + Range *This = impl_from_ITfRange(iface); FIXME("STUB:(%p)\n",This); return E_NOTIMPL; } @@ -136,7 +141,7 @@ static HRESULT WINAPI Range_InsertEmbedded(ITfRange *iface, TfEditCookie ec, DWORD dwFlags, IDataObject *pDataObject) { - Range *This = (Range *)iface; + Range *This = impl_from_ITfRange(iface); FIXME("STUB:(%p)\n",This); return E_NOTIMPL; } @@ -144,7 +149,7 @@ static HRESULT WINAPI Range_ShiftStart(ITfRange *iface, TfEditCookie ec, LONG cchReq, LONG *pcch, const TF_HALTCOND *pHalt) { - Range *This = (Range *)iface; + Range *This = impl_from_ITfRange(iface); FIXME("STUB:(%p)\n",This); return E_NOTIMPL; } @@ -152,7 +157,7 @@ static HRESULT WINAPI Range_ShiftEnd(ITfRange *iface, TfEditCookie ec, LONG cchReq, LONG *pcch, const TF_HALTCOND *pHalt) { - Range *This = (Range *)iface; + Range *This = impl_from_ITfRange(iface); FIXME("STUB:(%p)\n",This); return E_NOTIMPL; } @@ -160,7 +165,7 @@ static HRESULT WINAPI Range_ShiftStartToRange(ITfRange *iface, TfEditCookie ec, ITfRange *pRange, TfAnchor aPos) { - Range *This = (Range *)iface; + Range *This = impl_from_ITfRange(iface); FIXME("STUB:(%p)\n",This); return E_NOTIMPL; } @@ -168,7 +173,7 @@ static HRESULT WINAPI Range_ShiftEndToRange(ITfRange *iface, TfEditCookie ec, ITfRange *pRange, TfAnchor aPos) { - Range *This = (Range *)iface; + Range *This = impl_from_ITfRange(iface); FIXME("STUB:(%p)\n",This); return E_NOTIMPL; } @@ -176,7 +181,7 @@ static HRESULT WINAPI Range_ShiftStartRegion(ITfRange *iface, TfEditCookie ec, TfShiftDir dir, BOOL *pfNoRegion) { - Range *This = (Range *)iface; + Range *This = impl_from_ITfRange(iface); FIXME("STUB:(%p)\n",This); return E_NOTIMPL; } @@ -184,7 +189,7 @@ static HRESULT WINAPI Range_ShiftEndRegion(ITfRange *iface, TfEditCookie ec, TfShiftDir dir, BOOL *pfNoRegion) { - Range *This = (Range *)iface; + Range *This = impl_from_ITfRange(iface); FIXME("STUB:(%p)\n",This); return E_NOTIMPL; } @@ -192,7 +197,7 @@ static HRESULT WINAPI Range_IsEmpty(ITfRange *iface, TfEditCookie ec, BOOL *pfEmpty) { - Range *This = (Range *)iface; + Range *This = impl_from_ITfRange(iface); FIXME("STUB:(%p)\n",This); return E_NOTIMPL; } @@ -200,7 +205,7 @@ static HRESULT WINAPI Range_Collapse(ITfRange *iface, TfEditCookie ec, TfAnchor aPos) { - Range *This = (Range *)iface; + Range *This = impl_from_ITfRange(iface); TRACE("(%p) %i %i\n",This,ec,aPos); switch (aPos) @@ -221,7 +226,7 @@ static HRESULT WINAPI Range_IsEqualStart(ITfRange *iface, TfEditCookie ec, ITfRange *pWith, TfAnchor aPos, BOOL *pfEqual) { - Range *This = (Range *)iface; + Range *This = impl_from_ITfRange(iface); FIXME("STUB:(%p)\n",This); return E_NOTIMPL; } @@ -229,7 +234,7 @@ static HRESULT WINAPI Range_IsEqualEnd(ITfRange *iface, TfEditCookie ec, ITfRange *pWith, TfAnchor aPos, BOOL *pfEqual) { - Range *This = (Range *)iface; + Range *This = impl_from_ITfRange(iface); FIXME("STUB:(%p)\n",This); return E_NOTIMPL; } @@ -237,7 +242,7 @@ static HRESULT WINAPI Range_CompareStart(ITfRange *iface, TfEditCookie ec, ITfRange *pWith, TfAnchor aPos, LONG *plResult) { - Range *This = (Range *)iface; + Range *This = impl_from_ITfRange(iface); FIXME("STUB:(%p)\n",This); return E_NOTIMPL; } @@ -245,7 +250,7 @@ static HRESULT WINAPI Range_CompareEnd(ITfRange *iface, TfEditCookie ec, ITfRange *pWith, TfAnchor aPos, LONG *plResult) { - Range *This = (Range *)iface; + Range *This = impl_from_ITfRange(iface); FIXME("STUB:(%p)\n",This); return E_NOTIMPL; } @@ -253,7 +258,7 @@ static HRESULT WINAPI Range_AdjustForInsert(ITfRange *iface, TfEditCookie ec, ULONG cchInsert, BOOL *pfInsertOk) { - Range *This = (Range *)iface; + Range *This = impl_from_ITfRange(iface); FIXME("STUB:(%p)\n",This); return E_NOTIMPL; } @@ -261,7 +266,7 @@ static HRESULT WINAPI Range_GetGravity(ITfRange *iface, TfGravity *pgStart, TfGravity *pgEnd) { - Range *This = (Range *)iface; + Range *This = impl_from_ITfRange(iface); FIXME("STUB:(%p)\n",This); return E_NOTIMPL; } @@ -269,21 +274,21 @@ static HRESULT WINAPI Range_SetGravity(ITfRange *iface, TfEditCookie ec, TfGravity gStart, TfGravity gEnd) { - Range *This = (Range *)iface; + Range *This = impl_from_ITfRange(iface); FIXME("STUB:(%p)\n",This); return E_NOTIMPL; } static HRESULT WINAPI Range_Clone(ITfRange *iface, ITfRange **ppClone) { - Range *This = (Range *)iface; + Range *This = impl_from_ITfRange(iface); FIXME("STUB:(%p)\n",This); return E_NOTIMPL; } static HRESULT WINAPI Range_GetContext(ITfRange *iface, ITfContext **ppContext) { - Range *This = (Range *)iface; + Range *This = impl_from_ITfRange(iface); TRACE("(%p)\n",This); if (!ppContext) return E_INVALIDARG; @@ -331,7 +336,7 @@ TRACE("(%p) %p %p\n",This, context, textstore); - This->RangeVtbl= &Range_RangeVtbl; + This->ITfRange_iface.lpVtbl = &Range_RangeVtbl; This->refCount = 1; This->pITfContext = context; This->pITextStoreACP = textstore; @@ -339,7 +344,7 @@ This->anchorStart = anchorStart; This->anchorEnd = anchorEnd; - *ppOut = (ITfRange*)This; + *ppOut = &This->ITfRange_iface; TRACE("returning %p\n", This); return S_OK; Modified: trunk/reactos/dll/win32/msctf/threadmgr.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msctf/threadmgr.…
============================================================================== --- trunk/reactos/dll/win32/msctf/threadmgr.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msctf/threadmgr.c [iso-8859-1] Fri Jan 27 17:31:52 2012 @@ -1313,7 +1313,7 @@ } /************************************************** - * IEnumTfDocumentMgrs implementaion + * IEnumTfDocumentMgrs implementation **************************************************/ static void EnumTfDocumentMgr_Destructor(EnumTfDocumentMgr *This) { @@ -1470,5 +1470,5 @@ return; } } - FIXME("ITfDocumenMgr %p not found in this thread\n",mgr); -} + FIXME("ITfDocumentMgr %p not found in this thread\n",mgr); +} Modified: trunk/reactos/dll/win32/msctf/version.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msctf/version.rc…
============================================================================== --- trunk/reactos/dll/win32/msctf/version.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msctf/version.rc [iso-8859-1] Fri Jan 27 17:31:52 2012 @@ -16,6 +16,8 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +1 WINE_REGISTRY msctf.rgs + #define WINE_FILEDESCRIPTION_STR "Wine Msctf" #define WINE_FILENAME_STR "msctf.dll" #define WINE_FILEVERSION 5,1,2600,3319 Modified: trunk/reactos/media/doc/README.WINE URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=…
============================================================================== --- trunk/reactos/media/doc/README.WINE [iso-8859-1] (original) +++ trunk/reactos/media/doc/README.WINE [iso-8859-1] Fri Jan 27 17:31:52 2012 @@ -96,7 +96,7 @@ reactos/dll/win32/mscat32 # Autosync reactos/dll/win32/mscms # Synced to Wine-1.3.37 reactos/dll/win32/mscoree # Autosync -reactos/dll/win32/msctf # Autosync +reactos/dll/win32/msctf # Synced to Wine-1.3.37 reactos/dll/win32/msftedit # Synced to Wine-1.3.37 reactos/dll/win32/msg711.acm # Synced to Wine-1.3.37 reactos/dll/win32/msgsm32.acm # Autosync
12 years, 11 months
1
0
0
0
[akhaldi] 55249: [ITSS_WINETEST] * Sync to Wine 1.3.37.
by akhaldi@svn.reactos.org
Author: akhaldi Date: Fri Jan 27 17:05:41 2012 New Revision: 55249 URL:
http://svn.reactos.org/svn/reactos?rev=55249&view=rev
Log: [ITSS_WINETEST] * Sync to Wine 1.3.37. Modified: trunk/rostests/winetests/itss/protocol.c Modified: trunk/rostests/winetests/itss/protocol.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/itss/protocol.c…
============================================================================== --- trunk/rostests/winetests/itss/protocol.c [iso-8859-1] (original) +++ trunk/rostests/winetests/itss/protocol.c [iso-8859-1] Fri Jan 27 17:05:41 2012 @@ -62,7 +62,7 @@ DEFINE_EXPECT(ReportProgress_BEGINDOWNLOADDATA); DEFINE_EXPECT(ReportProgress_SENDINGREQUEST); DEFINE_EXPECT(ReportProgress_MIMETYPEAVAILABLE); -DEFINE_EXPECT(ReportProgress_CACHEFILENAMEAVAIABLE); +DEFINE_EXPECT(ReportProgress_CACHEFILENAMEAVAILABLE); DEFINE_EXPECT(ReportProgress_DIRECTBIND); DEFINE_EXPECT(ReportData); DEFINE_EXPECT(ReportResult); @@ -149,7 +149,7 @@ ok(!lstrcmpW(szStatusText, text_html), "unexpected szStatusText\n"); break; case BINDSTATUS_CACHEFILENAMEAVAILABLE: - CHECK_EXPECT(ReportProgress_CACHEFILENAMEAVAIABLE); + CHECK_EXPECT(ReportProgress_CACHEFILENAMEAVAILABLE); ok(!lstrcmpW(szStatusText, cache_file), "unexpected szStatusText\n"); break; case BINDSTATUS_DIRECTBIND: @@ -294,7 +294,7 @@ if(expect_mime) SET_EXPECT(ReportProgress_MIMETYPEAVAILABLE); if(test_protocol == MK_PROTOCOL) - SET_EXPECT(ReportProgress_CACHEFILENAMEAVAIABLE); + SET_EXPECT(ReportProgress_CACHEFILENAMEAVAILABLE); SET_EXPECT(ReportData); if(test_protocol == ITS_PROTOCOL) SET_EXPECT(ReportProgress_BEGINDOWNLOADDATA); @@ -311,7 +311,7 @@ if(expect_mime) SET_CALLED(ReportProgress_MIMETYPEAVAILABLE); if(test_protocol == MK_PROTOCOL) - SET_EXPECT(ReportProgress_CACHEFILENAMEAVAIABLE); + SET_EXPECT(ReportProgress_CACHEFILENAMEAVAILABLE); SET_CALLED(ReportData); if(test_protocol == ITS_PROTOCOL) SET_CALLED(ReportProgress_BEGINDOWNLOADDATA); @@ -324,7 +324,7 @@ if(expect_mime) CHECK_CALLED(ReportProgress_MIMETYPEAVAILABLE); if(test_protocol == MK_PROTOCOL) - SET_EXPECT(ReportProgress_CACHEFILENAMEAVAIABLE); + SET_EXPECT(ReportProgress_CACHEFILENAMEAVAILABLE); CHECK_CALLED(ReportData); if(test_protocol == ITS_PROTOCOL) CHECK_CALLED(ReportProgress_BEGINDOWNLOADDATA);
12 years, 11 months
1
0
0
0
[akhaldi] 55248: [ITSS] * Sync to Wine 1.3.37.
by akhaldi@svn.reactos.org
Author: akhaldi Date: Fri Jan 27 17:05:33 2012 New Revision: 55248 URL:
http://svn.reactos.org/svn/reactos?rev=55248&view=rev
Log: [ITSS] * Sync to Wine 1.3.37. Added: trunk/reactos/dll/win32/itss/itss.idl (with props) trunk/reactos/dll/win32/itss/itss.rgs (with props) trunk/reactos/dll/win32/itss/itss_r.rgs (with props) Removed: trunk/reactos/dll/win32/itss/itss.inf Modified: trunk/reactos/dll/win32/itss/chm_lib.h trunk/reactos/dll/win32/itss/itss.c trunk/reactos/dll/win32/itss/itsstor.h trunk/reactos/dll/win32/itss/moniker.c trunk/reactos/dll/win32/itss/protocol.c trunk/reactos/dll/win32/itss/rsrc.rc trunk/reactos/dll/win32/itss/storage.c trunk/reactos/media/doc/README.WINE Modified: trunk/reactos/dll/win32/itss/chm_lib.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/itss/chm_lib.h?r…
============================================================================== --- trunk/reactos/dll/win32/itss/chm_lib.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/itss/chm_lib.h [iso-8859-1] Fri Jan 27 17:05:33 2012 @@ -72,25 +72,25 @@ WCHAR path[CHM_MAX_PATHLEN+1]; }; -struct chmFile* chm_openW(const WCHAR *filename); -struct chmFile *chm_dup(struct chmFile *oldHandle); +struct chmFile* chm_openW(const WCHAR *filename) DECLSPEC_HIDDEN; +struct chmFile *chm_dup(struct chmFile *oldHandle) DECLSPEC_HIDDEN; /* close an ITS archive */ -void chm_close(struct chmFile *h); +void chm_close(struct chmFile *h) DECLSPEC_HIDDEN; /* resolve a particular object from the archive */ #define CHM_RESOLVE_SUCCESS (0) #define CHM_RESOLVE_FAILURE (1) int chm_resolve_object(struct chmFile *h, const WCHAR *objPath, - struct chmUnitInfo *ui); + struct chmUnitInfo *ui) DECLSPEC_HIDDEN; /* retrieve part of an object from the archive */ LONGINT64 chm_retrieve_object(struct chmFile *h, struct chmUnitInfo *ui, unsigned char *buf, LONGUINT64 addr, - LONGINT64 len); + LONGINT64 len) DECLSPEC_HIDDEN; /* enumerate the objects in the .chm archive */ typedef int (*CHM_ENUMERATOR)(struct chmFile *h, @@ -109,6 +109,6 @@ const WCHAR *prefix, int what, CHM_ENUMERATOR e, - void *context); + void *context) DECLSPEC_HIDDEN; #endif /* INCLUDED_CHMLIB_H */ Modified: trunk/reactos/dll/win32/itss/itss.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/itss/itss.c?rev=…
============================================================================== --- trunk/reactos/dll/win32/itss/itss.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/itss/itss.c [iso-8859-1] Fri Jan 27 17:05:33 2012 @@ -33,6 +33,7 @@ #include "winuser.h" #include "winreg.h" #include "ole2.h" +#include "rpcproxy.h" #include "advpub.h" #include "wine/unicode.h" @@ -67,14 +68,19 @@ * ITSS ClassFactory */ typedef struct { - const IClassFactoryVtbl *lpVtbl; + IClassFactory IClassFactory_iface; HRESULT (*pfnCreateInstance)(IUnknown *pUnkOuter, LPVOID *ppObj); } IClassFactoryImpl; +static inline IClassFactoryImpl *impl_from_IClassFactory(IClassFactory *iface) +{ + return CONTAINING_RECORD(iface, IClassFactoryImpl, IClassFactory_iface); +} + static HRESULT WINAPI ITSSCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) { - IClassFactoryImpl *This = (IClassFactoryImpl *)iface; + IClassFactoryImpl *This = impl_from_IClassFactory(iface); if (IsEqualGUID(riid, &IID_IUnknown) || IsEqualGUID(riid, &IID_IClassFactory)) @@ -104,7 +110,7 @@ static HRESULT WINAPI ITSSCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj) { - IClassFactoryImpl *This = (IClassFactoryImpl *)iface; + IClassFactoryImpl *This = impl_from_IClassFactory(iface); HRESULT hres; LPUNKNOWN punk; @@ -140,9 +146,9 @@ ITSSCF_LockServer }; -static const IClassFactoryImpl ITStorage_factory = { &ITSSCF_Vtbl, ITSS_create }; -static const IClassFactoryImpl MSITStore_factory = { &ITSSCF_Vtbl, ITS_IParseDisplayName_create }; -static const IClassFactoryImpl ITSProtocol_factory = { &ITSSCF_Vtbl, ITSProtocol_create }; +static const IClassFactoryImpl ITStorage_factory = { { &ITSSCF_Vtbl }, ITSS_create }; +static const IClassFactoryImpl MSITStore_factory = { { &ITSSCF_Vtbl }, ITS_IParseDisplayName_create }; +static const IClassFactoryImpl ITSProtocol_factory = { { &ITSSCF_Vtbl }, ITSProtocol_create }; /*********************************************************************** * DllGetClassObject (ITSS.@) @@ -171,17 +177,22 @@ /*****************************************************************************/ typedef struct { - const IITStorageVtbl *vtbl_IITStorage; + IITStorage IITStorage_iface; LONG ref; } ITStorageImpl; +static inline ITStorageImpl *impl_from_IITStorage(IITStorage *iface) +{ + return CONTAINING_RECORD(iface, ITStorageImpl, IITStorage_iface); +} + static HRESULT WINAPI ITStorageImpl_QueryInterface( IITStorage* iface, REFIID riid, void** ppvObject) { - ITStorageImpl *This = (ITStorageImpl *)iface; + ITStorageImpl *This = impl_from_IITStorage(iface); if (IsEqualGUID(riid, &IID_IUnknown) || IsEqualGUID(riid, &IID_IITStorage)) { @@ -197,7 +208,7 @@ static ULONG WINAPI ITStorageImpl_AddRef( IITStorage* iface) { - ITStorageImpl *This = (ITStorageImpl *)iface; + ITStorageImpl *This = impl_from_IITStorage(iface); TRACE("%p\n", This); return InterlockedIncrement(&This->ref); } @@ -205,7 +216,7 @@ static ULONG WINAPI ITStorageImpl_Release( IITStorage* iface) { - ITStorageImpl *This = (ITStorageImpl *)iface; + ITStorageImpl *This = impl_from_IITStorage(iface); ULONG ref = InterlockedDecrement(&This->ref); if (ref == 0) { @@ -223,7 +234,7 @@ DWORD reserved, IStorage** ppstgOpen) { - ITStorageImpl *This = (ITStorageImpl *)iface; + ITStorageImpl *This = impl_from_IITStorage(iface); TRACE("%p %s %u %u %p\n", This, debugstr_w(pwcsName), grfMode, reserved, ppstgOpen ); @@ -239,7 +250,7 @@ DWORD reserved, IStorage** ppstgOpen) { - ITStorageImpl *This = (ITStorageImpl *)iface; + ITStorageImpl *This = impl_from_IITStorage(iface); FIXME("%p\n", This); return E_NOTIMPL; } @@ -248,7 +259,7 @@ IITStorage* iface, const WCHAR* pwcsName) { - ITStorageImpl *This = (ITStorageImpl *)iface; + ITStorageImpl *This = impl_from_IITStorage(iface); FIXME("%p\n", This); return E_NOTIMPL; } @@ -257,7 +268,7 @@ IITStorage* iface, ILockBytes* plkbyt) { - ITStorageImpl *This = (ITStorageImpl *)iface; + ITStorageImpl *This = impl_from_IITStorage(iface); FIXME("%p\n", This); return E_NOTIMPL; } @@ -271,7 +282,7 @@ DWORD reserved, IStorage** ppstgOpen) { - ITStorageImpl *This = (ITStorageImpl *)iface; + ITStorageImpl *This = impl_from_IITStorage(iface); TRACE("%p %s %p %d %p\n", This, debugstr_w( pwcsName ), pstgPriority, grfMode, snbExclude ); @@ -289,7 +300,7 @@ DWORD reserved, IStorage** ppstgOpen) { - ITStorageImpl *This = (ITStorageImpl *)iface; + ITStorageImpl *This = impl_from_IITStorage(iface); FIXME("%p\n", This); return E_NOTIMPL; } @@ -301,7 +312,7 @@ const FILETIME* patime, const FILETIME* pmtime) { - ITStorageImpl *This = (ITStorageImpl *)iface; + ITStorageImpl *This = impl_from_IITStorage(iface); FIXME("%p\n", This); return E_NOTIMPL; } @@ -310,7 +321,7 @@ IITStorage* iface, PITS_Control_Data pControlData) { - ITStorageImpl *This = (ITStorageImpl *)iface; + ITStorageImpl *This = impl_from_IITStorage(iface); FIXME("%p\n", This); return E_NOTIMPL; } @@ -319,7 +330,7 @@ IITStorage* iface, PITS_Control_Data* ppControlData) { - ITStorageImpl *This = (ITStorageImpl *)iface; + ITStorageImpl *This = impl_from_IITStorage(iface); FIXME("%p\n", This); return E_NOTIMPL; } @@ -329,7 +340,7 @@ const WCHAR* pwcsName, ECompactionLev iLev) { - ITStorageImpl *This = (ITStorageImpl *)iface; + ITStorageImpl *This = impl_from_IITStorage(iface); FIXME("%p\n", This); return E_NOTIMPL; } @@ -359,7 +370,7 @@ return CLASS_E_NOAGGREGATION; its = HeapAlloc( GetProcessHeap(), 0, sizeof(ITStorageImpl) ); - its->vtbl_IITStorage = &ITStorageImpl_Vtbl; + its->IITStorage_iface.lpVtbl = &ITStorageImpl_Vtbl; its->ref = 1; TRACE("-> %p\n", its); @@ -376,66 +387,13 @@ TRACE("dll_count = %u\n", dll_count); return dll_count ? S_FALSE : S_OK; } - -#define INF_SET_ID(id) \ - do \ - { \ - static CHAR name[] = #id; \ - \ - pse[i].pszName = name; \ - clsids[i++] = &id; \ - } while (0) - -#define INF_SET_CLSID(clsid) INF_SET_ID(CLSID_ ## clsid) - -static HRESULT register_server(BOOL do_register) -{ - HRESULT hres; - HMODULE hAdvpack; - HRESULT (WINAPI *pRegInstall)(HMODULE hm, LPCSTR pszSection, const STRTABLEA* pstTable); - STRTABLEA strtable; - STRENTRYA pse[4]; - static CLSID const *clsids[4]; - DWORD i = 0; - - static const WCHAR wszAdvpack[] = {'a','d','v','p','a','c','k','.','d','l','l',0}; - - INF_SET_CLSID(ITStorage); - INF_SET_CLSID(MSFSStore); - INF_SET_CLSID(MSITStore); - INF_SET_CLSID(ITSProtocol); - - strtable.cEntries = sizeof(pse)/sizeof(pse[0]); - strtable.pse = pse; - - for(i=0; i < strtable.cEntries; i++) { - pse[i].pszValue = HeapAlloc(GetProcessHeap(), 0, 39); - sprintf(pse[i].pszValue, "{%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X}", - clsids[i]->Data1, clsids[i]->Data2, clsids[i]->Data3, clsids[i]->Data4[0], - clsids[i]->Data4[1], clsids[i]->Data4[2], clsids[i]->Data4[3], clsids[i]->Data4[4], - clsids[i]->Data4[5], clsids[i]->Data4[6], clsids[i]->Data4[7]); - } - - hAdvpack = LoadLibraryW(wszAdvpack); - pRegInstall = (void *)GetProcAddress(hAdvpack, "RegInstall"); - - hres = pRegInstall(hInst, do_register ? "RegisterDll" : "UnregisterDll", &strtable); - - for(i=0; i < sizeof(pse)/sizeof(pse[0]); i++) - HeapFree(GetProcessHeap(), 0, pse[i].pszValue); - - return hres; -} - -#undef INF_SET_CLSID -#undef INF_SET_ID /*********************************************************************** * DllRegisterServer (ITSS.@) */ HRESULT WINAPI DllRegisterServer(void) { - return register_server(TRUE); + return __wine_register_resources( hInst ); } /*********************************************************************** @@ -443,5 +401,5 @@ */ HRESULT WINAPI DllUnregisterServer(void) { - return register_server(FALSE); -} + return __wine_unregister_resources( hInst ); +} Added: trunk/reactos/dll/win32/itss/itss.idl URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/itss/itss.idl?re…
============================================================================== --- trunk/reactos/dll/win32/itss/itss.idl (added) +++ trunk/reactos/dll/win32/itss/itss.idl [iso-8859-1] Fri Jan 27 17:05:33 2012 @@ -1,0 +1,55 @@ +/* + * COM Classes for itss + * + * Copyright 2010 Alexandre Julliard + * + * 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 + */ + +[ + helpstring("Microsoft InfoTech Protocol for IE 3.0"), + threading(both), + progid("MSITFS1.0"), + vi_progid("MSITFS"), + uuid(9d148290-b9c8-11d0-a4cc-0000f80149f6) +] +coclass MSITStore { interface IParseDisplayName; } + +[ + helpstring("Microsoft InfoTech Protocol for IE 4.0"), + threading(both), + progid("MSITFS1.0"), + vi_progid("MSITFS"), + uuid(9d148291-b9c8-11d0-a4cc-0000f80149f6) +] +coclass ITSProtocol { interface IInternetProtocolInfo; } + +[ + helpstring("Microsoft InfoTech IStorage for Win32 Files"), + threading(both), + progid("MSITFS1.0"), + vi_progid("MSITFS"), + uuid(d54eee56-aaab-11d0-9e1d-00a0c922e6ec) +] +coclass MSFSStore { } + +[ + helpstring("Microsoft InfoTech IStorage System"), + threading(both), + progid("MSITFS1.0"), + vi_progid("MSITFS"), + uuid(5d02926a-212e-11d0-9df9-00a0c922e6ec) +] +coclass ITStorage { interface IITStorage; } Propchange: trunk/reactos/dll/win32/itss/itss.idl ------------------------------------------------------------------------------ svn:eol-style = native Removed: trunk/reactos/dll/win32/itss/itss.inf URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/itss/itss.inf?re…
============================================================================== --- trunk/reactos/dll/win32/itss/itss.inf [iso-8859-1] (original) +++ trunk/reactos/dll/win32/itss/itss.inf (removed) @@ -1,79 +1,0 @@ -[version] -Signature="$CHICAGO$" - - -[RegisterDll] -AddReg=Classes.Reg, Misc.Reg - - -[UnregisterDll] -DelReg=Classes.Reg, Misc.Reg - - -[Classes.Reg] - -;; ITStorage -HKCR,"CLSID\%CLSID_ITStorage%",,,"Microsoft InfoTech IStorage System" -HKCR,"CLSID\%CLSID_ITStorage%\InProcServer32",,,"itss.dll" -HKCR,"CLSID\%CLSID_ITStorage%\InProcServer32","ThreadingModel",,"Both" -HKCR,"CLSID\%CLSID_ITStorage%\NotInsertable",,16 -HKCR,"CLSID\%CLSID_ITStorage%\ProgID",,,"MSITFS1.0" -HKCR,"CLSID\%CLSID_ITStorage%\VersionIndependentProgID",,,"MSITFS" - -HKCR,"MSITFS",,,"Microsoft InfoTech IStorage System" -HKCR,"MSITFS\CLSID",,,"%CLSID_ITStorage%" -HKCR,"MSITFS\CurVer",,,"MSITFS1.0" - -;; ITSProtocol for IE 3.0 -HKCR,"CLSID\%CLSID_MSITStore%",,,"Microsoft InfoTech Protocol for IE 3.0" -HKCR,"CLSID\%CLSID_MSITStore%\InProcServer32",,,"itss.dll" -HKCR,"CLSID\%CLSID_MSITStore%\InProcServer32","ThreadingModel",,"Both" -HKCR,"CLSID\%CLSID_MSITStore%\NotInsertable",,16 -HKCR,"CLSID\%CLSID_MSITStore%\ProgID",,,"MSITFS1.0" -HKCR,"CLSID\%CLSID_MSITStore%\VersionIndependentProgID",,,"MSITFS" - -HKCR,"MSITStore",,,"Microsoft InfoTech Protocol for IE 3.0" -HKCR,"MSITStore\CLSID",,,"%CLSID_MSITStore%" -HKCR,"MSITStore\CurVer",,,"MSITStore1.0" - - -;; ITSProtocol for IE 4.0 -HKCR,"CLSID\%CLSID_ITSProtocol%",,,"Microsoft InfoTech Protocol for IE 4.0" -HKCR,"CLSID\%CLSID_ITSProtocol%\InProcServer32",,,"itss.dll" -HKCR,"CLSID\%CLSID_ITSProtocol%\InProcServer32","ThreadingModel",,"Both" -HKCR,"CLSID\%CLSID_ITSProtocol%\NotInsertable",,16 -HKCR,"CLSID\%CLSID_ITSProtocol%\ProgID",,,"MSITFS1.0" -HKCR,"CLSID\%CLSID_ITSProtocol%\VersionIndependentProgID",,,"MSITFS" - -HKCR,"ITSProtocol","Microsoft InfoTech Protocols for IE 4.0" -HKCR,"ITSProtocol\CLSID",,,"%CLSID_ITSProtocol%" -HKCR,"ITSProtocol\CurVer",,,"ITSProtocol1.0" - - -;; MSFSStore -HKCR,"CLSID\%CLSID_MSFSStore%",,,"Microsoft InfoTech IStorage for Win32 Files" -HKCR,"CLSID\%CLSID_MSFSStore%\InProcServer32",,,"itss.dll" -HKCR,"CLSID\%CLSID_MSFSStore%\InProcServer32","ThreadingModel",,"Both" -HKCR,"CLSID\%CLSID_MSFSStore%\NotInsertable",,16 -HKCR,"CLSID\%CLSID_MSFSStore%\ProgID",,,"MSITFS1.0" -HKCR,"CLSID\%CLSID_MSFSStore%\VersionIndependentProgID",,,"MSITFS" - -HKCR,"MSFSStore",,,"Microsoft InfoTech IStorage for Win32 Files" -HKCR,"MSFSStore\CLSID",,,"%CLSID_MSFSStore%" -HKCR,"MSFSStore\CurVer",,,"MSFSStore1.0" - - -[Misc.Reg] - -HKCR,".its",,,"ITS File" -HKCR,"ITS FILE",,,"Internet Document Set" -HKCR,"ITS FILE\DefaultIcon",,,"itss.dll,0" -;; HKCR "ITS FILE\shell\open\command",,,"FIXME" - -HKCR,"PROTOCOLS\Handler\its",,,"its: Asychronous Pluggable Protocol Handler" -HKCR,"PROTOCOLS\Handler\its","CLSID",,"%CLSID_ITSProtocol%" -HKCR,"PROTOCOLS\Handler\ms-its",,,"ms-its: Asychronous Pluggable Protocol Handler" -HKCR,"PROTOCOLS\Handler\ms-its","CLSID",,"%CLSID_ITSProtocol%" - -HKCR,"PROTOCOLS\Name-Space Handler\mk",,,"NameSpace Filter for MK:@MSITStore:..." -HKCR,"PROTOCOLS\Name-Space Handler\mk\*","CLSID",,"%CLSID_ITSProtocol%" Added: trunk/reactos/dll/win32/itss/itss.rgs URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/itss/itss.rgs?re…
============================================================================== --- trunk/reactos/dll/win32/itss/itss.rgs (added) +++ trunk/reactos/dll/win32/itss/itss.rgs [iso-8859-1] Fri Jan 27 17:05:33 2012 @@ -1,0 +1,51 @@ +HKCR +{ + ForceRemove '.its' = s 'ITS File' + ForceRemove 'ITS FILE' = s 'Internet Document Set' + { + DefaultIcon = s '%MODULE%,0' + } + ForceRemove MSITStore = s 'Microsoft InfoTech Protocol for IE 3.0' + { + CLSID = s '{9D148290-B9C8-11D0-A4CC-0000F80149F6}' + CurVer = s 'MSITStore1.0' + } + ForceRemove ITSProtocol = s 'Microsoft InfoTech Protocols for IE 4.0' + { + CLSID = s '{9D148291-B9C8-11D0-A4CC-0000F80149F6}' + CurVer = s 'ITSProtocol1.0' + } + ForceRemove MSFSStore = s 'Microsoft InfoTech IStorage for Win32 Files' + { + CLSID = s '{D54EEE56-AAAB-11D0-9E1D-00A0C922E6EC}' + CurVer = s 'MSFSStore1.0' + } + NoRemove PROTOCOLS + { + NoRemove Handler + { + ForceRemove its = s 'its: Asychronous Pluggable Protocol Handler' + { + val CLSID = s '{9D148291-B9C8-11D0-A4CC-0000F80149F6}' + } + ForceRemove ms-its = s 'ms-its: Asychronous Pluggable Protocol Handler' + { + val CLSID = s '{9D148291-B9C8-11D0-A4CC-0000F80149F6}' + } + } + NoRemove 'Name-Space Handler' + { + ForceRemove mk = s 'NameSpace Filter for MK:@MSITStore:...' + { + '*' { val CLSID = s '{9D148291-B9C8-11D0-A4CC-0000F80149F6}' } + } + } + } + NoRemove CLSID + { + '{5D02926A-212E-11D0-9DF9-00A0C922E6EC}' { NotInsertable } + '{9D148290-B9C8-11D0-A4CC-0000F80149F6}' { NotInsertable } + '{9D148291-B9C8-11D0-A4CC-0000F80149F6}' { NotInsertable } + '{D54EEE56-AAAB-11D0-9E1D-00A0C922E6EC}' { NotInsertable } + } +} Propchange: trunk/reactos/dll/win32/itss/itss.rgs ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/dll/win32/itss/itss_r.rgs URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/itss/itss_r.rgs?…
============================================================================== --- trunk/reactos/dll/win32/itss/itss_r.rgs (added) +++ trunk/reactos/dll/win32/itss/itss_r.rgs [iso-8859-1] Fri Jan 27 17:05:33 2012 @@ -1,0 +1,69 @@ +HKCR +{ + NoRemove Interface + { + } + NoRemove CLSID + { + '{9D148290-B9C8-11D0-A4CC-0000F80149F6}' = s 'Microsoft InfoTech Protocol for IE 3.0' + { + InprocServer32 = s '%MODULE%' { val ThreadingModel = s 'Both' } + ProgId = s 'MSITFS1.0' + VersionIndependentProgId = s 'MSITFS' + } + '{9D148291-B9C8-11D0-A4CC-0000F80149F6}' = s 'Microsoft InfoTech Protocol for IE 4.0' + { + InprocServer32 = s '%MODULE%' { val ThreadingModel = s 'Both' } + ProgId = s 'MSITFS1.0' + VersionIndependentProgId = s 'MSITFS' + } + '{D54EEE56-AAAB-11D0-9E1D-00A0C922E6EC}' = s 'Microsoft InfoTech IStorage for Win32 Files' + { + InprocServer32 = s '%MODULE%' { val ThreadingModel = s 'Both' } + ProgId = s 'MSITFS1.0' + VersionIndependentProgId = s 'MSITFS' + } + '{5D02926A-212E-11D0-9DF9-00A0C922E6EC}' = s 'Microsoft InfoTech IStorage System' + { + InprocServer32 = s '%MODULE%' { val ThreadingModel = s 'Both' } + ProgId = s 'MSITFS1.0' + VersionIndependentProgId = s 'MSITFS' + } + } + 'MSITFS1.0' = s 'Microsoft InfoTech Protocol for IE 3.0' + { + CLSID = s '{9D148290-B9C8-11D0-A4CC-0000F80149F6}' + } + 'MSITFS' = s 'Microsoft InfoTech Protocol for IE 3.0' + { + CLSID = s '{9D148290-B9C8-11D0-A4CC-0000F80149F6}' + CurVer = s 'MSITFS1.0' + } + 'MSITFS1.0' = s 'Microsoft InfoTech Protocol for IE 4.0' + { + CLSID = s '{9D148291-B9C8-11D0-A4CC-0000F80149F6}' + } + 'MSITFS' = s 'Microsoft InfoTech Protocol for IE 4.0' + { + CLSID = s '{9D148291-B9C8-11D0-A4CC-0000F80149F6}' + CurVer = s 'MSITFS1.0' + } + 'MSITFS1.0' = s 'Microsoft InfoTech IStorage for Win32 Files' + { + CLSID = s '{D54EEE56-AAAB-11D0-9E1D-00A0C922E6EC}' + } + 'MSITFS' = s 'Microsoft InfoTech IStorage for Win32 Files' + { + CLSID = s '{D54EEE56-AAAB-11D0-9E1D-00A0C922E6EC}' + CurVer = s 'MSITFS1.0' + } + 'MSITFS1.0' = s 'Microsoft InfoTech IStorage System' + { + CLSID = s '{5D02926A-212E-11D0-9DF9-00A0C922E6EC}' + } + 'MSITFS' = s 'Microsoft InfoTech IStorage System' + { + CLSID = s '{5D02926A-212E-11D0-9DF9-00A0C922E6EC}' + CurVer = s 'MSITFS1.0' + } +} Propchange: trunk/reactos/dll/win32/itss/itss_r.rgs ------------------------------------------------------------------------------ svn:eol-style = native Modified: trunk/reactos/dll/win32/itss/itsstor.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/itss/itsstor.h?r…
============================================================================== --- trunk/reactos/dll/win32/itss/itsstor.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/itss/itsstor.h [iso-8859-1] Fri Jan 27 17:05:33 2012 @@ -29,18 +29,16 @@ DWORD grfMode, SNB snbExclude, DWORD reserved, - IStorage** ppstgOpen); + IStorage** ppstgOpen) DECLSPEC_HIDDEN; extern HRESULT ITS_IParseDisplayName_create( IUnknown *pUnkOuter, - LPVOID *ppObj); + LPVOID *ppObj) DECLSPEC_HIDDEN; -extern HRESULT ITSProtocol_create(IUnknown *pUnkOuter, LPVOID *ppobj); +extern HRESULT ITSProtocol_create(IUnknown *pUnkOuter, LPVOID *ppobj) DECLSPEC_HIDDEN; -extern LONG dll_count; +extern LONG dll_count DECLSPEC_HIDDEN; static inline void ITSS_LockModule(void) { InterlockedIncrement(&dll_count); } static inline void ITSS_UnlockModule(void) { InterlockedDecrement(&dll_count); } -#define DEFINE_THIS(cls,ifc,iface) ((cls*)((BYTE*)(iface)-offsetof(cls,lp ## ifc ## Vtbl))) - #endif /* __WINE_ITS_STORAGE_PRIVATE__ */ Modified: trunk/reactos/dll/win32/itss/moniker.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/itss/moniker.c?r…
============================================================================== --- trunk/reactos/dll/win32/itss/moniker.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/itss/moniker.c [iso-8859-1] Fri Jan 27 17:05:33 2012 @@ -43,19 +43,24 @@ /*****************************************************************************/ typedef struct { - const IMonikerVtbl *vtbl_ITS_IMoniker; + IMoniker IMoniker_iface; LONG ref; LPWSTR szHtml; WCHAR szFile[1]; } ITS_IMonikerImpl; +static inline ITS_IMonikerImpl *impl_from_IMoniker(IMoniker *iface) +{ + return CONTAINING_RECORD(iface, ITS_IMonikerImpl, IMoniker_iface); +} + /*** IUnknown methods ***/ static HRESULT WINAPI ITS_IMonikerImpl_QueryInterface( IMoniker* iface, REFIID riid, void** ppvObject) { - ITS_IMonikerImpl *This = (ITS_IMonikerImpl *)iface; + ITS_IMonikerImpl *This = impl_from_IMoniker(iface); if (IsEqualGUID(riid, &IID_IUnknown) || IsEqualGUID(riid, &IID_IParseDisplayName)) @@ -72,7 +77,7 @@ static ULONG WINAPI ITS_IMonikerImpl_AddRef( IMoniker* iface) { - ITS_IMonikerImpl *This = (ITS_IMonikerImpl *)iface; + ITS_IMonikerImpl *This = impl_from_IMoniker(iface); TRACE("%p\n", This); return InterlockedIncrement(&This->ref); } @@ -80,7 +85,7 @@ static ULONG WINAPI ITS_IMonikerImpl_Release( IMoniker* iface) { - ITS_IMonikerImpl *This = (ITS_IMonikerImpl *)iface; + ITS_IMonikerImpl *This = impl_from_IMoniker(iface); ULONG ref = InterlockedDecrement(&This->ref); if (ref == 0) { @@ -96,7 +101,7 @@ IMoniker* iface, CLSID* pClassID) { - ITS_IMonikerImpl *This = (ITS_IMonikerImpl *)iface; + ITS_IMonikerImpl *This = impl_from_IMoniker(iface); TRACE("%p %p\n", This, pClassID); *pClassID = CLSID_ITStorage; @@ -155,7 +160,7 @@ REFIID riid, void** ppvObj) { - ITS_IMonikerImpl *This = (ITS_IMonikerImpl *)iface; + ITS_IMonikerImpl *This = impl_from_IMoniker(iface); DWORD grfMode = STGM_SIMPLE | STGM_READ | STGM_SHARE_EXCLUSIVE; HRESULT r; IStorage *stg = NULL; @@ -279,7 +284,7 @@ IMoniker* pmkToLeft, LPOLESTR* ppszDisplayName) { - ITS_IMonikerImpl *This = (ITS_IMonikerImpl *)iface; + ITS_IMonikerImpl *This = impl_from_IMoniker(iface); static const WCHAR szFormat[] = { 'm','s','-','i','t','s',':','%','s',':',':','%','s',0 }; DWORD len = sizeof szFormat / sizeof(WCHAR); @@ -352,7 +357,7 @@ sz = sizeof(ITS_IMonikerImpl) + strlenW( name )*sizeof(WCHAR); itsmon = HeapAlloc( GetProcessHeap(), 0, sz ); - itsmon->vtbl_ITS_IMoniker = &ITS_IMonikerImpl_Vtbl; + itsmon->IMoniker_iface.lpVtbl = &ITS_IMonikerImpl_Vtbl; itsmon->ref = 1; strcpyW( itsmon->szFile, name ); itsmon->szHtml = &itsmon->szFile[n]; @@ -362,7 +367,7 @@ TRACE("-> %p %s %s\n", itsmon, debugstr_w(itsmon->szFile), debugstr_w(itsmon->szHtml) ); - *ppObj = (IMoniker*) itsmon; + *ppObj = &itsmon->IMoniker_iface; ITSS_LockModule(); return S_OK; @@ -371,16 +376,21 @@ /*****************************************************************************/ typedef struct { - const IParseDisplayNameVtbl *vtbl_ITS_IParseDisplayName; + IParseDisplayName IParseDisplayName_iface; LONG ref; } ITS_IParseDisplayNameImpl; + +static inline ITS_IParseDisplayNameImpl *impl_from_IParseDisplayName(IParseDisplayName *iface) +{ + return CONTAINING_RECORD(iface, ITS_IParseDisplayNameImpl, IParseDisplayName_iface); +} static HRESULT WINAPI ITS_IParseDisplayNameImpl_QueryInterface( IParseDisplayName* iface, REFIID riid, void** ppvObject) { - ITS_IParseDisplayNameImpl *This = (ITS_IParseDisplayNameImpl *)iface; + ITS_IParseDisplayNameImpl *This = impl_from_IParseDisplayName(iface); if (IsEqualGUID(riid, &IID_IUnknown) || IsEqualGUID(riid, &IID_IParseDisplayName)) @@ -397,7 +407,7 @@ static ULONG WINAPI ITS_IParseDisplayNameImpl_AddRef( IParseDisplayName* iface) { - ITS_IParseDisplayNameImpl *This = (ITS_IParseDisplayNameImpl *)iface; + ITS_IParseDisplayNameImpl *This = impl_from_IParseDisplayName(iface); TRACE("%p\n", This); return InterlockedIncrement(&This->ref); } @@ -405,7 +415,7 @@ static ULONG WINAPI ITS_IParseDisplayNameImpl_Release( IParseDisplayName* iface) { - ITS_IParseDisplayNameImpl *This = (ITS_IParseDisplayNameImpl *)iface; + ITS_IParseDisplayNameImpl *This = impl_from_IParseDisplayName(iface); ULONG ref = InterlockedDecrement(&This->ref); if (ref == 0) { @@ -428,12 +438,12 @@ const DWORD prefix_len = (sizeof szPrefix/sizeof szPrefix[0])-1; DWORD n; - ITS_IParseDisplayNameImpl *This = (ITS_IParseDisplayNameImpl *)iface; + ITS_IParseDisplayNameImpl *This = impl_from_IParseDisplayName(iface); TRACE("%p %s %p %p\n", This, debugstr_w( pszDisplayName ), pchEaten, ppmkOut ); - if( strncmpW( pszDisplayName, szPrefix, prefix_len ) ) + if( strncmpiW( pszDisplayName, szPrefix, prefix_len ) ) return MK_E_SYNTAX; /* search backwards for a double colon */ @@ -469,7 +479,7 @@ return CLASS_E_NOAGGREGATION; its = HeapAlloc( GetProcessHeap(), 0, sizeof(ITS_IParseDisplayNameImpl) ); - its->vtbl_ITS_IParseDisplayName = &ITS_IParseDisplayNameImpl_Vtbl; + its->IParseDisplayName_iface.lpVtbl = &ITS_IParseDisplayNameImpl_Vtbl; its->ref = 1; TRACE("-> %p\n", its); Modified: trunk/reactos/dll/win32/itss/protocol.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/itss/protocol.c?…
============================================================================== --- trunk/reactos/dll/win32/itss/protocol.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/itss/protocol.c [iso-8859-1] Fri Jan 27 17:05:33 2012 @@ -36,8 +36,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(itss); typedef struct { - const IInternetProtocolVtbl *lpInternetProtocolVtbl; - const IInternetProtocolInfoVtbl *lpInternetProtocolInfoVtbl; + IInternetProtocol IInternetProtocol_iface; + IInternetProtocolInfo IInternetProtocolInfo_iface; LONG ref; @@ -46,8 +46,15 @@ struct chmUnitInfo chm_object; } ITSProtocol; -#define PROTOCOL(x) ((IInternetProtocol*) &(x)->lpInternetProtocolVtbl) -#define PROTINFO(x) (&(x)->lpInternetProtocolInfoVtbl) +static inline ITSProtocol *impl_from_IInternetProtocol(IInternetProtocol *iface) +{ + return CONTAINING_RECORD(iface, ITSProtocol, IInternetProtocol_iface); +} + +static inline ITSProtocol *impl_from_IInternetProtocolInfo(IInternetProtocolInfo *iface) +{ + return CONTAINING_RECORD(iface, ITSProtocol, IInternetProtocolInfo_iface); +} static void release_chm(ITSProtocol *This) { @@ -58,25 +65,23 @@ This->offset = 0; } -#define PROTOCOL_THIS(iface) DEFINE_THIS(ITSProtocol, InternetProtocol, iface) - static HRESULT WINAPI ITSProtocol_QueryInterface(IInternetProtocol *iface, REFIID riid, void **ppv) { - ITSProtocol *This = PROTOCOL_THIS(iface); + ITSProtocol *This = impl_from_IInternetProtocol(iface); *ppv = NULL; if(IsEqualGUID(&IID_IUnknown, riid)) { TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv); - *ppv = PROTOCOL(This); + *ppv = &This->IInternetProtocol_iface; }else if(IsEqualGUID(&IID_IInternetProtocolRoot, riid)) { TRACE("(%p)->(IID_IInternetProtocolRoot %p)\n", This, ppv); - *ppv = PROTOCOL(This); + *ppv = &This->IInternetProtocol_iface; }else if(IsEqualGUID(&IID_IInternetProtocol, riid)) { TRACE("(%p)->(IID_IInternetProtocol %p)\n", This, ppv); - *ppv = PROTOCOL(This); + *ppv = &This->IInternetProtocol_iface; }else if(IsEqualGUID(&IID_IInternetProtocolInfo, riid)) { TRACE("(%p)->(IID_IInternetProtocolInfo %p)\n", This, ppv); - *ppv = PROTINFO(This); + *ppv = &This->IInternetProtocolInfo_iface; } if(*ppv) { @@ -90,7 +95,7 @@ static ULONG WINAPI ITSProtocol_AddRef(IInternetProtocol *iface) { - ITSProtocol *This = PROTOCOL_THIS(iface); + ITSProtocol *This = impl_from_IInternetProtocol(iface); LONG ref = InterlockedIncrement(&This->ref); TRACE("(%p) ref=%d\n", This, ref); return ref; @@ -98,7 +103,7 @@ static ULONG WINAPI ITSProtocol_Release(IInternetProtocol *iface) { - ITSProtocol *This = PROTOCOL_THIS(iface); + ITSProtocol *This = impl_from_IInternetProtocol(iface); LONG ref = InterlockedDecrement(&This->ref); TRACE("(%p) ref=%d\n", This, ref); @@ -139,7 +144,7 @@ IInternetProtocolSink *pOIProtSink, IInternetBindInfo *pOIBindInfo, DWORD grfPI, HANDLE_PTR dwReserved) { - ITSProtocol *This = PROTOCOL_THIS(iface); + ITSProtocol *This = impl_from_IInternetProtocol(iface); BINDINFO bindinfo; DWORD bindf = 0, len; LPWSTR file_name, mime, object_name, p; @@ -252,7 +257,7 @@ static HRESULT WINAPI ITSProtocol_Continue(IInternetProtocol *iface, PROTOCOLDATA *pProtocolData) { - ITSProtocol *This = PROTOCOL_THIS(iface); + ITSProtocol *This = impl_from_IInternetProtocol(iface); FIXME("(%p)->(%p)\n", This, pProtocolData); return E_NOTIMPL; } @@ -260,14 +265,14 @@ static HRESULT WINAPI ITSProtocol_Abort(IInternetProtocol *iface, HRESULT hrReason, DWORD dwOptions) { - ITSProtocol *This = PROTOCOL_THIS(iface); + ITSProtocol *This = impl_from_IInternetProtocol(iface); FIXME("(%p)->(%08x %08x)\n", This, hrReason, dwOptions); return E_NOTIMPL; } static HRESULT WINAPI ITSProtocol_Terminate(IInternetProtocol *iface, DWORD dwOptions) { - ITSProtocol *This = PROTOCOL_THIS(iface); + ITSProtocol *This = impl_from_IInternetProtocol(iface); TRACE("(%p)->(%08x)\n", This, dwOptions); @@ -276,14 +281,14 @@ static HRESULT WINAPI ITSProtocol_Suspend(IInternetProtocol *iface) { - ITSProtocol *This = PROTOCOL_THIS(iface); + ITSProtocol *This = impl_from_IInternetProtocol(iface); FIXME("(%p)\n", This); return E_NOTIMPL; } static HRESULT WINAPI ITSProtocol_Resume(IInternetProtocol *iface) { - ITSProtocol *This = PROTOCOL_THIS(iface); + ITSProtocol *This = impl_from_IInternetProtocol(iface); FIXME("(%p)\n", This); return E_NOTIMPL; } @@ -291,7 +296,7 @@ static HRESULT WINAPI ITSProtocol_Read(IInternetProtocol *iface, void *pv, ULONG cb, ULONG *pcbRead) { - ITSProtocol *This = PROTOCOL_THIS(iface); + ITSProtocol *This = impl_from_IInternetProtocol(iface); TRACE("(%p)->(%p %u %p)\n", This, pv, cb, pcbRead); @@ -307,14 +312,14 @@ static HRESULT WINAPI ITSProtocol_Seek(IInternetProtocol *iface, LARGE_INTEGER dlibMove, DWORD dwOrigin, ULARGE_INTEGER *plibNewPosition) { - ITSProtocol *This = PROTOCOL_THIS(iface); + ITSProtocol *This = impl_from_IInternetProtocol(iface); FIXME("(%p)->(%d %d %p)\n", This, dlibMove.u.LowPart, dwOrigin, plibNewPosition); return E_NOTIMPL; } static HRESULT WINAPI ITSProtocol_LockRequest(IInternetProtocol *iface, DWORD dwOptions) { - ITSProtocol *This = PROTOCOL_THIS(iface); + ITSProtocol *This = impl_from_IInternetProtocol(iface); TRACE("(%p)->(%08x)\n", This, dwOptions); @@ -323,14 +328,12 @@ static HRESULT WINAPI ITSProtocol_UnlockRequest(IInternetProtocol *iface) { - ITSProtocol *This = PROTOCOL_THIS(iface); + ITSProtocol *This = impl_from_IInternetProtocol(iface); TRACE("(%p)\n", This); return S_OK; } - -#undef PROTOCOL_THIS static const IInternetProtocolVtbl ITSProtocolVtbl = { ITSProtocol_QueryInterface, @@ -348,32 +351,30 @@ ITSProtocol_UnlockRequest }; -#define PROTINFO_THIS(iface) DEFINE_THIS(ITSProtocol, InternetProtocolInfo, iface) - static HRESULT WINAPI ITSProtocolInfo_QueryInterface(IInternetProtocolInfo *iface, REFIID riid, void **ppv) { - ITSProtocol *This = PROTINFO_THIS(iface); - return IInternetProtocol_QueryInterface(PROTOCOL(This), riid, ppv); + ITSProtocol *This = impl_from_IInternetProtocolInfo(iface); + return IInternetProtocol_QueryInterface(&This->IInternetProtocol_iface, riid, ppv); } static ULONG WINAPI ITSProtocolInfo_AddRef(IInternetProtocolInfo *iface) { - ITSProtocol *This = PROTINFO_THIS(iface); - return IInternetProtocol_AddRef(PROTOCOL(This)); + ITSProtocol *This = impl_from_IInternetProtocolInfo(iface); + return IInternetProtocol_AddRef(&This->IInternetProtocol_iface); } static ULONG WINAPI ITSProtocolInfo_Release(IInternetProtocolInfo *iface) { - ITSProtocol *This = PROTINFO_THIS(iface); - return IInternetProtocol_Release(PROTOCOL(This)); + ITSProtocol *This = impl_from_IInternetProtocolInfo(iface); + return IInternetProtocol_Release(&This->IInternetProtocol_iface); } static HRESULT WINAPI ITSProtocolInfo_ParseUrl(IInternetProtocolInfo *iface, LPCWSTR pwzUrl, PARSEACTION ParseAction, DWORD dwParseFlags, LPWSTR pwzResult, DWORD cchResult, DWORD *pcchResult, DWORD dwReserved) { - ITSProtocol *This = PROTINFO_THIS(iface); + ITSProtocol *This = impl_from_IInternetProtocolInfo(iface); TRACE("(%p)->(%s %x %08x %p %d %p %d)\n", This, debugstr_w(pwzUrl), ParseAction, dwParseFlags, pwzResult, cchResult, pcchResult, dwReserved); @@ -396,7 +397,7 @@ LPCWSTR pwzBaseUrl, LPCWSTR pwzRelativeUrl, DWORD dwCombineFlags, LPWSTR pwzResult, DWORD cchResult, DWORD* pcchResult, DWORD dwReserved) { - ITSProtocol *This = PROTINFO_THIS(iface); + ITSProtocol *This = impl_from_IInternetProtocolInfo(iface); LPCWSTR base_end, ptr; DWORD rel_len; @@ -441,7 +442,7 @@ static HRESULT WINAPI ITSProtocolInfo_CompareUrl(IInternetProtocolInfo *iface, LPCWSTR pwzUrl1, LPCWSTR pwzUrl2, DWORD dwCompareFlags) { - ITSProtocol *This = PROTINFO_THIS(iface); + ITSProtocol *This = impl_from_IInternetProtocolInfo(iface); FIXME("%p)->(%s %s %08x)\n", This, debugstr_w(pwzUrl1), debugstr_w(pwzUrl2), dwCompareFlags); return E_NOTIMPL; } @@ -450,13 +451,11 @@ QUERYOPTION QueryOption, DWORD dwQueryFlags, LPVOID pBuffer, DWORD cbBuffer, DWORD* pcbBuf, DWORD dwReserved) { - ITSProtocol *This = PROTINFO_THIS(iface); + ITSProtocol *This = impl_from_IInternetProtocolInfo(iface); FIXME("(%p)->(%s %08x %08x %p %d %p %d)\n", This, debugstr_w(pwzUrl), QueryOption, dwQueryFlags, pBuffer, cbBuffer, pcbBuf, dwReserved); return E_NOTIMPL; } - -#undef PROTINFO_THIS static const IInternetProtocolInfoVtbl ITSProtocolInfoVtbl = { ITSProtocolInfo_QueryInterface, @@ -478,11 +477,11 @@ ret = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(ITSProtocol)); - ret->lpInternetProtocolVtbl = &ITSProtocolVtbl; - ret->lpInternetProtocolInfoVtbl = &ITSProtocolInfoVtbl; + ret->IInternetProtocol_iface.lpVtbl = &ITSProtocolVtbl; + ret->IInternetProtocolInfo_iface.lpVtbl = &ITSProtocolInfoVtbl; ret->ref = 1; - *ppobj = PROTOCOL(ret); - - return S_OK; -} + *ppobj = &ret->IInternetProtocol_iface; + + return S_OK; +} Modified: trunk/reactos/dll/win32/itss/rsrc.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/itss/rsrc.rc?rev…
============================================================================== --- trunk/reactos/dll/win32/itss/rsrc.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/itss/rsrc.rc [iso-8859-1] Fri Jan 27 17:05:33 2012 @@ -16,5 +16,6 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -/* @makedep: itss.inf */ -REGINST REGINST itss.inf +/* @makedep: itss.rgs */ +1 WINE_REGISTRY itss.rgs +2 WINE_REGISTRY itss_r.rgs Modified: trunk/reactos/dll/win32/itss/storage.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/itss/storage.c?r…
============================================================================== --- trunk/reactos/dll/win32/itss/storage.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/itss/storage.c [iso-8859-1] Fri Jan 27 17:05:33 2012 @@ -45,7 +45,7 @@ typedef struct _ITSS_IStorageImpl { - const IStorageVtbl *vtbl_IStorage; + IStorage IStorage_iface; LONG ref; struct chmFile *chmfile; WCHAR dir[1]; @@ -59,20 +59,35 @@ typedef struct _IEnumSTATSTG_Impl { - const IEnumSTATSTGVtbl *vtbl_IEnumSTATSTG; + IEnumSTATSTG IEnumSTATSTG_iface; LONG ref; struct enum_info *first, *last, *current; } IEnumSTATSTG_Impl; typedef struct _IStream_Impl { - const IStreamVtbl *vtbl_IStream; + IStream IStream_iface; LONG ref; ITSS_IStorageImpl *stg; ULONGLONG addr; struct chmUnitInfo ui; } IStream_Impl; +static inline ITSS_IStorageImpl *impl_from_IStorage(IStorage *iface) +{ + return CONTAINING_RECORD(iface, ITSS_IStorageImpl, IStorage_iface); +} + +static inline IEnumSTATSTG_Impl *impl_from_IEnumSTATSTG(IEnumSTATSTG *iface) +{ + return CONTAINING_RECORD(iface, IEnumSTATSTG_Impl, IEnumSTATSTG_iface); +} + +static inline IStream_Impl *impl_from_IStream(IStream *iface) +{ + return CONTAINING_RECORD(iface, IStream_Impl, IStream_iface); +} + static HRESULT ITSS_create_chm_storage( struct chmFile *chmfile, const WCHAR *dir, IStorage** ppstgOpen ); static IStream_Impl* ITSS_create_stream( @@ -85,7 +100,7 @@ REFIID riid, void** ppvObject) { - IEnumSTATSTG_Impl *This = (IEnumSTATSTG_Impl *)iface; + IEnumSTATSTG_Impl *This = impl_from_IEnumSTATSTG(iface); if (IsEqualGUID(riid, &IID_IUnknown) || IsEqualGUID(riid, &IID_IEnumSTATSTG)) @@ -102,14 +117,14 @@ static ULONG WINAPI ITSS_IEnumSTATSTG_AddRef( IEnumSTATSTG* iface) { - IEnumSTATSTG_Impl *This = (IEnumSTATSTG_Impl *)iface; + IEnumSTATSTG_Impl *This = impl_from_IEnumSTATSTG(iface); return InterlockedIncrement(&This->ref); } static ULONG WINAPI ITSS_IEnumSTATSTG_Release( IEnumSTATSTG* iface) { - IEnumSTATSTG_Impl *This = (IEnumSTATSTG_Impl *)iface; + IEnumSTATSTG_Impl *This = impl_from_IEnumSTATSTG(iface); ULONG ref = InterlockedDecrement(&This->ref); @@ -134,7 +149,7 @@ STATSTG* rgelt, ULONG* pceltFetched) { - IEnumSTATSTG_Impl *This = (IEnumSTATSTG_Impl *)iface; + IEnumSTATSTG_Impl *This = impl_from_IEnumSTATSTG(iface); DWORD len, n; struct enum_info *cur; @@ -186,7 +201,7 @@ IEnumSTATSTG* iface, ULONG celt) { - IEnumSTATSTG_Impl *This = (IEnumSTATSTG_Impl *)iface; + IEnumSTATSTG_Impl *This = impl_from_IEnumSTATSTG(iface); DWORD n; struct enum_info *cur; @@ -210,7 +225,7 @@ static HRESULT WINAPI ITSS_IEnumSTATSTG_Reset( IEnumSTATSTG* iface) { - IEnumSTATSTG_Impl *This = (IEnumSTATSTG_Impl *)iface; + IEnumSTATSTG_Impl *This = impl_from_IEnumSTATSTG(iface); TRACE("%p\n", This ); @@ -243,7 +258,7 @@ IEnumSTATSTG_Impl *stgenum; stgenum = HeapAlloc( GetProcessHeap(), 0, sizeof (IEnumSTATSTG_Impl) ); - stgenum->vtbl_IEnumSTATSTG = &IEnumSTATSTG_vtbl; + stgenum->IEnumSTATSTG_iface.lpVtbl = &IEnumSTATSTG_vtbl; stgenum->ref = 1; stgenum->first = NULL; stgenum->last = NULL; @@ -262,7 +277,7 @@ REFIID riid, void** ppvObject) { - ITSS_IStorageImpl *This = (ITSS_IStorageImpl *)iface; + ITSS_IStorageImpl *This = impl_from_IStorage(iface); if (IsEqualGUID(riid, &IID_IUnknown) || IsEqualGUID(riid, &IID_IStorage)) @@ -279,14 +294,14 @@ static ULONG WINAPI ITSS_IStorageImpl_AddRef( IStorage* iface) { - ITSS_IStorageImpl *This = (ITSS_IStorageImpl *)iface; + ITSS_IStorageImpl *This = impl_from_IStorage(iface); return InterlockedIncrement(&This->ref); } static ULONG WINAPI ITSS_IStorageImpl_Release( IStorage* iface) { - ITSS_IStorageImpl *This = (ITSS_IStorageImpl *)iface; + ITSS_IStorageImpl *This = impl_from_IStorage(iface); ULONG ref = InterlockedDecrement(&This->ref); @@ -320,7 +335,7 @@ DWORD reserved2, IStream** ppstm) { - ITSS_IStorageImpl *This = (ITSS_IStorageImpl *)iface; + ITSS_IStorageImpl *This = impl_from_IStorage(iface); IStream_Impl *stm; DWORD len; struct chmUnitInfo ui; @@ -364,7 +379,7 @@ if( !stm ) return E_FAIL; - *ppstm = (IStream*) stm; + *ppstm = &stm->IStream_iface; return S_OK; } @@ -390,7 +405,7 @@ DWORD reserved, IStorage** ppstg) { - ITSS_IStorageImpl *This = (ITSS_IStorageImpl *)iface; + ITSS_IStorageImpl *This = impl_from_IStorage(iface); static const WCHAR szRoot[] = { '/', 0 }; struct chmFile *chmfile; WCHAR *path, *p; @@ -498,7 +513,7 @@ DWORD reserved3, IEnumSTATSTG** ppenum) { - ITSS_IStorageImpl *This = (ITSS_IStorageImpl *)iface; + ITSS_IStorageImpl *This = impl_from_IStorage(iface); IEnumSTATSTG_Impl* stgenum; TRACE("%p %d %p %d %p\n", This, reserved1, reserved2, reserved3, ppenum ); @@ -515,7 +530,7 @@ stgenum->current = stgenum->first; - *ppenum = (IEnumSTATSTG*) stgenum; + *ppenum = &stgenum->IEnumSTATSTG_iface; return S_OK; } @@ -607,12 +622,12 @@ len = strlenW( dir ) + 1; stg = HeapAlloc( GetProcessHeap(), 0, sizeof (ITSS_IStorageImpl) + len*sizeof(WCHAR) ); - stg->vtbl_IStorage = &ITSS_IStorageImpl_Vtbl; + stg->IStorage_iface.lpVtbl = &ITSS_IStorageImpl_Vtbl; stg->ref = 1; stg->chmfile = chmfile; strcpyW( stg->dir, dir ); - *ppstgOpen = (IStorage*) stg; + *ppstgOpen = &stg->IStorage_iface; ITSS_LockModule(); return S_OK; @@ -645,7 +660,7 @@ REFIID riid, void** ppvObject) { - IStream_Impl *This = (IStream_Impl *)iface; + IStream_Impl *This = impl_from_IStream(iface); if (IsEqualGUID(riid, &IID_IUnknown) || IsEqualGUID(riid, &IID_ISequentialStream) @@ -663,20 +678,20 @@ static ULONG WINAPI ITSS_IStream_AddRef( IStream* iface) { - IStream_Impl *This = (IStream_Impl *)iface; + IStream_Impl *This = impl_from_IStream(iface); return InterlockedIncrement(&This->ref); } static ULONG WINAPI ITSS_IStream_Release( IStream* iface) { - IStream_Impl *This = (IStream_Impl *)iface; + IStream_Impl *This = impl_from_IStream(iface); ULONG ref = InterlockedDecrement(&This->ref); if (ref == 0) { - IStorage_Release( (IStorage*) This->stg ); + IStorage_Release( &This->stg->IStorage_iface ); HeapFree(GetProcessHeap(), 0, This); ITSS_UnlockModule(); } @@ -690,7 +705,7 @@ ULONG cb, ULONG* pcbRead) { - IStream_Impl *This = (IStream_Impl *)iface; + IStream_Impl *This = impl_from_IStream(iface); ULONG count; TRACE("%p %p %u %p\n", This, pv, cb, pcbRead); @@ -720,7 +735,7 @@ DWORD dwOrigin, ULARGE_INTEGER* plibNewPosition) { - IStream_Impl *This = (IStream_Impl *)iface; + IStream_Impl *This = impl_from_IStream(iface); LONGLONG newpos; TRACE("%p %s %u %p\n", This, @@ -809,7 +824,7 @@ STATSTG* pstatstg, DWORD grfStatFlag) { - IStream_Impl *This = (IStream_Impl *)iface; + IStream_Impl *This = impl_from_IStream(iface); TRACE("%p %p %d\n", This, pstatstg, grfStatFlag); @@ -858,12 +873,12 @@ IStream_Impl *stm; stm = HeapAlloc( GetProcessHeap(), 0, sizeof (IStream_Impl) ); - stm->vtbl_IStream = &ITSS_IStream_vtbl; + stm->IStream_iface.lpVtbl = &ITSS_IStream_vtbl; stm->ref = 1; stm->addr = 0; stm->ui = *ui; stm->stg = stg; - IStorage_AddRef( (IStorage*) stg ); + IStorage_AddRef( &stg->IStorage_iface ); ITSS_LockModule(); Modified: trunk/reactos/media/doc/README.WINE URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=…
============================================================================== --- trunk/reactos/media/doc/README.WINE [iso-8859-1] (original) +++ trunk/reactos/media/doc/README.WINE [iso-8859-1] Fri Jan 27 17:05:33 2012 @@ -77,7 +77,7 @@ reactos/dll/win32/inseng # Synced to Wine-1.3.37 reactos/dll/win32/iphlpapi # Out of sync reactos/dll/win32/itircl # Autosync -reactos/dll/win32/itss # Autosync +reactos/dll/win32/itss # Synced to Wine-1.3.37 reactos/dll/win32/jscript # Autosync reactos/dll/win32/localspl # Autosync reactos/dll/win32/localui # Autosync
12 years, 11 months
1
0
0
0
← Newer
1
...
8
9
10
11
12
13
14
...
56
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
Results per page:
10
25
50
100
200