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
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
April 2010
----- 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
22 participants
435 discussions
Start a n
N
ew thread
[fireball] 46957: - Sync localspl, mciavi32, mcicda, mciqtz32, mciseq, mciwave, mscoree, msctf, msgsm32.acm, mshtml to Wine-1.1.43.
by fireball@svn.reactos.org
Author: fireball Date: Tue Apr 20 19:16:57 2010 New Revision: 46957 URL:
http://svn.reactos.org/svn/reactos?rev=46957&view=rev
Log: - Sync localspl, mciavi32, mcicda, mciqtz32, mciseq, mciwave, mscoree, msctf, msgsm32.acm, mshtml to Wine-1.1.43. Added: trunk/reactos/dll/win32/msctf/displayattributemgr.c (with props) Modified: trunk/reactos/dll/win32/localspl/provider.c trunk/reactos/dll/win32/mciavi32/mciavi.c trunk/reactos/dll/win32/mcicda/mcicda.c trunk/reactos/dll/win32/mciqtz32/mciqtz.c trunk/reactos/dll/win32/mciqtz32/mciqtz_private.h trunk/reactos/dll/win32/mciseq/mcimidi.c trunk/reactos/dll/win32/mciwave/mciwave.c trunk/reactos/dll/win32/mscoree/mscoree.rbuild trunk/reactos/dll/win32/mscoree/mscoree_main.c trunk/reactos/dll/win32/mscoree/mscoree_private.h trunk/reactos/dll/win32/msctf/inputprocessor.c trunk/reactos/dll/win32/msctf/msctf.c trunk/reactos/dll/win32/msctf/msctf.rbuild trunk/reactos/dll/win32/msctf/msctf_internal.h trunk/reactos/dll/win32/msctf/regsvr.c trunk/reactos/dll/win32/msgsm32.acm/msgsm32.c trunk/reactos/dll/win32/mshtml/dispex.c trunk/reactos/dll/win32/mshtml/editor.c trunk/reactos/dll/win32/mshtml/htmlelem.c trunk/reactos/dll/win32/mshtml/htmlwindow.c trunk/reactos/dll/win32/mshtml/install.c trunk/reactos/dll/win32/mshtml/mshtml_private.h trunk/reactos/dll/win32/mshtml/navigate.c trunk/reactos/dll/win32/mshtml/nsembed.c trunk/reactos/dll/win32/mshtml/nsevents.c trunk/reactos/dll/win32/mshtml/nsio.c trunk/reactos/dll/win32/mshtml/olecmd.c trunk/reactos/dll/win32/mshtml/view.c Modified: trunk/reactos/dll/win32/localspl/provider.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/localspl/provide…
============================================================================== --- trunk/reactos/dll/win32/localspl/provider.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/localspl/provider.c [iso-8859-1] Tue Apr 20 19:16:57 2010 @@ -1375,7 +1375,7 @@ } /* Verified with the Adobe PS Driver, that w2k does not use di.Version */ - RegSetValueExW(hdrv, versionW, 0, REG_DWORD, (LPBYTE) &env->driverversion, + RegSetValueExW(hdrv, versionW, 0, REG_DWORD, (const BYTE*) &env->driverversion, sizeof(DWORD)); RegSetValueExW(hdrv, driverW, 0, REG_SZ, (LPBYTE) di.pDriverPath, @@ -1395,7 +1395,7 @@ RegSetValueExW(hdrv, help_fileW, 0, REG_SZ, (LPBYTE) di.pHelpFile, (lstrlenW(di.pHelpFile)+1)* sizeof(WCHAR)); else - RegSetValueExW(hdrv, help_fileW, 0, REG_SZ, (LPBYTE)emptyW, sizeof(emptyW)); + RegSetValueExW(hdrv, help_fileW, 0, REG_SZ, (const BYTE*)emptyW, sizeof(emptyW)); apd_copyfile(di.pHelpFile, &apd); @@ -1404,7 +1404,7 @@ RegSetValueExW(hdrv, dependent_filesW, 0, REG_MULTI_SZ, (LPBYTE) di.pDependentFiles, multi_sz_lenW(di.pDependentFiles)); else - RegSetValueExW(hdrv, dependent_filesW, 0, REG_MULTI_SZ, (LPBYTE)emptyW, sizeof(emptyW)); + RegSetValueExW(hdrv, dependent_filesW, 0, REG_MULTI_SZ, (const BYTE*)emptyW, sizeof(emptyW)); while ((ptr != NULL) && (ptr[0])) { if (apd_copyfile(ptr, &apd)) { ptr += lstrlenW(ptr) + 1; @@ -1420,20 +1420,20 @@ RegSetValueExW(hdrv, monitorW, 0, REG_SZ, (LPBYTE) di.pMonitorName, (lstrlenW(di.pMonitorName)+1)* sizeof(WCHAR)); else - RegSetValueExW(hdrv, monitorW, 0, REG_SZ, (LPBYTE)emptyW, sizeof(emptyW)); + RegSetValueExW(hdrv, monitorW, 0, REG_SZ, (const BYTE*)emptyW, sizeof(emptyW)); if (di.pDefaultDataType) RegSetValueExW(hdrv, datatypeW, 0, REG_SZ, (LPBYTE) di.pDefaultDataType, (lstrlenW(di.pDefaultDataType)+1)* sizeof(WCHAR)); else - RegSetValueExW(hdrv, datatypeW, 0, REG_SZ, (LPBYTE)emptyW, sizeof(emptyW)); + RegSetValueExW(hdrv, datatypeW, 0, REG_SZ, (const BYTE*)emptyW, sizeof(emptyW)); /* settings for level 4 */ if (di.pszzPreviousNames) RegSetValueExW(hdrv, previous_namesW, 0, REG_MULTI_SZ, (LPBYTE) di.pszzPreviousNames, multi_sz_lenW(di.pszzPreviousNames)); else - RegSetValueExW(hdrv, previous_namesW, 0, REG_MULTI_SZ, (LPBYTE)emptyW, sizeof(emptyW)); + RegSetValueExW(hdrv, previous_namesW, 0, REG_MULTI_SZ, (const BYTE*)emptyW, sizeof(emptyW)); if (level > 5) TRACE("level %u for Driver %s is incomplete\n", level, debugstr_w(di.pName)); Modified: trunk/reactos/dll/win32/mciavi32/mciavi.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mciavi32/mciavi.…
============================================================================== --- trunk/reactos/dll/win32/mciavi32/mciavi.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/mciavi32/mciavi.c [iso-8859-1] Tue Apr 20 19:16:57 2010 @@ -89,6 +89,7 @@ wma->hStopEvent = CreateEventW(NULL, FALSE, FALSE, NULL); wma->wDevID = modp->wDeviceID; wma->wCommandTable = mciLoadCommandResource(MCIAVI_hInstance, mciAviWStr, 0); + wma->dwStatus = MCI_MODE_NOT_READY; modp->wCustomCommandTable = wma->wCommandTable; modp->wType = MCI_DEVTYPE_DIGITAL_VIDEO; mciSetDriverData(wma->wDevID, (DWORD_PTR)wma); @@ -301,11 +302,11 @@ wma = MCIAVI_mciGetOpenDev(wDevID); if (wma == NULL) return MCIERR_INVALID_DEVICE_ID; + MCIAVI_mciStop(wDevID, MCI_WAIT, NULL); + EnterCriticalSection(&wma->cs); if (wma->nUseCount == 1) { - if (wma->dwStatus != MCI_MODE_STOP) - dwRet = MCIAVI_mciStop(wDevID, MCI_WAIT, NULL); MCIAVI_CleanUp(wma); if ((dwFlags & MCI_NOTIFY) && lpParms) { @@ -836,14 +837,14 @@ { WINE_MCIAVI *wma; - FIXME("(%04x, %08x, %p) : stub\n", wDevID, dwFlags, lpParms); - - if (lpParms == NULL) return MCIERR_NULL_PARAMETER_BLOCK; - - wma = MCIAVI_mciGetOpenDev(wDevID); - if (wma == NULL) return MCIERR_INVALID_DEVICE_ID; - - return MCIERR_UNSUPPORTED_FUNCTION; /* like w2k */ + if (lpParms == NULL) return MCIERR_NULL_PARAMETER_BLOCK; + + FIXME("(%04x, %08x, %p) Item %04x: stub\n", wDevID, dwFlags, lpParms, dwFlags & MCI_DGV_SETAUDIO_ITEM ? lpParms->dwItem : 0); + + wma = MCIAVI_mciGetOpenDev(wDevID); + if (wma == NULL) return MCIERR_INVALID_DEVICE_ID; + + return 0; } /****************************************************************************** @@ -870,14 +871,14 @@ { WINE_MCIAVI *wma; - FIXME("(%04x, %08x, %p) : stub\n", wDevID, dwFlags, lpParms); - - if (lpParms == NULL) return MCIERR_NULL_PARAMETER_BLOCK; - - wma = MCIAVI_mciGetOpenDev(wDevID); - if (wma == NULL) return MCIERR_INVALID_DEVICE_ID; - - return MCIERR_UNSUPPORTED_FUNCTION; /* like w2k */ + if (lpParms == NULL) return MCIERR_NULL_PARAMETER_BLOCK; + + FIXME("(%04x, %08x, %p) Item %04x: stub\n", wDevID, dwFlags, lpParms, dwFlags & MCI_DGV_SETVIDEO_ITEM ? lpParms->dwItem : 0); + + wma = MCIAVI_mciGetOpenDev(wDevID); + if (wma == NULL) return MCIERR_INVALID_DEVICE_ID; + + return 0; } /****************************************************************************** Modified: trunk/reactos/dll/win32/mcicda/mcicda.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mcicda/mcicda.c?…
============================================================================== --- trunk/reactos/dll/win32/mcicda/mcicda.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/mcicda/mcicda.c [iso-8859-1] Tue Apr 20 19:16:57 2010 @@ -420,7 +420,8 @@ if (dwFlags & MCI_OPEN_ELEMENT) { if (dwFlags & MCI_OPEN_ELEMENT_ID) { WARN("MCI_OPEN_ELEMENT_ID %p! Abort\n", lpOpenParms->lpstrElementName); - return MCIERR_NO_ELEMENT_ALLOWED; + ret = MCIERR_NO_ELEMENT_ALLOWED; + goto the_error; } TRACE("MCI_OPEN_ELEMENT element name: %s\n", debugstr_w(lpOpenParms->lpstrElementName)); if (!isalpha(lpOpenParms->lpstrElementName[0]) || lpOpenParms->lpstrElementName[1] != ':' || @@ -482,6 +483,8 @@ TRACE("(%04X, %08X, %p);\n", wDevID, dwParam, lpParms); if (wmcda == NULL) return MCIERR_INVALID_DEVICE_ID; + + MCICDA_Stop(wDevID, MCI_WAIT, NULL); if (--wmcda->nUseCount == 0) { CloseHandle(wmcda->handle); Modified: trunk/reactos/dll/win32/mciqtz32/mciqtz.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mciqtz32/mciqtz.…
============================================================================== --- trunk/reactos/dll/win32/mciqtz32/mciqtz.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/mciqtz32/mciqtz.c [iso-8859-1] Tue Apr 20 19:16:57 2010 @@ -153,7 +153,8 @@ MCIQTZ_mciStop(wDevID, MCI_WAIT, NULL); - CoInitializeEx(NULL, COINIT_MULTITHREADED); + hr = CoInitializeEx(NULL, COINIT_MULTITHREADED); + wma->uninit = SUCCEEDED(hr); hr = CoCreateInstance(&CLSID_FilterGraph, NULL, CLSCTX_INPROC_SERVER, &IID_IGraphBuilder, (LPVOID*)&wma->pgraph); if (FAILED(hr)) { @@ -197,7 +198,8 @@ IMediaControl_Release(wma->pmctrl); wma->pmctrl = NULL; - CoUninitialize(); + if (wma->uninit) + CoUninitialize(); return MCIERR_INTERNAL; } @@ -220,7 +222,8 @@ if (wma->opened) { IGraphBuilder_Release(wma->pgraph); IMediaControl_Release(wma->pmctrl); - CoUninitialize(); + if (wma->uninit) + CoUninitialize(); wma->opened = FALSE; } Modified: trunk/reactos/dll/win32/mciqtz32/mciqtz_private.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mciqtz32/mciqtz_…
============================================================================== --- trunk/reactos/dll/win32/mciqtz32/mciqtz_private.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/mciqtz32/mciqtz_private.h [iso-8859-1] Tue Apr 20 19:16:57 2010 @@ -28,6 +28,7 @@ typedef struct { MCIDEVICEID wDevID; BOOL opened; + BOOL uninit; IGraphBuilder* pgraph; IMediaControl* pmctrl; BOOL started; Modified: trunk/reactos/dll/win32/mciseq/mcimidi.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mciseq/mcimidi.c…
============================================================================== --- trunk/reactos/dll/win32/mciseq/mcimidi.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/mciseq/mcimidi.c [iso-8859-1] Tue Apr 20 19:16:57 2010 @@ -62,6 +62,7 @@ UINT wDevID; /* the MCI one */ HMIDI hMidi; int nUseCount; /* Incremented for each shared open */ + WORD wPort; /* the WINMM device unit */ WORD wNotifyDeviceID; /* MCI device ID with a pending notification */ HANDLE hCallback; /* Callback handle for pending notification */ HMMIO hFile; /* mmio file handle open as Element */ @@ -726,6 +727,7 @@ wmm->hFile = 0; wmm->hMidi = 0; + wmm->wPort = MIDI_MAPPER; wmm->lpstrElementName = NULL; dwDeviceID = lpParms->wDeviceID; @@ -962,8 +964,8 @@ MIDI_mciReadNextEvent(wmm, mmt); /* FIXME == 0 */ } - dwRet = midiOutOpen((LPHMIDIOUT)&wmm->hMidi, MIDIMAPPER, 0L, 0L, CALLBACK_NULL); - /* dwRet = midiInOpen(&wmm->hMidi, MIDIMAPPER, 0L, 0L, CALLBACK_NULL);*/ + dwRet = midiOutOpen((LPHMIDIOUT)&wmm->hMidi, wmm->wPort, 0L, 0L, CALLBACK_NULL); + /* dwRet = midiInOpen(&wmm->hMidi, wmm->wPort, 0L, 0L, CALLBACK_NULL);*/ if (dwRet != MMSYSERR_NOERROR) { return dwRet; } @@ -1290,7 +1292,7 @@ /************************************************************************** * MIDI_mciSet [internal] */ -static DWORD MIDI_mciSet(UINT wDevID, DWORD dwFlags, LPMCI_SET_PARMS lpParms) +static DWORD MIDI_mciSet(UINT wDevID, DWORD dwFlags, LPMCI_SEQ_SET_PARMS lpParms) { WINE_MCIMIDI* wmm = MIDI_mciGetOpenDev(wDevID); @@ -1359,8 +1361,15 @@ TRACE("MCI_SEQ_SET_SLAVE !\n"); if (dwFlags & MCI_SEQ_SET_OFFSET) TRACE("MCI_SEQ_SET_OFFSET !\n"); - if (dwFlags & MCI_SEQ_SET_PORT) - TRACE("MCI_SEQ_SET_PORT !\n"); + if (dwFlags & MCI_SEQ_SET_PORT) { + TRACE("MCI_SEQ_SET_PORT = %d\n", lpParms->dwPort); + if ((UINT16)lpParms->dwPort != (UINT16)MIDI_MAPPER && + (UINT16)lpParms->dwPort >= midiOutGetNumDevs()) + /* FIXME: input/output port distinction? */ + return MCIERR_SEQ_PORT_NONEXISTENT; + /* FIXME: Native manages to swap the device while playing! */ + wmm->wPort = lpParms->dwPort; + } if (dwFlags & MCI_SEQ_SET_TEMPO) TRACE("MCI_SEQ_SET_TEMPO !\n"); return 0; @@ -1459,8 +1468,13 @@ lpParms->dwReturn = 0; break; case MCI_SEQ_STATUS_PORT: - TRACE("MCI_SEQ_STATUS_PORT (%u)!\n", wmm->wDevID); - lpParms->dwReturn = MIDI_MAPPER; + if (wmm->wPort != (UINT16)MIDI_MAPPER) + lpParms->dwReturn = wmm->wPort; + else { + lpParms->dwReturn = MAKEMCIRESOURCE(MIDI_MAPPER, MCI_SEQ_MAPPER_S); + ret = MCI_RESOURCE_RETURNED; + } + TRACE("MCI_SEQ_STATUS_PORT (%u) => %d\n", wmm->wDevID, wmm->wPort); break; case MCI_SEQ_STATUS_TEMPO: TRACE("MCI_SEQ_STATUS_TEMPO !\n"); @@ -1664,7 +1678,7 @@ case MCI_PLAY: return MIDI_mciPlay (dwDevID, dwParam1, (LPMCI_PLAY_PARMS) dwParam2); case MCI_RECORD: return MIDI_mciRecord (dwDevID, dwParam1, (LPMCI_RECORD_PARMS) dwParam2); case MCI_STOP: return MIDI_mciStop (dwDevID, dwParam1, (LPMCI_GENERIC_PARMS) dwParam2); - case MCI_SET: return MIDI_mciSet (dwDevID, dwParam1, (LPMCI_SET_PARMS) dwParam2); + case MCI_SET: return MIDI_mciSet (dwDevID, dwParam1, (LPMCI_SEQ_SET_PARMS) dwParam2); case MCI_PAUSE: return MIDI_mciPause (dwDevID, dwParam1, (LPMCI_GENERIC_PARMS) dwParam2); case MCI_RESUME: return MIDI_mciResume (dwDevID, dwParam1, (LPMCI_GENERIC_PARMS) dwParam2); case MCI_STATUS: return MIDI_mciStatus (dwDevID, dwParam1, (LPMCI_STATUS_PARMS) dwParam2); Modified: trunk/reactos/dll/win32/mciwave/mciwave.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mciwave/mciwave.…
============================================================================== --- trunk/reactos/dll/win32/mciwave/mciwave.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/mciwave/mciwave.c [iso-8859-1] Tue Apr 20 19:16:57 2010 @@ -47,6 +47,8 @@ WAVEFORMATEX wfxRef; LPWAVEFORMATEX lpWaveFormat; /* Points to wfxRef until set by OPEN or RECORD */ BOOL fInput; /* FALSE = Output, TRUE = Input */ + WORD wInput; /* wave input device */ + WORD wOutput; /* wave output device */ volatile WORD dwStatus; /* one from MCI_MODE_xxxx */ DWORD dwMciTimeFormat;/* One of the supported MCI_FORMAT_xxxx */ DWORD dwPosition; /* position in bytes in chunk */ @@ -529,6 +531,7 @@ wmw->nUseCount++; + wmw->wInput = wmw->wOutput = WAVE_MAPPER; wmw->fInput = FALSE; wmw->hWave = 0; wmw->dwStatus = MCI_MODE_NOT_READY; @@ -831,8 +834,7 @@ */ mmioSeek(wmw->hFile, wmw->ckWaveData.dwDataOffset + wmw->dwPosition, SEEK_SET); /* >= 0 */ - /* FIXME: how to choose between several output channels ? here mapper is forced */ - dwRet = waveOutOpen((HWAVEOUT *)&wmw->hWave, WAVE_MAPPER, wmw->lpWaveFormat, + dwRet = waveOutOpen((HWAVEOUT *)&wmw->hWave, wmw->wOutput, wmw->lpWaveFormat, (DWORD_PTR)WAVE_mciPlayCallback, (DWORD_PTR)wmw, CALLBACK_FUNCTION); if (dwRet != 0) { @@ -1064,11 +1066,7 @@ */ mmioSeek(wmw->hFile, wmw->ckWaveData.dwDataOffset + wmw->dwPosition, SEEK_SET); /* >= 0 */ - /* By default the device will be opened for output, the MCI_CUE function is there to - * change from output to input and back - */ - /* FIXME: how to choose between several output channels ? here mapper is forced */ - dwRet = waveInOpen((HWAVEIN*)&wmw->hWave, WAVE_MAPPER, wmw->lpWaveFormat, + dwRet = waveInOpen((HWAVEIN*)&wmw->hWave, wmw->wInput, wmw->lpWaveFormat, (DWORD_PTR)WAVE_mciRecordCallback, (DWORD_PTR)wmw, CALLBACK_FUNCTION); if (dwRet != MMSYSERR_NOERROR) { @@ -1279,7 +1277,7 @@ /************************************************************************** * WAVE_mciSet [internal] */ -static DWORD WAVE_mciSet(MCIDEVICEID wDevID, DWORD dwFlags, LPMCI_SET_PARMS lpParms) +static DWORD WAVE_mciSet(MCIDEVICEID wDevID, DWORD dwFlags, LPMCI_WAVE_SET_PARMS lpParms) { WINE_MCIWAVE* wmw = WAVE_mciGetOpenDev(wDevID); @@ -1337,44 +1335,64 @@ default: WARN("Unknown audio channel %u\n", lpParms->dwAudio); break; } } - if (dwFlags & MCI_WAVE_INPUT) - TRACE("MCI_WAVE_INPUT !\n"); - if (dwFlags & MCI_WAVE_OUTPUT) - TRACE("MCI_WAVE_OUTPUT !\n"); - if (dwFlags & MCI_WAVE_SET_ANYINPUT) - TRACE("MCI_WAVE_SET_ANYINPUT !\n"); - if (dwFlags & MCI_WAVE_SET_ANYOUTPUT) - TRACE("MCI_WAVE_SET_ANYOUTPUT !\n"); + if (dwFlags & MCI_WAVE_INPUT) { + TRACE("MCI_WAVE_INPUT = %d\n", lpParms->wInput); + if (lpParms->wInput >= waveInGetNumDevs()) + return MCIERR_OUTOFRANGE; + if (wmw->wInput != (WORD)lpParms->wInput) + WAVE_mciStop(wDevID, MCI_WAIT, NULL); + wmw->wInput = lpParms->wInput; + } + if (dwFlags & MCI_WAVE_OUTPUT) { + TRACE("MCI_WAVE_OUTPUT = %d\n", lpParms->wOutput); + if (lpParms->wOutput >= waveOutGetNumDevs()) + return MCIERR_OUTOFRANGE; + if (wmw->wOutput != (WORD)lpParms->wOutput) + WAVE_mciStop(wDevID, MCI_WAIT, NULL); + wmw->wOutput = lpParms->wOutput; + } + if (dwFlags & MCI_WAVE_SET_ANYINPUT) { + TRACE("MCI_WAVE_SET_ANYINPUT\n"); + if (wmw->wInput != (WORD)lpParms->wInput) + WAVE_mciStop(wDevID, MCI_WAIT, NULL); + wmw->wInput = WAVE_MAPPER; + } + if (dwFlags & MCI_WAVE_SET_ANYOUTPUT) { + TRACE("MCI_WAVE_SET_ANYOUTPUT\n"); + if (wmw->wOutput != (WORD)lpParms->wOutput) + WAVE_mciStop(wDevID, MCI_WAIT, NULL); + wmw->wOutput = WAVE_MAPPER; + } /* Set wave format parameters is refused after Open or Record.*/ if (dwFlags & MCI_WAVE_SET_FORMATTAG) { - TRACE("MCI_WAVE_SET_FORMATTAG = %d\n", ((LPMCI_WAVE_SET_PARMS)lpParms)->wFormatTag); + TRACE("MCI_WAVE_SET_FORMATTAG = %d\n", lpParms->wFormatTag); if (wmw->lpWaveFormat != &wmw->wfxRef) return MCIERR_NONAPPLICABLE_FUNCTION; - if (((LPMCI_WAVE_SET_PARMS)lpParms)->wFormatTag != WAVE_FORMAT_PCM) + if (lpParms->wFormatTag != WAVE_FORMAT_PCM) return MCIERR_OUTOFRANGE; } if (dwFlags & MCI_WAVE_SET_AVGBYTESPERSEC) { if (wmw->lpWaveFormat != &wmw->wfxRef) return MCIERR_NONAPPLICABLE_FUNCTION; - wmw->wfxRef.nAvgBytesPerSec = ((LPMCI_WAVE_SET_PARMS)lpParms)->nAvgBytesPerSec; + wmw->wfxRef.nAvgBytesPerSec = lpParms->nAvgBytesPerSec; TRACE("MCI_WAVE_SET_AVGBYTESPERSEC = %d\n", wmw->wfxRef.nAvgBytesPerSec); } if (dwFlags & MCI_WAVE_SET_BITSPERSAMPLE) { if (wmw->lpWaveFormat != &wmw->wfxRef) return MCIERR_NONAPPLICABLE_FUNCTION; - wmw->wfxRef.wBitsPerSample = ((LPMCI_WAVE_SET_PARMS)lpParms)->wBitsPerSample; + wmw->wfxRef.wBitsPerSample = lpParms->wBitsPerSample; TRACE("MCI_WAVE_SET_BITSPERSAMPLE = %d\n", wmw->wfxRef.wBitsPerSample); } if (dwFlags & MCI_WAVE_SET_BLOCKALIGN) { if (wmw->lpWaveFormat != &wmw->wfxRef) return MCIERR_NONAPPLICABLE_FUNCTION; - wmw->wfxRef.nBlockAlign = ((LPMCI_WAVE_SET_PARMS)lpParms)->nBlockAlign; + wmw->wfxRef.nBlockAlign = lpParms->nBlockAlign; TRACE("MCI_WAVE_SET_BLOCKALIGN = %d\n", wmw->wfxRef.nBlockAlign); } if (dwFlags & MCI_WAVE_SET_CHANNELS) { if (wmw->lpWaveFormat != &wmw->wfxRef) return MCIERR_NONAPPLICABLE_FUNCTION; - wmw->wfxRef.nChannels = ((LPMCI_WAVE_SET_PARMS)lpParms)->nChannels; + wmw->wfxRef.nChannels = lpParms->nChannels; TRACE("MCI_WAVE_SET_CHANNELS = %d\n", wmw->wfxRef.nChannels); } if (dwFlags & MCI_WAVE_SET_SAMPLESPERSEC) { if (wmw->lpWaveFormat != &wmw->wfxRef) return MCIERR_NONAPPLICABLE_FUNCTION; - wmw->wfxRef.nSamplesPerSec = ((LPMCI_WAVE_SET_PARMS)lpParms)->nSamplesPerSec; + wmw->wfxRef.nSamplesPerSec = lpParms->nSamplesPerSec; TRACE("MCI_WAVE_SET_SAMPLESPERSEC = %d\n", wmw->wfxRef.nSamplesPerSec); } if (dwFlags & MCI_NOTIFY) @@ -1500,24 +1518,34 @@ ret = MCI_RESOURCE_RETURNED; break; case MCI_WAVE_INPUT: - TRACE("MCI_WAVE_INPUT !\n"); - lpParms->dwReturn = 0; - ret = MCIERR_WAVE_INPUTUNSPECIFIED; + if (wmw->wInput != (WORD)WAVE_MAPPER) + lpParms->dwReturn = wmw->wInput; + else { + lpParms->dwReturn = MAKEMCIRESOURCE(WAVE_MAPPER, WAVE_MAPPER_S); + ret = MCI_RESOURCE_RETURNED; + } + TRACE("MCI_WAVE_INPUT => %d\n", (signed)wmw->wInput); break; case MCI_WAVE_OUTPUT: - TRACE("MCI_WAVE_OUTPUT !\n"); - { - UINT id; - if (waveOutGetID(wmw->hWave, &id) == MMSYSERR_NOERROR) { - lpParms->dwReturn = id; - } else { - lpParms->dwReturn = 0; - ret = MCIERR_WAVE_OUTPUTUNSPECIFIED; - } + if (wmw->wOutput != (WORD)WAVE_MAPPER) + lpParms->dwReturn = wmw->wOutput; + else { + lpParms->dwReturn = MAKEMCIRESOURCE(WAVE_MAPPER, WAVE_MAPPER_S); + ret = MCI_RESOURCE_RETURNED; } + TRACE("MCI_WAVE_OUTPUT => %d\n", (signed)wmw->wOutput); break; /* It is always ok to query wave format parameters, * except on auto-open yield MCIERR_UNSUPPORTED_FUNCTION. */ + case MCI_WAVE_STATUS_FORMATTAG: + if (wmw->lpWaveFormat->wFormatTag != WAVE_FORMAT_PCM) + lpParms->dwReturn = wmw->lpWaveFormat->wFormatTag; + else { + lpParms->dwReturn = MAKEMCIRESOURCE(WAVE_FORMAT_PCM, WAVE_FORMAT_PCM_S); + ret = MCI_RESOURCE_RETURNED; + } + TRACE("MCI_WAVE_FORMATTAG => %lu\n", lpParms->dwReturn); + break; case MCI_WAVE_STATUS_AVGBYTESPERSEC: lpParms->dwReturn = wmw->lpWaveFormat->nAvgBytesPerSec; TRACE("MCI_WAVE_STATUS_AVGBYTESPERSEC => %lu\n", lpParms->dwReturn); @@ -1533,10 +1561,6 @@ case MCI_WAVE_STATUS_CHANNELS: lpParms->dwReturn = wmw->lpWaveFormat->nChannels; TRACE("MCI_WAVE_STATUS_CHANNELS => %lu\n", lpParms->dwReturn); - break; - case MCI_WAVE_STATUS_FORMATTAG: - lpParms->dwReturn = wmw->lpWaveFormat->wFormatTag; - TRACE("MCI_WAVE_FORMATTAG => %lu\n", lpParms->dwReturn); break; case MCI_WAVE_STATUS_SAMPLESPERSEC: lpParms->dwReturn = wmw->lpWaveFormat->nSamplesPerSec; @@ -1705,7 +1729,7 @@ case MCI_PLAY: return WAVE_mciPlay (dwDevID, dwParam1, dwParam2, NULL); case MCI_RECORD: return WAVE_mciRecord (dwDevID, dwParam1, dwParam2, NULL); case MCI_STOP: return WAVE_mciStop (dwDevID, dwParam1, (LPMCI_GENERIC_PARMS) dwParam2); - case MCI_SET: return WAVE_mciSet (dwDevID, dwParam1, (LPMCI_SET_PARMS) dwParam2); + case MCI_SET: return WAVE_mciSet (dwDevID, dwParam1, (LPMCI_WAVE_SET_PARMS) dwParam2); case MCI_PAUSE: return WAVE_mciPause (dwDevID, dwParam1, (LPMCI_GENERIC_PARMS) dwParam2); case MCI_RESUME: return WAVE_mciResume (dwDevID, dwParam1, (LPMCI_GENERIC_PARMS) dwParam2); case MCI_STATUS: return WAVE_mciStatus (dwDevID, dwParam1, (LPMCI_STATUS_PARMS) dwParam2); Modified: trunk/reactos/dll/win32/mscoree/mscoree.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mscoree/mscoree.…
============================================================================== --- trunk/reactos/dll/win32/mscoree/mscoree.rbuild [iso-8859-1] (original) +++ trunk/reactos/dll/win32/mscoree/mscoree.rbuild [iso-8859-1] Tue Apr 20 19:16:57 2010 @@ -5,6 +5,7 @@ <define name="__WINESRC__" /> <library>wine</library> <library>advapi32</library> + <library>shell32</library> <library>uuid</library> <file>corruntimehost.c</file> <file>mscoree_main.c</file> Modified: trunk/reactos/dll/win32/mscoree/mscoree_main.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mscoree/mscoree_…
============================================================================== --- trunk/reactos/dll/win32/mscoree/mscoree_main.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/mscoree/mscoree_main.c [iso-8859-1] Tue Apr 20 19:16:57 2010 @@ -21,11 +21,14 @@ #include <stdarg.h> +#include "wine/unicode.h" #include "windef.h" #include "winbase.h" #include "winuser.h" +#include "winnls.h" #include "winreg.h" #include "ole2.h" +#include "shellapi.h" #include "initguid.h" #include "cor.h" @@ -36,26 +39,25 @@ WINE_DEFAULT_DEBUG_CHANNEL( mscoree ); -static LPWSTR get_mono_exe(void) -{ - static const WCHAR mono_exe[] = {'b','i','n','\\','m','o','n','o','.','e','x','e',' ',0}; +static BOOL get_mono_path(LPWSTR path) +{ static const WCHAR mono_key[] = {'S','o','f','t','w','a','r','e','\\','N','o','v','e','l','l','\\','M','o','n','o',0}; static const WCHAR defaul_clr[] = {'D','e','f','a','u','l','t','C','L','R',0}; static const WCHAR install_root[] = {'S','d','k','I','n','s','t','a','l','l','R','o','o','t',0}; static const WCHAR slash[] = {'\\',0}; - WCHAR version[64], version_key[MAX_PATH], root[MAX_PATH], *ret; - DWORD len, size; + WCHAR version[64], version_key[MAX_PATH]; + DWORD len; HKEY key; if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, mono_key, 0, KEY_READ, &key)) - return NULL; + return FALSE; len = sizeof(version); if (RegQueryValueExW(key, defaul_clr, 0, NULL, (LPBYTE)version, &len)) { RegCloseKey(key); - return NULL; + return FALSE; } RegCloseKey(key); @@ -64,24 +66,129 @@ lstrcatW(version_key, version); if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, version_key, 0, KEY_READ, &key)) - return NULL; - - len = sizeof(root); - if (RegQueryValueExW(key, install_root, 0, NULL, (LPBYTE)root, &len)) + return FALSE; + + len = sizeof(WCHAR) * MAX_PATH; + if (RegQueryValueExW(key, install_root, 0, NULL, (LPBYTE)path, &len)) { RegCloseKey(key); - return NULL; + return FALSE; } RegCloseKey(key); - size = len + sizeof(slash) + sizeof(mono_exe); - if (!(ret = HeapAlloc(GetProcessHeap(), 0, size))) return NULL; - - lstrcpyW(ret, root); - lstrcatW(ret, slash); - lstrcatW(ret, mono_exe); - - return ret; + return TRUE; +} + +static CRITICAL_SECTION mono_lib_cs; +static CRITICAL_SECTION_DEBUG mono_lib_cs_debug = +{ + 0, 0, &mono_lib_cs, + { &mono_lib_cs_debug.ProcessLocksList, + &mono_lib_cs_debug.ProcessLocksList }, + 0, 0, { (DWORD_PTR)(__FILE__ ": mono_lib_cs") } +}; +static CRITICAL_SECTION mono_lib_cs = { &mono_lib_cs_debug, -1, 0, 0, 0, 0 }; + +HMODULE mono_handle; + +void (*mono_config_parse)(const char *filename); +MonoAssembly* (*mono_domain_assembly_open) (MonoDomain *domain, const char *name); +void (*mono_jit_cleanup)(MonoDomain *domain); +int (*mono_jit_exec)(MonoDomain *domain, MonoAssembly *assembly, int argc, char *argv[]); +MonoDomain* (*mono_jit_init)(const char *file); +int (*mono_jit_set_trace_options)(const char* options); +void (*mono_set_dirs)(const char *assembly_dir, const char *config_dir); + +static void set_environment(LPCWSTR bin_path) +{ + WCHAR path_env[MAX_PATH]; + int len; + + static const WCHAR pathW[] = {'P','A','T','H',0}; + + /* We have to modify PATH as Mono loads other DLLs from this directory. */ + GetEnvironmentVariableW(pathW, path_env, sizeof(path_env)/sizeof(WCHAR)); + len = strlenW(path_env); + path_env[len++] = ';'; + strcpyW(path_env+len, bin_path); + SetEnvironmentVariableW(pathW, path_env); +} + +static HMODULE load_mono(void) +{ + static const WCHAR mono_dll[] = {'\\','b','i','n','\\','m','o','n','o','.','d','l','l',0}; + static const WCHAR libmono_dll[] = {'\\','b','i','n','\\','l','i','b','m','o','n','o','.','d','l','l',0}; + static const WCHAR bin[] = {'\\','b','i','n',0}; + static const WCHAR lib[] = {'\\','l','i','b',0}; + static const WCHAR etc[] = {'\\','e','t','c',0}; + HMODULE result; + WCHAR mono_path[MAX_PATH], mono_dll_path[MAX_PATH+16], mono_bin_path[MAX_PATH+4]; + WCHAR mono_lib_path[MAX_PATH+4], mono_etc_path[MAX_PATH+4]; + char mono_lib_path_a[MAX_PATH], mono_etc_path_a[MAX_PATH]; + + EnterCriticalSection(&mono_lib_cs); + + if (!mono_handle) + { + if (!get_mono_path(mono_path)) goto end; + + strcpyW(mono_bin_path, mono_path); + strcatW(mono_bin_path, bin); + set_environment(mono_bin_path); + + strcpyW(mono_lib_path, mono_path); + strcatW(mono_lib_path, lib); + WideCharToMultiByte(CP_UTF8, 0, mono_lib_path, -1, mono_lib_path_a, MAX_PATH, NULL, NULL); + + strcpyW(mono_etc_path, mono_path); + strcatW(mono_etc_path, etc); + WideCharToMultiByte(CP_UTF8, 0, mono_etc_path, -1, mono_etc_path_a, MAX_PATH, NULL, NULL); + + strcpyW(mono_dll_path, mono_path); + strcatW(mono_dll_path, mono_dll); + mono_handle = LoadLibraryW(mono_dll_path); + + if (!mono_handle) + { + strcpyW(mono_dll_path, mono_path); + strcatW(mono_dll_path, libmono_dll); + mono_handle = LoadLibraryW(mono_dll_path); + } + + if (!mono_handle) goto end; + +#define LOAD_MONO_FUNCTION(x) do { \ + x = (void*)GetProcAddress(mono_handle, #x); \ + if (!x) { \ + mono_handle = NULL; \ + goto end; \ + } \ +} while (0); + + LOAD_MONO_FUNCTION(mono_config_parse); + LOAD_MONO_FUNCTION(mono_domain_assembly_open); + LOAD_MONO_FUNCTION(mono_jit_cleanup); + LOAD_MONO_FUNCTION(mono_jit_exec); + LOAD_MONO_FUNCTION(mono_jit_init); + LOAD_MONO_FUNCTION(mono_jit_set_trace_options); + LOAD_MONO_FUNCTION(mono_set_dirs); + +#undef LOAD_MONO_FUNCTION + + mono_set_dirs(mono_lib_path_a, mono_etc_path_a); + + mono_config_parse(NULL); + } + +end: + result = mono_handle; + + LeaveCriticalSection(&mono_lib_cs); + + if (!result) + MESSAGE("wine: Install the Windows version of Mono to run .NET executables\n"); + + return result; } HRESULT WINAPI CorBindToRuntimeHost(LPCWSTR pwszVersion, LPCWSTR pwszBuildFlavor, @@ -89,19 +196,15 @@ DWORD startupFlags, REFCLSID rclsid, REFIID riid, LPVOID *ppv) { - WCHAR *mono_exe; - FIXME("(%s, %s, %s, %p, %d, %s, %s, %p): semi-stub!\n", debugstr_w(pwszVersion), debugstr_w(pwszBuildFlavor), debugstr_w(pwszHostConfigFile), pReserved, startupFlags, debugstr_guid(rclsid), debugstr_guid(riid), ppv); - if (!(mono_exe = get_mono_exe())) + if (!get_mono_path(NULL)) { MESSAGE("wine: Install the Windows version of Mono to run .NET executables\n"); return E_FAIL; } - - HeapFree(GetProcessHeap(), 0, mono_exe); return S_OK; } @@ -138,68 +241,73 @@ return TRUE; } +static void get_utf8_args(int *argc, char ***argv) +{ + WCHAR **argvw; + int size=0, i; + char *current_arg; + + argvw = CommandLineToArgvW(GetCommandLineW(), argc); + + for (i=0; i<*argc; i++) + { + size += sizeof(char*); + size += WideCharToMultiByte(CP_UTF8, 0, argvw[i], -1, NULL, 0, NULL, NULL); + } + size += sizeof(char*); + + *argv = HeapAlloc(GetProcessHeap(), 0, size); + current_arg = (char*)(*argv + *argc + 1); + + for (i=0; i<*argc; i++) + { + (*argv)[i] = current_arg; + current_arg += WideCharToMultiByte(CP_UTF8, 0, argvw[i], -1, current_arg, size, NULL, NULL); + } + + (*argv)[*argc] = NULL; + + HeapFree(GetProcessHeap(), 0, argvw); +} + __int32 WINAPI _CorExeMain(void) { - STARTUPINFOW si; - PROCESS_INFORMATION pi; - WCHAR *mono_exe, *cmd_line; - DWORD size, exit_code; - static const WCHAR WINE_MONO_TRACE[]={'W','I','N','E','_','M','O','N','O','_','T','R','A','C','E',0}; - static const WCHAR trace_switch_start[]={'"','-','-','t','r','a','c','e','=',0}; - static const WCHAR trace_switch_end[]={'"',' ',0}; + int exit_code; int trace_size; - WCHAR trace_setting[256]; - - if (!(mono_exe = get_mono_exe())) - { - MESSAGE("install the Windows version of Mono to run .NET executables\n"); + char trace_setting[256]; + int argc; + char **argv; + MonoDomain *domain; + MonoAssembly *assembly; + char filename[MAX_PATH]; + + if (!load_mono()) + { return -1; } - trace_size = GetEnvironmentVariableW(WINE_MONO_TRACE, trace_setting, sizeof(trace_setting)/sizeof(WCHAR)); - - size = (lstrlenW(mono_exe) + lstrlenW(GetCommandLineW()) + 1) * sizeof(WCHAR); + get_utf8_args(&argc, &argv); + + trace_size = GetEnvironmentVariableA("WINE_MONO_TRACE", trace_setting, sizeof(trace_setting)); if (trace_size) - size += (trace_size + lstrlenW(trace_switch_start) + lstrlenW(trace_switch_end)) * sizeof(WCHAR); - - if (!(cmd_line = HeapAlloc(GetProcessHeap(), 0, size))) - { - HeapFree(GetProcessHeap(), 0, mono_exe); - return -1; - } - - lstrcpyW(cmd_line, mono_exe); - HeapFree(GetProcessHeap(), 0, mono_exe); - - if (trace_size) - { - lstrcatW(cmd_line, trace_switch_start); - lstrcatW(cmd_line, trace_setting); - lstrcatW(cmd_line, trace_switch_end); - } - - lstrcatW(cmd_line, GetCommandLineW()); - - TRACE("new command line: %s\n", debugstr_w(cmd_line)); - - memset(&si, 0, sizeof(si)); - si.cb = sizeof(si); - if (!CreateProcessW(NULL, cmd_line, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi)) - { - HeapFree(GetProcessHeap(), 0, cmd_line); - return -1; - } - HeapFree(GetProcessHeap(), 0, cmd_line); - - /* wait for the process to exit */ - WaitForSingleObject(pi.hProcess, INFINITE); - GetExitCodeProcess(pi.hProcess, &exit_code); - - CloseHandle(pi.hThread); - CloseHandle(pi.hProcess); - - return (int)exit_code; + { + mono_jit_set_trace_options(trace_setting); + } + + GetModuleFileNameA(NULL, filename, MAX_PATH); + + domain = mono_jit_init(filename); + + assembly = mono_domain_assembly_open(domain, filename); + + exit_code = mono_jit_exec(domain, assembly, argc, argv); + + mono_jit_cleanup(domain); + + HeapFree(GetProcessHeap(), 0, argv); + + return exit_code; } __int32 WINAPI _CorExeMain2(PBYTE ptrMemory, DWORD cntMemory, LPWSTR imageName, LPWSTR loaderName, LPWSTR cmdLine) Modified: trunk/reactos/dll/win32/mscoree/mscoree_private.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mscoree/mscoree_…
============================================================================== --- trunk/reactos/dll/win32/mscoree/mscoree_private.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/mscoree/mscoree_private.h [iso-8859-1] Tue Apr 20 19:16:57 2010 @@ -22,5 +22,18 @@ extern IUnknown* create_corruntimehost(void); +/* Mono 2.6 embedding */ +typedef struct _MonoDomain MonoDomain; +typedef struct _MonoAssembly MonoAssembly; + +extern HMODULE mono_handle; + +extern void (*mono_config_parse)(const char *filename); +extern MonoAssembly* (*mono_domain_assembly_open) (MonoDomain *domain, const char *name); +extern void (*mono_jit_cleanup)(MonoDomain *domain); +extern int (*mono_jit_exec)(MonoDomain *domain, MonoAssembly *assembly, int argc, char *argv[]); +extern MonoDomain* (*mono_jit_init)(const char *file); +extern int (*mono_jit_set_trace_options)(const char* options); +extern void (*mono_set_dirs)(const char *assembly_dir, const char *config_dir); #endif /* __MSCOREE_PRIVATE__ */ Added: trunk/reactos/dll/win32/msctf/displayattributemgr.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msctf/displayatt…
============================================================================== --- trunk/reactos/dll/win32/msctf/displayattributemgr.c (added) +++ trunk/reactos/dll/win32/msctf/displayattributemgr.c [iso-8859-1] Tue Apr 20 19:16:57 2010 @@ -1,0 +1,139 @@ +/* + * ITfDisplayAttributeMgr implementation + * + * Copyright 2010 CodeWeavers, Aric Stewart + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#define COBJMACROS + +#include "wine/debug.h" +#include "winbase.h" +#include "winreg.h" +#include "shlwapi.h" + +#include "msctf.h" +#include "msctf_internal.h" + +WINE_DEFAULT_DEBUG_CHANNEL(msctf); + +typedef struct tagDisplayAttributeMgr { + const ITfDisplayAttributeMgrVtbl *DisplayAttributeMgrVtbl; + + LONG refCount; + +} DisplayAttributeMgr; + +static void DisplayAttributeMgr_Destructor(DisplayAttributeMgr *This) +{ + TRACE("destroying %p\n", This); + + HeapFree(GetProcessHeap(),0,This); +} + +static HRESULT WINAPI DisplayAttributeMgr_QueryInterface(ITfDisplayAttributeMgr *iface, REFIID iid, LPVOID *ppvOut) +{ + DisplayAttributeMgr *This = (DisplayAttributeMgr *)iface; + *ppvOut = NULL; + + if (IsEqualIID(iid, &IID_IUnknown) || IsEqualIID(iid, &IID_ITfDisplayAttributeMgr)) + { + *ppvOut = This; + } + + if (*ppvOut) + { + IUnknown_AddRef(iface); + return S_OK; + } + + WARN("unsupported interface: %s\n", debugstr_guid(iid)); + return E_NOINTERFACE; +} + +static ULONG WINAPI DisplayAttributeMgr_AddRef(ITfDisplayAttributeMgr *iface) +{ + DisplayAttributeMgr *This = (DisplayAttributeMgr *)iface; + return InterlockedIncrement(&This->refCount); +} + +static ULONG WINAPI DisplayAttributeMgr_Release(ITfDisplayAttributeMgr *iface) +{ + DisplayAttributeMgr *This = (DisplayAttributeMgr *)iface; + ULONG ret; + + ret = InterlockedDecrement(&This->refCount); + if (ret == 0) + DisplayAttributeMgr_Destructor(This); + return ret; +} + +/***************************************************** + * ITfDisplayAttributeMgr functions + *****************************************************/ + +static HRESULT WINAPI DisplayAttributeMgr_OnUpdateInfo(ITfDisplayAttributeMgr *iface) +{ + DisplayAttributeMgr *This = (DisplayAttributeMgr *)iface; + + FIXME("STUB:(%p)\n",This); + return E_NOTIMPL; +} + +static HRESULT WINAPI DisplayAttributeMgr_EnumDisplayAttributeInfo(ITfDisplayAttributeMgr *iface, IEnumTfDisplayAttributeInfo **ppEnum) +{ + DisplayAttributeMgr *This = (DisplayAttributeMgr *)iface; + + FIXME("STUB:(%p)\n",This); + return E_NOTIMPL; +} + +static HRESULT WINAPI DisplayAttributeMgr_GetDisplayAttributeInfo(ITfDisplayAttributeMgr *iface, REFGUID guid, ITfDisplayAttributeInfo **ppInfo, CLSID *pclsidOwner) +{ + DisplayAttributeMgr *This = (DisplayAttributeMgr *)iface; + + FIXME("STUB:(%p)\n",This); + return E_NOTIMPL; +} + +static const ITfDisplayAttributeMgrVtbl DisplayAttributeMgr_DisplayAttributeMgrVtbl = +{ + DisplayAttributeMgr_QueryInterface, + DisplayAttributeMgr_AddRef, + DisplayAttributeMgr_Release, + + DisplayAttributeMgr_OnUpdateInfo, + DisplayAttributeMgr_EnumDisplayAttributeInfo, + DisplayAttributeMgr_GetDisplayAttributeInfo +}; + +HRESULT DisplayAttributeMgr_Constructor(IUnknown *pUnkOuter, IUnknown **ppOut) +{ + DisplayAttributeMgr *This; + if (pUnkOuter) + return CLASS_E_NOAGGREGATION; + + This = HeapAlloc(GetProcessHeap(),0,sizeof(DisplayAttributeMgr)); + if (This == NULL) + return E_OUTOFMEMORY; + + This->DisplayAttributeMgrVtbl= &DisplayAttributeMgr_DisplayAttributeMgrVtbl; + This->refCount = 1; + + TRACE("returning %p\n", This); + *ppOut = (IUnknown *)This; + return S_OK; +} Propchange: trunk/reactos/dll/win32/msctf/displayattributemgr.c ------------------------------------------------------------------------------ svn:eol-style = native Modified: trunk/reactos/dll/win32/msctf/inputprocessor.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msctf/inputproce…
============================================================================== --- trunk/reactos/dll/win32/msctf/inputprocessor.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msctf/inputprocessor.c [iso-8859-1] Tue Apr 20 19:16:57 2010 @@ -279,8 +279,8 @@ if (!res) { DWORD zero = 0x0; - RegSetValueExW(fmtkey, desc, 0, REG_SZ, (LPBYTE)pchDesc, cchDesc * sizeof(WCHAR)); - RegSetValueExW(fmtkey, icnf, 0, REG_SZ, (LPBYTE)pchIconFile, cchFile * sizeof(WCHAR)); + RegSetValueExW(fmtkey, desc, 0, REG_SZ, (const BYTE*)pchDesc, cchDesc * sizeof(WCHAR)); + RegSetValueExW(fmtkey, icnf, 0, REG_SZ, (const BYTE*)pchIconFile, cchFile * sizeof(WCHAR)); RegSetValueExW(fmtkey, icni, 0, REG_DWORD, (LPBYTE)&uIconIndex, sizeof(DWORD)); if (disposition == REG_CREATED_NEW_KEY) RegSetValueExW(fmtkey, szwEnable, 0, REG_DWORD, (LPBYTE)&zero, sizeof(DWORD)); Modified: trunk/reactos/dll/win32/msctf/msctf.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msctf/msctf.c?re…
============================================================================== --- trunk/reactos/dll/win32/msctf/msctf.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msctf/msctf.c [iso-8859-1] Tue Apr 20 19:16:57 2010 @@ -88,6 +88,7 @@ {&CLSID_TF_InputProcessorProfiles, InputProcessorProfiles_Constructor}, {&CLSID_TF_CategoryMgr, CategoryMgr_Constructor}, {&CLSID_TF_LangBarMgr, LangBarMgr_Constructor}, + {&CLSID_TF_DisplayAttributeMgr, DisplayAttributeMgr_Constructor}, {NULL, NULL} }; Modified: trunk/reactos/dll/win32/msctf/msctf.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msctf/msctf.rbui…
============================================================================== --- trunk/reactos/dll/win32/msctf/msctf.rbuild [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msctf/msctf.rbuild [iso-8859-1] Tue Apr 20 19:16:57 2010 @@ -11,6 +11,7 @@ <file>categorymgr.c</file> <file>compartmentmgr.c</file> <file>context.c</file> + <file>displayattributemgr.c</file> <file>documentmgr.c</file> <file>inputprocessor.c</file> <file>langbarmgr.c</file> Modified: trunk/reactos/dll/win32/msctf/msctf_internal.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msctf/msctf_inte…
============================================================================== --- trunk/reactos/dll/win32/msctf/msctf_internal.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msctf/msctf_internal.h [iso-8859-1] Tue Apr 20 19:16:57 2010 @@ -41,6 +41,7 @@ extern HRESULT CompartmentMgr_Constructor(IUnknown *pUnkOuter, REFIID riid, IUnknown **ppOut); extern HRESULT CompartmentMgr_Destructor(ITfCompartmentMgr *This); extern HRESULT LangBarMgr_Constructor(IUnknown *pUnkOuter, IUnknown **ppOut); +extern HRESULT DisplayAttributeMgr_Constructor(IUnknown *pUnkOuter, IUnknown **ppOut); extern HRESULT Context_Initialize(ITfContext *cxt, ITfDocumentMgr *manager); extern HRESULT Context_Uninitialize(ITfContext *cxt); Modified: trunk/reactos/dll/win32/msctf/regsvr.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msctf/regsvr.c?r…
============================================================================== --- trunk/reactos/dll/win32/msctf/regsvr.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msctf/regsvr.c [iso-8859-1] Tue Apr 20 19:16:57 2010 @@ -469,6 +469,13 @@ "msctf.dll", "Apartment" }, + { + &CLSID_TF_DisplayAttributeMgr, + "TF_DisplayAttributeMgr", + NULL, + "msctf.dll", + "Apartment" + }, { NULL } /* list terminator */ }; Modified: trunk/reactos/dll/win32/msgsm32.acm/msgsm32.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msgsm32.acm/msgs…
============================================================================== --- trunk/reactos/dll/win32/msgsm32.acm/msgsm32.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msgsm32.acm/msgsm32.c [iso-8859-1] Tue Apr 20 19:16:57 2010 @@ -179,10 +179,10 @@ WARN("GSM nBlockAlign %u\n", wfx->nBlockAlign); return 0; } - if (((GSM610WAVEFORMAT*)wfx)->wSamplesPerBlock != 320) + if (((const GSM610WAVEFORMAT*)wfx)->wSamplesPerBlock != 320) { WARN("GSM wSamplesPerBlock %u\n", - ((GSM610WAVEFORMAT*)wfx)->wSamplesPerBlock); + ((const GSM610WAVEFORMAT*)wfx)->wSamplesPerBlock); return 0; } if (wfx->nAvgBytesPerSec != wfx->nSamplesPerSec * 65 / 320) Modified: trunk/reactos/dll/win32/mshtml/dispex.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mshtml/dispex.c?…
============================================================================== --- trunk/reactos/dll/win32/mshtml/dispex.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/mshtml/dispex.c [iso-8859-1] Tue Apr 20 19:16:57 2010 @@ -52,7 +52,10 @@ typedef struct { VARIANT var; LPWSTR name; + DWORD flags; } dynamic_prop_t; + +#define DYNPROP_DELETED 0x01 typedef struct { DispatchEx dispex; @@ -245,12 +248,12 @@ static int dispid_cmp(const void *p1, const void *p2) { - return ((func_info_t*)p1)->id - ((func_info_t*)p2)->id; + return ((const func_info_t*)p1)->id - ((const func_info_t*)p2)->id; } static int func_name_cmp(const void *p1, const void *p2) { - return strcmpiW((*(func_info_t**)p1)->name, (*(func_info_t**)p2)->name); + return strcmpiW((*(func_info_t* const*)p1)->name, (*(func_info_t* const*)p2)->name); } static dispex_data_t *preprocess_dispex_data(DispatchEx *This) @@ -319,7 +322,7 @@ static int id_cmp(const void *p1, const void *p2) { - return *(DISPID*)p1 - *(DISPID*)p2; + return *(const DISPID*)p1 - *(const DISPID*)p2; } HRESULT get_dispids(tid_t tid, DWORD *ret_size, DISPID **ret) @@ -442,7 +445,7 @@ { const BOOL alloc = flags & fdexNameEnsure; dispex_dynamic_data_t *data; - unsigned i; + dynamic_prop_t *prop; data = get_dynamic_data(This, alloc); if(!data) { @@ -453,9 +456,14 @@ return DISP_E_UNKNOWNNAME; } - for(i=0; i < data->prop_cnt; i++) { - if(flags & fdexNameCaseInsensitive ? !strcmpiW(data->props[i].name, name) : !strcmpW(data->props[i].name, name)) { - *ret = data->props+i; + for(prop = data->props; prop < data->props+data->prop_cnt; prop++) { + if(flags & fdexNameCaseInsensitive ? !strcmpiW(prop->name, name) : !strcmpW(prop->name, name)) { + if(prop->flags & DYNPROP_DELETED) { + if(!alloc) + return DISP_E_UNKNOWNNAME; + prop->flags &= ~DYNPROP_DELETED; + } + *ret = prop; return S_OK; } } @@ -481,10 +489,16 @@ data->buf_size <<= 1; } - data->props[data->prop_cnt].name = heap_strdupW(name); - VariantInit(&data->props[data->prop_cnt].var); - *ret = data->props + data->prop_cnt++; - + prop = data->props + data->prop_cnt; + + prop->name = heap_strdupW(name); + if(!prop->name) + return E_OUTOFMEMORY; + + VariantInit(&prop->var); + prop->flags = 0; + data->prop_cnt++; + *ret = prop; return S_OK; } @@ -729,6 +743,109 @@ return DISP_E_UNKNOWNNAME; } +static HRESULT get_builtin_id(DispatchEx *This, BSTR name, DWORD grfdex, DISPID *ret) +{ + dispex_data_t *data; + int min, max, n, c; + + data = get_dispex_data(This); + if(!data) + return E_FAIL; + + min = 0; + max = data->func_cnt-1; + + while(min <= max) { + n = (min+max)/2; + + c = strcmpiW(data->name_table[n]->name, name); + if(!c) { + if((grfdex & fdexNameCaseSensitive) && strcmpW(data->name_table[n]->name, name)) + break; + + *ret = data->name_table[n]->id; + return S_OK; + } + + if(c > 0) + max = n-1; + else + min = n+1; + } + + if(This->data->vtbl && This->data->vtbl->get_dispid) { + HRESULT hres; + + hres = This->data->vtbl->get_dispid(This->outer, name, grfdex, ret); + if(hres != DISP_E_UNKNOWNNAME) + return hres; + } + + return DISP_E_UNKNOWNNAME; +} + +static HRESULT invoke_builtin_prop(DispatchEx *This, DISPID id, LCID lcid, WORD flags, DISPPARAMS *dp, + VARIANT *res, EXCEPINFO *ei, IServiceProvider *caller) +{ + dispex_data_t *data; + func_info_t *func; + HRESULT hres; + + data = get_dispex_data(This); + if(!data) + return E_FAIL; + + hres = get_builtin_func(data, id, &func); + if(id == DISPID_VALUE && hres == DISP_E_UNKNOWNNAME) + return dispex_value(This, lcid, flags, dp, res, ei, caller); + if(FAILED(hres)) + return hres; + + if(func->func_disp_idx == -1) + hres = typeinfo_invoke(This, func, flags, dp, res, ei); + else + hres = function_invoke(This, func, flags, dp, res, ei); + + return hres; +} + +HRESULT remove_prop(DispatchEx *This, BSTR name, VARIANT_BOOL *success) +{ + dynamic_prop_t *prop; + DISPID id; + HRESULT hres; + + hres = get_builtin_id(This, name, 0, &id); + if(hres == S_OK) { + DISPID named_id = DISPID_PROPERTYPUT; + VARIANT var; + DISPPARAMS dp = {&var,&named_id,1,1}; + EXCEPINFO ei; + + V_VT(&var) = VT_EMPTY; + memset(&ei, 0, sizeof(ei)); + hres = invoke_builtin_prop(This, id, 0, DISPATCH_PROPERTYPUT, &dp, NULL, &ei, NULL); + if(FAILED(hres)) + return hres; + + *success = VARIANT_TRUE; + return S_OK; + } + + hres = get_dynamic_prop(This, name, 0, &prop); + if(FAILED(hres)) { + if(hres != DISP_E_UNKNOWNNAME) + return hres; + *success = VARIANT_FALSE; + return S_OK; + } + + VariantClear(&prop->var); + prop->flags |= DYNPROP_DELETED; + *success = VARIANT_TRUE; + return S_OK; +} + #define DISPATCHEX_THIS(iface) DEFINE_THIS(DispatchEx, IDispatchEx, iface) static HRESULT WINAPI DispatchEx_QueryInterface(IDispatchEx *iface, REFIID riid, void **ppv) @@ -815,8 +932,6 @@ { DispatchEx *This = DISPATCHEX_THIS(iface); dynamic_prop_t *dprop; - dispex_data_t *data; - int min, max, n, c; HRESULT hres; TRACE("(%p)->(%s %x %p)\n", This, debugstr_w(bstrName), grfdex, pid); @@ -824,38 +939,9 @@ if(grfdex & ~(fdexNameCaseSensitive|fdexNameCaseInsensitive|fdexNameEnsure|fdexNameImplicit|FDEX_VERSION_MASK)) FIXME("Unsupported grfdex %x\n", grfdex); - data = get_dispex_data(This); - if(!data) - return E_FAIL; - - min = 0; - max = data->func_cnt-1; - - while(min <= max) { - n = (min+max)/2; - - c = strcmpiW(data->name_table[n]->name, bstrName); - if(!c) { - if((grfdex & fdexNameCaseSensitive) && strcmpW(data->name_table[n]->name, bstrName)) - break; - - *pid = data->name_table[n]->id; - return S_OK; - } - - if(c > 0) - max = n-1; - else - min = n+1; - } - - if(This->data->vtbl && This->data->vtbl->get_dispid) { - HRESULT hres; - - hres = This->data->vtbl->get_dispid(This->outer, bstrName, grfdex, pid); - if(hres != DISP_E_UNKNOWNNAME) - return hres; - } + hres = get_builtin_id(This, bstrName, grfdex, pid); + if(hres != DISP_E_UNKNOWNNAME) + return hres; hres = get_dynamic_prop(This, bstrName, grfdex, &dprop); if(FAILED(hres)) @@ -869,8 +955,6 @@ VARIANT *pvarRes, EXCEPINFO *pei, IServiceProvider *pspCaller) { DispatchEx *This = DISPATCHEX_THIS(iface); - dispex_data_t *data; - func_info_t *func; HRESULT hres; TRACE("(%p)->(%x %x %x %p %p %p %p)\n", This, id, lcid, wFlags, pdp, pvarRes, pei, pspCaller); @@ -893,12 +977,12 @@ if(is_dynamic_dispid(id)) { DWORD idx = id - DISPID_DYNPROP_0; - VARIANT *var; + dynamic_prop_t *prop; if(!This->dynamic_data || This->dynamic_data->prop_cnt <= idx) return DISP_E_UNKNOWNNAME; - var = &This->dynamic_data->props[idx].var; + prop = This->dynamic_data->props+idx; switch(wFlags) { case DISPATCH_METHOD|DISPATCH_PROPERTYGET: @@ -909,8 +993,8 @@ DISPPARAMS dp = {NULL, &named_arg, 0, 1}; IDispatchEx *dispex; - if(V_VT(var) != VT_DISPATCH) { - FIXME("invoke vt %d\n", V_VT(var)); + if(V_VT(&prop->var) != VT_DISPATCH) { + FIXME("invoke %s\n", debugstr_variant(&prop->var)); return E_NOTIMPL; } @@ -929,14 +1013,14 @@ V_VT(dp.rgvarg) = VT_DISPATCH; V_DISPATCH(dp.rgvarg) = (IDispatch*)DISPATCHEX(This); - hres = IDispatch_QueryInterface(V_DISPATCH(var), &IID_IDispatchEx, (void**)&dispex); + hres = IDispatch_QueryInterface(V_DISPATCH(&prop->var), &IID_IDispatchEx, (void**)&dispex); TRACE("%s call\n", debugstr_w(This->dynamic_data->props[idx].name)); if(SUCCEEDED(hres)) { hres = IDispatchEx_InvokeEx(dispex, DISPID_VALUE, lcid, wFlags, &dp, pvarRes, pei, pspCaller); IDispatchEx_Release(dispex); }else { ULONG err = 0; - hres = IDispatch_Invoke(V_DISPATCH(var), DISPID_VALUE, &IID_NULL, lcid, wFlags, pdp, pvarRes, pei, &err); + hres = IDispatch_Invoke(V_DISPATCH(&prop->var), DISPID_VALUE, &IID_NULL, lcid, wFlags, pdp, pvarRes, pei, &err); } TRACE("%s ret %08x\n", debugstr_w(This->dynamic_data->props[idx].name), hres); @@ -944,7 +1028,9 @@ return hres; } case DISPATCH_PROPERTYGET: - return VariantCopy(pvarRes, var); + if(prop->flags & DYNPROP_DELETED) + return DISP_E_UNKNOWNNAME; + return VariantCopy(pvarRes, &prop->var); case DISPATCH_PROPERTYPUT|DISPATCH_PROPERTYPUTREF: case DISPATCH_PROPERTYPUT: if(pdp->cArgs != 1 || (pdp->cNamedArgs == 1 && *pdp->rgdispidNamedArgs != DISPID_PROPERTYPUT) @@ -954,30 +1040,20 @@ } TRACE("put %s\n", debugstr_variant(pdp->rgvarg)); - VariantClear(var); - return VariantCopy(var, pdp->rgvarg); + VariantClear(&prop->var); + hres = VariantCopy(&prop->var, pdp->rgvarg); + if(FAILED(hres)) + return hres; + + prop->flags &= ~DYNPROP_DELETED; + return S_OK; default: FIXME("unhandled wFlags %x\n", wFlags); return E_NOTIMPL; } } - data = get_dispex_data(This); - if(!data) - return E_FAIL; - - hres = get_builtin_func(data, id, &func); - if(id == DISPID_VALUE && hres == DISP_E_UNKNOWNNAME) - return dispex_value(This, lcid, wFlags, pdp, pvarRes, pei, pspCaller); - if(FAILED(hres)) - return hres; - - if(func->func_disp_idx == -1) - hres = typeinfo_invoke(This, func, wFlags, pdp, pvarRes, pei); - else - hres = function_invoke(This, func, wFlags, pdp, pvarRes, pei); - - return hres; + return invoke_builtin_prop(This, id, lcid, wFlags, pdp, pvarRes, pei, pspCaller); } static HRESULT WINAPI DispatchEx_DeleteMemberByName(IDispatchEx *iface, BSTR bstrName, DWORD grfdex) @@ -1055,12 +1131,14 @@ if(!This->dynamic_data || This->dynamic_data->prop_cnt <= idx) return DISP_E_UNKNOWNNAME; - if(idx+1 == This->dynamic_data->prop_cnt) { + while(++idx < This->dynamic_data->prop_cnt && This->dynamic_data->props[idx].flags & DYNPROP_DELETED); + + if(idx == This->dynamic_data->prop_cnt) { *pid = DISPID_STARTENUM; return S_FALSE; } - *pid = id+1; + *pid = DISPID_DYNPROP_0+idx; return S_OK; } Modified: trunk/reactos/dll/win32/mshtml/editor.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mshtml/editor.c?…
============================================================================== --- trunk/reactos/dll/win32/mshtml/editor.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/mshtml/editor.c [iso-8859-1] Tue Apr 20 19:16:57 2010 @@ -508,7 +508,6 @@ void handle_edit_load(HTMLDocument *This) { - This->doc_obj->nscontainer->reset_focus = GetFocus(); get_editor_controller(This->doc_obj->nscontainer); } Modified: trunk/reactos/dll/win32/mshtml/htmlelem.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mshtml/htmlelem.…
============================================================================== --- trunk/reactos/dll/win32/mshtml/htmlelem.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/mshtml/htmlelem.c [iso-8859-1] Tue Apr 20 19:16:57 2010 @@ -198,8 +198,10 @@ LONG lFlags, VARIANT_BOOL *pfSuccess) { HTMLElement *This = HTMLELEM_THIS(iface); - FIXME("(%p)->()\n", This); - return E_NOTIMPL; + + TRACE("(%p)->(%s %x %p)\n", This, debugstr_w(strAttributeName), lFlags, pfSuccess); + + return remove_prop(&This->node.dispex, strAttributeName, pfSuccess); } static HRESULT WINAPI HTMLElement_put_className(IHTMLElement *iface, BSTR v) Modified: trunk/reactos/dll/win32/mshtml/htmlwindow.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mshtml/htmlwindo…
============================================================================== --- trunk/reactos/dll/win32/mshtml/htmlwindow.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/mshtml/htmlwindow.c [iso-8859-1] Tue Apr 20 19:16:57 2010 @@ -56,6 +56,26 @@ window->doc_obj->basedoc.doc_node = doc_node; if(doc_node) htmldoc_addref(&doc_node->basedoc); + } + + if(doc_node && window->doc_obj->usermode == EDITMODE) { + nsIDOMNSHTMLDocument *nshtmldoc; + nsAString mode_str; + nsresult nsres; + + static const PRUnichar onW[] = {'o','n',0}; + + nsres = nsIDOMHTMLDocument_QueryInterface(doc_node->nsdoc, &IID_nsIDOMNSHTMLDocument, (void**)&nshtmldoc); + if(NS_SUCCEEDED(nsres)) { + nsAString_Init(&mode_str, onW); + nsres = nsIDOMNSHTMLDocument_SetDesignMode(nshtmldoc, &mode_str); + nsAString_Finish(&mode_str); + nsIDOMNSHTMLDocument_Release(nshtmldoc); + if(NS_FAILED(nsres)) + ERR("SetDesignMode failed: %08x\n", nsres); + }else { + ERR("Could not get nsIDOMNSHTMLDocument interface: %08x\n", nsres); + } } } Modified: trunk/reactos/dll/win32/mshtml/install.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mshtml/install.c…
============================================================================== --- trunk/reactos/dll/win32/mshtml/install.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/mshtml/install.c [iso-8859-1] Tue Apr 20 19:16:57 2010 @@ -60,11 +60,6 @@ '\\','W','i','n','e', '\\','M','S','H','T','M','L',0}; -static const CHAR mshtml_keyA[] = - {'S','o','f','t','w','a','r','e', - '\\','W','i','n','e', - '\\','M','S','H','T','M','L',0}; - static HWND install_dialog = NULL; static LPWSTR tmp_file_name = NULL; static HANDLE tmp_file = INVALID_HANDLE_VALUE; @@ -230,18 +225,23 @@ static BOOL install_from_registered_dir(void) { char *file_name; + HKEY hkey; DWORD res, type, size = MAX_PATH; BOOL ret; + /* @@ Wine registry key: HKCU\Software\Wine\MSHTML */ + res = RegOpenKeyW(HKEY_CURRENT_USER, mshtml_keyW, &hkey); + if(res != ERROR_SUCCESS) + return FALSE; + file_name = heap_alloc(size+sizeof(GECKO_FILE_NAME)); - /* @@ Wine registry key: HKCU\Software\Wine\MSHTML */ - res = RegGetValueA(HKEY_CURRENT_USER, mshtml_keyA, "GeckoCabDir", RRF_RT_ANY, &type, (PBYTE)file_name, &size); + res = RegQueryValueExA(hkey, "GeckoCabDir", NULL, &type, (PBYTE)file_name, &size); if(res == ERROR_MORE_DATA) { file_name = heap_realloc(file_name, size+sizeof(GECKO_FILE_NAME)); - res = RegGetValueA(HKEY_CURRENT_USER, mshtml_keyA, "GeckoCabDir", RRF_RT_ANY, &type, (PBYTE)file_name, &size); - } - - if(res != ERROR_SUCCESS || (type != REG_SZ && type != REG_EXPAND_SZ)) { + res = RegQueryValueExA(hkey, "GeckoCabDir", NULL, &type, (PBYTE)file_name, &size); + } + RegCloseKey(hkey); + if(res != ERROR_SUCCESS || type != REG_SZ) { heap_free(file_name); return FALSE; } Modified: trunk/reactos/dll/win32/mshtml/mshtml_private.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mshtml/mshtml_pr…
============================================================================== --- trunk/reactos/dll/win32/mshtml/mshtml_private.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/mshtml/mshtml_private.h [iso-8859-1] Tue Apr 20 19:16:57 2010 @@ -38,6 +38,7 @@ #define NS_ERROR_FAILURE ((nsresult)0x80004005L) #define NS_NOINTERFACE ((nsresult)0x80004002L) #define NS_ERROR_NOT_IMPLEMENTED ((nsresult)0x80004001L) +#define NS_ERROR_NOT_AVAILABLE ((nsresult)0x80040111L) #define NS_ERROR_INVALID_ARG ((nsresult)0x80070057L) #define NS_ERROR_UNEXPECTED ((nsresult)0x8000ffffL) #define NS_ERROR_UNKNOWN_PROTOCOL ((nsresult)0x804b0012L) @@ -171,6 +172,7 @@ BOOL dispex_query_interface(DispatchEx*,REFIID,void**); HRESULT dispex_get_dprop_ref(DispatchEx*,const WCHAR*,BOOL,VARIANT**); HRESULT get_dispids(tid_t,DWORD*,DISPID**); +HRESULT remove_prop(DispatchEx*,BSTR,VARIANT_BOOL*); typedef struct HTMLWindow HTMLWindow; typedef struct HTMLDocumentNode HTMLDocumentNode; @@ -435,8 +437,6 @@ nsIURIContentListener *content_listener; HWND hwnd; - - HWND reset_focus; /* hack */ }; typedef struct nsWineURI nsWineURI; @@ -461,8 +461,15 @@ char *content_type; char *charset; PRUint32 response_status; + struct list response_headers; UINT url_scheme; } nsChannel; + +struct ResponseHeader { + struct list entry; + WCHAR *header; + WCHAR *data; +}; typedef struct { HRESULT (*qi)(HTMLDOMNode*,REFIID,void**); @@ -836,7 +843,6 @@ /* editor */ void init_editor(HTMLDocument*); -void set_ns_editmode(NSContainer*); void handle_edit_event(HTMLDocument*,nsIDOMEvent*); HRESULT editor_exec_copy(HTMLDocument*,DWORD,VARIANT*,VARIANT*); HRESULT editor_exec_cut(HTMLDocument*,DWORD,VARIANT*,VARIANT*); Modified: trunk/reactos/dll/win32/mshtml/navigate.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mshtml/navigate.…
============================================================================== --- trunk/reactos/dll/win32/mshtml/navigate.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/mshtml/navigate.c [iso-8859-1] Tue Apr 20 19:16:57 2010 @@ -62,7 +62,7 @@ HRESULT (*stop_binding)(BSCallback*,HRESULT); HRESULT (*read_data)(BSCallback*,IStream*); HRESULT (*on_progress)(BSCallback*,ULONG,LPCWSTR); - HRESULT (*on_response)(BSCallback*,DWORD); + HRESULT (*on_response)(BSCallback*,DWORD,LPCWSTR); } BSCallbackVtbl; struct BSCallback { @@ -493,7 +493,7 @@ TRACE("(%p)->(%d %s %s %p)\n", This, dwResponseCode, debugstr_w(szResponseHeaders), debugstr_w(szRequestHeaders), pszAdditionalRequestHeaders); - return This->vtbl->on_response(This, dwResponseCode); + return This->vtbl->on_response(This, dwResponseCode, szResponseHeaders); } static HRESULT WINAPI HttpNegotiate_GetRootSecurityId(IHttpNegotiate2 *iface, @@ -825,7 +825,8 @@ return S_OK; } -static HRESULT BufferBSC_on_response(BSCallback *bsc, DWORD response_code) +static HRESULT BufferBSC_on_response(BSCallback *bsc, DWORD response_code, + LPCWSTR response_headers) { return S_OK; } @@ -1099,11 +1100,72 @@ return S_OK; } -static HRESULT nsChannelBSC_on_response(BSCallback *bsc, DWORD response_code) +static HRESULT nsChannelBSC_on_response(BSCallback *bsc, DWORD response_code, + LPCWSTR response_headers) { nsChannelBSC *This = NSCHANNELBSC_THIS(bsc); This->nschannel->response_status = response_code; + + if(response_headers) { + const WCHAR *hdr_start, *hdr_end; + + hdr_start = strchrW(response_headers, '\r'); + while(hdr_start) { + const WCHAR *colon; + struct ResponseHeader *new_header; + int len; + + hdr_start += 2; + hdr_end = strchrW(hdr_start, '\r'); + if(!hdr_end) { + WARN("Header doesn't end with CRLF: %s\n", wine_dbgstr_w(hdr_start)); + break; + } + if(hdr_end == hdr_start) + break; + + for(colon = hdr_start; *colon != ':' && colon != hdr_end; ++colon); + if(*colon != ':') { + WARN("Header missing colon: %s\n", wine_dbgstr_w(hdr_start)); + hdr_start = strchrW(hdr_start, '\r'); + continue; + } + + new_header = heap_alloc(sizeof(struct ResponseHeader)); + if(!new_header) + return E_OUTOFMEMORY; + + len = colon - hdr_start; + new_header->header = heap_alloc((len + 1) * sizeof(WCHAR)); + if(!new_header->header) { + heap_free(new_header); + return E_OUTOFMEMORY; + } + memcpy(new_header->header, hdr_start, len * sizeof(WCHAR)); + new_header->header[len] = 0; + + colon++; + while(*colon == ' ') + colon++; + + len = hdr_end - colon; + new_header->data = heap_alloc((len + 1) * sizeof(WCHAR)); + if(!new_header->data) { + heap_free(new_header->header); + heap_free(new_header); + return E_OUTOFMEMORY; + } + memcpy(new_header->data, colon, len * sizeof(WCHAR)); + new_header->data[len] = 0; + + list_add_head(&This->nschannel->response_headers, &new_header->entry); + TRACE("Adding header to list: (%s):(%s)\n", wine_dbgstr_w(new_header->header), wine_dbgstr_w(new_header->data)); + + hdr_start = strchrW(hdr_start, '\r'); + } + } + return S_OK; } Modified: trunk/reactos/dll/win32/mshtml/nsembed.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mshtml/nsembed.c…
============================================================================== --- trunk/reactos/dll/win32/mshtml/nsembed.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/mshtml/nsembed.c [iso-8859-1] Tue Apr 20 19:16:57 2010 @@ -80,8 +80,6 @@ static ATOM nscontainer_class; -#define WM_RESETFOCUS_HACK WM_USER+600 - static LRESULT WINAPI nsembed_proc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) { NSContainer *This; @@ -106,20 +104,13 @@ WARN("SetSize failed: %08x\n", nsres); break; - case WM_RESETFOCUS_HACK: - /* - * FIXME - * Gecko grabs focus in edit mode and some apps don't like it. - * We should somehow prevent grabbing focus. - */ - - TRACE("WM_RESETFOCUS_HACK\n"); - - if(This->reset_focus) { - SetFocus(This->reset_focus); - This->reset_focus = NULL; - if(This->doc) - This->doc->focus = FALSE; + case WM_PARENTNOTIFY: + TRACE("WM_PARENTNOTIFY %x\n", (unsigned)wParam); + + switch(wParam) { + case WM_LBUTTONDOWN: + case WM_RBUTTONDOWN: + nsIWebBrowserFocus_Activate(This->focus); } } @@ -774,46 +765,6 @@ }else { ERR("Could not create edit controller: %08x\n", nsres); } -} - -void set_ns_editmode(NSContainer *This) -{ - nsIEditingSession *editing_session = NULL; - nsIURIContentListener *listener = NULL; - nsIDOMWindow *dom_window = NULL; - nsresult nsres; - - nsres = get_nsinterface((nsISupports*)This->webbrowser, &IID_nsIEditingSession, - (void**)&editing_session); - if(NS_FAILED(nsres)) { - ERR("Could not get nsIEditingSession: %08x\n", nsres); - return; - } - - nsres = nsIWebBrowser_GetContentDOMWindow(This->webbrowser, &dom_window); - if(NS_FAILED(nsres)) { - ERR("Could not get content DOM window: %08x\n", nsres); - nsIEditingSession_Release(editing_session); - return; - } - - nsres = nsIEditingSession_MakeWindowEditable(editing_session, dom_window, - NULL, FALSE, TRUE, TRUE); - nsIEditingSession_Release(editing_session); - nsIDOMWindow_Release(dom_window); - if(NS_FAILED(nsres)) { - ERR("MakeWindowEditable failed: %08x\n", nsres); - return; - } - - /* MakeWindowEditable changes WebBrowser's parent URI content listener. - * It seams to be a bug in Gecko. To workaround it we set our content - * listener again and Gecko's one as its parent. - */ - nsIWebBrowser_GetParentURIContentListener(This->webbrowser, &listener); - nsIURIContentListener_SetParentContentListener(NSURICL(This), listener); - nsIURIContentListener_Release(listener); - nsIWebBrowser_SetParentURIContentListener(This->webbrowser, NSURICL(This)); } void close_gecko(void) @@ -1316,9 +1267,6 @@ TRACE("(%p)\n", This); - if(This->reset_focus) - PostMessageW(This->hwnd, WM_RESETFOCUS_HACK, 0, 0); - return nsIBaseWindow_SetFocus(This->window); } Modified: trunk/reactos/dll/win32/mshtml/nsevents.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mshtml/nsevents.…
============================================================================== --- trunk/reactos/dll/win32/mshtml/nsevents.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/mshtml/nsevents.c [iso-8859-1] Tue Apr 20 19:16:57 2010 @@ -109,11 +109,11 @@ return release_listener(This); } -static BOOL is_doc_child_focus(HTMLDocumentObj *doc) +static BOOL is_doc_child_focus(NSContainer *nscontainer) { HWND hwnd; - for(hwnd = GetFocus(); hwnd && hwnd != doc->hwnd; hwnd = GetParent(hwnd)); + for(hwnd = GetFocus(); hwnd && hwnd != nscontainer->hwnd; hwnd = GetParent(hwnd)); return hwnd != NULL; } @@ -129,7 +129,7 @@ return NS_ERROR_FAILURE; doc_obj = doc->basedoc.doc_obj; - if(!doc_obj->nscontainer->reset_focus && doc_obj->focus && !is_doc_child_focus(doc_obj)) { + if(doc_obj->focus && !is_doc_child_focus(doc_obj->nscontainer)) { doc_obj->focus = FALSE; notif_focus(doc_obj); } @@ -148,7 +148,7 @@ return NS_ERROR_FAILURE; doc_obj = doc->basedoc.doc_obj; - if(!doc_obj->nscontainer->reset_focus && !doc_obj->focus) { + if(!doc_obj->focus) { doc_obj->focus = TRUE; notif_focus(doc_obj); } Modified: trunk/reactos/dll/win32/mshtml/nsio.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mshtml/nsio.c?re…
============================================================================== --- trunk/reactos/dll/win32/mshtml/nsio.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/mshtml/nsio.c [iso-8859-1] Tue Apr 20 19:16:57 2010 @@ -307,7 +307,7 @@ static inline BOOL is_http_channel(nsChannel *This) { - return This->url_scheme == URL_SCHEME_HTTP || This->url_scheme == URL_SCHEME_HTTP; + return This->url_scheme == URL_SCHEME_HTTP || This->url_scheme == URL_SCHEME_HTTPS; } #define NSCHANNEL_THIS(iface) DEFINE_THIS(nsChannel, HttpChannel, iface) @@ -363,6 +363,8 @@ LONG ref = InterlockedDecrement(&This->ref); if(!ref) { + struct ResponseHeader *header, *next_hdr; + nsIURI_Release(NSURI(This->uri)); if(This->owner) nsISupports_Release(This->owner); @@ -376,6 +378,14 @@ nsIURI_Release(This->original_uri); heap_free(This->content_type); heap_free(This->charset); + + LIST_FOR_EACH_ENTRY_SAFE(header, next_hdr, &This->response_headers, struct ResponseHeader, entry) { + list_remove(&header->entry); + heap_free(header->header); + heap_free(header->data); + heap_free(header); + } + heap_free(This); } @@ -933,9 +943,9 @@ { nsChannel *This = NSCHANNEL_THIS(iface); - FIXME("(%p)->(%p)\n", This, aRequestMethod); - - return NS_ERROR_NOT_IMPLEMENTED; + TRACE("(%p)->(%p): Returning NS_OK\n", This, aRequestMethod); + + return NS_OK; } static nsresult NSAPI nsChannel_GetReferrer(nsIHttpChannel *iface, nsIURI **aReferrer) @@ -1052,19 +1062,48 @@ { nsChannel *This = NSCHANNEL_THIS(iface); - FIXME("(%p)->(%p)\n", This, aRequestSucceeded); - - return NS_ERROR_NOT_IMPLEMENTED; + TRACE("(%p)->(%p)\n", This, aRequestSucceeded); + + if(!This->response_status) + return NS_ERROR_NOT_AVAILABLE; + + *aRequestSucceeded = This->response_status/100 == 2; + + return NS_OK; } static nsresult NSAPI nsChannel_GetResponseHeader(nsIHttpChannel *iface, const nsACString *header, nsACString *_retval) { nsChannel *This = NSCHANNEL_THIS(iface); - - FIXME("(%p)->(%p %p)\n", This, header, _retval); - - return NS_ERROR_NOT_IMPLEMENTED; + const char *header_str; + WCHAR *header_wstr; + struct ResponseHeader *this_header; + + nsACString_GetData(header, &header_str); + TRACE("(%p)->(%p(%s) %p)\n", This, header, header_str, _retval); + + header_wstr = heap_strdupAtoW(header_str); + if(!header_wstr) + return NS_ERROR_UNEXPECTED; + + LIST_FOR_EACH_ENTRY(this_header, &This->response_headers, struct ResponseHeader, entry) { + if(!strcmpW(this_header->header, header_wstr)) { + char *data = heap_strdupWtoA(this_header->data); + if(!data) { + heap_free(header_wstr); + return NS_ERROR_UNEXPECTED; + } + nsACString_SetData(_retval, data); + heap_free(data); + heap_free(header_wstr); + return NS_OK; + } + } + + heap_free(header_wstr); + + return NS_ERROR_NOT_AVAILABLE; } static nsresult NSAPI nsChannel_SetResponseHeader(nsIHttpChannel *iface, @@ -2414,7 +2453,6 @@ HTMLWindow *window = NULL; nsIURI *uri = NULL; LPCWSTR base_wine_url = NULL; - BOOL is_wine_uri = FALSE; nsresult nsres; nsACString_GetData(aSpec, &spec); @@ -2425,10 +2463,8 @@ if(is_gecko_special_uri(spec)) return nsIIOService_NewURI(nsio, aSpec, aOriginCharset, aBaseURI, _retval); - if(!strncmp(spec, "wine:", 5)) { + if(!strncmp(spec, "wine:", 5)) spec += 5; - is_wine_uri = TRUE; - } if(aBaseURI) { PARSEDURLA parsed_url = {sizeof(PARSEDURLA)}; @@ -2473,7 +2509,7 @@ set_wine_url(wine_uri, url); else WARN("CoCombineUrl failed: %08x\n", hres); - }else if(is_wine_uri) { + }else { WCHAR url[INTERNET_MAX_URL_LENGTH]; MultiByteToWideChar(CP_ACP, 0, spec, -1, url, sizeof(url)/sizeof(WCHAR)); @@ -2516,6 +2552,7 @@ ret->lpIHttpChannelInternalVtbl = &nsHttpChannelInternalVtbl; ret->ref = 1; ret->uri = wine_uri; + list_init(&ret->response_headers); nsIURI_AddRef(aURI); ret->original_uri = aURI; Modified: trunk/reactos/dll/win32/mshtml/olecmd.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mshtml/olecmd.c?…
============================================================================== --- trunk/reactos/dll/win32/mshtml/olecmd.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/mshtml/olecmd.c [iso-8859-1] Tue Apr 20 19:16:57 2010 @@ -615,9 +615,6 @@ if(This->doc_obj->hostui) IDocHostUIHandler_HideUI(This->doc_obj->hostui); } - - if(This->doc_obj->nscontainer) - set_ns_editmode(This->doc_obj->nscontainer); if(This->doc_obj->ui_active) { RECT rcBorderWidths; Modified: trunk/reactos/dll/win32/mshtml/view.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mshtml/view.c?re…
============================================================================== --- trunk/reactos/dll/win32/mshtml/view.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/mshtml/view.c [iso-8859-1] Tue Apr 20 19:16:57 2010 @@ -92,7 +92,6 @@ nsIBaseWindow_SetVisibility(This->window, TRUE); nsIBaseWindow_SetEnabled(This->window, TRUE); - nsIWebBrowserFocus_Activate(This->focus); } void update_doc(HTMLDocument *This, DWORD flags) @@ -216,6 +215,10 @@ break; case WM_TIMER: return on_timer(This); + case WM_SETFOCUS: + TRACE("(%p) WM_SETFOCUS\n", This); + nsIWebBrowserFocus_Activate(This->nscontainer->focus); + break; case WM_MOUSEACTIVATE: return MA_ACTIVATE; } @@ -664,6 +667,8 @@ This->doc_obj->ui_active = TRUE; }else { + This->doc_obj->focus = FALSE; + nsIWebBrowserFocus_Deactivate(This->doc_obj->nscontainer->focus); if(This->doc_obj->ui_active) { This->doc_obj->ui_active = FALSE; if(This->doc_obj->ip_window) @@ -811,7 +816,7 @@ TRACE("(%p)->(%d %d %p)\n", This, aspects, advf, pAdvSink); if(aspects != DVASPECT_CONTENT || advf != ADVF_PRIMEFIRST) - FIXME("unsuported arguments\n"); + FIXME("unsupported arguments\n"); if(This->doc_obj->view_sink) IAdviseSink_Release(This->doc_obj->view_sink);
14 years, 6 months
1
0
0
0
[fireball] 46956: - Sync inetcomm, inseng, jscript to Wine-1.1.43.
by fireball@svn.reactos.org
Author: fireball Date: Tue Apr 20 18:42:47 2010 New Revision: 46956 URL:
http://svn.reactos.org/svn/reactos?rev=46956&view=rev
Log: - Sync inetcomm, inseng, jscript to Wine-1.1.43. Modified: trunk/reactos/dll/win32/inetcomm/mimeintl.c trunk/reactos/dll/win32/inetcomm/mimeole.c trunk/reactos/dll/win32/inseng/inseng_main.c trunk/reactos/dll/win32/jscript/jscript.h trunk/reactos/dll/win32/jscript/regexp.c trunk/reactos/dll/win32/jscript/string.c Modified: trunk/reactos/dll/win32/inetcomm/mimeintl.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/inetcomm/mimeint…
============================================================================== --- trunk/reactos/dll/win32/inetcomm/mimeintl.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/inetcomm/mimeintl.c [iso-8859-1] Tue Apr 20 18:42:47 2010 @@ -268,7 +268,7 @@ if(SUCCEEDED(hr)) *phCharset = add_charset(&This->charsets, &mlang_info, - (HCHARSET)InterlockedIncrement(&This->next_charset_handle)); + UlongToHandle(InterlockedIncrement(&This->next_charset_handle))); } LeaveCriticalSection(&This->cs); Modified: trunk/reactos/dll/win32/inetcomm/mimeole.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/inetcomm/mimeole…
============================================================================== --- trunk/reactos/dll/win32/inetcomm/mimeole.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/inetcomm/mimeole.c [iso-8859-1] Tue Apr 20 18:42:47 2010 @@ -1419,7 +1419,7 @@ typedef struct body_t { struct list entry; - HBODY hbody; + DWORD index; IMimeBody *mime_body; struct body_t *parent; @@ -1434,7 +1434,7 @@ IStream *stream; struct list body_tree; - HBODY next_hbody; + DWORD next_index; } MimeMessage; static HRESULT WINAPI MimeMessage_QueryInterface(IMimeMessage *iface, REFIID riid, void **ppv) @@ -1512,13 +1512,13 @@ return E_NOTIMPL; } -static body_t *new_body_entry(IMimeBody *mime_body, HBODY hbody, body_t *parent) +static body_t *new_body_entry(IMimeBody *mime_body, DWORD index, body_t *parent) { body_t *body = HeapAlloc(GetProcessHeap(), 0, sizeof(*body)); if(body) { body->mime_body = mime_body; - body->hbody = hbody; + body->index = index; list_init(&body->children); body->parent = parent; } @@ -1630,8 +1630,7 @@ offset->cbBodyStart = cur.u.LowPart + offset->cbHeaderStart; if(parent) MimeBody_set_offsets(impl_from_IMimeBody(mime_body), offset); IMimeBody_SetData(mime_body, IET_BINARY, NULL, NULL, &IID_IStream, pStm); - body = new_body_entry(mime_body, msg->next_hbody, parent); - msg->next_hbody = (HBODY)((DWORD)msg->next_hbody + 1); + body = new_body_entry(mime_body, msg->next_index++, parent); if(IMimeBody_IsContentType(mime_body, "multipart", NULL) == S_OK) { @@ -1812,7 +1811,7 @@ LIST_FOR_EACH_ENTRY(cur, list, body_t, entry) { - if(cur->hbody == hbody) + if(cur->index == HandleToUlong(hbody)) { *body = cur; return S_OK; @@ -1948,7 +1947,7 @@ hr = get_body(This, location, hPivot, &body); - if(hr == S_OK) *phBody = body->hbody; + if(hr == S_OK) *phBody = UlongToHandle(body->index); return hr; } @@ -2003,38 +2002,35 @@ return S_OK; } -static HRESULT find_next(IMimeMessage *msg, LPFINDBODY find_body, HBODY *out) -{ - HRESULT hr; - IMimeBody *mime_body; +static HRESULT find_next(IMimeMessage *msg, body_t *body, LPFINDBODY find, HBODY *out) +{ + MimeMessage *This = (MimeMessage *)msg; + struct list *ptr; HBODY next; - if(find_body->dwReserved == 0) - find_body->dwReserved = (DWORD)HBODY_ROOT; - else - { - hr = IMimeMessage_GetBody(msg, IBL_FIRST, (HBODY)find_body->dwReserved, &next); - if(hr == S_OK) - find_body->dwReserved = (DWORD)next; + for (;;) + { + if (!body) ptr = list_head( &This->body_tree ); else { - hr = IMimeMessage_GetBody(msg, IBL_NEXT, (HBODY)find_body->dwReserved, &next); - if(hr == S_OK) - find_body->dwReserved = (DWORD)next; - else - return MIME_E_NOT_FOUND; + ptr = list_head( &body->children ); + while (!ptr) + { + if (!body->parent) return MIME_E_NOT_FOUND; + if (!(ptr = list_next( &body->parent->children, &body->entry ))) body = body->parent; + } } - } - - hr = IMimeMessage_BindToObject(msg, (HBODY)find_body->dwReserved, &IID_IMimeBody, (void**)&mime_body); - if(IMimeBody_IsContentType(mime_body, find_body->pszPriType, find_body->pszSubType) == S_OK) - { - IMimeBody_Release(mime_body); - *out = (HBODY)find_body->dwReserved; - return S_OK; - } - IMimeBody_Release(mime_body); - return find_next(msg, find_body, out); + + body = LIST_ENTRY( ptr, body_t, entry ); + next = UlongToHandle( body->index ); + find->dwReserved = body->index; + if (IMimeBody_IsContentType(body->mime_body, find->pszPriType, find->pszSubType) == S_OK) + { + *out = next; + return S_OK; + } + } + return MIME_E_NOT_FOUND; } static HRESULT WINAPI MimeMessage_FindFirst( @@ -2045,7 +2041,7 @@ TRACE("(%p)->(%p, %p)\n", iface, pFindBody, phBody); pFindBody->dwReserved = 0; - return find_next(iface, pFindBody, phBody); + return find_next( iface, NULL, pFindBody, phBody ); } static HRESULT WINAPI MimeMessage_FindNext( @@ -2053,9 +2049,15 @@ LPFINDBODY pFindBody, LPHBODY phBody) { + MimeMessage *This = (MimeMessage *)iface; + body_t *body; + HRESULT hr; + TRACE("(%p)->(%p, %p)\n", iface, pFindBody, phBody); - return find_next(iface, pFindBody, phBody); + hr = find_body( &This->body_tree, UlongToHandle( pFindBody->dwReserved ), &body ); + if (hr != S_OK) return MIME_E_NOT_FOUND; + return find_next( iface, body, pFindBody, phBody ); } static HRESULT WINAPI MimeMessage_ResolveURL( @@ -2562,7 +2564,7 @@ This->refs = 1; This->stream = NULL; list_init(&This->body_tree); - This->next_hbody = (HBODY)1; + This->next_index = 1; *obj = &This->lpVtbl; return S_OK; Modified: trunk/reactos/dll/win32/inseng/inseng_main.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/inseng/inseng_ma…
============================================================================== --- trunk/reactos/dll/win32/inseng/inseng_main.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/inseng/inseng_main.c [iso-8859-1] Tue Apr 20 18:42:47 2010 @@ -61,7 +61,6 @@ HRESULT WINAPI DllCanUnloadNow(void) { - FIXME("\n"); return S_FALSE; } Modified: trunk/reactos/dll/win32/jscript/jscript.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/jscript/jscript.…
============================================================================== --- trunk/reactos/dll/win32/jscript/jscript.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/jscript/jscript.h [iso-8859-1] Tue Apr 20 18:42:47 2010 @@ -324,6 +324,7 @@ DWORD*,DWORD*,match_result_t*); HRESULT regexp_match(script_ctx_t*,DispatchEx*,const WCHAR*,DWORD,BOOL,match_result_t**,DWORD*); HRESULT parse_regexp_flags(const WCHAR*,DWORD,DWORD*); +HRESULT regexp_string_match(script_ctx_t*,DispatchEx*,BSTR,VARIANT*,jsexcept_t*); static inline VARIANT *get_arg(DISPPARAMS *dp, DWORD i) { Modified: trunk/reactos/dll/win32/jscript/regexp.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/jscript/regexp.c…
============================================================================== --- trunk/reactos/dll/win32/jscript/regexp.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/jscript/regexp.c [iso-8859-1] Tue Apr 20 18:42:47 2010 @@ -2384,7 +2384,7 @@ RECharSet *charSet; const char *opname = reop_names[op]; - TRACE("\n%06d: %*s%s\n", pc - gData->regexp->program, + TRACE("\n%06d: %*s%s\n", (int)(pc - gData->regexp->program), (int)gData->stateStackTop * 2, "", opname); switch (op) { @@ -2623,7 +2623,7 @@ for (;;) { const char *opname = reop_names[op]; - TRACE("\n%06d: %*s%s\n", pc - gData->regexp->program, + TRACE("\n%06d: %*s%s\n", (int)(pc - gData->regexp->program), (int)gData->stateStackTop * 2, "", opname); if (REOP_IS_SIMPLE(op)) { @@ -3637,25 +3637,25 @@ hres = to_string(ctx, arg, ei, &string); if(FAILED(hres)) return hres; + length = SysStringLen(string); }else { - string = SysAllocStringLen(NULL, 0); - if(!string) - return E_OUTOFMEMORY; - } - - if(regexp->last_index < 0) { - SysFreeString(string); - set_last_index(regexp, 0); - *ret = VARIANT_FALSE; - if(input) { - *input = NULL; - } - return S_OK; - } - - length = SysStringLen(string); - if(regexp->jsregexp->flags & JSREG_GLOB) + string = NULL; + length = 0; + } + + if(regexp->jsregexp->flags & JSREG_GLOB) { + if(regexp->last_index < 0) { + SysFreeString(string); + set_last_index(regexp, 0); + *ret = VARIANT_FALSE; + if(input) { + *input = NULL; + } + return S_OK; + } + last_index = regexp->last_index; + } cp = string + last_index; hres = regexp_match_next(ctx, ®exp->dispex, REM_RESET_INDEX, string, length, &cp, parens, @@ -3876,6 +3876,87 @@ return hres; return create_regexp(ctx, src, -1, flags, ret); +} + +HRESULT regexp_string_match(script_ctx_t *ctx, DispatchEx *re, BSTR str, + VARIANT *retv, jsexcept_t *ei) +{ + RegExpInstance *regexp = (RegExpInstance*)re; + match_result_t *match_result; + DWORD match_cnt, i, length; + DispatchEx *array; + VARIANT var; + HRESULT hres; + + length = SysStringLen(str); + + if(!(regexp->jsregexp->flags & JSREG_GLOB)) { + match_result_t match, *parens = NULL; + DWORD parens_cnt, parens_size = 0; + const WCHAR *cp = str; + + hres = regexp_match_next(ctx, ®exp->dispex, 0, str, length, &cp, &parens, &parens_size, &parens_cnt, &match); + if(FAILED(hres)) + return hres; + + if(retv) { + if(hres == S_OK) { + IDispatch *ret; + + hres = create_match_array(ctx, str, &match, parens, parens_cnt, ei, &ret); + if(SUCCEEDED(hres)) { + V_VT(retv) = VT_DISPATCH; + V_DISPATCH(retv) = ret; + } + }else { + V_VT(retv) = VT_NULL; + } + } + + heap_free(parens); + return S_OK; + } + + hres = regexp_match(ctx, ®exp->dispex, str, length, FALSE, &match_result, &match_cnt); + if(FAILED(hres)) + return hres; + + if(!match_cnt) { + TRACE("no match\n"); + + if(retv) + V_VT(retv) = VT_NULL; + return S_OK; + } + + hres = create_array(ctx, match_cnt, &array); + if(FAILED(hres)) + return hres; + + V_VT(&var) = VT_BSTR; + + for(i=0; i < match_cnt; i++) { + V_BSTR(&var) = SysAllocStringLen(match_result[i].str, match_result[i].len); + if(!V_BSTR(&var)) { + hres = E_OUTOFMEMORY; + break; + } + + hres = jsdisp_propput_idx(array, i, &var, ei, NULL/*FIXME*/); + SysFreeString(V_BSTR(&var)); + if(FAILED(hres)) + break; + } + + heap_free(match_result); + + if(SUCCEEDED(hres) && retv) { + V_VT(retv) = VT_DISPATCH; + V_DISPATCH(retv) = (IDispatch*)_IDispatchEx_(array); + }else { + jsdisp_release(array); + } + return hres; } static HRESULT RegExpConstr_value(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, DISPPARAMS *dp, Modified: trunk/reactos/dll/win32/jscript/string.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/jscript/string.c…
============================================================================== --- trunk/reactos/dll/win32/jscript/string.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/jscript/string.c [iso-8859-1] Tue Apr 20 18:42:47 2010 @@ -622,11 +622,9 @@ VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp) { const WCHAR *str; - match_result_t *match_result; DispatchEx *regexp; - DispatchEx *array; - VARIANT var, *arg_var; - DWORD length, match_cnt, i; + VARIANT *arg_var; + DWORD length; BSTR val_str = NULL; HRESULT hres = S_OK; @@ -645,7 +643,7 @@ case VT_DISPATCH: regexp = iface_to_jsdisp((IUnknown*)V_DISPATCH(arg_var)); if(regexp) { - if(regexp->builtin_info->class == JSCLASS_REGEXP) + if(is_class(regexp, JSCLASS_REGEXP)) break; jsdisp_release(regexp); } @@ -664,54 +662,17 @@ } hres = get_string_val(ctx, jsthis, ei, &str, &length, &val_str); - if(SUCCEEDED(hres)) - hres = regexp_match(ctx, regexp, str, length, FALSE, &match_result, &match_cnt); + if(SUCCEEDED(hres)) { + if(!val_str) + val_str = SysAllocStringLen(str, length); + if(val_str) + hres = regexp_string_match(ctx, regexp, val_str, retv, ei); + else + hres = E_OUTOFMEMORY; + } + jsdisp_release(regexp); - if(FAILED(hres)) { - SysFreeString(val_str); - return hres; - } - - if(!match_cnt) { - TRACE("no match\n"); - - if(retv) - V_VT(retv) = VT_NULL; - - SysFreeString(val_str); - return S_OK; - } - - hres = create_array(ctx, match_cnt, &array); - if(FAILED(hres)) { - SysFreeString(val_str); - return hres; - } - - V_VT(&var) = VT_BSTR; - - for(i=0; i < match_cnt; i++) { - V_BSTR(&var) = SysAllocStringLen(match_result[i].str, match_result[i].len); - if(!V_BSTR(&var)) { - hres = E_OUTOFMEMORY; - break; - } - - hres = jsdisp_propput_idx(array, i, &var, ei, NULL/*FIXME*/); - SysFreeString(V_BSTR(&var)); - if(FAILED(hres)) - break; - } - - heap_free(match_result); SysFreeString(val_str); - - if(SUCCEEDED(hres) && retv) { - V_VT(retv) = VT_DISPATCH; - V_DISPATCH(retv) = (IDispatch*)_IDispatchEx_(array); - }else { - jsdisp_release(array); - } return hres; }
14 years, 6 months
1
0
0
0
[fireball] 46955: - Sync comdlg32, crypt32, gdiplus, hhctrl.ocx to Wine-1.1.43.
by fireball@svn.reactos.org
Author: fireball Date: Tue Apr 20 10:30:10 2010 New Revision: 46955 URL:
http://svn.reactos.org/svn/reactos?rev=46955&view=rev
Log: - Sync comdlg32, crypt32, gdiplus, hhctrl.ocx to Wine-1.1.43. Modified: trunk/reactos/dll/win32/comdlg32/filedlg.c trunk/reactos/dll/win32/comdlg32/fontdlg.c trunk/reactos/dll/win32/comdlg32/printdlg.c trunk/reactos/dll/win32/crypt32/decode.c trunk/reactos/dll/win32/gdiplus/brush.c trunk/reactos/dll/win32/gdiplus/font.c trunk/reactos/dll/win32/gdiplus/gdiplus.spec trunk/reactos/dll/win32/gdiplus/gdiplus_private.h trunk/reactos/dll/win32/gdiplus/graphics.c trunk/reactos/dll/win32/gdiplus/image.c trunk/reactos/dll/win32/hhctrl.ocx/hhctrl.c trunk/reactos/include/psdk/gdiplusflat.h [This mail would be too long, it was shortened to contain the URLs only.] Modified: trunk/reactos/dll/win32/comdlg32/filedlg.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comdlg32/filedlg…
Modified: trunk/reactos/dll/win32/comdlg32/fontdlg.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comdlg32/fontdlg…
Modified: trunk/reactos/dll/win32/comdlg32/printdlg.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comdlg32/printdl…
Modified: trunk/reactos/dll/win32/crypt32/decode.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/crypt32/decode.c…
Modified: trunk/reactos/dll/win32/gdiplus/brush.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdiplus/brush.c?…
Modified: trunk/reactos/dll/win32/gdiplus/font.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdiplus/font.c?r…
Modified: trunk/reactos/dll/win32/gdiplus/gdiplus.spec URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdiplus/gdiplus.…
Modified: trunk/reactos/dll/win32/gdiplus/gdiplus_private.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdiplus/gdiplus_…
Modified: trunk/reactos/dll/win32/gdiplus/graphics.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdiplus/graphics…
Modified: trunk/reactos/dll/win32/gdiplus/image.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdiplus/image.c?…
Modified: trunk/reactos/dll/win32/hhctrl.ocx/hhctrl.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/hhctrl.ocx/hhctr…
Modified: trunk/reactos/include/psdk/gdiplusflat.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/gdiplusflat.h…
14 years, 6 months
1
0
0
0
[tkreuzer] 46954: [WIN32K] Fix LPARAM parameter when sending WM_DISPLAYCHANGE, fixes resizing the desktop.
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Tue Apr 20 01:36:31 2010 New Revision: 46954 URL:
http://svn.reactos.org/svn/reactos?rev=46954&view=rev
Log: [WIN32K] Fix LPARAM parameter when sending WM_DISPLAYCHANGE, fixes resizing the desktop. Modified: branches/reactos-yarotows/subsystems/win32/win32k/ntuser/display.c Modified: branches/reactos-yarotows/subsystems/win32/win32k/ntuser/display.c URL:
http://svn.reactos.org/svn/reactos/branches/reactos-yarotows/subsystems/win…
============================================================================== --- branches/reactos-yarotows/subsystems/win32/win32k/ntuser/display.c [iso-8859-1] (original) +++ branches/reactos-yarotows/subsystems/win32/win32k/ntuser/display.c [iso-8859-1] Tue Apr 20 01:36:31 2010 @@ -777,7 +777,7 @@ co_IntSendMessageTimeout(HWND_BROADCAST, WM_DISPLAYCHANGE, (WPARAM)ppdev->gdiinfo.cBitsPixel, - (LPARAM)(ppdev->gdiinfo.ulHorzRes + (ppdev->gdiinfo.ulHorzRes << 16)), + (LPARAM)(ppdev->gdiinfo.ulHorzRes + (ppdev->gdiinfo.ulVertRes << 16)), SMTO_NORMAL, 100, &ulResult);
14 years, 6 months
1
0
0
0
[tkreuzer] 46953: [WIN32K] Don't call IntHideDesktop and co_IntShowDesktop for now. This doesn't seem to be neccessary and fixes a bunch of problems
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Tue Apr 20 01:22:17 2010 New Revision: 46953 URL:
http://svn.reactos.org/svn/reactos?rev=46953&view=rev
Log: [WIN32K] Don't call IntHideDesktop and co_IntShowDesktop for now. This doesn't seem to be neccessary and fixes a bunch of problems Modified: branches/reactos-yarotows/subsystems/win32/win32k/ntuser/display.c Modified: branches/reactos-yarotows/subsystems/win32/win32k/ntuser/display.c URL:
http://svn.reactos.org/svn/reactos/branches/reactos-yarotows/subsystems/win…
============================================================================== --- branches/reactos-yarotows/subsystems/win32/win32k/ntuser/display.c [iso-8859-1] (original) +++ branches/reactos-yarotows/subsystems/win32/win32k/ntuser/display.c [iso-8859-1] Tue Apr 20 01:22:17 2010 @@ -771,7 +771,7 @@ //IntvGetDeviceCaps(&PrimarySurface, &GdiHandleTable->DevCaps); pdesk = IntGetActiveDesktop(); - IntHideDesktop(pdesk); + //IntHideDesktop(pdesk); /* Send WM_DISPLAYCHANGE to all toplevel windows */ co_IntSendMessageTimeout(HWND_BROADCAST, @@ -782,7 +782,7 @@ 100, &ulResult); - co_IntShowDesktop(pdesk, ppdev->gdiinfo.ulHorzRes, ppdev->gdiinfo.ulVertRes); + //co_IntShowDesktop(pdesk, ppdev->gdiinfo.ulHorzRes, ppdev->gdiinfo.ulVertRes); UserRedrawDesktop(); }
14 years, 6 months
1
0
0
0
[jgardou] 46952: [WIN32K] - update clipping, GraphicCaps, brush, pen, background and charset of the DC after a mode change
by jgardou@svn.reactos.org
Author: jgardou Date: Tue Apr 20 00:51:40 2010 New Revision: 46952 URL:
http://svn.reactos.org/svn/reactos?rev=46952&view=rev
Log: [WIN32K] - update clipping, GraphicCaps, brush, pen, background and charset of the DC after a mode change Modified: branches/reactos-yarotows/subsystems/win32/win32k/objects/dclife.c Modified: branches/reactos-yarotows/subsystems/win32/win32k/objects/dclife.c URL:
http://svn.reactos.org/svn/reactos/branches/reactos-yarotows/subsystems/win…
============================================================================== --- branches/reactos-yarotows/subsystems/win32/win32k/objects/dclife.c [iso-8859-1] (original) +++ branches/reactos-yarotows/subsystems/win32/win32k/objects/dclife.c [iso-8859-1] Tue Apr 20 00:51:40 2010 @@ -453,6 +453,34 @@ return ret; } + +int FASTCALL +CLIPPING_UpdateGCRegion(DC* Dc); + +static +void +DC_vUpdateDC(PDC pdc) +{ + HRGN hVisRgn ; + PPDEVOBJ ppdev = pdc->ppdev ; + + pdc->dhpdev = ppdev->dhpdev; + + SURFACE_ShareUnlockSurface(pdc->dclevel.pSurface); + pdc->dclevel.pSurface = PDEVOBJ_pSurface(ppdev); + + PDEVOBJ_sizl(pdc->ppdev, &pdc->dclevel.sizl); + hVisRgn = NtGdiCreateRectRgn(0, 0, pdc->dclevel.sizl.cx, pdc->dclevel.sizl.cy); + ASSERT(hVisRgn); + GdiSelectVisRgn(pdc->BaseObject.hHmgr, hVisRgn); + GreDeleteObject(hVisRgn); + + pdc->flGraphicsCaps = ppdev->devinfo.flGraphicsCaps; + pdc->flGraphicsCaps2 = ppdev->devinfo.flGraphicsCaps2; + + pdc->pdcattr->ulDirty_ |= DIRTY_DEFAULT; +} + /* Prepare a blit for up to 2 DCs */ /* rc1 and rc2 are the rectangles where we want to draw or * from where we take pixels. */ @@ -501,8 +529,7 @@ /* Update surface if needed */ if(pdcFirst->ppdev->pSurface != pdcFirst->dclevel.pSurface) { - SURFACE_ShareUnlockSurface(pdcFirst->dclevel.pSurface); - pdcFirst->dclevel.pSurface = PDEVOBJ_pSurface(pdcFirst->ppdev); + DC_vUpdateDC(pdcFirst); } } if(pdcSecond && pdcSecond->dctype == DCTYPE_DIRECT) @@ -516,8 +543,7 @@ /* Update surface if needed */ if(pdcSecond->ppdev->pSurface != pdcSecond->dclevel.pSurface) { - SURFACE_ShareUnlockSurface(pdcSecond->dclevel.pSurface); - pdcSecond->dclevel.pSurface = PDEVOBJ_pSurface(pdcSecond->ppdev); + DC_vUpdateDC(pdcSecond); } } }
14 years, 6 months
1
0
0
0
[jgardou] 46951: [WIN32K] - Do not access surface before holding ppdev Lock
by jgardou@svn.reactos.org
Author: jgardou Date: Mon Apr 19 23:56:44 2010 New Revision: 46951 URL:
http://svn.reactos.org/svn/reactos?rev=46951&view=rev
Log: [WIN32K] - Do not access surface before holding ppdev Lock Modified: branches/reactos-yarotows/subsystems/win32/win32k/objects/bitblt.c Modified: branches/reactos-yarotows/subsystems/win32/win32k/objects/bitblt.c URL:
http://svn.reactos.org/svn/reactos/branches/reactos-yarotows/subsystems/win…
============================================================================== --- branches/reactos-yarotows/subsystems/win32/win32k/objects/bitblt.c [iso-8859-1] (original) +++ branches/reactos-yarotows/subsystems/win32/win32k/objects/bitblt.c [iso-8859-1] Mon Apr 19 23:56:44 2010 @@ -942,13 +942,6 @@ ASSERT(pbrush); - psurf = pdc->dclevel.pSurface; - if (psurf == NULL) - { - SetLastWin32Error(ERROR_INVALID_HANDLE); - return FALSE; - } - if (pbrush->flAttrs & GDIBRUSH_IS_NULL) { return TRUE; @@ -987,6 +980,8 @@ BrushOrigin.y = pbrush->ptOrigin.y + pdc->ptlDCOrig.y; DC_vPrepareDCsForBlit(pdc, DestRect, NULL, DestRect); + + psurf = pdc->dclevel.pSurface; EBRUSHOBJ_vInit(&eboFill, pbrush, pdc);
14 years, 6 months
1
0
0
0
[jgardou] 46950: [WIN32K] - Prepare DC for blit before initializing EBRUSHOBJ
by jgardou@svn.reactos.org
Author: jgardou Date: Mon Apr 19 23:48:17 2010 New Revision: 46950 URL:
http://svn.reactos.org/svn/reactos?rev=46950&view=rev
Log: [WIN32K] - Prepare DC for blit before initializing EBRUSHOBJ Modified: branches/reactos-yarotows/subsystems/win32/win32k/objects/bitblt.c Modified: branches/reactos-yarotows/subsystems/win32/win32k/objects/bitblt.c URL:
http://svn.reactos.org/svn/reactos/branches/reactos-yarotows/subsystems/win…
============================================================================== --- branches/reactos-yarotows/subsystems/win32/win32k/objects/bitblt.c [iso-8859-1] (original) +++ branches/reactos-yarotows/subsystems/win32/win32k/objects/bitblt.c [iso-8859-1] Mon Apr 19 23:48:17 2010 @@ -986,9 +986,9 @@ BrushOrigin.x = pbrush->ptOrigin.x + pdc->ptlDCOrig.x; BrushOrigin.y = pbrush->ptOrigin.y + pdc->ptlDCOrig.y; + DC_vPrepareDCsForBlit(pdc, DestRect, NULL, DestRect); + EBRUSHOBJ_vInit(&eboFill, pbrush, pdc); - - DC_vPrepareDCsForBlit(pdc, DestRect, NULL, DestRect); ret = IntEngBitBlt( &psurf->SurfObj,
14 years, 6 months
1
0
0
0
[tkreuzer] 46949: Merge back most changes to ntifs.h from lastt revert
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Mon Apr 19 23:40:23 2010 New Revision: 46949 URL:
http://svn.reactos.org/svn/reactos?rev=46949&view=rev
Log: Merge back most changes to ntifs.h from lastt revert Modified: trunk/reactos/include/ddk/ntifs.h [This mail would be too long, it was shortened to contain the URLs only.] Modified: trunk/reactos/include/ddk/ntifs.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ddk/ntifs.h?rev=46…
14 years, 6 months
1
0
0
0
[tkreuzer] 46948: [W32KNAPI] Patch by Jerome Gardou: more tests for NtGdiBitBlt
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Mon Apr 19 21:45:10 2010 New Revision: 46948 URL:
http://svn.reactos.org/svn/reactos?rev=46948&view=rev
Log: [W32KNAPI] Patch by Jerome Gardou: more tests for NtGdiBitBlt Modified: trunk/rostests/apitests/w32knapi/ntgdi/NtGdiBitBlt.c Modified: trunk/rostests/apitests/w32knapi/ntgdi/NtGdiBitBlt.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/w32knapi/ntgdi/N…
============================================================================== --- trunk/rostests/apitests/w32knapi/ntgdi/NtGdiBitBlt.c [iso-8859-1] (original) +++ trunk/rostests/apitests/w32knapi/ntgdi/NtGdiBitBlt.c [iso-8859-1] Mon Apr 19 21:45:10 2010 @@ -29,6 +29,11 @@ hbmp1 = NtGdiCreateBitmap(2, 2, 1, 32, (LPBYTE)bytes1 ); TEST(hbmp1 != NULL); hOldBmp1 = SelectObject(hdc1, hbmp1); + + TESTX(NtGdiGetPixel(hdc1, 0, 0) == 0x000000ff, "Pixel[0][0] 0x%08x\n", (UINT)NtGdiGetPixel(hdc2, 0, 0)); + TESTX(NtGdiGetPixel(hdc1, 0, 1) == 0x00ff0000, "Pixel[0][1] 0x%08x\n", (UINT)NtGdiGetPixel(hdc2, 0, 1)); + TESTX(NtGdiGetPixel(hdc1, 1, 0) == 0x0000ff00, "Pixel[1][0] 0x%08x\n", (UINT)NtGdiGetPixel(hdc2, 1, 0)); + TESTX(NtGdiGetPixel(hdc1, 1, 1) == 0x00ffffff, "Pixel[1][1] 0x%08x\n", (UINT)NtGdiGetPixel(hdc2, 1, 1)); hbmp2 = NtGdiCreateBitmap(2, 2, 1, 32, (LPBYTE)bytes2 ); TEST(hbmp2 != NULL); @@ -68,7 +73,22 @@ TESTX(NtGdiGetPixel(hdc2, 1, 0) == 0x00000000, "Pixel[1][0] 0x%08x\n", (UINT)NtGdiGetPixel(hdc2, 1, 0)); TESTX(NtGdiGetPixel(hdc2, 1, 1) == 0x00000000, "Pixel[1][1] 0x%08x\n", (UINT)NtGdiGetPixel(hdc2, 1, 1)); + NtGdiSetPixel(hdc2, 0, 0, 0x00000000); + bRet = NtGdiBitBlt(hdc2, 2, 2, -2, -2, hdc1, 2, 2, SRCCOPY, 0, 0); + TEST(bRet == TRUE); + TEST(GetLastError() == ERROR_SUCCESS); + TESTX(NtGdiGetPixel(hdc2, 0, 0) == 0x000000ff, "Pixel[0][0] 0x%08x\n", (UINT)NtGdiGetPixel(hdc2, 0, 0)); + TESTX(NtGdiGetPixel(hdc2, 0, 1) == 0x00ff0000, "Pixel[0][1] 0x%08x\n", (UINT)NtGdiGetPixel(hdc2, 0, 1)); + TESTX(NtGdiGetPixel(hdc2, 1, 0) == 0x0000ff00, "Pixel[1][0] 0x%08x\n", (UINT)NtGdiGetPixel(hdc2, 1, 0)); + TESTX(NtGdiGetPixel(hdc2, 1, 1) == 0x00ffffff, "Pixel[1][1] 0x%08x\n", (UINT)NtGdiGetPixel(hdc2, 1, 1)); + + NtGdiSetPixel(hdc2, 0, 0, 0x00000000); + NtGdiSetPixel(hdc2, 1, 0, 0x00000000); + NtGdiSetPixel(hdc2, 0, 1, 0x00000000); + NtGdiSetPixel(hdc2, 1, 1, 0x00000000); + + bRet = NtGdiBitBlt(hdc2, 0, 0, 2, 2, hdc1, 0, 0, SRCCOPY, 0, 0); TEST(bRet == TRUE); TEST(GetLastError() == ERROR_SUCCESS); TESTX(NtGdiGetPixel(hdc2, 0, 0) == 0x000000ff, "Pixel[0][0] 0x%08x\n", (UINT)NtGdiGetPixel(hdc2, 0, 0));
14 years, 6 months
1
0
0
0
← Newer
1
...
9
10
11
12
13
14
15
...
44
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
Results per page:
10
25
50
100
200