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
December 2008
----- 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
31 participants
710 discussions
Start a n
N
ew thread
[janderwald] 38444: - Add IIrpTarget, IKsWorkSink, IKsShellTransport, IIrpStream, IIrpStreamVirtual IIrpStreamPhysical, IPortFilterWaveCyclic, IPortPinWaveCyclic
by janderwald@svn.reactos.org
Author: janderwald Date: Mon Dec 29 02:55:12 2008 New Revision: 38444 URL:
http://svn.reactos.org/svn/reactos?rev=38444&view=rev
Log: - Add IIrpTarget, IKsWorkSink, IKsShellTransport, IIrpStream, IIrpStreamVirtual IIrpStreamPhysical, IPortFilterWaveCyclic, IPortPinWaveCyclic Modified: trunk/reactos/drivers/wdm/audio/backpln/portcls/interfaces.h Modified: trunk/reactos/drivers/wdm/audio/backpln/portcls/interfaces.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/backpln/…
============================================================================== --- trunk/reactos/drivers/wdm/audio/backpln/portcls/interfaces.h [iso-8859-1] (original) +++ trunk/reactos/drivers/wdm/audio/backpln/portcls/interfaces.h [iso-8859-1] Mon Dec 29 02:55:12 2008 @@ -5,13 +5,99 @@ DEFINE_GUID(IID_ISubdevice, 0xB4C90A61, 0x5791, 0x11D0, 0x86, 0xF9, 0x00, 0xA0, 0xC9, 0x11, 0xB5, 0x44); DEFINE_GUID(IID_IIrpTargetFactory, 0xB4C90A62, 0x5791, 0x11D0, 0x86, 0xF9, 0x00, 0xA0, 0xC9, 0x11, 0xB5, 0x44); + +/***************************************************************************** + * IIrpTarget + ***************************************************************************** + */ + +#define DEFINE_ABSTRACT_IRPTARGET() \ + STDMETHOD_(NTSTATUS, NewIrpTarget)(THIS_ \ + OUT struct IIrpTarget **OutTarget, \ + IN WCHAR * Name, \ + IN PUNKNOWN Unknown, \ + IN POOL_TYPE PoolType, \ + IN PDEVICE_OBJECT * DeviceObject, \ + IN PIRP Irp, \ + IN KSOBJECT_CREATE *CreateObject) PURE; \ + \ + STDMETHOD_(NTSTATUS, DeviceIoControl)(THIS_ \ + IN PDEVICE_OBJECT DeviceObject, \ + IN PIRP Irp)PURE; \ + \ + STDMETHOD_(NTSTATUS, Read)(THIS_ \ + IN PDEVICE_OBJECT DeviceObject, \ + IN PIRP Irp)PURE; \ + \ + STDMETHOD_(NTSTATUS, Write)(THIS_ \ + IN PDEVICE_OBJECT DeviceObject, \ + IN PIRP Irp)PURE; \ + \ + STDMETHOD_(NTSTATUS, Flush)(THIS_ \ + IN PDEVICE_OBJECT DeviceObject, \ + IN PIRP Irp)PURE; \ + \ + STDMETHOD_(NTSTATUS, Close)(THIS_ \ + IN PDEVICE_OBJECT DeviceObject, \ + IN PIRP Irp)PURE; \ + \ + STDMETHOD_(NTSTATUS, QuerySecurity)(THIS_ \ + IN PDEVICE_OBJECT DeviceObject, \ + IN PIRP Irp)PURE; \ + \ + STDMETHOD_(NTSTATUS, SetSecurity)(THIS_ \ + IN PDEVICE_OBJECT DeviceObject, \ + IN PIRP Irp)PURE; \ + \ + STDMETHOD_(NTSTATUS, FastDeviceIoControl)(THIS_ \ + IN PFILE_OBJECT FileObject, \ + IN BOOLEAN Wait, \ + IN PVOID InputBuffer, \ + IN ULONG InputBufferLength, \ + OUT PVOID OutputBuffer, \ + IN ULONG OutputBufferLength, \ + IN ULONG IoControlCode, \ + OUT PIO_STATUS_BLOCK StatusBlock, \ + IN PDEVICE_OBJECT DeviceObject)PURE; \ + \ + STDMETHOD_(NTSTATUS, FastRead)(THIS_ \ + IN PFILE_OBJECT FileObject, \ + IN PLARGE_INTEGER FileOffset, \ + IN ULONG Length, \ + IN BOOLEAN Wait, \ + IN ULONG LockKey, \ + IN PVOID Buffer, \ + OUT PIO_STATUS_BLOCK StatusBlock, \ + IN PDEVICE_OBJECT DeviceObject)PURE; \ + \ + STDMETHOD_(NTSTATUS, FastWrite)(THIS_ \ + IN PFILE_OBJECT FileObject, \ + IN PLARGE_INTEGER FileOffset, \ + IN ULONG Length, \ + IN BOOLEAN Wait, \ + IN ULONG LockKey, \ + IN PVOID Buffer, \ + OUT PIO_STATUS_BLOCK StatusBlock, \ + IN PDEVICE_OBJECT DeviceObject)PURE; + +#undef INTERFACE +#define INTERFACE IIrpTarget + +DECLARE_INTERFACE_(IIrpTarget, IUnknown) +{ + DEFINE_ABSTRACT_UNKNOWN() + + DEFINE_ABSTRACT_IRPTARGET() +}; + /***************************************************************************** * ISubdevice ***************************************************************************** */ + +struct IIrpTargetFactory; struct SUBDEVICE_DESCRIPTOR; -struct IIrpTarget; -struct IIrpTargetFactory; + #undef INTERFACE #define INTERFACE ISubdevice @@ -26,7 +112,7 @@ STDMETHOD_(ULONG,Release)(THIS) PURE; STDMETHOD_(NTSTATUS, NewIrpTarget)(THIS_ - OUT struct IIrpTarget **OutTarget, + OUT IIrpTarget **OutTarget, IN WCHAR * Name, IN PUNKNOWN Unknown, IN POOL_TYPE PoolType, @@ -58,9 +144,246 @@ IN OUT PULONG GlobalCurrent, IN OUT PULONG GlobalPossible)PURE; - -}; -#undef INTERFACE - +}; + +/***************************************************************************** + * IKsWorkSink + ***************************************************************************** + */ +#undef INTERFACE +#define INTERFACE IKsWorkSink + +DECLARE_INTERFACE_(IKsWorkSink, IUnknown) +{ + DEFINE_ABSTRACT_UNKNOWN() + + STDMETHOD_(NTSTATUS, Work)(THIS); +}; + +/***************************************************************************** + * IIrpStreamNotify + ***************************************************************************** + */ +#undef INTERFACE +#define INTERFACE IIrpStreamNotify + +struct IRPSTREAMPOSITION; + +DECLARE_INTERFACE_(IIrpStreamNotify, IUnknown) +{ + DEFINE_ABSTRACT_UNKNOWN() + + STDMETHOD_(NTSTATUS, IrpSubmitted)(THIS_ + IN PIRP Irp, + IN BOOLEAN WAIT)PURE; + + STDMETHOD_(NTSTATUS, GetPosition)(THIS_ + OUT struct IRPSTREAMPOSITION * Position)PURE; +}; + +/***************************************************************************** + * IKsShellTransport + ***************************************************************************** + */ + +#undef INTERFACE +#define INTERFACE IKsShellTransport + +#define DEFINE_ABSTRACT_IKSSHELLTRANSPORT() \ + STDMETHOD_(NTSTATUS, TransferKsIrp)(THIS_ \ + IN PIRP Irp, \ + OUT IKsShellTransport ** Transport) PURE; \ + \ + STDMETHOD_(NTSTATUS, Connect)(THIS_ \ + IN IKsShellTransport * StartTransport, \ + OUT IKsShellTransport ** EndTransport, \ + IN KSPIN_DATAFLOW DataFlow)PURE; \ + \ + STDMETHOD_(NTSTATUS, SetDeviceState)(THIS_ \ + IN KSSTATE State1, \ + IN KSSTATE State2, \ + OUT IKsShellTransport ** EndTransport)PURE; \ + \ + STDMETHOD_(NTSTATUS, SetResetState)(THIS_ \ + IN KSRESET State1, \ + OUT IKsShellTransport ** EndTransport)PURE; + + +DECLARE_INTERFACE_(IKsShellTransport, IUnknown) +{ + DEFINE_ABSTRACT_UNKNOWN() + + DEFINE_ABSTRACT_IKSSHELLTRANSPORT() +}; + +/***************************************************************************** + * IIrpStream + ***************************************************************************** + */ +struct IRPSTREAM_POSITION; +struct IRPSTREAMPACKETINFO; + +#define DEFINE_ABSTRACT_IRPSTREAM() \ + STDMETHOD_(NTSTATUS, TransferKsIrp)(THIS_ \ + IN PIRP Irp, \ + OUT IKsShellTransport ** Transport) PURE; \ + \ + STDMETHOD_(NTSTATUS, Connect)(THIS_ \ + IN IKsShellTransport * StartTransport, \ + OUT IKsShellTransport ** EndTransport, \ + IN KSPIN_DATAFLOW DataFlow)PURE; \ + \ + STDMETHOD_(NTSTATUS, SetDeviceState)(THIS_ \ + IN KSSTATE State1, \ + IN KSSTATE State2, \ + OUT IKsShellTransport ** EndTransport)PURE; \ + \ + STDMETHOD_(NTSTATUS, SetResetState)(THIS_ \ + IN KSRESET State1, \ + OUT IKsShellTransport ** EndTransport)PURE; \ + \ + STDMETHOD_(NTSTATUS, GetPosition)(THIS_ \ + IN OUT struct IRPSTREAM_POSITION * Position) PURE; \ + \ + STDMETHOD_(NTSTATUS, Init)(THIS_ \ + IN BOOLEAN Wait, \ + KSPIN_CONNECT *ConnectDetails, \ + PDEVICE_OBJECT DeviceObject, \ + PDMA_ADAPTER DmaAdapter) PURE; \ + \ + STDMETHOD_(NTSTATUS, CancelAllIrps)(THIS_ \ + ULONG Wait)PURE; \ + \ + STDMETHOD_(VOID, TerminatePacket)(THIS); \ + \ + STDMETHOD_(NTSTATUS, ChangeOptionsFlag)(THIS_ \ + ULONG Unknown1, \ + ULONG Unknown2, \ + ULONG Unknown3, \ + ULONG Unknown4)PURE; \ + \ + STDMETHOD_(NTSTATUS, GetPacketInfo)(THIS_ \ + struct IRPSTREAMPACKETINFO * Info1, \ + struct IRPSTREAMPACKETINFO * Info2)PURE; \ + \ + STDMETHOD_(NTSTATUS, SetPacketOffsets)(THIS_ \ + ULONG Unknown1, \ + ULONG Unknown2)PURE; \ + \ + STDMETHOD_(NTSTATUS, RegisterNotifySink)(THIS_ \ + IN IIrpStreamNotify * NotifyStream)PURE; + + + +#undef INTERFACE +#define INTERFACE IIrpStream + +DECLARE_INTERFACE_(IIrpStream, IUnknown) +{ + DEFINE_ABSTRACT_UNKNOWN() + + DEFINE_ABSTRACT_IRPSTREAM() +}; + + +/***************************************************************************** + * IIrpStreamPhysical + ***************************************************************************** + */ +#undef INTERFACE +#define INTERFACE IIrpStreamPhysical + +DECLARE_INTERFACE_(IIrpStreamPhysical, IIrpStream) +{ + DEFINE_ABSTRACT_UNKNOWN() + + DEFINE_ABSTRACT_IRPSTREAM() + + STDMETHOD_(NTSTATUS, GetMapping)(THIS_ + IN PVOID Tag, + OUT PPHYSICAL_ADDRESS PhysicalAddress, + OUT PVOID * VirtualAddress, + OUT PULONG ByteCount, + OUT PULONG Flags)PURE; + +}; + +/***************************************************************************** + * IIrpStreamVirtual + ***************************************************************************** + */ +#undef INTERFACE +#define INTERFACE IIrpStreamVirtual + +DECLARE_INTERFACE_(IIrpStreamVirtual, IIrpStream) +{ + DEFINE_ABSTRACT_UNKNOWN() + + DEFINE_ABSTRACT_IRPSTREAM() + + STDMETHOD_(NTSTATUS, GetLockedRegion)(THIS_ + OUT PULONG OutSize, + OUT PVOID * OutBuffer)PURE; + + STDMETHOD_(NTSTATUS, Copy)(THIS_ + IN BOOLEAN Wait, + OUT ULONG Size, + IN PULONG Buffer, + OUT PVOID Result)PURE; + + STDMETHOD_(NTSTATUS, Complete)(THIS_ + IN ULONG Unknown1, + IN PULONG Data)PURE; + + STDMETHOD_(ULONG, GetIrpStreamPositionLock)(THIS); +}; + + +/***************************************************************************** + * IPortFilterWaveCyclic + ***************************************************************************** + */ + +#undef INTERFACE +#define INTERFACE IPortFilterWaveCyclic + +DECLARE_INTERFACE_(IPortFilterWaveCyclic, IIrpTarget) +{ + DEFINE_ABSTRACT_UNKNOWN() + + DEFINE_ABSTRACT_IRPTARGET() + + STDMETHOD_(NTSTATUS, Init)(THIS_ + IN PPORTWAVECYCLIC Port)PURE; +}; + +typedef IPortFilterWaveCyclic *PPORTFILTERWAVECYCLIC; + +/***************************************************************************** + * IPortPinWaveCyclic + ***************************************************************************** + */ + +#undef INTERFACE +#define INTERFACE IPortPinWaveCyclic + +DECLARE_INTERFACE_(IPortPinWaveCyclic, IIrpTarget) +{ + DEFINE_ABSTRACT_UNKNOWN() + + DEFINE_ABSTRACT_IRPTARGET() + + STDMETHOD_(NTSTATUS, Init)(THIS_ + IN PPORTWAVECYCLIC Port, + IN PPORTFILTERWAVECYCLIC Filter, + IN KSPIN_CONNECT * ConnectDetails, + IN KSPIN_DESCRIPTOR * PinDescriptor) PURE; + + STDMETHOD_(ULONG, GetCompletedPosition)(THIS); + STDMETHOD_(ULONG, GetCycleCount)(THIS); + STDMETHOD_(ULONG, GetDeviceBufferSize)(THIS); + STDMETHOD_(PVOID, GetIrpStream)(THIS); + STDMETHOD_(PMINIPORT, GetMiniport)(THIS); +}; #endif
15 years, 12 months
1
0
0
0
[cwittich] 38443: sync urlmon winetest to wine 1.1.11
by cwittich@svn.reactos.org
Author: cwittich Date: Mon Dec 29 02:42:01 2008 New Revision: 38443 URL:
http://svn.reactos.org/svn/reactos?rev=38443&view=rev
Log: sync urlmon winetest to wine 1.1.11 Modified: trunk/rostests/winetests/urlmon/protocol.c trunk/rostests/winetests/urlmon/testlist.c trunk/rostests/winetests/urlmon/url.c Modified: trunk/rostests/winetests/urlmon/protocol.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/urlmon/protocol…
============================================================================== --- trunk/rostests/winetests/urlmon/protocol.c [iso-8859-1] (original) +++ trunk/rostests/winetests/urlmon/protocol.c [iso-8859-1] Mon Dec 29 02:42:01 2008 @@ -350,7 +350,8 @@ CHECK_CALLED(ReportProgress_CONNECTING); } else todo_wine { CHECK_NOT_CALLED(ReportProgress_FINDINGRESOURCE); - CHECK_NOT_CALLED(ReportProgress_CONNECTING); + /* IE7 does call this */ + CLEAR_CALLED(ReportProgress_CONNECTING); } CHECK_CALLED(ReportProgress_SENDINGREQUEST); SET_EXPECT(OnResponse); @@ -754,6 +755,12 @@ return S_OK; } + if(IsEqualGUID(&IID_IInternetProtocolEx, riid)) { + trace("IID_IInternetProtocolEx not supported\n"); + *ppv = NULL; + return E_NOINTERFACE; + } + if(IsEqualGUID(&IID_IInternetPriority, riid)) { *ppv = &InternetPriority; return S_OK; @@ -871,6 +878,7 @@ LPWSTR additional_headers = NULL; BYTE sec_id[100]; DWORD fetched = 0, size = 100; + DWORD tid; SET_EXPECT(GetBindString_USER_AGENT); hres = IInternetBindInfo_GetBindString(pOIBindInfo, BINDSTRING_USER_AGENT, @@ -927,7 +935,7 @@ IServiceProvider_Release(service_provider); - CreateThread(NULL, 0, thread_proc, NULL, 0, NULL); + CreateThread(NULL, 0, thread_proc, NULL, 0, &tid); return S_OK; } @@ -1192,7 +1200,7 @@ IInternetPriority_Release(priority); } -static void file_protocol_start(IInternetProtocol *protocol, LPCWSTR url, BOOL is_first) +static BOOL file_protocol_start(IInternetProtocol *protocol, LPCWSTR url, BOOL is_first) { HRESULT hres; @@ -1214,6 +1222,10 @@ expect_hrResult = S_OK; hres = IInternetProtocol_Start(protocol, url, &protocol_sink, &bind_info, 0, 0); + if(hres == INET_E_RESOURCE_NOT_FOUND) { + win_skip("Start failed\n"); + return FALSE; + } ok(hres == S_OK, "Start failed: %08x\n", hres); CHECK_CALLED(GetBindInfo); @@ -1230,6 +1242,8 @@ CHECK_CALLED(ReportData); if(is_first) CHECK_CALLED(ReportResult); + + return TRUE; } static void test_file_protocol_url(LPCWSTR url) @@ -1242,7 +1256,7 @@ hres = CoGetClassObject(&CLSID_FileProtocol, CLSCTX_INPROC_SERVER, NULL, &IID_IUnknown, (void**)&unk); ok(hres == S_OK, "CoGetClassObject failed: %08x\n", hres); - if(!SUCCEEDED(hres)) + if(FAILED(hres)) return; hres = IUnknown_QueryInterface(unk, &IID_IInternetProtocolInfo, (void**)&protocol_info); @@ -1259,25 +1273,27 @@ ok(hres == S_OK, "Could not get IInternetProtocol: %08x\n", hres); if(SUCCEEDED(hres)) { - file_protocol_start(protocol, url, TRUE); - hres = IInternetProtocol_Read(protocol, buf, 2, &cb); - ok(hres == S_OK, "Read failed: %08x\n", hres); - ok(cb == 2, "cb=%u expected 2\n", cb); - hres = IInternetProtocol_Read(protocol, buf, sizeof(buf), &cb); - ok(hres == S_FALSE, "Read failed: %08x\n", hres); - hres = IInternetProtocol_Read(protocol, buf, sizeof(buf), &cb); - ok(hres == S_FALSE, "Read failed: %08x expected S_FALSE\n", hres); - ok(cb == 0, "cb=%u expected 0\n", cb); - hres = IInternetProtocol_UnlockRequest(protocol); - ok(hres == S_OK, "UnlockRequest failed: %08x\n", hres); - - file_protocol_start(protocol, url, FALSE); - hres = IInternetProtocol_Read(protocol, buf, 2, &cb); - ok(hres == S_FALSE, "Read failed: %08x\n", hres); - hres = IInternetProtocol_LockRequest(protocol, 0); - ok(hres == S_OK, "LockRequest failed: %08x\n", hres); - hres = IInternetProtocol_UnlockRequest(protocol); - ok(hres == S_OK, "UnlockRequest failed: %08x\n", hres); + if(file_protocol_start(protocol, url, TRUE)) { + hres = IInternetProtocol_Read(protocol, buf, 2, &cb); + ok(hres == S_OK, "Read failed: %08x\n", hres); + ok(cb == 2, "cb=%u expected 2\n", cb); + hres = IInternetProtocol_Read(protocol, buf, sizeof(buf), &cb); + ok(hres == S_FALSE, "Read failed: %08x\n", hres); + hres = IInternetProtocol_Read(protocol, buf, sizeof(buf), &cb); + ok(hres == S_FALSE, "Read failed: %08x expected S_FALSE\n", hres); + ok(cb == 0, "cb=%u expected 0\n", cb); + hres = IInternetProtocol_UnlockRequest(protocol); + ok(hres == S_OK, "UnlockRequest failed: %08x\n", hres); + } + + if(file_protocol_start(protocol, url, FALSE)) { + hres = IInternetProtocol_Read(protocol, buf, 2, &cb); + ok(hres == S_FALSE, "Read failed: %08x\n", hres); + hres = IInternetProtocol_LockRequest(protocol, 0); + ok(hres == S_OK, "LockRequest failed: %08x\n", hres); + hres = IInternetProtocol_UnlockRequest(protocol); + ok(hres == S_OK, "UnlockRequest failed: %08x\n", hres); + } IInternetProtocol_Release(protocol); } @@ -1286,19 +1302,20 @@ ok(hres == S_OK, "Could not get IInternetProtocol: %08x\n", hres); if(SUCCEEDED(hres)) { - file_protocol_start(protocol, url, TRUE); - hres = IInternetProtocol_LockRequest(protocol, 0); - ok(hres == S_OK, "LockRequest failed: %08x\n", hres); - hres = IInternetProtocol_Terminate(protocol, 0); - ok(hres == S_OK, "Terminate failed: %08x\n", hres); - hres = IInternetProtocol_Read(protocol, buf, 2, &cb); - ok(hres == S_OK, "Read failed: %08x\n\n", hres); - hres = IInternetProtocol_UnlockRequest(protocol); - ok(hres == S_OK, "UnlockRequest failed: %08x\n", hres); - hres = IInternetProtocol_Read(protocol, buf, 2, &cb); - ok(hres == S_OK, "Read failed: %08x\n", hres); - hres = IInternetProtocol_Terminate(protocol, 0); - ok(hres == S_OK, "Terminate failed: %08x\n", hres); + if(file_protocol_start(protocol, url, TRUE)) { + hres = IInternetProtocol_LockRequest(protocol, 0); + ok(hres == S_OK, "LockRequest failed: %08x\n", hres); + hres = IInternetProtocol_Terminate(protocol, 0); + ok(hres == S_OK, "Terminate failed: %08x\n", hres); + hres = IInternetProtocol_Read(protocol, buf, 2, &cb); + ok(hres == S_OK, "Read failed: %08x\n\n", hres); + hres = IInternetProtocol_UnlockRequest(protocol); + ok(hres == S_OK, "UnlockRequest failed: %08x\n", hres); + hres = IInternetProtocol_Read(protocol, buf, 2, &cb); + ok(hres == S_OK, "Read failed: %08x\n", hres); + hres = IInternetProtocol_Terminate(protocol, 0); + ok(hres == S_OK, "Terminate failed: %08x\n", hres); + } IInternetProtocol_Release(protocol); } @@ -1307,12 +1324,13 @@ ok(hres == S_OK, "Could not get IInternetProtocol: %08x\n", hres); if(SUCCEEDED(hres)) { - file_protocol_start(protocol, url, TRUE); - hres = IInternetProtocol_Terminate(protocol, 0); - ok(hres == S_OK, "Terminate failed: %08x\n", hres); - hres = IInternetProtocol_Read(protocol, buf, 2, &cb); - ok(hres == S_OK, "Read failed: %08x\n", hres); - ok(cb == 2, "cb=%u expected 2\n", cb); + if(file_protocol_start(protocol, url, TRUE)) { + hres = IInternetProtocol_Terminate(protocol, 0); + ok(hres == S_OK, "Terminate failed: %08x\n", hres); + hres = IInternetProtocol_Read(protocol, buf, 2, &cb); + ok(hres == S_OK, "Read failed: %08x\n", hres); + ok(cb == 2, "cb=%u expected 2\n", cb); + } IInternetProtocol_Release(protocol); } @@ -1411,8 +1429,14 @@ trace("Testing file protocol...\n"); tested_protocol = FILE_TEST; + SetLastError(0xdeadbeef); file = CreateFileW(wszIndexHtml, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); + if(!file && GetLastError() == ERROR_CALL_NOT_IMPLEMENTED) + { + win_skip("Detected Win9x or WinMe\n"); + return; + } ok(file != INVALID_HANDLE_VALUE, "CreateFile failed\n"); if(file == INVALID_HANDLE_VALUE) return; @@ -1535,7 +1559,7 @@ hres = CoGetClassObject(&CLSID_HttpProtocol, CLSCTX_INPROC_SERVER, NULL, &IID_IUnknown, (void**)&unk); ok(hres == S_OK, "CoGetClassObject failed: %08x\n", hres); - if(!SUCCEEDED(hres)) + if(FAILED(hres)) return; hres = IUnknown_QueryInterface(unk, &IID_IInternetProtocolInfo, (void**)&protocol_info); @@ -1555,7 +1579,6 @@ if(SUCCEEDED(hres)) { BYTE buf[3600]; DWORD cb; - int *called = (bindf & BINDF_FROMURLMON) ? &called_Switch : &called_ReportData; test_priority(http_protocol); @@ -1577,8 +1600,8 @@ expect_hrResult = S_OK; hres = IInternetProtocol_Read(http_protocol, buf, 1, &cb); - ok((!*called && hres == E_PENDING && cb==0) || - (*called && hres == S_OK && cb==1), "Read failed: %08x (%d bytes)\n", hres, cb); + ok((hres == E_PENDING && cb==0) || + (hres == S_OK && cb==1), "Read failed: %08x (%d bytes)\n", hres, cb); WaitForSingleObject(event_complete, INFINITE); if(bindf & BINDF_FROMURLMON) @@ -1594,8 +1617,8 @@ hres = IInternetProtocol_Read(http_protocol, buf, sizeof(buf), &cb); if(hres == E_PENDING) { hres = IInternetProtocol_Read(http_protocol, buf, 1, &cb); - ok((!*called && hres == E_PENDING && cb==0) || - (*called && hres == S_OK && cb==1), "Read failed: %08x (%d bytes)\n", hres, cb); + ok((hres == E_PENDING && cb==0) || + (hres == S_OK && cb==1), "Read failed: %08x (%d bytes)\n", hres, cb); WaitForSingleObject(event_complete, INFINITE); if(bindf & BINDF_FROMURLMON) CHECK_CALLED(Switch); Modified: trunk/rostests/winetests/urlmon/testlist.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/urlmon/testlist…
============================================================================== --- trunk/rostests/winetests/urlmon/testlist.c [iso-8859-1] (original) +++ trunk/rostests/winetests/urlmon/testlist.c [iso-8859-1] Mon Dec 29 02:42:01 2008 @@ -6,8 +6,18 @@ #define STANDALONE #include "wine/test.h" +extern void func_generated(void); +extern void func_misc(void); +extern void func_protocol(void); +extern void func_stream(void); +extern void func_url(void); const struct test winetest_testlist[] = { + { "generated", func_generated }, + { "misc", func_misc }, + { "protocol", func_protocol }, + { "stream", func_stream }, + { "url", func_url }, { 0, 0 } }; Modified: trunk/rostests/winetests/urlmon/url.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/urlmon/url.c?re…
============================================================================== --- trunk/rostests/winetests/urlmon/url.c [iso-8859-1] (original) +++ trunk/rostests/winetests/urlmon/url.c [iso-8859-1] Mon Dec 29 02:42:01 2008 @@ -147,8 +147,10 @@ {'w','w','w','.','w','i','n','e','h','q','.','o','r','g',0}; static const WCHAR wszWineHQIP[] = {'2','0','9','.','3','2','.','1','4','1','.','3',0}; +static const CHAR wszIndexHtmlA[] = "index.html"; static const WCHAR wszIndexHtml[] = {'i','n','d','e','x','.','h','t','m','l',0}; static const WCHAR cache_fileW[] = {'c',':','\\','c','a','c','h','e','.','h','t','m',0}; +static const CHAR dwl_htmlA[] = "dwl.html"; static const WCHAR dwl_htmlW[] = {'d','w','l','.','h','t','m','l',0}; static const WCHAR emptyW[] = {0}; @@ -159,6 +161,7 @@ static IInternetProtocolSink *protocol_sink = NULL; static HANDLE complete_event, complete_event2; static HRESULT binding_hres; +static BOOL have_IHttpNegotiate2; static LPCWSTR urls[] = { WINE_ABOUT_URL, @@ -1824,6 +1827,7 @@ hres = IBindStatusCallback_QueryInterface(holder, &IID_IHttpNegotiate2, (void**)&http_negotiate2); if(SUCCEEDED(hres)) { + have_IHttpNegotiate2 = TRUE; hres = IHttpNegotiate2_GetRootSecurityId(http_negotiate2, (void*)0xdeadbeef, (void*)0xdeadbeef, 0); ok(hres == E_FAIL, "GetRootSecurityId failed: %08x\n", hres); @@ -2113,16 +2117,18 @@ CLEAR_CALLED(QueryService_IInternetBindInfo); CHECK_CALLED(QueryInterface_IHttpNegotiate); CHECK_CALLED(BeginningTransaction); - /* QueryInterface_IHttpNegotiate2 and GetRootSecurityId - * called on WinXP but not on Win98 */ - CLEAR_CALLED(QueryInterface_IHttpNegotiate2); - CLEAR_CALLED(GetRootSecurityId); + if (have_IHttpNegotiate2) + { + CHECK_CALLED(QueryInterface_IHttpNegotiate2); + CHECK_CALLED(GetRootSecurityId); + } if(http_is_first) { CHECK_CALLED(OnProgress_FINDINGRESOURCE); CHECK_CALLED(OnProgress_CONNECTING); }else todo_wine { CHECK_NOT_CALLED(OnProgress_FINDINGRESOURCE); - CHECK_NOT_CALLED(OnProgress_CONNECTING); + /* IE7 does call this */ + CLEAR_CALLED(OnProgress_CONNECTING); } } if(test_protocol == HTTP_TEST || test_protocol == FILE_TEST) @@ -2272,16 +2278,18 @@ if(test_protocol == HTTP_TEST) { CHECK_CALLED(QueryInterface_IHttpNegotiate); CHECK_CALLED(BeginningTransaction); - /* QueryInterface_IHttpNegotiate2 and GetRootSecurityId - * called on WinXP but not on Win98 */ - CLEAR_CALLED(QueryInterface_IHttpNegotiate2); - CLEAR_CALLED(GetRootSecurityId); + if (have_IHttpNegotiate2) + { + CHECK_CALLED(QueryInterface_IHttpNegotiate2); + CHECK_CALLED(GetRootSecurityId); + } if(http_is_first) { CHECK_CALLED(Obj_OnProgress_FINDINGRESOURCE); CHECK_CALLED(Obj_OnProgress_CONNECTING); }else todo_wine { CHECK_NOT_CALLED(Obj_OnProgress_FINDINGRESOURCE); - CHECK_NOT_CALLED(Obj_OnProgress_CONNECTING); + /* IE7 does call this */ + CLEAR_CALLED(Obj_OnProgress_CONNECTING); } } if(test_protocol == HTTP_TEST || test_protocol == FILE_TEST) { @@ -2313,7 +2321,7 @@ todo_wine ok(IMoniker_Release(mon) == 0, "mon should be destroyed here\n"); if(bindf & BINDF_ASYNCHRONOUS) - ok(IBindCtx_Release(bctx) != 0, "bctx should not be destroyed here\n"); + IBindCtx_Release(bctx); else todo_wine ok(IBindCtx_Release(bctx) == 0, "bctx should be destroyed here\n"); } @@ -2380,11 +2388,16 @@ if(test_protocol == HTTP_TEST) { CHECK_CALLED(QueryInterface_IHttpNegotiate); CHECK_CALLED(BeginningTransaction); - CHECK_CALLED(QueryInterface_IHttpNegotiate2); - CHECK_CALLED(GetRootSecurityId); + if (have_IHttpNegotiate2) + { + CHECK_CALLED(QueryInterface_IHttpNegotiate2); + CHECK_CALLED(GetRootSecurityId); + } } - if(test_protocol == HTTP_TEST || test_protocol == FILE_TEST) + if(test_protocol == FILE_TEST) CHECK_CALLED(OnProgress_SENDINGREQUEST); + else if(test_protocol == HTTP_TEST) + CLEAR_CALLED(OnProgress_SENDINGREQUEST); /* not called by IE7 */ if(test_protocol == HTTP_TEST) CHECK_CALLED(OnResponse); CHECK_CALLED(OnProgress_MIMETYPEAVAILABLE); @@ -2397,7 +2410,7 @@ CHECK_CALLED(OnStopBinding); } - res = DeleteFileW(dwl_htmlW); + res = DeleteFileA(dwl_htmlA); ok(res, "DeleteFile failed: %u\n", GetLastError()); if(prot != FILE_TEST || emul) @@ -2406,35 +2419,33 @@ hres = URLDownloadToFileW(NULL, urls[test_protocol], dwl_htmlW, 0, NULL); ok(hres == S_OK, "URLDownloadToFile failed: %08x\n", hres); - res = DeleteFileW(dwl_htmlW); + res = DeleteFileA(dwl_htmlA); ok(res, "DeleteFile failed: %u\n", GetLastError()); } -static void set_file_url(void) -{ - int len; - - static const WCHAR wszFile[] = {'f','i','l','e',':','/','/'}; - - memcpy(file_url, wszFile, sizeof(wszFile)); - len = sizeof(wszFile)/sizeof(WCHAR); - file_url[len++] = '/'; - len += GetCurrentDirectoryW(sizeof(file_url)/sizeof(WCHAR)-len, file_url+len); - file_url[len++] = '\\'; - memcpy(file_url+len, wszIndexHtml, sizeof(wszIndexHtml)); - - memcpy(INDEX_HTML, wszFile, sizeof(wszIndexHtml)); - memmove(INDEX_HTML+7, file_url+8, (lstrlenW(file_url+8)+1)*sizeof(WCHAR)); +static void set_file_url(char *path) +{ + CHAR file_urlA[INTERNET_MAX_URL_LENGTH]; + CHAR INDEX_HTMLA[MAX_PATH]; + + lstrcpyA(file_urlA, "file:///"); + lstrcatA(file_urlA, path); + MultiByteToWideChar(CP_ACP, 0, file_urlA, -1, file_url, INTERNET_MAX_URL_LENGTH); + + lstrcpyA(INDEX_HTMLA, "file://"); + lstrcatA(INDEX_HTMLA, path); + MultiByteToWideChar(CP_ACP, 0, INDEX_HTMLA, -1, INDEX_HTML, MAX_PATH); } static void create_file(void) { HANDLE file; DWORD size; + CHAR path[MAX_PATH]; static const char html_doc[] = "<HTML></HTML>"; - file = CreateFileW(wszIndexHtml, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, + file = CreateFileA(wszIndexHtmlA, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); ok(file != INVALID_HANDLE_VALUE, "CreateFile failed\n"); if(file == INVALID_HANDLE_VALUE) @@ -2443,7 +2454,10 @@ WriteFile(file, html_doc, sizeof(html_doc)-1, &size, NULL); CloseHandle(file); - set_file_url(); + GetCurrentDirectoryA(MAX_PATH, path); + lstrcatA(path, "\\"); + lstrcatA(path, wszIndexHtmlA); + set_file_url(path); } static void test_ReportResult(HRESULT exhres) @@ -2661,7 +2675,7 @@ trace("test failures...\n"); test_BindToStorage_fail(); - DeleteFileW(wszIndexHtml); + DeleteFileA(wszIndexHtmlA); CloseHandle(complete_event); CloseHandle(complete_event2); CoUninitialize();
15 years, 12 months
1
0
0
0
[cwittich] 38442: sync urlmon.idl to wine 1.1.11
by cwittich@svn.reactos.org
Author: cwittich Date: Mon Dec 29 02:35:12 2008 New Revision: 38442 URL:
http://svn.reactos.org/svn/reactos?rev=38442&view=rev
Log: sync urlmon.idl to wine 1.1.11 Modified: trunk/reactos/include/psdk/urlmon.idl 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] Mon Dec 29 02:35:12 2008 @@ -21,6 +21,10 @@ import "oleidl.idl"; import "servprov.idl"; import "msxml.idl"; + +cpp_quote("#ifdef WINE_NO_UNICODE_MACROS") +cpp_quote("#undef GetUserName") +cpp_quote("#endif") interface IInternetProtocolSink; @@ -1363,6 +1367,147 @@ FEATURE_ENTRY_COUNT } INTERNETFEATURELIST; +/***************************************************************************** + * IUri interface + */ +[ + local, + object, + uuid(a39ee748-6a27-4817-a6f2-13914bef5890), + pointer_default(unique) +] +interface IUri : IUnknown +{ + typedef enum + { + Uri_PROPERTY_ABSOLUTE_URI = 0, + Uri_PROPERTY_STRING_START = Uri_PROPERTY_ABSOLUTE_URI, + Uri_PROPERTY_AUTHORITY = 1, + Uri_PROPERTY_DISPLAY_URI = 2, + Uri_PROPERTY_DOMAIN = 3, + Uri_PROPERTY_EXTENSION = 4, + Uri_PROPERTY_FRAGMENT = 5, + Uri_PROPERTY_HOST = 6, + Uri_PROPERTY_PASSWORD = 7, + Uri_PROPERTY_PATH = 8, + Uri_PROPERTY_PATH_AND_QUERY = 9, + Uri_PROPERTY_QUERY = 10, + Uri_PROPERTY_RAW_URI = 11, + Uri_PROPERTY_SCHEME_NAME = 12, + Uri_PROPERTY_USER_INFO = 13, + Uri_PROPERTY_USER_NAME = 14, + Uri_PROPERTY_STRING_LAST = Uri_PROPERTY_USER_NAME, + Uri_PROPERTY_HOST_TYPE = 15, + Uri_PROPERTY_DWORD_START = Uri_PROPERTY_HOST_TYPE, + Uri_PROPERTY_PORT = 16, + Uri_PROPERTY_SCHEME = 17, + Uri_PROPERTY_ZONE = 18, + Uri_PROPERTY_DWORD_LAST = Uri_PROPERTY_ZONE + } Uri_PROPERTY; + + HRESULT GetPropertyBSTR( + [in] Uri_PROPERTY uriProp, + [out] BSTR *pbstrProperty, + [in] DWORD dwFlags); + + HRESULT GetPropertyLength( + [in] Uri_PROPERTY uriProp, + [out] DWORD *pcchProperty, + [in] DWORD dwFlags); + + HRESULT GetPropertyDWORD( + [in] Uri_PROPERTY uriProp, + [out] DWORD *pdwProperty, + [in] DWORD dwFlags); + + HRESULT HasProperty( + [in] Uri_PROPERTY uriProp, + [out] BOOL *pfHasProperty); + + HRESULT GetAbsoluteUri( + [out] BSTR *pbstrAbsoluteUri); + + HRESULT GetAuthority( + [out] BSTR *pbstrAuthority); + + HRESULT GetDisplayUri( + [out] BSTR *pbstrDisplayString); + + HRESULT GetDomain( + [out] BSTR *pbstrDomain); + + HRESULT GetExtension( + [out] BSTR *pbstrExtension); + + HRESULT GetFragment( + [out] BSTR *pbstrFragment); + + HRESULT GetHost( + [out] BSTR *pbstrHost); + + HRESULT GetPassword( + [out] BSTR *pbstrPassword); + + HRESULT GetPath( + [out] BSTR *pbstrPath); + + HRESULT GetPathAndQuery( + [out] BSTR *pbstrPathAndQuery); + + HRESULT GetQuery( + [out] BSTR *pbstrQuery); + + HRESULT GetRawUri( + [out] BSTR *pbstrRawUri); + + HRESULT GetSchemeName( + [out] BSTR *pbstrSchemeName); + + HRESULT GetUserInfo( + [out] BSTR *pbstrUserInfo); + + HRESULT GetUserName( + [out] BSTR *pbstrUserName); + + HRESULT GetHostType( + [out] DWORD *pdwHostType); + + HRESULT GetPort( + [out] DWORD *pdwPort); + + HRESULT GetScheme( + [out] DWORD *pdwScheme); + + HRESULT GetZone( + [out] DWORD *pdwZone); + + HRESULT GetProperties( + [out] LPDWORD pdwFlags); + + HRESULT IsEqual( + [in] IUri *pUri, + [out] BOOL *pfEqual); +} + +/***************************************************************************** + * IInternetProtocolEx interface + */ +[ + local, + object, + uuid(c7a98e66-1010-492c-a1c8-c809e1f75905), + pointer_default(unique) +] +interface IInternetProtocolEx : IInternetProtocol +{ + HRESULT StartEx( + [in] IUri *pUri, + [in] IInternetProtocolSink *pOIProtSink, + [in] IInternetBindInfo *pOIBindInfo, + [in] DWORD grfPI, + [in] HANDLE *dwReserved); +} + cpp_quote("DEFINE_GUID(CLSID_InternetSecurityManager, 0x7b8a2d94, 0x0ac9, 0x11d1, 0x89, 0x6c, 0x00, 0xc0, 0x4f, 0xB6, 0xbf, 0xc4);") cpp_quote("DEFINE_GUID(CLSID_InternetZoneManager, 0x7B8A2D95, 0x0AC9, 0x11D1, 0x89, 0x6C, 0x00, 0xC0, 0x4F, 0xB6, 0xBF, 0xC4);") cpp_quote("DEFINE_GUID(IID_IAsyncMoniker, 0x79EAC9D3, 0xBAF9, 0x11CE, 0x8C, 0x82, 0x00, 0xAA, 0x00, 0x4B, 0xA9, 0x0B);") @@ -1381,32 +1526,32 @@ cpp_quote("#define URLMON_OPTION_USERAGENT_REFRESH 0x10000002") cpp_quote("#define URLMON_OPTION_URL_ENCODING 0x10000004") -cpp_quote("#define MK_S_ASYNCHRONOUS 0x000401E8") +cpp_quote("#define MK_S_ASYNCHRONOUS _HRESULT_TYPEDEF_(0x000401E8)") cpp_quote("#ifndef S_ASYNCHRONOUS") cpp_quote("#define S_ASYNCHRONOUS MK_S_ASYNCHRONOUS") cpp_quote("#endif") -cpp_quote("#define INET_E_ERROR_FIRST 0x800C0002") -cpp_quote("#define INET_E_INVALID_URL 0x800C0002") -cpp_quote("#define INET_E_NO_SESSION 0x800C0003") -cpp_quote("#define INET_E_CANNOT_CONNECT 0x800C0004") -cpp_quote("#define INET_E_RESOURCE_NOT_FOUND 0x800C0005") -cpp_quote("#define INET_E_OBJECT_NOT_FOUND 0x800C0006") -cpp_quote("#define INET_E_DATA_NOT_AVAILABLE 0x800C0007") -cpp_quote("#define INET_E_DOWNLOAD_FAILURE 0x800C0008") -cpp_quote("#define INET_E_AUTHENTICATION_REQUIRED 0x800C0009") -cpp_quote("#define INET_E_NO_VALID_MEDIA 0x800C000A") -cpp_quote("#define INET_E_CONNECTION_TIMEOUT 0x800C000B") -cpp_quote("#define INET_E_INVALID_REQUEST 0x800C000C") -cpp_quote("#define INET_E_UNKNOWN_PROTOCOL 0x800C000D") -cpp_quote("#define INET_E_SECURITY_PROBLEM 0x800C000E") -cpp_quote("#define INET_E_CANNOT_LOAD_DATA 0x800C000F") -cpp_quote("#define INET_E_CANNOT_INSTANTIATE_OBJECT 0x800C0010") -cpp_quote("#define INET_E_USE_DEFAULT_PROTOCOLHANDLER 0x800C0011") -cpp_quote("#define INET_E_QUERYOPTION_UNKNOWN 0x800C0013") -cpp_quote("#define INET_E_REDIRECT_FAILED 0x800C0014") -cpp_quote("#define INET_E_REDIRECT_TO_DIR 0x800C0015") -cpp_quote("#define INET_E_CANNOT_LOCK_REQUEST 0x800C0016") +cpp_quote("#define INET_E_ERROR_FIRST _HRESULT_TYPEDEF_(0x800C0002)") +cpp_quote("#define INET_E_INVALID_URL _HRESULT_TYPEDEF_(0x800C0002)") +cpp_quote("#define INET_E_NO_SESSION _HRESULT_TYPEDEF_(0x800C0003)") +cpp_quote("#define INET_E_CANNOT_CONNECT _HRESULT_TYPEDEF_(0x800C0004)") +cpp_quote("#define INET_E_RESOURCE_NOT_FOUND _HRESULT_TYPEDEF_(0x800C0005)") +cpp_quote("#define INET_E_OBJECT_NOT_FOUND _HRESULT_TYPEDEF_(0x800C0006)") +cpp_quote("#define INET_E_DATA_NOT_AVAILABLE _HRESULT_TYPEDEF_(0x800C0007)") +cpp_quote("#define INET_E_DOWNLOAD_FAILURE _HRESULT_TYPEDEF_(0x800C0008)") +cpp_quote("#define INET_E_AUTHENTICATION_REQUIRED _HRESULT_TYPEDEF_(0x800C0009)") +cpp_quote("#define INET_E_NO_VALID_MEDIA _HRESULT_TYPEDEF_(0x800C000A)") +cpp_quote("#define INET_E_CONNECTION_TIMEOUT _HRESULT_TYPEDEF_(0x800C000B)") +cpp_quote("#define INET_E_INVALID_REQUEST _HRESULT_TYPEDEF_(0x800C000C)") +cpp_quote("#define INET_E_UNKNOWN_PROTOCOL _HRESULT_TYPEDEF_(0x800C000D)") +cpp_quote("#define INET_E_SECURITY_PROBLEM _HRESULT_TYPEDEF_(0x800C000E)") +cpp_quote("#define INET_E_CANNOT_LOAD_DATA _HRESULT_TYPEDEF_(0x800C000F)") +cpp_quote("#define INET_E_CANNOT_INSTANTIATE_OBJECT _HRESULT_TYPEDEF_(0x800C0010)") +cpp_quote("#define INET_E_USE_DEFAULT_PROTOCOLHANDLER _HRESULT_TYPEDEF_(0x800C0011)") +cpp_quote("#define INET_E_QUERYOPTION_UNKNOWN _HRESULT_TYPEDEF_(0x800C0013)") +cpp_quote("#define INET_E_REDIRECT_FAILED _HRESULT_TYPEDEF_(0x800C0014)") +cpp_quote("#define INET_E_REDIRECT_TO_DIR _HRESULT_TYPEDEF_(0x800C0015)") +cpp_quote("#define INET_E_CANNOT_LOCK_REQUEST _HRESULT_TYPEDEF_(0x800C0016)") cpp_quote("#define INET_E_ERROR_LAST INET_E_REDIRECT_TO_DIR") cpp_quote("#define INET_E_DEFAULT_ACTION INET_E_USE_DEFAULT_PROTOCOLHANDLER") @@ -1461,6 +1606,10 @@ cpp_quote("#define OInetCompareUrl CoInternetCompareUrl") cpp_quote("#define OInetGetSession CoInternetGetSession") +cpp_quote("BOOL WINAPI IsLoggingEnabledA(LPCSTR);") +cpp_quote("BOOL WINAPI IsLoggingEnabledW(LPCWSTR);") +cpp_quote("#define IsLoggingEnabled WINELIB_NAME_AW(IsLoggingEnabled)") + cpp_quote("#define MKSYS_URLMONIKER 6") cpp_quote("#define URL_MK_LEGACY 0") cpp_quote("#define URL_MK_UNIFORM 1")
15 years, 12 months
1
0
0
0
[cwittich] 38441: sync riched20 winetest to wine 1.1.11
by cwittich@svn.reactos.org
Author: cwittich Date: Mon Dec 29 02:27:52 2008 New Revision: 38441 URL:
http://svn.reactos.org/svn/reactos?rev=38441&view=rev
Log: sync riched20 winetest to wine 1.1.11 Added: trunk/rostests/winetests/riched20/txtsrv.c (with props) Modified: trunk/rostests/winetests/riched20/editor.c trunk/rostests/winetests/riched20/riched20.rbuild trunk/rostests/winetests/riched20/testlist.c Modified: trunk/rostests/winetests/riched20/editor.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/riched20/editor…
============================================================================== --- trunk/rostests/winetests/riched20/editor.c [iso-8859-1] (original) +++ trunk/rostests/winetests/riched20/editor.c [iso-8859-1] Mon Dec 29 02:27:52 2008 @@ -21,6 +21,7 @@ */ #include <stdarg.h> +#include <stdio.h> #include <assert.h> #include <windef.h> #include <winbase.h> @@ -32,7 +33,18 @@ #include <time.h> #include <wine/test.h> +static CHAR string1[MAX_PATH], string2[MAX_PATH], string3[MAX_PATH]; + +#define ok_w3(format, szString1, szString2, szString3) \ + WideCharToMultiByte(CP_ACP, 0, szString1, -1, string1, MAX_PATH, NULL, NULL); \ + WideCharToMultiByte(CP_ACP, 0, szString2, -1, string2, MAX_PATH, NULL, NULL); \ + WideCharToMultiByte(CP_ACP, 0, szString3, -1, string3, MAX_PATH, NULL, NULL); \ + ok(!lstrcmpW(szString3, szString1) || !lstrcmpW(szString3, szString2), \ + format, string1, string2, string3); + static HMODULE hmoduleRichEdit; + +static int is_win9x = 0; static HWND new_window(LPCTSTR lpClassName, DWORD dwStyle, HWND parent) { HWND hwnd; @@ -45,6 +57,26 @@ static HWND new_richedit(HWND parent) { return new_window(RICHEDIT_CLASS, ES_MULTILINE, parent); +} + +/* Keeps the window reponsive for the deley_time in seconds. + * This is useful for debugging a test to see what is happening. */ +static void keep_responsive(time_t delay_time) +{ + MSG msg; + time_t end; + + /* The message pump uses PeekMessage() to empty the queue and then + * sleeps for 50ms before retrying the queue. */ + end = time(NULL) + delay_time; + while (time(NULL) < end) { + if (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) { + TranslateMessage(&msg); + DispatchMessage(&msg); + } else { + Sleep(50); + } + } } static void processPendingMessages(void) @@ -81,6 +113,34 @@ } } +static BOOL hold_key(int vk) +{ + BYTE key_state[256]; + BOOL result; + + result = GetKeyboardState(key_state); + ok(result, "GetKeyboardState failed.\n"); + if (!result) return FALSE; + key_state[vk] |= 0x80; + result = SetKeyboardState(key_state); + ok(result, "SetKeyboardState failed.\n"); + return result != 0; +} + +static BOOL release_key(int vk) +{ + BYTE key_state[256]; + BOOL result; + + result = GetKeyboardState(key_state); + ok(result, "GetKeyboardState failed.\n"); + if (!result) return FALSE; + key_state[vk] &= ~0x80; + result = SetKeyboardState(key_state); + ok(result, "SetKeyboardState failed.\n"); + return result != 0; +} + static const char haystack[] = "WINEWine wineWine wine WineWine"; /* ^0 ^10 ^20 ^30 */ @@ -90,80 +150,79 @@ const char *needle; int flags; int expected_loc; - int _todo_wine; }; struct find_s find_tests[] = { /* Find in empty text */ - {0, -1, "foo", FR_DOWN, -1, 0}, - {0, -1, "foo", 0, -1, 0}, - {0, -1, "", FR_DOWN, -1, 0}, - {20, 5, "foo", FR_DOWN, -1, 0}, - {5, 20, "foo", FR_DOWN, -1, 0} + {0, -1, "foo", FR_DOWN, -1}, + {0, -1, "foo", 0, -1}, + {0, -1, "", FR_DOWN, -1}, + {20, 5, "foo", FR_DOWN, -1}, + {5, 20, "foo", FR_DOWN, -1} }; struct find_s find_tests2[] = { /* No-result find */ - {0, -1, "foo", FR_DOWN | FR_MATCHCASE, -1, 0}, - {5, 20, "WINE", FR_DOWN | FR_MATCHCASE, -1, 0}, + {0, -1, "foo", FR_DOWN | FR_MATCHCASE, -1}, + {5, 20, "WINE", FR_DOWN | FR_MATCHCASE, -1}, /* Subsequent finds */ - {0, -1, "Wine", FR_DOWN | FR_MATCHCASE, 4, 0}, - {5, 31, "Wine", FR_DOWN | FR_MATCHCASE, 13, 0}, - {14, 31, "Wine", FR_DOWN | FR_MATCHCASE, 23, 0}, - {24, 31, "Wine", FR_DOWN | FR_MATCHCASE, 27, 0}, + {0, -1, "Wine", FR_DOWN | FR_MATCHCASE, 4}, + {5, 31, "Wine", FR_DOWN | FR_MATCHCASE, 13}, + {14, 31, "Wine", FR_DOWN | FR_MATCHCASE, 23}, + {24, 31, "Wine", FR_DOWN | FR_MATCHCASE, 27}, /* Find backwards */ - {19, 20, "Wine", FR_MATCHCASE, 13, 0}, - {10, 20, "Wine", FR_MATCHCASE, 4, 0}, - {20, 10, "Wine", FR_MATCHCASE, 13, 0}, + {19, 20, "Wine", FR_MATCHCASE, 13}, + {10, 20, "Wine", FR_MATCHCASE, 4}, + {20, 10, "Wine", FR_MATCHCASE, 13}, /* Case-insensitive */ - {1, 31, "wInE", FR_DOWN, 4, 0}, - {1, 31, "Wine", FR_DOWN, 4, 0}, + {1, 31, "wInE", FR_DOWN, 4}, + {1, 31, "Wine", FR_DOWN, 4}, /* High-to-low ranges */ - {20, 5, "Wine", FR_DOWN, -1, 0}, - {2, 1, "Wine", FR_DOWN, -1, 0}, - {30, 29, "Wine", FR_DOWN, -1, 0}, - {20, 5, "Wine", 0, 13, 0}, + {20, 5, "Wine", FR_DOWN, -1}, + {2, 1, "Wine", FR_DOWN, -1}, + {30, 29, "Wine", FR_DOWN, -1}, + {20, 5, "Wine", 0, 13}, /* Find nothing */ - {5, 10, "", FR_DOWN, -1, 0}, - {10, 5, "", FR_DOWN, -1, 0}, - {0, -1, "", FR_DOWN, -1, 0}, - {10, 5, "", 0, -1, 0}, + {5, 10, "", FR_DOWN, -1}, + {10, 5, "", FR_DOWN, -1}, + {0, -1, "", FR_DOWN, -1}, + {10, 5, "", 0, -1}, /* Whole-word search */ - {0, -1, "wine", FR_DOWN | FR_WHOLEWORD, 18, 0}, - {0, -1, "win", FR_DOWN | FR_WHOLEWORD, -1, 0}, - {13, -1, "wine", FR_DOWN | FR_WHOLEWORD, 18, 0}, - {0, -1, "winewine", FR_DOWN | FR_WHOLEWORD, 0, 0}, - {10, -1, "winewine", FR_DOWN | FR_WHOLEWORD, 23, 0}, - {11, -1, "winewine", FR_WHOLEWORD, 0, 0}, - {31, -1, "winewine", FR_WHOLEWORD, 23, 0}, + {0, -1, "wine", FR_DOWN | FR_WHOLEWORD, 18}, + {0, -1, "win", FR_DOWN | FR_WHOLEWORD, -1}, + {13, -1, "wine", FR_DOWN | FR_WHOLEWORD, 18}, + {0, -1, "winewine", FR_DOWN | FR_WHOLEWORD, 0}, + {10, -1, "winewine", FR_DOWN | FR_WHOLEWORD, 23}, + {11, -1, "winewine", FR_WHOLEWORD, 0}, + {31, -1, "winewine", FR_WHOLEWORD, 23}, /* Bad ranges */ - {5, 200, "XXX", FR_DOWN, -1, 0}, - {-20, 20, "Wine", FR_DOWN, -1, 0}, - {-20, 20, "Wine", FR_DOWN, -1, 0}, - {-15, -20, "Wine", FR_DOWN, -1, 0}, - {1<<12, 1<<13, "Wine", FR_DOWN, -1, 0}, + {5, 200, "XXX", FR_DOWN, -1}, + {-20, 20, "Wine", FR_DOWN, -1}, + {-20, 20, "Wine", FR_DOWN, -1}, + {-15, -20, "Wine", FR_DOWN, -1}, + {1<<12, 1<<13, "Wine", FR_DOWN, -1}, /* Check the case noted in bug 4479 where matches at end aren't recognized */ - {23, 31, "Wine", FR_DOWN | FR_MATCHCASE, 23, 0}, - {27, 31, "Wine", FR_DOWN | FR_MATCHCASE, 27, 0}, - {27, 32, "Wine", FR_DOWN | FR_MATCHCASE, 27, 0}, - {13, 31, "WineWine", FR_DOWN | FR_MATCHCASE, 23, 0}, - {13, 32, "WineWine", FR_DOWN | FR_MATCHCASE, 23, 0}, + {23, 31, "Wine", FR_DOWN | FR_MATCHCASE, 23}, + {27, 31, "Wine", FR_DOWN | FR_MATCHCASE, 27}, + {27, 32, "Wine", FR_DOWN | FR_MATCHCASE, 27}, + {13, 31, "WineWine", FR_DOWN | FR_MATCHCASE, 23}, + {13, 32, "WineWine", FR_DOWN | FR_MATCHCASE, 23}, /* The backwards case of bug 4479; bounds look right * Fails because backward find is wrong */ - {19, 20, "WINE", FR_MATCHCASE, 0, 0}, - {0, 20, "WINE", FR_MATCHCASE, -1, 0}, - - {0, -1, "wineWine wine", 0, -1, 0}, + {19, 20, "WINE", FR_MATCHCASE, 0}, + {0, 20, "WINE", FR_MATCHCASE, -1}, + + {0, -1, "wineWine wine", 0, -1}, }; static void check_EM_FINDTEXT(HWND hwnd, const char *name, struct find_s *f, int id) { @@ -209,15 +268,8 @@ int i; for (i = 0; i < num_tests; i++) { - if (find[i]._todo_wine) { - todo_wine { - check_EM_FINDTEXT(hwnd, name, &find[i], i); - check_EM_FINDTEXTEX(hwnd, name, &find[i], i); - } - } else { - check_EM_FINDTEXT(hwnd, name, &find[i], i); - check_EM_FINDTEXTEX(hwnd, name, &find[i], i); - } + check_EM_FINDTEXT(hwnd, name, &find[i], i); + check_EM_FINDTEXTEX(hwnd, name, &find[i], i); } } @@ -296,7 +348,7 @@ { int nCopied; int expected_nCopied = min(gl[i].buffer_len, strlen(gl[i].text)); - int expected_bytes_written = min(gl[i].buffer_len, strlen(gl[i].text) + 1); + int expected_bytes_written = min(gl[i].buffer_len, strlen(gl[i].text)); memset(dest, 0xBB, nBuf); *(WORD *) dest = gl[i].buffer_len; @@ -314,11 +366,37 @@ !strncmp(dest+2, origdest+2, nBuf-2), "buffer_len=1\n"); else { + /* Prepare hex strings of buffers to dump on failure. */ + char expectedbuf[1024]; + char resultbuf[1024]; + int j; + resultbuf[0] = '\0'; + for (j = 0; j < 32; j++) + sprintf(resultbuf+strlen(resultbuf), "%02x", dest[j] & 0xFF); + expectedbuf[0] = '\0'; + for (j = 0; j < expected_bytes_written; j++) /* Written bytes */ + sprintf(expectedbuf+strlen(expectedbuf), "%02x", gl[i].text[j] & 0xFF); + for (; j < gl[i].buffer_len; j++) /* Ignored bytes */ + sprintf(expectedbuf+strlen(expectedbuf), "??"); + for (; j < 32; j++) /* Bytes after declared buffer size */ + sprintf(expectedbuf+strlen(expectedbuf), "%02x", origdest[j] & 0xFF); + + /* Test the part of the buffer that is expected to be written according + * to the MSDN documentation fo EM_GETLINE, which does not state that + * a NULL terminating character will be added unless no text is copied. + * + * Windows 95, 98 & NT do not append a NULL terminating character, but + * Windows 2000 and up do append a NULL terminating character if there + * is space in the buffer. The test will ignore this difference. */ ok(!strncmp(dest, gl[i].text, expected_bytes_written), - "%d: expected_bytes_written=%d\n", i, expected_bytes_written); - ok(!strncmp(dest + expected_bytes_written, origdest - + expected_bytes_written, nBuf - expected_bytes_written), - "%d: expected_bytes_written=%d\n", i, expected_bytes_written); + "%d: expected_bytes_written=%d\n" "expected=0x%s\n" "but got= 0x%s\n", + i, expected_bytes_written, expectedbuf, resultbuf); + /* Test the part of the buffer after the declared length to make sure + * there are no buffer overruns. */ + ok(!strncmp(dest + gl[i].buffer_len, origdest + gl[i].buffer_len, + nBuf - gl[i].buffer_len), + "%d: expected_bytes_written=%d\n" "expected=0x%s\n" "but got= 0x%s\n", + i, expected_bytes_written, expectedbuf, resultbuf); } } @@ -383,7 +461,6 @@ static void test_EM_SCROLLCARET(void) { int prevY, curY; - HWND hwndRichEdit = new_richedit(NULL); const char text[] = "aa\n" "this is a long line of text that should be longer than the " "control's width\n" @@ -393,6 +470,14 @@ "ff\n" "gg\n" "hh\n"; + /* The richedit window height needs to be large enough vertically to fit in + * more than two lines of text, so the new_richedit function can't be used + * since a height of 60 was not large enough on some systems. + */ + HWND hwndRichEdit = CreateWindow(RICHEDIT_CLASS, NULL, + ES_MULTILINE|WS_POPUP|WS_HSCROLL|WS_VSCROLL|WS_VISIBLE, + 0, 0, 200, 80, NULL, NULL, hmoduleRichEdit, NULL); + ok(hwndRichEdit != NULL, "class: %s, error: %d\n", RICHEDIT_CLASS, (int) GetLastError()); /* Can't verify this */ SendMessage(hwndRichEdit, EM_SCROLLCARET, 0, 0); @@ -438,6 +523,7 @@ LRESULT result; unsigned int height = 0; int xpos = 0; + POINTL pt; static const char text[] = "aa\n" "this is a long line of text that should be longer than the " "control's width\n" @@ -475,9 +561,7 @@ if (i == 0) { ok(HIWORD(result) == 0, "EM_POSFROMCHAR reports y=%d, expected 0\n", HIWORD(result)); - todo_wine { ok(LOWORD(result) == 1, "EM_POSFROMCHAR reports x=%d, expected 1\n", LOWORD(result)); - } xpos = LOWORD(result); } else if (i == 1) @@ -531,9 +615,7 @@ result = SendMessage(hwndRichEdit, EM_POSFROMCHAR, 0, 0); ok(HIWORD(result) == 0, "EM_POSFROMCHAR reports y=%d, expected 0\n", HIWORD(result)); - todo_wine { ok(LOWORD(result) == 1, "EM_POSFROMCHAR reports x=%d, expected 1\n", LOWORD(result)); - } xpos = LOWORD(result); SendMessage(hwndRichEdit, WM_HSCROLL, SB_LINERIGHT, 0); @@ -545,6 +627,26 @@ "EM_POSFROMCHAR reports x=%hd, expected value less than %d\n", (signed short)(LOWORD(result)), xpos); } + SendMessage(hwndRichEdit, WM_HSCROLL, SB_LINELEFT, 0); + + /* Test around end of text that doesn't end in a newline. */ + SendMessage(hwndRichEdit, WM_SETTEXT, 0, (LPARAM) "12345678901234"); + SendMessage(hwndRichEdit, EM_POSFROMCHAR, (WPARAM)&pt, + SendMessage(hwndRichEdit, WM_GETTEXTLENGTH, 0, 0)-1); + ok(pt.x > 1, "pt.x = %d\n", pt.x); + xpos = pt.x; + SendMessage(hwndRichEdit, EM_POSFROMCHAR, (WPARAM)&pt, + SendMessage(hwndRichEdit, WM_GETTEXTLENGTH, 0, 0)); + ok(pt.x > xpos, "pt.x = %d\n", pt.x); + xpos = pt.x; + SendMessage(hwndRichEdit, EM_POSFROMCHAR, (WPARAM)&pt, + SendMessage(hwndRichEdit, WM_GETTEXTLENGTH, 0, 0)+1); + ok(pt.x == xpos, "pt.x = %d\n", pt.x); + + /* Try a negative position. */ + SendMessage(hwndRichEdit, EM_POSFROMCHAR, (WPARAM)&pt, -1); + ok(pt.x == 1, "pt.x = %d\n", pt.x); + DestroyWindow(hwndRichEdit); } @@ -659,7 +761,7 @@ cf2.dwEffects = CFE_ITALIC ^ cf2.dwEffects; /* wParam==0 is default char format, does not set modify */ - SendMessage(hwndRichEdit, WM_SETTEXT, 0, (LPARAM)NULL); + SendMessage(hwndRichEdit, WM_SETTEXT, 0, 0); rc = SendMessage(hwndRichEdit, EM_GETMODIFY, 0, 0); ok(rc == 0, "Text marked as modified, expected not modified!\n"); rc = SendMessage(hwndRichEdit, EM_SETCHARFORMAT, 0, (LPARAM) &cf2); @@ -668,7 +770,7 @@ ok(rc == 0, "Text marked as modified, expected not modified!\n"); /* wParam==SCF_SELECTION sets modify if nonempty selection */ - SendMessage(hwndRichEdit, WM_SETTEXT, 0, (LPARAM)NULL); + SendMessage(hwndRichEdit, WM_SETTEXT, 0, 0); rc = SendMessage(hwndRichEdit, EM_GETMODIFY, 0, 0); ok(rc == 0, "Text marked as modified, expected not modified!\n"); rc = SendMessage(hwndRichEdit, EM_SETCHARFORMAT, SCF_SELECTION, (LPARAM) &cf2); @@ -690,7 +792,7 @@ ok(rc == -1, "Text not marked as modified, expected modified! (%d)\n", rc); /* wParam==SCF_ALL sets modify regardless of whether text is present */ - SendMessage(hwndRichEdit, WM_SETTEXT, 0, (LPARAM)NULL); + SendMessage(hwndRichEdit, WM_SETTEXT, 0, 0); rc = SendMessage(hwndRichEdit, EM_GETMODIFY, 0, 0); ok(rc == 0, "Text marked as modified, expected not modified!\n"); rc = SendMessage(hwndRichEdit, EM_SETCHARFORMAT, (WPARAM) SCF_ALL, (LPARAM) &cf2); @@ -1092,6 +1194,7 @@ HWND hwndRichEdit = new_richedit(NULL); PARAFORMAT2 fmt; HRESULT ret; + LONG expectedMask = PFM_ALL2 & ~PFM_TABLEROWDELIMITER; fmt.cbSize = sizeof(PARAFORMAT2); fmt.dwMask = PFM_ALIGNMENT; fmt.wAlignment = PFA_LEFT; @@ -1102,8 +1205,14 @@ fmt.cbSize = sizeof(PARAFORMAT2); fmt.dwMask = -1; ret = SendMessage(hwndRichEdit, EM_GETPARAFORMAT, 0, (LPARAM) &fmt); - ok(ret == PFM_ALL2, "expected %x got %x\n", PFM_ALL2, ret); - ok(fmt.dwMask == PFM_ALL2, "expected %x got %x\n", PFM_ALL2, fmt.dwMask); + /* Ignore the PFM_TABLEROWDELIMITER bit because it changes + * between richedit different native builds of riched20.dll + * used on different Windows versions. */ + ret &= ~PFM_TABLEROWDELIMITER; + fmt.dwMask &= ~PFM_TABLEROWDELIMITER; + + ok(ret == expectedMask, "expected %x got %x\n", expectedMask, ret); + ok(fmt.dwMask == expectedMask, "expected %x got %x\n", expectedMask, fmt.dwMask); DestroyWindow(hwndRichEdit); } @@ -2253,7 +2362,7 @@ unsigned int recursionLevel = 0; unsigned int WM_SIZE_recursionLevel = 0; BOOL bailedOutOfRecursion = FALSE; -LRESULT WINAPI (*richeditProc)(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam); +LRESULT (WINAPI *richeditProc)(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam); static LRESULT WINAPI RicheditStupidOverrideProcA(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) { @@ -2307,8 +2416,8 @@ GetScrollInfo(hwndRichEdit, SB_VERT, &si); ok (((GetWindowLongA(hwndRichEdit, GWL_STYLE) & WS_VSCROLL) == 0), "Vertical scrollbar is visible, should be invisible.\n"); - ok(si.nPage == 0 && si.nMin == 0 && si.nMax == 0, - "reported page/range is %d (%d..%d) expected all 0\n", + ok(si.nPage == 0 && si.nMin == 0 && (si.nMax == 0 || si.nMax == 100), + "reported page/range is %d (%d..%d) expected all 0 or nMax=100\n", si.nPage, si.nMin, si.nMax); SendMessage(hwndRichEdit, WM_SETTEXT, 0, 0); @@ -2318,8 +2427,8 @@ GetScrollInfo(hwndRichEdit, SB_VERT, &si); ok (((GetWindowLongA(hwndRichEdit, GWL_STYLE) & WS_VSCROLL) == 0), "Vertical scrollbar is visible, should be invisible.\n"); - ok(si.nPage == 0 && si.nMin == 0 && si.nMax == 0, - "reported page/range is %d (%d..%d) expected all 0\n", + ok(si.nPage == 0 && si.nMin == 0 && (si.nMax == 0 || si.nMax == 100), + "reported page/range is %d (%d..%d) expected all 0 or nMax=100\n", si.nPage, si.nMin, si.nMax); SendMessage(hwndRichEdit, WM_SETTEXT, 0, (LPARAM)text); @@ -2584,8 +2693,8 @@ GetScrollInfo(hwndRichEdit, SB_VERT, &si); ok (((GetWindowLongA(hwndRichEdit, GWL_STYLE) & WS_VSCROLL) == 0), "Vertical scrollbar is visible, should be invisible.\n"); - ok(si.nPage == 0 && si.nMin == 0 && si.nMax == 0, - "reported page/range is %d (%d..%d) expected all 0\n", + ok(si.nPage == 0 && si.nMin == 0 && (si.nMax == 0 || si.nMax == 100), + "reported page/range is %d (%d..%d) expected all 0 or nMax=100\n", si.nPage, si.nMin, si.nMax); SendMessage(hwndRichEdit, WM_SETTEXT, 0, 0); @@ -2595,8 +2704,8 @@ GetScrollInfo(hwndRichEdit, SB_VERT, &si); ok (((GetWindowLongA(hwndRichEdit, GWL_STYLE) & WS_VSCROLL) == 0), "Vertical scrollbar is visible, should be invisible.\n"); - ok(si.nPage == 0 && si.nMin == 0 && si.nMax == 0, - "reported page/range is %d (%d..%d) expected all 0\n", + ok(si.nPage == 0 && si.nMin == 0 && (si.nMax == 0 || si.nMax == 100), + "reported page/range is %d (%d..%d) expected all 0 or nMax=100\n", si.nPage, si.nMin, si.nMax); SendMessage(hwndRichEdit, WM_SETTEXT, 0, (LPARAM)"a"); @@ -2606,8 +2715,8 @@ GetScrollInfo(hwndRichEdit, SB_VERT, &si); ok (((GetWindowLongA(hwndRichEdit, GWL_STYLE) & WS_VSCROLL) == 0), "Vertical scrollbar is visible, should be invisible.\n"); - ok(si.nPage == 0 && si.nMin == 0 && si.nMax == 0, - "reported page/range is %d (%d..%d) expected all 0\n", + ok(si.nPage == 0 && si.nMin == 0 && (si.nMax == 0 || si.nMax == 100), + "reported page/range is %d (%d..%d) expected all 0 or nMax=100\n", si.nPage, si.nMin, si.nMax); SendMessage(hwndRichEdit, WM_SETTEXT, 0, 0); @@ -2617,8 +2726,8 @@ GetScrollInfo(hwndRichEdit, SB_VERT, &si); ok (((GetWindowLongA(hwndRichEdit, GWL_STYLE) & WS_VSCROLL) == 0), "Vertical scrollbar is visible, should be invisible.\n"); - ok(si.nPage == 0 && si.nMin == 0 && si.nMax == 0, - "reported page/range is %d (%d..%d) expected all 0\n", + ok(si.nPage == 0 && si.nMin == 0 && (si.nMax == 0 || si.nMax == 100), + "reported page/range is %d (%d..%d) expected all 0 or nMax=100\n", si.nPage, si.nMin, si.nMax); SendMessage(hwndRichEdit, WM_SETTEXT, 0, (LPARAM)text); @@ -2732,8 +2841,8 @@ GetScrollInfo(hwndRichEdit, SB_VERT, &si); ok (((GetWindowLongA(hwndRichEdit, GWL_STYLE) & WS_VSCROLL) != 0), "Vertical scrollbar is invisible, should be visible.\n"); - ok(si.nPage == 0 && si.nMin == 0 && si.nMax == 0, - "reported page/range is %d (%d..%d) expected all 0\n", + ok(si.nPage == 0 && si.nMin == 0 && (si.nMax == 0 || si.nMax == 100), + "reported page/range is %d (%d..%d) expected all 0 or nMax=100\n", si.nPage, si.nMin, si.nMax); /* Ditto, see above */ @@ -2744,8 +2853,8 @@ GetScrollInfo(hwndRichEdit, SB_VERT, &si); ok (((GetWindowLongA(hwndRichEdit, GWL_STYLE) & WS_VSCROLL) != 0), "Vertical scrollbar is invisible, should be visible.\n"); - ok(si.nPage == 0 && si.nMin == 0 && si.nMax == 0, - "reported page/range is %d (%d..%d) expected all 0\n", + ok(si.nPage == 0 && si.nMin == 0 && (si.nMax == 0 || si.nMax == 100), + "reported page/range is %d (%d..%d) expected all 0 or nMax=100\n", si.nPage, si.nMin, si.nMax); /* Ditto, see above */ @@ -2756,8 +2865,8 @@ GetScrollInfo(hwndRichEdit, SB_VERT, &si); ok (((GetWindowLongA(hwndRichEdit, GWL_STYLE) & WS_VSCROLL) != 0), "Vertical scrollbar is invisible, should be visible.\n"); - ok(si.nPage == 0 && si.nMin == 0 && si.nMax == 0, - "reported page/range is %d (%d..%d) expected all 0\n", + ok(si.nPage == 0 && si.nMin == 0 && (si.nMax == 0 || si.nMax == 100), + "reported page/range is %d (%d..%d) expected all 0 or nMax=100\n", si.nPage, si.nMin, si.nMax); /* Ditto, see above */ @@ -2768,8 +2877,8 @@ GetScrollInfo(hwndRichEdit, SB_VERT, &si); ok (((GetWindowLongA(hwndRichEdit, GWL_STYLE) & WS_VSCROLL) != 0), "Vertical scrollbar is invisible, should be visible.\n"); - ok(si.nPage == 0 && si.nMin == 0 && si.nMax == 0, - "reported page/range is %d (%d..%d) expected all 0\n", + ok(si.nPage == 0 && si.nMin == 0 && (si.nMax == 0 || si.nMax == 100), + "reported page/range is %d (%d..%d) expected all 0 or nMax=100\n", si.nPage, si.nMin, si.nMax); /* Ditto, see above */ @@ -2780,8 +2889,8 @@ GetScrollInfo(hwndRichEdit, SB_VERT, &si); ok (((GetWindowLongA(hwndRichEdit, GWL_STYLE) & WS_VSCROLL) != 0), "Vertical scrollbar is invisible, should be visible.\n"); - ok(si.nPage == 0 && si.nMin == 0 && si.nMax == 0, - "reported page/range is %d (%d..%d) expected all 0\n", + ok(si.nPage == 0 && si.nMin == 0 && (si.nMax == 0 || si.nMax == 100), + "reported page/range is %d (%d..%d) expected all 0 or nMax=100\n", si.nPage, si.nMin, si.nMax); SendMessage(hwndRichEdit, WM_SETTEXT, 0, (LPARAM)text); @@ -2807,8 +2916,8 @@ GetScrollInfo(hwndRichEdit, SB_VERT, &si); ok (((GetWindowLongA(hwndRichEdit, GWL_STYLE) & WS_VSCROLL) == 0), "Vertical scrollbar is visible, should be invisible.\n"); - ok(si.nPage == 0 && si.nMin == 0 && si.nMax == 0, - "reported page/range is %d (%d..%d) expected all 0\n", + ok(si.nPage == 0 && si.nMin == 0 && (si.nMax == 0 || si.nMax == 100), + "reported page/range is %d (%d..%d) expected all 0 or nMax=100\n", si.nPage, si.nMin, si.nMax); SendMessage(hwndRichEdit, WM_SETTEXT, 0, 0); @@ -2818,8 +2927,8 @@ GetScrollInfo(hwndRichEdit, SB_VERT, &si); ok (((GetWindowLongA(hwndRichEdit, GWL_STYLE) & WS_VSCROLL) == 0), "Vertical scrollbar is visible, should be invisible.\n"); - ok(si.nPage == 0 && si.nMin == 0 && si.nMax == 0, - "reported page/range is %d (%d..%d) expected all 0\n", + ok(si.nPage == 0 && si.nMin == 0 && (si.nMax == 0 || si.nMax == 100), + "reported page/range is %d (%d..%d) expected all 0 or nMax=100\n", si.nPage, si.nMin, si.nMax); SendMessage(hwndRichEdit, WM_SETTEXT, 0, (LPARAM)"a"); @@ -2829,8 +2938,8 @@ GetScrollInfo(hwndRichEdit, SB_VERT, &si); ok (((GetWindowLongA(hwndRichEdit, GWL_STYLE) & WS_VSCROLL) == 0), "Vertical scrollbar is visible, should be invisible.\n"); - ok(si.nPage == 0 && si.nMin == 0 && si.nMax == 0, - "reported page/range is %d (%d..%d) expected all 0\n", + ok(si.nPage == 0 && si.nMin == 0 && (si.nMax == 0 || si.nMax == 100), + "reported page/range is %d (%d..%d) expected all 0 or nMax=100\n", si.nPage, si.nMin, si.nMax); SendMessage(hwndRichEdit, WM_SETTEXT, 0, 0); @@ -2840,8 +2949,8 @@ GetScrollInfo(hwndRichEdit, SB_VERT, &si); ok (((GetWindowLongA(hwndRichEdit, GWL_STYLE) & WS_VSCROLL) == 0), "Vertical scrollbar is visible, should be invisible.\n"); - ok(si.nPage == 0 && si.nMin == 0 && si.nMax == 0, - "reported page/range is %d (%d..%d) expected all 0\n", + ok(si.nPage == 0 && si.nMin == 0 && (si.nMax == 0 || si.nMax == 100), + "reported page/range is %d (%d..%d) expected all 0 or nMax=100\n", si.nPage, si.nMin, si.nMax); SendMessage(hwndRichEdit, WM_SETTEXT, 0, (LPARAM)text); @@ -3207,6 +3316,8 @@ 't', 't', 'S', 'o', 'm', 'e', 'T', 'e', 'x', 't', 0}; + WCHAR TestItem1altn[] = {'T','T','e','s','t','S','o','m','e','T','e','x','t', + '\r','t','S','o','m','e','T','e','x','t',0}; WCHAR TestItem2[] = {'T', 'e', 's', 't', 'S', 'o', 'm', 'e', 'T', 'e', 'x', 't', @@ -3341,8 +3452,7 @@ "EM_SETTEXTEX did not convert properly\n"); /* !ST_SELECTION && Unicode && !\rtf */ - result = SendMessage(hwndRichEdit, EM_SETTEXTEX, - (WPARAM)&setText, (LPARAM) NULL); + result = SendMessage(hwndRichEdit, EM_SETTEXTEX, (WPARAM)&setText, 0); SendMessage(hwndRichEdit, EM_GETTEXTEX, (WPARAM)&getText, (LPARAM) buf); ok (result == 1, @@ -3359,8 +3469,7 @@ SendMessage(hwndRichEdit, EM_EXSETSEL, 0, (LPARAM) &cr); /* replace current selection: ST_SELECTION && Unicode && !\rtf */ setText.flags = ST_SELECTION; - result = SendMessage(hwndRichEdit, EM_SETTEXTEX, - (WPARAM)&setText, (LPARAM) NULL); + result = SendMessage(hwndRichEdit, EM_SETTEXTEX, (WPARAM)&setText, 0); ok(result == 0, "EM_SETTEXTEX with NULL lParam to replace selection" " with no text should return 0. Got %i\n", @@ -3439,9 +3548,7 @@ setText.flags = ST_SELECTION; SendMessage(hwndRichEdit, EM_SETTEXTEX, (WPARAM)&setText, (LPARAM) buf); SendMessage(hwndRichEdit, EM_GETTEXTEX, (WPARAM)&getText, (LPARAM) buf); - ok(lstrcmpW(buf, TestItem1alt) == 0, - "EM_GETTEXTEX results not what was set by EM_SETTEXTEX when" - " using ST_SELECTION on an RTF string and non-Unicode\n"); + ok_w3("Expected \"%s\" or \"%s\", got \"%s\"\n", TestItem1alt, TestItem1altn, buf); /* The following test demonstrates that EM_SETTEXTEX replacing a selection */ setText.codepage = 1200; /* no constant for unicode */ @@ -3472,6 +3579,28 @@ "EM_GETTEXTEX results not what was set by EM_SETTEXTEX when" " using ST_SELECTION and non-Unicode\n"); + /* Test setting text using rich text format */ + setText.flags = 0; + setText.codepage = CP_ACP; + SendMessage(hwndRichEdit, EM_SETTEXTEX, (WPARAM)&setText, (LPARAM)"{\\rtf richtext}"); + getText.codepage = CP_ACP; + getText.cb = MAX_BUF_LEN; + getText.flags = GT_DEFAULT; + getText.lpDefaultChar = NULL; + getText.lpUsedDefChar = NULL; + SendMessage(hwndRichEdit, EM_GETTEXTEX, (WPARAM)&getText, (LPARAM) bufACP); + ok(!strcmp(bufACP, "richtext"), "expected 'richtext' but got '%s'\n", bufACP); + + setText.flags = 0; + setText.codepage = CP_ACP; + SendMessage(hwndRichEdit, EM_SETTEXTEX, (WPARAM)&setText, (LPARAM)"{\\urtf morerichtext}"); + getText.codepage = CP_ACP; + getText.cb = MAX_BUF_LEN; + getText.flags = GT_DEFAULT; + getText.lpDefaultChar = NULL; + getText.lpUsedDefChar = NULL; + SendMessage(hwndRichEdit, EM_GETTEXTEX, (WPARAM)&getText, (LPARAM) bufACP); + ok(!strcmp(bufACP, "morerichtext"), "expected 'morerichtext' but got '%s'\n", bufACP); DestroyWindow(hwndRichEdit); } @@ -3686,7 +3815,7 @@ returnedCF2A.cbSize = sizeof(returnedCF2A); SendMessage(hwndRichEdit, WM_SETTEXT, 0, (LPARAM) "x"); - SendMessage(hwndRichEdit, WM_SETFONT, (WPARAM)testFont1,(LPARAM) MAKELONG((WORD) TRUE, 0)); + SendMessage(hwndRichEdit, WM_SETFONT, (WPARAM)testFont1, MAKELPARAM(TRUE, 0)); SendMessage(hwndRichEdit, EM_GETCHARFORMAT, SCF_DEFAULT, (LPARAM) &returnedCF2A); GetObjectA(testFont1, sizeof(LOGFONTA), &sentLogFont); @@ -3694,14 +3823,14 @@ "EM_GETCHARFORMAT: Returned wrong font on test 1. Sent: %s, Returned: %s\n", sentLogFont.lfFaceName,returnedCF2A.szFaceName); - SendMessage(hwndRichEdit, WM_SETFONT, (WPARAM)testFont2,(LPARAM) MAKELONG((WORD) TRUE, 0)); + SendMessage(hwndRichEdit, WM_SETFONT, (WPARAM)testFont2, MAKELPARAM(TRUE, 0)); SendMessage(hwndRichEdit, EM_GETCHARFORMAT, SCF_DEFAULT, (LPARAM) &returnedCF2A); GetObjectA(testFont2, sizeof(LOGFONTA), &sentLogFont); ok (!strcmp(sentLogFont.lfFaceName,returnedCF2A.szFaceName), "EM_GETCHARFORMAT: Returned wrong font on test 2. Sent: %s, Returned: %s\n", sentLogFont.lfFaceName,returnedCF2A.szFaceName); - SendMessage(hwndRichEdit, WM_SETFONT, (WPARAM)testFont3,(LPARAM) MAKELONG((WORD) TRUE, 0)); + SendMessage(hwndRichEdit, WM_SETFONT, (WPARAM)testFont3, MAKELPARAM(TRUE, 0)); SendMessage(hwndRichEdit, EM_GETCHARFORMAT, SCF_DEFAULT, (LPARAM) &returnedCF2A); GetObjectA(testFont3, sizeof(LOGFONTA), &sentLogFont); ok (!strcmp(sentLogFont.lfFaceName,returnedCF2A.szFaceName), @@ -3714,7 +3843,7 @@ ZeroMemory(&sentLogFont,sizeof(sentLogFont)); returnedCF2A.cbSize = sizeof(returnedCF2A); - SendMessage(hwndRichEdit, WM_SETFONT, (WPARAM)NULL,(LPARAM) MAKELONG((WORD) TRUE, 0)); + SendMessage(hwndRichEdit, WM_SETFONT, 0, MAKELPARAM((WORD) TRUE, 0)); SendMessage(hwndRichEdit, EM_GETCHARFORMAT, SCF_DEFAULT, (LPARAM) &returnedCF2A); GetObjectA(NULL, sizeof(LOGFONTA), &sentLogFont); ok (!strcmp("System",returnedCF2A.szFaceName), @@ -3788,7 +3917,7 @@ /* setting font doesn't change modify flag */ SendMessage(hwndRichEdit, EM_SETMODIFY, FALSE, 0); - SendMessage(hwndRichEdit, WM_SETFONT, (WPARAM)testFont,(LPARAM) MAKELONG((WORD) TRUE, 0)); + SendMessage(hwndRichEdit, WM_SETFONT, (WPARAM)testFont, MAKELPARAM(TRUE, 0)); result = SendMessage(hwndRichEdit, EM_GETMODIFY, 0, 0); ok (result == 0, "EM_GETMODIFY returned non-zero, instead of zero on setting font\n"); @@ -4007,7 +4136,7 @@ /* FIXME add more tests */ SendMessage(hwndRichEdit, EM_SETSEL, 7, 17); - r = SendMessage(hwndRichEdit, EM_REPLACESEL, 0, (LPARAM) NULL); + r = SendMessage(hwndRichEdit, EM_REPLACESEL, 0, 0); ok(0 == r, "EM_REPLACESEL returned %d, expected 0\n", r); SendMessage(hwndRichEdit, WM_GETTEXT, 1024, (LPARAM) buffer); r = strcmp(buffer, "testing"); @@ -4021,7 +4150,7 @@ SendMessage(hwndRichEdit, WM_SETREDRAW, redraw, 0); /* Test behavior with carriage returns and newlines */ - SendMessage(hwndRichEdit, WM_SETTEXT, 0, (LPARAM)NULL); + SendMessage(hwndRichEdit, WM_SETTEXT, 0, 0); r = SendMessage(hwndRichEdit, EM_REPLACESEL, 0, (LPARAM) "RichEdit1"); ok(9 == r, "EM_REPLACESEL returned %d, expected 9\n", r); SendMessage(hwndRichEdit, WM_GETTEXT, 1024, (LPARAM) buffer); @@ -4040,7 +4169,7 @@ r = SendMessage(hwndRichEdit, EM_GETLINECOUNT, 0, 0); ok(r == 1, "EM_GETLINECOUNT returned %d, expected 1\n", r); - SendMessage(hwndRichEdit, WM_SETTEXT, 0, (LPARAM)NULL); + SendMessage(hwndRichEdit, WM_SETTEXT, 0, 0); r = SendMessage(hwndRichEdit, EM_REPLACESEL, 0, (LPARAM) "RichEdit1\r"); ok(10 == r, "EM_REPLACESEL returned %d, expected 10\n", r); SendMessage(hwndRichEdit, WM_GETTEXT, 1024, (LPARAM) buffer); @@ -4066,7 +4195,7 @@ characters interpreted from the original lParam. Wine's builtin riched20 implements the WinXP behavior. */ - SendMessage(hwndRichEdit, WM_SETTEXT, 0, (LPARAM)NULL); + SendMessage(hwndRichEdit, WM_SETTEXT, 0, 0); r = SendMessage(hwndRichEdit, EM_REPLACESEL, 0, (LPARAM) "RichEdit1\r\n"); ok(11 == r /* WinXP */ || 10 == r /* Win98 */, "EM_REPLACESEL returned %d, expected 11 or 10\n", r); @@ -4103,7 +4232,7 @@ string. */ - SendMessage(hwndRichEdit, WM_SETTEXT, 0, (LPARAM)NULL); + SendMessage(hwndRichEdit, WM_SETTEXT, 0, 0); r = SendMessage(hwndRichEdit, EM_REPLACESEL, 0, (LPARAM) "\r\r"); ok(2 == r, "EM_REPLACESEL returned %d, expected 4\n", r); r = SendMessage(hwndRichEdit, EM_EXGETSEL, 0, (LPARAM)&cr); @@ -4125,7 +4254,7 @@ r = SendMessage(hwndRichEdit, EM_GETLINECOUNT, 0, 0); ok(r == 3, "EM_GETLINECOUNT returned %d, expected 3\n", r); - SendMessage(hwndRichEdit, WM_SETTEXT, 0, (LPARAM)NULL); + SendMessage(hwndRichEdit, WM_SETTEXT, 0, 0); r = SendMessage(hwndRichEdit, EM_REPLACESEL, 0, (LPARAM) "\r\r\n"); ok(3 == r /* WinXP */ || 1 == r /* Win98 */, "EM_REPLACESEL returned %d, expected 3 or 1\n", r); @@ -4148,7 +4277,7 @@ r = SendMessage(hwndRichEdit, EM_GETLINECOUNT, 0, 0); ok(r == 1, "EM_GETLINECOUNT returned %d, expected 1\n", r); - SendMessage(hwndRichEdit, WM_SETTEXT, 0, (LPARAM)NULL); + SendMessage(hwndRichEdit, WM_SETTEXT, 0, 0); r = SendMessage(hwndRichEdit, EM_REPLACESEL, 0, (LPARAM) "\r\r\r\r\r\n\r\r\r"); ok(9 == r /* WinXP */ || 7 == r /* Win98 */, "EM_REPLACESEL returned %d, expected 9 or 7\n", r); @@ -4171,7 +4300,7 @@ r = SendMessage(hwndRichEdit, EM_GETLINECOUNT, 0, 0); ok(r == 7, "EM_GETLINECOUNT returned %d, expected 7\n", r); - SendMessage(hwndRichEdit, WM_SETTEXT, 0, (LPARAM)NULL); + SendMessage(hwndRichEdit, WM_SETTEXT, 0, 0); r = SendMessage(hwndRichEdit, EM_REPLACESEL, 0, (LPARAM) "\r\r\n\r\n"); ok(5 == r /* WinXP */ || 2 == r /* Win98 */, "EM_REPLACESEL returned %d, expected 5 or 2\n", r); @@ -4194,7 +4323,7 @@ r = SendMessage(hwndRichEdit, EM_GETLINECOUNT, 0, 0); ok(r == 2, "EM_GETLINECOUNT returned %d, expected 2\n", r); - SendMessage(hwndRichEdit, WM_SETTEXT, 0, (LPARAM)NULL); + SendMessage(hwndRichEdit, WM_SETTEXT, 0, 0); r = SendMessage(hwndRichEdit, EM_REPLACESEL, 0, (LPARAM) "\r\r\n\r\r"); ok(5 == r /* WinXP */ || 3 == r /* Win98 */, "EM_REPLACESEL returned %d, expected 5 or 3\n", r); @@ -4217,7 +4346,7 @@ r = SendMessage(hwndRichEdit, EM_GETLINECOUNT, 0, 0); ok(r == 3, "EM_GETLINECOUNT returned %d, expected 3\n", r); - SendMessage(hwndRichEdit, WM_SETTEXT, 0, (LPARAM)NULL); + SendMessage(hwndRichEdit, WM_SETTEXT, 0, 0); r = SendMessage(hwndRichEdit, EM_REPLACESEL, 0, (LPARAM) "\rX\r\n\r\r"); ok(6 == r /* WinXP */ || 5 == r /* Win98 */, "EM_REPLACESEL returned %d, expected 6 or 5\n", r); @@ -4240,7 +4369,7 @@ r = SendMessage(hwndRichEdit, EM_GETLINECOUNT, 0, 0); ok(r == 5, "EM_GETLINECOUNT returned %d, expected 5\n", r); - SendMessage(hwndRichEdit, WM_SETTEXT, 0, (LPARAM)NULL); + SendMessage(hwndRichEdit, WM_SETTEXT, 0, 0); r = SendMessage(hwndRichEdit, EM_REPLACESEL, 0, (LPARAM) "\n\n"); ok(2 == r, "EM_REPLACESEL returned %d, expected 2\n", r); r = SendMessage(hwndRichEdit, EM_EXGETSEL, 0, (LPARAM)&cr); @@ -4262,7 +4391,7 @@ r = SendMessage(hwndRichEdit, EM_GETLINECOUNT, 0, 0); ok(r == 3, "EM_GETLINECOUNT returned %d, expected 3\n", r); - SendMessage(hwndRichEdit, WM_SETTEXT, 0, (LPARAM)NULL); + SendMessage(hwndRichEdit, WM_SETTEXT, 0, 0); r = SendMessage(hwndRichEdit, EM_REPLACESEL, 0, (LPARAM) "\n\n\n\n\r\r\r\r\n"); ok(9 == r /* WinXP */ || 7 == r /* Win98 */, "EM_REPLACESEL returned %d, expected 9 or 7\n", r); @@ -4305,11 +4434,15 @@ const char* text3 = "testing paste\r\npaste\r\ntesting paste"; HWND hwndRichEdit = new_richedit(NULL); - /* Native riched20 won't obey WM_CHAR messages or WM_KEYDOWN/WM_KEYUP - messages, probably because it inspects the keyboard state itself. - Therefore, native requires this in order to obey Ctrl-<key> keystrokes. + /* Native riched20 inspects the keyboard state (e.g. GetKeyState) + * to test the state of the modifiers (Ctrl/Alt/Shift). + * + * Therefore Ctrl-<key> keystrokes need to be simulated with + * keybd_event or by using SetKeyboardState to set the modifiers + * and SendMessage to simulate the keystrokes. */ + /* Sent keystrokes with keybd_event */ #define SEND_CTRL_C(hwnd) pressKeyWithModifier(hwnd, VK_CONTROL, 'C') #define SEND_CTRL_X(hwnd) pressKeyWithModifier(hwnd, VK_CONTROL, 'X') #define SEND_CTRL_V(hwnd) pressKeyWithModifier(hwnd, VK_CONTROL, 'V') @@ -4326,13 +4459,14 @@ /* Pasted text should be visible at this step */ result = strcmp(text1_step1, buffer); ok(result == 0, - "test paste: strcmp = %i\n", result); + "test paste: strcmp = %i, text='%s'\n", result, buffer); + SEND_CTRL_Z(hwndRichEdit); /* Undo */ SendMessage(hwndRichEdit, WM_GETTEXT, 1024, (LPARAM) buffer); /* Text should be the same as before (except for \r -> \r\n conversion) */ result = strcmp(text1_after, buffer); ok(result == 0, - "test paste: strcmp = %i\n", result); + "test paste: strcmp = %i, text='%s'\n", result, buffer); SendMessage(hwndRichEdit, WM_SETTEXT, 0, (LPARAM) text2); SendMessage(hwndRichEdit, EM_SETSEL, 8, 13); @@ -4357,6 +4491,87 @@ ok(result == 0, "test paste: strcmp = %i\n", result); +#undef SEND_CTRL_C +#undef SEND_CTRL_X +#undef SEND_CTRL_V +#undef SEND_CTRL_Z +#undef SEND_CTRL_Y + + SendMessage(hwndRichEdit, WM_SETTEXT, 0, 0); + /* Send WM_CHAR to simulates Ctrl-V */ + SendMessage(hwndRichEdit, WM_CHAR, 22, + (MapVirtualKey('V', MAPVK_VK_TO_VSC) << 16) & 1); + SendMessage(hwndRichEdit, WM_GETTEXT, 1024, (LPARAM) buffer); + /* Shouldn't paste because pasting is handled by WM_KEYDOWN */ + result = strcmp(buffer,""); + ok(result == 0, + "test paste: strcmp = %i, actual = '%s'\n", result, buffer); + + /* Send keystrokes with WM_KEYDOWN after setting the modifiers + * with SetKeyboard state. */ + + SendMessage(hwndRichEdit, WM_SETTEXT, 0, 0); + /* Simulates paste (Ctrl-V) */ + hold_key(VK_CONTROL); + SendMessage(hwndRichEdit, WM_KEYDOWN, 'V', + (MapVirtualKey('V', MAPVK_VK_TO_VSC) << 16) & 1); + release_key(VK_CONTROL); + SendMessage(hwndRichEdit, WM_GETTEXT, 1024, (LPARAM) buffer); + result = strcmp(buffer,"paste"); + ok(result == 0, + "test paste: strcmp = %i, actual = '%s'\n", result, buffer); + + SendMessage(hwndRichEdit, WM_SETTEXT, 0, (LPARAM) text1); + SendMessage(hwndRichEdit, EM_SETSEL, 0, 7); + /* Simulates copy (Ctrl-C) */ + hold_key(VK_CONTROL); + SendMessage(hwndRichEdit, WM_KEYDOWN, 'C', + (MapVirtualKey('C', MAPVK_VK_TO_VSC) << 16) & 1); + release_key(VK_CONTROL); + SendMessage(hwndRichEdit, WM_SETTEXT, 0, 0); + SendMessage(hwndRichEdit, WM_PASTE, 0, 0); + SendMessage(hwndRichEdit, WM_GETTEXT, 1024, (LPARAM) buffer); + result = strcmp(buffer,"testing"); + ok(result == 0, + "test paste: strcmp = %i, actual = '%s'\n", result, buffer); + + /* Cut with WM_KEYDOWN to simulate Ctrl-X */ + SendMessage(hwndRichEdit, WM_SETTEXT, 0, (LPARAM) "cut"); + /* Simulates select all (Ctrl-A) */ + hold_key(VK_CONTROL); + SendMessage(hwndRichEdit, WM_KEYDOWN, 'A', + (MapVirtualKey('A', MAPVK_VK_TO_VSC) << 16) & 1); + /* Simulates select cut (Ctrl-X) */ + SendMessage(hwndRichEdit, WM_KEYDOWN, 'X', + (MapVirtualKey('X', MAPVK_VK_TO_VSC) << 16) & 1); + release_key(VK_CONTROL); + SendMessage(hwndRichEdit, WM_GETTEXT, 1024, (LPARAM) buffer); + result = strcmp(buffer,""); + ok(result == 0, + "test paste: strcmp = %i, actual = '%s'\n", result, buffer); + SendMessage(hwndRichEdit, WM_SETTEXT, 0, 0); + SendMessage(hwndRichEdit, WM_PASTE, 0, 0); + SendMessage(hwndRichEdit, WM_GETTEXT, 1024, (LPARAM) buffer); + result = strcmp(buffer,"cut\r\n"); + todo_wine ok(result == 0, + "test paste: strcmp = %i, actual = '%s'\n", result, buffer); + /* Simulates undo (Ctrl-Z) */ + hold_key(VK_CONTROL); + SendMessage(hwndRichEdit, WM_KEYDOWN, 'Z', + (MapVirtualKey('Z', MAPVK_VK_TO_VSC) << 16) & 1); + SendMessage(hwndRichEdit, WM_GETTEXT, 1024, (LPARAM) buffer); + result = strcmp(buffer,""); + ok(result == 0, + "test paste: strcmp = %i, actual = '%s'\n", result, buffer); + /* Simulates redo (Ctrl-Y) */ + SendMessage(hwndRichEdit, WM_KEYDOWN, 'Y', + (MapVirtualKey('Y', MAPVK_VK_TO_VSC) << 16) & 1); + SendMessage(hwndRichEdit, WM_GETTEXT, 1024, (LPARAM) buffer); + result = strcmp(buffer,"cut\r\n"); + todo_wine ok(result == 0, + "test paste: strcmp = %i, actual = '%s'\n", result, buffer); + release_key(VK_CONTROL); + DestroyWindow(hwndRichEdit); } @@ -4379,14 +4594,14 @@ fr.chrg.cpMin = 0; fr.chrg.cpMax = 20; - r = SendMessage(hwndRichEdit, EM_FORMATRANGE, TRUE, (LPARAM) NULL); + r = SendMessage(hwndRichEdit, EM_FORMATRANGE, TRUE, 0); todo_wine { ok(r == 31, "EM_FORMATRANGE expect %d, got %d\n", 31, r); } r = SendMessage(hwndRichEdit, EM_FORMATRANGE, TRUE, (LPARAM) &fr); todo_wine { - ok(r == 20, "EM_FORMATRANGE expect %d, got %d\n", 20, r); + ok(r == 20 || r == 9, "EM_FORMATRANGE expect 20 or 9, got %d\n", r); } fr.chrg.cpMin = 0; @@ -4397,7 +4612,7 @@ ok(r == 10, "EM_FORMATRANGE expect %d, got %d\n", 10, r); } - r = SendMessage(hwndRichEdit, EM_FORMATRANGE, TRUE, (LPARAM) NULL); + r = SendMessage(hwndRichEdit, EM_FORMATRANGE, TRUE, 0); todo_wine { ok(r == 31, "EM_FORMATRANGE expect %d, got %d\n", 31, r); } @@ -4486,26 +4701,26 @@ const char * streamText0b = "{\\rtf1 TestSomeText\\par\\par}"; const char * streamText1 = - "{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang12298{\\fonttbl{\\f0\\fswiss\\fprq2\\fcharset0 System;}}\r\n" \ - "\\viewkind4\\uc1\\pard\\f0\\fs17 TestSomeText\\par\r\n" \ + "{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang12298{\\fonttbl{\\f0\\fswiss\\fprq2\\fcharset0 System;}}\r\n" + "\\viewkind4\\uc1\\pard\\f0\\fs17 TestSomeText\\par\r\n" "}\r\n"; /* In richedit 2.0 mode, this should NOT be accepted, unlike 1.0 */ const char * streamText2 = - "{{\\colortbl;\\red0\\green255\\blue102;\\red255\\green255\\blue255;" \ - "\\red170\\green255\\blue255;\\red255\\green238\\blue0;\\red51\\green255" \ - "\\blue221;\\red238\\green238\\blue238;}\\tx0 \\tx424 \\tx848 \\tx1272 " \ - "\\tx1696 \\tx2120 \\tx2544 \\tx2968 \\tx3392 \\tx3816 \\tx4240 \\tx4664 " \ - "\\tx5088 \\tx5512 \\tx5936 \\tx6360 \\tx6784 \\tx7208 \\tx7632 \\tx8056 " \ - "\\tx8480 \\tx8904 \\tx9328 \\tx9752 \\tx10176 \\tx10600 \\tx11024 " \ + "{{\\colortbl;\\red0\\green255\\blue102;\\red255\\green255\\blue255;" + "\\red170\\green255\\blue255;\\red255\\green238\\blue0;\\red51\\green255" + "\\blue221;\\red238\\green238\\blue238;}\\tx0 \\tx424 \\tx848 \\tx1272 " + "\\tx1696 \\tx2120 \\tx2544 \\tx2968 \\tx3392 \\tx3816 \\tx4240 \\tx4664 " + "\\tx5088 \\tx5512 \\tx5936 \\tx6360 \\tx6784 \\tx7208 \\tx7632 \\tx8056 " + "\\tx8480 \\tx8904 \\tx9328 \\tx9752 \\tx10176 \\tx10600 \\tx11024 " "\\tx11448 \\tx11872 \\tx12296 \\tx12720 \\tx13144 \\cf2 RichEdit1\\line }"; const char * streamText3 = "RichEdit1"; struct StringWithLength cookieForStream4; const char * streamText4 = - "This text just needs to be long enough to cause run to be split onto "\ - "two separate lines and make sure the null terminating character is "\ + "This text just needs to be long enough to cause run to be split onto " + "two separate lines and make sure the null terminating character is " "handled properly.\0"; int length4 = strlen(streamText4) + 1; cookieForStream4.buffer = (char *)streamText4; @@ -4698,9 +4913,7 @@ char bufA[64]; WCHAR bufW[64]; HWND hwnd; - int is_win9x, em_settextex_supported, ret; - - is_win9x = GetVersion() & 0x80000000; + int em_settextex_supported, ret; #define set_textA(hwnd, wm_set_text, txt) \ do { \ @@ -4933,8 +5146,12 @@ char buffer[64] = {0}; /* single line */ - hwnd = CreateWindowExA(0, "RichEdit20W", NULL, WS_POPUP, - 0, 0, 200, 60, 0, 0, 0, 0); + if (!is_win9x) + hwnd = CreateWindowExA(0, "RichEdit20W", NULL, WS_POPUP, + 0, 0, 200, 60, 0, 0, 0, 0); + else + hwnd = CreateWindowExA(0, "RichEdit20A", NULL, WS_POPUP, + 0, 0, 200, 60, 0, 0, 0, 0); ok(hwnd != 0, "CreateWindowExA error %u\n", GetLastError()); gtl.flags = GTL_NUMCHARS | GTL_PRECISE | GTL_USECRLF; @@ -4978,8 +5195,12 @@ DestroyWindow(hwnd); /* multi line */ - hwnd = CreateWindowExA(0, "RichEdit20W", NULL, WS_POPUP | ES_MULTILINE, - 0, 0, 200, 60, 0, 0, 0, 0); + if (!is_win9x) + hwnd = CreateWindowExA(0, "RichEdit20W", NULL, WS_POPUP | ES_MULTILINE, + 0, 0, 200, 60, 0, 0, 0, 0); + else + hwnd = CreateWindowExA(0, "RichEdit20A", NULL, WS_POPUP | ES_MULTILINE, + 0, 0, 200, 60, 0, 0, 0, 0); ok(hwnd != 0, "CreateWindowExA error %u\n", GetLastError()); gtl.flags = GTL_NUMCHARS | GTL_PRECISE | GTL_USECRLF; @@ -5051,7 +5272,7 @@ static void test_eventMask(void) { HWND parent; - int ret; + int ret, style; WNDCLASSA cls; const char text[] = "foo bar\n"; int eventMask; @@ -5092,6 +5313,38 @@ ok(queriedEventMask == (eventMask & ~ENM_CHANGE), "wrong event mask (0x%x) during WM_COMMAND\n", queriedEventMask); + /* check to see if EN_CHANGE is sent when redraw is turned off */ + SendMessage(eventMaskEditHwnd, WM_CLEAR, 0, 0); + ok(IsWindowVisible(eventMaskEditHwnd), "Window should be visible.\n"); + SendMessage(eventMaskEditHwnd, WM_SETREDRAW, FALSE, 0); + /* redraw is disabled by making the window invisible. */ + ok(!IsWindowVisible(eventMaskEditHwnd), "Window shouldn't be visible.\n"); + queriedEventMask = 0; /* initialize to something other than we expect */ + SendMessage(eventMaskEditHwnd, EM_REPLACESEL, 0, (LPARAM) text); + ok(queriedEventMask == (eventMask & ~ENM_CHANGE), + "wrong event mask (0x%x) during WM_COMMAND\n", queriedEventMask); + SendMessage(eventMaskEditHwnd, WM_SETREDRAW, TRUE, 0); + ok(IsWindowVisible(eventMaskEditHwnd), "Window should be visible.\n"); + + /* check to see if EN_UPDATE is sent when the editor isn't visible */ + SendMessage(eventMaskEditHwnd, WM_CLEAR, 0, 0); + style = GetWindowLong(eventMaskEditHwnd, GWL_STYLE); + SetWindowLong(eventMaskEditHwnd, GWL_STYLE, style & ~WS_VISIBLE); + ok(!IsWindowVisible(eventMaskEditHwnd), "Window shouldn't be visible.\n"); + watchForEventMask = EN_UPDATE; + queriedEventMask = 0; /* initialize to something other than we expect */ + SendMessage(eventMaskEditHwnd, EM_REPLACESEL, 0, (LPARAM) text); + ok(queriedEventMask == 0, + "wrong event mask (0x%x) during WM_COMMAND\n", queriedEventMask); + SetWindowLong(eventMaskEditHwnd, GWL_STYLE, style); + ok(IsWindowVisible(eventMaskEditHwnd), "Window should be visible.\n"); + queriedEventMask = 0; /* initialize to something other than we expect */ + SendMessage(eventMaskEditHwnd, EM_REPLACESEL, 0, (LPARAM) text); + ok(queriedEventMask == eventMask, + "wrong event mask (0x%x) during WM_COMMAND\n", queriedEventMask); + + + DestroyWindow(parent); } static int received_WM_NOTIFY = 0; @@ -5167,6 +5420,14 @@ ok(received_WM_NOTIFY == 1, "Expected WM_NOTIFY was NOT sent!\n"); ok(modify_at_WM_NOTIFY == 0, "WM_NOTIFY callback saw text flagged as modified!\n"); + /* Test for WM_NOTIFY messages with redraw disabled. */ + SendMessage(hwndRichedit_WM_NOTIFY, EM_SETSEL, 0, 0); + SendMessage(hwndRichedit_WM_NOTIFY, WM_SETREDRAW, FALSE, 0); + received_WM_NOTIFY = 0; + SendMessage(hwndRichedit_WM_NOTIFY, EM_REPLACESEL, FALSE, (LPARAM)"inserted"); + ok(received_WM_NOTIFY == 1, "Expected WM_NOTIFY was NOT sent!\n"); + SendMessage(hwndRichedit_WM_NOTIFY, WM_SETREDRAW, TRUE, 0); + DestroyWindow(hwndRichedit_WM_NOTIFY); DestroyWindow(parent); } @@ -5178,8 +5439,12 @@ char buffer[64] = {0}; /* multi-line control inserts CR normally */ - hwnd = CreateWindowExA(0, "RichEdit20W", NULL, WS_POPUP|ES_MULTILINE, - 0, 0, 200, 60, 0, 0, 0, 0); + if (!is_win9x) + hwnd = CreateWindowExA(0, "RichEdit20W", NULL, WS_POPUP|ES_MULTILINE, + 0, 0, 200, 60, 0, 0, 0, 0); + else + hwnd = CreateWindowExA(0, "RichEdit20A", NULL, WS_POPUP|ES_MULTILINE, + 0, 0, 200, 60, 0, 0, 0, 0); ok(hwnd != 0, "CreateWindowExA error %u\n", GetLastError()); result = SendMessage(hwnd, EM_CANUNDO, 0, 0); @@ -5221,8 +5486,8 @@ simulate_typing_characters(hwnd, "one two three"); result = SendMessage(hwnd, EM_CANREDO, 0, 0); ok (result == FALSE, "Redo buffer should have been cleared by typing.\n"); - SendMessage(hwnd, WM_KILLFOCUS, (WPARAM)NULL, 0); - SendMessage(hwnd, WM_SETFOCUS, (WPARAM)NULL, 0); + SendMessage(hwnd, WM_KILLFOCUS, 0, 0); + SendMessage(hwnd, WM_SETFOCUS, 0, 0); simulate_typing_characters(hwnd, " four five six"); result = SendMessage(hwnd, EM_UNDO, 0, 0); ok (result == TRUE, "Failed to undo typed characters.\n"); @@ -5289,6 +5554,43 @@ DestroyWindow(hwnd); } +static LONG CALLBACK customWordBreakProc(WCHAR *text, int pos, int bytes, int code) +{ + int length; + + /* MSDN lied, length is actually the number of bytes. */ + length = bytes / sizeof(WCHAR); + switch(code) + { + case WB_ISDELIMITER: + return text[pos] == 'X'; + case WB_LEFT: + case WB_MOVEWORDLEFT: + if (customWordBreakProc(text, pos, bytes, WB_ISDELIMITER)) + return pos-1; + return min(customWordBreakProc(text, pos, bytes, WB_LEFTBREAK)-1, 0); + case WB_LEFTBREAK: + pos--; + while (pos > 0 && !customWordBreakProc(text, pos, bytes, WB_ISDELIMITER)) + pos--; + return pos; + case WB_RIGHT: + case WB_MOVEWORDRIGHT: + if (customWordBreakProc(text, pos, bytes, WB_ISDELIMITER)) + return pos+1; + return min(customWordBreakProc(text, pos, bytes, WB_RIGHTBREAK)+1, length); + case WB_RIGHTBREAK: + pos++; + while (pos < length && !customWordBreakProc(text, pos, bytes, WB_ISDELIMITER)) + pos++; + return pos; + default: + ok(FALSE, "Unexpected code %d\n", code); + break; + } + return 0; +} + #define SEND_CTRL_LEFT(hwnd) pressKeyWithModifier(hwnd, VK_CONTROL, VK_LEFT) #define SEND_CTRL_RIGHT(hwnd) pressKeyWithModifier(hwnd, VK_CONTROL, VK_RIGHT) @@ -5297,6 +5599,7 @@ HWND hwnd; int result; int sel_start, sel_end; + const WCHAR textW[] = {'o','n','e',' ','t','w','o','X','t','h','r','e','e',0}; /* multi-line control inserts CR normally */ hwnd = new_richedit(NULL); @@ -5346,6 +5649,42 @@ ok(sel_start == sel_end, "Selection should be empty\n"); ok(sel_start == 9, "Cursor is at %d instead of %d\n", sel_start, 9); + /* Test with a custom word break procedure that uses X as the delimiter. */ + result = SendMessageA(hwnd, WM_SETTEXT, 0, (LPARAM)"one twoXthree"); + ok (result == TRUE, "Failed to clear the text.\n"); + SendMessage(hwnd, EM_SETWORDBREAKPROC, 0, (LPARAM)customWordBreakProc); + /* |one twoXthree */ + SEND_CTRL_RIGHT(hwnd); + /* one twoX|three */ + SendMessage(hwnd, EM_GETSEL, (WPARAM)&sel_start, (LPARAM)&sel_end); + ok(sel_start == sel_end, "Selection should be empty\n"); + ok(sel_start == 8, "Cursor is at %d instead of %d\n", sel_start, 8); + + DestroyWindow(hwnd); + + /* Make sure the behaviour is the same with a unicode richedit window, + * and using unicode functions. */ + if (is_win9x) + { + skip("Cannot test with unicode richedit window\n"); + return; + } + + hwnd = CreateWindowW(RICHEDIT_CLASS20W, NULL, + ES_MULTILINE|WS_POPUP|WS_HSCROLL|WS_VSCROLL|WS_VISIBLE, + 0, 0, 200, 60, NULL, NULL, hmoduleRichEdit, NULL); + + /* Test with a custom word break procedure that uses X as the delimiter. */ + result = SendMessageW(hwnd, WM_SETTEXT, 0, (LPARAM)textW); + ok (result == TRUE, "Failed to clear the text.\n"); + SendMessageW(hwnd, EM_SETWORDBREAKPROC, 0, (LPARAM)customWordBreakProc); + /* |one twoXthree */ + SEND_CTRL_RIGHT(hwnd); + /* one twoX|three */ + SendMessageW(hwnd, EM_GETSEL, (WPARAM)&sel_start, (LPARAM)&sel_end); + ok(sel_start == sel_end, "Selection should be empty\n"); + ok(sel_start == 8, "Cursor is at %d instead of %d\n", sel_start, 8); + DestroyWindow(hwnd); } @@ -5368,15 +5707,318 @@ DestroyWindow(hwnd); } +static void test_word_wrap(void) +{ + HWND hwnd; + POINTL point = {0, 60}; /* This point must be below the first line */ + const char *text = "Must be long enough to test line wrapping"; + DWORD dwCommonStyle = WS_VISIBLE|WS_POPUP|WS_VSCROLL|ES_MULTILINE; + int res, pos, lines; + + /* Test the effect of WS_HSCROLL and ES_AUTOHSCROLL styles on wrapping + * when specified on window creation and set later. */ + hwnd = CreateWindow(RICHEDIT_CLASS, NULL, dwCommonStyle, + 0, 0, 200, 80, NULL, NULL, hmoduleRichEdit, NULL); + ok(hwnd != NULL, "error: %d\n", (int) GetLastError()); + res = SendMessage(hwnd, WM_SETTEXT, 0, (LPARAM) text); + ok(res, "WM_SETTEXT failed.\n"); + pos = SendMessage(hwnd, EM_CHARFROMPOS, 0, (LPARAM) &point); + ok(pos, "pos=%d indicating no word wrap when it is expected.\n", pos); + lines = SendMessage(hwnd, EM_GETLINECOUNT, 0, 0); + ok(lines > 1, "Line was expected to wrap (lines=%d).\n", lines); + + SetWindowLongW(hwnd, GWL_STYLE, dwCommonStyle|WS_HSCROLL|ES_AUTOHSCROLL); + pos = SendMessage(hwnd, EM_CHARFROMPOS, 0, (LPARAM) &point); + ok(pos, "pos=%d indicating no word wrap when it is expected.\n", pos); + DestroyWindow(hwnd); + + hwnd = CreateWindow(RICHEDIT_CLASS, NULL, dwCommonStyle|WS_HSCROLL, + 0, 0, 200, 80, NULL, NULL, hmoduleRichEdit, NULL); + ok(hwnd != NULL, "error: %d\n", (int) GetLastError()); + + res = SendMessage(hwnd, WM_SETTEXT, 0, (LPARAM) text); + ok(res, "WM_SETTEXT failed.\n"); + pos = SendMessage(hwnd, EM_CHARFROMPOS, 0, (LPARAM) &point); + ok(!pos, "pos=%d indicating word wrap when none is expected.\n", pos); + lines = SendMessage(hwnd, EM_GETLINECOUNT, 0, 0); + ok(lines == 1, "Line wasn't expected to wrap (lines=%d).\n", lines); + + SetWindowLongW(hwnd, GWL_STYLE, dwCommonStyle); + pos = SendMessage(hwnd, EM_CHARFROMPOS, 0, (LPARAM) &point); + ok(!pos, "pos=%d indicating word wrap when none is expected.\n", pos); + DestroyWindow(hwnd); + + hwnd = CreateWindow(RICHEDIT_CLASS, NULL, dwCommonStyle|ES_AUTOHSCROLL, + 0, 0, 200, 80, NULL, NULL, hmoduleRichEdit, NULL); + ok(hwnd != NULL, "error: %d\n", (int) GetLastError()); + res = SendMessage(hwnd, WM_SETTEXT, 0, (LPARAM) text); + ok(res, "WM_SETTEXT failed.\n"); + pos = SendMessage(hwnd, EM_CHARFROMPOS, 0, (LPARAM) &point); + ok(!pos, "pos=%d indicating word wrap when none is expected.\n", pos); + + SetWindowLongW(hwnd, GWL_STYLE, dwCommonStyle); + pos = SendMessage(hwnd, EM_CHARFROMPOS, 0, (LPARAM) &point); + ok(!pos, "pos=%d indicating word wrap when none is expected.\n", pos); + DestroyWindow(hwnd); + + hwnd = CreateWindow(RICHEDIT_CLASS, NULL, + dwCommonStyle|WS_HSCROLL|ES_AUTOHSCROLL, + 0, 0, 200, 80, NULL, NULL, hmoduleRichEdit, NULL); + ok(hwnd != NULL, "error: %d\n", (int) GetLastError()); + res = SendMessage(hwnd, WM_SETTEXT, 0, (LPARAM) text); + ok(res, "WM_SETTEXT failed.\n"); + pos = SendMessage(hwnd, EM_CHARFROMPOS, 0, (LPARAM) &point); + ok(!pos, "pos=%d indicating word wrap when none is expected.\n", pos); + + SetWindowLongW(hwnd, GWL_STYLE, dwCommonStyle); + pos = SendMessage(hwnd, EM_CHARFROMPOS, 0, (LPARAM) &point); + ok(!pos, "pos=%d indicating word wrap when none is expected.\n", pos); + + /* Test the effect of EM_SETTARGETDEVICE on word wrap. */ + res = SendMessage(hwnd, EM_SETTARGETDEVICE, 0, 1); + todo_wine ok(res, "EM_SETTARGETDEVICE failed (returned %d).\n", res); + pos = SendMessage(hwnd, EM_CHARFROMPOS, 0, (LPARAM) &point); + ok(!pos, "pos=%d indicating word wrap when none is expected.\n", pos); + + res = SendMessage(hwnd, EM_SETTARGETDEVICE, 0, 0); + todo_wine ok(res, "EM_SETTARGETDEVICE failed (returned %d).\n", res); + pos = SendMessage(hwnd, EM_CHARFROMPOS, 0, (LPARAM) &point); + ok(pos, "pos=%d indicating no word wrap when it is expected.\n", pos); + DestroyWindow(hwnd); + + /* Test to see if wrapping happens with redraw disabled. */ + hwnd = CreateWindow(RICHEDIT_CLASS, NULL, dwCommonStyle, + 0, 0, 400, 80, NULL, NULL, hmoduleRichEdit, NULL); + ok(hwnd != NULL, "error: %d\n", (int) GetLastError()); + SendMessage(hwnd, WM_SETREDRAW, FALSE, 0); + res = SendMessage(hwnd, EM_REPLACESEL, FALSE, (LPARAM) text); + ok(res, "EM_REPLACESEL failed.\n"); + lines = SendMessage(hwnd, EM_GETLINECOUNT, 0, 0); + ok(lines == 1, "Line wasn't expected to wrap (lines=%d).\n", lines); + MoveWindow(hwnd, 0, 0, 200, 80, FALSE); + lines = SendMessage(hwnd, EM_GETLINECOUNT, 0, 0); + ok(lines > 1, "Line was expected to wrap (lines=%d).\n", lines); + + SendMessage(hwnd, WM_SETREDRAW, TRUE, 0); + DestroyWindow(hwnd); +} + +static void test_auto_yscroll(void) +{ + HWND hwnd = new_richedit(NULL); + int lines, ret, redraw; + POINT pt; + + for (redraw = 0; redraw <= 1; redraw++) { + trace("testing with WM_SETREDRAW=%d\n", redraw); + SendMessage(hwnd, WM_SETREDRAW, redraw, 0); + SendMessage(hwnd, EM_REPLACESEL, 0, (LPARAM)"1\n2\n3\n4\n5\n6\n7\n8"); + lines = SendMessage(hwnd, EM_GETLINECOUNT, 0, 0); + ok(lines == 8, "%d lines instead of 8\n", lines); + ret = SendMessage(hwnd, EM_GETSCROLLPOS, 0, (LPARAM)&pt); + ok(ret == 1, "EM_GETSCROLLPOS returned %d instead of 1\n", ret); + ok(pt.y != 0, "Didn't scroll down after replacing text.\n"); + ret = GetWindowLong(hwnd, GWL_STYLE); + ok(ret & WS_VSCROLL, "Scrollbar was not shown yet (style=%x).\n", (UINT)ret); + + SendMessage(hwnd, WM_SETTEXT, 0, 0); + lines = SendMessage(hwnd, EM_GETLINECOUNT, 0, 0); + ok(lines == 1, "%d lines instead of 1\n", lines); + ret = SendMessage(hwnd, EM_GETSCROLLPOS, 0, (LPARAM)&pt); + ok(ret == 1, "EM_GETSCROLLPOS returned %d instead of 1\n", ret); + ok(pt.y == 0, "y scroll position is %d after clearing text.\n", pt.y); + ret = GetWindowLong(hwnd, GWL_STYLE); + ok(!(ret & WS_VSCROLL), "Scrollbar is still shown (style=%x).\n", (UINT)ret); + } + + SendMessage(hwnd, WM_SETREDRAW, TRUE, 0); + DestroyWindow(hwnd); +} + + +static void test_format_rect(void) +{ + HWND hwnd; + RECT rc, expected, clientRect; + int n; + DWORD options; + + hwnd = CreateWindowEx(0, RICHEDIT_CLASS, NULL, + ES_MULTILINE|WS_POPUP|WS_HSCROLL|WS_VSCROLL|WS_VISIBLE, + 0, 0, 200, 60, NULL, NULL, hmoduleRichEdit, NULL); + ok(hwnd != NULL, "class: %s, error: %d\n", RICHEDIT_CLASS, (int) GetLastError()); + + GetClientRect(hwnd, &clientRect); + + expected = clientRect; + expected.left += 1; + expected.right -= 1; + SendMessageA(hwnd, EM_GETRECT, 0, (LPARAM)&rc); + ok(rc.top == expected.top && rc.left == expected.left && + rc.bottom == expected.bottom && rc.right == expected.right, + "rect a(t=%d, l=%d, b=%d, r=%d) != e(t=%d, l=%d, b=%d, r=%d)\n", + rc.top, rc.left, rc.bottom, rc.right, + expected.top, expected.left, expected.bottom, expected.right); + + for (n = -3; n <= 3; n++) + { + rc = clientRect; + rc.top += n; + rc.left += n; + rc.bottom -= n; + rc.right -= n; + SendMessageA(hwnd, EM_SETRECT, 0, (LPARAM)&rc); + + expected = rc; + expected.top = max(0, rc.top); + expected.left = max(0, rc.left); + expected.bottom = min(clientRect.bottom, rc.bottom); + expected.right = min(clientRect.right, rc.right); + SendMessageA(hwnd, EM_GETRECT, 0, (LPARAM)&rc); + ok(rc.top == expected.top && rc.left == expected.left && + rc.bottom == expected.bottom && rc.right == expected.right, + "[n=%d] rect a(t=%d, l=%d, b=%d, r=%d) != e(t=%d, l=%d, b=%d, r=%d)\n", + n, rc.top, rc.left, rc.bottom, rc.right, + expected.top, expected.left, expected.bottom, expected.right); + } + + rc = clientRect; + SendMessageA(hwnd, EM_SETRECT, 0, (LPARAM)&rc); + expected = clientRect; + SendMessageA(hwnd, EM_GETRECT, 0, (LPARAM)&rc); + ok(rc.top == expected.top && rc.left == expected.left && + rc.bottom == expected.bottom && rc.right == expected.right, + "rect a(t=%d, l=%d, b=%d, r=%d) != e(t=%d, l=%d, b=%d, r=%d)\n", + rc.top, rc.left, rc.bottom, rc.right, + expected.top, expected.left, expected.bottom, expected.right); + + /* Adding the selectionbar adds the selectionbar width to the left side. */ + SendMessageA(hwnd, EM_SETOPTIONS, ECOOP_OR, ECO_SELECTIONBAR); + options = SendMessageA(hwnd, EM_GETOPTIONS, 0, 0); + ok(options & ECO_SELECTIONBAR, "EM_SETOPTIONS failed to add selectionbar.\n"); + expected.left += 8; /* selection bar width */ + SendMessageA(hwnd, EM_GETRECT, 0, (LPARAM)&rc); + ok(rc.top == expected.top && rc.left == expected.left && + rc.bottom == expected.bottom && rc.right == expected.right, + "rect a(t=%d, l=%d, b=%d, r=%d) != e(t=%d, l=%d, b=%d, r=%d)\n", + rc.top, rc.left, rc.bottom, rc.right, + expected.top, expected.left, expected.bottom, expected.right); + + rc = clientRect; + SendMessageA(hwnd, EM_SETRECT, 0, (LPARAM)&rc); + expected = clientRect; + SendMessageA(hwnd, EM_GETRECT, 0, (LPARAM)&rc); + ok(rc.top == expected.top && rc.left == expected.left && + rc.bottom == expected.bottom && rc.right == expected.right, + "rect a(t=%d, l=%d, b=%d, r=%d) != e(t=%d, l=%d, b=%d, r=%d)\n", + rc.top, rc.left, rc.bottom, rc.right, + expected.top, expected.left, expected.bottom, expected.right); + + /* Removing the selectionbar subtracts the selectionbar width from the left side, + * even if the left side is already 0. */ + SendMessageA(hwnd, EM_SETOPTIONS, ECOOP_AND, ~ECO_SELECTIONBAR); + options = SendMessageA(hwnd, EM_GETOPTIONS, 0, 0); + ok(!(options & ECO_SELECTIONBAR), "EM_SETOPTIONS failed to remove selectionbar.\n"); + expected.left -= 8; /* selection bar width */ + SendMessageA(hwnd, EM_GETRECT, 0, (LPARAM)&rc); + ok(rc.top == expected.top && rc.left == expected.left && + rc.bottom == expected.bottom && rc.right == expected.right, + "rect a(t=%d, l=%d, b=%d, r=%d) != e(t=%d, l=%d, b=%d, r=%d)\n", + rc.top, rc.left, rc.bottom, rc.right, + expected.top, expected.left, expected.bottom, expected.right); + + /* Set the absolute value of the formatting rectangle. */ + rc = clientRect; + SendMessageA(hwnd, EM_SETRECT, 0, (LPARAM)&rc); + expected = clientRect; + SendMessageA(hwnd, EM_GETRECT, 0, (LPARAM)&rc); + ok(rc.top == expected.top && rc.left == expected.left && + rc.bottom == expected.bottom && rc.right == expected.right, + "[n=%d] rect a(t=%d, l=%d, b=%d, r=%d) != e(t=%d, l=%d, b=%d, r=%d)\n", + n, rc.top, rc.left, rc.bottom, rc.right, + expected.top, expected.left, expected.bottom, expected.right); + + /* MSDN documents the EM_SETRECT message as using the rectangle provided in + * LPARAM as being a relative offset when the WPARAM value is 1, but these + * tests show that this isn't true. */ + rc.top = 15; + rc.left = 15; + rc.bottom = clientRect.bottom - 15; + rc.right = clientRect.right - 15; + expected = rc; + SendMessageA(hwnd, EM_SETRECT, 1, (LPARAM)&rc); + SendMessageA(hwnd, EM_GETRECT, 0, (LPARAM)&rc); + ok(rc.top == expected.top && rc.left == expected.left && + rc.bottom == expected.bottom && rc.right == expected.right, + "rect a(t=%d, l=%d, b=%d, r=%d) != e(t=%d, l=%d, b=%d, r=%d)\n", + rc.top, rc.left, rc.bottom, rc.right, + expected.top, expected.left, expected.bottom, expected.right); + + /* For some reason it does not limit the values to the client rect with + * a WPARAM value of 1. */ + rc.top = -15; + rc.left = -15; + rc.bottom = clientRect.bottom + 15; + rc.right = clientRect.right + 15; + expected = rc; + SendMessageA(hwnd, EM_SETRECT, 1, (LPARAM)&rc); + SendMessageA(hwnd, EM_GETRECT, 0, (LPARAM)&rc); + ok(rc.top == expected.top && rc.left == expected.left && + rc.bottom == expected.bottom && rc.right == expected.right, + "rect a(t=%d, l=%d, b=%d, r=%d) != e(t=%d, l=%d, b=%d, r=%d)\n", + rc.top, rc.left, rc.bottom, rc.right, + expected.top, expected.left, expected.bottom, expected.right); + + DestroyWindow(hwnd); + + /* The extended window style affects the formatting rectangle. */ + hwnd = CreateWindowEx(WS_EX_CLIENTEDGE, RICHEDIT_CLASS, NULL, + ES_MULTILINE|WS_POPUP|WS_HSCROLL|WS_VSCROLL|WS_VISIBLE, + 0, 0, 200, 60, NULL, NULL, hmoduleRichEdit, NULL); + ok(hwnd != NULL, "class: %s, error: %d\n", RICHEDIT_CLASS, (int) GetLastError()); + + GetClientRect(hwnd, &clientRect); + + expected = clientRect; + expected.left += 1; + expected.top += 1; + expected.right -= 1; + SendMessageA(hwnd, EM_GETRECT, 0, (LPARAM)&rc); + ok(rc.top == expected.top && rc.left == expected.left && + rc.bottom == expected.bottom && rc.right == expected.right, + "rect a(t=%d, l=%d, b=%d, r=%d) != e(t=%d, l=%d, b=%d, r=%d)\n", + rc.top, rc.left, rc.bottom, rc.right, + expected.top, expected.left, expected.bottom, expected.right); + + rc = clientRect; + rc.top += 5; + rc.left += 5; + rc.bottom -= 5; + rc.right -= 5; + expected = rc; + expected.top -= 1; + expected.left -= 1; + expected.right += 1; + SendMessageA(hwnd, EM_SETRECT, 0, (LPARAM)&rc); + SendMessageA(hwnd, EM_GETRECT, 0, (LPARAM)&rc); + ok(rc.top == expected.top && rc.left == expected.left && + rc.bottom == expected.bottom && rc.right == expected.right, + "rect a(t=%d, l=%d, b=%d, r=%d) != e(t=%d, l=%d, b=%d, r=%d)\n", + rc.top, rc.left, rc.bottom, rc.right, + expected.top, expected.left, expected.bottom, expected.right); + + DestroyWindow(hwnd); +} + START_TEST( editor ) { - MSG msg; - time_t end; - /* Must explicitly LoadLibrary(). The test has no references to functions in * RICHED20.DLL, so the linker doesn't actually link to it. */ hmoduleRichEdit = LoadLibrary("RICHED20.DLL"); ok(hmoduleRichEdit != NULL, "error: %d\n", (int) GetLastError()); + + is_win9x = GetVersion() & 0x80000000; + test_WM_CHAR(); test_EM_FINDTEXT(); test_EM_GETLINE(); @@ -5418,22 +6060,15 @@ test_word_movement(); test_EM_CHARFROMPOS(); test_SETPARAFORMAT(); + test_word_wrap(); + test_auto_yscroll(); + test_format_rect(); /* Set the environment variable WINETEST_RICHED20 to keep windows * responsive and open for 30 seconds. This is useful for debugging. - * - * The message pump uses PeekMessage() to empty the queue and then sleeps for - * 50ms before retrying the queue. */ - end = time(NULL) + 30; + */ if (getenv( "WINETEST_RICHED20" )) { - while (time(NULL) < end) { - if (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) { - TranslateMessage(&msg); - DispatchMessage(&msg); - } else { - Sleep(50); - } - } + keep_responsive(30); } OleFlushClipboard(); Modified: trunk/rostests/winetests/riched20/riched20.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/riched20/riched…
============================================================================== --- trunk/rostests/winetests/riched20/riched20.rbuild [iso-8859-1] (original) +++ trunk/rostests/winetests/riched20/riched20.rbuild [iso-8859-1] Mon Dec 29 02:27:52 2008 @@ -7,6 +7,7 @@ <file>editor.c</file> <file>richole.c</file> <file>testlist.c</file> + <file>txtsrv.c</file> <library>wine</library> <library>uuid</library> <library>ole32</library> Modified: trunk/rostests/winetests/riched20/testlist.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/riched20/testli…
============================================================================== --- trunk/rostests/winetests/riched20/testlist.c [iso-8859-1] (original) +++ trunk/rostests/winetests/riched20/testlist.c [iso-8859-1] Mon Dec 29 02:27:52 2008 @@ -6,8 +6,12 @@ #define STANDALONE #include "wine/test.h" +extern void func_editor(void); +extern void func_txtsrv(void); const struct test winetest_testlist[] = { + { "editor", func_editor }, + { "txtsrv", func_txtsrv }, { 0, 0 } }; Added: trunk/rostests/winetests/riched20/txtsrv.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/riched20/txtsrv…
============================================================================== --- trunk/rostests/winetests/riched20/txtsrv.c (added) +++ trunk/rostests/winetests/riched20/txtsrv.c [iso-8859-1] Mon Dec 29 02:27:52 2008 @@ -1,0 +1,662 @@ +/* + * Unit test suite for windowless rich edit controls + * + * Copyright 2008 Maarten Lankhorst + * Copyright 2008 Austin Lund + * Copyright 2008 Dylan Smith + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#define COBJMACROS + +#include <stdio.h> +#include <stdarg.h> +#include <windef.h> +#include <winbase.h> +#include <objbase.h> +#include <richedit.h> +#include <initguid.h> +#include <textserv.h> +#include <wine/test.h> + +static HMODULE hmoduleRichEdit; + +/* Define C Macros for ITextServices calls. */ + +/* Use a special table for x86 machines to convert the thiscall + * calling convention. This isn't needed on other platforms. */ +#ifdef __i386__ +#define TXTSERV_VTABLE(This) (&itextServicesStdcallVtbl) +#else /* __i386__ */ +#define TXTSERV_VTABLE(This) (This)->lpVtbl +#endif /* __i386__ */ + +#define ITextServices_TxSendMessage(This,a,b,c,d) TXTSERV_VTABLE(This)->TxSendMessage(This,a,b,c,d) +#define ITextServices_TxDraw(This,a,b,c,d,e,f,g,h,i,j,k,l) TXTSERV_VTABLE(This)->TxDraw(This,a,b,c,d,e,f,g,h,i,j,k,l) +#define ITextServices_TxGetHScroll(This,a,b,c,d,e) TXTSERV_VTABLE(This)->TxGetHScroll(This,a,b,c,d,e) +#define ITextServices_TxGetVScroll(This,a,b,c,d,e) TXTSERV_VTABLE(This)->TxGetVScroll(This,a,b,c,d,e) +#define ITextServices_OnTxSetCursor(This,a,b,c,d,e,f,g,h,i) TXTSERV_VTABLE(This)->OnTxSetCursor(This,a,b,c,d,e,f,g,h,i) +#define ITextServices_TxQueryHitPoint(This,a,b,c,d,e,f,g,h,i,j) TXTSERV_VTABLE(This)->TxQueryHitPoint(This,a,b,c,d,e,f,g,h,i,j) +#define ITextServices_OnTxInplaceActivate(This,a) TXTSERV_VTABLE(This)->OnTxInplaceActivate(This,a) +#define ITextServices_OnTxInplaceDeactivate(This) TXTSERV_VTABLE(This)->OnTxInplaceDeactivate(This) +#define ITextServices_OnTxUIActivate(This) TXTSERV_VTABLE(This)->OnTxUIActivate(This) +#define ITextServices_OnTxUIDeactivate(This) TXTSERV_VTABLE(This)->OnTxUIDeactivate(This) +#define ITextServices_TxGetText(This,a) TXTSERV_VTABLE(This)->TxGetText(This,a) +#define ITextServices_TxSetText(This,a) TXTSERV_VTABLE(This)->TxSetText(This,a) +#define ITextServices_TxGetCurrentTargetX(This,a) TXTSERV_VTABLE(This)->TxGetCurrentTargetX(This,a) +#define ITextServices_TxGetBaseLinePos(This,a) TXTSERV_VTABLE(This)->TxGetBaseLinePos(This,a) +#define ITextServices_TxGetNaturalSize(This,a,b,c,d,e,f,g,h) TXTSERV_VTABLE(This)->TxGetNaturalSize(This,a,b,c,d,e,f,g,h) +#define ITextServices_TxGetDropTarget(This,a) TXTSERV_VTABLE(This)->TxGetDropTarget(This,a) +#define ITextServices_OnTxPropertyBitsChange(This,a,b) TXTSERV_VTABLE(This)->OnTxPropertyBitsChange(This,a,b) +#define ITextServices_TxGetCachedSize(This,a,b) TXTSERV_VTABLE(This)->TxGetCachedSize(This,a,b) + +/* Set the WINETEST_DEBUG environment variable to be greater than 1 for verbose + * function call traces of ITextHost. */ +#define TRACECALL if(winetest_debug > 1) trace + +/************************************************************************/ +/* ITextHost implementation for conformance testing. */ + +typedef struct ITextHostTestImpl +{ + ITextHostVtbl *lpVtbl; + LONG refCount; +} ITextHostTestImpl; + +static HRESULT WINAPI ITextHostImpl_QueryInterface(ITextHost *iface, + REFIID riid, + LPVOID *ppvObject) +{ + ITextHostTestImpl *This = (ITextHostTestImpl *)iface; + + if (IsEqualIID(riid, &IID_IUnknown) || IsEqualIID(riid, &IID_ITextHost)) { + *ppvObject = This; + ITextHost_AddRef((ITextHost *)*ppvObject); + return S_OK; + } + + return E_NOINTERFACE; +} + +static ULONG WINAPI ITextHostImpl_AddRef(ITextHost *iface) +{ + ITextHostTestImpl *This = (ITextHostTestImpl *)iface; + ULONG refCount = InterlockedIncrement(&This->refCount); + return refCount; +} + +static ULONG WINAPI ITextHostImpl_Release(ITextHost *iface) +{ + ITextHostTestImpl *This = (ITextHostTestImpl *)iface; + ULONG refCount = InterlockedDecrement(&This->refCount); + + if (!refCount) + { + CoTaskMemFree(This); + return 0; + } else { + return refCount; + } +} + +static HDC WINAPI ITextHostImpl_TxGetDC(ITextHost *iface) +{ + ITextHostTestImpl *This = (ITextHostTestImpl *)iface; + TRACECALL("Call to TxGetDC(%p)\n", This); + return NULL; +} + +static INT WINAPI ITextHostImpl_TxReleaseDC(ITextHost *iface, + HDC hdc) +{ + ITextHostTestImpl *This = (ITextHostTestImpl *)iface; + TRACECALL("Call to TxReleaseDC(%p)\n", This); + return 0; +} + +static BOOL WINAPI ITextHostImpl_TxShowScrollBar(ITextHost *iface, + INT fnBar, + BOOL fShow) +{ + ITextHostTestImpl *This = (ITextHostTestImpl *)iface; + TRACECALL("Call to TxShowScrollBar(%p, fnBar=%d, fShow=%d)\n", + This, fnBar, fShow); + return FALSE; +} + +static BOOL WINAPI ITextHostImpl_TxEnableScrollBar(ITextHost *iface, + INT fuSBFlags, + INT fuArrowflags) +{ + ITextHostTestImpl *This = (ITextHostTestImpl *)iface; + TRACECALL("Call to TxEnableScrollBar(%p, fuSBFlags=%d, fuArrowflags=%d)\n", + This, fuSBFlags, fuArrowflags); + return FALSE; +} + +static BOOL WINAPI ITextHostImpl_TxSetScrollRange(ITextHost *iface, + INT fnBar, + LONG nMinPos, + INT nMaxPos, + BOOL fRedraw) +{ + ITextHostTestImpl *This = (ITextHostTestImpl *)iface; + TRACECALL("Call to TxSetScrollRange(%p, fnBar=%d, nMinPos=%d, nMaxPos=%d, fRedraw=%d)\n", + This, fnBar, nMinPos, nMaxPos, fRedraw); + return FALSE; +} + +static BOOL WINAPI ITextHostImpl_TxSetScrollPos(ITextHost *iface, + INT fnBar, + INT nPos, + BOOL fRedraw) +{ + ITextHostTestImpl *This = (ITextHostTestImpl *)iface; + TRACECALL("Call to TxSetScrollPos(%p, fnBar=%d, nPos=%d, fRedraw=%d)\n", + This, fnBar, nPos, fRedraw); + return FALSE; +} + +static void WINAPI ITextHostImpl_TxInvalidateRect(ITextHost *iface, + LPCRECT prc, + BOOL fMode) +{ + ITextHostTestImpl *This = (ITextHostTestImpl *)iface; + TRACECALL("Call to TxInvalidateRect(%p, prc=%p, fMode=%d)\n", + This, prc, fMode); +} + +static void WINAPI ITextHostImpl_TxViewChange(ITextHost *iface, BOOL fUpdate) +{ + ITextHostTestImpl *This = (ITextHostTestImpl *)iface; + TRACECALL("Call to TxViewChange(%p, fUpdate=%d)\n", + This, fUpdate); +} + +static BOOL WINAPI ITextHostImpl_TxCreateCaret(ITextHost *iface, + HBITMAP hbmp, + INT xWidth, INT yHeight) +{ + ITextHostTestImpl *This = (ITextHostTestImpl *)iface; + TRACECALL("Call to TxCreateCaret(%p, nbmp=%p, xWidth=%d, yHeight=%d)\n", + This, hbmp, xWidth, yHeight); + return FALSE; +} + +static BOOL WINAPI ITextHostImpl_TxShowCaret(ITextHost *iface, BOOL fShow) +{ + ITextHostTestImpl *This = (ITextHostTestImpl *)iface; + TRACECALL("Call to TxShowCaret(%p, fShow=%d)\n", + This, fShow); + return FALSE; +} + +static BOOL WINAPI ITextHostImpl_TxSetCaretPos(ITextHost *iface, + INT x, INT y) +{ + ITextHostTestImpl *This = (ITextHostTestImpl *)iface; + TRACECALL("Call to TxSetCaretPos(%p, x=%d, y=%d)\n", This, x, y); + return FALSE; +} + +static BOOL WINAPI ITextHostImpl_TxSetTimer(ITextHost *iface, + UINT idTimer, UINT uTimeout) +{ + ITextHostTestImpl *This = (ITextHostTestImpl *)iface; + TRACECALL("Call to TxSetTimer(%p, idTimer=%u, uTimeout=%u)\n", + This, idTimer, uTimeout); + return FALSE; +} + +static void WINAPI ITextHostImpl_TxKillTimer(ITextHost *iface, UINT idTimer) +{ + ITextHostTestImpl *This = (ITextHostTestImpl *)iface; + TRACECALL("Call to TxKillTimer(%p, idTimer=%u)\n", This, idTimer); +} + +static void WINAPI ITextHostImpl_TxScrollWindowEx(ITextHost *iface, + INT dx, INT dy, + LPCRECT lprcScroll, + LPCRECT lprcClip, + HRGN hRgnUpdate, + LPRECT lprcUpdate, + UINT fuScroll) +{ + ITextHostTestImpl *This = (ITextHostTestImpl *)iface; + TRACECALL("Call to TxScrollWindowEx(%p, %d, %d, %p, %p, %p, %p, %d)\n", + This, dx, dy, lprcScroll, lprcClip, hRgnUpdate, lprcUpdate, fuScroll); +} + +static void WINAPI ITextHostImpl_TxSetCapture(ITextHost *iface, BOOL fCapture) +{ + ITextHostTestImpl *This = (ITextHostTestImpl *)iface; + TRACECALL("Call to TxSetCapture(%p, fCapture=%d)\n", This, fCapture); +} + +static void WINAPI ITextHostImpl_TxSetFocus(ITextHost *iface) +{ + ITextHostTestImpl *This = (ITextHostTestImpl *)iface; + TRACECALL("Call to TxSetFocus(%p)\n", This); +} + +static void WINAPI ITextHostImpl_TxSetCursor(ITextHost *iface, + HCURSOR hcur, + BOOL fText) +{ + ITextHostTestImpl *This = (ITextHostTestImpl *)iface; + TRACECALL("Call to TxSetCursor(%p, hcur=%p, fText=%d)\n", + This, hcur, fText); +} + +static BOOL WINAPI ITextHostImpl_TxScreenToClient(ITextHost *iface, + LPPOINT lppt) +{ + ITextHostTestImpl *This = (ITextHostTestImpl *)iface; + TRACECALL("Call to TxScreenToClient(%p, lppt=%p)\n", This, lppt); + return FALSE; +} + +static BOOL WINAPI ITextHostImpl_TxClientToScreen(ITextHost *iface, + LPPOINT lppt) +{ + ITextHostTestImpl *This = (ITextHostTestImpl *)iface; + TRACECALL("Call to TxClientToScreen(%p, lppt=%p)\n", This, lppt); + return FALSE; +} + +static HRESULT WINAPI ITextHostImpl_TxActivate(ITextHost *iface, + LONG *plOldState) +{ + ITextHostTestImpl *This = (ITextHostTestImpl *)iface; + TRACECALL("Call to TxActivate(%p, plOldState=%p)\n", This, plOldState); + return E_NOTIMPL; +} + +static HRESULT WINAPI ITextHostImpl_TxDeactivate(ITextHost *iface, + LONG lNewState) +{ + ITextHostTestImpl *This = (ITextHostTestImpl *)iface; + TRACECALL("Call to TxDeactivate(%p, lNewState=%d)\n", This, lNewState); + return E_NOTIMPL; +} + +static HRESULT WINAPI ITextHostImpl_TxGetClientRect(ITextHost *iface, + LPRECT prc) +{ + ITextHostTestImpl *This = (ITextHostTestImpl *)iface; + TRACECALL("Call to TxGetClientRect(%p, prc=%p)\n", This, prc); + return E_NOTIMPL; +} + +static HRESULT WINAPI ITextHostImpl_TxGetViewInset(ITextHost *iface, + LPRECT prc) +{ + ITextHostTestImpl *This = (ITextHostTestImpl *)iface; + TRACECALL("Call to TxGetViewInset(%p, prc=%p)\n", This, prc); + return E_NOTIMPL; +} + +static HRESULT WINAPI ITextHostImpl_TxGetCharFormat(ITextHost *iface, + const CHARFORMATW **ppCF) +{ + ITextHostTestImpl *This = (ITextHostTestImpl *)iface; + TRACECALL("Call to TxGetCharFormat(%p, ppCF=%p)\n", This, ppCF); + return E_NOTIMPL; +} + +static HRESULT WINAPI ITextHostImpl_TxGetParaFormat(ITextHost *iface, + const PARAFORMAT **ppPF) +{ + ITextHostTestImpl *This = (ITextHostTestImpl *)iface; + TRACECALL("Call to TxGetParaFormat(%p, ppPF=%p)\n", This, ppPF); + return E_NOTIMPL; +} + +static COLORREF WINAPI ITextHostImpl_TxGetSysColor(ITextHost *iface, + int nIndex) +{ + ITextHostTestImpl *This = (ITextHostTestImpl *)iface; + TRACECALL("Call to TxGetSysColor(%p, nIndex=%d)\n", This, nIndex); + return E_NOTIMPL; +} + +static HRESULT WINAPI ITextHostImpl_TxGetBackStyle(ITextHost *iface, + TXTBACKSTYLE *pStyle) +{ + ITextHostTestImpl *This = (ITextHostTestImpl *)iface; + TRACECALL("Call to TxGetBackStyle(%p, pStyle=%p)\n", This, pStyle); + return E_NOTIMPL; +} + +static HRESULT WINAPI ITextHostImpl_TxGetMaxLength(ITextHost *iface, + DWORD *pLength) +{ + ITextHostTestImpl *This = (ITextHostTestImpl *)iface; + TRACECALL("Call to TxGetMaxLength(%p, pLength=%p)\n", This, pLength); + return E_NOTIMPL; +} + +static HRESULT WINAPI ITextHostImpl_TxGetScrollBars(ITextHost *iface, + DWORD *pdwScrollBar) +{ + ITextHostTestImpl *This = (ITextHostTestImpl *)iface; + TRACECALL("Call to TxGetScrollBars(%p, pdwScrollBar=%p)\n", + This, pdwScrollBar); + return E_NOTIMPL; +} + +static HRESULT WINAPI ITextHostImpl_TxGetPasswordChar(ITextHost *iface, + WCHAR *pch) +{ + ITextHostTestImpl *This = (ITextHostTestImpl *)iface; + TRACECALL("Call to TxGetPasswordChar(%p, pch=%p)\n", This, pch); + return E_NOTIMPL; +} + +static HRESULT WINAPI ITextHostImpl_TxGetAcceleratorPos(ITextHost *iface, + LONG *pch) +{ + ITextHostTestImpl *This = (ITextHostTestImpl *)iface; + TRACECALL("Call to TxGetAcceleratorPos(%p, pch=%p)\n", This, pch); + return E_NOTIMPL; +} + +static HRESULT WINAPI ITextHostImpl_TxGetExtent(ITextHost *iface, + LPSIZEL lpExtent) +{ + ITextHostTestImpl *This = (ITextHostTestImpl *)iface; + TRACECALL("Call to TxGetExtent(%p, lpExtent=%p)\n", This, lpExtent); + return E_NOTIMPL; +} + +static HRESULT WINAPI ITextHostImpl_OnTxCharFormatChange(ITextHost *iface, + const CHARFORMATW *pcf) +{ + ITextHostTestImpl *This = (ITextHostTestImpl *)iface; + TRACECALL("Call to OnTxCharFormatChange(%p, pcf=%p)\n", This, pcf); + return E_NOTIMPL; +} + +static HRESULT WINAPI ITextHostImpl_OnTxParaFormatChange(ITextHost *iface, + const PARAFORMAT *ppf) +{ + ITextHostTestImpl *This = (ITextHostTestImpl *)iface; + TRACECALL("Call to OnTxParaFormatChange(%p, ppf=%p)\n", This, ppf); + return E_NOTIMPL; +} + +/* This must return S_OK for the native ITextServices object to + initialize. */ +static HRESULT WINAPI ITextHostImpl_TxGetPropertyBits(ITextHost *iface, + DWORD dwMask, + DWORD *pdwBits) +{ + ITextHostTestImpl *This = (ITextHostTestImpl *)iface; + TRACECALL("Call to TxGetPropertyBits(%p, dwMask=0x%08x, pdwBits=%p)\n", + This, dwMask, pdwBits); + *pdwBits = 0; + return S_OK; +} + +static HRESULT WINAPI ITextHostImpl_TxNotify(ITextHost *iface, DWORD iNotify, + void *pv) +{ + ITextHostTestImpl *This = (ITextHostTestImpl *)iface; + TRACECALL("Call to TxNotify(%p, iNotify=%d, pv=%p)\n", This, iNotify, pv); + return E_NOTIMPL; +} + +static HIMC WINAPI ITextHostImpl_TxImmGetContext(ITextHost *iface) +{ + ITextHostTestImpl *This = (ITextHostTestImpl *)iface; + TRACECALL("Call to TxImmGetContext(%p)\n", This); + return 0; +} + +static void WINAPI ITextHostImpl_TxImmReleaseContext(ITextHost *iface, HIMC himc) +{ + ITextHostTestImpl *This = (ITextHostTestImpl *)iface; + TRACECALL("Call to TxImmReleaseContext(%p, himc=%p)\n", This, himc); +} + +static HRESULT WINAPI ITextHostImpl_TxGetSelectionBarWidth(ITextHost *iface, + LONG *lSelBarWidth) +{ + ITextHostTestImpl *This = (ITextHostTestImpl *)iface; + TRACECALL("Call to TxGetSelectionBarWidth(%p, lSelBarWidth=%p)\n", + This, lSelBarWidth); + return E_NOTIMPL; +} + +static ITextServicesVtbl itextServicesStdcallVtbl; + +static ITextHostVtbl itextHostVtbl = { + ITextHostImpl_QueryInterface, + ITextHostImpl_AddRef, + ITextHostImpl_Release, + ITextHostImpl_TxGetDC, + ITextHostImpl_TxReleaseDC, + ITextHostImpl_TxShowScrollBar, + ITextHostImpl_TxEnableScrollBar, + ITextHostImpl_TxSetScrollRange, + ITextHostImpl_TxSetScrollPos, + ITextHostImpl_TxInvalidateRect, + ITextHostImpl_TxViewChange, + ITextHostImpl_TxCreateCaret, + ITextHostImpl_TxShowCaret, + ITextHostImpl_TxSetCaretPos, + ITextHostImpl_TxSetTimer, + ITextHostImpl_TxKillTimer, + ITextHostImpl_TxScrollWindowEx, + ITextHostImpl_TxSetCapture, + ITextHostImpl_TxSetFocus, + ITextHostImpl_TxSetCursor, + ITextHostImpl_TxScreenToClient, + ITextHostImpl_TxClientToScreen, + ITextHostImpl_TxActivate, + ITextHostImpl_TxDeactivate, + ITextHostImpl_TxGetClientRect, + ITextHostImpl_TxGetViewInset, + ITextHostImpl_TxGetCharFormat, + ITextHostImpl_TxGetParaFormat, + ITextHostImpl_TxGetSysColor, + ITextHostImpl_TxGetBackStyle, + ITextHostImpl_TxGetMaxLength, + ITextHostImpl_TxGetScrollBars, + ITextHostImpl_TxGetPasswordChar, + ITextHostImpl_TxGetAcceleratorPos, + ITextHostImpl_TxGetExtent, + ITextHostImpl_OnTxCharFormatChange, + ITextHostImpl_OnTxParaFormatChange, + ITextHostImpl_TxGetPropertyBits, + ITextHostImpl_TxNotify, + ITextHostImpl_TxImmGetContext, + ITextHostImpl_TxImmReleaseContext, + ITextHostImpl_TxGetSelectionBarWidth +}; + +static ITextServices *txtserv = NULL; +static ITextHostTestImpl *dummyTextHost; +static void *wrapperCodeMem = NULL; + +#include "pshpack1.h" + +/* Code structure for x86 byte code */ +typedef struct +{ + BYTE pop_eax; /* popl %eax */ + BYTE push_ecx; /* pushl %ecx */ + BYTE push_eax; /* pushl %eax */ + BYTE jmp_func; /* jmp $func */ + DWORD func; +} THISCALL_TO_STDCALL_THUNK; + +typedef struct +{ + BYTE pop_eax; /* popl %eax */ + BYTE pop_ecx; /* popl %ecx */ + BYTE push_eax; /* pushl %eax */ + BYTE mov_vtable_eax[2]; /* movl (%ecx), %eax */ + BYTE jmp_eax[2]; /* jmp *$vtablefunc_offset(%eax) */ + int vtablefunc_offset; +} STDCALL_TO_THISCALL_THUNK; + +#include "poppack.h" + +static void setup_thiscall_wrappers(void) +{ +#ifdef __i386__ + void** pVtable; + void** pVtableEnd; + THISCALL_TO_STDCALL_THUNK *thunk; + STDCALL_TO_THISCALL_THUNK *thunk2; + + wrapperCodeMem = VirtualAlloc(NULL, + (sizeof(ITextHostVtbl)/sizeof(void*) - 3) + * sizeof(THISCALL_TO_STDCALL_THUNK) + +(sizeof(ITextServicesVtbl)/sizeof(void*) - 3) + * sizeof(STDCALL_TO_THISCALL_THUNK), + MEM_COMMIT, PAGE_EXECUTE_READWRITE); + thunk = wrapperCodeMem; + + /* Wrap all ITextHostImpl methods with code to perform a thiscall to + * stdcall conversion. The thiscall calling convention places the This + * pointer in ecx on the x86 platform, and the stdcall calling convention + * pushes the This pointer on the stack as the first argument. + * + * The byte code does the conversion then jumps to the real function. + * + * Each wrapper needs to be modified so that the function to jump to is + * modified in the byte code. */ + + /* Skip QueryInterface, AddRef, and Release native actually + * defined them with the stdcall calling convention. */ + pVtable = (void**)&itextHostVtbl + 3; + pVtableEnd = (void**)(&itextHostVtbl + 1); + while (pVtable != pVtableEnd) { + /* write byte code to executable memory */ + thunk->pop_eax = 0x58; /* popl %eax */ + thunk->push_ecx = 0x51; /* pushl %ecx */ + thunk->push_eax = 0x50; /* pushl %eax */ + thunk->jmp_func = 0xe9; /* jmp $func */ + /* The address needs to be relative to the end of the jump instructions. */ + thunk->func = (char*)*pVtable - (char*)(&thunk->func + 1); + *pVtable = thunk; + pVtable++; + thunk++; + } + + /* Setup an ITextServices standard call vtable that will call the + * native thiscall vtable when the methods are called. */ + + /* QueryInterface, AddRef, and Release should be called directly on the + * real vtable since they use the stdcall calling convention. */ + thunk2 = (STDCALL_TO_THISCALL_THUNK *)thunk; + pVtable = (void**)&itextServicesStdcallVtbl + 3; + pVtableEnd = (void**)(&itextServicesStdcallVtbl + 1); + while (pVtable != pVtableEnd) { + /* write byte code to executable memory */ + thunk2->pop_eax = 0x58; /* popl %eax */ + thunk2->pop_ecx = 0x59; /* popl %ecx */ + thunk2->push_eax = 0x50; /* pushl %eax */ + thunk2->mov_vtable_eax[0] = 0x8b; /* movl (%ecx), %eax */ + thunk2->mov_vtable_eax[1] = 0x01; + thunk2->jmp_eax[0] = 0xff; /* jmp *$vtablefunc_offset(%eax) */ + thunk2->jmp_eax[1] = 0xa0; + thunk2->vtablefunc_offset = (char*)pVtable - (char*)&itextServicesStdcallVtbl; + *pVtable = thunk2; + pVtable++; + thunk2++; + } +#endif /* __i386__ */ +} + +/*************************************************************************/ +/* Conformance test functions. */ + +/* Initialize the test texthost structure */ +static BOOL init_texthost(void) +{ + IUnknown *init; + HRESULT result; + PCreateTextServices pCreateTextServices; + + dummyTextHost = CoTaskMemAlloc(sizeof(*dummyTextHost)); + if (dummyTextHost == NULL) { + skip("Insufficient memory to create ITextHost interface\n"); + return FALSE; + } + dummyTextHost->lpVtbl = &itextHostVtbl; + dummyTextHost->refCount = 1; + + /* MSDN states that an IUnknown object is returned by + CreateTextServices which is then queried to obtain a + ITextServices object. */ + pCreateTextServices = (void*)GetProcAddress(hmoduleRichEdit, "CreateTextServices"); + result = (*pCreateTextServices)(NULL,(ITextHost*)dummyTextHost, &init); + ok(result == S_OK, "Did not return OK when created. Returned %x\n", result); + if (result != S_OK) { + CoTaskMemFree(dummyTextHost); + skip("CreateTextServices failed.\n"); + return FALSE; + } + + result = IUnknown_QueryInterface(init, &IID_ITextServices, + (void **)&txtserv); + ok((result == S_OK) && (txtserv != NULL), "Querying interface failed\n"); + IUnknown_Release(init); + if (!((result == S_OK) && (txtserv != NULL))) { + CoTaskMemFree(dummyTextHost); + skip("Could not retrieve ITextServices interface\n"); + return FALSE; + } + + return TRUE; +} + +static void test_TxGetText(void) +{ + HRESULT hres; + BSTR rettext; + + if (!init_texthost()) + return; + + hres = ITextServices_TxGetText(txtserv, &rettext); + todo_wine ok(hres == S_OK, "ITextServices_TxGetText failed\n"); + + IUnknown_Release(txtserv); + CoTaskMemFree(dummyTextHost); +} + +START_TEST( txtsrv ) +{ + setup_thiscall_wrappers(); + + /* Must explicitly LoadLibrary(). The test has no references to functions in + * RICHED20.DLL, so the linker doesn't actually link to it. */ + hmoduleRichEdit = LoadLibrary("RICHED20.DLL"); + ok(hmoduleRichEdit != NULL, "error: %d\n", (int) GetLastError()); + + if (init_texthost()) + { + IUnknown_Release(txtserv); + CoTaskMemFree(dummyTextHost); + + test_TxGetText(); + } + if (wrapperCodeMem) VirtualFree(wrapperCodeMem, 0, MEM_RELEASE); +} Propchange: trunk/rostests/winetests/riched20/txtsrv.c ------------------------------------------------------------------------------ svn:eol-style = native
15 years, 12 months
1
0
0
0
[cwittich] 38440: fix "Primary mouse button changes prematurely." See issue #3949 for more details.
by cwittich@svn.reactos.org
Author: cwittich Date: Mon Dec 29 01:14:35 2008 New Revision: 38440 URL:
http://svn.reactos.org/svn/reactos?rev=38440&view=rev
Log: fix "Primary mouse button changes prematurely." See issue #3949 for more details. Modified: trunk/reactos/dll/cpl/main/mouse.c Modified: trunk/reactos/dll/cpl/main/mouse.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/main/mouse.c?rev=3…
============================================================================== --- trunk/reactos/dll/cpl/main/mouse.c [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/main/mouse.c [iso-8859-1] Mon Dec 29 01:14:35 2008 @@ -333,7 +333,6 @@ SendMessage((HWND)lParam, BM_SETCHECK, (WPARAM)BST_CHECKED, (LPARAM)0); SendDlgItemMessage(hwndDlg, IDC_IMAGE_SWAP_MOUSE, STM_SETIMAGE, IMAGE_ICON, (LPARAM)pButtonData->hButtonRight); } - SystemParametersInfo(SPI_SETMOUSEBUTTONSWAP, pButtonData->g_SwapMouseButtons, NULL, 0); PropSheet_Changed(GetParent(hwndDlg), hwndDlg); break;
15 years, 12 months
1
0
0
0
[cwittich] 38439: fix doxygen @name for ExpSystemErrorHandler patch by <aspotashev at gmail.com> See issue #3963 for more details.
by cwittich@svn.reactos.org
Author: cwittich Date: Mon Dec 29 00:24:46 2008 New Revision: 38439 URL:
http://svn.reactos.org/svn/reactos?rev=38439&view=rev
Log: fix doxygen @name for ExpSystemErrorHandler patch by <aspotashev at
gmail.com
> See issue #3963 for more details. Modified: trunk/reactos/ntoskrnl/ex/harderr.c Modified: trunk/reactos/ntoskrnl/ex/harderr.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ex/harderr.c?rev=…
============================================================================== --- trunk/reactos/ntoskrnl/ex/harderr.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/ex/harderr.c [iso-8859-1] Mon Dec 29 00:24:46 2008 @@ -23,7 +23,7 @@ /* FUNCTIONS ****************************************************************/ /*++ -* @name ExpRaiseHardError +* @name ExpSystemErrorHandler * * For now it's a stub *
15 years, 12 months
1
0
0
0
[dgorbachev] 38438: Add Slovak koruna to Calculator, update Korean file. Patch by Mario Kacmar, with some modifications. Bug #3867.
by dgorbachev@svn.reactos.org
Author: dgorbachev Date: Sun Dec 28 21:53:13 2008 New Revision: 38438 URL:
http://svn.reactos.org/svn/reactos?rev=38438&view=rev
Log: Add Slovak koruna to Calculator, update Korean file. Patch by Mario Kacmar, with some modifications. Bug #3867. Modified: trunk/reactos/base/applications/calc/convert.c trunk/reactos/base/applications/calc/lang/bg-BG.rc trunk/reactos/base/applications/calc/lang/cs-CZ.rc trunk/reactos/base/applications/calc/lang/de-DE.rc trunk/reactos/base/applications/calc/lang/en-US.rc trunk/reactos/base/applications/calc/lang/es-ES.rc trunk/reactos/base/applications/calc/lang/it-IT.rc trunk/reactos/base/applications/calc/lang/ko-KR.rc trunk/reactos/base/applications/calc/lang/nl-NL.rc trunk/reactos/base/applications/calc/lang/no-NO.rc trunk/reactos/base/applications/calc/lang/pl-PL.rc trunk/reactos/base/applications/calc/lang/ru-RU.rc trunk/reactos/base/applications/calc/lang/sk-SK.rc trunk/reactos/base/applications/calc/lang/th-TH.rc trunk/reactos/base/applications/calc/lang/uk-UA.rc trunk/reactos/base/applications/calc/resource.h Modified: trunk/reactos/base/applications/calc/convert.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/calc/con…
============================================================================== --- trunk/reactos/base/applications/calc/convert.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/calc/convert.c [iso-8859-1] Sun Dec 28 21:53:13 2008 @@ -142,6 +142,7 @@ DECLARE_CONV_UNIT(CURRENCY, LUXEMBOURG_FRANC, "$/40,3399", "$*40,3399") DECLARE_CONV_UNIT(CURRENCY, MALTESE_LIRA, "$/0.42930", "$*0.42930") DECLARE_CONV_UNIT(CURRENCY, PORTOGUESE_ESCUDO, "$/200,482", "$*200,482") + DECLARE_CONV_UNIT(CURRENCY, SLOVAK_KORUNA, "$/30,126", "$*30,126") DECLARE_CONV_UNIT(CURRENCY, SLOVENIAN_TOLAR, "$/239,640", "$*239,640") DECLARE_CONV_UNIT(CURRENCY, SPANISH_PESETA, "$/166,386", "$*166,386") DECLARE_CONV_END Modified: trunk/reactos/base/applications/calc/lang/bg-BG.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/calc/lan…
============================================================================== --- trunk/reactos/base/applications/calc/lang/bg-BG.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/calc/lang/bg-BG.rc [iso-8859-1] Sun Dec 28 21:53:13 2008 @@ -522,6 +522,7 @@ IDS_CURRENCY_LUXEMBOURG_FRANC "Luxembourg franc" IDS_CURRENCY_MALTESE_LIRA "Maltese lira" IDS_CURRENCY_PORTOGUESE_ESCUDO "Portoguese escudo" + IDS_CURRENCY_SLOVAK_KORUNA "Slovak koruna" IDS_CURRENCY_SLOVENIAN_TOLAR "Slovenian tolar" IDS_CURRENCY_SPANISH_PESETA "Spanish peseta" END Modified: trunk/reactos/base/applications/calc/lang/cs-CZ.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/calc/lan…
============================================================================== --- trunk/reactos/base/applications/calc/lang/cs-CZ.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/calc/lang/cs-CZ.rc [iso-8859-1] Sun Dec 28 21:53:13 2008 @@ -1,6 +1,6 @@ /* FILE: base/applications/calc/lang/cs-CZ.rc * TRANSLATOR: Radek Liska aka Black_Fox (radekliska at gmail dot com) - * UPDATED: 2008-07-27 + * UPDATED: 2008-12-29 */ LANGUAGE LANG_CZECH, SUBLANG_DEFAULT @@ -523,6 +523,7 @@ IDS_CURRENCY_PORTOGUESE_ESCUDO "Portugalské escudo" IDS_CURRENCY_AUSTRIAN_SCHILLING "Rakouský ilink" IDS_CURRENCY_GREEK_DRACHMA "Øecká drachma" + IDS_CURRENCY_SLOVAK_KORUNA "Slovenská koruna" IDS_CURRENCY_SLOVENIAN_TOLAR "Slovinský tolar" IDS_CURRENCY_SPANISH_PESETA "panìlská peseta" END Modified: trunk/reactos/base/applications/calc/lang/de-DE.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/calc/lan…
============================================================================== --- trunk/reactos/base/applications/calc/lang/de-DE.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/calc/lang/de-DE.rc [iso-8859-1] Sun Dec 28 21:53:13 2008 @@ -521,6 +521,7 @@ IDS_CURRENCY_DUTCH_GUILDER "Niederländische Guilder" IDS_CURRENCY_AUSTRIAN_SCHILLING "Österreichische Schilling" IDS_CURRENCY_PORTOGUESE_ESCUDO "Portugiesische Escudo" + IDS_CURRENCY_SLOVAK_KORUNA "Slowakische Krone" IDS_CURRENCY_SLOVENIAN_TOLAR "Slovenische Tolar" IDS_CURRENCY_SPANISH_PESETA "Spanische Peseta" IDS_CURRENCY_CYPRIOT_POUND "Zypriotische Pfund" Modified: trunk/reactos/base/applications/calc/lang/en-US.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/calc/lan…
============================================================================== --- trunk/reactos/base/applications/calc/lang/en-US.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/calc/lang/en-US.rc [iso-8859-1] Sun Dec 28 21:53:13 2008 @@ -517,6 +517,7 @@ IDS_CURRENCY_LUXEMBOURG_FRANC "Luxembourg franc" IDS_CURRENCY_MALTESE_LIRA "Maltese lira" IDS_CURRENCY_PORTOGUESE_ESCUDO "Portoguese escudo" + IDS_CURRENCY_SLOVAK_KORUNA "Slovak koruna" IDS_CURRENCY_SLOVENIAN_TOLAR "Slovenian tolar" IDS_CURRENCY_SPANISH_PESETA "Spanish peseta" END Modified: trunk/reactos/base/applications/calc/lang/es-ES.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/calc/lan…
============================================================================== --- trunk/reactos/base/applications/calc/lang/es-ES.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/calc/lang/es-ES.rc [iso-8859-1] Sun Dec 28 21:53:13 2008 @@ -1,5 +1,5 @@ /* - *Spanish Language resource file + * Spanish Language resource file * Traducido por: Javier Remacha 2008 */ @@ -527,6 +527,7 @@ IDS_CURRENCY_LUXEMBOURG_FRANC "Franco Luxemburgués" IDS_CURRENCY_MALTESE_LIRA "Lira Maltesa" IDS_CURRENCY_PORTOGUESE_ESCUDO "Escudo Portugués" + IDS_CURRENCY_SLOVAK_KORUNA "Corona Eslovaca" IDS_CURRENCY_SLOVENIAN_TOLAR "Tolar Esloveno" IDS_CURRENCY_SPANISH_PESETA "Peseta Española" END Modified: trunk/reactos/base/applications/calc/lang/it-IT.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/calc/lan…
============================================================================== --- trunk/reactos/base/applications/calc/lang/it-IT.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/calc/lang/it-IT.rc [iso-8859-1] Sun Dec 28 21:53:13 2008 @@ -517,6 +517,7 @@ IDS_CURRENCY_LUXEMBOURG_FRANC "Franco Lussemburghese" IDS_CURRENCY_MALTESE_LIRA "Lira maltese" IDS_CURRENCY_PORTOGUESE_ESCUDO "Escudo portoghese" + IDS_CURRENCY_SLOVAK_KORUNA "Corona slovacca" IDS_CURRENCY_SLOVENIAN_TOLAR "Tallero sloveno" IDS_CURRENCY_SPANISH_PESETA "Peseta spagnola" END Modified: trunk/reactos/base/applications/calc/lang/ko-KR.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/calc/lan…
============================================================================== --- trunk/reactos/base/applications/calc/lang/ko-KR.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/calc/lang/ko-KR.rc [iso-8859-1] Sun Dec 28 21:53:13 2008 @@ -1,11 +1,13 @@ /* - *Korean translation by manatails007(www.manatails007.org) Seungju Kim + * Korean translation by manatails007 (
www.manatails007.org
) Seungju Kim */ + LANGUAGE LANG_KOREAN, SUBLANG_DEFAULT + // Dialog IDD_DIALOG_SCIENTIFIC DIALOGEX 0, 0, 316, 161 -STYLE DS_SHELLFONT | WS_MINIMIZEBOX | WS_VISIBLE | WS_CAPTION | WS_SYSMENU +STYLE WS_MINIMIZEBOX | WS_VISIBLE | WS_CAPTION | WS_SYSMENU CAPTION "ReactOS °è»ê±â" MENU IDR_MENU_SCIENTIFIC_1 FONT 8, "MS Shell Dlg", 0, 0, 0x1 @@ -151,7 +153,7 @@ 42,10 CONTROL "Radians",IDC_RADIO_RAD,"Button",BS_AUTORADIOBUTTON,192, 24,42,10 - CONTROL "Grads",IDC_RADIO_GRAD,"Button",BS_AUTORADIOBUTTON, + CONTROL "Gradians",IDC_RADIO_GRAD,"Button",BS_AUTORADIOBUTTON, 236,24,44,10 PUSHBUTTON "C",IDC_BUTTON_CANC,272,40,40,17,BS_CENTER | BS_VCENTER | BS_NOTIFY | BS_OWNERDRAW | WS_TABSTOP @@ -165,7 +167,7 @@ END IDD_DIALOG_STANDARD DIALOGEX 0, 0, 172, 127 -STYLE DS_SHELLFONT | WS_MINIMIZEBOX | WS_VISIBLE | WS_CAPTION | WS_SYSMENU +STYLE WS_MINIMIZEBOX | WS_VISIBLE | WS_CAPTION | WS_SYSMENU CAPTION "ReactOS °è»ê±â" MENU IDR_MENU_STANDARD FONT 8, "MS Shell Dlg", 0, 0, 0x1 @@ -231,13 +233,91 @@ DEFPUSHBUTTON "",IDC_BUTTON_FOCUS,0,0,5,5, NOT WS_VISIBLE END +IDD_DIALOG_CONVERSION DIALOGEX 0, 0, 320, 130 +STYLE WS_MINIMIZEBOX | WS_VISIBLE | WS_CAPTION | WS_SYSMENU +CAPTION "ReactOS °è»ê±â Á¤º¸" +MENU IDR_MENU_STANDARD +FONT 8, "MS Shell Dlg" +BEGIN + PUSHBUTTON "Convert",IDC_BUTTON_CONVERT,35,105,76,17 + COMBOBOX IDC_COMBO_CATEGORY,4,31,140,168,CBS_DROPDOWNLIST | + WS_VSCROLL | WS_TABSTOP | CBS_SORT + LTEXT "Category:",IDC_STATIC,4,20,56,8 + COMBOBOX IDC_COMBO_FROM,4,60,140,168,CBS_DROPDOWNLIST | + WS_VSCROLL | WS_TABSTOP | CBS_SORT + LTEXT "Convert from:",IDC_STATIC,4,49,56,8 + COMBOBOX IDC_COMBO_TO,4,87,140,168,CBS_DROPDOWNLIST | WS_VSCROLL | + WS_TABSTOP | CBS_SORT + LTEXT "Convert to:",IDC_STATIC,4,76,56,8 + CONTROL "C",IDC_BUTTON_CANC,"Button",BS_OWNERDRAW | BS_CENTER | + BS_VCENTER | BS_NOTIFY | WS_TABSTOP,276,24,40,17 + CONTROL "CE",IDC_BUTTON_CE,"Button",BS_OWNERDRAW | BS_CENTER | + BS_VCENTER | BS_NOTIFY | WS_TABSTOP,232,24,40,17 + CONTROL "Back",IDC_BUTTON_BACK,"Button",BS_OWNERDRAW | + BS_CENTER | BS_VCENTER | BS_NOTIFY | WS_TABSTOP,188,24, + 40,17 + RTEXT "",IDC_TEXT_OUTPUT,4,4,312,12,SS_CENTERIMAGE, + WS_EX_CLIENTEDGE + CONTROL "7",IDC_BUTTON_7,"Button",BS_OWNERDRAW | BS_CENTER | + BS_VCENTER | BS_NOTIFY | WS_TABSTOP,188,48,24,17 + CONTROL "4",IDC_BUTTON_4,"Button",BS_OWNERDRAW | BS_CENTER | + BS_VCENTER | BS_NOTIFY | WS_TABSTOP,188,67,24,17 + CONTROL "1",IDC_BUTTON_1,"Button",BS_OWNERDRAW | BS_CENTER | + BS_VCENTER | BS_NOTIFY | WS_TABSTOP,188,86,24,17 + CONTROL "0",IDC_BUTTON_0,"Button",BS_OWNERDRAW | BS_CENTER | + BS_VCENTER | BS_NOTIFY | WS_TABSTOP,188,105,24,17 + CONTROL "8",IDC_BUTTON_8,"Button",BS_OWNERDRAW | BS_CENTER | + BS_VCENTER | BS_NOTIFY | WS_TABSTOP,214,48,24,17 + CONTROL "5",IDC_BUTTON_5,"Button",BS_OWNERDRAW | BS_CENTER | + BS_VCENTER | BS_NOTIFY | WS_TABSTOP,214,67,24,17 + CONTROL "2",IDC_BUTTON_2,"Button",BS_OWNERDRAW | BS_CENTER | + BS_VCENTER | BS_NOTIFY | WS_TABSTOP,214,86,24,17 + CONTROL "+/-",IDC_BUTTON_SIGN,"Button",BS_OWNERDRAW | BS_CENTER | + BS_VCENTER | BS_NOTIFY | WS_TABSTOP,214,105,24,17 + CONTROL "9",IDC_BUTTON_9,"Button",BS_OWNERDRAW | BS_CENTER | + BS_VCENTER | BS_NOTIFY | WS_TABSTOP,240,48,24,17 + CONTROL "6",IDC_BUTTON_6,"Button",BS_OWNERDRAW | BS_CENTER | + BS_VCENTER | BS_NOTIFY | WS_TABSTOP,240,67,24,17 + CONTROL "3",IDC_BUTTON_3,"Button",BS_OWNERDRAW | BS_CENTER | + BS_VCENTER | BS_NOTIFY | WS_TABSTOP,240,86,24,17 + CONTROL ",",IDC_BUTTON_DOT,"Button",BS_OWNERDRAW | BS_CENTER | + BS_VCENTER | BS_NOTIFY | WS_TABSTOP,240,105,24,17 + CONTROL "/",IDC_BUTTON_DIV,"Button",BS_OWNERDRAW | BS_CENTER | + BS_VCENTER | BS_NOTIFY | WS_TABSTOP,266,48,24,17 + CONTROL "*",IDC_BUTTON_MULT,"Button",BS_OWNERDRAW | BS_CENTER | + BS_VCENTER | BS_NOTIFY | WS_TABSTOP,266,67,24,17 + CONTROL "-",IDC_BUTTON_SUB,"Button",BS_OWNERDRAW | BS_CENTER | + BS_VCENTER | BS_NOTIFY | WS_TABSTOP,266,86,24,17 + CONTROL "+",IDC_BUTTON_ADD,"Button",BS_OWNERDRAW | BS_CENTER | + BS_VCENTER | BS_NOTIFY | WS_TABSTOP,266,105,24,17 + CONTROL "Sqrt",IDC_BUTTON_SQRT,"Button",BS_OWNERDRAW | BS_CENTER | + BS_VCENTER | BS_NOTIFY | WS_TABSTOP,292,48,24,17 + CONTROL "%",IDC_BUTTON_PERCENT,"Button",BS_OWNERDRAW | BS_CENTER | + BS_VCENTER | BS_NOTIFY | WS_TABSTOP,292,67,24,17 + CONTROL "1/x",IDC_BUTTON_RX,"Button",BS_OWNERDRAW | BS_CENTER | + BS_VCENTER | BS_NOTIFY | WS_TABSTOP,292,86,24,17 + CONTROL "=",IDC_BUTTON_EQU,"Button",BS_OWNERDRAW | BS_CENTER | + BS_VCENTER | BS_NOTIFY | WS_TABSTOP,292,105,24,17 + CTEXT "",IDC_TEXT_MEMORY,152,24,24,17,SS_CENTERIMAGE, + WS_EX_CLIENTEDGE + CONTROL "MC",IDC_BUTTON_MC,"Button",BS_OWNERDRAW | BS_CENTER | + BS_VCENTER | BS_NOTIFY | WS_TABSTOP,152,48,24,17 + CONTROL "MR",IDC_BUTTON_MR,"Button",BS_OWNERDRAW | BS_CENTER | + BS_VCENTER | BS_NOTIFY | WS_TABSTOP,152,67,24,17 + CONTROL "MS",IDC_BUTTON_MS,"Button",BS_OWNERDRAW | BS_CENTER | + BS_VCENTER | BS_NOTIFY | WS_TABSTOP,152,86,24,17 + CONTROL "M+",IDC_BUTTON_MP,"Button",BS_OWNERDRAW | BS_CENTER | + BS_VCENTER | BS_NOTIFY | WS_TABSTOP,152,105,24,17 + DEFPUSHBUTTON "",IDC_BUTTON_FOCUS,0,0,5,5,NOT WS_VISIBLE +END + IDD_DIALOG_ABOUT DIALOGEX DISCARDABLE 0, 0, 264, 169 -STYLE DS_SHELLFONT | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU +STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU CAPTION "ReactOS °è»ê±â Á¤º¸" FONT 8, "MS Shell Dlg" BEGIN DEFPUSHBUTTON "OK",IDOK,105,148,52,16 - CONTROL 106,IDC_STATIC,"Static",SS_BITMAP | SS_CENTERIMAGE | + CONTROL IDB_BITMAP_ROS,IDC_STATIC,"Static",SS_BITMAP | SS_CENTERIMAGE | SS_REALSIZEIMAGE | WS_BORDER,4,4,104,48 LTEXT "ReactOS °è»ê±â",IDC_STATIC,120,12,132,8, SS_CENTERIMAGE @@ -251,7 +331,7 @@ END IDD_DIALOG_STAT DIALOGEX DISCARDABLE 0, 0, 163, 85 -STYLE DS_SHELLFONT | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU +STYLE WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU CAPTION "Statistics box" FONT 8, "MS Shell Dlg" BEGIN @@ -265,7 +345,6 @@ SS_SUNKEN END - // Menus IDR_MENU_SCIENTIFIC_1 MENU DISCARDABLE @@ -365,3 +444,260 @@ IDS_QUICKHELP "ºü¸¥ µµ¿ò¸»" END +// types of conversion +STRINGTABLE DISCARDABLE +BEGIN + IDS_CONV_AREA "Area" + IDS_CONV_CONSUMPTION "Consumption (engines)" + IDS_CONV_CURRENCY "Currencies" + IDS_CONV_ENERGY "Energy" + IDS_CONV_LENGTH "Lenghts" + IDS_CONV_POWER "Power" + IDS_CONV_PRESSURE "Pressure" + IDS_CONV_TEMPERATURE "Temperature" + IDS_CONV_VELOCITY "Velocity" + IDS_CONV_VOLUME "Volume" + IDS_CONV_WEIGHT "Weights" +END + +// TYPES OF AREAS +STRINGTABLE DISCARDABLE +BEGIN + IDS_AREA_ACRES "Acres" + IDS_AREA_ACRES_BRAZIL "Acres (Brazil)" + IDS_AREA_ACRES_FRANCE "Acres (France)" + IDS_AREA_ACRES_SCOTS "Acres (Scots)" + IDS_AREA_ACRES_US "Acres (US)" + IDS_AREA_ARES "Ares" + IDS_AREA_CHOU "Chou" + IDS_AREA_DANBO "Danbo" + IDS_AREA_HECTARES "Hectares" + IDS_AREA_JEONGBO "Jeongbo" + IDS_AREA_MORGEN_HUNGARY "Morgen (Hungary)" + IDS_AREA_MU "Mu" + IDS_AREA_PING "Ping" + IDS_AREA_PYEONG "Pyeong" + IDS_AREA_PYEONGBANGJA "Pyeongbangja" + IDS_AREA_RAI "Rai" + IDS_AREA_SE "Se" + IDS_AREA_SQUARE_CENTIMETERS "Square centimeters" + IDS_AREA_SQUARE_CHR "Square chr" + IDS_AREA_SQUARE_FATHOMS "Square fathoms" + IDS_AREA_SQUARE_FATHOMS_HUNGARY "Square fathoms (Hungary)" + IDS_AREA_SQUARE_FEET "Square feet" + IDS_AREA_SQUARE_INCHES "Square inches" + IDS_AREA_SQUARE_KILOMETERS "Square kilometers" + IDS_AREA_SQUARE_LAR "Square lar" + IDS_AREA_SQUARE_METER "Square meter" + IDS_AREA_SQUARE_MILES "Square miles" + IDS_AREA_SQUARE_MILLIMETERS "Square millimeters" + IDS_AREA_SQUARE_SHAKU "Square shaku" + IDS_AREA_SQUARE_TSUEN "Square tsuen" + IDS_AREA_SQUARE_VA "Square va" + IDS_AREA_SQUARE_YARD "Square yard" + IDS_AREA_TAN "Tan" + IDS_AREA_TSUBO "Tsubo" +END + +// TYPES OF COMSUMPTIONS +STRINGTABLE DISCARDABLE +BEGIN + IDS_CONSUMPTION_KM_PER_L "Kilometer/liter" + IDS_CONSUMPTION_L_PER_100_KM "Liters/100 kilometers" + IDS_CONSUMPTION_MILES_GALLON_UK "Miles/gallon (UK)" + IDS_CONSUMPTION_MILES_GALLON_US "Miles/gallon (US)" +END + +// TYPES OF CURRENCIES +STRINGTABLE DISCARDABLE +BEGIN + IDS_CURRENCY_AUSTRIAN_SCHILLING "Austrian schilling" + IDS_CURRENCY_BELGIAN_FRANC "Belgian franc" + IDS_CURRENCY_CYPRIOT_POUND "Cypriot pound" + IDS_CURRENCY_DEUTSCHE_MARK "Deutsche Mark" + IDS_CURRENCY_DUTCH_GUILDER "Dutch guilder" + IDS_CURRENCY_EURO "Euro" + IDS_CURRENCY_FINNISH_MARKKA "Finnish markka" + IDS_CURRENCY_FRENCH_FRANC "French franc" + IDS_CURRENCY_GREEK_DRACHMA "Greek Drachma" + IDS_CURRENCY_IRISH_POUND "Irish pound" + IDS_CURRENCY_ITALIAN_LIRA "Italian lira" + IDS_CURRENCY_LUXEMBOURG_FRANC "Luxembourg franc" + IDS_CURRENCY_MALTESE_LIRA "Maltese lira" + IDS_CURRENCY_PORTOGUESE_ESCUDO "Portoguese escudo" + IDS_CURRENCY_SLOVAK_KORUNA "Slovak koruna" + IDS_CURRENCY_SLOVENIAN_TOLAR "Slovenian tolar" + IDS_CURRENCY_SPANISH_PESETA "Spanish peseta" +END + +// TYPES OF ENERGIES +STRINGTABLE DISCARDABLE +BEGIN + IDS_ENERGY_15_C_CALORIES "15 ^C calories" + IDS_ENERGY_ERGS "Ergs" + IDS_ENERGY_IT_CALORIES "International Table calories" + IDS_ENERGY_JOULES "Joules" + IDS_ENERGY_KILOJOULES "Kilojoules" + IDS_ENERGY_KILOWATT_HOURS "Kilowatt hours" + IDS_ENERGY_NUTRITION_CALORIES "Nutrition calories" + IDS_ENERGY_TH_CALORIES "Thermochemical calorie" +END + +// TYPES OF LENGTHS +STRINGTABLE DISCARDABLE +BEGIN + IDS_LENGTH_ANGSTROMS "Angstroms" + IDS_LENGTH_ASTRONOMILA_UNITS "Astronomila units" + IDS_LENGTH_BARLEYCORNS "Barleycorns" + IDS_LENGTH_CENTIMETERS "Centimeters" + IDS_LENGTH_CHAINS_UK "Chains (UK)" + IDS_LENGTH_CHI "Chi" + IDS_LENGTH_CHOU "Chou" + IDS_LENGTH_CHR "Chr" + IDS_LENGTH_CUN "Cun" + IDS_LENGTH_FATHOMS "Fathoms" + IDS_LENGTH_FATHOMS_HUNGARY "Fathoms (Hungary)" + IDS_LENGTH_FEET "Feet" + IDS_LENGTH_FURLONGS "Furlongs" + IDS_LENGTH_GAN "Gan" + IDS_LENGTH_HANDS "Hands" + IDS_LENGTH_HUNH "Hunh" + IDS_LENGTH_INCHES "Inches" + IDS_LENGTH_JA "Ja" + IDS_LENGTH_JEONG "Jeong" + IDS_LENGTH_KABIET "Kabiet" + IDS_LENGTH_KEN "Ken" + IDS_LENGTH_KEUB "Keub" + IDS_LENGTH_KILOMETERS "Kilometers" + IDS_LENGTH_LAR "Lar" + IDS_LENGTH_LIGHT_YEARS "Light years" + IDS_LENGTH_LINKS_UK "Links (UK)" + IDS_LENGTH_METERS "Meters" + IDS_LENGTH_MILES "Miles" + IDS_LENGTH_MILLIMETERS "Millimeters" + IDS_LENGTH_NAUTICAL_MILES "Nautical miles" + IDS_LENGTH_NIEU "Nieu" + IDS_LENGTH_PARSECS "Parsecs" + IDS_LENGTH_PICAS "Picas" + IDS_LENGTH_RI_JAPAN "Ri (Japan)" + IDS_LENGTH_RI_KOREA "Ri (Korea)" + IDS_LENGTH_SAWK "Sawk" + IDS_LENGTH_SEN "Sen" + IDS_LENGTH_SHAKU "Shaku" + IDS_LENGTH_SPAN "Span" + IDS_LENGTH_SUN "Sun" + IDS_LENGTH_TSUEN "Tsuen" + IDS_LENGTH_VA "Va" + IDS_LENGTH_YARDS "Yards" + IDS_LENGTH_YOTE "Yote" + IDS_LENGTH_ZHANG "Zhang" +END + +// TYPES OF POWERS +STRINGTABLE DISCARDABLE +BEGIN + IDS_POWER_HORSEPOWER "Horsepower" + IDS_POWER_KILOWATTS "Kilowatts" + IDS_POWER_MEGAWATTS "Megawatts" + IDS_POWER_WATTS "Watts" +END + +// TYPE OF PRESSURES +STRINGTABLE DISCARDABLE +BEGIN + IDS_PRESSURE_ATMOSPHERES "Atmospheres" + IDS_PRESSURE_BARS "Bars" + IDS_PRESSURE_MM_OF_MERCURY "Millimeters of mercury" + IDS_PRESSURE_PASCALS "Pascals" + IDS_PRESSURE_PSI "Pounds-force per square inch" +END + +// TYPES OF TEMPERATURES +STRINGTABLE DISCARDABLE +BEGIN + IDS_TEMPERATURE_CELSIUS "Celsius" + IDS_TEMPERATURE_FAHRENHEIT "Fahrenheit" + IDS_TEMPERATURE_KELVIN "Kelvin" + IDS_TEMPERATURE_RANKINE "Rankine" +END + +// TYPES OF VELOCITIES +STRINGTABLE DISCARDABLE +BEGIN + IDS_VELOCITY_FEET_HOUR "Feet/hour" + IDS_VELOCITY_KILOMETERS_HOUR "Kilometers/hour" + IDS_VELOCITY_KNOTS "Knots" + IDS_VELOCITY_MACH "Mach" + IDS_VELOCITY_METERS_SECOND "Meters/second" + IDS_VELOCITY_MILES_HOUR "Miles/hour" +END + +// TYPES OF VOLUMES +STRINGTABLE DISCARDABLE +BEGIN + IDS_VOLUME_BARRELS_UK "Barrels (UK)" + IDS_VOLUME_BARRELS_OIL "Barrels oil" + IDS_VOLUME_BUN "Bun" + IDS_VOLUME_BUSHELS_UK "Bushels (UK)" + IDS_VOLUME_BUSHELS_US "Bushels (US)" + IDS_VOLUME_CUBIC_CENTIMETERS "Cubic centimeters" + IDS_VOLUME_CUBIC_FEET "Cubic feet" + IDS_VOLUME_CUBIC_INCHES "Cubic inches" + IDS_VOLUME_CUBIC_METERS "Cubic meters" + IDS_VOLUME_CUBIC_YARDS "Cubic yards" + IDS_VOLUME_DOE "Doe" + IDS_VOLUME_FLUID_OUNCES_UK "Fluid ounces (UK)" + IDS_VOLUME_FLUID_OUNCES_US "Fluid ounces (US)" + IDS_VOLUME_GALLONS_UK "Gallons (UK)" + IDS_VOLUME_GALLONS_DRY_US "Gallons, dry (US)" + IDS_VOLUME_GALLONS_LIQUID_US "Gallons, liquid (US)" + IDS_VOLUME_GOU "Gou" + IDS_VOLUME_HOP "Hop" + IDS_VOLUME_ICCE "Icce" + IDS_VOLUME_KWIAN "Kwian" + IDS_VOLUME_LITERS "Liters" + IDS_VOLUME_MAL "Mal" + IDS_VOLUME_MILLILITERS "Milliliters" + IDS_VOLUME_PINTS_UK "Pints (UK)" + IDS_VOLUME_PINTS_DRY_US "Pints, dry (US)" + IDS_VOLUME_PINTS_LIQUID_US "Pints, liquid (US)" + IDS_VOLUME_QUARTS_UK "Quarts (UK)" + IDS_VOLUME_QUARTS_DRY_US "Quarts, dry (US)" + IDS_VOLUME_QUARTS_LIQUID_US "Quarts, liquid (US)" + IDS_VOLUME_SEKI "Seki" + IDS_VOLUME_SYOU "Syou" + IDS_VOLUME_TANANLOUNG "Tananloung" + IDS_VOLUME_TANG "Tang" + IDS_VOLUME_TO "To" +END + +// TYPES OF WEIGHTS +STRINGTABLE DISCARDABLE +BEGIN + IDS_WEIGHT_BAHT "Baht" + IDS_WEIGHT_CARATS "Carats" + IDS_WEIGHT_CHUNG "Chung" + IDS_WEIGHT_DON "Don" + IDS_WEIGHT_GEUN "Geun" + IDS_WEIGHT_GRAMS "Grams" + IDS_WEIGHT_GWAN "Gwan" + IDS_WEIGHT_HARB "Harb" + IDS_WEIGHT_JIN_CHINA "Jin (China)" + IDS_WEIGHT_JIN_TAIWAN "Jin (Taiwan)" + IDS_WEIGHT_KAN "Kan" + IDS_WEIGHT_KILOGRAMS "Kilograms" + IDS_WEIGHT_KIN "Kin" + IDS_WEIGHT_LIANG_CHINA "Liang (China)" + IDS_WEIGHT_LIANG_TAIWAN "Liang (Taiwan)" + IDS_WEIGHT_MONME "Monme" + IDS_WEIGHT_OUNCES_AVOIRDUPOIS "Ounces, avoirdupois" + IDS_WEIGHT_OUNCES_TROY "Ounces, troy" + IDS_WEIGHT_POUNDS "Pounds" + IDS_WEIGHT_QUINTAL_METRIC "Quintal (metric)" + IDS_WEIGHT_SALOUNG "Saloung" + IDS_WEIGHT_STONES "Stones" + IDS_WEIGHT_TAMLUNG "Tamlung" + IDS_WEIGHT_TONNES "Tonnes" + IDS_WEIGHT_TONS_UK "Tons (UK)" + IDS_WEIGHT_TONS_US "Tons (US)" +END Modified: trunk/reactos/base/applications/calc/lang/nl-NL.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/calc/lan…
============================================================================== --- trunk/reactos/base/applications/calc/lang/nl-NL.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/calc/lang/nl-NL.rc [iso-8859-1] Sun Dec 28 21:53:13 2008 @@ -1,4 +1,3 @@ - LANGUAGE LANG_DUTCH, SUBLANG_NEUTRAL // Dialog @@ -523,6 +522,7 @@ IDS_CURRENCY_LUXEMBOURG_FRANC "Luxembourg franc" IDS_CURRENCY_MALTESE_LIRA "Maltese lira" IDS_CURRENCY_PORTOGUESE_ESCUDO "Portoguese escudo" + IDS_CURRENCY_SLOVAK_KORUNA "Slowaakse kroon" IDS_CURRENCY_SLOVENIAN_TOLAR "Slovenian tolar" IDS_CURRENCY_SPANISH_PESETA "Spanish peseta" END Modified: trunk/reactos/base/applications/calc/lang/no-NO.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/calc/lan…
============================================================================== --- trunk/reactos/base/applications/calc/lang/no-NO.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/calc/lang/no-NO.rc [iso-8859-1] Sun Dec 28 21:53:13 2008 @@ -518,6 +518,7 @@ IDS_CURRENCY_LUXEMBOURG_FRANC "Luxembourg franc" IDS_CURRENCY_MALTESE_LIRA "Maltese lira" IDS_CURRENCY_PORTOGUESE_ESCUDO "Portoguese escudo" + IDS_CURRENCY_SLOVAK_KORUNA "Slovakisk koruna" IDS_CURRENCY_SLOVENIAN_TOLAR "Slovenian tolar" IDS_CURRENCY_SPANISH_PESETA "Spanish peseta" END Modified: trunk/reactos/base/applications/calc/lang/pl-PL.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/calc/lan…
============================================================================== --- trunk/reactos/base/applications/calc/lang/pl-PL.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/calc/lang/pl-PL.rc [iso-8859-1] Sun Dec 28 21:53:13 2008 @@ -529,6 +529,7 @@ IDS_CURRENCY_LUXEMBOURG_FRANC "Luksemburski frank" IDS_CURRENCY_MALTESE_LIRA "Maltañskie liry" IDS_CURRENCY_PORTOGUESE_ESCUDO "Portugalskie escudo" + IDS_CURRENCY_SLOVAK_KORUNA "S³owacka korona" IDS_CURRENCY_SLOVENIAN_TOLAR "S³oveñski tolar" IDS_CURRENCY_SPANISH_PESETA "Hiszpañska peseta" END Modified: trunk/reactos/base/applications/calc/lang/ru-RU.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/calc/lan…
============================================================================== --- trunk/reactos/base/applications/calc/lang/ru-RU.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/calc/lang/ru-RU.rc [iso-8859-1] Sun Dec 28 21:53:13 2008 @@ -522,6 +522,7 @@ IDS_CURRENCY_LUXEMBOURG_FRANC "Ëþêñåìáóðãñêèé ôðàíê" IDS_CURRENCY_MALTESE_LIRA "Ìàëüòèéñêàÿ ëèðà" IDS_CURRENCY_PORTOGUESE_ESCUDO "Ïîðòóãàëüñêîå ýñêóäî" + IDS_CURRENCY_SLOVAK_KORUNA "Ñëîâàöêàÿ êðîíà" IDS_CURRENCY_SLOVENIAN_TOLAR "Ñëîâåíñêèé òîëàð" IDS_CURRENCY_SPANISH_PESETA "Èñïàíñêàÿ ïåñåòà" END Modified: trunk/reactos/base/applications/calc/lang/sk-SK.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/calc/lan…
============================================================================== --- trunk/reactos/base/applications/calc/lang/sk-SK.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/calc/lang/sk-SK.rc [iso-8859-1] Sun Dec 28 21:53:13 2008 @@ -1,6 +1,6 @@ /* TRANSLATOR : Mário Kaèmár /Mario Kacmar/ aka Kario (kario(a)szm.sk) * DATE OF TR.: 30-01-2008 - * LAST CHANGE: 30-08-2008 + * LAST CHANGE: 29-12-2008 * --------------------------------------- * TODO: * 1. treba usporiada jednotky pod¾a abecedy @@ -350,7 +350,6 @@ SS_SUNKEN END - // Menus IDR_MENU_SCIENTIFIC_1 MENU DISCARDABLE @@ -531,6 +530,7 @@ IDS_CURRENCY_LUXEMBOURG_FRANC "Luxembourg franc" IDS_CURRENCY_MALTESE_LIRA "Maltese lira" IDS_CURRENCY_PORTOGUESE_ESCUDO "Portoguese escudo" + IDS_CURRENCY_SLOVAK_KORUNA "Slovenská koruna" IDS_CURRENCY_SLOVENIAN_TOLAR "Slovinský toliar" IDS_CURRENCY_SPANISH_PESETA "panielska peseta" END Modified: trunk/reactos/base/applications/calc/lang/th-TH.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/calc/lan…
============================================================================== --- trunk/reactos/base/applications/calc/lang/th-TH.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/calc/lang/th-TH.rc [iso-8859-1] Sun Dec 28 21:53:13 2008 @@ -1,6 +1,6 @@ /* * ReactOS Calc (Thai resource file) - * Last modified: 2008-12-18 + * Last modified: 2008-12-29 */ LANGUAGE LANG_THAI, SUBLANG_DEFAULT @@ -522,6 +522,7 @@ IDS_CURRENCY_LUXEMBOURG_FRANC "Luxembourg franc" IDS_CURRENCY_MALTESE_LIRA "Maltese lira" IDS_CURRENCY_PORTOGUESE_ESCUDO "Portoguese escudo" + IDS_CURRENCY_SLOVAK_KORUNA "Slovak koruna" IDS_CURRENCY_SLOVENIAN_TOLAR "Slovenian tolar" IDS_CURRENCY_SPANISH_PESETA "Spanish peseta" END Modified: trunk/reactos/base/applications/calc/lang/uk-UA.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/calc/lan…
============================================================================== --- trunk/reactos/base/applications/calc/lang/uk-UA.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/calc/lang/uk-UA.rc [iso-8859-1] Sun Dec 28 21:53:13 2008 @@ -530,6 +530,7 @@ IDS_CURRENCY_LUXEMBOURG_FRANC "Luxembourg franc" IDS_CURRENCY_MALTESE_LIRA "Maltese lira" IDS_CURRENCY_PORTOGUESE_ESCUDO "Portoguese escudo" + IDS_CURRENCY_SLOVAK_KORUNA "Ñëîâàöüêà êðîíà" IDS_CURRENCY_SLOVENIAN_TOLAR "Slovenian tolar" IDS_CURRENCY_SPANISH_PESETA "Spanish peseta" END Modified: trunk/reactos/base/applications/calc/resource.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/calc/res…
============================================================================== --- trunk/reactos/base/applications/calc/resource.h [iso-8859-1] (original) +++ trunk/reactos/base/applications/calc/resource.h [iso-8859-1] Sun Dec 28 21:53:13 2008 @@ -173,8 +173,9 @@ #define IDS_CURRENCY_LUXEMBOURG_FRANC 2311 #define IDS_CURRENCY_MALTESE_LIRA 2312 #define IDS_CURRENCY_PORTOGUESE_ESCUDO 2313 -#define IDS_CURRENCY_SLOVENIAN_TOLAR 2314 -#define IDS_CURRENCY_SPANISH_PESETA 2315 +#define IDS_CURRENCY_SLOVAK_KORUNA 2314 +#define IDS_CURRENCY_SLOVENIAN_TOLAR 2315 +#define IDS_CURRENCY_SPANISH_PESETA 2316 /* TYPES OF ENERGIES */ #define IDS_ENERGY_15_C_CALORIES 2400
15 years, 12 months
1
0
0
0
[jimtabor] 38437: - Support MOVEFILE_WRITE_THROUGH flag.
by jimtabor@svn.reactos.org
Author: jimtabor Date: Sun Dec 28 20:30:09 2008 New Revision: 38437 URL:
http://svn.reactos.org/svn/reactos?rev=38437&view=rev
Log: - Support MOVEFILE_WRITE_THROUGH flag. Modified: trunk/reactos/dll/win32/kernel32/file/move.c Modified: trunk/reactos/dll/win32/kernel32/file/move.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/file/mo…
============================================================================== --- trunk/reactos/dll/win32/kernel32/file/move.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/file/move.c [iso-8859-1] Sun Dec 28 20:30:09 2008 @@ -249,8 +249,8 @@ if (dwFlags & MOVEFILE_DELAY_UNTIL_REBOOT) return add_boot_rename_entry( lpExistingFileName, lpNewFileName, dwFlags ); - if (dwFlags & MOVEFILE_WRITE_THROUGH) - FIXME("MOVEFILE_WRITE_THROUGH unimplemented\n"); +// if (dwFlags & MOVEFILE_WRITE_THROUGH) +// FIXME("MOVEFILE_WRITE_THROUGH unimplemented\n"); if (!lpNewFileName) return DeleteFileW(lpExistingFileName); @@ -272,31 +272,37 @@ NULL, NULL); - errCode = NtOpenFile(&hNewFile, GENERIC_READ | GENERIC_WRITE, &ObjectAttributes, &IoStatusBlock, 0, - FILE_NON_DIRECTORY_FILE | FILE_SYNCHRONOUS_IO_NONALERT ); - - if (NT_SUCCESS(errCode)) /* Destination exists */ - { + errCode = NtOpenFile( &hNewFile, + GENERIC_READ | GENERIC_WRITE, + &ObjectAttributes, + &IoStatusBlock, + 0, + FILE_NON_DIRECTORY_FILE | FILE_SYNCHRONOUS_IO_NONALERT | + ((dwFlags & MOVEFILE_WRITE_THROUGH) ? FILE_WRITE_THROUGH : 0) ); + + if (NT_SUCCESS(errCode)) /* Destination exists */ + { NtClose(hNewFile); if (!(dwFlags & MOVEFILE_REPLACE_EXISTING)) { SetLastError(ERROR_ALREADY_EXISTS); return FALSE; - } - else if (GetFileAttributesW(lpNewFileName) & FILE_ATTRIBUTE_DIRECTORY) - { - SetLastError(ERROR_ACCESS_DENIED); - return FALSE; - } - } + } + else if (GetFileAttributesW(lpNewFileName) & FILE_ATTRIBUTE_DIRECTORY) + { + SetLastError(ERROR_ACCESS_DENIED); + return FALSE; + } + } hFile = CreateFileW (lpExistingFileName, GENERIC_ALL, FILE_SHARE_WRITE|FILE_SHARE_READ, NULL, OPEN_EXISTING, - FILE_FLAG_BACKUP_SEMANTICS, + FILE_FLAG_BACKUP_SEMANTICS | + ((dwFlags & MOVEFILE_WRITE_THROUGH) ? FILE_FLAG_WRITE_THROUGH : 0), NULL); if (hFile == INVALID_HANDLE_VALUE)
15 years, 12 months
1
0
0
0
[pschweitzer] 38436: - Revert r35254. - Fixed all MCB stuff according to that revert Real thank to Alex for his help
by pschweitzer@svn.reactos.org
Author: pschweitzer Date: Sun Dec 28 16:24:52 2008 New Revision: 38436 URL:
http://svn.reactos.org/svn/reactos?rev=38436&view=rev
Log: - Revert r35254. - Fixed all MCB stuff according to that revert Real thank to Alex for his help Modified: branches/pierre-fsd/include/ddk/ntifs.h branches/pierre-fsd/ntoskrnl/fsrtl/largemcb.c Modified: branches/pierre-fsd/include/ddk/ntifs.h URL:
http://svn.reactos.org/svn/reactos/branches/pierre-fsd/include/ddk/ntifs.h?…
============================================================================== --- branches/pierre-fsd/include/ddk/ntifs.h [iso-8859-1] (original) +++ branches/pierre-fsd/include/ddk/ntifs.h [iso-8859-1] Sun Dec 28 16:24:52 2008 @@ -1372,7 +1372,7 @@ typedef struct _LARGE_MCB { - PFAST_MUTEX FastMutex; + PKGUARDED_MUTEX GuardedMutex; BASE_MCB BaseMcb; } LARGE_MCB, *PLARGE_MCB; Modified: branches/pierre-fsd/ntoskrnl/fsrtl/largemcb.c URL:
http://svn.reactos.org/svn/reactos/branches/pierre-fsd/ntoskrnl/fsrtl/large…
============================================================================== --- branches/pierre-fsd/ntoskrnl/fsrtl/largemcb.c [iso-8859-1] (original) +++ branches/pierre-fsd/ntoskrnl/fsrtl/largemcb.c [iso-8859-1] Sun Dec 28 16:24:52 2008 @@ -46,12 +46,12 @@ { BOOLEAN Result; - ExAcquireFastMutex(Mcb->FastMutex); + KeAcquireGuardedMutex(Mcb->GuardedMutex); Result = FsRtlAddBaseMcbEntry(&(Mcb->BaseMcb), Vbn, Lbn, SectorCount); - ExReleaseFastMutex(Mcb->FastMutex); + KeReleaseGuardedMutex(Mcb->GuardedMutex); return Result; } @@ -87,13 +87,13 @@ { BOOLEAN Result; - ExAcquireFastMutex(Mcb->FastMutex); + KeAcquireGuardedMutex(Mcb->GuardedMutex); Result = FsRtlGetNextBaseMcbEntry(&(Mcb->BaseMcb), RunIndex, Vbn, Lbn, SectorCount); - ExReleaseFastMutex(Mcb->FastMutex); + KeReleaseGuardedMutex(Mcb->GuardedMutex); return Result; } @@ -129,10 +129,9 @@ FsRtlInitializeLargeMcb(IN PLARGE_MCB Mcb, IN POOL_TYPE PoolType) { - Mcb->FastMutex = ExAllocateFromNPagedLookasideList(&FsRtlFastMutexLookasideList); - - ExInitializeFastMutex(Mcb->FastMutex); - KeInitializeGate((PKGATE)&(Mcb->FastMutex->Gate)); + Mcb->GuardedMutex = ExAllocateFromNPagedLookasideList(&FsRtlFastMutexLookasideList); + + KeInitializeGuardedMutex(Mcb->GuardedMutex); _SEH_TRY { @@ -141,8 +140,8 @@ _SEH_HANDLE { ExFreeToNPagedLookasideList(&FsRtlFastMutexLookasideList, - Mcb->FastMutex); - Mcb->FastMutex = NULL; + Mcb->GuardedMutex); + Mcb->GuardedMutex = NULL; } _SEH_END; } @@ -163,12 +162,12 @@ IFS_POOL_TAG, 0); /* FIXME: Should be 4 */ - /* Initialize the list for the fast mutex */ + /* Initialize the list for the guarded mutex */ ExInitializeNPagedLookasideList(&FsRtlFastMutexLookasideList, NULL, NULL, POOL_RAISE_IF_ALLOCATION_FAILURE, - sizeof(FAST_MUTEX), + sizeof(KGUARDED_MUTEX), IFS_POOL_TAG, 0); /* FIXME: Should be 32 */ } @@ -207,7 +206,7 @@ { BOOLEAN Result; - ExAcquireFastMutex(Mcb->FastMutex); + KeAcquireGuardedMutex(Mcb->GuardedMutex); Result = FsRtlLookupBaseMcbEntry(&(Mcb->BaseMcb), Vbn, Lbn, @@ -215,7 +214,7 @@ StartingLbn, SectorCountFromStartingLbn, Index); - ExReleaseFastMutex(Mcb->FastMutex); + KeReleaseGuardedMutex(Mcb->GuardedMutex); return Result; } @@ -249,12 +248,12 @@ { BOOLEAN Result; - ExAcquireFastMutex(OpaqueMcb->FastMutex); + KeAcquireGuardedMutex(OpaqueMcb->GuardedMutex); Result = FsRtlLookupLastBaseMcbEntryAndIndex(&(OpaqueMcb->BaseMcb), LargeVbn, LargeLbn, Index); - ExReleaseFastMutex(OpaqueMcb->FastMutex); + KeReleaseGuardedMutex(OpaqueMcb->GuardedMutex); return Result; } @@ -283,11 +282,11 @@ { BOOLEAN Result; - ExAcquireFastMutex(Mcb->FastMutex); + KeAcquireGuardedMutex(Mcb->GuardedMutex); Result = FsRtlLookupLastBaseMcbEntry(&(Mcb->BaseMcb), Vbn, Lbn); - ExReleaseFastMutex(Mcb->FastMutex); + KeReleaseGuardedMutex(Mcb->GuardedMutex); return Result; } @@ -313,9 +312,9 @@ ULONG NumberOfRuns; /* Read the number of runs while holding the MCB lock */ - ExAcquireFastMutex(Mcb->FastMutex); + KeAcquireGuardedMutex(Mcb->GuardedMutex); NumberOfRuns = Mcb->BaseMcb.PairCount; - ExReleaseFastMutex(Mcb->FastMutex); + KeReleaseGuardedMutex(Mcb->GuardedMutex); /* Return the count */ return NumberOfRuns; @@ -343,11 +342,11 @@ IN LONGLONG Vbn, IN LONGLONG SectorCount) { - ExAcquireFastMutex(Mcb->FastMutex); + KeAcquireGuardedMutex(Mcb->GuardedMutex); FsRtlRemoveBaseMcbEntry(&(Mcb->BaseMcb), Vbn, SectorCount); - ExReleaseFastMutex(Mcb->FastMutex); + KeReleaseGuardedMutex(Mcb->GuardedMutex); } /* @@ -370,9 +369,9 @@ { if (!SelfSynchronized) { - ExAcquireFastMutex(Mcb->FastMutex); + KeAcquireGuardedMutex(Mcb->GuardedMutex); Mcb->BaseMcb.PairCount = 0; - ExReleaseFastMutex(Mcb->FastMutex); + KeReleaseGuardedMutex(Mcb->GuardedMutex); } else { @@ -404,11 +403,11 @@ { BOOLEAN Result; - ExAcquireFastMutex(Mcb->FastMutex); + KeAcquireGuardedMutex(Mcb->GuardedMutex); Result = FsRtlSplitBaseMcb(&(Mcb->BaseMcb), Vbn, Amount); - ExReleaseFastMutex(Mcb->FastMutex); + KeReleaseGuardedMutex(Mcb->GuardedMutex); return Result; } @@ -432,10 +431,10 @@ FsRtlTruncateLargeMcb(IN PLARGE_MCB Mcb, IN LONGLONG Vbn) { - ExAcquireFastMutex(Mcb->FastMutex); + KeAcquireGuardedMutex(Mcb->GuardedMutex); FsRtlTruncateBaseMcb(&(Mcb->BaseMcb), Vbn); - ExReleaseFastMutex(Mcb->FastMutex); + KeReleaseGuardedMutex(Mcb->GuardedMutex); } /* @@ -463,10 +462,10 @@ NTAPI FsRtlUninitializeLargeMcb(IN PLARGE_MCB Mcb) { - if (Mcb->FastMutex) + if (Mcb->GuardedMutex) { ExFreeToNPagedLookasideList(&FsRtlFastMutexLookasideList, - Mcb->FastMutex); + Mcb->GuardedMutex); FsRtlUninitializeBaseMcb(&(Mcb->BaseMcb)); } }
15 years, 12 months
1
0
0
0
[janderwald] 38435: - Add IPowerNotify interface
by janderwald@svn.reactos.org
Author: janderwald Date: Sun Dec 28 15:30:58 2008 New Revision: 38435 URL:
http://svn.reactos.org/svn/reactos?rev=38435&view=rev
Log: - Add IPowerNotify interface Modified: trunk/reactos/include/ddk/portcls.h Modified: trunk/reactos/include/ddk/portcls.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ddk/portcls.h?rev=…
============================================================================== --- trunk/reactos/include/ddk/portcls.h [iso-8859-1] (original) +++ trunk/reactos/include/ddk/portcls.h [iso-8859-1] Sun Dec 28 15:30:58 2008 @@ -1544,6 +1544,23 @@ IPowerNotify Interface */ +#undef INTERFACE +#define INTERFACE IPowerNotify + +DEFINE_GUID(IID_IPowerNotify, 0x3DD648B8L, 0x969F, 0x11D1, 0x95, 0xA9, 0x00, 0xC0, 0x4F, 0xB9, 0x25, 0xD3); + +DECLARE_INTERFACE_(IPowerNotify, IUnknown) +{ + DEFINE_ABSTRACT_UNKNOWN() + + STDMETHOD_(void, PowerChangeNotify)(THIS_ + IN POWER_STATE PowerState)PURE; +}; + +typedef IPowerNotify *PPOWERNOTIFY; + +#undef INTERFACE + /* =============================================================== IPinCount Interface */
15 years, 12 months
1
0
0
0
← Newer
1
2
3
4
5
6
7
8
9
...
71
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
Results per page:
10
25
50
100
200