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
March 2010
----- 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
896 discussions
Start a n
N
ew thread
[cwittich] 45917: [OLEDLG] sync oledlg to wine 1.1.40
by cwittich@svn.reactos.org
Author: cwittich Date: Sat Mar 6 12:21:01 2010 New Revision: 45917 URL:
http://svn.reactos.org/svn/reactos?rev=45917&view=rev
Log: [OLEDLG] sync oledlg to wine 1.1.40 Modified: trunk/reactos/dll/win32/oledlg/insobjdlg.c trunk/reactos/dll/win32/oledlg/oledlg_De.rc trunk/reactos/dll/win32/oledlg/rsrc.rc Modified: trunk/reactos/dll/win32/oledlg/insobjdlg.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/oledlg/insobjdlg…
============================================================================== --- trunk/reactos/dll/win32/oledlg/insobjdlg.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/oledlg/insobjdlg.c [iso-8859-1] Sat Mar 6 12:21:01 2010 @@ -380,7 +380,7 @@ *lpclsid = clsid; len = SendMessageW(pdlgInfo->hwndObjTypeLB, LB_ADDSTRING, 0, (LPARAM)keydesc); - SendMessageW(pdlgInfo->hwndObjTypeLB, LB_SETITEMDATA, (WPARAM)len, (LPARAM)lpclsid); + SendMessageW(pdlgInfo->hwndObjTypeLB, LB_SETITEMDATA, len, (LPARAM)lpclsid); } } @@ -426,7 +426,7 @@ if (LoadStringW(OLEDLG_hInstance, IDS_RESULTOBJDESC, resstr, MAX_PATH) && ((index = SendMessageW(pdlgInfo->hwndObjTypeLB, LB_GETCURSEL, 0, 0)) >= 0) && - SendMessageW(pdlgInfo->hwndObjTypeLB, LB_GETTEXT, (WPARAM)index, (LPARAM)objname)) + SendMessageW(pdlgInfo->hwndObjTypeLB, LB_GETTEXT, index, (LPARAM)objname)) wsprintfW(objdesc, resstr, objname); else objdesc[0] = 0; @@ -452,7 +452,7 @@ if (index >= 0) { CLSID* clsid = (CLSID*) SendMessageA(pdlgInfo->hwndObjTypeLB, - LB_GETITEMDATA, (WPARAM)index, 0); + LB_GETITEMDATA, index, 0); pdlgInfo->lpOleUIInsertObject->clsid = *clsid; if (pdlgInfo->lpOleUIInsertObject->dwFlags & IOF_CREATENEWOBJECT) @@ -525,7 +525,7 @@ fn.nMaxCustFilter = 0; fn.nFilterIndex = 0; - SendMessageA(pdlgInfo->hwndFileTB, WM_GETTEXT, (WPARAM)MAX_PATH, (LPARAM)fname); + SendMessageA(pdlgInfo->hwndFileTB, WM_GETTEXT, MAX_PATH, (LPARAM)fname); fn.lpstrFile = fname; fn.nMaxFile = MAX_PATH; Modified: trunk/reactos/dll/win32/oledlg/oledlg_De.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/oledlg/oledlg_De…
============================================================================== --- trunk/reactos/dll/win32/oledlg/oledlg_De.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/oledlg/oledlg_De.rc [iso-8859-1] Sat Mar 6 12:21:01 2010 @@ -75,11 +75,11 @@ CONTROL "OK", IDOK, "Button", BS_DEFPUSHBUTTON | WS_TABSTOP | WS_GROUP | WS_VISIBLE, 224, 6, 66, 14 CONTROL "Abbrechen", IDCANCEL, "Button", BS_PUSHBUTTON | WS_TABSTOP | WS_VISIBLE, 224, 23, 66, 14 CONTROL "&Hilfe", IDC_OLEUIHELP, "Button", BS_PUSHBUTTON | WS_TABSTOP | WS_VISIBLE, 224, 42, 66, 14 - CONTROL "Als Symbol &darstellen", IDC_PS_DISPLAYASICON, "Button", BS_AUTOCHECKBOX | WS_TABSTOP | WS_VISIBLE, 224, 59, 66, 14 + CONTROL "Als Sym&bol", IDC_PS_DISPLAYASICON, "Button", BS_AUTOCHECKBOX | WS_TABSTOP | WS_VISIBLE, 224, 59, 66, 14 CONTROL "", IDC_PS_ICONDISPLAY, "Static", SS_ICON | WS_VISIBLE, 224, 75, 66, 44 CONTROL "&Symbol ändern...", IDC_PS_CHANGEICON, "Button", BS_PUSHBUTTON | WS_TABSTOP | WS_VISIBLE, 224, 123, 66, 14 CONTROL "", IDC_PS_RESULTIMAGE, "Static", SS_ICON | WS_VISIBLE, 8, 101, 42, 34 - CONTROL "<< result text goes here >>", IDC_PS_RESULTTEXT, "Static", SS_NOPREFIX | WS_VISIBLE, 54, 100, 159, 35 + CONTROL "<< Ergebnis Text hier her >>", IDC_PS_RESULTTEXT, "Static", SS_NOPREFIX | WS_VISIBLE, 54, 100, 159, 35 CONTROL "Ergebnis", -1, "Button", BS_GROUPBOX | WS_GROUP | WS_VISIBLE, 6, 90, 212, 48 CONTROL "", IDC_PS_SOURCETEXT, "Edit", ES_READONLY | ES_AUTOHSCROLL | WS_VISIBLE, 37, 9, 180, 8 END Modified: trunk/reactos/dll/win32/oledlg/rsrc.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/oledlg/rsrc.rc?r…
============================================================================== --- trunk/reactos/dll/win32/oledlg/rsrc.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/oledlg/rsrc.rc [iso-8859-1] Sat Mar 6 12:21:01 2010 @@ -35,22 +35,25 @@ */ #include "oledlg_Cs.rc" #include "oledlg_Da.rc" -#include "oledlg_De.rc" #include "oledlg_En.rc" #include "oledlg_Es.rc" -#include "oledlg_Fr.rc" #include "oledlg_Hu.rc" #include "oledlg_It.rc" -#include "oledlg_Ja.rc" #include "oledlg_Ko.rc" -#include "oledlg_Lt.rc" #include "oledlg_Nl.rc" #include "oledlg_No.rc" #include "oledlg_Pl.rc" +#include "oledlg_Sv.rc" +#include "oledlg_Tr.rc" +#include "oledlg_Uk.rc" + +/* UTF-8 */ +#include "oledlg_De.rc" +#include "oledlg_Fr.rc" +#include "oledlg_Ja.rc" +#include "oledlg_Lt.rc" #include "oledlg_Pt.rc" #include "oledlg_Ru.rc" #include "oledlg_Si.rc" -#include "oledlg_Sv.rc" -#include "oledlg_Tr.rc" -#include "oledlg_Uk.rc" #include "oledlg_Zh.rc" +
14 years, 9 months
1
0
0
0
[cwittich] 45916: [OLEPRO32] sync olepro32 to wine 1.1.40
by cwittich@svn.reactos.org
Author: cwittich Date: Sat Mar 6 12:15:39 2010 New Revision: 45916 URL:
http://svn.reactos.org/svn/reactos?rev=45916&view=rev
Log: [OLEPRO32] sync olepro32 to wine 1.1.40 Modified: trunk/reactos/dll/win32/olepro32/olepro32stubs.c Modified: trunk/reactos/dll/win32/olepro32/olepro32stubs.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/olepro32/olepro3…
============================================================================== --- trunk/reactos/dll/win32/olepro32/olepro32stubs.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/olepro32/olepro32stubs.c [iso-8859-1] Sat Mar 6 12:15:39 2010 @@ -53,7 +53,6 @@ */ HRESULT WINAPI DllCanUnloadNow(void) { - FIXME("stub\n"); return S_OK; }
14 years, 9 months
1
0
0
0
[cwittich] 45915: [ATL] sync atl to wine 1.1.40
by cwittich@svn.reactos.org
Author: cwittich Date: Sat Mar 6 12:14:00 2010 New Revision: 45915 URL:
http://svn.reactos.org/svn/reactos?rev=45915&view=rev
Log: [ATL] sync atl to wine 1.1.40 Modified: trunk/reactos/dll/win32/atl/registrar.c Modified: trunk/reactos/dll/win32/atl/registrar.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/atl/registrar.c?…
============================================================================== --- trunk/reactos/dll/win32/atl/registrar.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/atl/registrar.c [iso-8859-1] Sat Mar 6 12:14:00 2010 @@ -758,39 +758,44 @@ LPCOLESTR wszId, BOOL do_register, const struct _ATL_REGMAP_ENTRY* pMapEntries) { - WCHAR buf[MAX_PATH]; + IRegistrar *registrar; HRESULT hres; const struct _ATL_REGMAP_ENTRY *pMapEntry; static const WCHAR wszModule[] = {'M','O','D','U','L','E',0}; static const WCHAR wszRegistry[] = {'R','E','G','I','S','T','R','Y',0}; - static const WCHAR wszCLSID_ATLRegistrar[] = + + if (pRegistrar) + registrar = pRegistrar; + else + Registrar_create(NULL, &IID_IRegistrar, (void**)®istrar); + + IRegistrar_AddReplacement(registrar, wszModule, wszDll); + + for (pMapEntry = pMapEntries; pMapEntry && pMapEntry->szKey; pMapEntry++) + IRegistrar_AddReplacement(registrar, pMapEntry->szKey, pMapEntry->szData); + + if(do_register) + hres = IRegistrar_ResourceRegisterSz(registrar, wszDll, wszId, wszRegistry); + else + hres = IRegistrar_ResourceUnregisterSz(registrar, wszDll, wszId, wszRegistry); + + if(registrar != pRegistrar) + IRegistrar_Release(registrar); + return hres; +} + +static HRESULT do_register_server(BOOL do_register) +{ + static const WCHAR CLSID_ATLRegistrarW[] = {'C','L','S','I','D','_','A','T','L','R','e','g','i','s','t','r','a','r',0}; - - if (!pRegistrar) - Registrar_create(NULL, &IID_IRegistrar, (void**)&pRegistrar); - - IRegistrar_AddReplacement(pRegistrar, wszModule, wszDll); - - for (pMapEntry = pMapEntries; pMapEntry && pMapEntry->szKey; pMapEntry++) - IRegistrar_AddReplacement(pRegistrar, pMapEntry->szKey, pMapEntry->szData); - - StringFromGUID2(&CLSID_ATLRegistrar, buf, sizeof(buf)/sizeof(buf[0])); - IRegistrar_AddReplacement(pRegistrar, wszCLSID_ATLRegistrar, buf); - - if(do_register) - hres = IRegistrar_ResourceRegisterSz(pRegistrar, wszDll, wszId, wszRegistry); - else - hres = IRegistrar_ResourceUnregisterSz(pRegistrar, wszDll, wszId, wszRegistry); - - IRegistrar_Release(pRegistrar); - return hres; -} - -static HRESULT do_register_server(BOOL do_register) -{ - static const WCHAR wszDll[] = {'a','t','l','.','d','l','l',0}; - return do_register_dll_server(NULL, wszDll, MAKEINTRESOURCEW(101), do_register, NULL); + static const WCHAR atl_dllW[] = {'a','t','l','.','d','l','l',0}; + + WCHAR clsid_str[40]; + const struct _ATL_REGMAP_ENTRY reg_map[] = {{CLSID_ATLRegistrarW, clsid_str}, {NULL,NULL}}; + + StringFromGUID2(&CLSID_ATLRegistrar, clsid_str, sizeof(clsid_str)/sizeof(WCHAR)); + return do_register_dll_server(NULL, atl_dllW, MAKEINTRESOURCEW(101), do_register, reg_map); } /***********************************************************************
14 years, 9 months
1
0
0
0
[cwittich] 45914: [QUARTZ] sync quartz to wine 1.1.40
by cwittich@svn.reactos.org
Author: cwittich Date: Sat Mar 6 12:12:11 2010 New Revision: 45914 URL:
http://svn.reactos.org/svn/reactos?rev=45914&view=rev
Log: [QUARTZ] sync quartz to wine 1.1.40 Modified: trunk/reactos/dll/directx/quartz/filesource.c trunk/reactos/dll/directx/quartz/pin.c Modified: trunk/reactos/dll/directx/quartz/filesource.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/quartz/filesou…
============================================================================== --- trunk/reactos/dll/directx/quartz/filesource.c [iso-8859-1] (original) +++ trunk/reactos/dll/directx/quartz/filesource.c [iso-8859-1] Sat Mar 6 12:12:11 2010 @@ -395,7 +395,8 @@ return S_OK; } - if (!IsEqualIID(riid, &IID_IPin) && !IsEqualIID(riid, &IID_IMediaSeeking) && !IsEqualIID(riid, &IID_IVideoWindow)) + if (!IsEqualIID(riid, &IID_IPin) && !IsEqualIID(riid, &IID_IMediaSeeking) && + !IsEqualIID(riid, &IID_IVideoWindow) && !IsEqualIID(riid, &IID_IBasicAudio)) FIXME("No interface for %s!\n", qzdebugstr_guid(riid)); return E_NOINTERFACE; Modified: trunk/reactos/dll/directx/quartz/pin.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/quartz/pin.c?r…
============================================================================== --- trunk/reactos/dll/directx/quartz/pin.c [iso-8859-1] (original) +++ trunk/reactos/dll/directx/quartz/pin.c [iso-8859-1] Sat Mar 6 12:12:11 2010 @@ -765,9 +765,6 @@ { assert(pmtCandidate); dump_AM_MEDIA_TYPE(pmtCandidate); - if (!IsEqualGUID(&FORMAT_None, &pmtCandidate->formattype) - && !IsEqualGUID(&GUID_NULL, &pmtCandidate->formattype)) - assert(pmtCandidate->pbFormat); if (( !pmt || CompareMediaTypes(pmt, pmtCandidate, TRUE) ) && (This->pConnectSpecific(iface, pReceivePin, pmtCandidate) == S_OK)) {
14 years, 9 months
1
0
0
0
[cwittich] 45913: [QEDIT] sync qedit to wine 1.1.40
by cwittich@svn.reactos.org
Author: cwittich Date: Sat Mar 6 12:10:27 2010 New Revision: 45913 URL:
http://svn.reactos.org/svn/reactos?rev=45913&view=rev
Log: [QEDIT] sync qedit to wine 1.1.40 Modified: trunk/reactos/dll/directx/qedit/samplegrabber.c Modified: trunk/reactos/dll/directx/qedit/samplegrabber.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/qedit/samplegr…
============================================================================== --- trunk/reactos/dll/directx/qedit/samplegrabber.c [iso-8859-1] (original) +++ trunk/reactos/dll/directx/qedit/samplegrabber.c [iso-8859-1] Sat Mar 6 12:10:27 2010 @@ -1014,6 +1014,10 @@ } else type = &This->sg->mtype; + if (!IsEqualGUID(&type->formattype, &FORMAT_None) && + !IsEqualGUID(&type->formattype, &GUID_NULL) && + !type->pbFormat) + return VFW_E_TYPE_NOT_ACCEPTED; hr = IPin_ReceiveConnection(receiver,(IPin*)&This->lpVtbl,type); if (FAILED(hr)) return hr; @@ -1053,6 +1057,10 @@ if (!IsEqualGUID(&This->sg->mtype.formattype,&GUID_NULL) && !IsEqualGUID(&This->sg->mtype.formattype,&FORMAT_None) && !IsEqualGUID(&This->sg->mtype.formattype,&type->formattype)) + return VFW_E_TYPE_NOT_ACCEPTED; + if (!IsEqualGUID(&type->formattype, &FORMAT_None) && + !IsEqualGUID(&type->formattype, &GUID_NULL) && + !type->pbFormat) return VFW_E_TYPE_NOT_ACCEPTED; if (This->sg->mtype.pbFormat) CoTaskMemFree(This->sg->mtype.pbFormat);
14 years, 9 months
1
0
0
0
[cwittich] 45912: [DWMAPI] sync dwmapi to wine 1.1.40
by cwittich@svn.reactos.org
Author: cwittich Date: Sat Mar 6 12:08:56 2010 New Revision: 45912 URL:
http://svn.reactos.org/svn/reactos?rev=45912&view=rev
Log: [DWMAPI] sync dwmapi to wine 1.1.40 Modified: trunk/reactos/dll/win32/dwmapi/dwmapi_main.c Modified: trunk/reactos/dll/win32/dwmapi/dwmapi_main.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/dwmapi/dwmapi_ma…
============================================================================== --- trunk/reactos/dll/win32/dwmapi/dwmapi_main.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/dwmapi/dwmapi_main.c [iso-8859-1] Sat Mar 6 12:08:56 2010 @@ -54,7 +54,14 @@ */ HRESULT WINAPI DwmIsCompositionEnabled(BOOL *enabled) { - FIXME("%p\n", enabled); + static int once; + if (!once) + { + FIXME("%p\n", enabled); + once = 1; + } + else + TRACE("%p\n", enabled); *enabled = FALSE; return S_OK;
14 years, 9 months
1
0
0
0
[cwittich] 45911: [CRYPT32] sync crypt32 to wine 1.1.40
by cwittich@svn.reactos.org
Author: cwittich Date: Sat Mar 6 12:06:56 2010 New Revision: 45911 URL:
http://svn.reactos.org/svn/reactos?rev=45911&view=rev
Log: [CRYPT32] sync crypt32 to wine 1.1.40 Modified: trunk/reactos/dll/win32/crypt32/main.c Modified: trunk/reactos/dll/win32/crypt32/main.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/crypt32/main.c?r…
============================================================================== --- trunk/reactos/dll/win32/crypt32/main.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/crypt32/main.c [iso-8859-1] Sat Mar 6 12:06:56 2010 @@ -161,8 +161,13 @@ BOOL WINAPI I_CryptFreeTls(DWORD dwTlsIndex, DWORD unknown) { + BOOL ret; + TRACE("(%d, %d)\n", dwTlsIndex, unknown); - return TlsFree(dwTlsIndex); + + ret = TlsFree(dwTlsIndex); + if (!ret) SetLastError( E_INVALIDARG ); + return ret; } BOOL WINAPI I_CryptGetOssGlobal(DWORD x)
14 years, 9 months
1
0
0
0
[fireball] 45910: [vendor/wine] - Import Wine-1.1.40 gdi32, user32, winex11.drv, wineserver.
by fireball@svn.reactos.org
Author: fireball Date: Sat Mar 6 11:03:37 2010 New Revision: 45910 URL:
http://svn.reactos.org/svn/reactos?rev=45910&view=rev
Log: [vendor/wine] - Import Wine-1.1.40 gdi32, user32, winex11.drv, wineserver. Modified: vendor/wine/dlls/gdi32/current/bitmap.c vendor/wine/dlls/gdi32/current/dc.c vendor/wine/dlls/gdi32/current/gdiobj.c vendor/wine/dlls/gdi32/current/tests/Makefile.in vendor/wine/dlls/gdi32/current/tests/bitmap.c vendor/wine/dlls/gdi32/current/tests/dc.c vendor/wine/dlls/user32/current/dialog.c vendor/wine/dlls/user32/current/edit.c vendor/wine/dlls/user32/current/input.c vendor/wine/dlls/user32/current/message.c vendor/wine/dlls/user32/current/painting.c vendor/wine/dlls/user32/current/spy.c vendor/wine/dlls/user32/current/tests/Makefile.in vendor/wine/dlls/user32/current/tests/dialog.c vendor/wine/dlls/user32/current/tests/edit.c vendor/wine/dlls/user32/current/tests/msg.c vendor/wine/dlls/user32/current/tests/scroll.c vendor/wine/dlls/user32/current/tests/win.c vendor/wine/dlls/user32/current/win.c vendor/wine/dlls/winex11.drv/current/bitblt.c vendor/wine/dlls/winex11.drv/current/dib.c vendor/wine/dlls/winex11.drv/current/ime.c vendor/wine/dlls/winex11.drv/current/keyboard.c vendor/wine/dlls/winex11.drv/current/window.c vendor/wine/dlls/winex11.drv/current/x11drv.h vendor/wine/dlls/winex11.drv/current/xdnd.c vendor/wine/dlls/winex11.drv/current/xim.c vendor/wine/dlls/winex11.drv/current/xrender.c vendor/wine/server/current/console.c vendor/wine/server/current/debugger.c vendor/wine/server/current/queue.c vendor/wine/server/current/registry.c vendor/wine/server/current/thread.c vendor/wine/server/current/thread.h vendor/wine/server/current/trace.c Modified: vendor/wine/dlls/gdi32/current/bitmap.c URL:
http://svn.reactos.org/svn/reactos/vendor/wine/dlls/gdi32/current/bitmap.c?…
============================================================================== --- vendor/wine/dlls/gdi32/current/bitmap.c [iso-8859-1] (original) +++ vendor/wine/dlls/gdi32/current/bitmap.c [iso-8859-1] Sat Mar 6 11:03:37 2010 @@ -678,7 +678,9 @@ { if (count >= sizeof(DIBSECTION)) { - memcpy( buffer, bmp->dib, sizeof(DIBSECTION) ); + DIBSECTION *dib = buffer; + *dib = *bmp->dib; + dib->dsBmih.biHeight = abs( dib->dsBmih.biHeight ); ret = sizeof(DIBSECTION); } else /* if (count >= sizeof(BITMAP)) */ Modified: vendor/wine/dlls/gdi32/current/dc.c URL:
http://svn.reactos.org/svn/reactos/vendor/wine/dlls/gdi32/current/dc.c?rev=…
============================================================================== --- vendor/wine/dlls/gdi32/current/dc.c [iso-8859-1] (original) +++ vendor/wine/dlls/gdi32/current/dc.c [iso-8859-1] Sat Mar 6 11:03:37 2010 @@ -819,7 +819,7 @@ if (dc->hookProc && !dc->hookProc( hdc, DCHC_DELETEDC, dc->dwHookData, 0 )) { release_dc_ptr( dc ); - return FALSE; + return TRUE; } while (dc->saveLevel) Modified: vendor/wine/dlls/gdi32/current/gdiobj.c URL:
http://svn.reactos.org/svn/reactos/vendor/wine/dlls/gdi32/current/gdiobj.c?…
============================================================================== --- vendor/wine/dlls/gdi32/current/gdiobj.c [iso-8859-1] (original) +++ vendor/wine/dlls/gdi32/current/gdiobj.c [iso-8859-1] Sat Mar 6 11:03:37 2010 @@ -89,7 +89,8 @@ static const LOGFONTW AnsiFixedFont = { 12, 0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, ANSI_CHARSET, - 0, 0, DEFAULT_QUALITY, FIXED_PITCH | FF_MODERN, {'\0'} }; + 0, 0, DEFAULT_QUALITY, FIXED_PITCH | FF_MODERN, + {'C','o','u','r','i','e','r','\0'} }; static const LOGFONTW AnsiVarFont = { 12, 0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, ANSI_CHARSET, @@ -635,6 +636,50 @@ static GDIOBJHDR *large_handles[MAX_LARGE_HANDLES]; static int next_large_handle; +static const char *gdi_obj_type( unsigned type ) +{ + switch ( type ) + { + case OBJ_PEN: return "OBJ_PEN"; + case OBJ_BRUSH: return "OBJ_BRUSH"; + case OBJ_DC: return "OBJ_DC"; + case OBJ_METADC: return "OBJ_METADC"; + case OBJ_PAL: return "OBJ_PAL"; + case OBJ_FONT: return "OBJ_FONT"; + case OBJ_BITMAP: return "OBJ_BITMAP"; + case OBJ_REGION: return "OBJ_REGION"; + case OBJ_METAFILE: return "OBJ_METAFILE"; + case OBJ_MEMDC: return "OBJ_MEMDC"; + case OBJ_EXTPEN: return "OBJ_EXTPEN"; + case OBJ_ENHMETADC: return "OBJ_ENHMETADC"; + case OBJ_ENHMETAFILE: return "OBJ_ENHMETAFILE"; + case OBJ_COLORSPACE: return "OBJ_COLORSPACE"; + default: return "UNKNOWN"; + } +} + +static void dump_gdi_objects( void ) +{ + int i; + + TRACE( "%u objects:\n", MAX_LARGE_HANDLES ); + + EnterCriticalSection( &gdi_section ); + for (i = 0; i < MAX_LARGE_HANDLES; i++) + { + if (!large_handles[i]) + { + TRACE( "index %d handle %p FREE\n", i, (HGDIOBJ)(ULONG_PTR)((i + FIRST_LARGE_HANDLE) << 2) ); + continue; + } + TRACE( "handle %p obj %p type %s selcount %u deleted %u\n", + (HGDIOBJ)(ULONG_PTR)((i + FIRST_LARGE_HANDLE) << 2), + large_handles[i], gdi_obj_type( large_handles[i]->type ), + large_handles[i]->selcount, large_handles[i]->deleted ); + } + LeaveCriticalSection( &gdi_section ); +} + /*********************************************************************** * alloc_gdi_handle * @@ -658,6 +703,9 @@ for (i = 0; i <= next_large_handle; i++) if (!large_handles[i]) goto found; LeaveCriticalSection( &gdi_section ); + + ERR( "out of GDI object handles, expect a crash\n" ); + if (TRACE_ON(gdi)) dump_gdi_objects(); return 0; found: Modified: vendor/wine/dlls/gdi32/current/tests/Makefile.in URL:
http://svn.reactos.org/svn/reactos/vendor/wine/dlls/gdi32/current/tests/Mak…
============================================================================== --- vendor/wine/dlls/gdi32/current/tests/Makefile.in [iso-8859-1] (original) +++ vendor/wine/dlls/gdi32/current/tests/Makefile.in [iso-8859-1] Sat Mar 6 11:03:37 2010 @@ -5,7 +5,7 @@ TESTDLL = gdi32.dll IMPORTS = user32 gdi32 kernel32 -CTESTS = \ +C_SRCS = \ bitmap.c \ brush.c \ clipping.c \ Modified: vendor/wine/dlls/gdi32/current/tests/bitmap.c URL:
http://svn.reactos.org/svn/reactos/vendor/wine/dlls/gdi32/current/tests/bit…
============================================================================== --- vendor/wine/dlls/gdi32/current/tests/bitmap.c [iso-8859-1] (original) +++ vendor/wine/dlls/gdi32/current/tests/bitmap.c [iso-8859-1] Sat Mar 6 11:03:37 2010 @@ -301,7 +301,7 @@ ok(bm.bmType == 0, "wrong bm.bmType %d\n", bm.bmType); ok(bm.bmWidth == bmih->biWidth, "wrong bm.bmWidth %d\n", bm.bmWidth); - ok(bm.bmHeight == bmih->biHeight, "wrong bm.bmHeight %d\n", bm.bmHeight); + ok(bm.bmHeight == abs(bmih->biHeight), "wrong bm.bmHeight %d\n", bm.bmHeight); dib_width_bytes = DIB_GetWidthBytes(bm.bmWidth, bm.bmBitsPixel); bm_width_bytes = BITMAP_GetWidthBytes(bm.bmWidth, bm.bmBitsPixel); if (bm.bmWidthBytes != dib_width_bytes) /* Win2k bug */ @@ -332,7 +332,7 @@ ret = GetObject(hbm, sizeof(*bma) * 2, bma); ok(ret == sizeof(*bma) || broken(ret == sizeof(*bma) * 2 /* Win9x */), "wrong size %d\n", ret); ok(bm.bmWidth == bmih->biWidth, "wrong bm.bmWidth %d\n", bm.bmWidth); - ok(bm.bmHeight == bmih->biHeight, "wrong bm.bmHeight %d\n", bm.bmHeight); + ok(bm.bmHeight == abs(bmih->biHeight), "wrong bm.bmHeight %d\n", bm.bmHeight); ok(bm.bmBits == bits, "wrong bm.bmBits %p != %p\n", bm.bmBits, bits); ret = GetObject(hbm, sizeof(bm) / 2, &bm); @@ -363,20 +363,22 @@ ds.dsBmih.biSizeImage = 0; ok(ds.dsBmih.biSize == bmih->biSize, "%u != %u\n", ds.dsBmih.biSize, bmih->biSize); - ok(ds.dsBmih.biWidth == bmih->biWidth, "%u != %u\n", ds.dsBmih.biWidth, bmih->biWidth); - ok(ds.dsBmih.biHeight == bmih->biHeight, "%u != %u\n", ds.dsBmih.biHeight, bmih->biHeight); + ok(ds.dsBmih.biWidth == bmih->biWidth, "%d != %d\n", ds.dsBmih.biWidth, bmih->biWidth); + ok(ds.dsBmih.biHeight == abs(bmih->biHeight) || + broken(ds.dsBmih.biHeight == bmih->biHeight), /* Win9x/WinMe */ + "%d != %d\n", ds.dsBmih.biHeight, abs(bmih->biHeight)); ok(ds.dsBmih.biPlanes == bmih->biPlanes, "%u != %u\n", ds.dsBmih.biPlanes, bmih->biPlanes); ok(ds.dsBmih.biBitCount == bmih->biBitCount, "%u != %u\n", ds.dsBmih.biBitCount, bmih->biBitCount); ok(ds.dsBmih.biCompression == bmih->biCompression, "%u != %u\n", ds.dsBmih.biCompression, bmih->biCompression); ok(ds.dsBmih.biSizeImage == bmih->biSizeImage, "%u != %u\n", ds.dsBmih.biSizeImage, bmih->biSizeImage); - ok(ds.dsBmih.biXPelsPerMeter == bmih->biXPelsPerMeter, "%u != %u\n", ds.dsBmih.biXPelsPerMeter, bmih->biXPelsPerMeter); - ok(ds.dsBmih.biYPelsPerMeter == bmih->biYPelsPerMeter, "%u != %u\n", ds.dsBmih.biYPelsPerMeter, bmih->biYPelsPerMeter); + ok(ds.dsBmih.biXPelsPerMeter == bmih->biXPelsPerMeter, "%d != %d\n", ds.dsBmih.biXPelsPerMeter, bmih->biXPelsPerMeter); + ok(ds.dsBmih.biYPelsPerMeter == bmih->biYPelsPerMeter, "%d != %d\n", ds.dsBmih.biYPelsPerMeter, bmih->biYPelsPerMeter); memset(&ds, 0xAA, sizeof(ds)); ret = GetObject(hbm, sizeof(ds) - 4, &ds); ok(ret == sizeof(ds.dsBm) || broken(ret == (sizeof(ds) - 4) /* Win9x */), "wrong size %d\n", ret); - ok(ds.dsBm.bmWidth == bmih->biWidth, "%u != %u\n", ds.dsBmih.biWidth, bmih->biWidth); - ok(ds.dsBm.bmHeight == bmih->biHeight, "%u != %u\n", ds.dsBmih.biHeight, bmih->biHeight); + ok(ds.dsBm.bmWidth == bmih->biWidth, "%d != %d\n", ds.dsBmih.biWidth, bmih->biWidth); + ok(ds.dsBm.bmHeight == abs(bmih->biHeight), "%d != %d\n", ds.dsBmih.biHeight, abs(bmih->biHeight)); ok(ds.dsBm.bmBits == bits, "%p != %p\n", ds.dsBm.bmBits, bits); ret = GetObject(hbm, 0, &ds); @@ -525,6 +527,14 @@ test_dib_info(hdib, bits, &pbmi->bmiHeader); DeleteObject(hdib); + /* Test a top-down DIB. */ + pbmi->bmiHeader.biHeight = -100; + hdib = CreateDIBSection(hdc, pbmi, DIB_RGB_COLORS, (void**)&bits, NULL, 0); + ok(hdib != NULL, "CreateDIBSection error %d\n", GetLastError()); + test_dib_info(hdib, bits, &pbmi->bmiHeader); + DeleteObject(hdib); + + pbmi->bmiHeader.biHeight = 100; pbmi->bmiHeader.biBitCount = 8; pbmi->bmiHeader.biCompression = BI_RLE8; SetLastError(0xdeadbeef); Modified: vendor/wine/dlls/gdi32/current/tests/dc.c URL:
http://svn.reactos.org/svn/reactos/vendor/wine/dlls/gdi32/current/tests/dc.…
============================================================================== --- vendor/wine/dlls/gdi32/current/tests/dc.c [iso-8859-1] (original) +++ vendor/wine/dlls/gdi32/current/tests/dc.c [iso-8859-1] Sat Mar 6 11:03:37 2010 @@ -69,7 +69,7 @@ assert(hrgn != 0); hdc = GetDC(hwnd); - ok(hdc != NULL, "CreateDC rets %p\n", hdc); + ok(hdc != NULL, "GetDC failed\n"); ret = GetClipBox(hdc, &rc_clip); ok(ret == SIMPLEREGION, "GetClipBox returned %d instead of SIMPLEREGION\n", ret); @@ -328,6 +328,152 @@ ReleaseDC( 0, hdc ); } +static void test_DeleteDC(void) +{ + HWND hwnd; + HDC hdc, hdc_test; + WNDCLASSEX cls; + int ret; + + /* window DC */ + hwnd = CreateWindowExA(0, "static", NULL, WS_POPUP|WS_VISIBLE, 0,0,100,100, + 0, 0, 0, NULL); + ok(hwnd != 0, "CreateWindowExA failed\n"); + + hdc = GetDC(hwnd); + ok(hdc != 0, "GetDC failed\n"); + ret = GetObjectType(hdc); + ok(ret == OBJ_DC, "expected OBJ_DC, got %d\n", ret); + ret = DeleteDC(hdc); + ok(ret, "DeleteDC failed\n"); + ret = GetObjectType(hdc); + ok(!ret || broken(ret) /* win9x */, "GetObjectType should fail for a deleted DC\n"); + + hdc = GetWindowDC(hwnd); + ok(hdc != 0, "GetDC failed\n"); + ret = GetObjectType(hdc); + ok(ret == OBJ_DC, "expected OBJ_DC, got %d\n", ret); + ret = DeleteDC(hdc); + ok(ret, "DeleteDC failed\n"); + ret = GetObjectType(hdc); + ok(!ret || broken(ret) /* win9x */, "GetObjectType should fail for a deleted DC\n"); + + DestroyWindow(hwnd); + + /* desktop window DC */ + hwnd = GetDesktopWindow(); + ok(hwnd != 0, "GetDesktopWindow failed\n"); + + hdc = GetDC(hwnd); + ok(hdc != 0, "GetDC failed\n"); + ret = GetObjectType(hdc); + ok(ret == OBJ_DC, "expected OBJ_DC, got %d\n", ret); + ret = DeleteDC(hdc); + ok(ret, "DeleteDC failed\n"); + ret = GetObjectType(hdc); + ok(!ret || broken(ret) /* win9x */, "GetObjectType should fail for a deleted DC\n"); + + hdc = GetWindowDC(hwnd); + ok(hdc != 0, "GetDC failed\n"); + ret = GetObjectType(hdc); + ok(ret == OBJ_DC, "expected OBJ_DC, got %d\n", ret); + ret = DeleteDC(hdc); + ok(ret, "DeleteDC failed\n"); + ret = GetObjectType(hdc); + ok(!ret || broken(ret) /* win9x */, "GetObjectType should fail for a deleted DC\n"); + + /* CS_CLASSDC */ + memset(&cls, 0, sizeof(cls)); + cls.cbSize = sizeof(cls); + cls.style = CS_CLASSDC; + cls.hInstance = GetModuleHandle(0); + cls.lpszClassName = "Wine class DC"; + cls.lpfnWndProc = DefWindowProcA; + ret = RegisterClassExA(&cls); + ok(ret, "RegisterClassExA failed\n"); + + hwnd = CreateWindowExA(0, "Wine class DC", NULL, WS_POPUP|WS_VISIBLE, 0,0,100,100, + 0, 0, 0, NULL); + ok(hwnd != 0, "CreateWindowExA failed\n"); + + hdc = GetDC(hwnd); + ok(hdc != 0, "GetDC failed\n"); + ret = GetObjectType(hdc); + ok(ret == OBJ_DC, "expected OBJ_DC, got %d\n", ret); + ret = DeleteDC(hdc); + ok(ret, "DeleteDC failed\n"); + ret = GetObjectType(hdc); + ok(ret == OBJ_DC, "expected OBJ_DC, got %d\n", ret); + ret = ReleaseDC(hwnd, hdc); + ok(ret, "ReleaseDC failed\n"); + ret = GetObjectType(hdc); + ok(ret == OBJ_DC, "expected OBJ_DC, got %d\n", ret); + + hdc_test = hdc; + + hdc = GetWindowDC(hwnd); + ok(hdc != 0, "GetDC failed\n"); + ret = GetObjectType(hdc); + ok(ret == OBJ_DC, "expected OBJ_DC, got %d\n", ret); + ret = DeleteDC(hdc); + ok(ret, "DeleteDC failed\n"); + ret = GetObjectType(hdc); + ok(!ret || broken(ret) /* win9x */, "GetObjectType should fail for a deleted DC\n"); + + DestroyWindow(hwnd); + + ret = GetObjectType(hdc_test); + ok(ret == OBJ_DC, "expected OBJ_DC, got %d\n", ret); + + ret = UnregisterClassA("Wine class DC", GetModuleHandle(NULL)); + ok(ret, "UnregisterClassA failed\n"); + + ret = GetObjectType(hdc_test); +todo_wine + ok(!ret, "GetObjectType should fail for a deleted DC\n"); + + /* CS_OWNDC */ + memset(&cls, 0, sizeof(cls)); + cls.cbSize = sizeof(cls); + cls.style = CS_OWNDC; + cls.hInstance = GetModuleHandle(0); + cls.lpszClassName = "Wine own DC"; + cls.lpfnWndProc = DefWindowProcA; + ret = RegisterClassExA(&cls); + ok(ret, "RegisterClassExA failed\n"); + + hwnd = CreateWindowExA(0, "Wine own DC", NULL, WS_POPUP|WS_VISIBLE, 0,0,100,100, + 0, 0, 0, NULL); + ok(hwnd != 0, "CreateWindowExA failed\n"); + + hdc = GetDC(hwnd); + ok(hdc != 0, "GetDC failed\n"); + ret = GetObjectType(hdc); + ok(ret == OBJ_DC, "expected OBJ_DC, got %d\n", ret); + ret = DeleteDC(hdc); + ok(ret, "DeleteDC failed\n"); + ret = GetObjectType(hdc); + ok(ret == OBJ_DC, "expected OBJ_DC, got %d\n", ret); + ret = ReleaseDC(hwnd, hdc); + ok(ret, "ReleaseDC failed\n"); + ret = GetObjectType(hdc); + ok(ret == OBJ_DC, "expected OBJ_DC, got %d\n", ret); + + hdc = GetWindowDC(hwnd); + ok(hdc != 0, "GetDC failed\n"); + ret = GetObjectType(hdc); + ok(ret == OBJ_DC, "expected OBJ_DC, got %d\n", ret); + ret = DeleteDC(hdc); + ok(ret, "DeleteDC failed\n"); + ret = GetObjectType(hdc); + ok(!ret || broken(ret) /* win9x */, "GetObjectType should fail for a deleted DC\n"); + + DestroyWindow(hwnd); + + ret = UnregisterClassA("Wine own DC", GetModuleHandle(NULL)); + ok(ret, "UnregisterClassA failed\n"); +} + START_TEST(dc) { test_savedc(); @@ -335,4 +481,5 @@ test_GdiConvertToDevmodeW(); test_CreateCompatibleDC(); test_DC_bitmap(); -} + test_DeleteDC(); +} Modified: vendor/wine/dlls/user32/current/dialog.c URL:
http://svn.reactos.org/svn/reactos/vendor/wine/dlls/user32/current/dialog.c…
============================================================================== --- vendor/wine/dlls/user32/current/dialog.c [iso-8859-1] (original) +++ vendor/wine/dlls/user32/current/dialog.c [iso-8859-1] Sat Mar 6 11:03:37 2010 @@ -690,11 +690,14 @@ if (dlgProc) { - if (SendMessageW( hwnd, WM_INITDIALOG, (WPARAM)dlgInfo->hwndFocus, param ) && + HWND focus = GetNextDlgTabItem( hwnd, 0, FALSE ); + if (SendMessageW( hwnd, WM_INITDIALOG, (WPARAM)focus, param ) && ((~template.style & DS_CONTROL) || (template.style & WS_VISIBLE))) { - /* By returning TRUE, app has requested a default focus assignment */ - dlgInfo->hwndFocus = GetNextDlgTabItem( hwnd, 0, FALSE); + /* By returning TRUE, app has requested a default focus assignment. + * WM_INITDIALOG may have changed the tab order, so find the first + * tabstop control again. */ + dlgInfo->hwndFocus = GetNextDlgTabItem( hwnd, 0, FALSE ); if( dlgInfo->hwndFocus ) SetFocus( dlgInfo->hwndFocus ); } @@ -812,6 +815,12 @@ DispatchMessageW( &msg ); } if (dlgInfo->flags & DF_END) break; + + if (bFirstEmpty && msg.message == WM_TIMER) + { + ShowWindow( hwnd, SW_SHOWNORMAL ); + bFirstEmpty = FALSE; + } } } if (dlgInfo->flags & DF_OWNERENABLED) DIALOG_EnableOwner( owner ); Modified: vendor/wine/dlls/user32/current/edit.c URL:
http://svn.reactos.org/svn/reactos/vendor/wine/dlls/user32/current/edit.c?r…
============================================================================== --- vendor/wine/dlls/user32/current/edit.c [iso-8859-1] (original) +++ vendor/wine/dlls/user32/current/edit.c [iso-8859-1] Sat Mar 6 11:03:37 2010 @@ -1632,13 +1632,16 @@ INT vlc = get_vertical_line_count(es); /* check if we are going to move too far */ if(es->y_offset + dy > es->line_count - vlc) - dy = es->line_count - vlc - es->y_offset; + dy = max(es->line_count - vlc, 0) - es->y_offset; /* Notification is done in EDIT_EM_LineScroll */ - if(dy) + if(dy) { EDIT_EM_LineScroll(es, 0, dy); - } - return MAKELONG(dy, TRUE); + return MAKELONG(dy, TRUE); + } + + } + return (LRESULT)FALSE; } Modified: vendor/wine/dlls/user32/current/input.c URL:
http://svn.reactos.org/svn/reactos/vendor/wine/dlls/user32/current/input.c?…
============================================================================== --- vendor/wine/dlls/user32/current/input.c [iso-8859-1] (original) +++ vendor/wine/dlls/user32/current/input.c [iso-8859-1] Sat Mar 6 11:03:37 2010 @@ -134,7 +134,7 @@ break; case INPUT_KEYBOARD: - TRACE("keyboard: vk %x, scan %x, flags %x, time %u, info %lx\n", + TRACE("keyboard: vk %X, scan %x, flags %x, time %u, info %lx\n", inputs[i].u.ki.wVk, inputs[i].u.ki.wScan, inputs[i].u.ki.dwFlags, inputs[i].u.ki.time, inputs[i].u.ki.dwExtraInfo); break; @@ -657,7 +657,7 @@ */ UINT WINAPI MapVirtualKeyExW(UINT code, UINT maptype, HKL hkl) { - TRACE_(keyboard)("(%d, %d, %p)\n", code, maptype, hkl); + TRACE_(keyboard)("(%X, %d, %p)\n", code, maptype, hkl); return USER_Driver->pMapVirtualKeyEx(code, maptype, hkl); } @@ -869,7 +869,7 @@ BOOL WINAPI RegisterHotKey(HWND hwnd,INT id,UINT modifiers,UINT vk) { static int once; - if (!once++) FIXME_(keyboard)("(%p,%d,0x%08x,%d): stub\n",hwnd,id,modifiers,vk); + if (!once++) FIXME_(keyboard)("(%p,%d,0x%08x,%X): stub\n",hwnd,id,modifiers,vk); return TRUE; } Modified: vendor/wine/dlls/user32/current/message.c URL:
http://svn.reactos.org/svn/reactos/vendor/wine/dlls/user32/current/message.…
============================================================================== --- vendor/wine/dlls/user32/current/message.c [iso-8859-1] (original) +++ vendor/wine/dlls/user32/current/message.c [iso-8859-1] Sat Mar 6 11:03:37 2010 @@ -2034,8 +2034,7 @@ if (!(buffer = HeapAlloc( GetProcessHeap(), 0, buffer_size ))) return FALSE; if (!first && !last) last = ~0; - if (hwnd == HWND_BROADCAST || hwnd == HWND_TOPMOST || hwnd == HWND_BOTTOM) - hwnd = (HWND)-1; + if (hwnd == HWND_BROADCAST) hwnd = HWND_TOPMOST; for (;;) { @@ -2999,7 +2998,7 @@ if (msg->message < WM_KEYFIRST || msg->message > WM_KEYLAST) return FALSE; if (msg->message != WM_KEYDOWN && msg->message != WM_SYSKEYDOWN) return TRUE; - TRACE_(key)("Translating key %s (%04lx), scancode %04x\n", + TRACE_(key)("Translating key %s (%04lX), scancode %04x\n", SPY_GetVKeyName(msg->wParam), msg->wParam, HIWORD(msg->lParam)); switch (msg->wParam) Modified: vendor/wine/dlls/user32/current/painting.c URL:
http://svn.reactos.org/svn/reactos/vendor/wine/dlls/user32/current/painting…
============================================================================== --- vendor/wine/dlls/user32/current/painting.c [iso-8859-1] (original) +++ vendor/wine/dlls/user32/current/painting.c [iso-8859-1] Sat Mar 6 11:03:37 2010 @@ -296,6 +296,7 @@ { win->dce = dce; dce->hwnd = hwnd; + dce->count++; list_add_tail( &dce_list, &dce->entry ); } WIN_ReleasePtr( win ); @@ -495,7 +496,7 @@ * (between GetDC and ReleaseDC) */ USER_Lock(); - if (dce->count) + if (dce->count > 1) { WARN("Application trying to delete a busy DC %p\n", dce->hdc); retv = FALSE; Modified: vendor/wine/dlls/user32/current/spy.c URL:
http://svn.reactos.org/svn/reactos/vendor/wine/dlls/user32/current/spy.c?re…
============================================================================== --- vendor/wine/dlls/user32/current/spy.c [iso-8859-1] (original) +++ vendor/wine/dlls/user32/current/spy.c [iso-8859-1] Sat Mar 6 11:03:37 2010 @@ -1166,10 +1166,10 @@ NULL, /* 0x19 */ NULL, /* 0x1A */ "VK_ESCAPE", /* 0x1B */ - NULL, /* 0x1C */ - NULL, /* 0x1D */ - NULL, /* 0x1E */ - NULL, /* 0x1F */ + "VK_CONVERT", /* 0x1C */ + "VK_NONCONVERT", /* 0x1D */ + "VK_ACCEPT", /* 0x1E */ + "VK_MODECHANGE", /* 0x1F */ "VK_SPACE", /* 0x20 */ "VK_PRIOR", /* 0x21 */ "VK_NEXT", /* 0x22 */ @@ -1233,7 +1233,7 @@ "VK_RWIN", /* 0x5C */ "VK_APPS", /* 0x5D */ NULL, /* 0x5E */ - NULL, /* 0x5F */ + "VK_SLEEP", /* 0x5F */ "VK_NUMPAD0", /* 0x60 */ "VK_NUMPAD1", /* 0x61 */ "VK_NUMPAD2", /* 0x62 */ @@ -1284,11 +1284,11 @@ NULL, /* 0x8F */ "VK_NUMLOCK", /* 0x90 */ "VK_SCROLL", /* 0x91 */ - NULL, /* 0x92 */ - NULL, /* 0x93 */ - NULL, /* 0x94 */ - NULL, /* 0x95 */ - NULL, /* 0x96 */ + "VK_OEM_NEC_EQUAL", /* 0x92 aka. VK_OEM_FJ_JISHO */ + "VK_OEM_FJ_MASSHOU", /* 0x93 */ + "VK_OEM_FJ_TOUROKU", /* 0x94 */ + "VK_OEM_FJ_LOYA", /* 0x95 */ + "VK_OEM_FJ_ROYA", /* 0x96 */ NULL, /* 0x97 */ NULL, /* 0x98 */ NULL, /* 0x99 */ Modified: vendor/wine/dlls/user32/current/tests/Makefile.in URL:
http://svn.reactos.org/svn/reactos/vendor/wine/dlls/user32/current/tests/Ma…
============================================================================== --- vendor/wine/dlls/user32/current/tests/Makefile.in [iso-8859-1] (original) +++ vendor/wine/dlls/user32/current/tests/Makefile.in [iso-8859-1] Sat Mar 6 11:03:37 2010 @@ -5,7 +5,7 @@ TESTDLL = user32.dll IMPORTS = user32 gdi32 advapi32 kernel32 -CTESTS = \ +C_SRCS = \ broadcast.c \ class.c \ clipboard.c \ Modified: vendor/wine/dlls/user32/current/tests/dialog.c URL:
http://svn.reactos.org/svn/reactos/vendor/wine/dlls/user32/current/tests/di…
============================================================================== --- vendor/wine/dlls/user32/current/tests/dialog.c [iso-8859-1] (original) +++ vendor/wine/dlls/user32/current/tests/dialog.c [iso-8859-1] Sat Mar 6 11:03:37 2010 @@ -852,8 +852,8 @@ ok ((g_hwndInitialFocusT1 == g_hwndButton2), "Error in initial focus when WM_INITDIALOG returned TRUE: " "Expected the second button (%p), got %s (%p).\n", - g_hwndButton2, GetHwndString(g_hwndInitialFocusT2), - g_hwndInitialFocusT2); + g_hwndButton2, GetHwndString(g_hwndInitialFocusT1), + g_hwndInitialFocusT1); ok ((g_hwndInitialFocusT2 == g_hwndButton2), "Error after first SetFocus() when WM_INITDIALOG returned TRUE: " @@ -926,6 +926,21 @@ return FALSE; } +static INT_PTR CALLBACK TestInitDialogHandleProc (HWND hDlg, UINT uiMsg, + WPARAM wParam, LPARAM lParam) +{ + if (uiMsg == WM_INITDIALOG) + { + HWND expected = GetNextDlgTabItem(hDlg, NULL, FALSE); + ok(expected == (HWND)wParam, + "Expected wParam to be the handle to the first tabstop control (%p), got %p\n", + expected, (HWND)wParam); + + EndDialog(hDlg, LOWORD(SendMessage(hDlg, DM_GETDEFID, 0, 0))); + return TRUE; + } + return FALSE; +} static INT_PTR CALLBACK TestDefButtonDlgProc (HWND hDlg, UINT uiMsg, WPARAM wParam, LPARAM lParam) @@ -977,6 +992,9 @@ ok(GetLastError() == ERROR_INVALID_WINDOW_HANDLE || broken(GetLastError() == 0xdeadbeef), "got %d, expected ERROR_INVALID_WINDOW_HANDLE\n", GetLastError()); + + ret = DialogBoxParamA(GetModuleHandle(NULL), "TEST_EMPTY_DIALOG", 0, TestInitDialogHandleProc, 0); + ok(ret == IDOK, "Expected IDOK\n"); ret = DialogBoxParamA(GetModuleHandle(NULL), "TEST_EMPTY_DIALOG", 0, TestDefButtonDlgProc, 0); ok(ret == IDOK, "Expected IDOK\n"); @@ -1139,6 +1157,55 @@ DestroyWindow(hDlg); } +static INT_PTR CALLBACK timer_message_dlg_proc(HWND wnd, UINT msg, WPARAM wparam, LPARAM lparam) +{ + static int count; + BOOL visible; + + switch (msg) + { + case WM_INITDIALOG: + visible = GetWindowLong(wnd, GWL_STYLE) & WS_VISIBLE; + ok(!visible, "Dialog should not be visible.\n"); + SetTimer(wnd, 1, 100, NULL); + Sleep(200); + return FALSE; + + case WM_COMMAND: + if (LOWORD(wparam) != IDCANCEL) return FALSE; + EndDialog(wnd, LOWORD(wparam)); + return TRUE; + + case WM_TIMER: + if (wparam != 1) return FALSE; + visible = GetWindowLong(wnd, GWL_STYLE) & WS_VISIBLE; + if (!count++) + { + ok(!visible, "Dialog should not be visible.\n"); + PostMessage(wnd, WM_USER, 0, 0); + } + else + { + ok(visible, "Dialog should be visible.\n"); + PostMessage(wnd, WM_COMMAND, IDCANCEL, 0); + } + return TRUE; + + case WM_USER: + visible = GetWindowLong(wnd, GWL_STYLE) & WS_VISIBLE; + ok(visible, "Dialog should be visible.\n"); + return TRUE; + + default: + return FALSE; + } +} + +static void test_timer_message(void) +{ + DialogBoxA(g_hinst, "RADIO_TEST_DIALOG", NULL, timer_message_dlg_proc); +} + START_TEST(dialog) { g_hinst = GetModuleHandleA (0); @@ -1154,4 +1221,5 @@ test_DisabledDialogTest(); test_MessageBoxFontTest(); test_SaveRestoreFocus(); -} + test_timer_message(); +} Modified: vendor/wine/dlls/user32/current/tests/edit.c URL:
http://svn.reactos.org/svn/reactos/vendor/wine/dlls/user32/current/tests/ed…
============================================================================== --- vendor/wine/dlls/user32/current/tests/edit.c [iso-8859-1] (original) +++ vendor/wine/dlls/user32/current/tests/edit.c [iso-8859-1] Sat Mar 6 11:03:37 2010 @@ -1314,6 +1314,57 @@ ok( (r == 65535) || (r == 4294967295UL), "got limit %u (expected 65535 or 4294967295)\n", r); DestroyWindow(hwEdit); +} + +/* Test EM_SCROLL */ +static void test_edit_control_scroll(void) +{ + static const char *single_line_str = "a"; + static const char *multiline_str = "Test\r\nText"; + HWND hwEdit; + LONG ret; + + /* Check the return value when EM_SCROLL doesn't scroll + * anything. Should not return true unless any lines were actually + * scrolled. */ + hwEdit = CreateWindow( + "EDIT", + single_line_str, + WS_VSCROLL | ES_MULTILINE, + 1, 1, 100, 100, + NULL, NULL, hinst, NULL); + + assert(hwEdit); + + ret = SendMessage(hwEdit, EM_SCROLL, SB_PAGEDOWN, 0); + ok(!ret, "Returned %x, expected 0.\n", ret); + + ret = SendMessage(hwEdit, EM_SCROLL, SB_PAGEUP, 0); + ok(!ret, "Returned %x, expected 0.\n", ret); + + ret = SendMessage(hwEdit, EM_SCROLL, SB_LINEUP, 0); + ok(!ret, "Returned %x, expected 0.\n", ret); + + ret = SendMessage(hwEdit, EM_SCROLL, SB_LINEDOWN, 0); + ok(!ret, "Returned %x, expected 0.\n", ret); + + DestroyWindow (hwEdit); + + /* SB_PAGEDOWN while at the beginning of a buffer with few lines + should not cause EM_SCROLL to return a negative value of + scrolled lines that would put us "before" the beginning. */ + hwEdit = CreateWindow( + "EDIT", + multiline_str, + WS_VSCROLL | ES_MULTILINE, + 0, 0, 100, 100, + NULL, NULL, hinst, NULL); + assert(hwEdit); + + ret = SendMessage(hwEdit, EM_SCROLL, SB_PAGEDOWN, 0); + ok(!ret, "Returned %x, expected 0.\n", ret); + + DestroyWindow (hwEdit); } static void test_margins(void) @@ -2319,6 +2370,7 @@ test_edit_control_5(); test_edit_control_6(); test_edit_control_limittext(); + test_edit_control_scroll(); test_margins(); test_margins_font_change(); test_text_position(); Modified: vendor/wine/dlls/user32/current/tests/msg.c URL:
http://svn.reactos.org/svn/reactos/vendor/wine/dlls/user32/current/tests/ms…
============================================================================== --- vendor/wine/dlls/user32/current/tests/msg.c [iso-8859-1] (original) +++ vendor/wine/dlls/user32/current/tests/msg.c [iso-8859-1] Sat Mar 6 11:03:37 2010 @@ -12080,6 +12080,13 @@ { 0, 0, FALSE }, { 0, WAIT_TIMEOUT, FALSE }, { 0, 0, FALSE }, + { 0, 0, FALSE }, +/* 15 */ { 0, 0, FALSE }, + { WAIT_TIMEOUT, 0, FALSE }, + { WAIT_TIMEOUT, 0, FALSE }, + { WAIT_TIMEOUT, 0, FALSE }, + { WAIT_TIMEOUT, 0, FALSE }, +/* 20 */ { WAIT_TIMEOUT, 0, FALSE }, }; static DWORD CALLBACK do_wait_idle_child_thread( void *arg ) @@ -12205,6 +12212,41 @@ WaitForSingleObject( thread, 10000 ); CloseHandle( thread ); break; + case 14: + SetEvent( start_event ); + Sleep( 200 ); + PeekMessage( &msg, HWND_TOPMOST, 0, 0, PM_NOREMOVE ); + break; + case 15: + SetEvent( start_event ); + Sleep( 200 ); + PeekMessage( &msg, HWND_BROADCAST, 0, 0, PM_NOREMOVE ); + break; + case 16: + SetEvent( start_event ); + Sleep( 200 ); + PeekMessage( &msg, HWND_BOTTOM, 0, 0, PM_NOREMOVE ); + break; + case 17: + SetEvent( start_event ); + Sleep( 200 ); + PeekMessage( &msg, (HWND)0xdeadbeef, 0, 0, PM_NOREMOVE ); + break; + case 18: + SetEvent( start_event ); + Sleep( 200 ); + PeekMessage( &msg, HWND_NOTOPMOST, 0, 0, PM_NOREMOVE ); + break; + case 19: + SetEvent( start_event ); + Sleep( 200 ); + PeekMessage( &msg, HWND_MESSAGE, 0, 0, PM_NOREMOVE ); + break; + case 20: + SetEvent( start_event ); + Sleep( 200 ); + PeekMessage( &msg, GetDesktopWindow(), 0, 0, PM_NOREMOVE ); + break; } WaitForSingleObject( end_event, 2000 ); CloseHandle( start_event ); Modified: vendor/wine/dlls/user32/current/tests/scroll.c URL:
http://svn.reactos.org/svn/reactos/vendor/wine/dlls/user32/current/tests/sc…
============================================================================== --- vendor/wine/dlls/user32/current/tests/scroll.c [iso-8859-1] (original) +++ vendor/wine/dlls/user32/current/tests/scroll.c [iso-8859-1] Sat Mar 6 11:03:37 2010 @@ -411,8 +411,8 @@ WS_OVERLAPPEDWINDOW|WS_VSCROLL|WS_HSCROLL, CW_USEDEFAULT, CW_USEDEFAULT, 100, 100, NULL, NULL, GetModuleHandleA(NULL), 0 ); - if ( !ok( hMainWnd != NULL, "Failed to create parent window. Tests aborted.\n" ) ) - return; + ok(hMainWnd != NULL, "Failed to create parent window. Tests aborted.\n"); + if (!hMainWnd) return; assert( hScroll ); Modified: vendor/wine/dlls/user32/current/tests/win.c URL:
http://svn.reactos.org/svn/reactos/vendor/wine/dlls/user32/current/tests/wi…
============================================================================== --- vendor/wine/dlls/user32/current/tests/win.c [iso-8859-1] (original) +++ vendor/wine/dlls/user32/current/tests/win.c [iso-8859-1] Sat Mar 6 11:03:37 2010 @@ -3424,6 +3424,14 @@ check_window_style(WS_CHILD, WS_EX_DLGMODALFRAME|WS_EX_STATICEDGE, WS_CHILD, WS_EX_STATICEDGE|WS_EX_WINDOWEDGE|WS_EX_DLGMODALFRAME); check_window_style(WS_CAPTION, WS_EX_STATICEDGE, WS_CLIPSIBLINGS|WS_CAPTION, WS_EX_STATICEDGE|WS_EX_WINDOWEDGE); check_window_style(0, WS_EX_APPWINDOW, WS_CLIPSIBLINGS|WS_CAPTION, WS_EX_APPWINDOW|WS_EX_WINDOWEDGE); + + if (pGetLayeredWindowAttributes) + { + check_window_style(0, WS_EX_LAYERED, WS_CLIPSIBLINGS|WS_CAPTION, WS_EX_LAYERED|WS_EX_WINDOWEDGE); + check_window_style(0, WS_EX_LAYERED|WS_EX_TRANSPARENT, WS_CLIPSIBLINGS|WS_CAPTION, WS_EX_LAYERED|WS_EX_TRANSPARENT|WS_EX_WINDOWEDGE); + check_window_style(0, WS_EX_LAYERED|WS_EX_TRANSPARENT|WS_EX_TOOLWINDOW, WS_CLIPSIBLINGS|WS_CAPTION, + WS_EX_LAYERED|WS_EX_TRANSPARENT|WS_EX_TOOLWINDOW|WS_EX_WINDOWEDGE); + } } static void test_scrollwindow( HWND hwnd) Modified: vendor/wine/dlls/user32/current/win.c URL:
http://svn.reactos.org/svn/reactos/vendor/wine/dlls/user32/current/win.c?re…
============================================================================== --- vendor/wine/dlls/user32/current/win.c [iso-8859-1] (original) +++ vendor/wine/dlls/user32/current/win.c [iso-8859-1] Sat Mar 6 11:03:37 2010 @@ -3392,29 +3392,33 @@ cy = info->psize->cy; flags &= ~SWP_NOSIZE; } - TRACE( "moving window %p pos %d,%d %dx%x\n", hwnd, x, y, cx, cy ); + TRACE( "moving window %p pos %d,%d %dx%d\n", hwnd, x, y, cx, cy ); SetWindowPos( hwnd, 0, x, y, cx, cy, flags ); } if (info->hdcSrc) { - RECT rect; - HDC hdc = GetDCEx( hwnd, 0, DCX_CACHE ); + HDC hdc = GetWindowDC( hwnd ); if (hdc) { int x = 0, y = 0; - - GetClientRect( hwnd, &rect ); + RECT rect; + + GetWindowRect( hwnd, &rect ); + OffsetRect( &rect, -rect.left, -rect.top); if (info->pptSrc) { x = info->pptSrc->x; y = info->pptSrc->y; } - /* FIXME: intersect rect with info->prcDirty */ - TRACE( "copying window %p pos %d,%d\n", hwnd, x, y ); - BitBlt( hdc, rect.left, rect.top, rect.right, rect.bottom, - info->hdcSrc, rect.left + x, rect.top + y, SRCCOPY ); + + if (!info->prcDirty || (info->prcDirty && IntersectRect(&rect, &rect, info->prcDirty))) + { + TRACE( "copying window %p pos %d,%d\n", hwnd, x, y ); + BitBlt( hdc, rect.left, rect.top, rect.right, rect.bottom, + info->hdcSrc, rect.left + x, rect.top + y, SRCCOPY ); + } ReleaseDC( hwnd, hdc ); } } Modified: vendor/wine/dlls/winex11.drv/current/bitblt.c URL:
http://svn.reactos.org/svn/reactos/vendor/wine/dlls/winex11.drv/current/bit…
============================================================================== --- vendor/wine/dlls/winex11.drv/current/bitblt.c [iso-8859-1] (original) +++ vendor/wine/dlls/winex11.drv/current/bitblt.c [iso-8859-1] Sat Mar 6 11:03:37 2010 @@ -1308,7 +1308,7 @@ bytesToCopy = width * bytesPerPixel; - if (srcDib.dsBmih.biHeight < 0) + if (physDevSrc->bitmap->topdown) { srcPtr = &physDevSrc->bitmap->base[ySrc*srcDib.dsBm.bmWidthBytes + xSrc*bytesPerPixel]; srcRowOffset = srcDib.dsBm.bmWidthBytes; @@ -1319,7 +1319,7 @@ + xSrc*bytesPerPixel]; srcRowOffset = -srcDib.dsBm.bmWidthBytes; } - if (dstDib.dsBmih.biHeight < 0) + if (physDevDst->bitmap->topdown) { dstPtr = &physDevDst->bitmap->base[yDst*dstDib.dsBm.bmWidthBytes + xDst*bytesPerPixel]; dstRowOffset = dstDib.dsBm.bmWidthBytes; Modified: vendor/wine/dlls/winex11.drv/current/dib.c URL:
http://svn.reactos.org/svn/reactos/vendor/wine/dlls/winex11.drv/current/dib…
============================================================================== --- vendor/wine/dlls/winex11.drv/current/dib.c [iso-8859-1] (original) +++ vendor/wine/dlls/winex11.drv/current/dib.c [iso-8859-1] Sat Mar 6 11:03:37 2010 @@ -4054,7 +4054,7 @@ UINT y; TRACE("syncing compatible set bits to app bits\n"); - if ((tmpheight < 0) ^ (ds.dsBmih.biHeight < 0)) + if ((tmpheight < 0) ^ physBitmap->topdown) { dbits += dstwidthb * (lines-1); dstwidthb = -dstwidthb; @@ -4249,7 +4249,7 @@ descr.palentry = NULL; descr.infoWidth = dibSection.dsBmih.biWidth; descr.infoBpp = dibSection.dsBmih.biBitCount; - descr.lines = dibSection.dsBmih.biHeight; + descr.lines = physBitmap->topdown ? -dibSection.dsBmih.biHeight : dibSection.dsBmih.biHeight; descr.image = physBitmap->image; descr.colorMap = colorMap; descr.nColorMap = nColorMap; @@ -4726,12 +4726,17 @@ { X_PHYSBITMAP *physBitmap; DIBSECTION dib; + WORD bpp, compr; + LONG w, h; #ifdef HAVE_LIBXXSHM int major, minor; Bool pixmaps; #endif + DIB_GetBitmapInfo( &bmi->bmiHeader, &w, &h, &bpp, &compr ); + if (!(physBitmap = X11DRV_init_phys_bitmap( hbitmap ))) return 0; + if (h < 0) physBitmap->topdown = TRUE; physBitmap->status = DIB_Status_None; GetObjectW( hbitmap, sizeof(dib), &dib ); Modified: vendor/wine/dlls/winex11.drv/current/ime.c URL:
http://svn.reactos.org/svn/reactos/vendor/wine/dlls/winex11.drv/current/ime…
============================================================================== --- vendor/wine/dlls/winex11.drv/current/ime.c [iso-8859-1] (original) +++ vendor/wine/dlls/winex11.drv/current/ime.c [iso-8859-1] Sat Mar 6 11:03:37 2010 @@ -717,30 +717,36 @@ } break; case IMC_SETOPENSTATUS: - { - LPIMEPRIVATE myPrivate; TRACE("IMC_SETOPENSTATUS\n"); - myPrivate = ImmLockIMCC(lpIMC->hPrivate); - if (lpIMC->fOpen != myPrivate->bInternalState && - myPrivate->bInComposition) + /* Indirectly called from XIM callbacks */ + if (ImmGetIMCCLockCount(lpIMC->hPrivate) > 0) { - if(lpIMC->fOpen == FALSE) + bRet = TRUE; + break; + } + + bRet = X11DRV_SetPreeditState(lpIMC->hWnd, lpIMC->fOpen); + if (bRet) + { + if (!lpIMC->fOpen) { - X11DRV_ForceXIMReset(lpIMC->hWnd); - GenerateIMEMessage(hIMC,WM_IME_ENDCOMPOSITION,0,0); - myPrivate->bInComposition = FALSE; - } - else - { - GenerateIMEMessage(hIMC,WM_IME_STARTCOMPOSITION,0,0); - GenerateIMEMessage(hIMC, WM_IME_COMPOSITION, 0, 0); + LPIMEPRIVATE myPrivate; + + myPrivate = ImmLockIMCC(lpIMC->hPrivate); + if (myPrivate->bInComposition) + { + X11DRV_ForceXIMReset(lpIMC->hWnd); + GenerateIMEMessage(hIMC, WM_IME_ENDCOMPOSITION, 0, 0); + myPrivate->bInComposition = FALSE; + } + ImmUnlockIMCC(lpIMC->hPrivate); } } - myPrivate->bInternalState = lpIMC->fOpen; - bRet = TRUE; - } - break; + else + lpIMC->fOpen = !lpIMC->fOpen; + + break; default: FIXME("Unknown\n"); break; } break; @@ -951,35 +957,36 @@ /* Interfaces to XIM and other parts of winex11drv */ -void IME_SetOpenStatus(BOOL fOpen) -{ +void IME_SetOpenStatus(BOOL fOpen, BOOL force) +{ + HIMC imc; LPINPUTCONTEXT lpIMC; LPIMEPRIVATE myPrivate; - lpIMC = LockRealIMC(FROM_X11); + imc = RealIMC(FROM_X11); + lpIMC = ImmLockIMC(imc); if (lpIMC == NULL) return; myPrivate = ImmLockIMCC(lpIMC->hPrivate); - if (myPrivate->bInternalState && fOpen == FALSE) + if (!fOpen && myPrivate->bInComposition) { ShowWindow(myPrivate->hwndDefault, SW_HIDE); ImmDestroyIMCC(lpIMC->hCompStr); lpIMC->hCompStr = ImeCreateBlankCompStr(); - } + myPrivate->bInComposition = FALSE; + GenerateIMEMessage(imc, WM_IME_ENDCOMPOSITION, 0, 0); + } + + if (lpIMC->fOpen && fOpen) + ImmSetOpenStatus(imc, FALSE); + + if (fOpen || force) + ImmSetOpenStatus(imc, fOpen); ImmUnlockIMCC(lpIMC->hPrivate); - UnlockRealIMC(FROM_X11); - - if (myPrivate->bInComposition && fOpen == FALSE) - { - GenerateIMEMessage(FROM_X11, WM_IME_ENDCOMPOSITION, 0, 0); - myPrivate->bInComposition = FALSE; - } - - if (!myPrivate->bInternalState && fOpen == TRUE) - ImmSetOpenStatus(RealIMC(FROM_X11), fOpen); + ImmUnlockIMC(imc); } INT IME_GetCursorPos(void) @@ -1048,10 +1055,14 @@ void IME_SetResultString(LPWSTR lpResult, DWORD dwResultLen) { + HIMC imc; LPINPUTCONTEXT lpIMC; HIMCC newCompStr; - - lpIMC = LockRealIMC(FROM_X11); + LPIMEPRIVATE myPrivate; + BOOL fOpen; + + imc = RealIMC(FROM_X11); + lpIMC = ImmLockIMC(imc); if (lpIMC == NULL) return; @@ -1059,9 +1070,19 @@ ImmDestroyIMCC(lpIMC->hCompStr); lpIMC->hCompStr = newCompStr; - GenerateIMEMessage(FROM_X11, WM_IME_COMPOSITION, 0, GCS_RESULTSTR); - - UnlockRealIMC(FROM_X11); + myPrivate = ImmLockIMCC(lpIMC->hPrivate); + fOpen = lpIMC->fOpen; + ImmSetOpenStatus(imc, TRUE); + if (!myPrivate->bInComposition) + GenerateIMEMessage(imc, WM_IME_STARTCOMPOSITION, 0, 0); + GenerateIMEMessage(imc, WM_IME_COMPOSITION, 0, GCS_RESULTSTR); + if (!myPrivate->bInComposition) + GenerateIMEMessage(imc, WM_IME_ENDCOMPOSITION, 0, 0); + if (!fOpen) + ImmSetOpenStatus(imc, FALSE); + ImmUnlockIMCC(lpIMC->hPrivate); + + ImmUnlockIMC(imc); } /***** @@ -1290,7 +1311,7 @@ FIXME("WM_IME_NOTIFY:IMN_SETSENTENCEMODE\n"); break; case IMN_SETOPENSTATUS: - FIXME("WM_IME_NOTIFY:IMN_SETOPENSTATUS\n"); + TRACE("WM_IME_NOTIFY:IMN_SETOPENSTATUS\n"); break; case IMN_SETCANDIDATEPOS: FIXME("WM_IME_NOTIFY:IMN_SETCANDIDATEPOS\n"); Modified: vendor/wine/dlls/winex11.drv/current/keyboard.c URL:
http://svn.reactos.org/svn/reactos/vendor/wine/dlls/winex11.drv/current/key…
============================================================================== --- vendor/wine/dlls/winex11.drv/current/keyboard.c [iso-8859-1] (original) +++ vendor/wine/dlls/winex11.drv/current/keyboard.c [iso-8859-1] Sat Mar 6 11:03:37 2010 @@ -51,6 +51,12 @@ #include "wine/unicode.h" #include "wine/debug.h" +/* log format (add 0-padding as appropriate): + keycode %u as in output from xev + keysym %lx as in X11/keysymdef.h + vkey %X as in winuser.h + scancode %x +*/ WINE_DEFAULT_DEBUG_CHANNEL(keyboard); WINE_DECLARE_DEBUG_CHANNEL(key); @@ -1145,7 +1151,7 @@ if ((e->state & ControlMask) && (keysym == XK_Break)) return VK_CANCEL; - TRACE_(key)("e->keycode = %x\n", e->keycode); + TRACE_(key)("e->keycode = %u\n", e->keycode); return keyc2vkey[e->keycode]; } @@ -1231,7 +1237,7 @@ { vk_hook = wVk = VK_PACKET; lParam = MAKELPARAM(1 /* repeat count */, wScan); - TRACE_(key)(" message=0x%04x wParam=0x%04x lParam=0x%08lx\n", + TRACE_(key)("message=0x%04x wParam=0x%04X lParam=0x%08lx\n", message, wVk, lParam); } @@ -1263,7 +1269,7 @@ lParam = MAKELPARAM(1 /* repeat count */, flags); - TRACE_(key)(" message=0x%04x wParam=0x%04x, lParam=0x%08lx, InputKeyState=0x%x\n", + TRACE_(key)(" message=0x%04x wParam=0x%04X, lParam=0x%08lx, InputKeyState=0x%x\n", message, wVk, lParam, key_state_table[wVk]); } @@ -1299,7 +1305,7 @@ if (!state) flags |= KEYEVENTF_KEYUP; - TRACE("Adjusting state for vkey %#.2x. State before %#.2x\n", + TRACE("Adjusting state for vkey %#.2X. State before %#.2x\n", vkey, key_state_table[vkey & 0xff]); /* Fake key being pressed inside wine */ @@ -1377,7 +1383,7 @@ DWORD event_time = EVENT_x11_time_to_win32_time(event->time); Status status = 0; - TRACE_(key)("type %d, window %lx, state 0x%04x, keycode 0x%04x\n", + TRACE_(key)("type %d, window %lx, state 0x%04x, keycode %u\n", event->type, event->window, event->state, event->keycode); wine_tsx11_lock(); @@ -1402,7 +1408,7 @@ ascii_chars = XLookupString(event, buf, sizeof(buf), &keysym, NULL); wine_tsx11_unlock(); - TRACE_(key)("nbyte = %d, status 0x%x\n", ascii_chars, status); + TRACE_(key)("nbyte = %d, status %d\n", ascii_chars, status); if (status == XLookupChars) { @@ -1432,7 +1438,7 @@ wine_tsx11_unlock(); if (!ksname) ksname = "No Name"; - TRACE_(key)("%s : keysym=%lX (%s), # of chars=%d / %s\n", + TRACE_(key)("%s : keysym=%lx (%s), # of chars=%d / %s\n", (event->type == KeyPress) ? "KeyPress" : "KeyRelease", keysym, ksname, ascii_chars, debugstr_an(Str, ascii_chars)); } @@ -1445,7 +1451,7 @@ if (!vkey && ascii_chars) vkey = VK_NONAME; wine_tsx11_unlock(); - TRACE_(key)("keycode 0x%x converted to vkey 0x%x\n", + TRACE_(key)("keycode %u converted to vkey 0x%X\n", event->keycode, vkey); if (!vkey) return; @@ -1525,7 +1531,7 @@ if (!use_xkb || !XkbTranslateKeySym(display, &keysym, 0, &ckey[keyc][i], 1, NULL)) #endif { - TRACE("XKB could not translate keysym %ld\n", keysym); + TRACE("XKB could not translate keysym %04lx\n", keysym); /* FIXME: query what keysym is used as Mode_switch, fill XKeyEvent * with appropriate ShiftMask and Mode_switch, use XLookupString * to get character in the local encoding. @@ -1577,7 +1583,7 @@ char str[5]; for (i = 0; i < 4; i++) str[i] = ckey[keyc][i] ? ckey[keyc][i] : ' '; str[4] = 0; - TRACE_(key)("mismatch for keysym 0x%04lX, keycode %d, got %s\n", keysym, keyc, str ); + TRACE_(key)("mismatch for keycode %u, got %s\n", keyc, str); mismatch++; score -= syms; } @@ -1822,11 +1828,11 @@ } } } - TRACE("keycode %04x => vkey %04x\n", e2.keycode, vkey); + TRACE("keycode %u => vkey %04X\n", e2.keycode, vkey); keyc2vkey[e2.keycode] = vkey; keyc2scan[e2.keycode] = scan; if ((vkey & 0xff) && vkey_used[(vkey & 0xff)]) - WARN("vkey %04x is being used by more than one keycode\n", vkey); + WARN("vkey %04X is being used by more than one keycode\n", vkey); vkey_used[(vkey & 0xff)] = 1; } /* for */ @@ -1874,7 +1880,7 @@ if (vkey) { - TRACE("keycode %04x => vkey %04x\n", e2.keycode, vkey); + TRACE("keycode %u => vkey %04X\n", e2.keycode, vkey); keyc2vkey[e2.keycode] = vkey; } } /* for */ @@ -1912,7 +1918,7 @@ if (TRACE_ON(keyboard)) { - TRACE("spare virtual key %X assigned to keycode %X:\n", + TRACE("spare virtual key %04X assigned to keycode %u:\n", vkey, e2.keycode); TRACE("("); for (i = 0; i < keysyms_per_keycode; i += 1) @@ -1923,12 +1929,12 @@ ksname = XKeysymToString(keysym); if (!ksname) ksname = "NoSymbol"; - TRACE( "%lX (%s) ", keysym, ksname); + TRACE( "%lx (%s) ", keysym, ksname); } TRACE(")\n"); } - TRACE("keycode %04x => vkey %04x\n", e2.keycode, vkey); + TRACE("keycode %u => vkey %04X\n", e2.keycode, vkey); keyc2vkey[e2.keycode] = vkey; vkey_used[vkey] = 1; } /* for */ @@ -1944,7 +1950,7 @@ /* should make sure the scancode is unassigned here, but >=0x60 currently always is */ - TRACE_(key)("assigning scancode %02x to unidentified keycode %02x (%s)\n",scan,keyc,ksname); + TRACE_(key)("assigning scancode %02x to unidentified keycode %u (%s)\n",scan,keyc,ksname); keyc2scan[keyc]=scan++; } @@ -1976,7 +1982,7 @@ retval = ((key_state_table[key] & 0x40) ? 0x0001 : 0) | ((key_state_table[key] & 0x80) ? 0x8000 : 0); key_state_table[key] &= ~0x40; - TRACE_(key)("(%x) -> %x\n", key, retval); + TRACE_(key)("(%X) -> %x\n", key, retval); return retval; } @@ -2127,8 +2133,7 @@ } wine_tsx11_unlock(); - TRACE("'%c'(%#lx, %lu): got keycode %#.2x (%d)\n", - cChar, keysym, keysym, keycode, keycode); + TRACE("'%c'(%lx): got keycode %u\n", cChar, keysym, keycode); /* keycode -> (keyc2vkey) vkey */ ret = keyc2vkey[keycode]; @@ -2298,7 +2303,7 @@ wine_tsx11_unlock(); return 0; /* whatever */ } - TRACE("Found keycode %d (0x%2X)\n",e.keycode,e.keycode); + TRACE("Found keycode %u\n",e.keycode); len = XLookupString(&e, s, sizeof(s), &keysym, NULL); wine_tsx11_unlock(); @@ -2357,7 +2362,7 @@ } ansi = X11DRV_MapVirtualKeyEx(vkey, MAPVK_VK_TO_CHAR, X11DRV_GetKeyboardLayout(0)); - TRACE("scan 0x%04x, vkey 0x%04x, ANSI 0x%04x\n", scanCode, vkey, ansi); + TRACE("scan 0x%04x, vkey 0x%04X, ANSI 0x%04x\n", scanCode, vkey, ansi); /* first get the name of the "regular" keys which is the Upper case value of the keycap imprint. */ @@ -2400,7 +2405,7 @@ keys = XKeycodeToKeysym(display, keyc, 0); name = XKeysymToString(keys); wine_tsx11_unlock(); - TRACE("found scan=%04x keyc=%04x keysym=%04x string=%s\n", + TRACE("found scan=%04x keyc=%u keysym=%04x string=%s\n", scanCode, keyc, (int)keys, name); if (lpBuffer && nSize && name) return MultiByteToWideChar(CP_UNIXCP, 0, name, -1, lpBuffer, nSize); @@ -2408,7 +2413,7 @@ /* Finally issue WARN for unknown keys */ - WARN("(%08x,%p,%d): unsupported key, vkey=%04x, ansi=%04x\n",lParam,lpBuffer,nSize,vkey,ansi); + WARN("(%08x,%p,%d): unsupported key, vkey=%04X, ansi=%04x\n",lParam,lpBuffer,nSize,vkey,ansi); if (lpBuffer && nSize) *lpBuffer = 0; return 0; @@ -2609,9 +2614,9 @@ wine_tsx11_unlock(); return 0; } - else TRACE("Found keycode %d (0x%2X)\n",e.keycode,e.keycode); - - TRACE_(key)("type %d, window %lx, state 0x%04x, keycode 0x%04x\n", + else TRACE("Found keycode %u\n",e.keycode); + + TRACE_(key)("type %d, window %lx, state 0x%04x, keycode %u\n", e.type, e.window, e.state, e.keycode); /* Clients should pass only KeyPress events to XmbLookupString, @@ -2647,7 +2652,7 @@ ksname = XKeysymToString(keysym); wine_tsx11_unlock(); if (!ksname) ksname = "No Name"; - TRACE_(key)("%s : keysym=%lX (%s), # of chars=%d / %s\n", + TRACE_(key)("%s : keysym=%lx (%s), # of chars=%d / %s\n", (e.type == KeyPress) ? "KeyPress" : "KeyRelease", keysym, ksname, ret, debugstr_an(lpChar, ret)); } @@ -2706,9 +2711,9 @@ ksname = "No Name"; if ((keysym >> 8) != 0xff) { - WARN("no char for keysym %04lX (%s) :\n", + WARN("no char for keysym %04lx (%s) :\n", keysym, ksname); - WARN("virtKey=%X, scanCode=%X, keycode=%X, state=%X\n", + WARN("virtKey=%X, scanCode=%X, keycode=%u, state=%X\n", virtKey, scanCode, e.keycode, e.state); } } Modified: vendor/wine/dlls/winex11.drv/current/window.c URL:
http://svn.reactos.org/svn/reactos/vendor/wine/dlls/winex11.drv/current/win…
============================================================================== --- vendor/wine/dlls/winex11.drv/current/window.c [iso-8859-1] (original) +++ vendor/wine/dlls/winex11.drv/current/window.c [iso-8859-1] Sat Mar 6 11:03:37 2010 @@ -142,6 +142,31 @@ } +struct has_popup_result +{ + HWND hwnd; + BOOL found; +}; + +static BOOL CALLBACK has_popup( HWND hwnd, LPARAM lparam ) +{ + struct has_popup_result *result = (struct has_popup_result *)lparam; + + if (hwnd == result->hwnd) return FALSE; /* popups are always above owner */ + result->found = (GetWindow( hwnd, GW_OWNER ) == result->hwnd); + return !result->found; +} + +static BOOL has_owned_popups( HWND hwnd ) +{ + struct has_popup_result result; + + result.hwnd = hwnd; + result.found = FALSE; + EnumWindows( has_popup, (LPARAM)&result ); + return result.found; +} + /*********************************************************************** * is_window_managed * @@ -181,6 +206,8 @@ /* application windows are managed */ ex_style = GetWindowLongW( hwnd, GWL_EXSTYLE ); if (ex_style & WS_EX_APPWINDOW) return TRUE; + /* windows that own popups are managed */ + if (has_owned_popups( hwnd )) return TRUE; /* default: not managed */ return FALSE; } @@ -917,7 +944,7 @@ { long i; Atom protocols[3]; - Atom dndVersion = 4; + Atom dndVersion = WINE_XDND_VERSION; XClassHint *class_hints; char *process_name = get_process_name(); @@ -966,13 +993,41 @@ /*********************************************************************** + * get_owner_whole_window + * + * Retrieve an owner's window, creating it if necessary. + */ +static Window get_owner_whole_window( HWND owner ) +{ + struct x11drv_win_data *data; + + if (!owner) return 0; + + if (!(data = X11DRV_get_win_data( owner ))) + { + if (GetWindowThreadProcessId( owner, NULL ) != GetCurrentThreadId() || + !(data = X11DRV_create_win_data( owner ))) + return (Window)GetPropA( owner, whole_window_prop ); + } + else if (!data->managed) /* make it managed */ + { + SetWindowPos( owner, 0, 0, 0, 0, 0, + SWP_NOACTIVATE | SWP_NOZORDER | SWP_NOSIZE | SWP_NOMOVE | + SWP_NOREDRAW | SWP_DEFERERASE | SWP_NOSENDCHANGING | SWP_STATECHANGED ); + } + return data->whole_window; +} + + +/*********************************************************************** * set_wm_hints * * Set the window manager hints for a newly-created window */ static void set_wm_hints( Display *display, struct x11drv_win_data *data ) { - Window group_leader; + Window group_leader = data->whole_window; + Window owner_win = 0; Atom window_type; MwmHints mwm_hints; DWORD style, ex_style; @@ -990,20 +1045,12 @@ style = GetWindowLongW( data->hwnd, GWL_STYLE ); ex_style = GetWindowLongW( data->hwnd, GWL_EXSTYLE ); owner = get_window_owner( data->hwnd ); - } - - /* transient for hint */ - if (owner) - { - Window owner_win = X11DRV_get_whole_window( owner ); - wine_tsx11_lock(); - XSetTransientForHint( display, data->whole_window, owner_win ); - wine_tsx11_unlock(); - group_leader = owner_win; - } - else group_leader = data->whole_window; + if ((owner_win = get_owner_whole_window( owner ))) group_leader = owner_win; + } wine_tsx11_lock(); + + if (owner_win) XSetTransientForHint( display, data->whole_window, owner_win ); /* size hints */ set_size_hints( display, data, style ); Modified: vendor/wine/dlls/winex11.drv/current/x11drv.h URL:
http://svn.reactos.org/svn/reactos/vendor/wine/dlls/winex11.drv/current/x11…
============================================================================== --- vendor/wine/dlls/winex11.drv/current/x11drv.h [iso-8859-1] (original) +++ vendor/wine/dlls/winex11.drv/current/x11drv.h [iso-8859-1] Sat Mar 6 11:03:37 2010 @@ -64,6 +64,8 @@ #define MAX_PIXELFORMATS 8 #define MAX_DASHLEN 16 +#define WINE_XDND_VERSION 4 + struct tagCURSORICONINFO; extern void CDECL wine_tsx11_lock(void); @@ -125,6 +127,7 @@ int *colorMap; /* color map info */ int nColorMap; BOOL trueColor; + BOOL topdown; CRITICAL_SECTION lock; /* GDI access lock */ enum x11drv_shm_mode shm_mode; #ifdef HAVE_LIBXXSHM @@ -300,7 +303,7 @@ /* IME support */ extern void IME_UnregisterClasses(void); -extern void IME_SetOpenStatus(BOOL fOpen); +extern void IME_SetOpenStatus(BOOL fOpen, BOOL force); extern INT IME_GetCursorPos(void); extern void IME_SetCursorPos(DWORD pos); extern void IME_UpdateAssociation(HWND focus); @@ -809,6 +812,7 @@ extern void X11DRV_SetupXIM(void) DECLSPEC_HIDDEN; extern void X11DRV_XIMLookupChars( const char *str, DWORD count ) DECLSPEC_HIDDEN; extern void X11DRV_ForceXIMReset(HWND hwnd) DECLSPEC_HIDDEN; +extern BOOL X11DRV_SetPreeditState(HWND hwnd, BOOL fOpen); /* FIXME: private functions imported from user32 */ extern LRESULT HOOK_CallHooks( INT id, INT code, WPARAM wparam, LPARAM lparam, BOOL unicode ); Modified: vendor/wine/dlls/winex11.drv/current/xdnd.c URL:
http://svn.reactos.org/svn/reactos/vendor/wine/dlls/winex11.drv/current/xdn…
============================================================================== --- vendor/wine/dlls/winex11.drv/current/xdnd.c [iso-8859-1] (original) +++ vendor/wine/dlls/winex11.drv/current/xdnd.c [iso-8859-1] Sat Mar 6 11:03:37 2010 @@ -87,13 +87,21 @@ */ void X11DRV_XDND_EnterEvent( HWND hWnd, XClientMessageEvent *event ) { + int version; Atom *xdndtypes; unsigned long count = 0; - TRACE("ver(%ld) check-XdndTypeList(%ld) data=%ld,%ld,%ld,%ld,%ld\n", - (event->data.l[1] & 0xFF000000) >> 24, (event->data.l[1] & 1), + version = (event->data.l[1] & 0xFF000000) >> 24; + TRACE("ver(%d) check-XdndTypeList(%ld) data=%ld,%ld,%ld,%ld,%ld\n", + version, (event->data.l[1] & 1), event->data.l[0], event->data.l[1], event->data.l[2], event->data.l[3], event->data.l[4]); + + if (version > WINE_XDND_VERSION) + { + TRACE("Ignores unsupported version\n"); + return; + } /* If the source supports more than 3 data types we retrieve * the entire list. */ Modified: vendor/wine/dlls/winex11.drv/current/xim.c URL:
http://svn.reactos.org/svn/reactos/vendor/wine/dlls/winex11.drv/current/xim…
============================================================================== --- vendor/wine/dlls/winex11.drv/current/xim.c [iso-8859-1] (original) +++ vendor/wine/dlls/winex11.drv/current/xim.c [iso-8859-1] Sat Mar 6 11:03:37 2010 @@ -32,7 +32,7 @@ #include "imm.h" #include "wine/debug.h" -WINE_DEFAULT_DEBUG_CHANNEL(x11drv); +WINE_DEFAULT_DEBUG_CHANNEL(xim); #ifndef HAVE_XICCALLBACK_CALLBACK #define XICCallback XIMCallback @@ -120,10 +120,30 @@ HeapFree(GetProcessHeap(), 0, wcOutput); } +static BOOL XIMPreEditStateNotifyCallback(XIC xic, XPointer p, XPointer data) +{ + const struct x11drv_win_data * const win_data = (struct x11drv_win_data *)p; + const XIMPreeditState state = ((XIMPreeditStateNotifyCallbackStruct *)data)->state; + + TRACE("xic = %p, win = %lx, state = %lu\n", xic, win_data->whole_window, state); + switch (state) + { + case XIMPreeditEnable: + IME_SetOpenStatus(TRUE, TRUE); + break; + case XIMPreeditDisable: + IME_SetOpenStatus(FALSE, TRUE); + break; + default: + break; + } + return TRUE; +} + static int XIMPreEditStartCallback(XIC ic, XPointer client_data, XPointer call_data) { TRACE("PreEditStartCallback %p\n",ic); - IME_SetOpenStatus(TRUE); + IME_SetOpenStatus(TRUE, FALSE); ximInComposeMode = TRUE; return -1; } @@ -137,7 +157,7 @@ dwCompStringSize = 0; dwCompStringLength = 0; CompositionString = NULL; - IME_SetOpenStatus(FALSE); + IME_SetOpenStatus(FALSE, FALSE); } static void XIMPreEditDrawCallback(XIM ic, XPointer client_data, @@ -243,6 +263,51 @@ wine_tsx11_unlock(); } } + +BOOL X11DRV_SetPreeditState(HWND hwnd, BOOL fOpen) +{ + XIC ic; + XIMPreeditState state; + XVaNestedList attr_set, attr_get; + BOOL ret; + + ic = X11DRV_get_ic(hwnd); + if (!ic) + return FALSE; + + if (fOpen) + state = XIMPreeditEnable; + else + state = XIMPreeditDisable; + + ret = FALSE; + wine_tsx11_lock(); + + attr_set = XVaCreateNestedList(0, XNPreeditState, state, NULL); + if (attr_set == NULL) + goto error1; + + attr_get = XVaCreateNestedList(0, XNPreeditState, &state, NULL); + if (attr_get == NULL) + goto error2; + + if (XSetICValues(ic, XNPreeditAttributes, attr_set, NULL) != NULL) + goto error3; + + /* SCIM claims it supports XNPreeditState, but seems to ignore */ + state = XIMPreeditUnKnown; + ret = XGetICValues(ic, XNPreeditAttributes, attr_get, NULL) == NULL && + ((fOpen && state == XIMPreeditEnable) || + (!fOpen && state == XIMPreeditDisable)); +error3: + XFree(attr_get); +error2: + XFree(attr_set); +error1: + wine_tsx11_unlock(); + return ret; +} + /*********************************************************************** * X11DRV_InitXIM @@ -446,7 +511,7 @@ XVaNestedList status = NULL; XIC xic; XICCallback destroy = {(XPointer)data, (XICProc)X11DRV_DestroyIC}; - XICCallback P_StartCB, P_DoneCB, P_DrawCB, P_CaretCB; + XICCallback P_StateNotifyCB, P_StartCB, P_DoneCB, P_DrawCB, P_CaretCB; LANGID langid = PRIMARYLANGID(LANGIDFROMLCID(GetThreadLocale())); Window win = data->whole_window; XFontSet fontSet = x11drv_thread_data()->font_set; @@ -472,10 +537,12 @@ } /* create callbacks */ + P_StateNotifyCB.client_data = (XPointer)data; P_StartCB.client_data = NULL; P_DoneCB.client_data = NULL; P_DrawCB.client_data = NULL; P_CaretCB.client_data = NULL; + P_StateNotifyCB.callback = (XICProc)XIMPreEditStateNotifyCallback; P_StartCB.callback = (XICProc)XIMPreEditStartCallback; P_DoneCB.callback = (XICProc)XIMPreEditDoneCallback; P_DrawCB.callback = (XICProc)XIMPreEditDrawCallback; @@ -486,6 +553,7 @@ preedit = XVaCreateNestedList(0, XNFontSet, fontSet, XNSpotLocation, &spot, + XNPreeditStateNotifyCallback, &P_StateNotifyCB, XNPreeditStartCallback, &P_StartCB, XNPreeditDoneCallback, &P_DoneCB, XNPreeditDrawCallback, &P_DrawCB, @@ -496,6 +564,7 @@ else { preedit = XVaCreateNestedList(0, + XNPreeditStateNotifyCallback, &P_StateNotifyCB, XNPreeditStartCallback, &P_StartCB, XNPreeditDoneCallback, &P_DoneCB, XNPreeditDrawCallback, &P_DrawCB, Modified: vendor/wine/dlls/winex11.drv/current/xrender.c URL:
http://svn.reactos.org/svn/reactos/vendor/wine/dlls/winex11.drv/current/xre…
============================================================================== --- vendor/wine/dlls/winex11.drv/current/xrender.c [iso-8859-1] (original) +++ vendor/wine/dlls/winex11.drv/current/xrender.c [iso-8859-1] Sat Mar 6 11:03:37 2010 @@ -1862,7 +1862,7 @@ if(xscale != 1.0 || yscale != 1.0) { if(mask_pict) - set_xrender_transformation(mask_pict, xscale, yscale, x_offset, y_offset); + set_xrender_transformation(mask_pict, xscale, yscale, x_src + x_offset, y_src + y_offset); else set_xrender_transformation(src_pict, xscale, yscale, x_src + x_offset, y_src + y_offset); @@ -1871,11 +1871,16 @@ else { if(mask_pict) + { set_xrender_transformation(mask_pict, 1, 1, 0, 0); + /* Note since the 'source data' is in the mask picture, we have to pass x_src / y_src using mask_x / mask_y */ + pXRenderComposite(gdi_display, op, src_pict, mask_pict, dst_pict, 0, 0, x_src, y_src, 0, 0, width, height); + } else + { set_xrender_transformation(src_pict, 1, 1, 0, 0); - - pXRenderComposite(gdi_display, op, src_pict, mask_pict, dst_pict, x_src, y_src, 0, 0, 0, 0, width, height); + pXRenderComposite(gdi_display, op, src_pict, mask_pict, dst_pict, x_src, y_src, 0, 0, 0, 0, width, height); + } } } @@ -1948,10 +1953,10 @@ /* If the source is a 1x1 bitmap, tiling is equivalent to stretching, but tiling is much faster. Therefore, we do no stretching in this case. */ - repeat_src = dib.dsBmih.biWidth == 1 && abs(dib.dsBmih.biHeight) == 1; + repeat_src = dib.dsBmih.biWidth == 1 && dib.dsBmih.biHeight == 1; if (xSrc < 0 || ySrc < 0 || widthSrc < 0 || heightSrc < 0 || xSrc + widthSrc > dib.dsBmih.biWidth - || ySrc + heightSrc > abs(dib.dsBmih.biHeight)) + || ySrc + heightSrc > dib.dsBmih.biHeight) { WARN("Invalid src coords: (%d,%d), size %dx%d\n", xSrc, ySrc, widthSrc, heightSrc); SetLastError(ERROR_INVALID_PARAMETER); @@ -1964,7 +1969,7 @@ } dstbits = data = HeapAlloc(GetProcessHeap(), 0, heightSrc * widthSrc * 4); - if(dib.dsBmih.biHeight < 0) { /* top-down dib */ + if (devSrc->bitmap->topdown) { /* top-down dib */ top_down = TRUE; dstbits += widthSrc * (heightSrc - 1); y2 = ySrc; Modified: vendor/wine/server/current/console.c URL:
http://svn.reactos.org/svn/reactos/vendor/wine/server/current/console.c?rev…
============================================================================== --- vendor/wine/server/current/console.c [iso-8859-1] (original) +++ vendor/wine/server/current/console.c [iso-8859-1] Sat Mar 6 11:03:37 2010 @@ -294,7 +294,7 @@ console_input->win = 0; console_input->event = create_event( NULL, NULL, 0, 1, 0, NULL ); - if (!console_input->history || !console_input->evt) + if (!console_input->history || !console_input->evt || !console_input->event) { release_object( console_input ); return NULL; Modified: vendor/wine/server/current/debugger.c URL:
http://svn.reactos.org/svn/reactos/vendor/wine/server/current/debugger.c?re…
============================================================================== --- vendor/wine/server/current/debugger.c [iso-8859-1] (original) +++ vendor/wine/server/current/debugger.c [iso-8859-1] Sat Mar 6 11:03:37 2010 @@ -420,15 +420,9 @@ /* attach a process to a debugger thread and suspend it */ static int debugger_attach( struct process *process, struct thread *debugger ) { - struct thread *thread; - if (process->debugger) goto error; /* already being debugged */ if (!is_process_init_done( process )) goto error; /* still starting up */ if (list_empty( &process->thread_list )) goto error; /* no thread running in the process */ - - /* make sure we don't create a debugging loop */ - for (thread = debugger; thread; thread = thread->process->debugger) - if (thread->process == process) goto error; /* don't let a debugger debug its console... won't work */ if (debugger->process->console && console_get_renderer(debugger->process->console)->process == process) Modified: vendor/wine/server/current/queue.c URL:
http://svn.reactos.org/svn/reactos/vendor/wine/server/current/queue.c?rev=4…
============================================================================== --- vendor/wine/server/current/queue.c [iso-8859-1] (original) +++ vendor/wine/server/current/queue.c [iso-8859-1] Sat Mar 6 11:03:37 2010 @@ -636,7 +636,7 @@ static int match_window( user_handle_t win, user_handle_t msg_win ) { if (!win) return 1; - if (win == (user_handle_t)-1) return !msg_win; + if (win == -1 || win == 1) return !msg_win; if (msg_win == win) return 1; return is_child_window( win, msg_win ); } @@ -1819,6 +1819,7 @@ return; } + if (get_win == -1 && current->process->idle_event) set_event( current->process->idle_event ); queue->wake_mask = req->wake_mask; queue->changed_mask = req->changed_mask; set_error( STATUS_PENDING ); /* FIXME */ Modified: vendor/wine/server/current/registry.c URL:
http://svn.reactos.org/svn/reactos/vendor/wine/server/current/registry.c?re…
============================================================================== --- vendor/wine/server/current/registry.c [iso-8859-1] (original) +++ vendor/wine/server/current/registry.c [iso-8859-1] Sat Mar 6 11:03:37 2010 @@ -84,6 +84,8 @@ #define KEY_DELETED 0x0002 /* key has been deleted */ #define KEY_DIRTY 0x0004 /* key has been modified */ #define KEY_SYMLINK 0x0008 /* key is a symbolic link */ +#define KEY_WOW64 0x0010 /* key contains a Wow6432Node subkey */ +#define KEY_WOWSHARE 0x0020 /* key is a Wow64 shared key (used for Software\Classes) */ /* a key value */ struct key_value @@ -109,6 +111,7 @@ static struct timeout_user *save_timeout_user; /* saving timer */ static const WCHAR root_name[] = { '\\','R','e','g','i','s','t','r','y','\\' }; +static const WCHAR wow6432node[] = {'W','o','w','6','4','3','2','N','o','d','e'}; static const WCHAR symlink_value[] = {'S','y','m','b','o','l','i','c','L','i','n','k','V','a','l','u','e'}; static const struct unicode_str symlink_str = { symlink_value, sizeof(symlink_value) }; @@ -166,6 +169,12 @@ }; +static inline int is_wow6432node( const WCHAR *name, unsigned int len ) +{ + return (len == sizeof(wow6432node) && + !memicmpW( name, wow6432node, sizeof(wow6432node)/sizeof(WCHAR) )); +} + /* * The registry text file format v2 used by this code is similar to the one * used by REGEDIT import/export functionality, with the following differences: @@ -528,6 +537,7 @@ for (i = ++parent->last_subkey; i > index; i--) parent->subkeys[i] = parent->subkeys[i-1]; parent->subkeys[index] = key; + if (is_wow6432node( key->name, key->namelen )) parent->flags |= KEY_WOW64; } return key; } @@ -546,6 +556,7 @@ parent->last_subkey--; key->flags |= KEY_DELETED; key->parent = NULL; + if (is_wow6432node( key->name, key->namelen )) parent->flags &= ~KEY_WOW64; release_object( key ); /* try to shrink the array */ @@ -587,6 +598,22 @@ return NULL; } +/* return the wow64 variant of the key, or the key itself if none */ +static struct key *find_wow64_subkey( struct key *key, const struct unicode_str *name ) +{ + static const struct unicode_str wow6432node_str = { wow6432node, sizeof(wow6432node) }; + int index; + + if (!(key->flags & KEY_WOW64)) return key; + if (!is_wow6432node( name->str, name->len )) + { + key = find_subkey( key, &wow6432node_str, &index ); + assert( key ); /* if KEY_WOW64 is set we must find it */ + } + return key; +} + + /* follow a symlink and return the resolved key */ static struct key *follow_symlink( struct key *key, int iteration ) { @@ -617,9 +644,137 @@ return key; } +/* open a key until we find an element that doesn't exist */ +/* helper for open_key and create_key */ +static struct key *open_key_prefix( struct key *key, const struct unicode_str *name, + unsigned int access, struct unicode_str *token, int *index ) +{ + token->str = NULL; + if (!get_path_token( name, token )) return NULL; + if (access & KEY_WOW64_32KEY) key = find_wow64_subkey( key, token ); + while (token->len) + { + struct key *subkey; + if (!(subkey = find_subkey( key, token, index ))) + { + if ((key->flags & KEY_WOWSHARE) && !(access & KEY_WOW64_64KEY)) + { + /* try in the 64-bit parent */ + key = key->parent; + subkey = find_subkey( key, token, index ); + } + } + if (!subkey) break; + key = subkey; + get_path_token( name, token ); + if (!token->len) break; + if (!(access & KEY_WOW64_64KEY)) key = find_wow64_subkey( key, token ); + if (!(key = follow_symlink( key, 0 ))) + { + set_error( STATUS_OBJECT_NAME_NOT_FOUND ); + return NULL; + } + } + return key; +} + /* open a subkey */ -static struct key *open_key( struct key *key, const struct unicode_str *name, unsigned int attributes ) -{ +static struct key *open_key( struct key *key, const struct unicode_str *name, unsigned int access, + unsigned int attributes ) +{ + int index; + struct unicode_str token; + + if (!(key = open_key_prefix( key, name, access, &token, &index ))) return NULL; + + if (token.len) + { + set_error( STATUS_OBJECT_NAME_NOT_FOUND ); + return NULL; + } + if (!(access & KEY_WOW64_64KEY)) key = find_wow64_subkey( key, &token ); + if (!(attributes & OBJ_OPENLINK) && !(key = follow_symlink( key, 0 ))) + { + set_error( STATUS_OBJECT_NAME_NOT_FOUND ); + return NULL; + } + if (debug_level > 1) dump_operation( key, NULL, "Open" ); + grab_object( key ); + return key; +} + +/* create a subkey */ +static struct key *create_key( struct key *key, const struct unicode_str *name, + const struct unicode_str *class, unsigned int options, + unsigned int access, unsigned int attributes, int *created ) +{ + int index; + struct unicode_str token, next; + + if (key->flags & KEY_DELETED) /* we cannot create a subkey under a deleted key */ + { + set_error( STATUS_KEY_DELETED ); + return NULL; + } + + *created = 0; + if (!(key = open_key_prefix( key, name, access, &token, &index ))) return NULL; + + if (!token.len) /* the key already exists */ + { + if (!(access & KEY_WOW64_64KEY)) key = find_wow64_subkey( key, &token ); + if (options & REG_OPTION_CREATE_LINK) + { + set_error( STATUS_OBJECT_NAME_COLLISION ); + return NULL; + } + if (!(attributes & OBJ_OPENLINK) && !(key = follow_symlink( key, 0 ))) + { + set_error( STATUS_OBJECT_NAME_NOT_FOUND ); + return NULL; + } + if (debug_level > 1) dump_operation( key, NULL, "Open" ); + grab_object( key ); + return key; + } + + /* token must be the last path component at this point */ + next = token; + get_path_token( name, &next ); + if (next.len) + { + set_error( STATUS_OBJECT_NAME_NOT_FOUND ); + return NULL; + } + + if ((key->flags & KEY_VOLATILE) && !(options & REG_OPTION_VOLATILE)) + { + set_error( STATUS_CHILD_MUST_BE_VOLATILE ); + return NULL; + } + *created = 1; + make_dirty( key ); + if (!(key = alloc_subkey( key, &token, index, current_time ))) return NULL; + + if (options & REG_OPTION_CREATE_LINK) key->flags |= KEY_SYMLINK; + if (options & REG_OPTION_VOLATILE) key->flags |= KEY_VOLATILE; + else key->flags |= KEY_DIRTY; + + if (debug_level > 1) dump_operation( key, NULL, "Create" ); + if (class && class->len) + { + key->classlen = class->len; + free(key->class); + if (!(key->class = memdup( class->str, key->classlen ))) key->classlen = 0; + } + grab_object( key ); + return key; +} + +/* recursively create a subkey (for internal use only) */ +static struct key *create_key_recursive( struct key *key, const struct unicode_str *name, timeout_t modif ) +{ + struct key *base; int index; struct unicode_str token; @@ -627,113 +782,34 @@ if (!get_path_token( name, &token )) return NULL; while (token.len) { - if (!(key = find_subkey( key, &token, &index ))) - { - set_error( STATUS_OBJECT_NAME_NOT_FOUND ); - return NULL; - } - get_path_token( name, &token ); - if (!token.len) break; - if (!(key = follow_symlink( key, 0 ))) - { - set_error( STATUS_OBJECT_NAME_NOT_FOUND ); - return NULL; - } - } - - if (!(attributes & OBJ_OPENLINK) && !(key = follow_symlink( key, 0 ))) - { - set_error( STATUS_OBJECT_NAME_NOT_FOUND ); - return NULL; - } - if (debug_level > 1) dump_operation( key, NULL, "Open" ); - grab_object( key ); - return key; -} - -/* create a subkey */ -static struct key *create_key( struct key *key, const struct unicode_str *name, - const struct unicode_str *class, int flags, unsigned int options, - unsigned int attributes, timeout_t modif, int *created ) -{ - struct key *base; - int index; - struct unicode_str token; - - if (key->flags & KEY_DELETED) /* we cannot create a subkey under a deleted key */ - { - set_error( STATUS_KEY_DELETED ); - return NULL; - } - - token.str = NULL; - if (!get_path_token( name, &token )) return NULL; - *created = 0; - while (token.len) - { struct key *subkey; if (!(subkey = find_subkey( key, &token, &index ))) break; key = subkey; - get_path_token( name, &token ); - if (!token.len) break; - if (!(subkey = follow_symlink( subkey, 0 ))) + if (!(key = follow_symlink( key, 0 ))) { set_error( STATUS_OBJECT_NAME_NOT_FOUND ); return NULL; } - } - - /* create the remaining part */ - - if (!token.len) - { - if (options & REG_OPTION_CREATE_LINK) - { - set_error( STATUS_OBJECT_NAME_COLLISION ); - return NULL; - } - if (!(attributes & OBJ_OPENLINK) && !(key = follow_symlink( key, 0 ))) - { - set_error( STATUS_OBJECT_NAME_NOT_FOUND ); - return NULL; - } - goto done; - } - if (options & REG_OPTION_VOLATILE) - { - flags = (flags & ~KEY_DIRTY) | KEY_VOLATILE; - } - else if (key->flags & KEY_VOLATILE) - { - set_error( STATUS_CHILD_MUST_BE_VOLATILE ); - return NULL; - } - *created = 1; - if (flags & KEY_DIRTY) make_dirty( key ); - if (!(key = alloc_subkey( key, &token, index, modif ))) return NULL; - base = key; - for (;;) - { - key->flags |= flags; get_path_token( name, &token ); - if (!token.len) break; - /* we know the index is always 0 in a new key */ - if (!(key = alloc_subkey( key, &token, 0, modif ))) - { - free_subkey( base, index ); - return NULL; - } - } - if (options & REG_OPTION_CREATE_LINK) key->flags |= KEY_SYMLINK; - - done: - if (debug_level > 1) dump_operation( key, NULL, "Create" ); - if (class && class->len) - { - key->classlen = class->len; - free(key->class); - if (!(key->class = memdup( class->str, key->classlen ))) key->classlen = 0; - } + } + + if (token.len) + { + if (!(key = alloc_subkey( key, &token, index, modif ))) return NULL; + base = key; + for (;;) + { + get_path_token( name, &token ); + if (!token.len) break; + /* we know the index is always 0 in a new key */ + if (!(key = alloc_subkey( key, &token, 0, modif ))) + { + free_subkey( base, index ); + return NULL; + } + } + } + grab_object( key ); return key; } @@ -1191,7 +1267,7 @@ } /* load and create a key from the input file */ -static struct key *load_key( struct key *base, const char *buffer, int flags, +static struct key *load_key( struct key *base, const char *buffer, int prefix_len, struct file_load_info *info ) { WCHAR *p; @@ -1227,7 +1303,7 @@ } name.str = p; name.len = len - (p - info->tmp + 1) * sizeof(WCHAR); - return create_key( base, &name, NULL, flags, 0, 0, modif, &res ); + return create_key_recursive( base, &name, modif ); } /* load a key option from the input file */ @@ -1440,7 +1516,7 @@ case '[': /* new key */ if (subkey) release_object( subkey ); if (prefix_len == -1) prefix_len = get_prefix_len( key, p + 1, &info ); - if (!(subkey = load_key( key, p + 1, key->flags, prefix_len, &info ))) + if (!(subkey = load_key( key, p + 1, prefix_len, &info ))) file_read_error( "Error creating key", &info ); break; case '@': /* default value */ @@ -1538,15 +1614,17 @@ { static const WCHAR HKLM[] = { 'M','a','c','h','i','n','e' }; static const WCHAR HKU_default[] = { 'U','s','e','r','\\','.','D','e','f','a','u','l','t' }; + static const WCHAR classes[] = {'S','o','f','t','w','a','r','e','\\', + 'C','l','a','s','s','e','s','\\', + 'W','o','w','6','4','3','2','N','o','d','e'}; static const struct unicode_str root_name = { NULL, 0 }; static const struct unicode_str HKLM_name = { HKLM, sizeof(HKLM) }; static const struct unicode_str HKU_name = { HKU_default, sizeof(HKU_default) }; + static const struct unicode_str classes_name = { classes, sizeof(classes) }; WCHAR *current_user_path; struct unicode_str current_user_str; - - struct key *key; - int dummy; + struct key *key, *hklm, *hkcu; /* switch to the config dir */ @@ -1559,15 +1637,14 @@ /* load system.reg into Registry\Machine */ - if (!(key = create_key( root_key, &HKLM_name, NULL, 0, 0, 0, current_time, &dummy ))) + if (!(hklm = create_key_recursive( root_key, &HKLM_name, current_time ))) fatal_error( "could not create Machine registry key\n" ); - load_init_registry_from_file( "system.reg", key ); - release_object( key ); + load_init_registry_from_file( "system.reg", hklm ); /* load userdef.reg into Registry\User\.Default */ - if (!(key = create_key( root_key, &HKU_name, NULL, 0, 0, 0, current_time, &dummy ))) + if (!(key = create_key_recursive( root_key, &HKU_name, current_time ))) fatal_error( "could not create User\\.Default registry key\n" ); load_init_registry_from_file( "userdef.reg", key ); @@ -1578,11 +1655,24 @@ /* FIXME: match default user in token.c. should get from process token instead */ current_user_path = format_user_registry_path( security_interactive_sid, ¤t_user_str ); if (!current_user_path || - !(key = create_key( root_key, ¤t_user_str, NULL, 0, 0, 0, current_time, &dummy ))) + !(hkcu = create_key_recursive( root_key, ¤t_user_str, current_time ))) fatal_error( "could not create HKEY_CURRENT_USER registry key\n" ); free( current_user_path ); - load_init_registry_from_file( "user.reg", key ); - release_object( key ); + load_init_registry_from_file( "user.reg", hkcu ); + + /* set the shared flag on Software\Classes\Wow6432Node */ + if (sizeof(void *) > sizeof(int)) + { + if ((key = create_key_recursive( hklm, &classes_name, current_time ))) + { + key->flags |= KEY_WOWSHARE; + release_object( key ); + } + /* FIXME: handle HKCU too */ + } + + release_object( hklm ); + release_object( hkcu ); /* start the periodic save timer */ set_periodic_save_timer(); @@ -1751,6 +1841,8 @@ struct unicode_str name, class; unsigned int access = req->access; + if (!is_wow64_thread( current )) access = (access & ~KEY_WOW64_32KEY) | KEY_WOW64_64KEY; + reply->hkey = 0; if (req->namelen > get_req_data_size()) @@ -1771,8 +1863,8 @@ /* NOTE: no access rights are required from the parent handle to create a key */ if ((parent = get_parent_hkey_obj( req->parent ))) { - if ((key = create_key( parent, &name, &class, KEY_DIRTY, req->options, - req->attributes, current_time, &reply->created ))) + if ((key = create_key( parent, &name, &class, req->options, access, + req->attributes, &reply->created ))) { reply->hkey = alloc_handle( current->process, key, access, req->attributes ); release_object( key ); @@ -1788,12 +1880,14 @@ struct unicode_str name; unsigned int access = req->access; + if (!is_wow64_thread( current )) access = (access & ~KEY_WOW64_32KEY) | KEY_WOW64_64KEY; + reply->hkey = 0; /* NOTE: no access rights are required to open the parent key, only the child key */ if ((parent = get_parent_hkey_obj( req->parent ))) { get_req_path( &name, !req->parent ); - if ((key = open_key( parent, &name, req->attributes ))) + if ((key = open_key( parent, &name, access, req->attributes ))) { reply->hkey = alloc_handle( current->process, key, access, req->attributes ); release_object( key ); @@ -1927,7 +2021,7 @@ { int dummy; get_req_path( &name, !req->hkey ); - if ((key = create_key( parent, &name, NULL, KEY_DIRTY, 0, 0, current_time, &dummy ))) + if ((key = create_key( parent, &name, NULL, 0, KEY_WOW64_64KEY, 0, &dummy ))) { load_registry( key, req->file ); release_object( key ); Modified: vendor/wine/server/current/thread.c URL:
http://svn.reactos.org/svn/reactos/vendor/wine/server/current/thread.c?rev=…
============================================================================== --- vendor/wine/server/current/thread.c [iso-8859-1] (original) +++ vendor/wine/server/current/thread.c [iso-8859-1] Sat Mar 6 11:03:37 2010 @@ -67,6 +67,7 @@ #else #error Unsupported CPU #endif +#define CPU_64BIT_MASK CPU_FLAG(CPU_x86_64) /* thread queues */ @@ -408,6 +409,12 @@ return NULL; } +/* determine if the thread is wow64 (32-bit client running on 64-bit server) */ +int is_wow64_thread( struct thread *thread ) +{ + return (supported_cpus & CPU_64BIT_MASK) && !(CPU_FLAG(thread->process->cpu) & CPU_64BIT_MASK); +} + int set_thread_affinity( struct thread *thread, affinity_t affinity ) { int ret = 0; Modified: vendor/wine/server/current/thread.h URL:
http://svn.reactos.org/svn/reactos/vendor/wine/server/current/thread.h?rev=…
============================================================================== --- vendor/wine/server/current/thread.h [iso-8859-1] (original) +++ vendor/wine/server/current/thread.h [iso-8859-1] Sat Mar 6 11:03:37 2010 @@ -118,6 +118,7 @@ extern int thread_get_inflight_fd( struct thread *thread, int client ); extern struct thread_snapshot *thread_snap( int *count ); extern struct token *thread_get_impersonation_token( struct thread *thread ); +extern int is_wow64_thread( struct thread *thread ); extern int set_thread_affinity( struct thread *thread, affinity_t affinity ); /* ptrace functions */ Modified: vendor/wine/server/current/trace.c URL:
http://svn.reactos.org/svn/reactos/vendor/wine/server/current/trace.c?rev=4…
============================================================================== --- vendor/wine/server/current/trace.c [iso-8859-1] (original) +++ vendor/wine/server/current/trace.c [iso-8859-1] Sat Mar 6 11:03:37 2010 @@ -438,7 +438,7 @@ ctx.debug.i386_regs.dr3, ctx.debug.i386_regs.dr6, ctx.debug.i386_regs.dr7 ); if (ctx.flags & SERVER_CTX_FLOATING_POINT) { - fprintf( stderr, "fp.ctrl=%08x,fp.status=%08x,fp.tag=%08x,fp.err_off=%08x,fp.err_sel=%08x", + fprintf( stderr, ",fp.ctrl=%08x,fp.status=%08x,fp.tag=%08x,fp.err_off=%08x,fp.err_sel=%08x", ctx.fp.i386_regs.ctrl, ctx.fp.i386_regs.status, ctx.fp.i386_regs.tag, ctx.fp.i386_regs.err_off, ctx.fp.i386_regs.err_sel ); fprintf( stderr, ",fp.data_off=%08x,fp.data_sel=%08x,fp.cr0npx=%08x",
14 years, 9 months
1
0
0
0
[cwittich] 45909: [MSI] sync msi to wine 1.1.40
by cwittich@svn.reactos.org
Author: cwittich Date: Sat Mar 6 10:05:09 2010 New Revision: 45909 URL:
http://svn.reactos.org/svn/reactos?rev=45909&view=rev
Log: [MSI] sync msi to wine 1.1.40 Modified: trunk/reactos/dll/win32/msi/action.c trunk/reactos/dll/win32/msi/appsearch.c trunk/reactos/dll/win32/msi/custom.c trunk/reactos/dll/win32/msi/dialog.c trunk/reactos/dll/win32/msi/files.c trunk/reactos/dll/win32/msi/helpers.c trunk/reactos/dll/win32/msi/msi.rc trunk/reactos/dll/win32/msi/msipriv.h trunk/reactos/dll/win32/msi/package.c trunk/reactos/dll/win32/msi/streams.c trunk/reactos/dll/win32/msi/upgrade.c trunk/reactos/include/psdk/msidefs.h Modified: trunk/reactos/dll/win32/msi/action.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msi/action.c?rev…
============================================================================== --- trunk/reactos/dll/win32/msi/action.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msi/action.c [iso-8859-1] Sat Mar 6 10:05:09 2010 @@ -92,8 +92,6 @@ {'F','o','r','c','e','R','e','b','o','o','t',0}; static const WCHAR szResolveSource[] = {'R','e','s','o','l','v','e','S','o','u','r','c','e',0}; -static const WCHAR szAppSearch[] = - {'A','p','p','S','e','a','r','c','h',0}; static const WCHAR szAllocateRegistrySpace[] = {'A','l','l','o','c','a','t','e','R','e','g','i','s','t','r','y','S','p','a','c','e',0}; static const WCHAR szBindImage[] = @@ -114,8 +112,6 @@ {'I','s','o','l','a','t','e','C','o','m','p','o','n','e','n','t','s',0}; static const WCHAR szMigrateFeatureStates[] = {'M','i','g','r','a','t','e','F','e','a','t','u','r','e','S','t','a','t','e','s',0}; -static const WCHAR szMoveFiles[] = - {'M','o','v','e','F','i','l','e','s',0}; static const WCHAR szMsiPublishAssemblies[] = {'M','s','i','P','u','b','l','i','s','h','A','s','s','e','m','b','l','i','e','s',0}; static const WCHAR szMsiUnpublishAssemblies[] = @@ -134,8 +130,6 @@ {'R','e','g','i','s','t','e','r','F','o','n','t','s',0}; static const WCHAR szRegisterUser[] = {'R','e','g','i','s','t','e','r','U','s','e','r',0}; -static const WCHAR szRemoveDuplicateFiles[] = - {'R','e','m','o','v','e','D','u','p','l','i','c','a','t','e','F','i','l','e','s',0}; static const WCHAR szRemoveEnvironmentStrings[] = {'R','e','m','o','v','e','E','n','v','i','r','o','n','m','e','n','t','S','t','r','i','n','g','s',0}; static const WCHAR szRemoveExistingProducts[] = @@ -912,6 +906,11 @@ return ERROR_SUCCESS; } + uirow = MSI_CreateRecord(1); + MSI_RecordSetStringW(uirow, 1, dir); + ui_actiondata(package, szCreateFolders, uirow); + msiobj_release(&uirow->hdr); + full_path = resolve_folder(package,dir,FALSE,FALSE,TRUE,&folder); if (!full_path) { @@ -920,12 +919,6 @@ } TRACE("Folder is %s\n",debugstr_w(full_path)); - - /* UI stuff */ - uirow = MSI_CreateRecord(1); - MSI_RecordSetStringW(uirow,1,full_path); - ui_actiondata(package,szCreateFolders,uirow); - msiobj_release( &uirow->hdr ); if (folder->State == 0) create_full_pathW(full_path); @@ -2220,21 +2213,51 @@ return data; } +static const WCHAR *get_root_key( MSIPACKAGE *package, INT root, HKEY *root_key ) +{ + const WCHAR *ret; + + switch (root) + { + case -1: + if (msi_get_property_int( package, szAllUsers, 0 )) + { + *root_key = HKEY_LOCAL_MACHINE; + ret = szHLM; + } + else + { + *root_key = HKEY_CURRENT_USER; + ret = szHCU; + } + break; + case 0: + *root_key = HKEY_CLASSES_ROOT; + ret = szHCR; + break; + case 1: + *root_key = HKEY_CURRENT_USER; + ret = szHCU; + break; + case 2: + *root_key = HKEY_LOCAL_MACHINE; + ret = szHLM; + break; + case 3: + *root_key = HKEY_USERS; + ret = szHU; + break; + default: + ERR("Unknown root %i\n", root); + return NULL; + } + + return ret; +} + static UINT ITERATE_WriteRegistryValues(MSIRECORD *row, LPVOID param) { MSIPACKAGE *package = param; - static const WCHAR szHCR[] = - {'H','K','E','Y','_','C','L','A','S','S','E','S','_', - 'R','O','O','T','\\',0}; - static const WCHAR szHCU[] = - {'H','K','E','Y','_','C','U','R','R','E','N','T','_', - 'U','S','E','R','\\',0}; - static const WCHAR szHLM[] = - {'H','K','E','Y','_','L','O','C','A','L','_', - 'M','A','C','H','I','N','E','\\',0}; - static const WCHAR szHU[] = - {'H','K','E','Y','_','U','S','E','R','S','\\',0}; - LPSTR value_data = NULL; HKEY root_key, hkey; DWORD type,size; @@ -2282,44 +2305,8 @@ root = MSI_RecordGetInteger(row,2); key = MSI_RecordGetString(row, 3); - /* get the root key */ - switch (root) - { - case -1: - { - LPWSTR all_users = msi_dup_property( package, szAllUsers ); - if (all_users && all_users[0] == '1') - { - root_key = HKEY_LOCAL_MACHINE; - szRoot = szHLM; - } - else - { - root_key = HKEY_CURRENT_USER; - szRoot = szHCU; - } - msi_free(all_users); - } - break; - case 0: root_key = HKEY_CLASSES_ROOT; - szRoot = szHCR; - break; - case 1: root_key = HKEY_CURRENT_USER; - szRoot = szHCU; - break; - case 2: root_key = HKEY_LOCAL_MACHINE; - szRoot = szHLM; - break; - case 3: root_key = HKEY_USERS; - szRoot = szHU; - break; - default: - ERR("Unknown root %i\n",root); - root_key=NULL; - szRoot = NULL; - break; - } - if (!root_key) + szRoot = get_root_key( package, root, &root_key ); + if (!szRoot) return ERROR_SUCCESS; deformat_string(package, key , &deformated); @@ -2412,6 +2399,212 @@ msiobj_release(&view->hdr); return rc; +} + +static void delete_reg_key_or_value( HKEY hkey_root, LPCWSTR key, LPCWSTR value, BOOL delete_key ) +{ + LONG res; + HKEY hkey; + DWORD num_subkeys, num_values; + + if (delete_key) + { + if ((res = RegDeleteTreeW( hkey_root, key ))) + { + WARN("Failed to delete key %s (%d)\n", debugstr_w(key), res); + } + return; + } + + if (!(res = RegOpenKeyW( hkey_root, key, &hkey ))) + { + if ((res = RegDeleteValueW( hkey, value ))) + { + WARN("Failed to delete value %s (%d)\n", debugstr_w(value), res); + } + res = RegQueryInfoKeyW( hkey, NULL, NULL, NULL, &num_subkeys, NULL, NULL, &num_values, + NULL, NULL, NULL, NULL ); + RegCloseKey( hkey ); + + if (!res && !num_subkeys && !num_values) + { + TRACE("Removing empty key %s\n", debugstr_w(key)); + RegDeleteKeyW( hkey_root, key ); + } + return; + } + WARN("Failed to open key %s (%d)\n", debugstr_w(key), res); +} + + +static UINT ITERATE_RemoveRegistryValuesOnUninstall( MSIRECORD *row, LPVOID param ) +{ + MSIPACKAGE *package = param; + LPCWSTR component, name, key_str, root_key_str; + LPWSTR deformated_key, deformated_name, ui_key_str; + MSICOMPONENT *comp; + MSIRECORD *uirow; + BOOL delete_key = FALSE; + HKEY hkey_root; + UINT size; + INT root; + + ui_progress( package, 2, 0, 0, 0 ); + + component = MSI_RecordGetString( row, 6 ); + comp = get_loaded_component( package, component ); + if (!comp) + return ERROR_SUCCESS; + + if (comp->ActionRequest != INSTALLSTATE_ABSENT) + { + TRACE("Component not scheduled for removal: %s\n", debugstr_w(component)); + comp->Action = comp->Installed; + return ERROR_SUCCESS; + } + comp->Action = INSTALLSTATE_ABSENT; + + name = MSI_RecordGetString( row, 4 ); + if (MSI_RecordIsNull( row, 5 ) && name ) + { + if (name[0] == '+' && !name[1]) + return ERROR_SUCCESS; + else if ((name[0] == '-' && !name[1]) || (name[0] == '*' && !name[1])) + { + delete_key = TRUE; + name = NULL; + } + } + + root = MSI_RecordGetInteger( row, 2 ); + key_str = MSI_RecordGetString( row, 3 ); + + root_key_str = get_root_key( package, root, &hkey_root ); + if (!root_key_str) + return ERROR_SUCCESS; + + deformat_string( package, key_str, &deformated_key ); + size = strlenW( deformated_key ) + strlenW( root_key_str ) + 1; + ui_key_str = msi_alloc( size * sizeof(WCHAR) ); + strcpyW( ui_key_str, root_key_str ); + strcatW( ui_key_str, deformated_key ); + + deformat_string( package, name, &deformated_name ); + + delete_reg_key_or_value( hkey_root, deformated_key, deformated_name, delete_key ); + msi_free( deformated_key ); + + uirow = MSI_CreateRecord( 2 ); + MSI_RecordSetStringW( uirow, 1, ui_key_str ); + MSI_RecordSetStringW( uirow, 2, deformated_name ); + + ui_actiondata( package, szRemoveRegistryValues, uirow ); + msiobj_release( &uirow->hdr ); + + msi_free( ui_key_str ); + msi_free( deformated_name ); + return ERROR_SUCCESS; +} + +static UINT ITERATE_RemoveRegistryValuesOnInstall( MSIRECORD *row, LPVOID param ) +{ + MSIPACKAGE *package = param; + LPCWSTR component, name, key_str, root_key_str; + LPWSTR deformated_key, deformated_name, ui_key_str; + MSICOMPONENT *comp; + MSIRECORD *uirow; + BOOL delete_key = FALSE; + HKEY hkey_root; + UINT size; + INT root; + + ui_progress( package, 2, 0, 0, 0 ); + + component = MSI_RecordGetString( row, 5 ); + comp = get_loaded_component( package, component ); + if (!comp) + return ERROR_SUCCESS; + + if (comp->ActionRequest != INSTALLSTATE_LOCAL) + { + TRACE("Component not scheduled for installation: %s\n", debugstr_w(component)); + comp->Action = comp->Installed; + return ERROR_SUCCESS; + } + comp->Action = INSTALLSTATE_LOCAL; + + if ((name = MSI_RecordGetString( row, 4 ))) + { + if (name[0] == '-' && !name[1]) + { + delete_key = TRUE; + name = NULL; + } + } + + root = MSI_RecordGetInteger( row, 2 ); + key_str = MSI_RecordGetString( row, 3 ); + + root_key_str = get_root_key( package, root, &hkey_root ); + if (!root_key_str) + return ERROR_SUCCESS; + + deformat_string( package, key_str, &deformated_key ); + size = strlenW( deformated_key ) + strlenW( root_key_str ) + 1; + ui_key_str = msi_alloc( size * sizeof(WCHAR) ); + strcpyW( ui_key_str, root_key_str ); + strcatW( ui_key_str, deformated_key ); + + deformat_string( package, name, &deformated_name ); + + delete_reg_key_or_value( hkey_root, deformated_key, deformated_name, delete_key ); + msi_free( deformated_key ); + + uirow = MSI_CreateRecord( 2 ); + MSI_RecordSetStringW( uirow, 1, ui_key_str ); + MSI_RecordSetStringW( uirow, 2, deformated_name ); + + ui_actiondata( package, szRemoveRegistryValues, uirow ); + msiobj_release( &uirow->hdr ); + + msi_free( ui_key_str ); + msi_free( deformated_name ); + return ERROR_SUCCESS; +} + +static UINT ACTION_RemoveRegistryValues( MSIPACKAGE *package ) +{ + UINT rc; + MSIQUERY *view; + static const WCHAR registry_query[] = + {'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ', + '`','R','e','g','i','s','t','r','y','`',0 }; + static const WCHAR remove_registry_query[] = + {'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ', + '`','R','e','m','o','v','e','R','e','g','i','s','t','r','y','`',0 }; + + /* increment progress bar each time action data is sent */ + ui_progress( package, 1, REG_PROGRESS_VALUE, 1, 0 ); + + rc = MSI_DatabaseOpenViewW( package->db, registry_query, &view ); + if (rc == ERROR_SUCCESS) + { + rc = MSI_IterateRecords( view, NULL, ITERATE_RemoveRegistryValuesOnUninstall, package ); + msiobj_release( &view->hdr ); + if (rc != ERROR_SUCCESS) + return rc; + } + + rc = MSI_DatabaseOpenViewW( package->db, remove_registry_query, &view ); + if (rc == ERROR_SUCCESS) + { + rc = MSI_IterateRecords( view, NULL, ITERATE_RemoveRegistryValuesOnInstall, package ); + msiobj_release( &view->hdr ); + if (rc != ERROR_SUCCESS) + return rc; + } + + return ERROR_SUCCESS; } static UINT ACTION_InstallInitialize(MSIPACKAGE *package) @@ -3276,7 +3469,6 @@ CHAR buffer[1024]; DWORD sz; UINT rc; - MSIRECORD *uirow; FileName = MSI_RecordGetString(row,1); if (!FileName) @@ -3315,13 +3507,7 @@ } while (sz == 1024); msi_free(FilePath); - CloseHandle(the_file); - - uirow = MSI_CreateRecord(1); - MSI_RecordSetStringW(uirow,1,FileName); - ui_actiondata(package,szPublishProduct,uirow); - msiobj_release( &uirow->hdr ); return ERROR_SUCCESS; } @@ -3584,8 +3770,8 @@ static UINT ACTION_PublishProduct(MSIPACKAGE *package) { UINT rc; - HKEY hukey=0; - HKEY hudkey=0; + HKEY hukey = NULL, hudkey = NULL; + MSIRECORD *uirow; /* FIXME: also need to publish if the product is in advertise mode */ if (!msi_check_publish(package)) @@ -3623,24 +3809,60 @@ rc = msi_publish_icons(package); end: + uirow = MSI_CreateRecord( 1 ); + MSI_RecordSetStringW( uirow, 1, package->ProductCode ); + ui_actiondata( package, szPublishProduct, uirow ); + msiobj_release( &uirow->hdr ); + RegCloseKey(hukey); RegCloseKey(hudkey); return rc; } +static WCHAR *get_ini_file_name( MSIPACKAGE *package, MSIRECORD *row ) +{ + WCHAR *filename, *ptr, *folder, *ret; + const WCHAR *dirprop; + + filename = msi_dup_record_field( row, 2 ); + if (filename && (ptr = strchrW( filename, '|' ))) + ptr++; + else + ptr = filename; + + dirprop = MSI_RecordGetString( row, 3 ); + if (dirprop) + { + folder = resolve_folder( package, dirprop, FALSE, FALSE, TRUE, NULL ); + if (!folder) + folder = msi_dup_property( package, dirprop ); + } + else + folder = msi_dup_property( package, szWindowsFolder ); + + if (!folder) + { + ERR("Unable to resolve folder %s\n", debugstr_w(dirprop)); + msi_free( filename ); + return NULL; + } + + ret = build_directory_name( 2, folder, ptr ); + + msi_free( filename ); + msi_free( folder ); + return ret; +} + static UINT ITERATE_WriteIniValues(MSIRECORD *row, LPVOID param) { MSIPACKAGE *package = param; - LPCWSTR component, section, key, value, identifier, dirproperty; - LPWSTR deformated_section, deformated_key, deformated_value; - LPWSTR folder, filename, fullname = NULL; - LPCWSTR filenameptr; + LPCWSTR component, section, key, value, identifier; + LPWSTR deformated_section, deformated_key, deformated_value, fullname; MSIRECORD * uirow; INT action; MSICOMPONENT *comp; - static const WCHAR szWindowsFolder[] = - {'W','i','n','d','o','w','s','F','o','l','d','e','r',0}; component = MSI_RecordGetString(row, 8); comp = get_loaded_component(package,component); @@ -3656,7 +3878,6 @@ comp->Action = INSTALLSTATE_LOCAL; identifier = MSI_RecordGetString(row,1); - dirproperty = MSI_RecordGetString(row,3); section = MSI_RecordGetString(row,4); key = MSI_RecordGetString(row,5); value = MSI_RecordGetString(row,6); @@ -3666,28 +3887,7 @@ deformat_string(package,key,&deformated_key); deformat_string(package,value,&deformated_value); - filename = msi_dup_record_field(row, 2); - if (filename && (filenameptr = strchrW(filename, '|'))) - filenameptr++; - else - filenameptr = filename; - - if (dirproperty) - { - folder = resolve_folder(package, dirproperty, FALSE, FALSE, TRUE, NULL); - if (!folder) - folder = msi_dup_property( package, dirproperty ); - } - else - folder = msi_dup_property( package, szWindowsFolder ); - - if (!folder) - { - ERR("Unable to resolve folder! (%s)\n",debugstr_w(dirproperty)); - goto cleanup; - } - - fullname = build_directory_name(2, folder, filenameptr); + fullname = get_ini_file_name(package, row); if (action == 0) { @@ -3723,10 +3923,7 @@ ui_actiondata(package,szWriteIniValues,uirow); msiobj_release( &uirow->hdr ); -cleanup: - msi_free(filename); msi_free(fullname); - msi_free(folder); msi_free(deformated_key); msi_free(deformated_value); msi_free(deformated_section); @@ -3751,6 +3948,163 @@ rc = MSI_IterateRecords(view, NULL, ITERATE_WriteIniValues, package); msiobj_release(&view->hdr); return rc; +} + +static UINT ITERATE_RemoveIniValuesOnUninstall( MSIRECORD *row, LPVOID param ) +{ + MSIPACKAGE *package = param; + LPCWSTR component, section, key, value, identifier; + LPWSTR deformated_section, deformated_key, deformated_value, filename; + MSICOMPONENT *comp; + MSIRECORD *uirow; + INT action; + + component = MSI_RecordGetString( row, 8 ); + comp = get_loaded_component( package, component ); + if (!comp) + return ERROR_SUCCESS; + + if (comp->ActionRequest != INSTALLSTATE_ABSENT) + { + TRACE("Component not scheduled for removal %s\n", debugstr_w(component)); + comp->Action = comp->Installed; + return ERROR_SUCCESS; + } + comp->Action = INSTALLSTATE_ABSENT; + + identifier = MSI_RecordGetString( row, 1 ); + section = MSI_RecordGetString( row, 4 ); + key = MSI_RecordGetString( row, 5 ); + value = MSI_RecordGetString( row, 6 ); + action = MSI_RecordGetInteger( row, 7 ); + + deformat_string( package, section, &deformated_section ); + deformat_string( package, key, &deformated_key ); + deformat_string( package, value, &deformated_value ); + + if (action == msidbIniFileActionAddLine || action == msidbIniFileActionCreateLine) + { + filename = get_ini_file_name( package, row ); + + TRACE("Removing key %s from section %s in %s\n", + debugstr_w(deformated_key), debugstr_w(deformated_section), debugstr_w(filename)); + + if (!WritePrivateProfileStringW( deformated_section, deformated_key, NULL, filename )) + { + WARN("Unable to remove key %u\n", GetLastError()); + } + msi_free( filename ); + } + else + FIXME("Unsupported action %d\n", action); + + + uirow = MSI_CreateRecord( 4 ); + MSI_RecordSetStringW( uirow, 1, identifier ); + MSI_RecordSetStringW( uirow, 2, deformated_section ); + MSI_RecordSetStringW( uirow, 3, deformated_key ); + MSI_RecordSetStringW( uirow, 4, deformated_value ); + ui_actiondata( package, szRemoveIniValues, uirow ); + msiobj_release( &uirow->hdr ); + + msi_free( deformated_key ); + msi_free( deformated_value ); + msi_free( deformated_section ); + return ERROR_SUCCESS; +} + +static UINT ITERATE_RemoveIniValuesOnInstall( MSIRECORD *row, LPVOID param ) +{ + MSIPACKAGE *package = param; + LPCWSTR component, section, key, value, identifier; + LPWSTR deformated_section, deformated_key, deformated_value, filename; + MSICOMPONENT *comp; + MSIRECORD *uirow; + INT action; + + component = MSI_RecordGetString( row, 8 ); + comp = get_loaded_component( package, component ); + if (!comp) + return ERROR_SUCCESS; + + if (comp->ActionRequest != INSTALLSTATE_LOCAL) + { + TRACE("Component not scheduled for installation %s\n", debugstr_w(component)); + comp->Action = comp->Installed; + return ERROR_SUCCESS; + } + comp->Action = INSTALLSTATE_LOCAL; + + identifier = MSI_RecordGetString( row, 1 ); + section = MSI_RecordGetString( row, 4 ); + key = MSI_RecordGetString( row, 5 ); + value = MSI_RecordGetString( row, 6 ); + action = MSI_RecordGetInteger( row, 7 ); + + deformat_string( package, section, &deformated_section ); + deformat_string( package, key, &deformated_key ); + deformat_string( package, value, &deformated_value ); + + if (action == msidbIniFileActionRemoveLine) + { + filename = get_ini_file_name( package, row ); + + TRACE("Removing key %s from section %s in %s\n", + debugstr_w(deformated_key), debugstr_w(deformated_section), debugstr_w(filename)); + + if (!WritePrivateProfileStringW( deformated_section, deformated_key, NULL, filename )) + { + WARN("Unable to remove key %u\n", GetLastError()); + } + msi_free( filename ); + } + else + FIXME("Unsupported action %d\n", action); + + uirow = MSI_CreateRecord( 4 ); + MSI_RecordSetStringW( uirow, 1, identifier ); + MSI_RecordSetStringW( uirow, 2, deformated_section ); + MSI_RecordSetStringW( uirow, 3, deformated_key ); + MSI_RecordSetStringW( uirow, 4, deformated_value ); + ui_actiondata( package, szRemoveIniValues, uirow ); + msiobj_release( &uirow->hdr ); + + msi_free( deformated_key ); + msi_free( deformated_value ); + msi_free( deformated_section ); + return ERROR_SUCCESS; +} + +static UINT ACTION_RemoveIniValues( MSIPACKAGE *package ) +{ + UINT rc; + MSIQUERY *view; + static const WCHAR query[] = + {'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ', + '`','I','n','i','F','i','l','e','`',0}; + static const WCHAR remove_query[] = + {'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ', + '`','R','e','m','o','v','e','I','n','i','F','i','l','e','`',0}; + + rc = MSI_DatabaseOpenViewW( package->db, query, &view ); + if (rc == ERROR_SUCCESS) + { + rc = MSI_IterateRecords( view, NULL, ITERATE_RemoveIniValuesOnUninstall, package ); + msiobj_release( &view->hdr ); + if (rc != ERROR_SUCCESS) + return rc; + } + + rc = MSI_DatabaseOpenViewW( package->db, remove_query, &view ); + if (rc == ERROR_SUCCESS) + { + rc = MSI_IterateRecords( view, NULL, ITERATE_RemoveIniValuesOnInstall, package ); + msiobj_release( &view->hdr ); + if (rc != ERROR_SUCCESS) + return rc; + } + + return ERROR_SUCCESS; } static UINT ITERATE_SelfRegModules(MSIRECORD *row, LPVOID param) @@ -3924,8 +4278,7 @@ { MSIFEATURE *feature; UINT rc; - HKEY hkey; - HKEY userdata = NULL; + HKEY hkey = NULL, userdata = NULL; if (!msi_check_publish(package)) return ERROR_SUCCESS; @@ -4178,6 +4531,7 @@ static UINT ACTION_RegisterProduct(MSIPACKAGE *package) { WCHAR squashed_pc[SQUISH_GUID_SIZE]; + MSIRECORD *uirow; LPWSTR upgrade_code; HKEY hkey, props; HKEY upgrade; @@ -4222,8 +4576,12 @@ } done: + uirow = MSI_CreateRecord( 1 ); + MSI_RecordSetStringW( uirow, 1, package->ProductCode ); + ui_actiondata( package, szRegisterProduct, uirow ); + msiobj_release( &uirow->hdr ); + RegCloseKey(hkey); - return ERROR_SUCCESS; } @@ -4424,10 +4782,10 @@ static UINT ACTION_RegisterUser(MSIPACKAGE *package) { - HKEY hkey=0; - LPWSTR buffer; - LPWSTR productid; - UINT rc,i; + HKEY hkey = 0; + LPWSTR buffer, productid = NULL; + UINT i, rc = ERROR_SUCCESS; + MSIRECORD *uirow; static const WCHAR szPropKeys[][80] = { @@ -4448,12 +4806,12 @@ if (msi_check_unpublish(package)) { MSIREG_DeleteUserDataProductKey(package->ProductCode); - return ERROR_SUCCESS; + goto end; } productid = msi_dup_property( package, INSTALLPROPERTY_PRODUCTIDW ); if (!productid) - return ERROR_SUCCESS; + goto end; rc = MSIREG_OpenInstallProps(package->ProductCode, package->Context, NULL, &hkey, TRUE); @@ -4468,11 +4826,13 @@ } end: + uirow = MSI_CreateRecord( 1 ); + MSI_RecordSetStringW( uirow, 1, productid ); + ui_actiondata( package, szRegisterUser, uirow ); + msiobj_release( &uirow->hdr ); + msi_free(productid); RegCloseKey(hkey); - - /* FIXME: call ui_actiondata */ - return rc; } @@ -4492,7 +4852,7 @@ MSIPACKAGE *package = param; LPCWSTR compgroupid, component, feature, qualifier, text; LPWSTR advertise = NULL, output = NULL; - HKEY hkey; + HKEY hkey = NULL; UINT rc; MSICOMPONENT *comp; MSIFEATURE *feat; @@ -4803,14 +5163,23 @@ MSIPACKAGE *package = param; MSICOMPONENT *comp; SC_HANDLE scm = NULL, service = NULL; - LPCWSTR *vector = NULL; + LPCWSTR component, *vector = NULL; LPWSTR name, args; DWORD event, numargs; UINT r = ERROR_FUNCTION_FAILED; - comp = get_loaded_component(package, MSI_RecordGetString(rec, 6)); - if (!comp || comp->Action == INSTALLSTATE_UNKNOWN || comp->Action == INSTALLSTATE_ABSENT) - return ERROR_SUCCESS; + component = MSI_RecordGetString(rec, 6); + comp = get_loaded_component(package, component); + if (!comp) + return ERROR_SUCCESS; + + if (comp->ActionRequest != INSTALLSTATE_LOCAL) + { + TRACE("Component not scheduled for installation: %s\n", debugstr_w(component)); + comp->Action = comp->Installed; + return ERROR_SUCCESS; + } + comp->Action = INSTALLSTATE_LOCAL; deformat_string(package, MSI_RecordGetString(rec, 2), &name); deformat_string(package, MSI_RecordGetString(rec, 4), &args); @@ -4966,6 +5335,7 @@ { MSIPACKAGE *package = param; MSICOMPONENT *comp; + LPCWSTR component; LPWSTR name; DWORD event; @@ -4973,9 +5343,18 @@ if (!(event & msidbServiceControlEventStop)) return ERROR_SUCCESS; - comp = get_loaded_component( package, MSI_RecordGetString( rec, 6 ) ); - if (!comp || comp->Action == INSTALLSTATE_UNKNOWN || comp->Action == INSTALLSTATE_ABSENT) - return ERROR_SUCCESS; + component = MSI_RecordGetString( rec, 6 ); + comp = get_loaded_component( package, component ); + if (!comp) + return ERROR_SUCCESS; + + if (comp->ActionRequest != INSTALLSTATE_ABSENT) + { + TRACE("Component not scheduled for removal: %s\n", debugstr_w(component)); + comp->Action = comp->Installed; + return ERROR_SUCCESS; + } + comp->Action = INSTALLSTATE_ABSENT; deformat_string( package, MSI_RecordGetString( rec, 2 ), &name ); stop_service( name ); @@ -5007,17 +5386,28 @@ { MSIPACKAGE *package = param; MSICOMPONENT *comp; - LPWSTR name = NULL; - DWORD event; + MSIRECORD *uirow; + LPCWSTR component; + LPWSTR name = NULL, display_name = NULL; + DWORD event, len; SC_HANDLE scm = NULL, service = NULL; event = MSI_RecordGetInteger( rec, 3 ); if (!(event & msidbServiceControlEventDelete)) return ERROR_SUCCESS; - comp = get_loaded_component( package, MSI_RecordGetString(rec, 6) ); - if (!comp || comp->Action == INSTALLSTATE_UNKNOWN || comp->Action == INSTALLSTATE_ABSENT) - return ERROR_SUCCESS; + component = MSI_RecordGetString(rec, 6); + comp = get_loaded_component(package, component); + if (!comp) + return ERROR_SUCCESS; + + if (comp->ActionRequest != INSTALLSTATE_ABSENT) + { + TRACE("Component not scheduled for removal: %s\n", debugstr_w(component)); + comp->Action = comp->Installed; + return ERROR_SUCCESS; + } + comp->Action = INSTALLSTATE_ABSENT; deformat_string( package, MSI_RecordGetString(rec, 2), &name ); stop_service( name ); @@ -5029,6 +5419,14 @@ goto done; } + len = 0; + if (!GetServiceDisplayNameW( scm, name, NULL, &len ) && + GetLastError() == ERROR_INSUFFICIENT_BUFFER) + { + if ((display_name = msi_alloc( ++len * sizeof(WCHAR )))) + GetServiceDisplayNameW( scm, name, display_name, &len ); + } + service = OpenServiceW( scm, name, DELETE ); if (!service) { @@ -5040,9 +5438,16 @@ WARN("Failed to delete service (%s): %u\n", debugstr_w(name), GetLastError()); done: + uirow = MSI_CreateRecord( 2 ); + MSI_RecordSetStringW( uirow, 1, display_name ); + MSI_RecordSetStringW( uirow, 2, name ); + ui_actiondata( package, szDeleteServices, uirow ); + msiobj_release( &uirow->hdr ); + CloseServiceHandle( service ); CloseServiceHandle( scm ); msi_free( name ); + msi_free( display_name ); return ERROR_SUCCESS; } @@ -5085,6 +5490,7 @@ LPWSTR driver, driver_path, ptr; WCHAR outpath[MAX_PATH]; MSIFILE *driver_file, *setup_file; + MSIRECORD *uirow; LPCWSTR desc; DWORD len, usage; UINT r = ERROR_SUCCESS; @@ -5110,7 +5516,7 @@ len = lstrlenW(desc) + lstrlenW(driver_fmt) + lstrlenW(driver_file->FileName); if (setup_file) len += lstrlenW(setup_fmt) + lstrlenW(setup_file->FileName); - len += lstrlenW(usage_fmt) + 1; + len += lstrlenW(usage_fmt) + 2; /* \0\0 */ driver = msi_alloc(len * sizeof(WCHAR)); if (!driver) @@ -5120,13 +5526,13 @@ lstrcpyW(ptr, desc); ptr += lstrlenW(ptr) + 1; - sprintfW(ptr, driver_fmt, driver_file->FileName); - ptr += lstrlenW(ptr) + 1; + len = sprintfW(ptr, driver_fmt, driver_file->FileName); + ptr += len + 1; if (setup_file) { - sprintfW(ptr, setup_fmt, setup_file->FileName); - ptr += lstrlenW(ptr) + 1; + len = sprintfW(ptr, setup_fmt, setup_file->FileName); + ptr += len + 1; } lstrcpyW(ptr, usage_fmt); @@ -5143,6 +5549,13 @@ ERR("Failed to install SQL driver!\n"); r = ERROR_FUNCTION_FAILED; } + + uirow = MSI_CreateRecord( 5 ); + MSI_RecordSetStringW( uirow, 1, desc ); + MSI_RecordSetStringW( uirow, 2, MSI_RecordGetString(rec, 2) ); + MSI_RecordSetStringW( uirow, 3, driver_path ); + ui_actiondata( package, szInstallODBC, uirow ); + msiobj_release( &uirow->hdr ); msi_free(driver); msi_free(driver_path); @@ -5156,6 +5569,7 @@ LPWSTR translator, translator_path, ptr; WCHAR outpath[MAX_PATH]; MSIFILE *translator_file, *setup_file; + MSIRECORD *uirow; LPCWSTR desc; DWORD len, usage; UINT r = ERROR_SUCCESS; @@ -5176,7 +5590,7 @@ return ERROR_FUNCTION_FAILED; } - len = lstrlenW(desc) + lstrlenW(translator_fmt) + lstrlenW(translator_file->FileName) + 1; + len = lstrlenW(desc) + lstrlenW(translator_fmt) + lstrlenW(translator_file->FileName) + 2; /* \0\0 */ if (setup_file) len += lstrlenW(setup_fmt) + lstrlenW(setup_file->FileName); @@ -5188,13 +5602,13 @@ lstrcpyW(ptr, desc); ptr += lstrlenW(ptr) + 1; - sprintfW(ptr, translator_fmt, translator_file->FileName); - ptr += lstrlenW(ptr) + 1; + len = sprintfW(ptr, translator_fmt, translator_file->FileName); + ptr += len + 1; if (setup_file) { - sprintfW(ptr, setup_fmt, setup_file->FileName); - ptr += lstrlenW(ptr) + 1; + len = sprintfW(ptr, setup_fmt, setup_file->FileName); + ptr += len + 1; } *ptr = '\0'; @@ -5209,6 +5623,13 @@ r = ERROR_FUNCTION_FAILED; } + uirow = MSI_CreateRecord( 5 ); + MSI_RecordSetStringW( uirow, 1, desc ); + MSI_RecordSetStringW( uirow, 2, MSI_RecordGetString(rec, 2) ); + MSI_RecordSetStringW( uirow, 3, translator_path ); + ui_actiondata( package, szInstallODBC, uirow ); + msiobj_release( &uirow->hdr ); + msi_free(translator); msi_free(translator_path); @@ -5217,12 +5638,14 @@ static UINT ITERATE_InstallODBCDataSource( MSIRECORD *rec, LPVOID param ) { + MSIPACKAGE *package = param; LPWSTR attrs; LPCWSTR desc, driver; WORD request = ODBC_ADD_SYS_DSN; INT registration; DWORD len; UINT r = ERROR_SUCCESS; + MSIRECORD *uirow; static const WCHAR attrs_fmt[] = { 'D','S','N','=','%','s',0 }; @@ -5234,7 +5657,7 @@ if (registration == msidbODBCDataSourceRegistrationPerMachine) request = ODBC_ADD_SYS_DSN; else if (registration == msidbODBCDataSourceRegistrationPerUser) request = ODBC_ADD_DSN; - len = lstrlenW(attrs_fmt) + lstrlenW(desc) + 1 + 1; + len = lstrlenW(attrs_fmt) + lstrlenW(desc) + 2; /* \0\0 */ attrs = msi_alloc(len * sizeof(WCHAR)); if (!attrs) return ERROR_OUTOFMEMORY; @@ -5248,6 +5671,13 @@ r = ERROR_FUNCTION_FAILED; } + uirow = MSI_CreateRecord( 5 ); + MSI_RecordSetStringW( uirow, 1, desc ); + MSI_RecordSetStringW( uirow, 2, MSI_RecordGetString(rec, 2) ); + MSI_RecordSetInteger( uirow, 3, request ); + ui_actiondata( package, szInstallODBC, uirow ); + msiobj_release( &uirow->hdr ); + msi_free(attrs); return r; @@ -5296,6 +5726,8 @@ static UINT ITERATE_RemoveODBCDriver( MSIRECORD *rec, LPVOID param ) { + MSIPACKAGE *package = param; + MSIRECORD *uirow; DWORD usage; LPCWSTR desc; @@ -5309,11 +5741,19 @@ FIXME("Usage count reached 0\n"); } + uirow = MSI_CreateRecord( 2 ); + MSI_RecordSetStringW( uirow, 1, desc ); + MSI_RecordSetStringW( uirow, 2, MSI_RecordGetString(rec, 2) ); + ui_actiondata( package, szRemoveODBC, uirow ); + msiobj_release( &uirow->hdr ); + return ERROR_SUCCESS; } static UINT ITERATE_RemoveODBCTranslator( MSIRECORD *rec, LPVOID param ) { + MSIPACKAGE *package = param; + MSIRECORD *uirow; DWORD usage; LPCWSTR desc; @@ -5327,11 +5767,19 @@ FIXME("Usage count reached 0\n"); } + uirow = MSI_CreateRecord( 2 ); + MSI_RecordSetStringW( uirow, 1, desc ); + MSI_RecordSetStringW( uirow, 2, MSI_RecordGetString(rec, 2) ); + ui_actiondata( package, szRemoveODBC, uirow ); + msiobj_release( &uirow->hdr ); + return ERROR_SUCCESS; } static UINT ITERATE_RemoveODBCDataSource( MSIRECORD *rec, LPVOID param ) { + MSIPACKAGE *package = param; + MSIRECORD *uirow; LPWSTR attrs; LPCWSTR desc, driver; WORD request = ODBC_REMOVE_SYS_DSN; @@ -5348,7 +5796,7 @@ if (registration == msidbODBCDataSourceRegistrationPerMachine) request = ODBC_REMOVE_SYS_DSN; else if (registration == msidbODBCDataSourceRegistrationPerUser) request = ODBC_REMOVE_DSN; - len = strlenW( attrs_fmt ) + strlenW( desc ) + 1 + 1; + len = strlenW( attrs_fmt ) + strlenW( desc ) + 2; /* \0\0 */ attrs = msi_alloc( len * sizeof(WCHAR) ); if (!attrs) return ERROR_OUTOFMEMORY; @@ -5363,6 +5811,13 @@ WARN("Failed to remove ODBC data source\n"); } msi_free( attrs ); + + uirow = MSI_CreateRecord( 3 ); + MSI_RecordSetStringW( uirow, 1, desc ); + MSI_RecordSetStringW( uirow, 2, MSI_RecordGetString(rec, 2) ); + MSI_RecordSetInteger( uirow, 3, request ); + ui_actiondata( package, szRemoveODBC, uirow ); + msiobj_release( &uirow->hdr ); return ERROR_SUCCESS; } @@ -5420,7 +5875,7 @@ #define check_flag_combo(x, y) ((x) & ~(y)) == (y) -static LONG env_set_flags( LPCWSTR *name, LPCWSTR *value, DWORD *flags ) +static UINT env_parse_flags( LPCWSTR *name, LPCWSTR *value, DWORD *flags ) { LPCWSTR cptr = *name; @@ -5501,17 +5956,8 @@ return ERROR_SUCCESS; } -static UINT ITERATE_WriteEnvironmentString( MSIRECORD *rec, LPVOID param ) -{ - MSIPACKAGE *package = param; - LPCWSTR name, value; - LPWSTR data = NULL, newval = NULL; - LPWSTR deformatted = NULL, ptr; - DWORD flags, type, size; - LONG res; - HKEY env = NULL, root; - LPCWSTR environment; - +static UINT open_env_key( DWORD flags, HKEY *key ) +{ static const WCHAR user_env[] = {'E','n','v','i','r','o','n','m','e','n','t',0}; static const WCHAR machine_env[] = @@ -5520,13 +5966,62 @@ 'C','o','n','t','r','o','l','\\', 'S','e','s','s','i','o','n',' ','M','a','n','a','g','e','r','\\', 'E','n','v','i','r','o','n','m','e','n','t',0}; + const WCHAR *env; + HKEY root; + LONG res; + + if (flags & ENV_MOD_MACHINE) + { + env = machine_env; + root = HKEY_LOCAL_MACHINE; + } + else + { + env = user_env; + root = HKEY_CURRENT_USER; + } + + res = RegOpenKeyExW( root, env, 0, KEY_ALL_ACCESS, key ); + if (res != ERROR_SUCCESS) + { + WARN("Failed to open key %s (%d)\n", debugstr_w(env), res); + return ERROR_FUNCTION_FAILED; + } + + return ERROR_SUCCESS; +} + +static UINT ITERATE_WriteEnvironmentString( MSIRECORD *rec, LPVOID param ) +{ + MSIPACKAGE *package = param; + LPCWSTR name, value, component; + LPWSTR data = NULL, newval = NULL, deformatted = NULL, ptr; + DWORD flags, type, size; + UINT res; + HKEY env = NULL; + MSICOMPONENT *comp; + MSIRECORD *uirow; + int action = 0; + + component = MSI_RecordGetString(rec, 4); + comp = get_loaded_component(package, component); + if (!comp) + return ERROR_SUCCESS; + + if (comp->ActionRequest != INSTALLSTATE_LOCAL) + { + TRACE("Component not scheduled for installation: %s\n", debugstr_w(component)); + comp->Action = comp->Installed; + return ERROR_SUCCESS; + } + comp->Action = INSTALLSTATE_LOCAL; name = MSI_RecordGetString(rec, 2); value = MSI_RecordGetString(rec, 3); TRACE("name %s value %s\n", debugstr_w(name), debugstr_w(value)); - res = env_set_flags(&name, &value, &flags); + res = env_parse_flags(&name, &value, &flags); if (res != ERROR_SUCCESS || !value) goto done; @@ -5538,24 +6033,12 @@ value = deformatted; - if (flags & ENV_MOD_MACHINE) - { - environment = machine_env; - root = HKEY_LOCAL_MACHINE; - } - else - { - environment = user_env; - root = HKEY_CURRENT_USER; - } - - res = RegCreateKeyExW(root, environment, 0, NULL, 0, - KEY_ALL_ACCESS, NULL, &env, NULL); + res = open_env_key( flags, &env ); if (res != ERROR_SUCCESS) goto done; - if (flags & ENV_ACT_REMOVE) - FIXME("Not removing environment variable on uninstall!\n"); + if (flags & ENV_MOD_MACHINE) + action |= 0x20000000; size = 0; type = REG_SZ; @@ -5566,6 +6049,8 @@ if ((res == ERROR_FILE_NOT_FOUND || !(flags & ENV_MOD_MASK))) { + action = 0x2; + /* Nothing to do. */ if (!value) { @@ -5586,6 +6071,8 @@ } else { + action = 0x1; + /* Contrary to MSDN, +-variable to [~];path works */ if (flags & ENV_ACT_SETABSENT && !(flags & ENV_MOD_MASK)) { @@ -5606,7 +6093,10 @@ if (flags & ENV_ACT_REMOVEMATCH && (!value || !lstrcmpW(data, value))) { - res = RegDeleteKeyW(env, name); + action = 0x4; + res = RegDeleteValueW(env, name); + if (res != ERROR_SUCCESS) + WARN("Failed to remove value %s (%d)\n", debugstr_w(name), res); goto done; } @@ -5633,6 +6123,7 @@ { lstrcpyW(newval, value); ptr = newval + lstrlenW(value); + action |= 0x80000000; } lstrcpyW(ptr, data); @@ -5640,12 +6131,24 @@ if (flags & ENV_MOD_APPEND) { lstrcatW(newval, value); + action |= 0x40000000; } } TRACE("setting %s to %s\n", debugstr_w(name), debugstr_w(newval)); res = RegSetValueExW(env, name, 0, type, (LPVOID)newval, size); + if (res) + { + WARN("Failed to set %s to %s (%d)\n", debugstr_w(name), debugstr_w(newval), res); + } done: + uirow = MSI_CreateRecord( 3 ); + MSI_RecordSetStringW( uirow, 1, name ); + MSI_RecordSetStringW( uirow, 2, newval ); + MSI_RecordSetInteger( uirow, 3, action ); + ui_actiondata( package, szWriteEnvironmentStrings, uirow ); + msiobj_release( &uirow->hdr ); + if (env) RegCloseKey(env); msi_free(deformatted); msi_free(data); @@ -5670,333 +6173,98 @@ return rc; } -#define is_dot_dir(x) ((x[0] == '.') && ((x[1] == 0) || ((x[1] == '.') && (x[2] == 0)))) - -typedef struct -{ - struct list entry; - LPWSTR sourcename; - LPWSTR destname; - LPWSTR source; - LPWSTR dest; -} FILE_LIST; - -static BOOL msi_move_file(LPCWSTR source, LPCWSTR dest, int options) -{ - BOOL ret; - - if (GetFileAttributesW(source) == FILE_ATTRIBUTE_DIRECTORY || - GetFileAttributesW(dest) == FILE_ATTRIBUTE_DIRECTORY) - { - WARN("Source or dest is directory, not moving\n"); - return FALSE; - } - - if (options == msidbMoveFileOptionsMove) - { - TRACE("moving %s -> %s\n", debugstr_w(source), debugstr_w(dest)); - ret = MoveFileExW(source, dest, MOVEFILE_REPLACE_EXISTING); - if (!ret) - { - WARN("MoveFile failed: %d\n", GetLastError()); - return FALSE; - } - } - else - { - TRACE("copying %s -> %s\n", debugstr_w(source), debugstr_w(dest)); - ret = CopyFileW(source, dest, FALSE); - if (!ret) - { - WARN("CopyFile failed: %d\n", GetLastError()); - return FALSE; - } - } - - return TRUE; -} - -static LPWSTR wildcard_to_file(LPWSTR wildcard, LPWSTR filename) -{ - LPWSTR path, ptr; - DWORD dirlen, pathlen; - - ptr = strrchrW(wildcard, '\\'); - dirlen = ptr - wildcard + 1; - - pathlen = dirlen + lstrlenW(filename) + 1; - path = msi_alloc(pathlen * sizeof(WCHAR)); - - lstrcpynW(path, wildcard, dirlen + 1); - lstrcatW(path, filename); - - return path; -} - -static void free_file_entry(FILE_LIST *file) -{ - msi_free(file->source); - msi_free(file->dest); - msi_free(file); -} - -static void free_list(FILE_LIST *list) -{ - while (!list_empty(&list->entry)) - { - FILE_LIST *file = LIST_ENTRY(list_head(&list->entry), FILE_LIST, entry); - - list_remove(&file->entry); - free_file_entry(file); - } -} - -static BOOL add_wildcard(FILE_LIST *files, LPWSTR source, LPWSTR dest) -{ - FILE_LIST *new, *file; - LPWSTR ptr, filename; - DWORD size; - - new = msi_alloc_zero(sizeof(FILE_LIST)); - if (!new) - return FALSE; - - new->source = strdupW(source); - ptr = strrchrW(dest, '\\') + 1; - filename = strrchrW(new->source, '\\') + 1; - - new->sourcename = filename; - - if (*ptr) - new->destname = ptr; - else - new->destname = new->sourcename; - - size = (ptr - dest) + lstrlenW(filename) + 1; - new->dest = msi_alloc(size * sizeof(WCHAR)); - if (!new->dest) - { - free_file_entry(new); - return FALSE; - } - - lstrcpynW(new->dest, dest, ptr - dest + 1); - lstrcatW(new->dest, filename); - - if (list_empty(&files->entry)) - { - list_add_head(&files->entry, &new->entry); - return TRUE; - } - - LIST_FOR_EACH_ENTRY(file, &files->entry, FILE_LIST, entry) - { - if (lstrcmpW(source, file->source) < 0) - { - list_add_before(&file->entry, &new->entry); - return TRUE; - } - } - - list_add_after(&file->entry, &new->entry); - return TRUE; -} - -static BOOL move_files_wildcard(LPWSTR source, LPWSTR dest, int options) -{ - WIN32_FIND_DATAW wfd; - HANDLE hfile; - LPWSTR path; - BOOL res; - FILE_LIST files, *file; - DWORD size; - - hfile = FindFirstFileW(source, &wfd); - if (hfile == INVALID_HANDLE_VALUE) return FALSE; - - list_init(&files.entry); - - for (res = TRUE; res; res = FindNextFileW(hfile, &wfd)) - { - if (is_dot_dir(wfd.cFileName)) continue; - - path = wildcard_to_file(source, wfd.cFileName); - if (!path) - { - res = FALSE; - goto done; - } - - add_wildcard(&files, path, dest); - msi_free(path); - } - - /* no files match the wildcard */ - if (list_empty(&files.entry)) +static UINT ITERATE_RemoveEnvironmentString( MSIRECORD *rec, LPVOID param ) +{ + MSIPACKAGE *package = param; + LPCWSTR name, value, component; + LPWSTR deformatted = NULL; + DWORD flags; + HKEY env; + MSICOMPONENT *comp; + MSIRECORD *uirow; + int action = 0; + LONG res; + UINT r; + + component = MSI_RecordGetString( rec, 4 ); + comp = get_loaded_component( package, component ); + if (!comp) + return ERROR_SUCCESS; + + if (comp->ActionRequest != INSTALLSTATE_ABSENT) + { + TRACE("Component not scheduled for removal: %s\n", debugstr_w(component)); + comp->Action = comp->Installed; + return ERROR_SUCCESS; + } + comp->Action = INSTALLSTATE_ABSENT; + + name = MSI_RecordGetString( rec, 2 ); + value = MSI_RecordGetString( rec, 3 ); + + TRACE("name %s value %s\n", debugstr_w(name), debugstr_w(value)); + + r = env_parse_flags( &name, &value, &flags ); + if (r != ERROR_SUCCESS) + return r; + + if (!(flags & ENV_ACT_REMOVE)) + { + TRACE("Environment variable %s not marked for removal\n", debugstr_w(name)); + return ERROR_SUCCESS; + } + + if (value && !deformat_string( package, value, &deformatted )) + return ERROR_OUTOFMEMORY; + + value = deformatted; + + r = open_env_key( flags, &env ); + if (r != ERROR_SUCCESS) + { + r = ERROR_SUCCESS; goto done; - - /* only the first wildcard match gets renamed to dest */ - file = LIST_ENTRY(list_head(&files.entry), FILE_LIST, entry); - size = (strrchrW(file->dest, '\\') - file->dest) + lstrlenW(file->destname) + 2; - file->dest = msi_realloc(file->dest, size * sizeof(WCHAR)); - if (!file->dest) - { - res = FALSE; - goto done; - } - - /* file->dest may be shorter after the reallocation, so add a NULL - * terminator. This is needed for the call to strrchrW, as there will no - * longer be a NULL terminator within the bounds of the allocation in this case. - */ - file->dest[size - 1] = '\0'; - lstrcpyW(strrchrW(file->dest, '\\') + 1, file->destname); - - while (!list_empty(&files.entry)) - { - file = LIST_ENTRY(list_head(&files.entry), FILE_LIST, entry); - - msi_move_file(file->source, file->dest, options); - - list_remove(&file->entry); - free_file_entry(file); - } - - res = TRUE; + } + + if (flags & ENV_MOD_MACHINE) + action |= 0x20000000; + + TRACE("Removing %s\n", debugstr_w(name)); + + res = RegDeleteValueW( env, name ); + if (res != ERROR_SUCCESS) + { + WARN("Failed to delete value %s (%d)\n", debugstr_w(name), res); + r = ERROR_SUCCESS; + } done: - free_list(&files); - FindClose(hfile); - return res; -} - -static UINT ITERATE_MoveFiles( MSIRECORD *rec, LPVOID param ) -{ - MSIPACKAGE *package = param; - MSICOMPONENT *comp; - LPCWSTR sourcename; - LPWSTR destname = NULL; - LPWSTR sourcedir = NULL, destdir = NULL; - LPWSTR source = NULL, dest = NULL; - int options; - DWORD size; - BOOL ret, wildcards; - - comp = get_loaded_component(package, MSI_RecordGetString(rec, 2)); - if (!comp || !comp->Enabled || - !(comp->Action & (INSTALLSTATE_LOCAL | INSTALLSTATE_SOURCE))) - { - TRACE("Component not set for install, not moving file\n"); - return ERROR_SUCCESS; - } - - sourcename = MSI_RecordGetString(rec, 3); - options = MSI_RecordGetInteger(rec, 7); - - sourcedir = msi_dup_property(package, MSI_RecordGetString(rec, 5)); - if (!sourcedir) - goto done; - - destdir = msi_dup_property(package, MSI_RecordGetString(rec, 6)); - if (!destdir) - goto done; - - if (!sourcename) - { - if (GetFileAttributesW(sourcedir) == INVALID_FILE_ATTRIBUTES) - goto done; - - source = strdupW(sourcedir); - if (!source) - goto done; - } - else - { - size = lstrlenW(sourcedir) + lstrlenW(sourcename) + 2; - source = msi_alloc(size * sizeof(WCHAR)); - if (!source) - goto done; - - lstrcpyW(source, sourcedir); - if (source[lstrlenW(source) - 1] != '\\') - lstrcatW(source, szBackSlash); - lstrcatW(source, sourcename); - } - - wildcards = strchrW(source, '*') || strchrW(source, '?'); - - if (MSI_RecordIsNull(rec, 4)) - { - if (!wildcards) - { - destname = strdupW(sourcename); - if (!destname) - goto done; - } - } - else - { - destname = strdupW(MSI_RecordGetString(rec, 4)); - if (destname) - reduce_to_longfilename(destname); - } - - size = 0; - if (destname) - size = lstrlenW(destname); - - size += lstrlenW(destdir) + 2; - dest = msi_alloc(size * sizeof(WCHAR)); - if (!dest) - goto done; - - lstrcpyW(dest, destdir); - if (dest[lstrlenW(dest) - 1] != '\\') - lstrcatW(dest, szBackSlash); - - if (destname) - lstrcatW(dest, destname); - - if (GetFileAttributesW(destdir) == INVALID_FILE_ATTRIBUTES) - { - ret = CreateDirectoryW(destdir, NULL); - if (!ret) - { - WARN("CreateDirectory failed: %d\n", GetLastError()); - return ERROR_SUCCESS; - } - } - - if (!wildcards) - msi_move_file(source, dest, options); - else - move_files_wildcard(source, dest, options); - -done: - msi_free(sourcedir); - msi_free(destdir); - msi_free(destname); - msi_free(source); - msi_free(dest); - - return ERROR_SUCCESS; -} - -static UINT ACTION_MoveFiles( MSIPACKAGE *package ) + uirow = MSI_CreateRecord( 3 ); + MSI_RecordSetStringW( uirow, 1, name ); + MSI_RecordSetStringW( uirow, 2, value ); + MSI_RecordSetInteger( uirow, 3, action ); + ui_actiondata( package, szRemoveEnvironmentStrings, uirow ); + msiobj_release( &uirow->hdr ); + + if (env) RegCloseKey( env ); + msi_free( deformatted ); + return r; +} + +static UINT ACTION_RemoveEnvironmentStrings( MSIPACKAGE *package ) { UINT rc; MSIQUERY *view; - - static const WCHAR ExecSeqQuery[] = + static const WCHAR query[] = {'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ', - '`','M','o','v','e','F','i','l','e','`',0}; - - rc = MSI_DatabaseOpenViewW(package->db, ExecSeqQuery, &view); + '`','E','n','v','i','r','o','n','m','e','n','t','`',0}; + + rc = MSI_DatabaseOpenViewW( package->db, query, &view ); if (rc != ERROR_SUCCESS) return ERROR_SUCCESS; - rc = MSI_IterateRecords(view, NULL, ITERATE_MoveFiles, package); - msiobj_release(&view->hdr); + rc = MSI_IterateRecords( view, NULL, ITERATE_RemoveEnvironmentString, package ); + msiobj_release( &view->hdr ); return rc; } @@ -6009,6 +6277,7 @@ MSIFILE *file; LPWSTR manifest; LPWSTR application; + LPWSTR display_name; DWORD attributes; BOOL installed; } MSIASSEMBLY; @@ -6059,10 +6328,16 @@ LPWSTR path) { IAssemblyCache *cache; + MSIRECORD *uirow; HRESULT hr; UINT r = ERROR_FUNCTION_FAILED; TRACE("installing assembly: %s\n", debugstr_w(path)); + + uirow = MSI_CreateRecord( 2 ); + MSI_RecordSetStringW( uirow, 2, assembly->display_name ); + ui_actiondata( package, szMsiPublishAssemblies, uirow ); + msiobj_release( &uirow->hdr ); if (assembly->feature) msi_feature_set_state(package, assembly->feature, INSTALLSTATE_LOCAL); @@ -6153,81 +6428,87 @@ lstrcatW(*str, append); } -static BOOL check_assembly_installed(MSIDATABASE *db, IAssemblyCache *cache, - MSICOMPONENT *comp) -{ - ASSEMBLY_INFO asminfo; - ASSEMBLY_NAME name; - MSIQUERY *view; - LPWSTR disp; - DWORD size; - BOOL found; - UINT r; - +static WCHAR *get_assembly_display_name( MSIDATABASE *db, MSICOMPONENT *comp ) +{ static const WCHAR separator[] = {',',' ',0}; static const WCHAR Version[] = {'V','e','r','s','i','o','n','=',0}; static const WCHAR Culture[] = {'C','u','l','t','u','r','e','=',0}; - static const WCHAR PublicKeyToken[] = { - 'P','u','b','l','i','c','K','e','y','T','o','k','e','n','=',0}; + static const WCHAR PublicKeyToken[] = {'P','u','b','l','i','c','K','e','y','T','o','k','e','n','=',0}; static const WCHAR query[] = { 'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ', '`','M','s','i','A','s','s','e','m','b','l','y','N','a','m','e','`',' ', 'W','H','E','R','E',' ','`','C','o','m','p','o','n','e','n','t','_','`', '=','\'','%','s','\'',0}; - - disp = NULL; - found = FALSE; - ZeroMemory(&name, sizeof(ASSEMBLY_NAME)); - ZeroMemory(&asminfo, sizeof(ASSEMBLY_INFO)); - - r = MSI_OpenQuery(db, &view, query, comp->Component); + ASSEMBLY_NAME name; + MSIQUERY *view; + LPWSTR display_name; + DWORD size; + UINT r; + + display_name = NULL; + memset( &name, 0, sizeof(ASSEMBLY_NAME) ); + + r = MSI_OpenQuery( db, &view, query, comp->Component ); if (r != ERROR_SUCCESS) - return ERROR_SUCCESS; - - MSI_IterateRecords(view, NULL, parse_assembly_name, &name); - msiobj_release(&view->hdr); + return NULL; + + MSI_IterateRecords( view, NULL, parse_assembly_name, &name ); + msiobj_release( &view->hdr ); if (!name.name) { ERR("No assembly name specified!\n"); - goto done; - } - - append_str(&disp, &size, name.name); + return NULL; + } + + append_str( &display_name, &size, name.name ); if (name.version) { - append_str(&disp, &size, separator); - append_str(&disp, &size, Version); - append_str(&disp, &size, name.version); - } - + append_str( &display_name, &size, separator ); + append_str( &display_name, &size, Version ); + append_str( &display_name, &size, name.version ); + } if (name.culture) { - append_str(&disp, &size, separator); - append_str(&disp, &size, Culture); - append_str(&disp, &size, name.culture); - } - + append_str( &display_name, &size, separator ); + append_str( &display_name, &size, Culture ); + append_str( &display_name, &size, name.culture ); + } if (name.pubkeytoken) { - append_str(&disp, &size, separator); - append_str(&disp, &size, PublicKeyToken); - append_str(&disp, &size, name.pubkeytoken); - } - + append_str( &display_name, &size, separator ); + append_str( &display_name, &size, PublicKeyToken ); + append_str( &display_name, &size, name.pubkeytoken ); + } + + msi_free( name.name ); + msi_free( name.version ); + msi_free( name.culture ); + msi_free( name.pubkeytoken ); + + return display_name; +} + +static BOOL check_assembly_installed( MSIDATABASE *db, IAssemblyCache *cache, MSICOMPONENT *comp ) +{ + ASSEMBLY_INFO asminfo; + LPWSTR disp; + BOOL found = FALSE; + HRESULT hr; + + disp = get_assembly_display_name( db, comp ); + if (!disp) + return FALSE; + + memset( &asminfo, 0, sizeof(ASSEMBLY_INFO) ); asminfo.cbAssemblyInfo = sizeof(ASSEMBLY_INFO); - IAssemblyCache_QueryAssemblyInfo(cache, QUERYASMINFO_FLAG_VALIDATE, - disp, &asminfo); - found = (asminfo.dwAssemblyFlags == ASSEMBLYINFO_FLAG_INSTALLED); - -done: - msi_free(disp); - msi_free(name.name); - msi_free(name.version); - msi_free(name.culture); - msi_free(name.pubkeytoken); - + + hr = IAssemblyCache_QueryAssemblyInfo( cache, QUERYASMINFO_FLAG_VALIDATE, disp, &asminfo ); + if (SUCCEEDED(hr)) + found = (asminfo.dwAssemblyFlags == ASSEMBLYINFO_FLAG_INSTALLED); + + msi_free( disp ); return found; } @@ -6235,20 +6516,25 @@ { ASSEMBLY_LIST *list = param; MSIASSEMBLY *assembly; + LPCWSTR component; assembly = msi_alloc_zero(sizeof(MSIASSEMBLY)); if (!assembly) return ERROR_OUTOFMEMORY; - assembly->component = get_loaded_component(list->package, MSI_RecordGetString(rec, 1)); - - if (!assembly->component || !assembly->component->Enabled || - !(assembly->component->Action & (INSTALLSTATE_LOCAL | INSTALLSTATE_SOURCE))) - { - TRACE("Component not set for install, not publishing assembly\n"); - msi_free(assembly); - return ERROR_SUCCESS; - } + component = MSI_RecordGetString(rec, 1); + assembly->component = get_loaded_component(list->package, component); + if (!assembly->component) + return ERROR_SUCCESS; + + if (assembly->component->ActionRequest != INSTALLSTATE_LOCAL && + assembly->component->ActionRequest != INSTALLSTATE_SOURCE) + { + TRACE("Component not scheduled for installation: %s\n", debugstr_w(component)); + assembly->component->Action = assembly->component->Installed; + return ERROR_SUCCESS; + } + assembly->component->Action = assembly->component->ActionRequest; assembly->feature = find_feature_by_name(list->package, MSI_RecordGetString(rec, 2)); assembly->file = msi_find_file(list->package, assembly->component->KeyPath); @@ -6328,6 +6614,7 @@ list_remove(&assembly->entry); msi_free(assembly->application); msi_free(assembly->manifest); + msi_free(assembly->display_name); msi_free(assembly); } } @@ -6490,7 +6777,18 @@ static UINT ACTION_AllocateRegistrySpace( MSIPACKAGE *package ) { - TRACE("%p\n", package); + static const WCHAR szAvailableFreeReg[] = + {'A','V','A','I','L','A','B','L','E','F','R','E','E','R','E','G',0}; + MSIRECORD *uirow; + int space = msi_get_property_int( package, szAvailableFreeReg, 0 ); + + TRACE("%p %d kilobytes\n", package, space); + + uirow = MSI_CreateRecord( 1 ); + MSI_RecordSetInteger( uirow, 1, space ); + ui_actiondata( package, szAllocateRegistrySpace, uirow ); + msiobj_release( &uirow->hdr ); + return ERROR_SUCCESS; } @@ -6530,13 +6828,6 @@ return ERROR_SUCCESS; } -static UINT ACTION_RemoveIniValues( MSIPACKAGE *package ) -{ - static const WCHAR table[] = - {'R','e','m','o','v','e','I','n','i','F','i','l','e',0 }; - return msi_unimplemented_action_stub( package, "RemoveIniValues", table ); -} - static UINT ACTION_PatchFiles( MSIPACKAGE *package ) { static const WCHAR table[] = { 'P','a','t','c','h',0 }; @@ -6552,7 +6843,7 @@ static UINT ACTION_IsolateComponents( MSIPACKAGE *package ) { static const WCHAR table[] = { - 'I','s','o','l','a','t','e','C','o','m','p','o','n','e','n','t',0 }; + 'I','s','o','l','a','t','e','d','C','o','m','p','o','n','e','n','t',0 }; return msi_unimplemented_action_stub( package, "IsolateComponents", table ); } @@ -6560,13 +6851,6 @@ { static const WCHAR table[] = { 'U','p','g','r','a','d','e',0 }; return msi_unimplemented_action_stub( package, "MigrateFeatureStates", table ); -} - -static UINT ACTION_RemoveEnvironmentStrings( MSIPACKAGE *package ) -{ - static const WCHAR table[] = { - 'E','n','v','i','r','o','n','m','e','n','t',0 }; - return msi_unimplemented_action_stub( package, "RemoveEnvironmentStrings", table ); } static UINT ACTION_MsiUnpublishAssemblies( MSIPACKAGE *package ) @@ -6600,22 +6884,10 @@ return msi_unimplemented_action_stub( package, "InstallSFPCatalogFile", table ); } -static UINT ACTION_RemoveDuplicateFiles( MSIPACKAGE *package ) -{ - static const WCHAR table[] = { 'D','u','p','l','i','c','a','t','e','F','i','l','e',0 }; - return msi_unimplemented_action_stub( package, "RemoveDuplicateFiles", table ); -} - static UINT ACTION_RemoveExistingProducts( MSIPACKAGE *package ) { static const WCHAR table[] = { 'U','p','g','r','a','d','e',0 }; return msi_unimplemented_action_stub( package, "RemoveExistingProducts", table ); -} - -static UINT ACTION_RemoveRegistryValues( MSIPACKAGE *package ) -{ - static const WCHAR table[] = { 'R','e','m','o','v','e','R','e','g','i','s','t','r','y',0 }; - return msi_unimplemented_action_stub( package, "RemoveRegistryValues", table ); } static UINT ACTION_SetODBCFolders( MSIPACKAGE *package ) Modified: trunk/reactos/dll/win32/msi/appsearch.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msi/appsearch.c?…
============================================================================== --- trunk/reactos/dll/win32/msi/appsearch.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msi/appsearch.c [iso-8859-1] Sat Mar 6 10:05:09 2010 @@ -1026,13 +1026,15 @@ static UINT iterate_appsearch(MSIRECORD *row, LPVOID param) { MSIPACKAGE *package = param; - LPWSTR propName, sigName, value = NULL; + LPCWSTR propName, sigName; + LPWSTR value = NULL; MSISIGNATURE sig; + MSIRECORD *uirow; UINT r; /* get property and signature */ - propName = msi_dup_record_field(row,1); - sigName = msi_dup_record_field(row,2); + propName = MSI_RecordGetString(row, 1); + sigName = MSI_RecordGetString(row, 2); TRACE("%s %s\n", debugstr_w(propName), debugstr_w(sigName)); @@ -1043,8 +1045,12 @@ msi_free(value); } ACTION_FreeSignature(&sig); - msi_free(propName); - msi_free(sigName); + + uirow = MSI_CreateRecord( 2 ); + MSI_RecordSetStringW( uirow, 1, propName ); + MSI_RecordSetStringW( uirow, 2, sigName ); + ui_actiondata( package, szAppSearch, uirow ); + msiobj_release( &uirow->hdr ); return r; } Modified: trunk/reactos/dll/win32/msi/custom.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msi/custom.c?rev…
============================================================================== --- trunk/reactos/dll/win32/msi/custom.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msi/custom.c [iso-8859-1] Sat Mar 6 10:05:09 2010 @@ -1120,38 +1120,44 @@ static UINT HANDLE_CustomType34(MSIPACKAGE *package, LPCWSTR source, LPCWSTR target, const INT type, LPCWSTR action) { - LPWSTR filename, deformated; + LPWSTR workingdir, filename; STARTUPINFOW si; PROCESS_INFORMATION info; BOOL rc; - memset(&si,0,sizeof(STARTUPINFOW)); - - filename = resolve_folder(package, source, FALSE, FALSE, TRUE, NULL); + memset(&si, 0, sizeof(STARTUPINFOW)); + + workingdir = resolve_folder(package, source, FALSE, FALSE, TRUE, NULL); + + if (!workingdir) + return ERROR_FUNCTION_FAILED; + + deformat_string(package, target, &filename); if (!filename) + { + msi_free(workingdir); return ERROR_FUNCTION_FAILED; - - SetCurrentDirectoryW(filename); + } + + TRACE("executing exe %s with working directory %s\n", + debugstr_w(filename), debugstr_w(workingdir)); + + rc = CreateProcessW(NULL, filename, NULL, NULL, FALSE, 0, NULL, + workingdir, &si, &info); + + if ( !rc ) + { + ERR("Unable to execute command %s with working directory %s\n", + debugstr_w(filename), debugstr_w(workingdir)); + msi_free(filename); + msi_free(workingdir); + return ERROR_SUCCESS; + } + msi_free(filename); - - deformat_string(package,target,&deformated); - - if (!deformated) - return ERROR_FUNCTION_FAILED; - - TRACE("executing exe %s\n", debugstr_w(deformated)); - - rc = CreateProcessW(NULL, deformated, NULL, NULL, FALSE, 0, NULL, - c_collen, &si, &info); - - if ( !rc ) - { - ERR("Unable to execute command %s\n", debugstr_w(deformated)); - msi_free(deformated); - return ERROR_SUCCESS; - } - msi_free(deformated); + msi_free(workingdir); + CloseHandle( info.hThread ); return wait_process_handle(package, type, info.hProcess, action); Modified: trunk/reactos/dll/win32/msi/dialog.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msi/dialog.c?rev…
============================================================================== --- trunk/reactos/dll/win32/msi/dialog.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msi/dialog.c [iso-8859-1] Sat Mar 6 10:05:09 2010 @@ -801,11 +801,31 @@ return ERROR_SUCCESS; } +/* strip any leading text style label from text field */ +static WCHAR *msi_get_binary_name( MSIPACKAGE *package, MSIRECORD *rec ) +{ + WCHAR *p, *text; + + text = msi_get_deformatted_field( package, rec, 10 ); + if (!text) + return NULL; + + p = text; + while (*p && *p != '{') p++; + if (!*p++) return text; + + while (*p && *p != '}') p++; + if (!*p++) return text; + + p = strdupW( p ); + msi_free( text ); + return p; +} + static UINT msi_dialog_button_control( msi_dialog *dialog, MSIRECORD *rec ) { msi_control *control; UINT attributes, style; - LPWSTR text; TRACE("%p %p\n", dialog, rec); @@ -820,12 +840,19 @@ control->handler = msi_dialog_button_handler; - /* set the icon */ - text = msi_get_deformatted_field( dialog->package, rec, 10 ); - control->hIcon = msi_load_icon( dialog->package->db, text, attributes ); - if( attributes & msidbControlAttributesIcon ) - SendMessageW( control->hwnd, BM_SETIMAGE, IMAGE_ICON, (LPARAM) control->hIcon ); - msi_free( text ); + if (attributes & msidbControlAttributesIcon) + { + /* set the icon */ + LPWSTR name = msi_get_binary_name( dialog->package, rec ); + control->hIcon = msi_load_icon( dialog->package->db, name, attributes ); + if (control->hIcon) + { + SendMessageW( control->hwnd, BM_SETIMAGE, IMAGE_ICON, (LPARAM) control->hIcon ); + } + else + ERR("Failed to load icon %s\n", debugstr_w(name)); + msi_free( name ); + } return ERROR_SUCCESS; } @@ -1142,7 +1169,7 @@ { UINT cx, cy, flags, style, attributes; msi_control *control; - LPWSTR text; + LPWSTR name; flags = LR_LOADFROMFILE; style = SS_BITMAP | SS_LEFT | WS_GROUP; @@ -1160,15 +1187,15 @@ cx = msi_dialog_scale_unit( dialog, cx ); cy = msi_dialog_scale_unit( dialog, cy ); - text = msi_get_deformatted_field( dialog->package, rec, 10 ); - control->hBitmap = msi_load_picture( dialog->package->db, text, cx, cy, flags ); + name = msi_get_binary_name( dialog->package, rec ); + control->hBitmap = msi_load_picture( dialog->package->db, name, cx, cy, flags ); if( control->hBitmap ) SendMessageW( control->hwnd, STM_SETIMAGE, IMAGE_BITMAP, (LPARAM) control->hBitmap ); else - ERR("Failed to load bitmap %s\n", debugstr_w(text)); - - msi_free( text ); + ERR("Failed to load bitmap %s\n", debugstr_w(name)); + + msi_free( name ); return ERROR_SUCCESS; } @@ -1177,7 +1204,7 @@ { msi_control *control; DWORD attributes; - LPWSTR text; + LPWSTR name; TRACE("\n"); @@ -1185,13 +1212,13 @@ SS_ICON | SS_CENTERIMAGE | WS_GROUP ); attributes = MSI_RecordGetInteger( rec, 8 ); - text = msi_get_deformatted_field( dialog->package, rec, 10 ); - control->hIcon = msi_load_icon( dialog->package->db, text, attributes ); + name = msi_get_binary_name( dialog->package, rec ); + control->hIcon = msi_load_icon( dialog->package->db, name, attributes ); if( control->hIcon ) SendMessageW( control->hwnd, STM_SETICON, (WPARAM) control->hIcon, 0 ); else - ERR("Failed to load bitmap %s\n", debugstr_w(text)); - msi_free( text ); + ERR("Failed to load bitmap %s\n", debugstr_w(name)); + msi_free( name ); return ERROR_SUCCESS; } Modified: trunk/reactos/dll/win32/msi/files.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msi/files.c?rev=…
============================================================================== --- trunk/reactos/dll/win32/msi/files.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msi/files.c [iso-8859-1] Sat Mar 6 10:05:09 2010 @@ -24,10 +24,10 @@ * * InstallFiles * DuplicateFiles - * MoveFiles (TODO) + * MoveFiles * PatchFiles (TODO) - * RemoveDuplicateFiles(TODO) - * RemoveFiles(TODO) + * RemoveDuplicateFiles + * RemoveFiles */ #include <stdarg.h> @@ -85,23 +85,6 @@ return lstrcmpW(version, file->Version); } -static UINT get_file_target(MSIPACKAGE *package, LPCWSTR file_key, - MSIFILE** file) -{ - LIST_FOR_EACH_ENTRY( *file, &package->files, MSIFILE, entry ) - { - if (lstrcmpW( file_key, (*file)->File )==0) - { - if ((*file)->state >= msifs_overwrite) - return ERROR_SUCCESS; - else - return ERROR_FILE_NOT_FOUND; - } - } - - return ERROR_FUNCTION_FAILED; -} - static void schedule_install_files(MSIPACKAGE *package) { MSIFILE *file; @@ -345,15 +328,407 @@ return rc; } +#define is_dot_dir(x) ((x[0] == '.') && ((x[1] == 0) || ((x[1] == '.') && (x[2] == 0)))) + +typedef struct +{ + struct list entry; + LPWSTR sourcename; + LPWSTR destname; + LPWSTR source; + LPWSTR dest; +} FILE_LIST; + +static BOOL msi_move_file(LPCWSTR source, LPCWSTR dest, int options) +{ + BOOL ret; + + if (GetFileAttributesW(source) == FILE_ATTRIBUTE_DIRECTORY || + GetFileAttributesW(dest) == FILE_ATTRIBUTE_DIRECTORY) + { + WARN("Source or dest is directory, not moving\n"); + return FALSE; + } + + if (options == msidbMoveFileOptionsMove) + { + TRACE("moving %s -> %s\n", debugstr_w(source), debugstr_w(dest)); + ret = MoveFileExW(source, dest, MOVEFILE_REPLACE_EXISTING); + if (!ret) + { + WARN("MoveFile failed: %d\n", GetLastError()); + return FALSE; + } + } + else + { + TRACE("copying %s -> %s\n", debugstr_w(source), debugstr_w(dest)); + ret = CopyFileW(source, dest, FALSE); + if (!ret) + { + WARN("CopyFile failed: %d\n", GetLastError()); + return FALSE; + } + } + + return TRUE; +} + +static LPWSTR wildcard_to_file(LPWSTR wildcard, LPWSTR filename) +{ + LPWSTR path, ptr; + DWORD dirlen, pathlen; + + ptr = strrchrW(wildcard, '\\'); + dirlen = ptr - wildcard + 1; + + pathlen = dirlen + lstrlenW(filename) + 1; + path = msi_alloc(pathlen * sizeof(WCHAR)); + + lstrcpynW(path, wildcard, dirlen + 1); + lstrcatW(path, filename); + + return path; +} + +static void free_file_entry(FILE_LIST *file) +{ + msi_free(file->source); + msi_free(file->dest); + msi_free(file); +} + +static void free_list(FILE_LIST *list) +{ + while (!list_empty(&list->entry)) + { + FILE_LIST *file = LIST_ENTRY(list_head(&list->entry), FILE_LIST, entry); + + list_remove(&file->entry); + free_file_entry(file); + } +} + +static BOOL add_wildcard(FILE_LIST *files, LPWSTR source, LPWSTR dest) +{ + FILE_LIST *new, *file; + LPWSTR ptr, filename; + DWORD size; + + new = msi_alloc_zero(sizeof(FILE_LIST)); + if (!new) + return FALSE; + + new->source = strdupW(source); + ptr = strrchrW(dest, '\\') + 1; + filename = strrchrW(new->source, '\\') + 1; + + new->sourcename = filename; + + if (*ptr) + new->destname = ptr; + else + new->destname = new->sourcename; + + size = (ptr - dest) + lstrlenW(filename) + 1; + new->dest = msi_alloc(size * sizeof(WCHAR)); + if (!new->dest) + { + free_file_entry(new); + return FALSE; + } + + lstrcpynW(new->dest, dest, ptr - dest + 1); + lstrcatW(new->dest, filename); + + if (list_empty(&files->entry)) + { + list_add_head(&files->entry, &new->entry); + return TRUE; + } + + LIST_FOR_EACH_ENTRY(file, &files->entry, FILE_LIST, entry) + { + if (lstrcmpW(source, file->source) < 0) + { + list_add_before(&file->entry, &new->entry); + return TRUE; + } + } + + list_add_after(&file->entry, &new->entry); + return TRUE; +} + +static BOOL move_files_wildcard(LPWSTR source, LPWSTR dest, int options) +{ + WIN32_FIND_DATAW wfd; + HANDLE hfile; + LPWSTR path; + BOOL res; + FILE_LIST files, *file; + DWORD size; + + hfile = FindFirstFileW(source, &wfd); + if (hfile == INVALID_HANDLE_VALUE) return FALSE; + + list_init(&files.entry); + + for (res = TRUE; res; res = FindNextFileW(hfile, &wfd)) + { + if (is_dot_dir(wfd.cFileName)) continue; + + path = wildcard_to_file(source, wfd.cFileName); + if (!path) + { + res = FALSE; + goto done; + } + + add_wildcard(&files, path, dest); + msi_free(path); + } + + /* no files match the wildcard */ + if (list_empty(&files.entry)) + goto done; + + /* only the first wildcard match gets renamed to dest */ + file = LIST_ENTRY(list_head(&files.entry), FILE_LIST, entry); + size = (strrchrW(file->dest, '\\') - file->dest) + lstrlenW(file->destname) + 2; + file->dest = msi_realloc(file->dest, size * sizeof(WCHAR)); + if (!file->dest) + { + res = FALSE; + goto done; + } + + /* file->dest may be shorter after the reallocation, so add a NULL + * terminator. This is needed for the call to strrchrW, as there will no + * longer be a NULL terminator within the bounds of the allocation in this case. + */ + file->dest[size - 1] = '\0'; + lstrcpyW(strrchrW(file->dest, '\\') + 1, file->destname); + + while (!list_empty(&files.entry)) + { + file = LIST_ENTRY(list_head(&files.entry), FILE_LIST, entry); + + msi_move_file(file->source, file->dest, options); + + list_remove(&file->entry); + free_file_entry(file); + } + + res = TRUE; + +done: + free_list(&files); + FindClose(hfile); + return res; +} + +static UINT ITERATE_MoveFiles( MSIRECORD *rec, LPVOID param ) +{ + MSIPACKAGE *package = param; + MSIRECORD *uirow; + MSICOMPONENT *comp; + LPCWSTR sourcename, component; + LPWSTR sourcedir, destname = NULL, destdir = NULL, source = NULL, dest = NULL; + int options; + DWORD size; + BOOL ret, wildcards; + + component = MSI_RecordGetString(rec, 2); + comp = get_loaded_component(package, component); + if (!comp) + return ERROR_SUCCESS; + + if (comp->ActionRequest != INSTALLSTATE_LOCAL && comp->ActionRequest != INSTALLSTATE_SOURCE) + { + TRACE("Component not scheduled for installation: %s\n", debugstr_w(component)); + comp->Action = comp->Installed; + return ERROR_SUCCESS; + } + comp->Action = comp->ActionRequest; + + sourcename = MSI_RecordGetString(rec, 3); + options = MSI_RecordGetInteger(rec, 7); + + sourcedir = msi_dup_property(package, MSI_RecordGetString(rec, 5)); + if (!sourcedir) + goto done; + + destdir = msi_dup_property(package, MSI_RecordGetString(rec, 6)); + if (!destdir) + goto done; + + if (!sourcename) + { + if (GetFileAttributesW(sourcedir) == INVALID_FILE_ATTRIBUTES) + goto done; + + source = strdupW(sourcedir); + if (!source) + goto done; + } + else + { + size = lstrlenW(sourcedir) + lstrlenW(sourcename) + 2; + source = msi_alloc(size * sizeof(WCHAR)); + if (!source) + goto done; + + lstrcpyW(source, sourcedir); + if (source[lstrlenW(source) - 1] != '\\') + lstrcatW(source, szBackSlash); + lstrcatW(source, sourcename); + } + + wildcards = strchrW(source, '*') || strchrW(source, '?'); + + if (MSI_RecordIsNull(rec, 4)) + { + if (!wildcards) + { + destname = strdupW(sourcename); + if (!destname) + goto done; + } + } + else + { + destname = strdupW(MSI_RecordGetString(rec, 4)); + if (destname) + reduce_to_longfilename(destname); + } + + size = 0; + if (destname) + size = lstrlenW(destname); + + size += lstrlenW(destdir) + 2; + dest = msi_alloc(size * sizeof(WCHAR)); + if (!dest) + goto done; + + lstrcpyW(dest, destdir); + if (dest[lstrlenW(dest) - 1] != '\\') + lstrcatW(dest, szBackSlash); + + if (destname) + lstrcatW(dest, destname); + + if (GetFileAttributesW(destdir) == INVALID_FILE_ATTRIBUTES) + { + ret = CreateDirectoryW(destdir, NULL); + if (!ret) + { + WARN("CreateDirectory failed: %d\n", GetLastError()); + goto done; + } + } + + if (!wildcards) + msi_move_file(source, dest, options); + else + move_files_wildcard(source, dest, options); + +done: + uirow = MSI_CreateRecord( 9 ); + MSI_RecordSetStringW( uirow, 1, MSI_RecordGetString(rec, 1) ); + MSI_RecordSetInteger( uirow, 6, 1 ); /* FIXME */ + MSI_RecordSetStringW( uirow, 9, destdir ); + ui_actiondata( package, szMoveFiles, uirow ); + msiobj_release( &uirow->hdr ); + + msi_free(sourcedir); + msi_free(destdir); + msi_free(destname); + msi_free(source); + msi_free(dest); + + return ERROR_SUCCESS; +} + +UINT ACTION_MoveFiles( MSIPACKAGE *package ) +{ + UINT rc; + MSIQUERY *view; + + static const WCHAR ExecSeqQuery[] = + {'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ', + '`','M','o','v','e','F','i','l','e','`',0}; + + rc = MSI_DatabaseOpenViewW(package->db, ExecSeqQuery, &view); + if (rc != ERROR_SUCCESS) + return ERROR_SUCCESS; + + rc = MSI_IterateRecords(view, NULL, ITERATE_MoveFiles, package); + msiobj_release(&view->hdr); + + return rc; +} + +static WCHAR *get_duplicate_filename( MSIPACKAGE *package, MSIRECORD *row, const WCHAR *file_key, const WCHAR *src ) +{ + DWORD len; + WCHAR *dst_name, *dst_path, *dst; + + if (MSI_RecordIsNull( row, 4 )) + { + len = strlenW( src ) + 1; + if (!(dst_name = msi_alloc( len * sizeof(WCHAR)))) return NULL; + strcpyW( dst_name, strrchrW( src, '\\' ) + 1 ); + } + else + { + MSI_RecordGetStringW( row, 4, NULL, &len ); + if (!(dst_name = msi_alloc( ++len * sizeof(WCHAR) ))) return NULL; + MSI_RecordGetStringW( row, 4, dst_name, &len ); + reduce_to_longfilename( dst_name ); + } + + if (MSI_RecordIsNull( row, 5 )) + { + WCHAR *p; + dst_path = strdupW( src ); + p = strrchrW( dst_path, '\\' ); + if (p) *p = 0; + } + else + { + const WCHAR *dst_key = MSI_RecordGetString( row, 5 ); + + dst_path = resolve_folder( package, dst_key, FALSE, FALSE, TRUE, NULL ); + if (!dst_path) + { + /* try a property */ + dst_path = msi_dup_property( package, dst_key ); + if (!dst_path) + { + FIXME("Unable to get destination folder, try AppSearch properties\n"); + msi_free( dst_name ); + return NULL; + } + } + } + + dst = build_directory_name( 2, dst_path, dst_name ); + create_full_pathW( dst_path ); + + msi_free( dst_name ); + msi_free( dst_path ); + return dst; +} + static UINT ITERATE_DuplicateFiles(MSIRECORD *row, LPVOID param) { MSIPACKAGE *package = param; - WCHAR dest_name[0x100]; - LPWSTR dest_path, dest; + LPWSTR dest; LPCWSTR file_key, component; - DWORD sz; - DWORD rc; MSICOMPONENT *comp; + MSIRECORD *uirow; MSIFILE *file; component = MSI_RecordGetString(row,2); @@ -376,70 +751,38 @@ return ERROR_FUNCTION_FAILED; } - rc = get_file_target(package,file_key,&file); - - if (rc != ERROR_SUCCESS) - { - ERR("Original file unknown %s\n",debugstr_w(file_key)); - return ERROR_SUCCESS; - } - - if (MSI_RecordIsNull(row,4)) - strcpyW(dest_name,strrchrW(file->TargetPath,'\\')+1); - else - { - sz=0x100; - MSI_RecordGetStringW(row,4,dest_name,&sz); - reduce_to_longfilename(dest_name); - } - - if (MSI_RecordIsNull(row,5)) - { - LPWSTR p; - dest_path = strdupW(file->TargetPath); - p = strrchrW(dest_path,'\\'); - if (p) - *p=0; - } - else - { - LPCWSTR destkey; - destkey = MSI_RecordGetString(row,5); - dest_path = resolve_folder(package, destkey, FALSE, FALSE, TRUE, NULL); - if (!dest_path) - { - /* try a Property */ - dest_path = msi_dup_property( package, destkey ); - if (!dest_path) - { - FIXME("Unable to get destination folder, try AppSearch properties\n"); - return ERROR_SUCCESS; - } - } - } - - dest = build_directory_name(2, dest_path, dest_name); - create_full_pathW(dest_path); - - TRACE("Duplicating file %s to %s\n",debugstr_w(file->TargetPath), - debugstr_w(dest)); - - if (strcmpW(file->TargetPath,dest)) - rc = !CopyFileW(file->TargetPath,dest,TRUE); - else - rc = ERROR_SUCCESS; - - if (rc != ERROR_SUCCESS) - ERR("Failed to copy file %s -> %s, last error %d\n", - debugstr_w(file->TargetPath), debugstr_w(dest_path), GetLastError()); + file = get_loaded_file( package, file_key ); + if (!file) + { + ERR("Original file unknown %s\n", debugstr_w(file_key)); + return ERROR_SUCCESS; + } + + dest = get_duplicate_filename( package, row, file_key, file->TargetPath ); + if (!dest) + { + WARN("Unable to get duplicate filename\n"); + return ERROR_SUCCESS; + } + + TRACE("Duplicating file %s to %s\n", debugstr_w(file->TargetPath), debugstr_w(dest)); + + if (!CopyFileW( file->TargetPath, dest, TRUE )) + { + WARN("Failed to copy file %s -> %s (%u)\n", + debugstr_w(file->TargetPath), debugstr_w(dest), GetLastError()); + } FIXME("We should track these duplicate files as well\n"); - msi_free(dest_path); + uirow = MSI_CreateRecord( 9 ); + MSI_RecordSetStringW( uirow, 1, MSI_RecordGetString( row, 1 ) ); + MSI_RecordSetInteger( uirow, 6, file->FileSize ); + MSI_RecordSetStringW( uirow, 9, MSI_RecordGetString( row, 5 ) ); + ui_actiondata( package, szDuplicateFiles, uirow ); + msiobj_release( &uirow->hdr ); + msi_free(dest); - - msi_file_update_ui(package, file, szDuplicateFiles); - return ERROR_SUCCESS; } @@ -461,6 +804,84 @@ return rc; } +static UINT ITERATE_RemoveDuplicateFiles( MSIRECORD *row, LPVOID param ) +{ + MSIPACKAGE *package = param; + LPWSTR dest; + LPCWSTR file_key, component; + MSICOMPONENT *comp; + MSIRECORD *uirow; + MSIFILE *file; + + component = MSI_RecordGetString( row, 2 ); + comp = get_loaded_component( package, component ); + if (!comp) + return ERROR_SUCCESS; + + if (comp->ActionRequest != INSTALLSTATE_ABSENT) + { + TRACE("Component not scheduled for removal %s\n", debugstr_w(component)); + comp->Action = comp->Installed; + return ERROR_SUCCESS; + } + comp->Action = INSTALLSTATE_ABSENT; + + file_key = MSI_RecordGetString( row, 3 ); + if (!file_key) + { + ERR("Unable to get file key\n"); + return ERROR_FUNCTION_FAILED; + } + + file = get_loaded_file( package, file_key ); + if (!file) + { + ERR("Original file unknown %s\n", debugstr_w(file_key)); + return ERROR_SUCCESS; + } + + dest = get_duplicate_filename( package, row, file_key, file->TargetPath ); + if (!dest) + { + WARN("Unable to get duplicate filename\n"); + return ERROR_SUCCESS; + } + + TRACE("Removing duplicate %s of %s\n", debugstr_w(dest), debugstr_w(file->TargetPath)); + + if (!DeleteFileW( dest )) + { + WARN("Failed to delete duplicate file %s (%u)\n", debugstr_w(dest), GetLastError()); + } + + uirow = MSI_CreateRecord( 9 ); + MSI_RecordSetStringW( uirow, 1, MSI_RecordGetString( row, 1 ) ); + MSI_RecordSetStringW( uirow, 9, MSI_RecordGetString( row, 5 ) ); + ui_actiondata( package, szRemoveDuplicateFiles, uirow ); + msiobj_release( &uirow->hdr ); + + msi_free(dest); + return ERROR_SUCCESS; +} + +UINT ACTION_RemoveDuplicateFiles( MSIPACKAGE *package ) +{ + UINT rc; + MSIQUERY *view; + static const WCHAR query[] = + {'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ', + '`','D','u','p','l','i','c','a','t','e','F','i','l','e','`',0}; + + rc = MSI_DatabaseOpenViewW( package->db, query, &view ); + if (rc != ERROR_SUCCESS) + return ERROR_SUCCESS; + + rc = MSI_IterateRecords( view, NULL, ITERATE_RemoveDuplicateFiles, package ); + msiobj_release( &view->hdr ); + + return rc; +} + static BOOL verify_comp_for_removal(MSICOMPONENT *comp, UINT install_mode) { INSTALLSTATE request = comp->ActionRequest; @@ -491,6 +912,7 @@ { MSIPACKAGE *package = param; MSICOMPONENT *comp; + MSIRECORD *uirow; LPCWSTR component, filename, dirprop; UINT install_mode; LPWSTR dir = NULL, path = NULL; @@ -529,11 +951,10 @@ goto done; } - lstrcpyW(path, dir); - PathAddBackslashW(path); - if (filename) { + lstrcpyW(path, dir); + PathAddBackslashW(path); lstrcatW(path, filename); TRACE("Deleting misc file: %s\n", debugstr_w(path)); @@ -541,11 +962,17 @@ } else { - TRACE("Removing misc directory: %s\n", debugstr_w(path)); - RemoveDirectoryW(path); + TRACE("Removing misc directory: %s\n", debugstr_w(dir)); + RemoveDirectoryW(dir); } done: + uirow = MSI_CreateRecord( 9 ); + MSI_RecordSetStringW( uirow, 1, MSI_RecordGetString(row, 1) ); + MSI_RecordSetStringW( uirow, 9, dir ); + ui_actiondata( package, szRemoveFiles, uirow ); + msiobj_release( &uirow->hdr ); + msi_free(path); msi_free(dir); return ERROR_SUCCESS; @@ -560,6 +987,9 @@ static const WCHAR query[] = { 'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ', '`','R','e','m','o','v','e','F','i','l','e','`',0}; + static const WCHAR folder_query[] = { + 'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ', + '`','C','r','e','a','t','e','F','o','l','d','e','r','`',0}; r = MSI_DatabaseOpenViewW(package->db, query, &view); if (r == ERROR_SUCCESS) @@ -568,10 +998,14 @@ msiobj_release(&view->hdr); } + r = MSI_DatabaseOpenViewW(package->db, folder_query, &view); + if (r == ERROR_SUCCESS) + msiobj_release(&view->hdr); + LIST_FOR_EACH_ENTRY( file, &package->files, MSIFILE, entry ) { MSIRECORD *uirow; - LPWSTR uipath, p; + LPWSTR dir, uipath, p; if ( file->state == msifs_installed ) ERR("removing installed file %s\n", debugstr_w(file->TargetPath)); @@ -587,8 +1021,17 @@ continue; TRACE("removing %s\n", debugstr_w(file->File) ); - if ( !DeleteFileW( file->TargetPath ) ) - TRACE("failed to delete %s\n", debugstr_w(file->TargetPath)); + if (!DeleteFileW( file->TargetPath )) + { + WARN("failed to delete %s\n", debugstr_w(file->TargetPath)); + } + /* FIXME: check persistence for each directory */ + else if (r && (dir = strdupW( file->TargetPath ))) + { + if ((p = strrchrW( dir, '\\' ))) *p = 0; + RemoveDirectoryW( dir ); + msi_free( dir ); + } file->state = msifs_missing; /* the UI chunk */ Modified: trunk/reactos/dll/win32/msi/helpers.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msi/helpers.c?re…
============================================================================== --- trunk/reactos/dll/win32/msi/helpers.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msi/helpers.c [iso-8859-1] Sat Mar 6 10:05:09 2010 @@ -154,25 +154,6 @@ return folder; } return NULL; -} - -void msi_reset_folders( MSIPACKAGE *package, BOOL source ) -{ - MSIFOLDER *folder; - - LIST_FOR_EACH_ENTRY( folder, &package->folders, MSIFOLDER, entry ) - { - if ( source ) - { - msi_free( folder->ResolvedSource ); - folder->ResolvedSource = NULL; - } - else - { - msi_free( folder->ResolvedTarget ); - folder->ResolvedTarget = NULL; - } - } } static LPWSTR get_source_root( MSIPACKAGE *package ) @@ -732,7 +713,7 @@ if (!package->script) return FALSE; - TRACE("Registering Action %s as having fun\n",debugstr_w(action)); + TRACE("Registering %s as unique action\n", debugstr_w(action)); count = package->script->UniqueActionsCount; package->script->UniqueActionsCount++; Modified: trunk/reactos/dll/win32/msi/msi.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msi/msi.rc?rev=4…
============================================================================== --- trunk/reactos/dll/win32/msi/msi.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msi/msi.rc [iso-8859-1] Sat Mar 6 10:05:09 2010 @@ -29,27 +29,30 @@ #include "msi_Bg.rc" #include "msi_Da.rc" -#include "msi_De.rc" #include "msi_En.rc" #include "msi_Eo.rc" #include "msi_Es.rc" #include "msi_Fi.rc" -#include "msi_Fr.rc" #include "msi_Hu.rc" -#include "msi_It.rc" #include "msi_Ko.rc" -#include "msi_Lt.rc" #include "msi_Nl.rc" #include "msi_No.rc" #include "msi_Pl.rc" #include "msi_Pt.rc" -#include "msi_Ro.rc" -#include "msi_Ru.rc" -#include "msi_Si.rc" #include "msi_Sv.rc" #include "msi_Tr.rc" #include "msi_Uk.rc" #include "msi_Zh.rc" + +/* UTF-8 */ +#include "msi_De.rc" +#include "msi_Fr.rc" +#include "msi_It.rc" +#include "msi_Lt.rc" +#include "msi_Ro.rc" +#include "msi_Ru.rc" +#include "msi_Si.rc" + LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL Modified: trunk/reactos/dll/win32/msi/msipriv.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msi/msipriv.h?re…
============================================================================== --- trunk/reactos/dll/win32/msi/msipriv.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msi/msipriv.h [iso-8859-1] Sat Mar 6 10:05:09 2010 @@ -955,7 +955,9 @@ extern UINT ACTION_FindRelatedProducts(MSIPACKAGE *package); extern UINT ACTION_InstallFiles(MSIPACKAGE *package); extern UINT ACTION_RemoveFiles(MSIPACKAGE *package); +extern UINT ACTION_MoveFiles(MSIPACKAGE *package); extern UINT ACTION_DuplicateFiles(MSIPACKAGE *package); +extern UINT ACTION_RemoveDuplicateFiles(MSIPACKAGE *package); extern UINT ACTION_RegisterClassInfo(MSIPACKAGE *package); extern UINT ACTION_RegisterProgIdInfo(MSIPACKAGE *package); extern UINT ACTION_RegisterExtensionInfo(MSIPACKAGE *package); @@ -975,7 +977,6 @@ extern MSIFEATURE *get_loaded_feature( MSIPACKAGE* package, LPCWSTR Feature ); extern MSIFILE *get_loaded_file( MSIPACKAGE* package, LPCWSTR file ); extern MSIFOLDER *get_loaded_folder( MSIPACKAGE *package, LPCWSTR dir ); -extern void msi_reset_folders( MSIPACKAGE *package, BOOL source ); extern int track_tempfile(MSIPACKAGE *package, LPCWSTR path); extern UINT schedule_action(MSIPACKAGE *package, UINT script, LPCWSTR action); extern void msi_free_action_script(MSIPACKAGE *package, UINT script); @@ -1064,6 +1065,7 @@ static const WCHAR szRegisterExtensionInfo[] = {'R','e','g','i','s','t','e','r','E','x','t','e','n','s','i','o','n','I','n','f','o',0}; static const WCHAR szRegisterMIMEInfo[] = {'R','e','g','i','s','t','e','r','M','I','M','E','I','n','f','o',0}; static const WCHAR szDuplicateFiles[] = {'D','u','p','l','i','c','a','t','e','F','i','l','e','s',0}; +static const WCHAR szRemoveDuplicateFiles[] = {'R','e','m','o','v','e','D','u','p','l','i','c','a','t','e','F','i','l','e','s',0}; static const WCHAR szInstallFiles[] = {'I','n','s','t','a','l','l','F','i','l','e','s',0}; static const WCHAR szRemoveFiles[] = {'R','e','m','o','v','e','F','i','l','e','s',0}; static const WCHAR szFindRelatedProducts[] = {'F','i','n','d','R','e','l','a','t','e','d','P','r','o','d','u','c','t','s',0}; @@ -1075,6 +1077,13 @@ static const WCHAR szPIDKEY[] = {'P','I','D','K','E','Y',0}; static const WCHAR szTYPELIB[] = {'T','Y','P','E','L','I','B',0}; static const WCHAR szSumInfo[] = {5 ,'S','u','m','m','a','r','y','I','n','f','o','r','m','a','t','i','o','n',0}; +static const WCHAR szHCR[] = {'H','K','E','Y','_','C','L','A','S','S','E','S','_','R','O','O','T','\\',0}; +static const WCHAR szHCU[] = {'H','K','E','Y','_','C','U','R','R','E','N','T','_','U','S','E','R','\\',0}; +static const WCHAR szHLM[] = {'H','K','E','Y','_','L','O','C','A','L','_','M','A','C','H','I','N','E','\\',0}; +static const WCHAR szHU[] = {'H','K','E','Y','_','U','S','E','R','S','\\',0}; +static const WCHAR szWindowsFolder[] = {'W','i','n','d','o','w','s','F','o','l','d','e','r',0}; +static const WCHAR szAppSearch[] = {'A','p','p','S','e','a','r','c','h',0}; +static const WCHAR szMoveFiles[] = {'M','o','v','e','F','i','l','e','s',0}; /* memory allocation macro functions */ static void *msi_alloc( size_t len ) __WINE_ALLOC_SIZE(1); Modified: trunk/reactos/dll/win32/msi/package.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msi/package.c?re…
============================================================================== --- trunk/reactos/dll/win32/msi/package.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msi/package.c [iso-8859-1] Sat Mar 6 10:05:09 2010 @@ -1621,6 +1621,25 @@ return r; } +static void msi_reset_folders( MSIPACKAGE *package, BOOL source ) +{ + MSIFOLDER *folder; + + LIST_FOR_EACH_ENTRY( folder, &package->folders, MSIFOLDER, entry ) + { + if ( source ) + { + msi_free( folder->ResolvedSource ); + folder->ResolvedSource = NULL; + } + else + { + msi_free( folder->ResolvedTarget ); + folder->ResolvedTarget = NULL; + } + } +} + UINT MSI_SetPropertyW( MSIPACKAGE *package, LPCWSTR szName, LPCWSTR szValue) { MSIQUERY *view; Modified: trunk/reactos/dll/win32/msi/streams.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msi/streams.c?re…
============================================================================== --- trunk/reactos/dll/win32/msi/streams.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msi/streams.c [iso-8859-1] Sat Mar 6 10:05:09 2010 @@ -527,9 +527,9 @@ break; } - if (!strcmpW(stat.pwcsName, szSumInfo)) - { - /* summary information stream is not encoded */ + /* these streams appear to be unencoded */ + if (*stat.pwcsName == 0x0005) + { r = db_get_raw_stream(sv->db, stat.pwcsName, &stream->stream); } else Modified: trunk/reactos/dll/win32/msi/upgrade.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msi/upgrade.c?re…
============================================================================== --- trunk/reactos/dll/win32/msi/upgrade.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msi/upgrade.c [iso-8859-1] Sat Mar 6 10:05:09 2010 @@ -182,9 +182,10 @@ continue; } - action_property = MSI_RecordGetString(rec,7); - append_productcode(package,action_property,productid); - ui_actiondata(package,szFindRelatedProducts,uirow); + action_property = MSI_RecordGetString(rec, 7); + append_productcode(package, action_property, productid); + MSI_RecordSetStringW(uirow, 1, productid); + ui_actiondata(package, szFindRelatedProducts, uirow); } index ++; } @@ -202,6 +203,12 @@ UINT rc = ERROR_SUCCESS; MSIQUERY *view; + if (msi_get_property_int(package, szInstalled, 0)) + { + TRACE("Skipping FindRelatedProducts action: product already installed\n"); + return ERROR_SUCCESS; + } + if (check_unique_action(package,szFindRelatedProducts)) { TRACE("Skipping FindRelatedProducts action: already done on client side\n"); Modified: trunk/reactos/include/psdk/msidefs.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/msidefs.h?rev…
============================================================================== --- trunk/reactos/include/psdk/msidefs.h [iso-8859-1] (original) +++ trunk/reactos/include/psdk/msidefs.h [iso-8859-1] Sat Mar 6 10:05:09 2010 @@ -220,6 +220,15 @@ msidbRemoveFileInstallModeOnInstall = 0x00000001, msidbRemoveFileInstallModeOnRemove = 0x00000002, msidbRemoveFileInstallModeOnBoth = 0x00000003, +}; + +enum +{ + msidbIniFileActionAddLine = 0x00000000, + msidbIniFileActionCreateLine = 0x00000001, + msidbIniFileActionRemoveLine = 0x00000002, + msidbIniFileActionAddTag = 0x00000003, + msidbIniFileActionRemoveTag = 0x00000004 }; /*
14 years, 9 months
1
0
0
0
[cwittich] 45908: [MSXML3] sync msxml3 to wine 1.1.40
by cwittich@svn.reactos.org
Author: cwittich Date: Sat Mar 6 09:56:21 2010 New Revision: 45908 URL:
http://svn.reactos.org/svn/reactos?rev=45908&view=rev
Log: [MSXML3] sync msxml3 to wine 1.1.40 Modified: trunk/reactos/dll/win32/msxml3/domdoc.c trunk/reactos/dll/win32/msxml3/element.c Modified: trunk/reactos/dll/win32/msxml3/domdoc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msxml3/domdoc.c?…
============================================================================== --- trunk/reactos/dll/win32/msxml3/domdoc.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msxml3/domdoc.c [iso-8859-1] Sat Mar 6 09:56:21 2010 @@ -2214,7 +2214,7 @@ return IXMLDocument_Release((IXMLDocument *)This); } -#define SAFETY_SUPPORTED_OPTIONS (INTERFACESAFE_FOR_UNTRUSTED_CALLER|INTERFACESAFE_FOR_UNTRUSTED_DATA) +#define SAFETY_SUPPORTED_OPTIONS (INTERFACESAFE_FOR_UNTRUSTED_CALLER|INTERFACESAFE_FOR_UNTRUSTED_DATA|INTERFACE_USES_SECURITY_MANAGER) static HRESULT WINAPI xmldoc_Safety_GetInterfaceSafetyOptions(IObjectSafety *iface, REFIID riid, DWORD *pdwSupportedOptions, DWORD *pdwEnabledOptions) @@ -2237,6 +2237,9 @@ { domdoc *This = impl_from_IObjectSafety(iface); TRACE("(%p)->(%s %x %x)\n", This, debugstr_guid(riid), dwOptionSetMask, dwEnabledOptions); + + if ((dwOptionSetMask & ~SAFETY_SUPPORTED_OPTIONS) != 0) + return E_FAIL; This->safeopt = dwEnabledOptions & dwOptionSetMask & SAFETY_SUPPORTED_OPTIONS; return S_OK; Modified: trunk/reactos/dll/win32/msxml3/element.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msxml3/element.c…
============================================================================== --- trunk/reactos/dll/win32/msxml3/element.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msxml3/element.c [iso-8859-1] Sat Mar 6 09:56:21 2010 @@ -489,32 +489,24 @@ { domelem *This = impl_from_IXMLDOMElement( iface ); xmlNodePtr element; - DWORD len; - DWORD offset = 0; - LPWSTR str; + const xmlChar *prefix; + xmlChar *qname; TRACE("(%p)->(%p)\n", This, p ); + + if (!p) return E_INVALIDARG; element = get_element( This ); if ( !element ) return E_FAIL; - len = MultiByteToWideChar( CP_UTF8, 0, (LPCSTR) element->name, -1, NULL, 0 ); - if (element->ns) - len += MultiByteToWideChar( CP_UTF8, 0, (LPCSTR) element->ns->prefix, -1, NULL, 0 ); - str = heap_alloc( len * sizeof (WCHAR) ); - if ( !str ) - return E_OUTOFMEMORY; - if (element->ns) - { - offset = MultiByteToWideChar( CP_UTF8, 0, (LPCSTR) element->ns->prefix, -1, str, len ); - str[offset - 1] = ':'; - } - MultiByteToWideChar( CP_UTF8, 0, (LPCSTR) element->name, -1, str + offset, len - offset ); - *p = SysAllocString( str ); - heap_free( str ); - - return S_OK; + prefix = element->ns ? element->ns->prefix : NULL; + qname = xmlBuildQName(element->name, prefix, NULL, 0); + + *p = bstr_from_xmlChar(qname); + if (qname != element->name) xmlFree(qname); + + return *p ? S_OK : E_OUTOFMEMORY; } static HRESULT WINAPI domelem_getAttribute(
14 years, 9 months
1
0
0
0
← Newer
1
...
69
70
71
72
73
74
75
...
90
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
Results per page:
10
25
50
100
200