ReactOS.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
March 2010
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
19 participants
896 discussions
Start a n
N
ew thread
[spetreolle] 45837: [URLMON] Fix build.
by spetreolle@svn.reactos.org
Author: spetreolle Date: Thu Mar 4 19:50:24 2010 New Revision: 45837 URL:
http://svn.reactos.org/svn/reactos?rev=45837&view=rev
Log: [URLMON] Fix build. Modified: trunk/reactos/dll/win32/urlmon/urlmon.rbuild Modified: trunk/reactos/dll/win32/urlmon/urlmon.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/urlmon/urlmon.rb…
============================================================================== --- trunk/reactos/dll/win32/urlmon/urlmon.rbuild [iso-8859-1] (original) +++ trunk/reactos/dll/win32/urlmon/urlmon.rbuild [iso-8859-1] Thu Mar 4 19:50:24 2010 @@ -49,7 +49,7 @@ <define name="PROXY_DELEGATION"/> <define name="REGISTER_PROXY_DLL"/> <define name="_URLMON_"/> - <define name="PROXY_CLSID_IS">{0x79EAC9F1,0xBAF9,0x11CE,{0x8C,0x82,0x00,0xAA,0x00,0x4B,0xA9,0x0B}}</define> + <define name="PROXY_CLSID_IS">"{0x79EAC9F1,0xBAF9,0x11CE,{0x8C,0x82,0x00,0xAA,0x00,0x4B,0xA9,0x0B}}"</define> <file>urlmon_urlmon.idl</file> </module> </group>
14 years, 9 months
1
0
0
0
[janderwald] 45836: [KSPROXY] - Silence traces in IEnumPins interface - Partly implement IKsObject interface for COutputPin - Retrieve pin communication and pass it to constructor of CInputPin - Implement IKsPinEx and IMemInputPin interface for CInputPin - The DVBT network provider can now connect to the BDA Source Filter
by janderwald@svn.reactos.org
Author: janderwald Date: Thu Mar 4 18:34:22 2010 New Revision: 45836 URL:
http://svn.reactos.org/svn/reactos?rev=45836&view=rev
Log: [KSPROXY] - Silence traces in IEnumPins interface - Partly implement IKsObject interface for COutputPin - Retrieve pin communication and pass it to constructor of CInputPin - Implement IKsPinEx and IMemInputPin interface for CInputPin - The DVBT network provider can now connect to the BDA Source Filter Modified: trunk/reactos/dll/directx/ksproxy/enumpins.cpp trunk/reactos/dll/directx/ksproxy/input_pin.cpp trunk/reactos/dll/directx/ksproxy/ksproxy.rbuild trunk/reactos/dll/directx/ksproxy/output_pin.cpp trunk/reactos/dll/directx/ksproxy/precomp.h trunk/reactos/dll/directx/ksproxy/proxy.cpp Modified: trunk/reactos/dll/directx/ksproxy/enumpins.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/ksproxy/enumpi…
============================================================================== --- trunk/reactos/dll/directx/ksproxy/enumpins.cpp [iso-8859-1] (original) +++ trunk/reactos/dll/directx/ksproxy/enumpins.cpp [iso-8859-1] Thu Mar 4 18:34:22 2010 @@ -64,13 +64,6 @@ return NOERROR; } - WCHAR Buffer[MAX_PATH]; - LPOLESTR lpstr; - StringFromCLSID(refiid, &lpstr); - swprintf(Buffer, L"CEnumPins::QueryInterface: NoInterface for %s\n", lpstr); - OutputDebugStringW(Buffer); - CoTaskMemFree(lpstr); - return E_NOINTERFACE; } @@ -89,10 +82,6 @@ if (cPins > 1 && !pcFetched) return E_INVALIDARG; - WCHAR Buffer[MAX_PATH]; - swprintf(Buffer, L"CEnumPins::Next: this %p m_Index %lx cPins %u\n", this, m_Index, cPins); - OutputDebugStringW(Buffer); - while(i < cPins) { if (m_Index + i >= m_Pins.size()) @@ -110,7 +99,6 @@ } m_Index += i; - OutputDebugStringW(L"CEnumPins::Next: done\n"); if (i < cPins) return S_FALSE; else @@ -157,14 +145,6 @@ { CEnumPins * handler = new CEnumPins(Pins); -#ifdef MSDVBNP_TRACE - WCHAR Buffer[MAX_PATH]; - LPOLESTR lpstr; - StringFromCLSID(riid, &lpstr); - swprintf(Buffer, L"CEnumPins_fnConstructor riid %s pUnknown %p\n", lpstr, pUnknown); - OutputDebugStringW(Buffer); -#endif - if (!handler) return E_OUTOFMEMORY; Modified: trunk/reactos/dll/directx/ksproxy/input_pin.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/ksproxy/input_…
============================================================================== --- trunk/reactos/dll/directx/ksproxy/input_pin.cpp [iso-8859-1] (original) +++ trunk/reactos/dll/directx/ksproxy/input_pin.cpp [iso-8859-1] Thu Mar 4 18:34:22 2010 @@ -8,13 +8,32 @@ */ #include "precomp.h" +const GUID IID_IKsPinEx = {0x7bb38260L, 0xd19c, 0x11d2, {0xb3, 0x8a, 0x00, 0xa0, 0xc9, 0x5e, 0xc2, 0x2e}}; +const GUID KSPROPSETID_Connection = {0x1D58C920L, 0xAC9B, 0x11CF, {0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00}}; + +KSPIN_INTERFACE StandardPinInterface = +{ + {STATIC_KSINTERFACESETID_Standard}, + KSINTERFACE_STANDARD_STREAMING, + 0 +}; + +KSPIN_MEDIUM StandardPinMedium = +{ + {STATIC_KSMEDIUMSETID_Standard}, + KSMEDIUM_TYPE_ANYINSTANCE, + 0 +}; + + class CInputPin : public IPin, public IKsPropertySet, public IKsControl, - public IKsObject + public IKsObject, + public IKsPinEx, + public IMemInputPin /* public IQualityControl, - public IKsPinEx, public IKsPinPipe, public ISpecifyPropertyPages, public IStreamBuilder, @@ -71,8 +90,36 @@ HRESULT STDMETHODCALLTYPE KsMethod(PKSMETHOD Method, ULONG MethodLength, LPVOID MethodData, ULONG DataLength, ULONG* BytesReturned); HRESULT STDMETHODCALLTYPE KsEvent(PKSEVENT Event, ULONG EventLength, LPVOID EventData, ULONG DataLength, ULONG* BytesReturned); + //IKsPin + HRESULT STDMETHODCALLTYPE KsQueryMediums(PKSMULTIPLE_ITEM* MediumList); + HRESULT STDMETHODCALLTYPE KsQueryInterfaces(PKSMULTIPLE_ITEM* InterfaceList); + HRESULT STDMETHODCALLTYPE KsCreateSinkPinHandle(KSPIN_INTERFACE& Interface, KSPIN_MEDIUM& Medium); + HRESULT STDMETHODCALLTYPE KsGetCurrentCommunication(KSPIN_COMMUNICATION *Communication, KSPIN_INTERFACE *Interface, KSPIN_MEDIUM *Medium); + HRESULT STDMETHODCALLTYPE KsPropagateAcquire(); + HRESULT STDMETHODCALLTYPE KsDeliver(IMediaSample* Sample, ULONG Flags); + HRESULT STDMETHODCALLTYPE KsMediaSamplesCompleted(PKSSTREAM_SEGMENT StreamSegment); + IMemAllocator * STDMETHODCALLTYPE KsPeekAllocator(KSPEEKOPERATION Operation); + HRESULT STDMETHODCALLTYPE KsReceiveAllocator(IMemAllocator *MemAllocator); + HRESULT STDMETHODCALLTYPE KsRenegotiateAllocator(); + LONG STDMETHODCALLTYPE KsIncrementPendingIoCount(); + LONG STDMETHODCALLTYPE KsDecrementPendingIoCount(); + HRESULT STDMETHODCALLTYPE KsQualityNotify(ULONG Proportion, REFERENCE_TIME TimeDelta); + // IKsPinEx + VOID STDMETHODCALLTYPE KsNotifyError(IMediaSample* Sample, HRESULT hr); + + //IMemInputPin + HRESULT STDMETHODCALLTYPE GetAllocator(IMemAllocator **ppAllocator); + HRESULT STDMETHODCALLTYPE NotifyAllocator(IMemAllocator *pAllocator, BOOL bReadOnly); + HRESULT STDMETHODCALLTYPE GetAllocatorRequirements(ALLOCATOR_PROPERTIES *pProps); + HRESULT STDMETHODCALLTYPE Receive(IMediaSample *pSample); + HRESULT STDMETHODCALLTYPE ReceiveMultiple(IMediaSample **pSamples, long nSamples, long *nSamplesProcessed); + HRESULT STDMETHODCALLTYPE ReceiveCanBlock( void); + + //--------------------------------------------------------------- HRESULT STDMETHODCALLTYPE CheckFormat(const AM_MEDIA_TYPE *pmt); - CInputPin(IBaseFilter * ParentFilter, LPCWSTR PinName, HANDLE hFilter, ULONG PinId) : m_Ref(0), m_ParentFilter(ParentFilter), m_PinName(PinName), m_hFilter(hFilter), m_hPin(0), m_PinId(PinId){}; + HRESULT STDMETHODCALLTYPE CreatePin(); + HRESULT STDMETHODCALLTYPE CreatePinHandle(PKSPIN_MEDIUM Medium, PKSPIN_INTERFACE Interface, PKSDATAFORMAT DataFormat); + CInputPin(IBaseFilter * ParentFilter, LPCWSTR PinName, HANDLE hFilter, ULONG PinId, KSPIN_COMMUNICATION Communication) : m_Ref(0), m_ParentFilter(ParentFilter), m_PinName(PinName), m_hFilter(hFilter), m_hPin(0), m_PinId(PinId), m_MemAllocator(0), m_IoCount(0), m_Communication(Communication), m_Pin(0){}; virtual ~CInputPin(){}; protected: @@ -82,6 +129,12 @@ HANDLE m_hFilter; HANDLE m_hPin; ULONG m_PinId; + IMemAllocator * m_MemAllocator; + LONG m_IoCount; + KSPIN_COMMUNICATION m_Communication; + KSPIN_INTERFACE m_Interface; + KSPIN_MEDIUM m_Medium; + IPin * m_Pin; }; HRESULT @@ -99,12 +152,19 @@ reinterpret_cast<IUnknown*>(*Output)->AddRef(); return NOERROR; } + else if (IsEqualGUID(refiid, IID_IMemInputPin)) + { + *Output = (IMemInputPin*)(this); + reinterpret_cast<IMemInputPin*>(*Output)->AddRef(); + return NOERROR; + } else if (IsEqualGUID(refiid, IID_IKsObject)) { if (!m_hPin) { - OutputDebugStringW(L"CInputPin::QueryInterface IID_IKsObject Create PIN!!!\n"); - DebugBreak(); + HRESULT hr = CreatePin(); + if (FAILED(hr)) + return hr; } *Output = (IKsObject*)(this); @@ -115,8 +175,9 @@ { if (!m_hPin) { - OutputDebugStringW(L"CInputPin::QueryInterface IID_IKsPropertySet Create PIN!!!\n"); - DebugBreak(); + HRESULT hr = CreatePin(); + if (FAILED(hr)) + return hr; } *Output = (IKsPropertySet*)(this); @@ -127,14 +188,30 @@ { if (!m_hPin) { - OutputDebugStringW(L"CInputPin::QueryInterface IID_IKsControl Create PIN!!!\n"); - DebugBreak(); + HRESULT hr = CreatePin(); + if (FAILED(hr)) + return hr; } *Output = (IKsControl*)(this); reinterpret_cast<IKsControl*>(*Output)->AddRef(); return NOERROR; } + else if (IsEqualGUID(refiid, IID_IKsPin) || + IsEqualGUID(refiid, IID_IKsPinEx)) + { + if (!m_hPin) + { + HRESULT hr = CreatePin(); + if (FAILED(hr)) + return hr; + } + + *Output = (IKsPinEx*)(this); + reinterpret_cast<IKsPinEx*>(*Output)->AddRef(); + return NOERROR; + } + WCHAR Buffer[MAX_PATH]; LPOLESTR lpstr; @@ -145,6 +222,248 @@ return E_NOINTERFACE; } + +//------------------------------------------------------------------- +// IMemInputPin +// + + // +HRESULT +STDMETHODCALLTYPE +CInputPin::GetAllocator(IMemAllocator **ppAllocator) +{ + OutputDebugStringW(L"CInputPin::GetAllocator\n"); + return VFW_E_NO_ALLOCATOR; +} + +HRESULT +STDMETHODCALLTYPE +CInputPin::NotifyAllocator(IMemAllocator *pAllocator, BOOL bReadOnly) +{ + if (pAllocator) + { + pAllocator->AddRef(); + } + + if (m_MemAllocator) + { + m_MemAllocator->Release(); + } + + m_MemAllocator = pAllocator; + return NOERROR; +} + +HRESULT +STDMETHODCALLTYPE +CInputPin::GetAllocatorRequirements(ALLOCATOR_PROPERTIES *pProps) +{ + KSALLOCATOR_FRAMING Framing; + KSPROPERTY Property; + HRESULT hr; + ULONG BytesReturned; + + Property.Set = KSPROPSETID_Connection; + Property.Id = KSPROPERTY_CONNECTION_ALLOCATORFRAMING; + Property.Flags = KSPROPERTY_TYPE_SET; + + hr = KsProperty(&Property, sizeof(KSPROPERTY), (PVOID)&Framing, sizeof(KSALLOCATOR_FRAMING), &BytesReturned); + if (SUCCEEDED(hr)) + { + pProps->cBuffers = Framing.Frames; + pProps->cbBuffer = Framing.FrameSize; + pProps->cbAlign = Framing.FileAlignment; + pProps->cbPrefix = 0; + return hr; + } + else + return E_NOTIMPL; +} + +HRESULT +STDMETHODCALLTYPE +CInputPin::Receive(IMediaSample *pSample) +{ + OutputDebugStringW(L"CInputPin::Receive NotImplemented\n"); + return E_NOTIMPL; +} + +HRESULT +STDMETHODCALLTYPE +CInputPin::ReceiveMultiple(IMediaSample **pSamples, long nSamples, long *nSamplesProcessed) +{ + OutputDebugStringW(L"CInputPin::ReceiveMultiple NotImplemented\n"); + return E_NOTIMPL; +} + +HRESULT +STDMETHODCALLTYPE +CInputPin::ReceiveCanBlock( void) +{ + OutputDebugStringW(L"CInputPin::ReceiveCanBlock NotImplemented\n"); + return S_FALSE; +} + + +//------------------------------------------------------------------- +// IKsPin +// + +HRESULT +STDMETHODCALLTYPE +CInputPin::KsQueryMediums( + PKSMULTIPLE_ITEM* MediumList) +{ + return KsGetMultiplePinFactoryItems(m_hFilter, m_PinId, KSPROPERTY_PIN_MEDIUMS, (PVOID*)MediumList); +} + +HRESULT +STDMETHODCALLTYPE +CInputPin::KsQueryInterfaces( + PKSMULTIPLE_ITEM* InterfaceList) +{ + return KsGetMultiplePinFactoryItems(m_hFilter, m_PinId, KSPROPERTY_PIN_INTERFACES, (PVOID*)InterfaceList); +} + +HRESULT +STDMETHODCALLTYPE +CInputPin::KsCreateSinkPinHandle( + KSPIN_INTERFACE& Interface, + KSPIN_MEDIUM& Medium) +{ + OutputDebugStringW(L"CInputPin::KsCreateSinkPinHandle NotImplemented\n"); + return E_NOTIMPL; +} + +HRESULT +STDMETHODCALLTYPE +CInputPin::KsGetCurrentCommunication( + KSPIN_COMMUNICATION *Communication, + KSPIN_INTERFACE *Interface, + KSPIN_MEDIUM *Medium) +{ + if (Communication) + { + *Communication = m_Communication; + } + + if (Interface) + { + if (!m_hPin) + return VFW_E_NOT_CONNECTED; + + CopyMemory(Interface, &m_Interface, sizeof(KSPIN_INTERFACE)); + } + + if (Medium) + { + if (!m_hPin) + return VFW_E_NOT_CONNECTED; + + CopyMemory(Medium, &m_Medium, sizeof(KSPIN_MEDIUM)); + } + return NOERROR; +} + +HRESULT +STDMETHODCALLTYPE +CInputPin::KsPropagateAcquire() +{ + OutputDebugStringW(L"CInputPin::KsPropagateAcquire NotImplemented\n"); + return E_NOTIMPL; +} + +HRESULT +STDMETHODCALLTYPE +CInputPin::KsDeliver( + IMediaSample* Sample, + ULONG Flags) +{ + return E_FAIL; +} + +HRESULT +STDMETHODCALLTYPE +CInputPin::KsMediaSamplesCompleted(PKSSTREAM_SEGMENT StreamSegment) +{ + return NOERROR; +} + +IMemAllocator * +STDMETHODCALLTYPE +CInputPin::KsPeekAllocator(KSPEEKOPERATION Operation) +{ + if (Operation == KsPeekOperation_AddRef) + { + // add reference on allocator + m_MemAllocator->AddRef(); + } + + return m_MemAllocator; +} + +HRESULT +STDMETHODCALLTYPE +CInputPin::KsReceiveAllocator(IMemAllocator *MemAllocator) +{ + if (MemAllocator) + { + MemAllocator->AddRef(); + } + + if (m_MemAllocator) + { + m_MemAllocator->Release(); + } + + m_MemAllocator = MemAllocator; + return NOERROR; +} + +HRESULT +STDMETHODCALLTYPE +CInputPin::KsRenegotiateAllocator() +{ + return E_FAIL; +} + +LONG +STDMETHODCALLTYPE +CInputPin::KsIncrementPendingIoCount() +{ + return InterlockedIncrement((volatile LONG*)&m_IoCount); +} + +LONG +STDMETHODCALLTYPE +CInputPin::KsDecrementPendingIoCount() +{ + return InterlockedDecrement((volatile LONG*)&m_IoCount); +} + +HRESULT +STDMETHODCALLTYPE +CInputPin::KsQualityNotify( + ULONG Proportion, + REFERENCE_TIME TimeDelta) +{ + OutputDebugStringW(L"CInputPin::KsQualityNotify NotImplemented\n"); + return E_NOTIMPL; +} + +//------------------------------------------------------------------- +// IKsPinEx +// + +VOID +STDMETHODCALLTYPE +CInputPin::KsNotifyError( + IMediaSample* Sample, + HRESULT hr) +{ + OutputDebugStringW(L"CInputPin::KsNotifyError NotImplemented\n"); +} + //------------------------------------------------------------------- // IKsPropertySet @@ -314,25 +633,36 @@ STDMETHODCALLTYPE CInputPin::Connect(IPin *pReceivePin, const AM_MEDIA_TYPE *pmt) { - //MajorFormat: KSDATAFORMAT_TYPE_BDA_ANTENNA - //SubType: MEDIASUBTYPE_None - //FormatType: FORMAT_None - //bFixedSizeSamples 1 bTemporalCompression 0 lSampleSize 1 pUnk 00000000 cbFormat 0 pbFormat 00000000 - - //KSPROPSETID_Connection KSPROPERTY_CONNECTION_PROPOSEDATAFORMAT - //PriorityClass = KSPRIORITY_NORMAL PrioritySubClass = KSPRIORITY_NORMAL - - OutputDebugStringW(L"CInputPin::Connect NotImplemented\n"); - return E_NOTIMPL; + return NOERROR; } HRESULT STDMETHODCALLTYPE CInputPin::ReceiveConnection(IPin *pConnector, const AM_MEDIA_TYPE *pmt) { + HRESULT hr; + + if (m_Pin) + { + OutputDebugStringW(L"CInputPin::ReceiveConnection already connected\n"); + return VFW_E_ALREADY_CONNECTED; + } + + // first check format + hr = CheckFormat(pmt); + if (FAILED(hr)) + return hr; + + if (FAILED(CheckFormat(pmt))) + return hr; + + //FIXME create pin + m_Pin = pConnector; + m_Pin->AddRef(); + OutputDebugStringW(L"CInputPin::ReceiveConnection NotImplemented\n"); - return E_NOTIMPL; + return S_OK; } HRESULT STDMETHODCALLTYPE @@ -345,8 +675,18 @@ STDMETHODCALLTYPE CInputPin::ConnectedTo(IPin **pPin) { + if (!pPin) + return E_POINTER; + + if (m_Pin) + { + // increment reference count + m_Pin->AddRef(); + *pPin = m_Pin; + return S_OK; + } + *pPin = NULL; - OutputDebugStringW(L"CInputPin::ConnectedTo NotImplemented\n"); return VFW_E_NOT_CONNECTED; } HRESULT @@ -391,6 +731,56 @@ return S_OK; } +HRESULT +STDMETHODCALLTYPE +CInputPin::QueryAccept( + const AM_MEDIA_TYPE *pmt) +{ + return CheckFormat(pmt); +} +HRESULT +STDMETHODCALLTYPE +CInputPin::EnumMediaTypes(IEnumMediaTypes **ppEnum) +{ + return CEnumMediaTypes_fnConstructor(0, NULL, IID_IEnumMediaTypes, (void**)ppEnum); +} +HRESULT +STDMETHODCALLTYPE +CInputPin::QueryInternalConnections(IPin **apPin, ULONG *nPin) +{ + OutputDebugStringW(L"CInputPin::QueryInternalConnections NotImplemented\n"); + return E_NOTIMPL; +} +HRESULT +STDMETHODCALLTYPE +CInputPin::EndOfStream( void) +{ + OutputDebugStringW(L"CInputPin::EndOfStream NotImplemented\n"); + return E_NOTIMPL; +} +HRESULT +STDMETHODCALLTYPE +CInputPin::BeginFlush( void) +{ + OutputDebugStringW(L"CInputPin::BeginFlush NotImplemented\n"); + return E_NOTIMPL; +} +HRESULT +STDMETHODCALLTYPE +CInputPin::EndFlush( void) +{ + OutputDebugStringW(L"CInputPin::EndFlush NotImplemented\n"); + return E_NOTIMPL; +} +HRESULT +STDMETHODCALLTYPE +CInputPin::NewSegment(REFERENCE_TIME tStart, REFERENCE_TIME tStop, double dRate) +{ + OutputDebugStringW(L"CInputPin::NewSegment NotImplemented\n"); + return E_NOTIMPL; +} + +//------------------------------------------------------------------- HRESULT STDMETHODCALLTYPE CInputPin::CheckFormat( @@ -452,51 +842,118 @@ HRESULT STDMETHODCALLTYPE -CInputPin::QueryAccept( - const AM_MEDIA_TYPE *pmt) -{ - return CheckFormat(pmt); -} -HRESULT -STDMETHODCALLTYPE -CInputPin::EnumMediaTypes(IEnumMediaTypes **ppEnum) -{ - return CEnumMediaTypes_fnConstructor(0, NULL, IID_IEnumMediaTypes, (void**)ppEnum); -} -HRESULT -STDMETHODCALLTYPE -CInputPin::QueryInternalConnections(IPin **apPin, ULONG *nPin) -{ - OutputDebugStringW(L"CInputPin::QueryInternalConnections NotImplemented\n"); - return E_NOTIMPL; -} -HRESULT -STDMETHODCALLTYPE -CInputPin::EndOfStream( void) -{ - OutputDebugStringW(L"CInputPin::EndOfStream NotImplemented\n"); - return E_NOTIMPL; -} -HRESULT -STDMETHODCALLTYPE -CInputPin::BeginFlush( void) -{ - OutputDebugStringW(L"CInputPin::BeginFlush NotImplemented\n"); - return E_NOTIMPL; -} -HRESULT -STDMETHODCALLTYPE -CInputPin::EndFlush( void) -{ - OutputDebugStringW(L"CInputPin::EndFlush NotImplemented\n"); - return E_NOTIMPL; -} -HRESULT -STDMETHODCALLTYPE -CInputPin::NewSegment(REFERENCE_TIME tStart, REFERENCE_TIME tStop, double dRate) -{ - OutputDebugStringW(L"CInputPin::NewSegment NotImplemented\n"); - return E_NOTIMPL; +CInputPin::CreatePin() +{ + PKSMULTIPLE_ITEM MediumList; + PKSMULTIPLE_ITEM InterfaceList; + PKSMULTIPLE_ITEM DataFormatList = NULL; + PKSPIN_MEDIUM Medium; + PKSDATAFORMAT DataFormat; + PKSPIN_INTERFACE Interface; + HRESULT hr; + + // query for pin medium + hr = KsQueryMediums(&MediumList); + if (FAILED(hr)) + return hr; + + // query for pin interface + hr = KsQueryInterfaces(&InterfaceList); + if (FAILED(hr)) + { + // failed + CoTaskMemFree(MediumList); + return hr; + } + + // get data ranges + hr = KsGetMultiplePinFactoryItems(m_hFilter, m_PinId, KSPROPERTY_PIN_DATARANGES, (PVOID*)&DataFormatList); + if (FAILED(hr) || DataFormatList->Count == 0) + { + // failed + CoTaskMemFree(MediumList); + CoTaskMemFree(InterfaceList); + if (DataFormatList) + CoTaskMemFree(DataFormatList); + + return hr; + } + + if (MediumList->Count) + { + //use first available medium + Medium = (PKSPIN_MEDIUM)(MediumList + 1); + } + else + { + // default to standard medium + Medium = &StandardPinMedium; + } + + if (InterfaceList->Count) + { + //use first available interface + Interface = (PKSPIN_INTERFACE)(InterfaceList + 1); + } + else + { + // default to standard interface + Interface = &StandardPinInterface; + } + + //FIXME determine format + // use first available format + DataFormat = (PKSDATAFORMAT) (DataFormatList + 1); + + // now create pin + hr = CreatePinHandle(Medium, Interface, DataFormat); + + // free medium / interface / dataformat + CoTaskMemFree(DataFormatList); + CoTaskMemFree(MediumList); + CoTaskMemFree(InterfaceList); + + return hr; +} + +HRESULT +STDMETHODCALLTYPE +CInputPin::CreatePinHandle( + PKSPIN_MEDIUM Medium, + PKSPIN_INTERFACE Interface, + PKSDATAFORMAT DataFormat) +{ + PKSPIN_CONNECT PinConnect; + ULONG Length; + HRESULT hr; + + // calc format size + Length = sizeof(KSPIN_CONNECT) + DataFormat->FormatSize; + + // allocate pin connect + PinConnect = (PKSPIN_CONNECT)CoTaskMemAlloc(Length); + if (!PinConnect) + { + // failed + return E_OUTOFMEMORY; + } + + // setup request + CopyMemory(&PinConnect->Interface, Interface, sizeof(KSPIN_INTERFACE)); + CopyMemory(&PinConnect->Medium, Medium, sizeof(KSPIN_MEDIUM)); + PinConnect->PinId = m_PinId; + PinConnect->PinToHandle = NULL; + PinConnect->Priority.PriorityClass = KSPRIORITY_NORMAL; + PinConnect->Priority.PrioritySubClass = KSPRIORITY_NORMAL; + CopyMemory((PinConnect + 1), DataFormat, DataFormat->FormatSize); + + // create pin + hr = KsCreatePin(m_hFilter, PinConnect, GENERIC_WRITE, &m_hPin); + + // free pin connect + CoTaskMemFree(PinConnect); + + return hr; } HRESULT @@ -506,10 +963,11 @@ LPCWSTR PinName, HANDLE hFilter, ULONG PinId, + KSPIN_COMMUNICATION Communication, REFIID riid, LPVOID * ppv) { - CInputPin * handler = new CInputPin(ParentFilter, PinName, hFilter, PinId); + CInputPin * handler = new CInputPin(ParentFilter, PinName, hFilter, PinId, Communication); if (!handler) return E_OUTOFMEMORY; Modified: trunk/reactos/dll/directx/ksproxy/ksproxy.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/ksproxy/ksprox…
============================================================================== --- trunk/reactos/dll/directx/ksproxy/ksproxy.rbuild [iso-8859-1] (original) +++ trunk/reactos/dll/directx/ksproxy/ksproxy.rbuild [iso-8859-1] Thu Mar 4 18:34:22 2010 @@ -11,6 +11,7 @@ <library>setupapi</library> <library>msvcrt</library> <library>strmiids</library> + <library>ksuser</library> <group compilerset="gcc"> <compilerflag compiler="cxx">-fno-exceptions</compilerflag> <compilerflag compiler="cxx">-fno-rtti</compilerflag> Modified: trunk/reactos/dll/directx/ksproxy/output_pin.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/ksproxy/output…
============================================================================== --- trunk/reactos/dll/directx/ksproxy/output_pin.cpp [iso-8859-1] (original) +++ trunk/reactos/dll/directx/ksproxy/output_pin.cpp [iso-8859-1] Thu Mar 4 18:34:22 2010 @@ -8,10 +8,10 @@ */ #include "precomp.h" -class COutputPin : public IPin +class COutputPin : public IPin, + public IKsObject /* public IQualityControl, - public IKsObject, public IKsPinEx, public IKsPinPipe, public ISpecifyPropertyPages, @@ -61,6 +61,10 @@ HRESULT STDMETHODCALLTYPE EndFlush(); HRESULT STDMETHODCALLTYPE NewSegment(REFERENCE_TIME tStart, REFERENCE_TIME tStop, double dRate); + //IKsObject methods + HANDLE STDMETHODCALLTYPE KsGetObjectHandle(); + + COutputPin(IBaseFilter * ParentFilter, LPCWSTR PinName) : m_Ref(0), m_ParentFilter(ParentFilter), m_PinName(PinName){}; virtual ~COutputPin(){}; @@ -82,6 +86,12 @@ { *Output = PVOID(this); reinterpret_cast<IUnknown*>(*Output)->AddRef(); + return NOERROR; + } + else if (IsEqualGUID(refiid, IID_IKsObject)) + { + *Output = (IKsObject*)(this); + reinterpret_cast<IKsObject*>(*Output)->AddRef(); return NOERROR; } @@ -96,6 +106,20 @@ } //------------------------------------------------------------------- +// IKsObject +// +HANDLE +STDMETHODCALLTYPE +COutputPin::KsGetObjectHandle() +{ + OutputDebugStringW(L"COutputPin::KsGetObjectHandle CALLED\n"); + + //FIXME + // return pin handle + return NULL; +} + +//------------------------------------------------------------------- // IPin interface // HRESULT @@ -124,6 +148,7 @@ STDMETHODCALLTYPE COutputPin::ConnectedTo(IPin **pPin) { + *pPin = NULL; OutputDebugStringW(L"COutputPin::ConnectedTo called\n"); return VFW_E_NOT_CONNECTED; } Modified: trunk/reactos/dll/directx/ksproxy/precomp.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/ksproxy/precom…
============================================================================== --- trunk/reactos/dll/directx/ksproxy/precomp.h [iso-8859-1] (original) +++ trunk/reactos/dll/directx/ksproxy/precomp.h [iso-8859-1] Thu Mar 4 18:34:22 2010 @@ -107,6 +107,7 @@ LPCWSTR PinName, HANDLE hFilter, ULONG PinId, + KSPIN_COMMUNICATION Communication, REFIID riid, LPVOID * ppv); Modified: trunk/reactos/dll/directx/ksproxy/proxy.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/ksproxy/proxy.…
============================================================================== --- trunk/reactos/dll/directx/ksproxy/proxy.cpp [iso-8859-1] (original) +++ trunk/reactos/dll/directx/ksproxy/proxy.cpp [iso-8859-1] Thu Mar 4 18:34:22 2010 @@ -95,6 +95,7 @@ HRESULT STDMETHODCALLTYPE GetPinInstanceCount(ULONG PinId, PKSPIN_CINSTANCES Instances); HRESULT STDMETHODCALLTYPE GetPinDataflow(ULONG PinId, KSPIN_DATAFLOW * DataFlow); HRESULT STDMETHODCALLTYPE GetPinName(ULONG PinId, KSPIN_DATAFLOW DataFlow, ULONG PinCount, LPWSTR * OutPinName); + HRESULT STDMETHODCALLTYPE GetPinCommunication(ULONG PinId, KSPIN_COMMUNICATION * Communication); HRESULT STDMETHODCALLTYPE CreatePins(); protected: LONG m_Ref; @@ -352,6 +353,25 @@ HRESULT STDMETHODCALLTYPE +CKsProxy::GetPinCommunication( + ULONG PinId, + KSPIN_COMMUNICATION * Communication) +{ + KSP_PIN Property; + ULONG BytesReturned; + + // setup request + Property.Property.Set = KSPROPSETID_Pin; + Property.Property.Id = KSPROPERTY_PIN_COMMUNICATION; + Property.Property.Flags = KSPROPERTY_TYPE_GET; + Property.PinId = PinId; + Property.Reserved = 0; + + return KsSynchronousDeviceControl(m_hDevice, IOCTL_KS_PROPERTY, (PVOID)&Property, sizeof(KSP_PIN), (PVOID)Communication, sizeof(KSPIN_COMMUNICATION), &BytesReturned); +} + +HRESULT +STDMETHODCALLTYPE CKsProxy::GetPinDataflow( ULONG PinId, KSPIN_DATAFLOW * DataFlow) @@ -446,6 +466,7 @@ ULONG NumPins, Index; KSPIN_CINSTANCES Instances; KSPIN_DATAFLOW DataFlow; + KSPIN_COMMUNICATION Communication; HRESULT hr; WCHAR Buffer[100]; LPWSTR PinName; @@ -465,6 +486,11 @@ if (FAILED(hr)) continue; + // query pin communication; + hr = GetPinCommunication(Index, &Communication); + if (FAILED(hr)) + continue; + if (Instances.CurrentCount == Instances.PossibleCount) { // already maximum reached for this pin @@ -487,7 +513,7 @@ // construct the pins if (DataFlow == KSPIN_DATAFLOW_IN) { - hr = CInputPin_Constructor((IBaseFilter*)this, PinName, m_hDevice, Index, IID_IPin, (void**)&pPin); + hr = CInputPin_Constructor((IBaseFilter*)this, PinName, m_hDevice, Index, Communication, IID_IPin, (void**)&pPin); if (FAILED(hr)) { CoTaskMemFree(PinName);
14 years, 9 months
1
0
0
0
[cwittich] 45835: [ATL] sync atl to wine 1.1.39
by cwittich@svn.reactos.org
Author: cwittich Date: Thu Mar 4 16:28:42 2010 New Revision: 45835 URL:
http://svn.reactos.org/svn/reactos?rev=45835&view=rev
Log: [ATL] sync atl to wine 1.1.39 Modified: trunk/reactos/dll/win32/atl/atl_ax.c trunk/reactos/dll/win32/atl/atl_main.c trunk/reactos/dll/win32/atl/atlbase.h Modified: trunk/reactos/dll/win32/atl/atl_ax.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/atl/atl_ax.c?rev…
============================================================================== --- trunk/reactos/dll/win32/atl/atl_ax.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/atl/atl_ax.c [iso-8859-1] Thu Mar 4 16:28:42 2010 @@ -1208,7 +1208,7 @@ int length; WCHAR *nameW; - if ( HIWORD(name) == 0 ) + if (IS_INTRESOURCE(name)) return AtlAxCreateDialogW( hInst, (LPCWSTR) name, owner, dlgProc, param ); length = MultiByteToWideChar( CP_ACP, 0, name, -1, NULL, 0 ); Modified: trunk/reactos/dll/win32/atl/atl_main.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/atl/atl_main.c?r…
============================================================================== --- trunk/reactos/dll/win32/atl/atl_main.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/atl/atl_main.c [iso-8859-1] Thu Mar 4 16:28:42 2010 @@ -97,6 +97,19 @@ return S_OK; } +static _ATL_OBJMAP_ENTRYW_V1 *get_objmap_entry( _ATL_MODULEW *mod, unsigned int index ) +{ + _ATL_OBJMAP_ENTRYW_V1 *ret; + + if (mod->cbSize == ATLVer1Size) + ret = (_ATL_OBJMAP_ENTRYW_V1 *)mod->m_pObjMap + index; + else + ret = (_ATL_OBJMAP_ENTRYW_V1 *)(mod->m_pObjMap + index); + + if (!ret->pclsid) ret = NULL; + return ret; +} + HRESULT WINAPI AtlModuleLoadTypeLib(_ATL_MODULEW *pM, LPCOLESTR lpszIndex, BSTR *pbstrPath, ITypeLib **ppTypeLib) { @@ -158,6 +171,7 @@ HRESULT WINAPI AtlModuleRegisterClassObjects(_ATL_MODULEW *pM, DWORD dwClsContext, DWORD dwFlags) { + _ATL_OBJMAP_ENTRYW_V1 *obj; HRESULT hRes = S_OK; int i=0; @@ -166,10 +180,9 @@ if (pM == NULL) return E_INVALIDARG; - while(pM->m_pObjMap[i].pclsid != NULL) + while ((obj = get_objmap_entry( pM, i++ ))) { IUnknown* pUnknown; - _ATL_OBJMAP_ENTRYW *obj = &(pM->m_pObjMap[i]); HRESULT rc; TRACE("Registering object %i\n",i); @@ -185,7 +198,6 @@ IUnknown_Release(pUnknown); } } - i++; } return hRes; @@ -269,6 +281,7 @@ */ HRESULT WINAPI AtlModuleRegisterServer(_ATL_MODULEW* pM, BOOL bRegTypeLib, const CLSID* clsid) { + const _ATL_OBJMAP_ENTRYW_V1 *obj; int i; HRESULT hRes; @@ -277,12 +290,10 @@ if (pM == NULL) return E_INVALIDARG; - for (i = 0; pM->m_pObjMap[i].pclsid != NULL; i++) /* register CLSIDs */ - { - if (!clsid || IsEqualCLSID(pM->m_pObjMap[i].pclsid, clsid)) - { - const _ATL_OBJMAP_ENTRYW *obj = &pM->m_pObjMap[i]; - + for (i = 0; (obj = get_objmap_entry( pM, i )) != NULL; i++) /* register CLSIDs */ + { + if (!clsid || IsEqualCLSID(obj->pclsid, clsid)) + { TRACE("Registering clsid %s\n", debugstr_guid(obj->pclsid)); hRes = obj->pfnUpdateRegistry(TRUE); /* register */ if (FAILED(hRes)) @@ -351,6 +362,7 @@ HRESULT WINAPI AtlModuleGetClassObject(_ATL_MODULEW *pm, REFCLSID rclsid, REFIID riid, LPVOID *ppv) { + _ATL_OBJMAP_ENTRYW_V1 *obj; int i; HRESULT hres = CLASS_E_CLASSNOTAVAILABLE; @@ -359,12 +371,10 @@ if (pm == NULL) return E_INVALIDARG; - for (i = 0; pm->m_pObjMap[i].pclsid != NULL; i++) - { - if (IsEqualCLSID(pm->m_pObjMap[i].pclsid, rclsid)) - { - _ATL_OBJMAP_ENTRYW *obj = &pm->m_pObjMap[i]; - + for (i = 0; (obj = get_objmap_entry( pm, i )) != NULL; i++) + { + if (IsEqualCLSID(obj->pclsid, rclsid)) + { TRACE("found object %i\n", i); if (obj->pfnGetClassObject) { Modified: trunk/reactos/dll/win32/atl/atlbase.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/atl/atlbase.h?re…
============================================================================== --- trunk/reactos/dll/win32/atl/atlbase.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/atl/atlbase.h [iso-8859-1] Thu Mar 4 16:28:42 2010 @@ -32,6 +32,28 @@ typedef LPCWSTR (WINAPI _ATL_DESCRIPTIONFUNCW)(void); typedef const struct _ATL_CATMAP_ENTRY* (_ATL_CATMAPFUNC)(void); typedef void (WINAPI _ATL_TERMFUNC)(DWORD dw); + +typedef struct _ATL_OBJMAP_ENTRYA_V1_TAG +{ + const CLSID* pclsid; + HRESULT (WINAPI *pfnUpdateRegistry)(BOOL bRegister); + _ATL_CREATORFUNC* pfnGetClassObject; + _ATL_CREATORFUNC* pfnCreateInstance; + IUnknown* pCF; + DWORD dwRegister; + _ATL_DESCRIPTIONFUNCA* pfnGetObjectDescription; +}_ATL_OBJMAP_ENTRYA_V1; + +typedef struct _ATL_OBJMAP_ENTRYW_V1_TAG +{ + const CLSID* pclsid; + HRESULT (WINAPI *pfnUpdateRegistry)(BOOL bRegister); + _ATL_CREATORFUNC* pfnGetClassObject; + _ATL_CREATORFUNC* pfnCreateInstance; + IUnknown* pCF; + DWORD dwRegister; + _ATL_DESCRIPTIONFUNCW* pfnGetObjectDescription; +} _ATL_OBJMAP_ENTRYW_V1; typedef struct _ATL_OBJMAP_ENTRYA_TAG {
14 years, 9 months
1
0
0
0
[cwittich] 45834: [URLMON] sync urlmon to wine 1.1.39
by cwittich@svn.reactos.org
Author: cwittich Date: Thu Mar 4 16:24:17 2010 New Revision: 45834 URL:
http://svn.reactos.org/svn/reactos?rev=45834&view=rev
Log: [URLMON] sync urlmon to wine 1.1.39 Added: trunk/reactos/dll/win32/urlmon/uri.c (with props) trunk/reactos/dll/win32/urlmon/urlmon_urlmon.idl (with props) trunk/reactos/dll/win32/urlmon/usrmarshal.c (with props) Removed: trunk/reactos/dll/win32/urlmon/urlmon_local.idl Modified: trunk/reactos/dll/win32/urlmon/binding.c trunk/reactos/dll/win32/urlmon/bindprot.c trunk/reactos/dll/win32/urlmon/download.c trunk/reactos/dll/win32/urlmon/http.c trunk/reactos/dll/win32/urlmon/internet.c trunk/reactos/dll/win32/urlmon/protocol.c trunk/reactos/dll/win32/urlmon/regsvr.c trunk/reactos/dll/win32/urlmon/sec_mgr.c trunk/reactos/dll/win32/urlmon/urlmon.inf trunk/reactos/dll/win32/urlmon/urlmon.rbuild trunk/reactos/dll/win32/urlmon/urlmon.spec trunk/reactos/dll/win32/urlmon/urlmon_main.c trunk/reactos/dll/win32/urlmon/urlmon_main.h trunk/reactos/include/psdk/urlmon.idl Modified: trunk/reactos/dll/win32/urlmon/binding.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/urlmon/binding.c…
============================================================================== --- trunk/reactos/dll/win32/urlmon/binding.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/urlmon/binding.c [iso-8859-1] Thu Mar 4 16:24:17 2010 @@ -98,6 +98,7 @@ LPWSTR mime; UINT clipboard_format; LPWSTR url; + LPWSTR redirect_url; IID iid; BOOL report_mime; DWORD state; @@ -829,6 +830,7 @@ This->section.DebugInfo->Spare[0] = 0; DeleteCriticalSection(&This->section); heap_free(This->mime); + heap_free(This->redirect_url); heap_free(This->url); heap_free(This); @@ -966,6 +968,11 @@ break; case BINDSTATUS_CONNECTING: on_progress(This, 0, 0, BINDSTATUS_CONNECTING, szStatusText); + break; + case BINDSTATUS_REDIRECTING: + heap_free(This->redirect_url); + This->redirect_url = heap_strdupW(szStatusText); + on_progress(This, 0, 0, BINDSTATUS_REDIRECTING, szStatusText); break; case BINDSTATUS_BEGINDOWNLOADDATA: fill_stgmed_buffer(This->stgmed_buf); @@ -1474,6 +1481,8 @@ if(binding_ctx) { set_binding_sink(binding->protocol, PROTSINK(binding)); + if(binding_ctx->redirect_url) + IBindStatusCallback_OnProgress(binding->callback, 0, 0, BINDSTATUS_REDIRECTING, binding_ctx->redirect_url); report_data(binding, 0, 0, 0); }else { hres = IInternetProtocol_Start(binding->protocol, url, PROTSINK(binding), Modified: trunk/reactos/dll/win32/urlmon/bindprot.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/urlmon/bindprot.…
============================================================================== --- trunk/reactos/dll/win32/urlmon/bindprot.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/urlmon/bindprot.c [iso-8859-1] Thu Mar 4 16:24:17 2010 @@ -205,7 +205,7 @@ This->task_queue_tail = task; }else { This->task_queue_tail = This->task_queue_head = task; - do_post = TRUE; + do_post = !This->continue_call; } LeaveCriticalSection(&This->section); @@ -960,6 +960,7 @@ switch(status_code) { case BINDSTATUS_FINDINGRESOURCE: case BINDSTATUS_CONNECTING: + case BINDSTATUS_REDIRECTING: case BINDSTATUS_BEGINDOWNLOADDATA: case BINDSTATUS_SENDINGREQUEST: case BINDSTATUS_CACHEFILENAMEAVAILABLE: Modified: trunk/reactos/dll/win32/urlmon/download.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/urlmon/download.…
============================================================================== --- trunk/reactos/dll/win32/urlmon/download.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/urlmon/download.c [iso-8859-1] Thu Mar 4 16:24:17 2010 @@ -140,6 +140,7 @@ debugstr_w(szStatusText)); switch(ulStatusCode) { + case BINDSTATUS_CONNECTING: case BINDSTATUS_BEGINDOWNLOADDATA: case BINDSTATUS_DOWNLOADINGDATA: case BINDSTATUS_ENDDOWNLOADDATA: @@ -153,8 +154,7 @@ This->cache_file = heap_strdupW(szStatusText); break; - case BINDSTATUS_FINDINGRESOURCE: - case BINDSTATUS_CONNECTING: + case BINDSTATUS_FINDINGRESOURCE: /* FIXME */ break; default: Modified: trunk/reactos/dll/win32/urlmon/http.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/urlmon/http.c?re…
============================================================================== --- trunk/reactos/dll/win32/urlmon/http.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/urlmon/http.c [iso-8859-1] Thu Mar 4 16:24:17 2010 @@ -17,11 +17,6 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -/* - * TODO: - * - Handle redirects as native. - */ - #include "urlmon_main.h" #include "wininet.h" @@ -84,7 +79,7 @@ URL_COMPONENTSW url_comp; BYTE security_id[512]; DWORD len = 0; - ULONG num = 0; + ULONG num; BOOL res, b; HRESULT hres; @@ -95,7 +90,7 @@ memset(&url_comp, 0, sizeof(url_comp)); url_comp.dwStructSize = sizeof(url_comp); - url_comp.dwSchemeLength = url_comp.dwHostNameLength = url_comp.dwUrlPathLength = + url_comp.dwSchemeLength = url_comp.dwHostNameLength = url_comp.dwUrlPathLength = url_comp.dwExtraInfoLength = url_comp.dwUserNameLength = url_comp.dwPasswordLength = 1; if (!InternetCrackUrlW(url, 0, 0, &url_comp)) return MK_E_SYNTAX; @@ -124,7 +119,12 @@ } accept_mimes[num] = 0; - path = heap_strndupW(url_comp.lpszUrlPath, url_comp.dwUrlPathLength); + path = heap_alloc((url_comp.dwUrlPathLength+url_comp.dwExtraInfoLength+1)*sizeof(WCHAR)); + if(url_comp.dwUrlPathLength) + memcpy(path, url_comp.lpszUrlPath, url_comp.dwUrlPathLength*sizeof(WCHAR)); + if(url_comp.dwExtraInfoLength) + memcpy(path+url_comp.dwUrlPathLength, url_comp.lpszExtraInfo, url_comp.dwExtraInfoLength*sizeof(WCHAR)); + path[url_comp.dwUrlPathLength+url_comp.dwExtraInfoLength] = 0; if(This->https) request_flags |= INTERNET_FLAG_SECURE; This->base.request = HttpOpenRequestW(This->base.connection, @@ -132,8 +132,8 @@ ? wszBindVerb[This->base.bind_info.dwBindVerb] : This->base.bind_info.szCustomVerb, path, NULL, NULL, (LPCWSTR *)accept_mimes, request_flags, (DWORD_PTR)&This->base); heap_free(path); - while (num<sizeof(accept_mimes)/sizeof(accept_mimes[0]) && accept_mimes[num]) - CoTaskMemFree(accept_mimes[num++]); + while(num--) + CoTaskMemFree(accept_mimes[num]); if (!This->base.request) { WARN("HttpOpenRequest failed: %d\n", GetLastError()); return INET_E_RESOURCE_NOT_FOUND; @@ -227,7 +227,7 @@ static HRESULT HttpProtocol_start_downloading(Protocol *prot) { HttpProtocol *This = ASYNCPROTOCOL_THIS(prot); - LPWSTR content_type = 0, content_length = 0; + LPWSTR content_type, content_length, ranges; DWORD len = sizeof(DWORD); DWORD status_code; BOOL res; @@ -258,8 +258,11 @@ WARN("HttpQueryInfo failed: %d\n", GetLastError()); } - if(This->https) + ranges = query_http_info(This, HTTP_QUERY_ACCEPT_RANGES); + if(ranges) { IInternetProtocolSink_ReportProgress(This->base.protocol_sink, BINDSTATUS_ACCEPTRANGES, NULL); + heap_free(ranges); + } content_type = query_http_info(This, HTTP_QUERY_CONTENT_TYPE); if(content_type) { Modified: trunk/reactos/dll/win32/urlmon/internet.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/urlmon/internet.…
============================================================================== --- trunk/reactos/dll/win32/urlmon/internet.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/urlmon/internet.c [iso-8859-1] Thu Mar 4 16:24:17 2010 @@ -38,6 +38,9 @@ if(ptr) len = ptr-url; + if(rsize) + *rsize = len; + if(len >= size) return E_POINTER; @@ -45,9 +48,6 @@ memcpy(result, url, len*sizeof(WCHAR)); result[len] = 0; - if(rsize) - *rsize = len; - return S_OK; } @@ -168,6 +168,100 @@ } return E_FAIL; +} + +static HRESULT parse_domain(LPCWSTR url, DWORD flags, LPWSTR result, + DWORD size, DWORD *rsize) +{ + IInternetProtocolInfo *protocol_info; + HRESULT hres; + + TRACE("(%s %08x %p %d %p)\n", debugstr_w(url), flags, result, size, rsize); + + protocol_info = get_protocol_info(url); + + if(protocol_info) { + hres = IInternetProtocolInfo_ParseUrl(protocol_info, url, PARSE_DOMAIN, + flags, result, size, rsize, 0); + IInternetProtocolInfo_Release(protocol_info); + if(SUCCEEDED(hres)) + return hres; + } + + hres = UrlGetPartW(url, result, &size, URL_PART_HOSTNAME, flags); + if(rsize) + *rsize = size; + + if(hres == E_POINTER) + return S_FALSE; + + if(FAILED(hres)) + return E_FAIL; + return S_OK; +} + +static HRESULT parse_rootdocument(LPCWSTR url, DWORD flags, LPWSTR result, + DWORD size, DWORD *rsize) +{ + IInternetProtocolInfo *protocol_info; + PARSEDURLW url_info; + HRESULT hres; + + TRACE("(%s %08x %p %d %p)\n", debugstr_w(url), flags, result, size, rsize); + + protocol_info = get_protocol_info(url); + + if(protocol_info) { + hres = IInternetProtocolInfo_ParseUrl(protocol_info, url, PARSE_ROOTDOCUMENT, + flags, result, size, rsize, 0); + IInternetProtocolInfo_Release(protocol_info); + if(SUCCEEDED(hres)) + return hres; + } + + url_info.cbSize = sizeof(url_info); + if(FAILED(ParseURLW(url, &url_info))) + return E_FAIL; + + switch(url_info.nScheme) { + case URL_SCHEME_FTP: + case URL_SCHEME_HTTP: + case URL_SCHEME_HTTPS: + if(url_info.cchSuffix<3 || *(url_info.pszSuffix)!='/' + || *(url_info.pszSuffix+1)!='/') + return E_FAIL; + + if(size < url_info.cchProtocol+3) { + size = 0; + hres = UrlGetPartW(url, result, &size, URL_PART_HOSTNAME, flags); + + if(rsize) + *rsize = size+url_info.cchProtocol+3; + + if(hres == E_POINTER) + return S_FALSE; + + return hres; + } + + size -= url_info.cchProtocol+3; + hres = UrlGetPartW(url, result+url_info.cchProtocol+3, + &size, URL_PART_HOSTNAME, flags); + + if(hres == E_POINTER) + return S_FALSE; + + if(FAILED(hres)) + return E_FAIL; + + if(rsize) + *rsize = size+url_info.cchProtocol+3; + + memcpy(result, url, (url_info.cchProtocol+3)*sizeof(WCHAR)); + return hres; + default: + return E_FAIL; + } } /************************************************************************** @@ -192,6 +286,10 @@ return parse_schema(pwzUrl, dwFlags, pszResult, cchResult, pcchResult); case PARSE_SECURITY_DOMAIN: return parse_security_domain(pwzUrl, dwFlags, pszResult, cchResult, pcchResult); + case PARSE_DOMAIN: + return parse_domain(pwzUrl, dwFlags, pszResult, cchResult, pcchResult); + case PARSE_ROOTDOCUMENT: + return parse_rootdocument(pwzUrl, dwFlags, pszResult, cchResult, pcchResult); default: FIXME("not supported action %d\n", ParseAction); } Modified: trunk/reactos/dll/win32/urlmon/protocol.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/urlmon/protocol.…
============================================================================== --- trunk/reactos/dll/win32/urlmon/protocol.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/urlmon/protocol.c [iso-8859-1] Thu Mar 4 16:24:17 2010 @@ -151,6 +151,11 @@ report_progress(protocol, BINDSTATUS_SENDINGREQUEST, (LPWSTR)status_info); break; + case INTERNET_STATUS_REDIRECT: + TRACE("%p INTERNET_STATUS_REDIRECT\n", protocol); + report_progress(protocol, BINDSTATUS_REDIRECTING, (LPWSTR)status_info); + break; + case INTERNET_STATUS_REQUEST_COMPLETE: request_complete(protocol, status_info); break; Modified: trunk/reactos/dll/win32/urlmon/regsvr.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/urlmon/regsvr.c?…
============================================================================== --- trunk/reactos/dll/win32/urlmon/regsvr.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/urlmon/regsvr.c [iso-8859-1] Thu Mar 4 16:24:17 2010 @@ -495,6 +495,12 @@ "urlmon.dll", "Both" }, + { &CLSID_PSFactoryBuffer, + "URLMoniker ProxyStub Factory", + NULL, + "urlmon.dll", + "Apartment" + }, { NULL } /* list terminator */ }; @@ -573,12 +579,14 @@ TRACE("\n"); - hr = register_coclasses(coclass_list); - if (SUCCEEDED(hr)) + hr = URLMON_DllRegisterServer(); + if(SUCCEEDED(hr)) + hr = register_coclasses(coclass_list); + if(SUCCEEDED(hr)) hr = register_interfaces(interface_list); - if(FAILED(hr)) - return hr; - return register_inf(TRUE); + if(SUCCEEDED(hr)) + hr = register_inf(TRUE); + return hr; } /*********************************************************************** @@ -590,10 +598,12 @@ TRACE("\n"); - hr = unregister_coclasses(coclass_list); - if (SUCCEEDED(hr)) + hr = URLMON_DllUnregisterServer(); + if(SUCCEEDED(hr)) + hr = unregister_coclasses(coclass_list); + if(SUCCEEDED(hr)) hr = unregister_interfaces(interface_list); - if(FAILED(hr)) - return hr; - return register_inf(FALSE); -} + if(SUCCEEDED(hr)) + hr = register_inf(FALSE); + return hr; +} Modified: trunk/reactos/dll/win32/urlmon/sec_mgr.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/urlmon/sec_mgr.c…
============================================================================== --- trunk/reactos/dll/win32/urlmon/sec_mgr.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/urlmon/sec_mgr.c [iso-8859-1] Thu Mar 4 16:24:17 2010 @@ -147,12 +147,18 @@ DWORD size=0; HRESULT hres; - secur_url = heap_alloc(INTERNET_MAX_URL_LENGTH*sizeof(WCHAR)); *zone = -1; - hres = CoInternetParseUrl(url, PARSE_SECURITY_URL, 0, secur_url, INTERNET_MAX_URL_LENGTH, &size, 0); - if(hres != S_OK) - strcpyW(secur_url, url); + hres = CoInternetGetSecurityUrl(url, &secur_url, PSU_SECURITY_URL_ONLY, 0); + if(hres != S_OK) { + size = strlenW(url)*sizeof(WCHAR); + + secur_url = heap_alloc(size); + if(!secur_url) + return E_OUTOFMEMORY; + + memcpy(secur_url, url, size); + } hres = CoInternetParseUrl(secur_url, PARSE_SCHEMA, 0, schema, sizeof(schema)/sizeof(WCHAR), &size, 0); if(FAILED(hres) || !*schema) { @@ -1228,3 +1234,84 @@ TRACE("(%p %p %x)\n", pSP, ppZM, dwReserved); return ZoneMgrImpl_Construct(NULL, (void**)ppZM); } + +/******************************************************************** + * CoInternetGetSecurityUrl (URLMON.@) + */ +HRESULT WINAPI CoInternetGetSecurityUrl(LPCWSTR pwzUrl, LPWSTR *ppwzSecUrl, PSUACTION psuAction, DWORD dwReserved) +{ + WCHAR buf1[INTERNET_MAX_URL_LENGTH], buf2[INTERNET_MAX_URL_LENGTH]; + LPWSTR url, domain; + DWORD len; + HRESULT hres; + + TRACE("(%p,%p,%u,%u)\n", pwzUrl, ppwzSecUrl, psuAction, dwReserved); + + url = buf1; + domain = buf2; + strcpyW(url, pwzUrl); + + while(1) { + hres = CoInternetParseUrl(url, PARSE_SECURITY_URL, 0, domain, INTERNET_MAX_URL_LENGTH, &len, 0); + if(hres!=S_OK || !strcmpW(url, domain)) + break; + + if(url == buf1) { + url = buf2; + domain = buf1; + } else { + url = buf1; + domain = buf2; + } + } + + if(psuAction==PSU_SECURITY_URL_ONLY) { + len = lstrlenW(url)+1; + *ppwzSecUrl = CoTaskMemAlloc(len*sizeof(WCHAR)); + if(!*ppwzSecUrl) + return E_OUTOFMEMORY; + + memcpy(*ppwzSecUrl, url, len*sizeof(WCHAR)); + return S_OK; + } + + hres = CoInternetParseUrl(url, PARSE_SECURITY_DOMAIN, 0, domain, + INTERNET_MAX_URL_LENGTH, &len, 0); + if(SUCCEEDED(hres)) { + len++; + *ppwzSecUrl = CoTaskMemAlloc(len*sizeof(WCHAR)); + if(!*ppwzSecUrl) + return E_OUTOFMEMORY; + + memcpy(*ppwzSecUrl, domain, len*sizeof(WCHAR)); + return S_OK; + } + + hres = CoInternetParseUrl(url, PARSE_ROOTDOCUMENT, 0, domain, 0, &len, 0); + if(hres == S_FALSE) { + hres = CoInternetParseUrl(url, PARSE_SCHEMA, 0, domain, + INTERNET_MAX_URL_LENGTH, &len, 0); + if(hres == S_OK) { + domain[len] = ':'; + hres = CoInternetParseUrl(url, PARSE_DOMAIN, 0, domain+len+1, + INTERNET_MAX_URL_LENGTH-len-1, &len, 0); + if(hres == S_OK) { + len = lstrlenW(domain)+1; + *ppwzSecUrl = CoTaskMemAlloc(len*sizeof(WCHAR)); + if(!*ppwzSecUrl) + return E_OUTOFMEMORY; + + memcpy(*ppwzSecUrl, domain, len*sizeof(WCHAR)); + return S_OK; + } + } + } + + len = lstrlenW(url)+1; + *ppwzSecUrl = CoTaskMemAlloc(len*sizeof(WCHAR)); + if(!*ppwzSecUrl) + return E_OUTOFMEMORY; + + memcpy(*ppwzSecUrl, url, len*sizeof(WCHAR)); + return S_OK; +} Added: trunk/reactos/dll/win32/urlmon/uri.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/urlmon/uri.c?rev…
============================================================================== --- trunk/reactos/dll/win32/urlmon/uri.c (added) +++ trunk/reactos/dll/win32/urlmon/uri.c [iso-8859-1] Thu Mar 4 16:24:17 2010 @@ -1,0 +1,302 @@ +/* + * Copyright 2010 Jacek Caban for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include "urlmon_main.h" +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(urlmon); + +typedef struct { + const IUriVtbl *lpIUriVtbl; + LONG ref; +} Uri; + +#define URI(x) ((IUri*) &(x)->lpIUriVtbl) + +#define URI_THIS(iface) DEFINE_THIS(Uri, IUri, iface) + +static HRESULT WINAPI Uri_QueryInterface(IUri *iface, REFIID riid, void **ppv) +{ + Uri *This = URI_THIS(iface); + + if(IsEqualGUID(&IID_IUnknown, riid)) { + TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv); + *ppv = URI(This); + }else if(IsEqualGUID(&IID_IUri, riid)) { + TRACE("(%p)->(IID_IUri %p)\n", This, ppv); + *ppv = URI(This); + }else { + TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), ppv); + *ppv = NULL; + return E_NOINTERFACE; + } + + IUnknown_AddRef((IUnknown*)*ppv); + return S_OK; +} + +static ULONG WINAPI Uri_AddRef(IUri *iface) +{ + Uri *This = URI_THIS(iface); + LONG ref = InterlockedIncrement(&This->ref); + + TRACE("(%p) ref=%d\n", This, ref); + + return ref; +} + +static ULONG WINAPI Uri_Release(IUri *iface) +{ + Uri *This = URI_THIS(iface); + LONG ref = InterlockedDecrement(&This->ref); + + TRACE("(%p) ref=%d\n", This, ref); + + if(!ref) + heap_free(This); + + return ref; +} + +static HRESULT WINAPI Uri_GetPropertyBSTR(IUri *iface, Uri_PROPERTY uriProp, BSTR *pbstrProperty, DWORD dwFlags) +{ + Uri *This = URI_THIS(iface); + FIXME("(%p)->(%d %p %x)\n", This, uriProp, pbstrProperty, dwFlags); + return E_NOTIMPL; +} + +static HRESULT WINAPI Uri_GetPropertyLength(IUri *iface, Uri_PROPERTY uriProp, DWORD *pcchProperty, DWORD dwFlags) +{ + Uri *This = URI_THIS(iface); + FIXME("(%p)->(%d %p %x)\n", This, uriProp, pcchProperty, dwFlags); + return E_NOTIMPL; +} + +static HRESULT WINAPI Uri_GetPropertyDWORD(IUri *iface, Uri_PROPERTY uriProp, DWORD *pcchProperty, DWORD dwFlags) +{ + Uri *This = URI_THIS(iface); + FIXME("(%p)->(%d %p %x)\n", This, uriProp, pcchProperty, dwFlags); + return E_NOTIMPL; +} + +static HRESULT WINAPI Uri_HasProperty(IUri *iface, Uri_PROPERTY uriProp, BOOL *pfHasProperty) +{ + Uri *This = URI_THIS(iface); + FIXME("(%p)->()\n", This); + return E_NOTIMPL; +} + +static HRESULT WINAPI Uri_GetAbsoluteUri(IUri *iface, BSTR *pstrAbsoluteUri) +{ + Uri *This = URI_THIS(iface); + FIXME("(%p)->(%p)\n", This, pstrAbsoluteUri); + return E_NOTIMPL; +} + +static HRESULT WINAPI Uri_GetAuthority(IUri *iface, BSTR *pstrAuthority) +{ + Uri *This = URI_THIS(iface); + FIXME("(%p)->(%p)\n", This, pstrAuthority); + return E_NOTIMPL; +} + +static HRESULT WINAPI Uri_GetDisplayUri(IUri *iface, BSTR *pstrDisplayUri) +{ + Uri *This = URI_THIS(iface); + FIXME("(%p)->(%p)\n", This, pstrDisplayUri); + return E_NOTIMPL; +} + +static HRESULT WINAPI Uri_GetDomain(IUri *iface, BSTR *pstrDomain) +{ + Uri *This = URI_THIS(iface); + FIXME("(%p)->(%p)\n", This, pstrDomain); + return E_NOTIMPL; +} + +static HRESULT WINAPI Uri_GetExtension(IUri *iface, BSTR *pstrExtension) +{ + Uri *This = URI_THIS(iface); + FIXME("(%p)->(%p)\n", This, pstrExtension); + return E_NOTIMPL; +} + +static HRESULT WINAPI Uri_GetFragment(IUri *iface, BSTR *pstrFragment) +{ + Uri *This = URI_THIS(iface); + FIXME("(%p)->(%p)\n", This, pstrFragment); + return E_NOTIMPL; +} + +static HRESULT WINAPI Uri_GetHost(IUri *iface, BSTR *pstrHost) +{ + Uri *This = URI_THIS(iface); + FIXME("(%p)->(%p)\n", This, pstrHost); + return E_NOTIMPL; +} + +static HRESULT WINAPI Uri_GetPassword(IUri *iface, BSTR *pstrPassword) +{ + Uri *This = URI_THIS(iface); + FIXME("(%p)->(%p)\n", This, pstrPassword); + return E_NOTIMPL; +} + +static HRESULT WINAPI Uri_GetPath(IUri *iface, BSTR *pstrPath) +{ + Uri *This = URI_THIS(iface); + FIXME("(%p)->(%p)\n", This, pstrPath); + return E_NOTIMPL; +} + +static HRESULT WINAPI Uri_GetPathAndQuery(IUri *iface, BSTR *pstrPathAndQuery) +{ + Uri *This = URI_THIS(iface); + FIXME("(%p)->(%p)\n", This, pstrPathAndQuery); + return E_NOTIMPL; +} + +static HRESULT WINAPI Uri_GetQuery(IUri *iface, BSTR *pstrQuery) +{ + Uri *This = URI_THIS(iface); + FIXME("(%p)->(%p)\n", This, pstrQuery); + return E_NOTIMPL; +} + +static HRESULT WINAPI Uri_GetRawUri(IUri *iface, BSTR *pstrRawUri) +{ + Uri *This = URI_THIS(iface); + FIXME("(%p)->(%p)\n", This, pstrRawUri); + return E_NOTIMPL; +} + +static HRESULT WINAPI Uri_GetSchemeName(IUri *iface, BSTR *pstrSchemeName) +{ + Uri *This = URI_THIS(iface); + FIXME("(%p)->(%p)\n", This, pstrSchemeName); + return E_NOTIMPL; +} + +static HRESULT WINAPI Uri_GetUserInfo(IUri *iface, BSTR *pstrUserInfo) +{ + Uri *This = URI_THIS(iface); + FIXME("(%p)->(%p)\n", This, pstrUserInfo); + return E_NOTIMPL; +} + +static HRESULT WINAPI Uri_GetUserName(IUri *iface, BSTR *pstrUserName) +{ + Uri *This = URI_THIS(iface); + FIXME("(%p)->(%p)\n", This, pstrUserName); + return E_NOTIMPL; +} + +static HRESULT WINAPI Uri_GetHostType(IUri *iface, DWORD *pdwHostType) +{ + Uri *This = URI_THIS(iface); + FIXME("(%p)->(%p)\n", This, pdwHostType); + return E_NOTIMPL; +} + +static HRESULT WINAPI Uri_GetPort(IUri *iface, DWORD *pdwPort) +{ + Uri *This = URI_THIS(iface); + FIXME("(%p)->(%p)\n", This, pdwPort); + return E_NOTIMPL; +} + +static HRESULT WINAPI Uri_GetScheme(IUri *iface, DWORD *pdwScheme) +{ + Uri *This = URI_THIS(iface); + FIXME("(%p)->(%p)\n", This, pdwScheme); + return E_NOTIMPL; +} + +static HRESULT WINAPI Uri_GetZone(IUri *iface, DWORD *pdwZone) +{ + Uri *This = URI_THIS(iface); + FIXME("(%p)->(%p)\n", This, pdwZone); + return E_NOTIMPL; +} + +static HRESULT WINAPI Uri_GetProperties(IUri *iface, DWORD *pdwProperties) +{ + Uri *This = URI_THIS(iface); + FIXME("(%p)->(%p)\n", This, pdwProperties); + return E_NOTIMPL; +} + +static HRESULT WINAPI Uri_IsEqual(IUri *iface, IUri *pUri, BOOL *pfEqual) +{ + Uri *This = URI_THIS(iface); + FIXME("(%p)->(%p %p)\n", This, pUri, pfEqual); + return E_NOTIMPL; +} + +#undef URI_THIS + +static const IUriVtbl UriVtbl = { + Uri_QueryInterface, + Uri_AddRef, + Uri_Release, + Uri_GetPropertyBSTR, + Uri_GetPropertyLength, + Uri_GetPropertyDWORD, + Uri_HasProperty, + Uri_GetAbsoluteUri, + Uri_GetAuthority, + Uri_GetDisplayUri, + Uri_GetDomain, + Uri_GetExtension, + Uri_GetFragment, + Uri_GetHost, + Uri_GetPassword, + Uri_GetPath, + Uri_GetPathAndQuery, + Uri_GetQuery, + Uri_GetRawUri, + Uri_GetSchemeName, + Uri_GetUserInfo, + Uri_GetUserName, + Uri_GetHostType, + Uri_GetPort, + Uri_GetScheme, + Uri_GetZone, + Uri_GetProperties, + Uri_IsEqual +}; + +/*********************************************************************** + * CreateUri (urlmon.@) + */ +HRESULT WINAPI CreateUri(LPCWSTR pwzURI, DWORD dwFlags, DWORD_PTR dwReserved, IUri **ppURI) +{ + Uri *ret; + + TRACE("(%s %x %x %p)\n", debugstr_w(pwzURI), dwFlags, (DWORD)dwReserved, ppURI); + + ret = heap_alloc(sizeof(Uri)); + if(!ret) + return E_OUTOFMEMORY; + + ret->lpIUriVtbl = &UriVtbl; + ret->ref = 1; + + *ppURI = URI(ret); + return S_OK; +} Propchange: trunk/reactos/dll/win32/urlmon/uri.c ------------------------------------------------------------------------------ svn:eol-style = native Modified: trunk/reactos/dll/win32/urlmon/urlmon.inf URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/urlmon/urlmon.in…
============================================================================== --- trunk/reactos/dll/win32/urlmon/urlmon.inf [iso-8859-1] (original) +++ trunk/reactos/dll/win32/urlmon/urlmon.inf [iso-8859-1] Thu Mar 4 16:24:17 2010 @@ -43,7 +43,6 @@ [ZoneMap.Reg] -HKCU,"Software\Microsoft\Windows\CurrentVersion\Internet Settings",,, HKCU,"%PATH_ZONEMAP%",,, HKLM,"%PATH_ZONEMAP%",,, HKCU,"%PATH_ZONEMAP%","ProxyByPass", 0x10001,0x1 Modified: trunk/reactos/dll/win32/urlmon/urlmon.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/urlmon/urlmon.rb…
============================================================================== --- trunk/reactos/dll/win32/urlmon/urlmon.rbuild [iso-8859-1] (original) +++ trunk/reactos/dll/win32/urlmon/urlmon.rbuild [iso-8859-1] Thu Mar 4 16:24:17 2010 @@ -27,18 +27,29 @@ <file>session.c</file> <file>umon.c</file> <file>umstream.c</file> + <file>uri.c</file> <file>urlmon_main.c</file> + <file>usrmarshal.c</file> <file>rsrc.rc</file> <library>wine</library> <library>uuid</library> + <library>rpcrt4</library> <library>ole32</library> <library>shlwapi</library> <library>wininet</library> <library>user32</library> <library>advapi32</library> + <library>pseh</library> + <library>urlmon_proxy</library> <library>ntdll</library> </module> -<module name="urlmon_local_interface" type="idlinterface"> - <file>urlmon_local.idl</file> +<module name="urlmon_proxy" type="rpcproxy" allowwarnings="true"> + <define name="__WINESRC__" /> + <define name="ENTRY_PREFIX">URLMON_</define> + <define name="PROXY_DELEGATION"/> + <define name="REGISTER_PROXY_DLL"/> + <define name="_URLMON_"/> + <define name="PROXY_CLSID_IS">{0x79EAC9F1,0xBAF9,0x11CE,{0x8C,0x82,0x00,0xAA,0x00,0x4B,0xA9,0x0B}}</define> + <file>urlmon_urlmon.idl</file> </module> </group> Modified: trunk/reactos/dll/win32/urlmon/urlmon.spec URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/urlmon/urlmon.sp…
============================================================================== --- trunk/reactos/dll/win32/urlmon/urlmon.spec [iso-8859-1] (original) +++ trunk/reactos/dll/win32/urlmon/urlmon.spec [iso-8859-1] Thu Mar 4 16:24:17 2010 @@ -15,7 +15,7 @@ @ stdcall CoInternetCreateSecurityManager(ptr ptr long) @ stdcall CoInternetCreateZoneManager(ptr ptr long) @ stub CoInternetGetProtocolFlags -@ stub CoInternetGetSecurityUrl +@ stdcall CoInternetGetSecurityUrl(ptr ptr long long) @ stdcall CoInternetGetSession(long ptr long) @ stdcall CoInternetParseUrl(wstr long long wstr long ptr long) @ stdcall CoInternetQueryInfo(ptr long long ptr long ptr long) @@ -26,6 +26,7 @@ @ stdcall CreateAsyncBindCtx(long ptr ptr ptr) @ stdcall CreateAsyncBindCtxEx(ptr long ptr ptr ptr long) @ stdcall CreateFormatEnumerator(long ptr ptr) +@ stdcall CreateUri(wstr long long ptr) @ stdcall CreateURLMoniker(ptr wstr ptr) @ stdcall CreateURLMonikerEx(ptr wstr ptr long) @ stdcall -private DllCanUnloadNow() Removed: trunk/reactos/dll/win32/urlmon/urlmon_local.idl URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/urlmon/urlmon_lo…
============================================================================== --- trunk/reactos/dll/win32/urlmon/urlmon_local.idl [iso-8859-1] (original) +++ trunk/reactos/dll/win32/urlmon/urlmon_local.idl (removed) @@ -1,2 +1,0 @@ - -#include "urlmon.idl" Modified: trunk/reactos/dll/win32/urlmon/urlmon_main.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/urlmon/urlmon_ma…
============================================================================== --- trunk/reactos/dll/win32/urlmon/urlmon_main.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/urlmon/urlmon_main.c [iso-8859-1] Thu Mar 4 16:24:17 2010 @@ -348,6 +348,7 @@ HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv) { unsigned int i; + HRESULT hr; TRACE("(%s,%s,%p)\n", debugstr_guid(rclsid), debugstr_guid(riid), ppv); @@ -356,6 +357,10 @@ if (IsEqualGUID(object_creation[i].clsid, rclsid)) return IClassFactory_QueryInterface(object_creation[i].cf, riid, ppv); } + + hr = URLMON_DllGetClassObject(rclsid, riid, ppv); + if(SUCCEEDED(hr)) + return hr; FIXME("%s: no class found.\n", debugstr_guid(rclsid)); return CLASS_E_CLASSNOTAVAILABLE; Modified: trunk/reactos/dll/win32/urlmon/urlmon_main.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/urlmon/urlmon_ma…
============================================================================== --- trunk/reactos/dll/win32/urlmon/urlmon_main.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/urlmon/urlmon_main.h [iso-8859-1] Thu Mar 4 16:24:17 2010 @@ -48,6 +48,12 @@ extern HRESULT MkProtocol_Construct(IUnknown *pUnkOuter, LPVOID *ppobj); extern HRESULT MimeFilter_Construct(IUnknown *pUnkOuter, LPVOID *ppobj); +extern HRESULT WINAPI URLMON_DllGetClassObject(REFCLSID rclsid, REFIID iid,LPVOID *ppv) DECLSPEC_HIDDEN; +extern HRESULT WINAPI URLMON_DllRegisterServer(void) DECLSPEC_HIDDEN; +extern HRESULT WINAPI URLMON_DllUnregisterServer(void) DECLSPEC_HIDDEN; + +extern GUID const CLSID_PSFactoryBuffer DECLSPEC_HIDDEN; + /********************************************************************** * Dll lifetime tracking declaration for urlmon.dll */ Added: trunk/reactos/dll/win32/urlmon/urlmon_urlmon.idl URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/urlmon/urlmon_ur…
============================================================================== --- trunk/reactos/dll/win32/urlmon/urlmon_urlmon.idl (added) +++ trunk/reactos/dll/win32/urlmon/urlmon_urlmon.idl [iso-8859-1] Thu Mar 4 16:24:17 2010 @@ -1,0 +1,19 @@ +/* + * Copyright 2009 Piotr Caban for Codeweavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include "urlmon.idl" Propchange: trunk/reactos/dll/win32/urlmon/urlmon_urlmon.idl ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/dll/win32/urlmon/usrmarshal.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/urlmon/usrmarsha…
============================================================================== --- trunk/reactos/dll/win32/urlmon/usrmarshal.c (added) +++ trunk/reactos/dll/win32/urlmon/usrmarshal.c [iso-8859-1] Thu Mar 4 16:24:17 2010 @@ -1,0 +1,162 @@ +/* + * Copyright 2009 Piotr Caban for Codeweavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include "urlmon_main.h" + +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(urlmon); + +HRESULT CALLBACK IWinInetHttpInfo_QueryInfo_Proxy(IWinInetHttpInfo* This, + DWORD dwOption, LPVOID pBuffer, DWORD *pcbBuf, DWORD *pdwFlags, + DWORD *pdwReserved) +{ + FIXME("stub\n"); + return E_NOTIMPL; +} + +HRESULT __RPC_STUB IWinInetHttpInfo_QueryInfo_Stub(IWinInetHttpInfo* This, + DWORD dwOption, BYTE *pBuffer, DWORD *pcbBuf, DWORD *pdwFlags, + DWORD *pdwReserved) +{ + FIXME("stub\n"); + return E_NOTIMPL; +} + +HRESULT CALLBACK IWinInetInfo_QueryOption_Proxy(IWinInetInfo* This, + DWORD dwOption, LPVOID pBuffer, DWORD *pcbBuf) +{ + FIXME("stub\n"); + return E_NOTIMPL; +} + +HRESULT __RPC_STUB IWinInetInfo_QueryOption_Stub(IWinInetInfo* This, + DWORD dwOption, BYTE *pBuffer, DWORD *pcbBuf) +{ + FIXME("stub\n"); + return E_NOTIMPL; +} + +HRESULT CALLBACK IBindHost_MonikerBindToStorage_Proxy(IBindHost* This, + IMoniker *pMk, IBindCtx *pBC, IBindStatusCallback *pBSC, + REFIID riid, void **ppvObj) +{ + FIXME("stub\n"); + return E_NOTIMPL; +} + +HRESULT __RPC_STUB IBindHost_MonikerBindToStorage_Stub(IBindHost* This, + IMoniker *pMk, IBindCtx *pBC, IBindStatusCallback *pBSC, + REFIID riid, IUnknown **ppvObj) +{ + FIXME("stub\n"); + return E_NOTIMPL; +} + +HRESULT CALLBACK IBindHost_MonikerBindToObject_Proxy(IBindHost* This, + IMoniker *pMk, IBindCtx *pBC, IBindStatusCallback *pBSC, + REFIID riid, void **ppvObj) +{ + FIXME("stub\n"); + return E_NOTIMPL; +} + +HRESULT __RPC_STUB IBindHost_MonikerBindToObject_Stub(IBindHost* This, + IMoniker *pMk, IBindCtx *pBC, IBindStatusCallback *pBSC, + REFIID riid, IUnknown **ppvObj) +{ + FIXME("stub\n"); + return E_NOTIMPL; +} + +HRESULT CALLBACK IBindStatusCallbackEx_GetBindInfoEx_Proxy( + IBindStatusCallbackEx* This, DWORD *grfBINDF, BINDINFO *pbindinfo, + DWORD *grfBINDF2, DWORD *pdwReserved) +{ + FIXME("stub\n"); + return E_NOTIMPL; +} + +HRESULT __RPC_STUB IBindStatusCallbackEx_GetBindInfoEx_Stub( + IBindStatusCallbackEx* This, DWORD *grfBINDF, RemBINDINFO *pbindinfo, + RemSTGMEDIUM *pstgmed, DWORD *grfBINDF2, DWORD *pdwReserved) +{ + FIXME("stub\n"); + return E_NOTIMPL; +} + +HRESULT CALLBACK IBindStatusCallback_GetBindInfo_Proxy( + IBindStatusCallback* This, DWORD *grfBINDF, BINDINFO *pbindinfo) +{ + FIXME("stub\n"); + return E_NOTIMPL; +} + +HRESULT __RPC_STUB IBindStatusCallback_GetBindInfo_Stub( + IBindStatusCallback* This, DWORD *grfBINDF, + RemBINDINFO *pbindinfo, RemSTGMEDIUM *pstgmed) +{ + FIXME("stub\n"); + return E_NOTIMPL; +} + +HRESULT CALLBACK IBindStatusCallback_OnDataAvailable_Proxy( + IBindStatusCallback* This, DWORD grfBSCF, DWORD dwSize, + FORMATETC *pformatetc, STGMEDIUM *pstgmed) +{ + FIXME("stub\n"); + return E_NOTIMPL; +} + +HRESULT __RPC_STUB IBindStatusCallback_OnDataAvailable_Stub( + IBindStatusCallback* This, DWORD grfBSCF, DWORD dwSize, + RemFORMATETC *pformatetc, RemSTGMEDIUM *pstgmed) +{ + FIXME("stub\n"); + return E_NOTIMPL; +} + +HRESULT CALLBACK IBinding_GetBindResult_Proxy(IBinding* This, + CLSID *pclsidProtocol, DWORD *pdwResult, + LPOLESTR *pszResult, DWORD *pdwReserved) +{ + FIXME("stub\n"); + return E_NOTIMPL; +} + +HRESULT __RPC_STUB IBinding_GetBindResult_Stub(IBinding* This, + CLSID *pclsidProtocol, DWORD *pdwResult, + LPOLESTR *pszResult, DWORD dwReserved) +{ + FIXME("stub\n"); + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE IWindowForBindingUI_GetWindow_Proxy( + IWindowForBindingUI* This, REFGUID rguidReason, HWND *phwnd) +{ + FIXME("stub\n"); + return E_NOTIMPL; +} + +void __RPC_STUB IWindowForBindingUI_GetWindow_Stub(IRpcStubBuffer* This, + IRpcChannelBuffer* pRpcChannelBuffer, PRPC_MESSAGE pRpcMessage, + DWORD* pdwStubPhase) +{ + FIXME("stub\n"); +} Propchange: trunk/reactos/dll/win32/urlmon/usrmarshal.c ------------------------------------------------------------------------------ svn:eol-style = native Modified: trunk/reactos/include/psdk/urlmon.idl URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/urlmon.idl?re…
============================================================================== --- trunk/reactos/include/psdk/urlmon.idl [iso-8859-1] (original) +++ trunk/reactos/include/psdk/urlmon.idl [iso-8859-1] Thu Mar 4 16:24:17 2010 @@ -1646,6 +1646,62 @@ [out] BOOL *pfEqual); } +cpp_quote("HRESULT WINAPI CreateUri(LPCWSTR,DWORD,DWORD_PTR,IUri**);") +cpp_quote("HRESULT WINAPI CreateUriWithFragment(LPCWSTR,LPCWSTR,DWORD,DWORD_PTR,IUri**);") +cpp_quote("HRESULT WINAPI CreateUriFromMultiByteString(LPCSTR,DWORD,DWORD,DWORD,DWORD_PTR,IUri**);") + +cpp_quote("#define Uri_HAS_ABSOLUTE_URI (1 << Uri_PROPERTY_ABSOLUTE_URI)") +cpp_quote("#define Uri_HAS_AUTHORITY (1 << Uri_PROPERTY_AUTHORITY)") +cpp_quote("#define Uri_HAS_DISPLAY_URI (1 << Uri_PROPERTY_DISPLAY_URI)") +cpp_quote("#define Uri_HAS_DOMAIN (1 << Uri_PROPERTY_DOMAIN)") +cpp_quote("#define Uri_HAS_EXTENSION (1 << Uri_PROPERTY_EXTENSION)") +cpp_quote("#define Uri_HAS_FRAGMENT (1 << Uri_PROPERTY_FRAGMENT)") +cpp_quote("#define Uri_HAS_HOST (1 << Uri_PROPERTY_HOST)") +cpp_quote("#define Uri_HAS_PASSWORD (1 << Uri_PROPERTY_PASSWORD)") +cpp_quote("#define Uri_HAS_PATH (1 << Uri_PROPERTY_PATH)") +cpp_quote("#define Uri_HAS_QUERY (1 << Uri_PROPERTY_QUERY)") +cpp_quote("#define Uri_HAS_RAW_URI (1 << Uri_PROPERTY_RAW_URI)") +cpp_quote("#define Uri_HAS_SCHEME_NAME (1 << Uri_PROPERTY_SCHEME_NAME)") +cpp_quote("#define Uri_HAS_USER_NAME (1 << Uri_PROPERTY_USER_NAME)") +cpp_quote("#define Uri_HAS_PATH_AND_QUERY (1 << Uri_PROPERTY_PATH_AND_QUERY)") +cpp_quote("#define Uri_HAS_USER_INFO (1 << Uri_PROPERTY_USER_INFO)") +cpp_quote("#define Uri_HAS_HOST_TYPE (1 << Uri_PROPERTY_HOST_TYPE)") +cpp_quote("#define Uri_HAS_PORT (1 << Uri_PROPERTY_PORT)") +cpp_quote("#define Uri_HAS_SCHEME (1 << Uri_PROPERTY_SCHEME)") +cpp_quote("#define Uri_HAS_ZONE (1 << Uri_PROPERTY_ZONE)") + +cpp_quote("#define Uri_CREATE_ALLOW_RELATIVE 0x0001") +cpp_quote("#define Uri_CREATE_ALLOW_IMPLICIT_WILDCARD_SCHEME 0x0002") +cpp_quote("#define Uri_CREATE_ALLOW_IMPLICIT_FILE_SCHEME 0x0004") +cpp_quote("#define Uri_CREATE_NOFRAG 0x0008") +cpp_quote("#define Uri_CREATE_NO_CANONICALIZE 0x0010") +cpp_quote("#define Uri_CREATE_CANONICALIZE 0x0100") +cpp_quote("#define Uri_CREATE_FILE_USE_DOS_PATH 0x0020") +cpp_quote("#define Uri_CREATE_DECODE_EXTRA_INFO 0x0040") +cpp_quote("#define Uri_CREATE_NO_DECODE_EXTRA_INFO 0x0080") +cpp_quote("#define Uri_CREATE_CRACK_UNKNOWN_SCHEMES 0x0200") +cpp_quote("#define Uri_CREATE_NO_CRACK_UNKNOWN_SCHEMES 0x0400") +cpp_quote("#define Uri_CREATE_PRE_PROCESS_HTML_URI 0x0800") +cpp_quote("#define Uri_CREATE_NO_PRE_PROCESS_HTML_URI 0x1000") +cpp_quote("#define Uri_CREATE_IE_SETTINGS 0x2000") +cpp_quote("#define Uri_CREATE_NO_IE_SETTINGS 0x4000") +cpp_quote("#define Uri_CREATE_NO_ENCODE_FORBIDDEN_CHARACTERS 0x8000") + +cpp_quote("#define Uri_DISPLAY_NO_FRAGMENT 0x00000001") +cpp_quote("#define Uri_PUNYCODE_IDN_HOST 0x00000002") +cpp_quote("#define Uri_DISPLAY_IDN_HOST 0x00000004") + +cpp_quote("#define Uri_ENCODING_USER_INFO_AND_PATH_IS_PERCENT_ENCODED_UTF8 0x00000001") +cpp_quote("#define Uri_ENCODING_USER_INFO_AND_PATH_IS_CP 0x00000002") +cpp_quote("#define Uri_ENCODING_HOST_IS_IDN 0x00000004") +cpp_quote("#define Uri_ENCODING_HOST_IS_PERCENT_ENCODED_UTF8 0x00000008") +cpp_quote("#define Uri_ENCODING_HOST_IS_PERCENT_ENCODED_CP 0x00000010") +cpp_quote("#define Uri_ENCODING_QUERY_AND_FRAGMENT_IS_PERCENT_ENCODED_UTF8 0x00000020") +cpp_quote("#define Uri_ENCODING_QUERY_AND_FRAGMENT_IS_CP 0x00000040") +cpp_quote("#define Uri_ENCODING_RFC (Uri_ENCODING_USER_INFO_AND_PATH_IS_PERCENT_ENCODED_UTF8|Uri_ENCODING_HOST_IS_PERCENT_ENCODED_UTF8|Uri_ENCODING_QUERY_AND_FRAGMENT_IS_PERCENT_ENCODED_UTF8)") + +cpp_quote("#define UriBuilder_USE_ORIGINAL_FLAGS 0x00000001") + /***************************************************************************** * IUriContainer interface */ @@ -1740,6 +1796,8 @@ cpp_quote("HRESULT WINAPI CoGetClassObjectFromURL(REFCLSID, LPCWSTR, DWORD, DWORD, LPCWSTR, LPBINDCTX, DWORD, LPVOID, REFIID, LPVOID*);") cpp_quote("HRESULT WINAPI CreateURLMoniker(IMoniker *pmkContext, LPCWSTR szURL, IMoniker **ppmk);") +cpp_quote("HRESULT WINAPI CreateURLMonikerEx(IMoniker*,LPCWSTR,IMoniker**,DWORD);") +cpp_quote("HRESULT WINAPI CreateURLMonikerEx2(IMoniker*,IUri*,IMoniker**,DWORD);") cpp_quote("HRESULT WINAPI RegisterBindStatusCallback(IBindCtx *pbc, IBindStatusCallback *pbsc, IBindStatusCallback **ppbsc, DWORD dwReserved);") cpp_quote("HRESULT WINAPI CompareSecurityIds(BYTE*,DWORD,BYTE*,DWORD,DWORD);") cpp_quote("HRESULT WINAPI URLDownloadToFileA(LPUNKNOWN,LPCSTR,LPCSTR,DWORD,LPBINDSTATUSCALLBACK);") @@ -1758,6 +1816,7 @@ cpp_quote("HRESULT WINAPI CoInternetParseUrl(LPCWSTR,PARSEACTION,DWORD,LPWSTR,DWORD,DWORD*,DWORD);") cpp_quote("HRESULT WINAPI CoInternetQueryInfo(LPCWSTR,QUERYOPTION,DWORD,LPVOID,DWORD,DWORD*,DWORD);") cpp_quote("HRESULT WINAPI CoInternetSetFeatureEnabled(INTERNETFEATURELIST,DWORD,BOOL);") +cpp_quote("HRESULT WINAPI CoInternetGetSecurityUrl(LPCWSTR,LPWSTR*,PSUACTION,DWORD);") cpp_quote("HRESULT WINAPI CreateFormatEnumerator(UINT,FORMATETC*,IEnumFORMATETC**);") cpp_quote("HRESULT WINAPI GetSoftwareUpdateInfo( LPCWSTR szDistUnit, LPSOFTDISTINFO psdi);") cpp_quote("HRESULT WINAPI FaultInIEFeature(HWND,uCLSSPEC*,QUERYCONTEXT*,DWORD);")
14 years, 9 months
1
0
0
0
[fireball] 45833: [WIDL] - Sync to Wine-1.1.39
by fireball@svn.reactos.org
Author: fireball Date: Thu Mar 4 14:46:14 2010 New Revision: 45833 URL:
http://svn.reactos.org/svn/reactos?rev=45833&view=rev
Log: [WIDL] - Sync to Wine-1.1.39 Modified: trunk/reactos/media/doc/README.WINE trunk/reactos/tools/widl/expr.c trunk/reactos/tools/widl/header.c trunk/reactos/tools/widl/header.h trunk/reactos/tools/widl/parser.h trunk/reactos/tools/widl/parser.l trunk/reactos/tools/widl/parser.tab.c trunk/reactos/tools/widl/parser.tab.h trunk/reactos/tools/widl/parser.y trunk/reactos/tools/widl/parser.yy.c trunk/reactos/tools/widl/proxy.c trunk/reactos/tools/widl/typegen.c trunk/reactos/tools/widl/widl.c trunk/reactos/tools/widl/widltypes.h [This mail would be too long, it was shortened to contain the URLs only.] Modified: trunk/reactos/media/doc/README.WINE URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=…
Modified: trunk/reactos/tools/widl/expr.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/widl/expr.c?rev=4583…
Modified: trunk/reactos/tools/widl/header.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/widl/header.c?rev=45…
Modified: trunk/reactos/tools/widl/header.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/widl/header.h?rev=45…
Modified: trunk/reactos/tools/widl/parser.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/widl/parser.h?rev=45…
Modified: trunk/reactos/tools/widl/parser.l URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/widl/parser.l?rev=45…
Modified: trunk/reactos/tools/widl/parser.tab.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/widl/parser.tab.c?re…
Modified: trunk/reactos/tools/widl/parser.tab.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/widl/parser.tab.h?re…
Modified: trunk/reactos/tools/widl/parser.y URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/widl/parser.y?rev=45…
Modified: trunk/reactos/tools/widl/parser.yy.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/widl/parser.yy.c?rev…
Modified: trunk/reactos/tools/widl/proxy.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/widl/proxy.c?rev=458…
Modified: trunk/reactos/tools/widl/typegen.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/widl/typegen.c?rev=4…
Modified: trunk/reactos/tools/widl/widl.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/widl/widl.c?rev=4583…
Modified: trunk/reactos/tools/widl/widltypes.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/widl/widltypes.h?rev…
14 years, 9 months
1
0
0
0
[cwittich] 45832: [RSAENH] sync rsaenh to wine 1.1.39
by cwittich@svn.reactos.org
Author: cwittich Date: Thu Mar 4 14:36:55 2010 New Revision: 45832 URL:
http://svn.reactos.org/svn/reactos?rev=45832&view=rev
Log: [RSAENH] sync rsaenh to wine 1.1.39 Modified: trunk/reactos/dll/win32/rsaenh/rsaenh.c Modified: trunk/reactos/dll/win32/rsaenh/rsaenh.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/rsaenh/rsaenh.c?…
============================================================================== --- trunk/reactos/dll/win32/rsaenh/rsaenh.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/rsaenh/rsaenh.c [iso-8859-1] Thu Mar 4 14:36:55 2010 @@ -1219,6 +1219,8 @@ store_key_container_permissions(pKeyContainer); release_key_container_keys(pKeyContainer); } + else + release_key_container_keys(pKeyContainer); HeapFree( GetProcessHeap(), 0, pKeyContainer ); } @@ -1378,12 +1380,18 @@ (OBJECTHDR**)&pKeyContainer)) return (HCRYPTPROV)INVALID_HANDLE_VALUE; + /* read_key_value calls import_key, which calls import_private_key, + * which implicitly installs the key value into the appropriate key + * container key. Thus the ref count is incremented twice, once for + * the output key value, and once for the implicit install, and needs + * to be decremented to balance the two. + */ if (read_key_value(hKeyContainer, hKey, AT_KEYEXCHANGE, dwProtectFlags, &hCryptKey)) - pKeyContainer->hKeyExchangeKeyPair = hCryptKey; + release_handle(&handle_table, hCryptKey, RSAENH_MAGIC_KEY); if (read_key_value(hKeyContainer, hKey, AT_SIGNATURE, dwProtectFlags, &hCryptKey)) - pKeyContainer->hSignatureKeyPair = hCryptKey; + release_handle(&handle_table, hCryptKey, RSAENH_MAGIC_KEY); } return hKeyContainer; @@ -3065,9 +3073,9 @@ if (pCryptKey) { new_key_impl(pCryptKey->aiAlgid, &pCryptKey->context, pCryptKey->dwKeyLen); setup_key(pCryptKey); - RSAENH_CPDestroyKey(hProv, pKeyContainer->hSignatureKeyPair); - copy_handle(&handle_table, *phKey, RSAENH_MAGIC_KEY, - &pKeyContainer->hSignatureKeyPair); + release_and_install_key(hProv, *phKey, + &pKeyContainer->hSignatureKeyPair, + FALSE); } break; @@ -3077,9 +3085,9 @@ if (pCryptKey) { new_key_impl(pCryptKey->aiAlgid, &pCryptKey->context, pCryptKey->dwKeyLen); setup_key(pCryptKey); - RSAENH_CPDestroyKey(hProv, pKeyContainer->hKeyExchangeKeyPair); - copy_handle(&handle_table, *phKey, RSAENH_MAGIC_KEY, - &pKeyContainer->hKeyExchangeKeyPair); + release_and_install_key(hProv, *phKey, + &pKeyContainer->hKeyExchangeKeyPair, + FALSE); } break; @@ -4162,11 +4170,12 @@ LPCWSTR sDescription, DWORD dwFlags, BYTE *pbSignature, DWORD *pdwSigLen) { - HCRYPTKEY hCryptKey; + HCRYPTKEY hCryptKey = (HCRYPTKEY)INVALID_HANDLE_VALUE; CRYPTKEY *pCryptKey; DWORD dwHashLen; BYTE abHashValue[RSAENH_MAX_HASH_SIZE]; ALG_ID aiAlgid; + BOOL ret = FALSE; TRACE("(hProv=%08lx, hHash=%08lx, dwKeySpec=%08x, sDescription=%s, dwFlags=%08x, " "pbSignature=%p, pdwSigLen=%p)\n", hProv, hHash, dwKeySpec, debugstr_w(sDescription), @@ -4183,18 +4192,19 @@ (OBJECTHDR**)&pCryptKey)) { SetLastError(NTE_NO_KEY); - return FALSE; + goto out; } if (!pbSignature) { *pdwSigLen = pCryptKey->dwKeyLen; - return TRUE; + ret = TRUE; + goto out; } if (pCryptKey->dwKeyLen > *pdwSigLen) { SetLastError(ERROR_MORE_DATA); *pdwSigLen = pCryptKey->dwKeyLen; - return FALSE; + goto out; } *pdwSigLen = pCryptKey->dwKeyLen; @@ -4202,22 +4212,25 @@ if (!RSAENH_CPHashData(hProv, hHash, (CONST BYTE*)sDescription, (DWORD)lstrlenW(sDescription)*sizeof(WCHAR), 0)) { - return FALSE; + goto out; } } dwHashLen = sizeof(DWORD); - if (!RSAENH_CPGetHashParam(hProv, hHash, HP_ALGID, (BYTE*)&aiAlgid, &dwHashLen, 0)) return FALSE; + if (!RSAENH_CPGetHashParam(hProv, hHash, HP_ALGID, (BYTE*)&aiAlgid, &dwHashLen, 0)) goto out; dwHashLen = RSAENH_MAX_HASH_SIZE; - if (!RSAENH_CPGetHashParam(hProv, hHash, HP_HASHVAL, abHashValue, &dwHashLen, 0)) return FALSE; + if (!RSAENH_CPGetHashParam(hProv, hHash, HP_HASHVAL, abHashValue, &dwHashLen, 0)) goto out; if (!build_hash_signature(pbSignature, *pdwSigLen, aiAlgid, abHashValue, dwHashLen, dwFlags)) { - return FALSE; - } - - return encrypt_block_impl(pCryptKey->aiAlgid, PK_PRIVATE, &pCryptKey->context, pbSignature, pbSignature, RSAENH_ENCRYPT); + goto out; + } + + ret = encrypt_block_impl(pCryptKey->aiAlgid, PK_PRIVATE, &pCryptKey->context, pbSignature, pbSignature, RSAENH_ENCRYPT); +out: + RSAENH_CPDestroyKey(hProv, hCryptKey); + return ret; } /******************************************************************************
14 years, 9 months
1
0
0
0
[cwittich] 45831: [GDIPLUS] sync gdiplus to wine 1.1.39
by cwittich@svn.reactos.org
Author: cwittich Date: Thu Mar 4 14:34:05 2010 New Revision: 45831 URL:
http://svn.reactos.org/svn/reactos?rev=45831&view=rev
Log: [GDIPLUS] sync gdiplus to wine 1.1.39 Modified: trunk/reactos/dll/win32/gdiplus/brush.c trunk/reactos/dll/win32/gdiplus/customlinecap.c trunk/reactos/dll/win32/gdiplus/font.c trunk/reactos/dll/win32/gdiplus/gdiplus.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/graphicspath.c trunk/reactos/dll/win32/gdiplus/image.c trunk/reactos/dll/win32/gdiplus/imageattributes.c trunk/reactos/dll/win32/gdiplus/pen.c trunk/reactos/dll/win32/gdiplus/stringformat.c Modified: trunk/reactos/dll/win32/gdiplus/brush.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdiplus/brush.c?…
============================================================================== --- trunk/reactos/dll/win32/gdiplus/brush.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/gdiplus/brush.c [iso-8859-1] Thu Mar 4 14:34:05 2010 @@ -87,13 +87,11 @@ break; } case BrushTypeHatchFill: - *clone = GdipAlloc(sizeof(GpHatch)); - if (!*clone) return OutOfMemory; - - memcpy(*clone, brush, sizeof(GpHatch)); - - (*clone)->gdibrush = CreateBrushIndirect(&(*clone)->lb); - break; + { + GpHatch *hatch = (GpHatch*)brush; + + return GdipCreateHatchBrush(hatch->hatchstyle, hatch->forecol, hatch->backcol, (GpHatch**)clone); + } case BrushTypePathGradient:{ GpPathGradient *src, *dest; INT count; @@ -189,18 +187,29 @@ break; } case BrushTypeTextureFill: - *clone = GdipAlloc(sizeof(GpTexture)); - if(!*clone) return OutOfMemory; - - memcpy(*clone, brush, sizeof(GpTexture)); - - (*clone)->gdibrush = CreateBrushIndirect(&(*clone)->lb); - break; + { + GpStatus stat; + GpTexture *texture = (GpTexture*)brush; + GpTexture *new_texture; + + stat = GdipCreateTexture(texture->image, texture->wrap, &new_texture); + + if (stat == Ok) + { + memcpy(new_texture->transform, texture->transform, sizeof(GpMatrix)); + *clone = (GpBrush*)new_texture; + } + else + *clone = NULL; + + return stat; + } default: ERR("not implemented for brush type %d\n", brush->bt); return NotImplemented; } + TRACE("<-- %p\n", *clone); return Ok; } @@ -317,6 +326,7 @@ (*brush)->forecol = forecol; (*brush)->backcol = backcol; (*brush)->hatchstyle = hatchstyle; + TRACE("<-- %p\n", *brush); } else { @@ -336,8 +346,8 @@ { COLORREF col = ARGB2COLORREF(startcolor); - TRACE("(%p, %p, %x, %x, %d, %p)\n", startpoint, endpoint, - startcolor, endcolor, wrap, line); + TRACE("(%s, %s, %x, %x, %d, %p)\n", debugstr_pointf(startpoint), + debugstr_pointf(endpoint), startcolor, endcolor, wrap, line); if(!line || !startpoint || !endpoint || wrap == WrapModeClamp) return InvalidParameter; @@ -396,6 +406,8 @@ (*line)->pblendcolor = NULL; (*line)->pblendpos = NULL; (*line)->pblendcount = 0; + + TRACE("<-- %p\n", *line); return Ok; } @@ -491,20 +503,74 @@ /****************************************************************************** * GdipCreateLineBrushFromRectWithAngle [GDIPLUS.@] - * - * FIXME: angle value completely ignored. Don't know how to use it since native - * always set Brush rectangle to rect (independetly of this angle). - * Maybe it's used only on drawing. */ GpStatus WINGDIPAPI GdipCreateLineBrushFromRectWithAngle(GDIPCONST GpRectF* rect, ARGB startcolor, ARGB endcolor, REAL angle, BOOL isAngleScalable, GpWrapMode wrap, GpLineGradient **line) { + GpStatus stat; + LinearGradientMode mode; + REAL width, height, exofs, eyofs; + REAL sin_angle, cos_angle, sin_cos_angle; + TRACE("(%p, %x, %x, %.2f, %d, %d, %p)\n", rect, startcolor, endcolor, angle, isAngleScalable, wrap, line); - return GdipCreateLineBrushFromRect(rect, startcolor, endcolor, LinearGradientModeForwardDiagonal, - wrap, line); + sin_angle = sinf(deg2rad(angle)); + cos_angle = cosf(deg2rad(angle)); + sin_cos_angle = sin_angle * cos_angle; + + if (isAngleScalable) + { + width = height = 1.0; + } + else + { + width = rect->Width; + height = rect->Height; + } + + if (sin_cos_angle >= 0) + mode = LinearGradientModeForwardDiagonal; + else + mode = LinearGradientModeBackwardDiagonal; + + stat = GdipCreateLineBrushFromRect(rect, startcolor, endcolor, mode, wrap, line); + + if (stat == Ok) + { + if (sin_cos_angle >= 0) + { + exofs = width * sin_cos_angle + height * cos_angle * cos_angle; + eyofs = width * sin_angle * sin_angle + height * sin_cos_angle; + } + else + { + exofs = width * sin_angle * sin_angle + height * sin_cos_angle; + eyofs = -width * sin_cos_angle + height * sin_angle * sin_angle; + } + + if (isAngleScalable) + { + exofs = exofs * rect->Width; + eyofs = eyofs * rect->Height; + } + + if (sin_angle >= 0) + { + (*line)->endpoint.X = rect->X + exofs; + (*line)->endpoint.Y = rect->Y + eyofs; + } + else + { + (*line)->endpoint.X = (*line)->startpoint.X; + (*line)->endpoint.Y = (*line)->startpoint.Y; + (*line)->startpoint.X = rect->X + exofs; + (*line)->startpoint.Y = rect->Y + eyofs; + } + } + + return stat; } GpStatus WINGDIPAPI GdipCreateLineBrushFromRectWithAngleI(GDIPCONST GpRect* rect, @@ -570,6 +636,8 @@ (*grad)->center.Y = 0.0; (*grad)->focus.X = 0.0; (*grad)->focus.Y = 0.0; + + TRACE("<-- %p\n", *grad); return Ok; } @@ -661,6 +729,8 @@ (*grad)->focus.X = 0.0; (*grad)->focus.Y = 0.0; + TRACE("<-- %p\n", *grad); + return Ok; } @@ -686,6 +756,8 @@ (*sf)->brush.bt = BrushTypeSolidColor; (*sf)->color = color; (*sf)->bmp = ARGB2BMP(color); + + TRACE("<-- %p\n", *sf); return Ok; } @@ -749,139 +821,71 @@ GDIPCONST GpImageAttributes *imageattr, REAL x, REAL y, REAL width, REAL height, GpTexture **texture) { - HDC hdc; - HBITMAP hbm, old = NULL; - BITMAPINFO *pbmi; - BITMAPINFOHEADER *bmih; - INT n_x, n_y, n_width, n_height, abs_height, stride, image_stride, i, bytespp; - BOOL bm_is_selected; - BYTE *dibits, *buff, *textbits; + HBITMAP hbm; GpStatus status; + GpImage *new_image=NULL; TRACE("(%p, %p, %.2f, %.2f, %.2f, %.2f, %p)\n", image, imageattr, x, y, width, height, texture); if(!image || !texture || x < 0.0 || y < 0.0 || width < 0.0 || height < 0.0) return InvalidParameter; + + *texture = NULL; if(image->type != ImageTypeBitmap){ FIXME("not implemented for image type %d\n", image->type); return NotImplemented; } - n_x = roundr(x); - n_y = roundr(y); - n_width = roundr(width); - n_height = roundr(height); - - if(n_x + n_width > ((GpBitmap*)image)->width || - n_y + n_height > ((GpBitmap*)image)->height) - return InvalidParameter; - - hbm = ((GpBitmap*)image)->hbitmap; - if(!hbm) return GenericError; - hdc = ((GpBitmap*)image)->hdc; - bm_is_selected = (hdc != 0); - - pbmi = GdipAlloc(sizeof(BITMAPINFOHEADER) + 256 * sizeof(RGBQUAD)); - if (!pbmi) - return OutOfMemory; - pbmi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); - pbmi->bmiHeader.biBitCount = 0; - - if(!bm_is_selected){ - hdc = CreateCompatibleDC(0); - old = SelectObject(hdc, hbm); - } - - /* fill out bmi */ - GetDIBits(hdc, hbm, 0, 0, NULL, pbmi, DIB_RGB_COLORS); - - bytespp = pbmi->bmiHeader.biBitCount / 8; - abs_height = abs(pbmi->bmiHeader.biHeight); - - if(n_x > pbmi->bmiHeader.biWidth || n_x + n_width > pbmi->bmiHeader.biWidth || - n_y > abs_height || n_y + n_height > abs_height){ - GdipFree(pbmi); - return InvalidParameter; - } - - dibits = GdipAlloc(pbmi->bmiHeader.biSizeImage); - - if(dibits) /* this is not a good place to error out */ - GetDIBits(hdc, hbm, 0, abs_height, dibits, pbmi, DIB_RGB_COLORS); - - if(!bm_is_selected){ - SelectObject(hdc, old); - DeleteDC(hdc); - } - - if(!dibits){ - GdipFree(pbmi); - return OutOfMemory; - } - - image_stride = (pbmi->bmiHeader.biWidth * bytespp + 3) & ~3; - stride = (n_width * bytespp + 3) & ~3; - buff = GdipAlloc(sizeof(BITMAPINFOHEADER) + stride * n_height); - if(!buff){ - GdipFree(pbmi); - GdipFree(dibits); - return OutOfMemory; - } - - bmih = (BITMAPINFOHEADER*)buff; - textbits = (BYTE*) (bmih + 1); - bmih->biSize = sizeof(BITMAPINFOHEADER); - bmih->biWidth = n_width; - bmih->biHeight = n_height; - bmih->biCompression = BI_RGB; - bmih->biSizeImage = stride * n_height; - bmih->biBitCount = pbmi->bmiHeader.biBitCount; - bmih->biClrUsed = 0; - bmih->biPlanes = 1; - - /* image is flipped */ - if(pbmi->bmiHeader.biHeight > 0){ - dibits += image_stride * (pbmi->bmiHeader.biHeight - 1); - image_stride *= -1; - textbits += stride * (n_height - 1); - stride *= -1; - } - - GdipFree(pbmi); - - for(i = 0; i < n_height; i++) - memcpy(&textbits[i * stride], - &dibits[n_x * bytespp + (n_y + i) * image_stride], - abs(stride)); + status = GdipCloneBitmapArea(x, y, width, height, PixelFormatDontCare, (GpBitmap*)image, (GpBitmap**)&new_image); + if (status != Ok) + return status; + + hbm = ((GpBitmap*)new_image)->hbitmap; + if(!hbm) + { + status = GenericError; + goto exit; + } *texture = GdipAlloc(sizeof(GpTexture)); if (!*texture){ - GdipFree(dibits); - GdipFree(buff); - return OutOfMemory; + status = OutOfMemory; + goto exit; } if((status = GdipCreateMatrix(&(*texture)->transform)) != Ok){ - GdipFree(*texture); - GdipFree(dibits); - GdipFree(buff); - return status; - } - - (*texture)->brush.lb.lbStyle = BS_DIBPATTERNPT; - (*texture)->brush.lb.lbColor = DIB_RGB_COLORS; - (*texture)->brush.lb.lbHatch = (ULONG_PTR)buff; + goto exit; + } + + (*texture)->brush.lb.lbStyle = BS_PATTERN; + (*texture)->brush.lb.lbColor = 0; + (*texture)->brush.lb.lbHatch = (ULONG_PTR)hbm; (*texture)->brush.gdibrush = CreateBrushIndirect(&(*texture)->brush.lb); (*texture)->brush.bt = BrushTypeTextureFill; (*texture)->wrap = imageattr->wrap; - - GdipFree(dibits); - GdipFree(buff); - - return Ok; + (*texture)->image = new_image; + +exit: + if (status == Ok) + { + TRACE("<-- %p\n", *texture); + } + else + { + if (*texture) + { + GdipDeleteMatrix((*texture)->transform); + GdipFree(*texture); + *texture = NULL; + } + GdipDisposeImage(new_image); + TRACE("<-- error %u\n", status); + } + + return status; } /****************************************************************************** @@ -979,6 +983,7 @@ break; case BrushTypeTextureFill: GdipDeleteMatrix(((GpTexture*)brush)->transform); + GdipDisposeImage(((GpTexture*)brush)->image); break; default: break; @@ -1175,6 +1180,8 @@ { static int calls; + TRACE("(%p,%p,%p)\n", grad, argb, count); + if(!grad || !argb || !count || (*count < grad->pathdata.Count)) return InvalidParameter; @@ -1207,6 +1214,19 @@ *argb = sf->color; return Ok; +} + +/****************************************************************************** + * GdipGetTextureImage [GDIPLUS.@] + */ +GpStatus WINGDIPAPI GdipGetTextureImage(GpTexture *brush, GpImage **image) +{ + TRACE("(%p, %p)\n", brush, image); + + if(!brush || !image) + return InvalidParameter; + + return GdipCloneImage(brush->image, image); } /****************************************************************************** @@ -1430,6 +1450,8 @@ { static int calls; + TRACE("(%p,%p,%p,%i)\n", brush, blend, pos, count); + if(!(calls++)) FIXME("not implemented\n"); @@ -1463,7 +1485,7 @@ GpStatus WINGDIPAPI GdipSetPathGradientCenterPoint(GpPathGradient *grad, GpPointF *point) { - TRACE("(%p, %p)\n", grad, point); + TRACE("(%p, %s)\n", grad, debugstr_pointf(point)); if(!grad || !point) return InvalidParameter; @@ -1522,6 +1544,8 @@ { static int calls; + TRACE("(%p,%0.2f,%0.2f)\n", grad, focus, scale); + if(!grad || focus < 0.0 || focus > 1.0 || scale < 0.0 || scale > 1.0) return InvalidParameter; @@ -1535,6 +1559,8 @@ *grad, ARGB *argb, INT *count) { static int calls; + + TRACE("(%p,%p,%p)\n", grad, argb, count); if(!grad || !argb || !count || (*count <= 0) || (*count > grad->pathdata.Count)) @@ -1749,6 +1775,8 @@ { static int calls; + TRACE("(%p)\n", brush); + if(!(calls++)) FIXME("not implemented\n"); @@ -1760,6 +1788,8 @@ { static int calls; + TRACE("(%p,%p)\n", brush, matrix); + if(!(calls++)) FIXME("not implemented\n"); @@ -1770,6 +1800,8 @@ GpMatrixOrder order) { static int calls; + + TRACE("(%p,%0.2f,%0.2f,%u)\n", brush, sx, sy, order); if(!(calls++)) FIXME("not implemented\n"); @@ -1838,6 +1870,8 @@ { static int calls; + TRACE("(%p,%0.2f,%u)\n", brush, angle, order); + if(!brush) return InvalidParameter; Modified: trunk/reactos/dll/win32/gdiplus/customlinecap.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdiplus/customli…
============================================================================== --- trunk/reactos/dll/win32/gdiplus/customlinecap.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/gdiplus/customlinecap.c [iso-8859-1] Thu Mar 4 14:34:05 2010 @@ -57,6 +57,8 @@ * sizeof(PointF)); memcpy((*to)->pathdata.Types, from->pathdata.Types, from->pathdata.Count); + TRACE("<-- %p\n", *to); + return Ok; } @@ -105,6 +107,8 @@ (*customCap)->join = LineJoinMiter; (*customCap)->scale = 1.0; + TRACE("<-- %p\n", *customCap); + return Ok; } @@ -153,6 +157,8 @@ { static int calls; + TRACE("(%p,%u,%u)\n", custom, start, end); + if(!custom) return InvalidParameter; @@ -167,6 +173,8 @@ { static int calls; + TRACE("(%p,%u)\n", custom, base); + if(!(calls++)) FIXME("not implemented\n"); @@ -190,6 +198,8 @@ REAL inset) { static int calls; + + TRACE("(%p,%0.2f)\n", custom, inset); if(!(calls++)) FIXME("not implemented\n"); @@ -216,6 +226,8 @@ { static int calls; + TRACE("(%p,%0.2f)\n", custom, width); + if(!(calls++)) FIXME("not implemented\n"); @@ -239,6 +251,8 @@ { static int calls; + TRACE("(%0.2f,%0.2f,%i,%p)\n", height, width, fill, cap); + if(!(calls++)) FIXME("not implemented\n"); @@ -249,6 +263,8 @@ { static int calls; + TRACE("(%p,%p)\n", cap, fill); + if(!(calls++)) FIXME("not implemented\n"); @@ -259,6 +275,8 @@ { static int calls; + TRACE("(%p,%p)\n", cap, height); + if(!(calls++)) FIXME("not implemented\n"); @@ -269,6 +287,8 @@ { static int calls; + TRACE("(%p,%p)\n", cap, middle); + if(!(calls++)) FIXME("not implemented\n"); @@ -279,6 +299,8 @@ { static int calls; + TRACE("(%p,%p)\n", cap, width); + if(!(calls++)) FIXME("not implemented\n"); @@ -289,6 +311,8 @@ { static int calls; + TRACE("(%p,%i)\n", cap, fill); + if(!(calls++)) FIXME("not implemented\n"); @@ -299,6 +323,8 @@ { static int calls; + TRACE("(%p,%0.2f)\n", cap, height); + if(!(calls++)) FIXME("not implemented\n"); @@ -309,6 +335,8 @@ { static int calls; + TRACE("(%p,%0.2f)\n", cap, middle); + if(!(calls++)) FIXME("not implemented\n"); @@ -319,8 +347,10 @@ { static int calls; - if(!(calls++)) - FIXME("not implemented\n"); - - return NotImplemented; -} + TRACE("(%p,%0.2f)\n", cap, width); + + if(!(calls++)) + FIXME("not implemented\n"); + + return NotImplemented; +} Modified: trunk/reactos/dll/win32/gdiplus/font.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdiplus/font.c?r…
============================================================================== --- trunk/reactos/dll/win32/gdiplus/font.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/gdiplus/font.c [iso-8859-1] Thu Mar 4 14:34:05 2010 @@ -158,6 +158,8 @@ (*font)->height = tmw->ntmSizeEM; (*font)->line_spacing = tmw->tmAscent + tmw->tmDescent + tmw->tmExternalLeading; + TRACE("<-- %p\n", *font); + return Ok; } @@ -204,6 +206,8 @@ SelectObject(hdc, oldfont); DeleteObject(hfont); + + TRACE("<-- %p\n", *font); return Ok; } @@ -583,6 +587,8 @@ *FontFamily = ffamily; + TRACE("<-- %p\n", ffamily); + return Ok; } @@ -610,6 +616,8 @@ (*clonedFontFamily)->tmw = FontFamily->tmw; lstrcpyW((*clonedFontFamily)->FamilyName, FontFamily->FamilyName); + + TRACE("<-- %p\n", *clonedFontFamily); return Ok; } @@ -845,6 +853,9 @@ (*fontCollection)->FontFamilies = NULL; (*fontCollection)->count = 0; (*fontCollection)->allocated = 0; + + TRACE("<-- %p\n", *fontCollection); + return Ok; } Modified: trunk/reactos/dll/win32/gdiplus/gdiplus.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdiplus/gdiplus.…
============================================================================== --- trunk/reactos/dll/win32/gdiplus/gdiplus.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/gdiplus/gdiplus.c [iso-8859-1] Thu Mar 4 14:34:05 2010 @@ -58,9 +58,6 @@ switch(reason) { - case DLL_WINE_PREATTACH: - return FALSE; /* prefer native version */ - case DLL_PROCESS_ATTACH: DisableThreadLibraryCalls( hinst ); break; @@ -444,3 +441,9 @@ if (!rc) return "(null)"; return wine_dbg_sprintf("(%0.2f,%0.2f,%0.2f,%0.2f)", rc->X, rc->Y, rc->Width, rc->Height); } + +const char *debugstr_pointf(CONST PointF* pt) +{ + if (!pt) return "(null)"; + return wine_dbg_sprintf("(%0.2f,%0.2f)", pt->X, pt->Y); +} Modified: trunk/reactos/dll/win32/gdiplus/gdiplus.spec URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdiplus/gdiplus.…
============================================================================== --- trunk/reactos/dll/win32/gdiplus/gdiplus.spec [iso-8859-1] (original) +++ trunk/reactos/dll/win32/gdiplus/gdiplus.spec [iso-8859-1] Thu Mar 4 14:34:05 2010 @@ -397,7 +397,7 @@ @ stdcall GdipGetStringFormatTrimming(ptr ptr) @ stdcall GdipGetTextContrast(ptr ptr) @ stdcall GdipGetTextRenderingHint(ptr ptr) -@ stub GdipGetTextureImage +@ stdcall GdipGetTextureImage(ptr ptr) @ stdcall GdipGetTextureTransform(ptr ptr) @ stdcall GdipGetTextureWrapMode(ptr ptr) @ stdcall GdipGetVisibleClipBounds(ptr ptr) @@ -424,7 +424,7 @@ @ stdcall GdipIsOutlineVisiblePathPoint(ptr long long ptr ptr ptr) @ stdcall GdipIsOutlineVisiblePathPointI(ptr long long ptr ptr ptr) @ stdcall GdipIsStyleAvailable(ptr long ptr) -@ stub GdipIsVisibleClipEmpty +@ stdcall GdipIsVisibleClipEmpty(ptr ptr) @ stdcall GdipIsVisiblePathPoint(ptr long long ptr ptr) @ stdcall GdipIsVisiblePathPointI(ptr long long ptr ptr) @ stdcall GdipIsVisiblePoint(ptr long long ptr) Modified: trunk/reactos/dll/win32/gdiplus/gdiplus_private.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdiplus/gdiplus_…
============================================================================== --- trunk/reactos/dll/win32/gdiplus/gdiplus_private.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/gdiplus/gdiplus_private.h [iso-8859-1] Thu Mar 4 14:34:05 2010 @@ -80,8 +80,14 @@ extern const char *debugstr_rectf(CONST RectF* rc); +extern const char *debugstr_pointf(CONST PointF* pt); + extern void convert_32bppARGB_to_32bppPARGB(UINT width, UINT height, BYTE *dst_bits, INT dst_stride, const BYTE *src_bits, INT src_stride); + +extern GpStatus convert_pixels(UINT width, UINT height, + INT dst_stride, BYTE *dst_bits, PixelFormat dst_format, + INT src_stride, const BYTE *src_bits, PixelFormat src_format, ARGB *src_palette); struct GpPen{ UINT style; @@ -174,6 +180,7 @@ struct GpTexture{ GpBrush brush; GpMatrix *transform; + GpImage *image; WrapMode wrap; /* not used yet */ }; @@ -217,6 +224,7 @@ UINT palette_count; UINT palette_size; ARGB *palette_entries; + REAL xres, yres; }; struct GpMetafile{ @@ -249,9 +257,19 @@ ARGB high; }; +struct color_matrix{ + BOOL enabled; + ColorMatrixFlags flags; + ColorMatrix colormatrix; + ColorMatrix graymatrix; +}; + struct GpImageAttributes{ WrapMode wrap; struct color_key colorkeys[ColorAdjustTypeCount]; + struct color_matrix colormatrices[ColorAdjustTypeCount]; + BOOL gamma_enabled[ColorAdjustTypeCount]; + REAL gamma[ColorAdjustTypeCount]; }; struct GpFont{ @@ -274,6 +292,8 @@ INT tabcount; REAL firsttab; REAL *tabs; + CharacterRange *character_ranges; + INT range_count; }; struct GpFontCollection{ Modified: trunk/reactos/dll/win32/gdiplus/graphics.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdiplus/graphics…
============================================================================== --- trunk/reactos/dll/win32/gdiplus/graphics.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/gdiplus/graphics.c [iso-8859-1] Thu Mar 4 14:34:05 2010 @@ -1162,6 +1162,8 @@ list_init(&(*graphics)->containers); (*graphics)->contid = 0; + TRACE("<-- %p\n", *graphics); + return Ok; } @@ -1199,6 +1201,8 @@ { static int calls; + TRACE("(%p,%i,%p)\n", hemf, delete, metafile); + if(!hemf || !metafile) return InvalidParameter; @@ -1215,7 +1219,7 @@ UINT read; BYTE* copy; HENHMETAFILE hemf; - GpStatus retval = GenericError; + GpStatus retval = Ok; TRACE("(%p, %d, %p, %p)\n", hwmf, delete, placeable, metafile); @@ -1240,6 +1244,7 @@ if(CreateStreamOnHGlobal(copy, TRUE, &stream) != S_OK){ ERR("could not make stream\n"); GdipFree(copy); + retval = GenericError; goto err; } @@ -1251,7 +1256,10 @@ if(OleLoadPicture(stream, 0, FALSE, &IID_IPicture, (LPVOID*) &((*metafile)->image.picture)) != S_OK) + { + retval = GenericError; goto err; + } (*metafile)->image.type = ImageTypeMetafile; @@ -1260,8 +1268,10 @@ (*metafile)->image.palette_count = 0; (*metafile)->image.palette_size = 0; (*metafile)->image.palette_entries = NULL; + (*metafile)->image.xres = (REAL)placeable->Inch; + (*metafile)->image.yres = (REAL)placeable->Inch; (*metafile)->bounds.X = ((REAL) placeable->BoundingBox.Left) / ((REAL) placeable->Inch); - (*metafile)->bounds.Y = ((REAL) placeable->BoundingBox.Right) / ((REAL) placeable->Inch); + (*metafile)->bounds.Y = ((REAL) placeable->BoundingBox.Top) / ((REAL) placeable->Inch); (*metafile)->bounds.Width = ((REAL) (placeable->BoundingBox.Right - placeable->BoundingBox.Left)) / ((REAL) placeable->Inch); (*metafile)->bounds.Height = ((REAL) (placeable->BoundingBox.Bottom @@ -1271,10 +1281,11 @@ if(delete) DeleteMetaFile(hwmf); - return Ok; + TRACE("<-- %p\n", *metafile); err: - GdipFree(*metafile); + if (retval != Ok) + GdipFree(*metafile); IStream_Release(stream); return retval; } @@ -1871,6 +1882,9 @@ if(!graphics || !image || !points || count != 3) return InvalidParameter; + + TRACE("%s %s %s\n", debugstr_pointf(&points[0]), debugstr_pointf(&points[1]), + debugstr_pointf(&points[2])); memcpy(ptf, points, 3 * sizeof(GpPointF)); transform_and_round_points(graphics, pti, ptf, 3); @@ -1912,12 +1926,16 @@ else return NotImplemented; - if (bitmap->format == PixelFormat32bppARGB) + if (!(bitmap->format == PixelFormat16bppRGB555 || + bitmap->format == PixelFormat24bppRGB || + bitmap->format == PixelFormat32bppRGB || + bitmap->format == PixelFormat32bppPARGB)) { BITMAPINFOHEADER bih; BYTE *temp_bits; - - /* we need a bitmap with premultiplied alpha */ + PixelFormat dst_format; + + /* we can't draw a bitmap of this format directly */ hdc = CreateCompatibleDC(0); temp_hdc = 1; temp_bitmap = 1; @@ -1937,8 +1955,14 @@ hbitmap = CreateDIBSection(hdc, (BITMAPINFO*)&bih, DIB_RGB_COLORS, (void**)&temp_bits, NULL, 0); - convert_32bppARGB_to_32bppPARGB(bitmap->width, bitmap->height, - temp_bits, bitmap->width*4, bitmap->bits, bitmap->stride); + if (bitmap->format & (PixelFormatAlpha|PixelFormatPAlpha)) + dst_format = PixelFormat32bppPARGB; + else + dst_format = PixelFormat32bppRGB; + + convert_pixels(bitmap->width, bitmap->height, + bitmap->width*4, temp_bits, dst_format, + bitmap->stride, bitmap->bits, bitmap->format, bitmap->image.palette_entries); } else { @@ -1953,7 +1977,7 @@ old_hbm = SelectObject(hdc, hbitmap); } - if (bitmap->format == PixelFormat32bppARGB || bitmap->format == PixelFormat32bppPARGB) + if (bitmap->format & (PixelFormatAlpha|PixelFormatPAlpha)) { BLENDFUNCTION bf; @@ -3052,6 +3076,8 @@ { static int calls; + TRACE("(%p,%u)\n", graphics, intention); + if(!graphics) return InvalidParameter; @@ -3149,13 +3175,13 @@ GpStatus WINGDIPAPI GdipGetNearestColor(GpGraphics *graphics, ARGB* argb) { + FIXME("(%p, %p): stub\n", graphics, argb); + if(!graphics || !argb) return InvalidParameter; if(graphics->busy) return ObjectBusy; - - FIXME("(%p, %p): stub\n", graphics, argb); return NotImplemented; } @@ -3443,11 +3469,11 @@ GDIPCONST RectF* layoutRect, GDIPCONST GpStringFormat *stringFormat, INT regionCount, GpRegion** regions) { - if (!(graphics && string && font && layoutRect && stringFormat && regions)) - return InvalidParameter; - FIXME("stub: %p %s %d %p %p %p %d %p\n", graphics, debugstr_w(string), length, font, layoutRect, stringFormat, regionCount, regions); + + if (!(graphics && string && font && layoutRect && stringFormat && regions)) + return InvalidParameter; return NotImplemented; } @@ -4000,6 +4026,8 @@ UINT limitDpi) { static int calls; + + TRACE("(%p,%u)\n", metafile, limitDpi); if(!(calls++)) FIXME("not implemented\n"); @@ -4341,3 +4369,26 @@ FIXME("(%p %d %p %d %p %p): stub\n", hdc, type, frameRect, frameUnit, desc, metafile); return NotImplemented; } + +/***************************************************************************** + * GdipIsVisibleClipEmpty [GDIPLUS.@] + */ +GpStatus WINGDIPAPI GdipIsVisibleClipEmpty(GpGraphics *graphics, BOOL *res) +{ + GpStatus stat; + GpRegion* rgn; + + TRACE("(%p, %p)\n", graphics, res); + + if((stat = GdipCreateRegion(&rgn)) != Ok) + return stat; + + if((stat = get_visible_clip_region(graphics, rgn)) != Ok) + goto cleanup; + + stat = GdipIsEmptyRegion(rgn, graphics, res); + +cleanup: + GdipDeleteRegion(rgn); + return stat; +} Modified: trunk/reactos/dll/win32/gdiplus/graphicspath.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdiplus/graphics…
============================================================================== --- trunk/reactos/dll/win32/gdiplus/graphicspath.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/gdiplus/graphicspath.c [iso-8859-1] Thu Mar 4 14:34:05 2010 @@ -1380,6 +1380,8 @@ { static int calls; + TRACE("(%p,%0.2f,%0.2f,%p,%p,%p)\n", path, x, y, pen, graphics, result); + if(!path || !pen) return InvalidParameter; Modified: trunk/reactos/dll/win32/gdiplus/image.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdiplus/image.c?…
============================================================================== --- trunk/reactos/dll/win32/gdiplus/image.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/gdiplus/image.c [iso-8859-1] Thu Mar 4 14:34:05 2010 @@ -94,6 +94,24 @@ return NotImplemented; } +static inline void getpixel_1bppIndexed(BYTE *index, const BYTE *row, UINT x) +{ + *index = (row[x/8]>>(7-x%8)) & 1; +} + +static inline void getpixel_4bppIndexed(BYTE *index, const BYTE *row, UINT x) +{ + if (x & 1) + *index = row[x/2]&0xf; + else + *index = row[x/2]>>4; +} + +static inline void getpixel_8bppIndexed(BYTE *index, const BYTE *row, UINT x) +{ + *index = row[x]; +} + static inline void getpixel_16bppGrayScale(BYTE *r, BYTE *g, BYTE *b, BYTE *a, const BYTE *row, UINT x) { @@ -211,6 +229,7 @@ ARGB *color) { BYTE r, g, b, a; + BYTE index; BYTE *row; TRACE("%p %d %d %p\n", bitmap, x, y, color); @@ -222,6 +241,15 @@ switch (bitmap->format) { + case PixelFormat1bppIndexed: + getpixel_1bppIndexed(&index,row,x); + break; + case PixelFormat4bppIndexed: + getpixel_4bppIndexed(&index,row,x); + break; + case PixelFormat8bppIndexed: + getpixel_8bppIndexed(&index,row,x); + break; case PixelFormat16bppGrayScale: getpixel_16bppGrayScale(&r,&g,&b,&a,row,x); break; @@ -260,7 +288,10 @@ return NotImplemented; } - *color = a<<24|r<<16|g<<8|b; + if (bitmap->format & PixelFormatIndexed) + *color = bitmap->image.palette_entries[index]; + else + *color = a<<24|r<<16|g<<8|b; return Ok; } @@ -409,6 +440,412 @@ } return Ok; +} + +GpStatus convert_pixels(UINT width, UINT height, + INT dst_stride, BYTE *dst_bits, PixelFormat dst_format, + INT src_stride, const BYTE *src_bits, PixelFormat src_format, ARGB *src_palette) +{ + UINT x, y; + + if (src_format == dst_format || + (dst_format == PixelFormat32bppRGB && PIXELFORMATBPP(src_format) == 32)) + { + UINT widthbytes = PIXELFORMATBPP(src_format) * width / 8; + for (y=0; y<height; y++) + memcpy(dst_bits+dst_stride*y, src_bits+src_stride*y, widthbytes); + return Ok; + } + +#define convert_indexed_to_rgb(getpixel_function, setpixel_function) do { \ + for (x=0; x<width; x++) \ + for (y=0; y<height; y++) { \ + BYTE index; \ + BYTE *color; \ + getpixel_function(&index, src_bits+src_stride*y, x); \ + color = (BYTE*)(&src_palette[index]); \ + setpixel_function(color[2], color[1], color[0], color[3], dst_bits+dst_stride*y, x); \ + } \ + return Ok; \ +} while (0); + +#define convert_rgb_to_rgb(getpixel_function, setpixel_function) do { \ + for (x=0; x<width; x++) \ + for (y=0; y<height; y++) { \ + BYTE r, g, b, a; \ + getpixel_function(&r, &g, &b, &a, src_bits+src_stride*y, x); \ + setpixel_function(r, g, b, a, dst_bits+dst_stride*y, x); \ + } \ + return Ok; \ +} while (0); + + switch (src_format) + { + case PixelFormat1bppIndexed: + switch (dst_format) + { + case PixelFormat16bppGrayScale: + convert_indexed_to_rgb(getpixel_1bppIndexed, setpixel_16bppGrayScale); + case PixelFormat16bppRGB555: + convert_indexed_to_rgb(getpixel_1bppIndexed, setpixel_16bppRGB555); + case PixelFormat16bppRGB565: + convert_indexed_to_rgb(getpixel_1bppIndexed, setpixel_16bppRGB565); + case PixelFormat16bppARGB1555: + convert_indexed_to_rgb(getpixel_1bppIndexed, setpixel_16bppARGB1555); + case PixelFormat24bppRGB: + convert_indexed_to_rgb(getpixel_1bppIndexed, setpixel_24bppRGB); + case PixelFormat32bppRGB: + convert_indexed_to_rgb(getpixel_1bppIndexed, setpixel_32bppRGB); + case PixelFormat32bppARGB: + convert_indexed_to_rgb(getpixel_1bppIndexed, setpixel_32bppARGB); + case PixelFormat32bppPARGB: + convert_indexed_to_rgb(getpixel_1bppIndexed, setpixel_32bppPARGB); + case PixelFormat48bppRGB: + convert_indexed_to_rgb(getpixel_1bppIndexed, setpixel_48bppRGB); + case PixelFormat64bppARGB: + convert_indexed_to_rgb(getpixel_1bppIndexed, setpixel_64bppARGB); + default: + break; + } + break; + case PixelFormat4bppIndexed: + switch (dst_format) + { + case PixelFormat16bppGrayScale: + convert_indexed_to_rgb(getpixel_4bppIndexed, setpixel_16bppGrayScale); + case PixelFormat16bppRGB555: + convert_indexed_to_rgb(getpixel_4bppIndexed, setpixel_16bppRGB555); + case PixelFormat16bppRGB565: + convert_indexed_to_rgb(getpixel_4bppIndexed, setpixel_16bppRGB565); + case PixelFormat16bppARGB1555: + convert_indexed_to_rgb(getpixel_4bppIndexed, setpixel_16bppARGB1555); + case PixelFormat24bppRGB: + convert_indexed_to_rgb(getpixel_4bppIndexed, setpixel_24bppRGB); + case PixelFormat32bppRGB: + convert_indexed_to_rgb(getpixel_4bppIndexed, setpixel_32bppRGB); + case PixelFormat32bppARGB: + convert_indexed_to_rgb(getpixel_4bppIndexed, setpixel_32bppARGB); + case PixelFormat32bppPARGB: + convert_indexed_to_rgb(getpixel_4bppIndexed, setpixel_32bppPARGB); + case PixelFormat48bppRGB: + convert_indexed_to_rgb(getpixel_4bppIndexed, setpixel_48bppRGB); + case PixelFormat64bppARGB: + convert_indexed_to_rgb(getpixel_4bppIndexed, setpixel_64bppARGB); + default: + break; + } + break; + case PixelFormat8bppIndexed: + switch (dst_format) + { + case PixelFormat16bppGrayScale: + convert_indexed_to_rgb(getpixel_8bppIndexed, setpixel_16bppGrayScale); + case PixelFormat16bppRGB555: + convert_indexed_to_rgb(getpixel_8bppIndexed, setpixel_16bppRGB555); + case PixelFormat16bppRGB565: + convert_indexed_to_rgb(getpixel_8bppIndexed, setpixel_16bppRGB565); + case PixelFormat16bppARGB1555: + convert_indexed_to_rgb(getpixel_8bppIndexed, setpixel_16bppARGB1555); + case PixelFormat24bppRGB: + convert_indexed_to_rgb(getpixel_8bppIndexed, setpixel_24bppRGB); + case PixelFormat32bppRGB: + convert_indexed_to_rgb(getpixel_8bppIndexed, setpixel_32bppRGB); + case PixelFormat32bppARGB: + convert_indexed_to_rgb(getpixel_8bppIndexed, setpixel_32bppARGB); + case PixelFormat32bppPARGB: + convert_indexed_to_rgb(getpixel_8bppIndexed, setpixel_32bppPARGB); + case PixelFormat48bppRGB: + convert_indexed_to_rgb(getpixel_8bppIndexed, setpixel_48bppRGB); + case PixelFormat64bppARGB: + convert_indexed_to_rgb(getpixel_8bppIndexed, setpixel_64bppARGB); + default: + break; + } + break; + case PixelFormat16bppGrayScale: + switch (dst_format) + { + case PixelFormat16bppRGB555: + convert_rgb_to_rgb(getpixel_16bppGrayScale, setpixel_16bppRGB555); + case PixelFormat16bppRGB565: + convert_rgb_to_rgb(getpixel_16bppGrayScale, setpixel_16bppRGB565); + case PixelFormat16bppARGB1555: + convert_rgb_to_rgb(getpixel_16bppGrayScale, setpixel_16bppARGB1555); + case PixelFormat24bppRGB: + convert_rgb_to_rgb(getpixel_16bppGrayScale, setpixel_24bppRGB); + case PixelFormat32bppRGB: + convert_rgb_to_rgb(getpixel_16bppGrayScale, setpixel_32bppRGB); + case PixelFormat32bppARGB: + convert_rgb_to_rgb(getpixel_16bppGrayScale, setpixel_32bppARGB); + case PixelFormat32bppPARGB: + convert_rgb_to_rgb(getpixel_16bppGrayScale, setpixel_32bppPARGB); + case PixelFormat48bppRGB: + convert_rgb_to_rgb(getpixel_16bppGrayScale, setpixel_48bppRGB); + case PixelFormat64bppARGB: + convert_rgb_to_rgb(getpixel_16bppGrayScale, setpixel_64bppARGB); + default: + break; + } + break; + case PixelFormat16bppRGB555: + switch (dst_format) + { + case PixelFormat16bppGrayScale: + convert_rgb_to_rgb(getpixel_16bppRGB555, setpixel_16bppGrayScale); + case PixelFormat16bppRGB565: + convert_rgb_to_rgb(getpixel_16bppRGB555, setpixel_16bppRGB565); + case PixelFormat16bppARGB1555: + convert_rgb_to_rgb(getpixel_16bppRGB555, setpixel_16bppARGB1555); + case PixelFormat24bppRGB: + convert_rgb_to_rgb(getpixel_16bppRGB555, setpixel_24bppRGB); + case PixelFormat32bppRGB: + convert_rgb_to_rgb(getpixel_16bppRGB555, setpixel_32bppRGB); + case PixelFormat32bppARGB: + convert_rgb_to_rgb(getpixel_16bppRGB555, setpixel_32bppARGB); + case PixelFormat32bppPARGB: + convert_rgb_to_rgb(getpixel_16bppRGB555, setpixel_32bppPARGB); + case PixelFormat48bppRGB: + convert_rgb_to_rgb(getpixel_16bppRGB555, setpixel_48bppRGB); + case PixelFormat64bppARGB: + convert_rgb_to_rgb(getpixel_16bppRGB555, setpixel_64bppARGB); + default: + break; + } + break; + case PixelFormat16bppRGB565: + switch (dst_format) + { + case PixelFormat16bppGrayScale: + convert_rgb_to_rgb(getpixel_16bppRGB565, setpixel_16bppGrayScale); + case PixelFormat16bppRGB555: + convert_rgb_to_rgb(getpixel_16bppRGB565, setpixel_16bppRGB555); + case PixelFormat16bppARGB1555: + convert_rgb_to_rgb(getpixel_16bppRGB565, setpixel_16bppARGB1555); + case PixelFormat24bppRGB: + convert_rgb_to_rgb(getpixel_16bppRGB565, setpixel_24bppRGB); + case PixelFormat32bppRGB: + convert_rgb_to_rgb(getpixel_16bppRGB565, setpixel_32bppRGB); + case PixelFormat32bppARGB: + convert_rgb_to_rgb(getpixel_16bppRGB565, setpixel_32bppARGB); + case PixelFormat32bppPARGB: + convert_rgb_to_rgb(getpixel_16bppRGB565, setpixel_32bppPARGB); + case PixelFormat48bppRGB: + convert_rgb_to_rgb(getpixel_16bppRGB565, setpixel_48bppRGB); + case PixelFormat64bppARGB: + convert_rgb_to_rgb(getpixel_16bppRGB565, setpixel_64bppARGB); + default: + break; + } + break; + case PixelFormat16bppARGB1555: + switch (dst_format) + { + case PixelFormat16bppGrayScale: + convert_rgb_to_rgb(getpixel_16bppARGB1555, setpixel_16bppGrayScale); + case PixelFormat16bppRGB555: + convert_rgb_to_rgb(getpixel_16bppARGB1555, setpixel_16bppRGB555); + case PixelFormat16bppRGB565: + convert_rgb_to_rgb(getpixel_16bppARGB1555, setpixel_16bppRGB565); + case PixelFormat24bppRGB: + convert_rgb_to_rgb(getpixel_16bppARGB1555, setpixel_24bppRGB); + case PixelFormat32bppRGB: + convert_rgb_to_rgb(getpixel_16bppARGB1555, setpixel_32bppRGB); + case PixelFormat32bppARGB: + convert_rgb_to_rgb(getpixel_16bppARGB1555, setpixel_32bppARGB); + case PixelFormat32bppPARGB: + convert_rgb_to_rgb(getpixel_16bppARGB1555, setpixel_32bppPARGB); + case PixelFormat48bppRGB: + convert_rgb_to_rgb(getpixel_16bppARGB1555, setpixel_48bppRGB); + case PixelFormat64bppARGB: + convert_rgb_to_rgb(getpixel_16bppARGB1555, setpixel_64bppARGB); + default: + break; + } + break; + case PixelFormat24bppRGB: + switch (dst_format) + { + case PixelFormat16bppGrayScale: + convert_rgb_to_rgb(getpixel_24bppRGB, setpixel_16bppGrayScale); + case PixelFormat16bppRGB555: + convert_rgb_to_rgb(getpixel_24bppRGB, setpixel_16bppRGB555); + case PixelFormat16bppRGB565: + convert_rgb_to_rgb(getpixel_24bppRGB, setpixel_16bppRGB565); + case PixelFormat16bppARGB1555: + convert_rgb_to_rgb(getpixel_24bppRGB, setpixel_16bppARGB1555); + case PixelFormat32bppRGB: + convert_rgb_to_rgb(getpixel_24bppRGB, setpixel_32bppRGB); + case PixelFormat32bppARGB: + convert_rgb_to_rgb(getpixel_24bppRGB, setpixel_32bppARGB); + case PixelFormat32bppPARGB: + convert_rgb_to_rgb(getpixel_24bppRGB, setpixel_32bppPARGB); + case PixelFormat48bppRGB: + convert_rgb_to_rgb(getpixel_24bppRGB, setpixel_48bppRGB); + case PixelFormat64bppARGB: + convert_rgb_to_rgb(getpixel_24bppRGB, setpixel_64bppARGB); + default: + break; + } + break; + case PixelFormat32bppRGB: + switch (dst_format) + { + case PixelFormat16bppGrayScale: + convert_rgb_to_rgb(getpixel_32bppRGB, setpixel_16bppGrayScale); + case PixelFormat16bppRGB555: + convert_rgb_to_rgb(getpixel_32bppRGB, setpixel_16bppRGB555); + case PixelFormat16bppRGB565: + convert_rgb_to_rgb(getpixel_32bppRGB, setpixel_16bppRGB565); + case PixelFormat16bppARGB1555: + convert_rgb_to_rgb(getpixel_32bppRGB, setpixel_16bppARGB1555); + case PixelFormat24bppRGB: + convert_rgb_to_rgb(getpixel_32bppRGB, setpixel_24bppRGB); + case PixelFormat32bppARGB: + convert_rgb_to_rgb(getpixel_32bppRGB, setpixel_32bppARGB); + case PixelFormat32bppPARGB: + convert_rgb_to_rgb(getpixel_32bppRGB, setpixel_32bppPARGB); + case PixelFormat48bppRGB: + convert_rgb_to_rgb(getpixel_32bppRGB, setpixel_48bppRGB); + case PixelFormat64bppARGB: + convert_rgb_to_rgb(getpixel_32bppRGB, setpixel_64bppARGB); + default: + break; + } + break; + case PixelFormat32bppARGB: + switch (dst_format) + { + case PixelFormat16bppGrayScale: + convert_rgb_to_rgb(getpixel_32bppARGB, setpixel_16bppGrayScale); + case PixelFormat16bppRGB555: + convert_rgb_to_rgb(getpixel_32bppARGB, setpixel_16bppRGB555); + case PixelFormat16bppRGB565: + convert_rgb_to_rgb(getpixel_32bppARGB, setpixel_16bppRGB565); + case PixelFormat16bppARGB1555: + convert_rgb_to_rgb(getpixel_32bppARGB, setpixel_16bppARGB1555); + case PixelFormat24bppRGB: + convert_rgb_to_rgb(getpixel_32bppARGB, setpixel_24bppRGB); + case PixelFormat32bppPARGB: + convert_32bppARGB_to_32bppPARGB(width, height, dst_bits, dst_stride, src_bits, src_stride); + return Ok; + case PixelFormat48bppRGB: + convert_rgb_to_rgb(getpixel_32bppARGB, setpixel_48bppRGB); + case PixelFormat64bppARGB: + convert_rgb_to_rgb(getpixel_32bppARGB, setpixel_64bppARGB); + default: + break; + } + break; + case PixelFormat32bppPARGB: + switch (dst_format) + { + case PixelFormat16bppGrayScale: + convert_rgb_to_rgb(getpixel_32bppPARGB, setpixel_16bppGrayScale); + case PixelFormat16bppRGB555: + convert_rgb_to_rgb(getpixel_32bppPARGB, setpixel_16bppRGB555); + case PixelFormat16bppRGB565: + convert_rgb_to_rgb(getpixel_32bppPARGB, setpixel_16bppRGB565); + case PixelFormat16bppARGB1555: + convert_rgb_to_rgb(getpixel_32bppPARGB, setpixel_16bppARGB1555); + case PixelFormat24bppRGB: + convert_rgb_to_rgb(getpixel_32bppPARGB, setpixel_24bppRGB); + case PixelFormat32bppRGB: + convert_rgb_to_rgb(getpixel_32bppPARGB, setpixel_32bppRGB); + case PixelFormat32bppARGB: + convert_rgb_to_rgb(getpixel_32bppPARGB, setpixel_32bppARGB); + case PixelFormat48bppRGB: + convert_rgb_to_rgb(getpixel_32bppPARGB, setpixel_48bppRGB); + case PixelFormat64bppARGB: + convert_rgb_to_rgb(getpixel_32bppPARGB, setpixel_64bppARGB); + default: + break; + } + break; + case PixelFormat48bppRGB: + switch (dst_format) + { + case PixelFormat16bppGrayScale: + convert_rgb_to_rgb(getpixel_48bppRGB, setpixel_16bppGrayScale); + case PixelFormat16bppRGB555: + convert_rgb_to_rgb(getpixel_48bppRGB, setpixel_16bppRGB555); + case PixelFormat16bppRGB565: + convert_rgb_to_rgb(getpixel_48bppRGB, setpixel_16bppRGB565); + case PixelFormat16bppARGB1555: + convert_rgb_to_rgb(getpixel_48bppRGB, setpixel_16bppARGB1555); + case PixelFormat24bppRGB: + convert_rgb_to_rgb(getpixel_48bppRGB, setpixel_24bppRGB); + case PixelFormat32bppRGB: + convert_rgb_to_rgb(getpixel_48bppRGB, setpixel_32bppRGB); + case PixelFormat32bppARGB: + convert_rgb_to_rgb(getpixel_48bppRGB, setpixel_32bppARGB); + case PixelFormat32bppPARGB: + convert_rgb_to_rgb(getpixel_48bppRGB, setpixel_32bppPARGB); + case PixelFormat64bppARGB: + convert_rgb_to_rgb(getpixel_48bppRGB, setpixel_64bppARGB); + default: + break; + } + break; + case PixelFormat64bppARGB: + switch (dst_format) + { + case PixelFormat16bppGrayScale: + convert_rgb_to_rgb(getpixel_64bppARGB, setpixel_16bppGrayScale); + case PixelFormat16bppRGB555: + convert_rgb_to_rgb(getpixel_64bppARGB, setpixel_16bppRGB555); + case PixelFormat16bppRGB565: + convert_rgb_to_rgb(getpixel_64bppARGB, setpixel_16bppRGB565); + case PixelFormat16bppARGB1555: + convert_rgb_to_rgb(getpixel_64bppARGB, setpixel_16bppARGB1555); + case PixelFormat24bppRGB: + convert_rgb_to_rgb(getpixel_64bppARGB, setpixel_24bppRGB); + case PixelFormat32bppRGB: + convert_rgb_to_rgb(getpixel_64bppARGB, setpixel_32bppRGB); + case PixelFormat32bppARGB: + convert_rgb_to_rgb(getpixel_64bppARGB, setpixel_32bppARGB); + case PixelFormat32bppPARGB: + convert_rgb_to_rgb(getpixel_64bppARGB, setpixel_32bppPARGB); + case PixelFormat48bppRGB: + convert_rgb_to_rgb(getpixel_64bppARGB, setpixel_48bppRGB); + default: + break; + } + break; + case PixelFormat64bppPARGB: + switch (dst_format) + { + case PixelFormat16bppGrayScale: + convert_rgb_to_rgb(getpixel_64bppPARGB, setpixel_16bppGrayScale); + case PixelFormat16bppRGB555: + convert_rgb_to_rgb(getpixel_64bppPARGB, setpixel_16bppRGB555); + case PixelFormat16bppRGB565: + convert_rgb_to_rgb(getpixel_64bppPARGB, setpixel_16bppRGB565); + case PixelFormat16bppARGB1555: + convert_rgb_to_rgb(getpixel_64bppPARGB, setpixel_16bppARGB1555); + case PixelFormat24bppRGB: + convert_rgb_to_rgb(getpixel_64bppPARGB, setpixel_24bppRGB); + case PixelFormat32bppRGB: + convert_rgb_to_rgb(getpixel_64bppPARGB, setpixel_32bppRGB); + case PixelFormat32bppARGB: + convert_rgb_to_rgb(getpixel_64bppPARGB, setpixel_32bppARGB); + case PixelFormat32bppPARGB: + convert_rgb_to_rgb(getpixel_64bppPARGB, setpixel_32bppPARGB); + case PixelFormat48bppRGB: + convert_rgb_to_rgb(getpixel_64bppPARGB, setpixel_48bppRGB); + case PixelFormat64bppARGB: + convert_rgb_to_rgb(getpixel_64bppPARGB, setpixel_64bppARGB); + default: + break; + } + break; + default: + break; + } + +#undef convert_indexed_to_rgb +#undef convert_rgb_to_rgb + + return NotImplemented; } /* This function returns a pointer to an array of pixels that represents the @@ -420,16 +857,13 @@ GpStatus WINGDIPAPI GdipBitmapLockBits(GpBitmap* bitmap, GDIPCONST GpRect* rect, UINT flags, PixelFormat format, BitmapData* lockeddata) { - BOOL bm_is_selected; INT stride, bitspp = PIXELFORMATBPP(format); - HDC hdc; - HBITMAP hbm, old = NULL; - BITMAPINFO *pbmi; BYTE *buff = NULL; UINT abs_height; GpRect act_rect; /* actual rect to be used */ - - TRACE("%p %p %d %d %p\n", bitmap, rect, flags, format, lockeddata); + GpStatus stat; + + TRACE("%p %p %d 0x%x %p\n", bitmap, rect, flags, format, lockeddata); if(!lockeddata || !bitmap) return InvalidParameter; @@ -448,10 +882,17 @@ } if(flags & ImageLockModeUserInputBuf) + { + static int fixme=0; + if (!fixme++) FIXME("ImageLockModeUserInputBuf not implemented\n"); return NotImplemented; + } if(bitmap->lockmode) + { + WARN("bitmap is already locked and cannot be locked again\n"); return WrongState; + } if (bitmap->bits && bitmap->format == format) { @@ -470,83 +911,77 @@ return Ok; } - hbm = bitmap->hbitmap; - hdc = bitmap->hdc; - bm_is_selected = (hdc != 0); - - pbmi = GdipAlloc(sizeof(BITMAPINFOHEADER) + 256 * sizeof(RGBQUAD)); - if (!pbmi) - return OutOfMemory; - pbmi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); - pbmi->bmiHeader.biBitCount = 0; - - if(!bm_is_selected){ - hdc = CreateCompatibleDC(0); - old = SelectObject(hdc, hbm); - } - - /* fill out bmi */ - GetDIBits(hdc, hbm, 0, 0, NULL, pbmi, DIB_RGB_COLORS); - - abs_height = abs(pbmi->bmiHeader.biHeight); - stride = pbmi->bmiHeader.biWidth * bitspp / 8; + /* Make sure we can convert to the requested format. */ + stat = convert_pixels(0, 0, 0, NULL, format, 0, NULL, bitmap->format, NULL); + if (stat == NotImplemented) + { + FIXME("cannot read bitmap from %x to %x\n", bitmap->format, format); + return NotImplemented; + } + + /* If we're opening for writing, make sure we'll be able to write back in + * the original format. */ + if (flags & ImageLockModeWrite) + { + stat = convert_pixels(0, 0, 0, NULL, bitmap->format, 0, NULL, format, NULL); + if (stat == NotImplemented) + { + FIXME("cannot write bitmap from %x to %x\n", format, bitmap->format); + return NotImplemented; + } + } + + abs_height = bitmap->height; + stride = (bitmap->width * bitspp + 7) / 8; stride = (stride + 3) & ~3; buff = GdipAlloc(stride * abs_height); - pbmi->bmiHeader.biBitCount = bitspp; - - if(buff) - GetDIBits(hdc, hbm, 0, abs_height, buff, pbmi, DIB_RGB_COLORS); - - if(!bm_is_selected){ - SelectObject(hdc, old); - DeleteDC(hdc); - } - - if(!buff){ - GdipFree(pbmi); - return OutOfMemory; + if (!buff) return OutOfMemory; + + stat = convert_pixels(bitmap->width, bitmap->height, + stride, buff, format, + bitmap->stride, bitmap->bits, bitmap->format, bitmap->image.palette_entries); + + if (stat != Ok) + { + GdipFree(buff); + return stat; } lockeddata->Width = act_rect.Width; lockeddata->Height = act_rect.Height; lockeddata->PixelFormat = format; lockeddata->Reserved = flags; - - if(pbmi->bmiHeader.biHeight > 0){ - lockeddata->Stride = -stride; - lockeddata->Scan0 = buff + (bitspp / 8) * act_rect.X + - stride * (abs_height - 1 - act_rect.Y); - } - else{ - lockeddata->Stride = stride; - lockeddata->Scan0 = buff + (bitspp / 8) * act_rect.X + stride * act_rect.Y; - } + lockeddata->Stride = stride; + lockeddata->Scan0 = buff + (bitspp / 8) * act_rect.X + stride * act_rect.Y; bitmap->lockmode = flags; bitmap->numlocks++; - bitmap->bitmapbits = buff; - GdipFree(pbmi); return Ok; } GpStatus WINGDIPAPI GdipBitmapSetResolution(GpBitmap* bitmap, REAL xdpi, REAL ydpi) { - FIXME("(%p, %.2f, %.2f)\n", bitmap, xdpi, ydpi); - - return NotImplemented; + TRACE("(%p, %.2f, %.2f)\n", bitmap, xdpi, ydpi); + + if (!bitmap || xdpi == 0.0 || ydpi == 0.0) + return InvalidParameter; + + bitmap->image.xres = xdpi; + bitmap->image.yres = ydpi; + + return Ok; } GpStatus WINGDIPAPI GdipBitmapUnlockBits(GpBitmap* bitmap, BitmapData* lockeddata) { - HDC hdc; - HBITMAP hbm, old = NULL; - BOOL bm_is_selected; - BITMAPINFO *pbmi; + GpStatus stat; + + TRACE("(%p,%p)\n", bitmap, lockeddata); if(!bitmap || !lockeddata) return InvalidParameter; @@ -570,38 +1005,25 @@ { /* we passed a direct reference; no need to do anything */ bitmap->lockmode = 0; + bitmap->numlocks = 0; return Ok; } - hbm = bitmap->hbitmap; - hdc = bitmap->hdc; - bm_is_selected = (hdc != 0); - - pbmi = GdipAlloc(sizeof(BITMAPINFOHEADER) + 256 * sizeof(RGBQUAD)); - pbmi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); - pbmi->bmiHeader.biBitCount = 0; - - if(!bm_is_selected){ - hdc = CreateCompatibleDC(0); - old = SelectObject(hdc, hbm); - } - - GetDIBits(hdc, hbm, 0, 0, NULL, pbmi, DIB_RGB_COLORS); - pbmi->bmiHeader.biBitCount = PIXELFORMATBPP(lockeddata->PixelFormat); - SetDIBits(hdc, hbm, 0, abs(pbmi->bmiHeader.biHeight), - bitmap->bitmapbits, pbmi, DIB_RGB_COLORS); - - if(!bm_is_selected){ - SelectObject(hdc, old); - DeleteDC(hdc); - } - - GdipFree(pbmi); + stat = convert_pixels(bitmap->width, bitmap->height, + bitmap->stride, bitmap->bits, bitmap->format, + lockeddata->Stride, bitmap->bitmapbits, lockeddata->PixelFormat, NULL); + + if (stat != Ok) + { + ERR("failed to convert pixels; this should never happen\n"); + } + GdipFree(bitmap->bitmapbits); bitmap->bitmapbits = NULL; bitmap->lockmode = 0; - - return Ok; + bitmap->numlocks = 0; + + return stat; } GpStatus WINGDIPAPI GdipCloneBitmapArea(REAL x, REAL y, REAL width, REAL height, @@ -613,7 +1035,7 @@ Rect area; GpStatus stat; - TRACE("(%f,%f,%f,%f,%i,%p,%p)\n", x, y, width, height, format, srcBitmap, dstBitmap); + TRACE("(%f,%f,%f,%f,0x%x,%p,%p)\n", x, y, width, height, format, srcBitmap, dstBitmap); if (!srcBitmap || !dstBitmap || srcBitmap->image.type != ImageTypeBitmap || x < 0 || y < 0 || @@ -671,7 +1093,7 @@ GpStatus WINGDIPAPI GdipCloneBitmapAreaI(INT x, INT y, INT width, INT height, PixelFormat format, GpBitmap* srcBitmap, GpBitmap** dstBitmap) { - TRACE("(%i,%i,%i,%i,%i,%p,%p)\n", x, y, width, height, format, srcBitmap, dstBitmap); + TRACE("(%i,%i,%i,%i,0x%x,%p,%p)\n", x, y, width, height, format, srcBitmap, dstBitmap); return GdipCloneBitmapArea(x, y, width, height, format, srcBitmap, dstBitmap); } @@ -937,6 +1359,9 @@ { static int calls; + TRACE("(%p,%p,%p,%u,%s,%p)\n", ref, metafile, succ, emfType, + debugstr_w(description), out_metafile); + if(!ref || !metafile || !out_metafile) return InvalidParameter; @@ -1172,6 +1597,20 @@ } } +static GpStatus get_screen_resolution(REAL *xres, REAL *yres) +{ + HDC screendc = GetDC(0); + + if (!screendc) return GenericError; + + *xres = (REAL)GetDeviceCaps(screendc, LOGPIXELSX); + *yres = (REAL)GetDeviceCaps(screendc, LOGPIXELSY); + + ReleaseDC(0, screendc); + + return Ok; +} + GpStatus WINGDIPAPI GdipCreateBitmapFromScan0(INT width, INT height, INT stride, PixelFormat format, BYTE* scan0, GpBitmap** bitmap) { @@ -1181,8 +1620,10 @@ HDC hdc; BYTE *bits; int i; - - TRACE("%d %d %d %d %p %p\n", width, height, stride, format, scan0, bitmap); + REAL xres, yres; + GpStatus stat; + + TRACE("%d %d %d 0x%x %p %p\n", width, height, stride, format, scan0, bitmap); if (!bitmap) return InvalidParameter; @@ -1193,6 +1634,9 @@ if(scan0 && !stride) return InvalidParameter; + + stat = get_screen_resolution(&xres, &yres); + if (stat != Ok) return stat; row_size = (width * PIXELFORMATBPP(format)+7) / 8; dib_stride = (row_size + 3) & ~3; @@ -1243,6 +1687,8 @@ (*bitmap)->image.palette_count = 0; (*bitmap)->image.palette_size = 0; (*bitmap)->image.palette_entries = NULL; + (*bitmap)->image.xres = xres; + (*bitmap)->image.yres = yres; (*bitmap)->width = width; (*bitmap)->height = height; (*bitmap)->format = format; @@ -1282,6 +1728,8 @@ } } + TRACE("<-- %p\n", *bitmap); + return Ok; } @@ -1398,8 +1846,15 @@ GpStatus WINGDIPAPI GdipFindFirstImageItem(GpImage *image, ImageItemData* item) { + static int calls; + + TRACE("(%p,%p)\n", image, item); + if(!image || !item) return InvalidParameter; + + if (!(calls++)) + FIXME("not implemented\n"); return NotImplemented; } @@ -1520,15 +1975,14 @@ GpStatus WINGDIPAPI GdipGetImageHorizontalResolution(GpImage *image, REAL *res) { - static int calls; - if(!image || !res) return InvalidParameter; - if(!(calls++)) - FIXME("not implemented\n"); - - return NotImplemented; + *res = image->xres; + + TRACE("(%p) <-- %0.2f\n", image, *res); + + return Ok; } GpStatus WINGDIPAPI GdipGetImagePaletteSize(GpImage *image, INT *size) @@ -1588,15 +2042,14 @@ GpStatus WINGDIPAPI GdipGetImageVerticalResolution(GpImage *image, REAL *res) { - static int calls; - if(!image || !res) return InvalidParameter; - if(!(calls++)) - FIXME("not implemented\n"); - - return NotImplemented; + *res = image->yres; + + TRACE("(%p) <-- %0.2f\n", image, *res); + + return Ok; } GpStatus WINGDIPAPI GdipGetImageWidth(GpImage *image, UINT *width) @@ -1700,17 +2153,34 @@ { static int calls; + TRACE("(%p,%p,%p)\n", image, size, num); + if(!(calls++)) FIXME("not implemented\n"); return InvalidParameter; } +struct image_format_dimension +{ + const GUID *format; + const GUID *dimension; +}; + +struct image_format_dimension image_format_dimensions[] = +{ + {&ImageFormatGIF, &FrameDimensionTime}, + {&ImageFormatIcon, &FrameDimensionResolution}, + {NULL} +}; + GpStatus WINGDIPAPI GdipImageGetFrameCount(GpImage *image, GDIPCONST GUID* dimensionID, UINT* count) { static int calls; + TRACE("(%p,%s,%p)\n", image, debugstr_guid(dimensionID), count); + if(!image || !dimensionID || !count) return InvalidParameter; @@ -1723,12 +2193,12 @@ GpStatus WINGDIPAPI GdipImageGetFrameDimensionsCount(GpImage *image, UINT* count) { + /* Native gdiplus 1.1 does not yet support multiple frame dimensions. */ + if(!image || !count) return InvalidParameter; *count = 1; - - FIXME("stub\n"); return Ok; } @@ -1736,13 +2206,27 @@ GpStatus WINGDIPAPI GdipImageGetFrameDimensionsList(GpImage* image, GUID* dimensionIDs, UINT count) { - static int calls; - - if(!image || !dimensionIDs) - return InvalidParameter; - - if(!(calls++)) - FIXME("not implemented\n"); + int i; + const GUID *result=NULL; + + TRACE("(%p,%p,%u)\n", image, dimensionIDs, count); + + if(!image || !dimensionIDs || count != 1) + return InvalidParameter; + + for (i=0; image_format_dimensions[i].format; i++) + { + if (IsEqualGUID(&image->format, image_format_dimensions[i].format)) + { + result = image_format_dimensions[i].dimension; + break; + } + } + + if (!result) + result = &FrameDimensionPage; + + memcpy(dimensionIDs, result, sizeof(GUID)); return Ok; } @@ -1976,6 +2460,8 @@ (*image)->palette_size = 0; (*image)->palette_entries = NULL; + TRACE("<-- %p\n", *image); + return Ok; } @@ -2084,6 +2570,8 @@ { static int calls; + TRACE("(%p,%u)\n", image, propId); + if(!image) return InvalidParameter; @@ -2096,6 +2584,8 @@ GpStatus WINGDIPAPI GdipSetPropertyItem(GpImage *image, GDIPCONST PropertyItem* item) { static int calls; + + TRACE("(%p,%p)\n", image, item); if(!(calls++)) FIXME("not implemented\n"); @@ -2790,6 +3280,8 @@ { static int calls; + TRACE("(%p,%p,%u)\n", effect, params, size); + if(!(calls++)) FIXME("not implemented\n"); Modified: trunk/reactos/dll/win32/gdiplus/imageattributes.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdiplus/imageatt…
============================================================================== --- trunk/reactos/dll/win32/gdiplus/imageattributes.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/gdiplus/imageattributes.c [iso-8859-1] Thu Mar 4 14:34:05 2010 @@ -30,25 +30,30 @@ GpStatus WINGDIPAPI GdipCloneImageAttributes(GDIPCONST GpImageAttributes *imageattr, GpImageAttributes **cloneImageattr) { + GpStatus stat; + TRACE("(%p, %p)\n", imageattr, cloneImageattr); if(!imageattr || !cloneImageattr) return InvalidParameter; - **cloneImageattr = *imageattr; - - return Ok; + stat = GdipCreateImageAttributes(cloneImageattr); + + if (stat == Ok) + **cloneImageattr = *imageattr; + + return stat; } GpStatus WINGDIPAPI GdipCreateImageAttributes(GpImageAttributes **imageattr) { - TRACE("(%p)\n", imageattr); - if(!imageattr) return InvalidParameter; *imageattr = GdipAlloc(sizeof(GpImageAttributes)); if(!*imageattr) return OutOfMemory; + + TRACE("<-- %p\n", *imageattr); return Ok; } @@ -84,15 +89,32 @@ ColorAdjustType type, BOOL enableFlag, GDIPCONST ColorMatrix* colorMatrix, GDIPCONST ColorMatrix* grayMatrix, ColorMatrixFlags flags) { - static int calls; - - if(!imageattr || !colorMatrix || !grayMatrix) - return InvalidParameter; - - if(!(calls++)) - FIXME("not implemented\n"); - - return NotImplemented; + TRACE("(%p,%u,%i,%p,%p,%u)\n", imageattr, type, enableFlag, colorMatrix, + grayMatrix, flags); + + if(!imageattr || type >= ColorAdjustTypeCount || flags > ColorMatrixFlagsAltGray) + return InvalidParameter; + + if (enableFlag) + { + if (!colorMatrix) + return InvalidParameter; + + if (flags == ColorMatrixFlagsAltGray) + { + if (!grayMatrix) + return InvalidParameter; + + imageattr->colormatrices[type].graymatrix = *grayMatrix; + } + + imageattr->colormatrices[type].colormatrix = *colorMatrix; + imageattr->colormatrices[type].flags = flags; + } + + imageattr->colormatrices[type].enabled = enableFlag; + + return Ok; } GpStatus WINGDIPAPI GdipSetImageAttributesWrapMode(GpImageAttributes *imageAttr, @@ -100,6 +122,8 @@ { static int calls; + TRACE("(%p,%u,%08x,%i)\n", imageAttr, wrap, argb, clamp); + if(!imageAttr) return InvalidParameter; @@ -114,6 +138,8 @@ { static int calls; + TRACE("(%p,%i)\n", imageAttr, enableFlag); + if(!(calls++)) FIXME("not implemented\n"); @@ -123,12 +149,15 @@ GpStatus WINGDIPAPI GdipSetImageAttributesGamma(GpImageAttributes *imageAttr, ColorAdjustType type, BOOL enableFlag, REAL gamma) { - static int calls; - - if(!(calls++)) - FIXME("not implemented\n"); - - return NotImplemented; + TRACE("(%p,%u,%i,%0.2f)\n", imageAttr, type, enableFlag, gamma); + + if (!imageAttr || (enableFlag && gamma <= 0.0) || type >= ColorAdjustTypeCount) + return InvalidParameter; + + imageAttr->gamma_enabled[type] = enableFlag; + imageAttr->gamma[type] = gamma; + + return Ok; } GpStatus WINGDIPAPI GdipSetImageAttributesNoOp(GpImageAttributes *imageAttr, @@ -136,6 +165,8 @@ { static int calls; + TRACE("(%p,%u,%i)\n", imageAttr, type, enableFlag); + if(!(calls++)) FIXME("not implemented\n"); @@ -146,6 +177,8 @@ ColorAdjustType type, BOOL enableFlag, ColorChannelFlags channelFlags) { static int calls; + + TRACE("(%p,%u,%i,%x)\n", imageAttr, type, enableFlag, channelFlags); if(!(calls++)) FIXME("not implemented\n"); @@ -159,6 +192,8 @@ { static int calls; + TRACE("(%p,%u,%i,%s)\n", imageAttr, type, enableFlag, debugstr_w(colorProfileFilename)); + if(!(calls++)) FIXME("not implemented\n"); @@ -171,6 +206,8 @@ { static int calls; + TRACE("(%p,%u,%i,%u,%p)\n", imageAttr, type, enableFlag, mapSize, map); + if(!(calls++)) FIXME("not implemented\n"); @@ -182,6 +219,8 @@ { static int calls; + TRACE("(%p,%u,%i,%0.2f)\n", imageAttr, type, enableFlag, threshold); + if(!(calls++)) FIXME("not implemented\n"); @@ -193,8 +232,10 @@ { static int calls; - if(!(calls++)) - FIXME("not implemented\n"); - - return NotImplemented; -} + TRACE("(%p,%u)\n", imageAttr, type); + + if(!(calls++)) + FIXME("not implemented\n"); + + return NotImplemented; +} Modified: trunk/reactos/dll/win32/gdiplus/pen.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdiplus/pen.c?re…
============================================================================== --- trunk/reactos/dll/win32/gdiplus/pen.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/gdiplus/pen.c [iso-8859-1] Thu Mar 4 14:34:05 2010 @@ -101,6 +101,8 @@ GdipCloneCustomLineCap(pen->customend, &(*clonepen)->customend); GdipCloneBrush(pen->brush, &(*clonepen)->brush); + TRACE("<-- %p\n", *clonepen); + return Ok; } @@ -154,6 +156,8 @@ *pen = gp_pen; + TRACE("<-- %p\n", *pen); + return Ok; } @@ -389,6 +393,8 @@ { static int calls; + TRACE("(%p)\n", pen); + if(!pen) return InvalidParameter; @@ -401,6 +407,8 @@ GpStatus WINGDIPAPI GdipScalePenTransform(GpPen *pen, REAL sx, REAL sy, GpMatrixOrder order) { static int calls; + + TRACE("(%p,%0.2f,%0.2f,%u)\n", pen, sx, sy, order); if(!pen) return InvalidParameter; Modified: trunk/reactos/dll/win32/gdiplus/stringformat.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdiplus/stringfo…
============================================================================== --- trunk/reactos/dll/win32/gdiplus/stringformat.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/gdiplus/stringformat.c [iso-8859-1] Thu Mar 4 14:34:05 2010 @@ -48,11 +48,15 @@ (*format)->digitlang = LANG_NEUTRAL; (*format)->trimming = StringTrimmingCharacter; (*format)->digitsub = StringDigitSubstituteUser; + (*format)->character_ranges = NULL; + (*format)->range_count = 0; /* tabstops */ (*format)->tabcount = 0; (*format)->firsttab = 0.0; (*format)->tabs = NULL; + TRACE("<-- %p\n", *format); + return Ok; } @@ -61,6 +65,7 @@ if(!format) return InvalidParameter; + GdipFree(format->character_ranges); GdipFree(format->tabs); GdipFree(format); @@ -141,14 +146,16 @@ } GpStatus WINGDIPAPI GdipGetStringFormatMeasurableCharacterRangeCount( - GDIPCONST GpStringFormat* format, INT* count) + GDIPCONST GpStringFormat *format, INT *count) { if (!(format && count)) return InvalidParameter; - FIXME("stub: %p %p\n", format, count); - - return NotImplemented; + TRACE("%p %p\n", format, count); + + *count = format->range_count; + + return Ok; } GpStatus WINGDIPAPI GdipGetStringFormatTabStopCount(GDIPCONST GpStringFormat *format, @@ -242,15 +249,26 @@ return Ok; } -GpStatus WINGDIPAPI GdipSetStringFormatMeasurableCharacterRanges(GpStringFormat* - format, INT rangeCount, GDIPCONST CharacterRange* ranges) -{ - if (!(format && rangeCount && ranges)) - return InvalidParameter; - - FIXME("stub: %p, %d, %p\n", format, rangeCount, ranges); - - return NotImplemented; +GpStatus WINGDIPAPI GdipSetStringFormatMeasurableCharacterRanges( + GpStringFormat *format, INT rangeCount, GDIPCONST CharacterRange *ranges) +{ + CharacterRange *new_ranges; + + if (!(format && ranges)) + return InvalidParameter; + + TRACE("%p, %d, %p\n", format, rangeCount, ranges); + + new_ranges = GdipAlloc(rangeCount * sizeof(CharacterRange)); + if (!new_ranges) + return OutOfMemory; + + GdipFree(format->character_ranges); + format->character_ranges = new_ranges; + memcpy(format->character_ranges, ranges, sizeof(CharacterRange) * rangeCount); + format->range_count = rangeCount; + + return Ok; } GpStatus WINGDIPAPI GdipSetStringFormatTabStops(GpStringFormat *format, REAL firsttab, @@ -331,6 +349,19 @@ else (*newFormat)->tabs = NULL; + if(format->range_count > 0){ + (*newFormat)->character_ranges = GdipAlloc(sizeof(CharacterRange) * format->range_count); + if(!(*newFormat)->character_ranges){ + GdipFree((*newFormat)->tabs); + GdipFree(*newFormat); + return OutOfMemory; + } + memcpy((*newFormat)->character_ranges, format->character_ranges, + sizeof(CharacterRange) * format->range_count); + } + else + (*newFormat)->character_ranges = NULL; + TRACE("%p %p\n",format,newFormat); return Ok;
14 years, 9 months
1
0
0
0
[cwittich] 45830: [GDIPLUS_WINETEST] sync gdiplus_winetest to wine 1.1.39
by cwittich@svn.reactos.org
Author: cwittich Date: Thu Mar 4 14:32:28 2010 New Revision: 45830 URL:
http://svn.reactos.org/svn/reactos?rev=45830&view=rev
Log: [GDIPLUS_WINETEST] sync gdiplus_winetest to wine 1.1.39 Modified: trunk/rostests/winetests/gdiplus/image.c trunk/rostests/winetests/gdiplus/stringformat.c Modified: trunk/rostests/winetests/gdiplus/image.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/gdiplus/image.c…
============================================================================== --- trunk/rostests/winetests/gdiplus/image.c [iso-8859-1] (original) +++ trunk/rostests/winetests/gdiplus/image.c [iso-8859-1] Thu Mar 4 14:32:28 2010 @@ -30,6 +30,18 @@ #define expect(expected, got) ok((UINT)(got) == (UINT)(expected), "Expected %.8x, got %.8x\n", (UINT)(expected), (UINT)(got)) #define expectf(expected, got) ok(fabs(expected - got) < 0.0001, "Expected %.2f, got %.2f\n", expected, got) +static BOOL color_match(ARGB c1, ARGB c2, BYTE max_diff) +{ + if (abs((c1 & 0xff) - (c2 & 0xff)) > max_diff) return FALSE; + c1 >>= 8; c2 >>= 8; + if (abs((c1 & 0xff) - (c2 & 0xff)) > max_diff) return FALSE; + c1 >>= 8; c2 >>= 8; + if (abs((c1 & 0xff) - (c2 & 0xff)) > max_diff) return FALSE; + c1 >>= 8; c2 >>= 8; + if (abs((c1 & 0xff) - (c2 & 0xff)) > max_diff) return FALSE; + return TRUE; +} + static void expect_guid(REFGUID expected, REFGUID got, int line, BOOL todo) { WCHAR bufferW[39]; @@ -64,7 +76,7 @@ LPBYTE data; HRESULT hres; GpStatus stat; - GpBitmap *bmp; + GpImage *img; hglob = GlobalAlloc (0, size); data = GlobalLock (hglob); @@ -75,16 +87,16 @@ ok_(__FILE__, line)(hres == S_OK, "Failed to create a stream\n"); if(hres != S_OK) return; - stat = GdipCreateBitmapFromStream(stream, &bmp); + stat = GdipLoadImageFromStream(stream, &img); ok_(__FILE__, line)(stat == Ok, "Failed to create a Bitmap\n"); if(stat != Ok){ IStream_Release(stream); return; } - expect_rawformat(expected, (GpImage*)bmp, line, todo); - - GdipDisposeImage((GpImage*)bmp); + expect_rawformat(expected, img, line, todo); + + GdipDisposeImage(img); IStream_Release(stream); } @@ -206,7 +218,13 @@ stat = GdipImageGetFrameDimensionsList((GpImage*)bm, &dimension, 1); expect(Ok, stat); - expect_guid(&FrameDimensionPage, &dimension, __LINE__, TRUE); + expect_guid(&FrameDimensionPage, &dimension, __LINE__, FALSE); + + stat = GdipImageGetFrameDimensionsList((GpImage*)bm, &dimension, 2); + expect(InvalidParameter, stat); + + stat = GdipImageGetFrameDimensionsList((GpImage*)bm, &dimension, 0); + expect(InvalidParameter, stat); count = 12345; stat = GdipImageGetFrameCount((GpImage*)bm, &dimension, &count); @@ -512,6 +530,7 @@ GdipDisposeImage((GpImage*)gpbm); DeleteObject(hbm); + memset(buff, 0, sizeof(buff)); hbm = CreateBitmap(WIDTH2, HEIGHT2, 1, 1, &buff); stat = GdipCreateBitmapFromHBITMAP(hbm, NULL, &gpbm); expect(Ok, stat); @@ -774,12 +793,176 @@ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xda,0x00,0x0c,0x03,0x01, 0x00,0x02,0x11,0x03,0x11,0x00,0x3f,0x00,0xb2,0xc0,0x07,0xff,0xd9 }; +/* 320x320 twip wmf */ +static const unsigned char wmfimage[180] = { +0xd7,0xcd,0xc6,0x9a,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x01,0x40,0x01,0xa0,0x05, +0x00,0x00,0x00,0x00,0xb1,0x52,0x01,0x00,0x09,0x00,0x00,0x03,0x4f,0x00,0x00,0x00, +0x0f,0x00,0x08,0x00,0x00,0x00,0x00,0x00,0x05,0x00,0x00,0x00,0x0b,0x02,0x00,0x00, +0x00,0x00,0x05,0x00,0x00,0x00,0x0c,0x02,0x40,0x01,0x40,0x01,0x04,0x00,0x00,0x00, +0x02,0x01,0x01,0x00,0x04,0x00,0x00,0x00,0x04,0x01,0x0d,0x00,0x08,0x00,0x00,0x00, +0xfa,0x02,0x05,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x00,0x00,0x00, +0x2d,0x01,0x00,0x00,0x07,0x00,0x00,0x00,0xfc,0x02,0x01,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x04,0x00,0x00,0x00,0x2d,0x01,0x01,0x00,0x07,0x00,0x00,0x00,0xfc,0x02, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x2d,0x01,0x02,0x00, +0x07,0x00,0x00,0x00,0x1b,0x04,0x40,0x01,0x40,0x01,0x00,0x00,0x00,0x00,0x04,0x00, +0x00,0x00,0xf0,0x01,0x00,0x00,0x04,0x00,0x00,0x00,0xf0,0x01,0x01,0x00,0x03,0x00, +0x00,0x00,0x00,0x00 +}; static void test_getrawformat(void) { test_bufferrawformat((void*)pngimage, sizeof(pngimage), &ImageFormatPNG, __LINE__, FALSE); test_bufferrawformat((void*)gifimage, sizeof(gifimage), &ImageFormatGIF, __LINE__, FALSE); test_bufferrawformat((void*)bmpimage, sizeof(bmpimage), &ImageFormatBMP, __LINE__, FALSE); test_bufferrawformat((void*)jpgimage, sizeof(jpgimage), &ImageFormatJPEG, __LINE__, FALSE); + test_bufferrawformat((void*)wmfimage, sizeof(wmfimage), &ImageFormatWMF, __LINE__, FALSE); +} + +static void test_loadwmf(void) +{ + LPSTREAM stream; + HGLOBAL hglob; + LPBYTE data; + HRESULT hres; + GpStatus stat; + GpImage *img; + GpRectF bounds; + GpUnit unit; + REAL res = 12345.0; + + hglob = GlobalAlloc (0, sizeof(wmfimage)); + data = GlobalLock (hglob); + memcpy(data, wmfimage, sizeof(wmfimage)); + GlobalUnlock(hglob); data = NULL; + + hres = CreateStreamOnHGlobal(hglob, TRUE, &stream); + ok(hres == S_OK, "Failed to create a stream\n"); + if(hres != S_OK) return; + + stat = GdipLoadImageFromStream(stream, &img); + ok(stat == Ok, "Failed to create a Bitmap\n"); + if(stat != Ok){ + IStream_Release(stream); + return; + } + + IStream_Release(stream); + + stat = GdipGetImageBounds(img, &bounds, &unit); + expect(Ok, stat); + todo_wine expect(UnitPixel, unit); + expectf(0.0, bounds.X); + expectf(0.0, bounds.Y); + todo_wine expectf(320.0, bounds.Width); + todo_wine expectf(320.0, bounds.Height); + + stat = GdipGetImageHorizontalResolution(img, &res); + expect(Ok, stat); + todo_wine expectf(1440.0, res); + + stat = GdipGetImageVerticalResolution(img, &res); + expect(Ok, stat); + todo_wine expectf(1440.0, res); + + GdipDisposeImage(img); +} + +static void test_createfromwmf(void) +{ + HMETAFILE hwmf; + GpImage *img; + GpStatus stat; + GpRectF bounds; + GpUnit unit; + REAL res = 12345.0; + + hwmf = SetMetaFileBitsEx(sizeof(wmfimage)-sizeof(WmfPlaceableFileHeader), + wmfimage+sizeof(WmfPlaceableFileHeader)); + ok(hwmf != 0, "SetMetaFileBitsEx failed\n"); + + stat = GdipCreateMetafileFromWmf(hwmf, TRUE, + (WmfPlaceableFileHeader*)wmfimage, (GpMetafile**)&img); + expect(Ok, stat); + + stat = GdipGetImageBounds(img, &bounds, &unit); + expect(Ok, stat); + todo_wine expect(UnitPixel, unit); + expectf(0.0, bounds.X); + expectf(0.0, bounds.Y); + todo_wine expectf(320.0, bounds.Width); + todo_wine expectf(320.0, bounds.Height); + + stat = GdipGetImageHorizontalResolution(img, &res); + expect(Ok, stat); + expectf(1440.0, res); + + stat = GdipGetImageVerticalResolution(img, &res); + expect(Ok, stat); + expectf(1440.0, res); + + GdipDisposeImage(img); +} + +static void test_resolution(void) +{ + GpStatus stat; + GpBitmap *bitmap; + REAL res=-1.0; + HDC screendc; + int screenxres, screenyres; + + /* create Bitmap */ + stat = GdipCreateBitmapFromScan0(1, 1, 32, PixelFormat24bppRGB, NULL, &bitmap); + expect(Ok, stat); + + /* test invalid values */ + stat = GdipGetImageHorizontalResolution(NULL, &res); + expect(InvalidParameter, stat); + + stat = GdipGetImageHorizontalResolution((GpImage*)bitmap, NULL); + expect(InvalidParameter, stat); + + stat = GdipGetImageVerticalResolution(NULL, &res); + expect(InvalidParameter, stat); + + stat = GdipGetImageVerticalResolution((GpImage*)bitmap, NULL); + expect(InvalidParameter, stat); + + stat = GdipBitmapSetResolution(NULL, 96.0, 96.0); + expect(InvalidParameter, stat); + + stat = GdipBitmapSetResolution(bitmap, 0.0, 0.0); + expect(InvalidParameter, stat); + + /* defaults to screen resolution */ + screendc = GetDC(0); + + screenxres = GetDeviceCaps(screendc, LOGPIXELSX); + screenyres = GetDeviceCaps(screendc, LOGPIXELSY); + + ReleaseDC(0, screendc); + + stat = GdipGetImageHorizontalResolution((GpImage*)bitmap, &res); + expect(Ok, stat); + expectf((REAL)screenxres, res); + + stat = GdipGetImageVerticalResolution((GpImage*)bitmap, &res); + expect(Ok, stat); + expectf((REAL)screenyres, res); + + /* test changing the resolution */ + stat = GdipBitmapSetResolution(bitmap, screenxres*2.0, screenyres*3.0); + expect(Ok, stat); + + stat = GdipGetImageHorizontalResolution((GpImage*)bitmap, &res); + expect(Ok, stat); + expectf(screenxres*2.0, res); + + stat = GdipGetImageVerticalResolution((GpImage*)bitmap, &res); + expect(Ok, stat); + expectf(screenyres*3.0, res); + + stat = GdipDisposeImage((GpImage*)bitmap); + expect(Ok, stat); } static void test_createhbitmap(void) @@ -963,6 +1146,7 @@ INT size; BYTE buffer[1040]; ColorPalette *palette=(ColorPalette*)buffer; + ARGB color=0; /* test initial palette from non-indexed bitmap */ stat = GdipCreateBitmapFromScan0(2, 2, 8, PixelFormat32bppRGB, NULL, &bitmap); @@ -1008,6 +1192,22 @@ expect(0xff000000, palette->Entries[0]); expect(0xffffffff, palette->Entries[1]); + /* test getting/setting pixels */ + stat = GdipBitmapGetPixel(bitmap, 0, 0, &color); + expect(Ok, stat); + expect(0xff000000, color); + + stat = GdipBitmapSetPixel(bitmap, 0, 1, 0xffffffff); + todo_wine ok((stat == Ok) || + broken(stat == InvalidParameter) /* pre-win7 */, "stat=%.8x\n", stat); + + if (stat == Ok) + { + stat = GdipBitmapGetPixel(bitmap, 0, 1, &color); + expect(Ok, stat); + expect(0xffffffff, color); + } + GdipDisposeImage((GpImage*)bitmap); /* test initial palette on 4-bit bitmap */ @@ -1025,6 +1225,22 @@ check_halftone_palette(palette); + /* test getting/setting pixels */ + stat = GdipBitmapGetPixel(bitmap, 0, 0, &color); + expect(Ok, stat); + expect(0xff000000, color); + + stat = GdipBitmapSetPixel(bitmap, 0, 1, 0xffff00ff); + todo_wine ok((stat == Ok) || + broken(stat == InvalidParameter) /* pre-win7 */, "stat=%.8x\n", stat); + + if (stat == Ok) + { + stat = GdipBitmapGetPixel(bitmap, 0, 1, &color); + expect(Ok, stat); + expect(0xffff00ff, color); + } + GdipDisposeImage((GpImage*)bitmap); /* test initial palette on 8-bit bitmap */ @@ -1041,6 +1257,22 @@ expect(256, palette->Count); check_halftone_palette(palette); + + /* test getting/setting pixels */ + stat = GdipBitmapGetPixel(bitmap, 0, 0, &color); + expect(Ok, stat); + expect(0xff000000, color); + + stat = GdipBitmapSetPixel(bitmap, 0, 1, 0xffcccccc); + todo_wine ok((stat == Ok) || + broken(stat == InvalidParameter) /* pre-win7 */, "stat=%.8x\n", stat); + + if (stat == Ok) + { + stat = GdipBitmapGetPixel(bitmap, 0, 1, &color); + expect(Ok, stat); + expect(0xffcccccc, color); + } /* test setting/getting a different palette */ palette->Entries[1] = 0xffcccccc; @@ -1090,6 +1322,307 @@ "Expected %.8x, got %.8x\n", InvalidParameter, stat); GdipDisposeImage((GpImage*)bitmap); +} + +static void test_colormatrix(void) +{ + GpStatus stat; + ColorMatrix colormatrix, graymatrix; + GpImageAttributes *imageattr; + const ColorMatrix identity = {{ + {1.0,0.0,0.0,0.0,0.0}, + {0.0,1.0,0.0,0.0,0.0}, + {0.0,0.0,1.0,0.0,0.0}, + {0.0,0.0,0.0,1.0,0.0}, + {0.0,0.0,0.0,0.0,1.0}}}; + const ColorMatrix double_red = {{ + {2.0,0.0,0.0,0.0,0.0}, + {0.0,1.0,0.0,0.0,0.0}, + {0.0,0.0,1.0,0.0,0.0}, + {0.0,0.0,0.0,1.0,0.0}, + {0.0,0.0,0.0,0.0,1.0}}}; + GpBitmap *bitmap1, *bitmap2; + GpGraphics *graphics; + ARGB color; + + colormatrix = identity; + graymatrix = identity; + + stat = GdipSetImageAttributesColorMatrix(NULL, ColorAdjustTypeDefault, + TRUE, &colormatrix, &graymatrix, ColorMatrixFlagsDefault); + expect(InvalidParameter, stat); + + stat = GdipCreateImageAttributes(&imageattr); + expect(Ok, stat); + + stat = GdipSetImageAttributesColorMatrix(imageattr, ColorAdjustTypeDefault, + TRUE, &colormatrix, NULL, ColorMatrixFlagsDefault); + expect(Ok, stat); + + stat = GdipSetImageAttributesColorMatrix(imageattr, ColorAdjustTypeDefault, + TRUE, NULL, NULL, ColorMatrixFlagsDefault); + expect(InvalidParameter, stat); + + stat = GdipSetImageAttributesColorMatrix(imageattr, ColorAdjustTypeDefault, + TRUE, &colormatrix, &graymatrix, ColorMatrixFlagsDefault); + expect(Ok, stat); + + stat = GdipSetImageAttributesColorMatrix(imageattr, ColorAdjustTypeDefault, + TRUE, &colormatrix, NULL, ColorMatrixFlagsSkipGrays); + expect(Ok, stat); + + stat = GdipSetImageAttributesColorMatrix(imageattr, ColorAdjustTypeDefault, + TRUE, &colormatrix, NULL, ColorMatrixFlagsAltGray); + expect(InvalidParameter, stat); + + stat = GdipSetImageAttributesColorMatrix(imageattr, ColorAdjustTypeDefault, + TRUE, &colormatrix, &graymatrix, ColorMatrixFlagsAltGray); + expect(Ok, stat); + + stat = GdipSetImageAttributesColorMatrix(imageattr, ColorAdjustTypeDefault, + TRUE, &colormatrix, &graymatrix, 3); + expect(InvalidParameter, stat); + + stat = GdipSetImageAttributesColorMatrix(imageattr, ColorAdjustTypeCount, + TRUE, &colormatrix, &graymatrix, ColorMatrixFlagsDefault); + expect(InvalidParameter, stat); + + stat = GdipSetImageAttributesColorMatrix(imageattr, ColorAdjustTypeAny, + TRUE, &colormatrix, &graymatrix, ColorMatrixFlagsDefault); + expect(InvalidParameter, stat); + + stat = GdipSetImageAttributesColorMatrix(imageattr, ColorAdjustTypeDefault, + FALSE, NULL, NULL, ColorMatrixFlagsDefault); + expect(Ok, stat); + + /* Drawing a bitmap transforms the colors */ + colormatrix = double_red; + stat = GdipSetImageAttributesColorMatrix(imageattr, ColorAdjustTypeDefault, + TRUE, &colormatrix, NULL, ColorMatrixFlagsDefault); + expect(Ok, stat); + + stat = GdipCreateBitmapFromScan0(1, 1, 0, PixelFormat32bppRGB, NULL, &bitmap1); + expect(Ok, stat); + + stat = GdipCreateBitmapFromScan0(1, 1, 0, PixelFormat32bppRGB, NULL, &bitmap2); + expect(Ok, stat); + + stat = GdipBitmapSetPixel(bitmap1, 0, 0, 0xff40ffff); + expect(Ok, stat); + + stat = GdipGetImageGraphicsContext((GpImage*)bitmap2, &graphics); + expect(Ok, stat); + + stat = GdipDrawImageRectRectI(graphics, (GpImage*)bitmap1, 0,0,1,1, 0,0,1,1, + UnitPixel, imageattr, NULL, NULL); + expect(Ok, stat); + + stat = GdipBitmapGetPixel(bitmap2, 0, 0, &color); + expect(Ok, stat); + todo_wine expect(0xff80ffff, color); + + GdipDeleteGraphics(graphics); + GdipDisposeImage((GpImage*)bitmap1); + GdipDisposeImage((GpImage*)bitmap2); + GdipDisposeImageAttributes(imageattr); +} + +static void test_gamma(void) +{ + GpStatus stat; + GpImageAttributes *imageattr; + GpBitmap *bitmap1, *bitmap2; + GpGraphics *graphics; + ARGB color; + + stat = GdipSetImageAttributesGamma(NULL, ColorAdjustTypeDefault, TRUE, 1.0); + expect(InvalidParameter, stat); + + stat = GdipCreateImageAttributes(&imageattr); + expect(Ok, stat); + + stat = GdipSetImageAttributesGamma(imageattr, ColorAdjustTypeDefault, TRUE, 1.0); + expect(Ok, stat); + + stat = GdipSetImageAttributesGamma(imageattr, ColorAdjustTypeAny, TRUE, 1.0); + expect(InvalidParameter, stat); + + stat = GdipSetImageAttributesGamma(imageattr, ColorAdjustTypeDefault, TRUE, -1.0); + expect(InvalidParameter, stat); + + stat = GdipSetImageAttributesGamma(imageattr, ColorAdjustTypeDefault, TRUE, 0.0); + expect(InvalidParameter, stat); + + stat = GdipSetImageAttributesGamma(imageattr, ColorAdjustTypeDefault, TRUE, 0.5); + expect(Ok, stat); + + stat = GdipSetImageAttributesGamma(imageattr, ColorAdjustTypeDefault, FALSE, 0.0); + expect(Ok, stat); + + /* Drawing a bitmap transforms the colors */ + stat = GdipSetImageAttributesGamma(imageattr, ColorAdjustTypeDefault, TRUE, 3.0); + expect(Ok, stat); + + stat = GdipCreateBitmapFromScan0(1, 1, 0, PixelFormat32bppRGB, NULL, &bitmap1); + expect(Ok, stat); + + stat = GdipCreateBitmapFromScan0(1, 1, 0, PixelFormat32bppRGB, NULL, &bitmap2); + expect(Ok, stat); + + stat = GdipBitmapSetPixel(bitmap1, 0, 0, 0xff80ffff); + expect(Ok, stat); + + stat = GdipGetImageGraphicsContext((GpImage*)bitmap2, &graphics); + expect(Ok, stat); + + stat = GdipDrawImageRectRectI(graphics, (GpImage*)bitmap1, 0,0,1,1, 0,0,1,1, + UnitPixel, imageattr, NULL, NULL); + expect(Ok, stat); + + stat = GdipBitmapGetPixel(bitmap2, 0, 0, &color); + expect(Ok, stat); + todo_wine ok(color_match(0xff20ffff, color, 1), "Expected ff20ffff, got %.8x\n", color); + + GdipDeleteGraphics(graphics); + GdipDisposeImage((GpImage*)bitmap1); + GdipDisposeImage((GpImage*)bitmap2); + GdipDisposeImageAttributes(imageattr); +} + +/* 1x1 pixel gif, 2 frames; first frame is white, second is black */ +static const unsigned char gifanimation[72] = { +0x47,0x49,0x46,0x38,0x39,0x61,0x01,0x00,0x01,0x00,0xa1,0x00,0x00,0x00,0x00,0x00, +0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x21,0xf9,0x04,0x00,0x0a,0x00,0xff, +0x00,0x2c,0x00,0x00,0x00,0x00,0x01,0x00,0x01,0x00,0x00,0x02,0x02,0x4c,0x01,0x00, +0x21,0xf9,0x04,0x01,0x0a,0x00,0x01,0x00,0x2c,0x00,0x00,0x00,0x00,0x01,0x00,0x01, +0x00,0x00,0x02,0x02,0x44,0x01,0x00,0x3b +}; + +static void test_multiframegif(void) +{ + LPSTREAM stream; + HGLOBAL hglob; + LPBYTE data; + HRESULT hres; + GpStatus stat; + GpBitmap *bmp; + ARGB color; + UINT count; + GUID dimension; + + /* Test frame functions with an animated GIF */ + hglob = GlobalAlloc (0, sizeof(gifanimation)); + data = GlobalLock (hglob); + memcpy(data, gifanimation, sizeof(gifanimation)); + GlobalUnlock(hglob); + + hres = CreateStreamOnHGlobal(hglob, TRUE, &stream); + ok(hres == S_OK, "Failed to create a stream\n"); + if(hres != S_OK) return; + + stat = GdipCreateBitmapFromStream(stream, &bmp); + ok(stat == Ok, "Failed to create a Bitmap\n"); + if(stat != Ok){ + IStream_Release(stream); + return; + } + + /* Bitmap starts at frame 0 */ + color = 0xdeadbeef; + stat = GdipBitmapGetPixel(bmp, 0, 0, &color); + expect(Ok, stat); + expect(0xffffffff, color); + + /* Check that we get correct metadata */ + stat = GdipImageGetFrameDimensionsCount((GpImage*)bmp,&count); + expect(Ok, stat); + expect(1, count); + + stat = GdipImageGetFrameDimensionsList((GpImage*)bmp, &dimension, 1); + expect(Ok, stat); + expect_guid(&FrameDimensionTime, &dimension, __LINE__, FALSE); + + count = 12345; + stat = GdipImageGetFrameCount((GpImage*)bmp, &dimension, &count); + todo_wine expect(Ok, stat); + todo_wine expect(2, count); + + /* SelectActiveFrame overwrites our current data */ + stat = GdipImageSelectActiveFrame((GpImage*)bmp, &dimension, 1); + expect(Ok, stat); + + color = 0xdeadbeef; + GdipBitmapGetPixel(bmp, 0, 0, &color); + expect(Ok, stat); + todo_wine expect(0xff000000, color); + + stat = GdipImageSelectActiveFrame((GpImage*)bmp, &dimension, 0); + expect(Ok, stat); + + color = 0xdeadbeef; + GdipBitmapGetPixel(bmp, 0, 0, &color); + expect(Ok, stat); + expect(0xffffffff, color); + + /* Write over the image data */ + stat = GdipBitmapSetPixel(bmp, 0, 0, 0xff000000); + expect(Ok, stat); + + /* Switching to the same frame does not overwrite our changes */ + stat = GdipImageSelectActiveFrame((GpImage*)bmp, &dimension, 0); + expect(Ok, stat); + + stat = GdipBitmapGetPixel(bmp, 0, 0, &color); + expect(Ok, stat); + expect(0xff000000, color); + + /* But switching to another frame and back does */ + stat = GdipImageSelectActiveFrame((GpImage*)bmp, &dimension, 1); + expect(Ok, stat); + + stat = GdipImageSelectActiveFrame((GpImage*)bmp, &dimension, 0); + expect(Ok, stat); + + stat = GdipBitmapGetPixel(bmp, 0, 0, &color); + expect(Ok, stat); + todo_wine expect(0xffffffff, color); + + GdipDisposeImage((GpImage*)bmp); + IStream_Release(stream); + + /* Test with a non-animated gif */ + hglob = GlobalAlloc (0, sizeof(gifimage)); + data = GlobalLock (hglob); + memcpy(data, gifimage, sizeof(gifimage)); + GlobalUnlock(hglob); + + hres = CreateStreamOnHGlobal(hglob, TRUE, &stream); + ok(hres == S_OK, "Failed to create a stream\n"); + if(hres != S_OK) return; + + stat = GdipCreateBitmapFromStream(stream, &bmp); + ok(stat == Ok, "Failed to create a Bitmap\n"); + if(stat != Ok){ + IStream_Release(stream); + return; + } + + /* Check metadata */ + stat = GdipImageGetFrameDimensionsCount((GpImage*)bmp,&count); + expect(Ok, stat); + expect(1, count); + + stat = GdipImageGetFrameDimensionsList((GpImage*)bmp, &dimension, 1); + expect(Ok, stat); + expect_guid(&FrameDimensionTime, &dimension, __LINE__, FALSE); + + count = 12345; + stat = GdipImageGetFrameCount((GpImage*)bmp, &dimension, &count); + todo_wine expect(Ok, stat); + todo_wine expect(1, count); + + GdipDisposeImage((GpImage*)bmp); + IStream_Release(stream); } START_TEST(image) @@ -1117,9 +1650,15 @@ test_testcontrol(); test_fromhicon(); test_getrawformat(); + test_loadwmf(); + test_createfromwmf(); + test_resolution(); test_createhbitmap(); test_getsetpixel(); test_palette(); + test_colormatrix(); + test_gamma(); + test_multiframegif(); GdiplusShutdown(gdiplusToken); } Modified: trunk/rostests/winetests/gdiplus/stringformat.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/gdiplus/stringf…
============================================================================== --- trunk/rostests/winetests/gdiplus/stringformat.c [iso-8859-1] (original) +++ trunk/rostests/winetests/gdiplus/stringformat.c [iso-8859-1] Thu Mar 4 14:32:28 2010 @@ -29,7 +29,7 @@ { GpStringFormat *format; GpStatus stat; - INT n; + INT n, count; StringAlignment align, valign; StringTrimming trimming; StringDigitSubstitute digitsub; @@ -43,6 +43,7 @@ GdipGetStringFormatHotkeyPrefix(format, &n); GdipGetStringFormatTrimming(format, &trimming); GdipGetStringFormatDigitSubstitution(format, &digitlang, &digitsub); + GdipGetStringFormatMeasurableCharacterRangeCount(format, &count); expect(HotkeyPrefixNone, n); expect(StringAlignmentNear, align); @@ -50,6 +51,7 @@ expect(StringTrimmingCharacter, trimming); expect(StringDigitSubstituteUser, digitsub); expect(LANG_NEUTRAL, digitlang); + expect(0, count); stat = GdipDeleteStringFormat(format); expect(Ok, stat); @@ -64,14 +66,19 @@ stat = GdipCreateStringFormat(0, LANG_NEUTRAL, &format); expect(Ok, stat); -todo_wine -{ + stat = GdipSetStringFormatMeasurableCharacterRanges(NULL, 3, ranges); + expect(InvalidParameter, stat); + stat = GdipSetStringFormatMeasurableCharacterRanges(format, 0, ranges); + expect(Ok, stat); + stat = GdipSetStringFormatMeasurableCharacterRanges(format, 3, NULL); + expect(InvalidParameter, stat); + stat = GdipSetStringFormatMeasurableCharacterRanges(format, 3, ranges); expect(Ok, stat); stat = GdipGetStringFormatMeasurableCharacterRangeCount(format, &count); expect(Ok, stat); if (stat == Ok) expect(3, count); -} + stat= GdipDeleteStringFormat(format); expect(Ok, stat); }
14 years, 9 months
1
0
0
0
[cwittich] 45829: [MSVCRT_WINETEST] sync msvcrt_winetest to wine 1.1.39
by cwittich@svn.reactos.org
Author: cwittich Date: Thu Mar 4 14:28:33 2010 New Revision: 45829 URL:
http://svn.reactos.org/svn/reactos?rev=45829&view=rev
Log: [MSVCRT_WINETEST] sync msvcrt_winetest to wine 1.1.39 Modified: trunk/rostests/winetests/msvcrt/file.c Modified: trunk/rostests/winetests/msvcrt/file.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/msvcrt/file.c?r…
============================================================================== --- trunk/rostests/winetests/msvcrt/file.c [iso-8859-1] (original) +++ trunk/rostests/winetests/msvcrt/file.c [iso-8859-1] Thu Mar 4 14:28:33 2010 @@ -893,7 +893,7 @@ /* test _read in buffered mode. Last CR should be skipped but LF not pulled in */ tempfd = _open(tempf,_O_RDONLY|_O_TEXT); /* open in TEXT mode */ i = _read(tempfd,btext, strlen(mytext)); - ok(i == strlen(mytext)-1, "_read_i %d vs %d\n", i, strlen(mytext)); + ok(i == strlen(mytext)-1, "_read_i %d\n", i); _close(tempfd); ret =_chmod (tempf, _S_IREAD | _S_IWRITE);
14 years, 9 months
1
0
0
0
[cwittich] 45828: [BROWSEUI_WINETEST] sync browseui_winetest to wine 1.1.39
by cwittich@svn.reactos.org
Author: cwittich Date: Thu Mar 4 13:52:23 2010 New Revision: 45828 URL:
http://svn.reactos.org/svn/reactos?rev=45828&view=rev
Log: [BROWSEUI_WINETEST] sync browseui_winetest to wine 1.1.39 Modified: trunk/rostests/winetests/browseui/autocomplete.c Modified: trunk/rostests/winetests/browseui/autocomplete.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/browseui/autoco…
============================================================================== --- trunk/rostests/winetests/browseui/autocomplete.c [iso-8859-1] (original) +++ trunk/rostests/winetests/browseui/autocomplete.c [iso-8859-1] Thu Mar 4 13:52:23 2010 @@ -219,6 +219,7 @@ ole_ok(obj->lpVtbl->Next(obj, 1, &wstr, &i)); \ ok(i == 1, "Expected i == 1, got %d\n", i); \ ok(str[0] == wstr[0], "String mismatch\n"); \ + CoTaskMemFree(wstr); \ } #define expect_end(obj) \ @@ -280,9 +281,13 @@ ole_ok(obj->lpVtbl->Next(obj, 15, wstrtab, &i)); ok(i == 1, "Expected i == 1, got %d\n", i); + CoTaskMemFree(wstrtab[0]); ole_ok(obj->lpVtbl->Next(obj, 15, wstrtab, &i)); + CoTaskMemFree(wstrtab[0]); ole_ok(obj->lpVtbl->Next(obj, 15, wstrtab, &i)); + CoTaskMemFree(wstrtab[0]); ole_ok(obj->lpVtbl->Next(obj, 15, wstrtab, &i)); + CoTaskMemFree(wstrtab[0]); ole_ok(acl->lpVtbl->Expand(acl, exp)); ok(acl1->expcount == 2, "expcount - expected 1, got %d\n", acl1->expcount); ok(acl2->expcount == 0 /* XP */ || acl2->expcount == 2 /* Vista */, @@ -316,6 +321,9 @@ ok(mgr->lpVtbl->Release(mgr) == 0, "Unexpected references\n"); ok(acl1->ref == 1, "acl1 not released\n"); ok(acl2->ref == 1, "acl2 not released\n"); + + CoTaskMemFree(acl1); + CoTaskMemFree(acl2); } START_TEST(autocomplete)
14 years, 9 months
1
0
0
0
← Newer
1
...
77
78
79
80
81
82
83
...
90
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
Results per page:
10
25
50
100
200