ReactOS.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
March 2018
----- 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
25 participants
436 discussions
Start a n
N
ew thread
01/01: [DHCPCSVC] Add the ability to stop the DHCP client - Use a stop event to terminate the dispatch loop. - Report to the services manager that the service can be stopped or shut-down while it is running.
by Eric Kohl
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=9febc82acf317ea16ddb0…
commit 9febc82acf317ea16ddb04cda88e24051bacd8c4 Author: Eric Kohl <eric.kohl(a)reactos.org> AuthorDate: Wed Mar 21 21:07:26 2018 +0100 Commit: Eric Kohl <eric.kohl(a)reactos.org> CommitDate: Wed Mar 21 21:07:26 2018 +0100 [DHCPCSVC] Add the ability to stop the DHCP client - Use a stop event to terminate the dispatch loop. - Report to the services manager that the service can be stopped or shut-down while it is running. CORE-14390 --- base/services/dhcpcsvc/dhcp/dispatch.c | 48 ++++++++++++++++++++-------------- base/services/dhcpcsvc/dhcpcsvc.c | 44 +++++++++++++++---------------- base/services/dhcpcsvc/include/dhcpd.h | 2 +- 3 files changed, 51 insertions(+), 43 deletions(-) diff --git a/base/services/dhcpcsvc/dhcp/dispatch.c b/base/services/dhcpcsvc/dhcp/dispatch.c index d9ef98271a..d72e092804 100644 --- a/base/services/dhcpcsvc/dhcp/dispatch.c +++ b/base/services/dhcpcsvc/dhcp/dispatch.c @@ -63,21 +63,23 @@ void (*bootp_packet_handler)(struct interface_info *, * bootp_packet_handler hook to try to do something with it. */ void -dispatch(void) +dispatch(HANDLE hStopEvent) { int count, to_msec; struct protocol *l; time_t howlong, cur_time; - HANDLE Events[2]; - int EventCount = 1; + HANDLE Events[3]; + int EventCount = 2; Events[0] = StartAdapterDiscovery(); if (!Events[0]) return; + AdapterStateChangedEvent = Events[0]; - - Events[1] = WSA_INVALID_EVENT; - + + Events[1] = hStopEvent; + Events[2] = WSA_INVALID_EVENT; + ApiLock(); do { @@ -116,29 +118,29 @@ dispatch(void) to_msec = INFINITE; } - if (Events[1] == WSA_INVALID_EVENT && DhcpSocket != INVALID_SOCKET) + if (Events[2] == WSA_INVALID_EVENT && DhcpSocket != INVALID_SOCKET) { - Events[1] = WSACreateEvent(); - if (Events[1] != WSA_INVALID_EVENT) + Events[2] = WSACreateEvent(); + if (Events[2] != WSA_INVALID_EVENT) { - count = WSAEventSelect(DhcpSocket, Events[1], FD_READ | FD_CLOSE); + count = WSAEventSelect(DhcpSocket, Events[2], FD_READ | FD_CLOSE); if (count != NO_ERROR) { - WSACloseEvent(Events[1]); - Events[1] = WSA_INVALID_EVENT; + WSACloseEvent(Events[2]); + Events[2] = WSA_INVALID_EVENT; } else { - EventCount = 2; + EventCount = 3; } } } - else if (Events[1] != WSA_INVALID_EVENT && DhcpSocket == INVALID_SOCKET) + else if (Events[2] != WSA_INVALID_EVENT && DhcpSocket == INVALID_SOCKET) { - WSACloseEvent(Events[1]); - Events[1] = WSA_INVALID_EVENT; + WSACloseEvent(Events[2]); + Events[2] = WSA_INVALID_EVENT; - EventCount = 1; + EventCount = 2; } ApiUnlock(); @@ -153,11 +155,16 @@ dispatch(void) continue; } else if (count == WAIT_OBJECT_0 + 1) + { + /* Stop event signalled */ + break; + } + else if (count == WAIT_OBJECT_0 + 2) { /* Packet received */ - + /* WSA events are manual reset events */ - WSAResetEvent(Events[1]); + WSAResetEvent(Events[2]); } else { @@ -178,7 +185,8 @@ dispatch(void) AdapterStateChangedEvent = NULL; CloseHandle(Events[0]); - WSACloseEvent(Events[1]); + CloseHandle(Events[1]); + WSACloseEvent(Events[2]); ApiUnlock(); } diff --git a/base/services/dhcpcsvc/dhcpcsvc.c b/base/services/dhcpcsvc/dhcpcsvc.c index a96e372fc8..bfd3dbf6a5 100644 --- a/base/services/dhcpcsvc/dhcpcsvc.c +++ b/base/services/dhcpcsvc/dhcpcsvc.c @@ -16,6 +16,7 @@ static WCHAR ServiceName[] = L"DHCP"; SERVICE_STATUS_HANDLE ServiceStatusHandle = 0; SERVICE_STATUS ServiceStatus; +HANDLE hStopEvent = NULL; static HANDLE PipeHandle = INVALID_HANDLE_VALUE; @@ -328,17 +329,18 @@ UpdateServiceStatus(DWORD dwState) ServiceStatus.dwServiceType = SERVICE_WIN32_OWN_PROCESS; ServiceStatus.dwCurrentState = dwState; - ServiceStatus.dwControlsAccepted = 0; + if (dwState == SERVICE_RUNNING) + ServiceStatus.dwControlsAccepted = SERVICE_ACCEPT_SHUTDOWN | SERVICE_ACCEPT_STOP; + else + ServiceStatus.dwControlsAccepted = 0; ServiceStatus.dwWin32ExitCode = 0; ServiceStatus.dwServiceSpecificExitCode = 0; ServiceStatus.dwCheckPoint = 0; if (dwState == SERVICE_START_PENDING || - dwState == SERVICE_STOP_PENDING || - dwState == SERVICE_PAUSE_PENDING || - dwState == SERVICE_CONTINUE_PENDING) - ServiceStatus.dwWaitHint = 10000; + dwState == SERVICE_STOP_PENDING) + ServiceStatus.dwWaitHint = 1000; else ServiceStatus.dwWaitHint = 0; @@ -355,17 +357,10 @@ ServiceControlHandler(DWORD dwControl, switch (dwControl) { case SERVICE_CONTROL_STOP: + case SERVICE_CONTROL_SHUTDOWN: UpdateServiceStatus(SERVICE_STOP_PENDING); - UpdateServiceStatus(SERVICE_STOPPED); - return ERROR_SUCCESS; - - case SERVICE_CONTROL_PAUSE: - UpdateServiceStatus(SERVICE_PAUSED); - return ERROR_SUCCESS; - - case SERVICE_CONTROL_CONTINUE: - UpdateServiceStatus(SERVICE_START_PENDING); - UpdateServiceStatus(SERVICE_RUNNING); + if (hStopEvent != NULL) + SetEvent(hStopEvent); return ERROR_SUCCESS; case SERVICE_CONTROL_INTERROGATE: @@ -373,12 +368,7 @@ ServiceControlHandler(DWORD dwControl, &ServiceStatus); return ERROR_SUCCESS; - case SERVICE_CONTROL_SHUTDOWN: - UpdateServiceStatus(SERVICE_STOP_PENDING); - UpdateServiceStatus(SERVICE_STOPPED); - return ERROR_SUCCESS; - - default : + default: return ERROR_CALL_NOT_IMPLEMENTED; } } @@ -397,6 +387,16 @@ ServiceMain(DWORD argc, LPWSTR* argv) UpdateServiceStatus(SERVICE_START_PENDING); + /* Create the stop event */ + hStopEvent = CreateEventW(NULL, FALSE, FALSE, NULL); + if (hStopEvent == NULL) + { + UpdateServiceStatus(SERVICE_STOPPED); + return; + } + + UpdateServiceStatus(SERVICE_START_PENDING); + if (!init_client()) { DPRINT1("DHCPCSVC: init_client() failed!\n"); @@ -411,7 +411,7 @@ ServiceMain(DWORD argc, LPWSTR* argv) DH_DbgPrint(MID_TRACE,("Going into dispatch()\n")); DH_DbgPrint(MID_TRACE,("DHCPCSVC: DHCP service is starting up\n")); - dispatch(); + dispatch(hStopEvent); DH_DbgPrint(MID_TRACE,("DHCPCSVC: DHCP service is shutting down\n")); stop_client(); diff --git a/base/services/dhcpcsvc/include/dhcpd.h b/base/services/dhcpcsvc/include/dhcpd.h index d6a2fa405b..b7b01b4e00 100644 --- a/base/services/dhcpcsvc/include/dhcpd.h +++ b/base/services/dhcpcsvc/include/dhcpd.h @@ -351,7 +351,7 @@ extern void (*bootp_packet_handler)(struct interface_info *, struct dhcp_packet *, int, unsigned int, struct iaddr, struct hardware *); void discover_interfaces(struct interface_info *); void reinitialize_interfaces(void); -void dispatch(void); +void dispatch(HANDLE hStopEvent); void got_one(struct protocol *); void add_timeout(time_t, void (*)(void *), void *); void cancel_timeout(void (*)(void *), void *);
6 years, 9 months
1
0
0
0
02/02: [AFD] Mark the socket as named pipe, so NtWriteFile actually knows what to do with it. CORE-13067
by Mark Jansen
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=8b84b1c6b33576ff82077…
commit 8b84b1c6b33576ff8207712a109dd5fc93378c9d Author: Mark Jansen <mark.jansen(a)reactos.org> AuthorDate: Tue Mar 20 23:49:06 2018 +0100 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Wed Mar 21 19:22:13 2018 +0100 [AFD] Mark the socket as named pipe, so NtWriteFile actually knows what to do with it. CORE-13067 --- drivers/network/afd/afd/main.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/network/afd/afd/main.c b/drivers/network/afd/afd/main.c index 8f3886ef5c..04e28652c6 100644 --- a/drivers/network/afd/afd/main.c +++ b/drivers/network/afd/afd/main.c @@ -313,6 +313,7 @@ AfdCreateSocket(PDEVICE_OBJECT DeviceObject, PIRP Irp, DeviceExt = DeviceObject->DeviceExtension; FileObject = IrpSp->FileObject; + FileObject->Flags |= FO_NAMED_PIPE; //Disposition = (IrpSp->Parameters.Create.Options >> 24) & 0xff; Irp->IoStatus.Information = 0;
6 years, 9 months
1
0
0
0
01/02: [AFD] Respond to FileFsDeviceInformation. CORE-13067
by Mark Jansen
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=9168226378740cf69bbaf…
commit 9168226378740cf69bbaf18b1568be39db526fb5 Author: Mark Jansen <mark.jansen(a)reactos.org> AuthorDate: Tue Mar 20 22:15:16 2018 +0100 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Wed Mar 21 19:22:13 2018 +0100 [AFD] Respond to FileFsDeviceInformation. CORE-13067 --- drivers/network/afd/afd/main.c | 52 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/drivers/network/afd/afd/main.c b/drivers/network/afd/afd/main.c index 8cdfb1a269..8f3886ef5c 100644 --- a/drivers/network/afd/afd/main.c +++ b/drivers/network/afd/afd/main.c @@ -847,6 +847,53 @@ AfdDisconnect(PDEVICE_OBJECT DeviceObject, PIRP Irp, return UnlockAndMaybeComplete( FCB, Status, Irp, 0 ); } +NTSTATUS +AfdQueryFsDeviceInfo(PDEVICE_OBJECT DeviceObject, PFILE_FS_DEVICE_INFORMATION Buffer, PULONG Length) +{ + if (*Length >= sizeof(FILE_FS_DEVICE_INFORMATION)) + { + Buffer->Characteristics = 0; + Buffer->DeviceType = FILE_DEVICE_NAMED_PIPE; + + *Length -= sizeof(FILE_FS_DEVICE_INFORMATION); + + return STATUS_SUCCESS; + } + else + { + ASSERT(*Length >= sizeof(FILE_FS_DEVICE_INFORMATION)); + return STATUS_INFO_LENGTH_MISMATCH; + } +} + +static NTSTATUS NTAPI +AfdQueryVolumeInformation(PDEVICE_OBJECT DeviceObject, PIRP Irp, PIO_STACK_LOCATION IrpSp) +{ + FS_INFORMATION_CLASS InfoClass; + PVOID Buffer; + ULONG Length; + NTSTATUS Status = STATUS_INVALID_INFO_CLASS; + + Buffer = Irp->AssociatedIrp.SystemBuffer; + Length = IrpSp->Parameters.QueryVolume.Length; + InfoClass = IrpSp->Parameters.QueryVolume.FsInformationClass; + + switch (InfoClass) + { + case FileFsDeviceInformation: + Status = AfdQueryFsDeviceInfo(DeviceObject, Buffer, &Length); + break; + default: + break; + } + + Irp->IoStatus.Status = Status; + Irp->IoStatus.Information = IrpSp->Parameters.QueryVolume.Length - Length; + IoCompleteRequest(Irp, IO_NETWORK_INCREMENT); + + return Status; +} + static DRIVER_DISPATCH AfdDispatch; static NTSTATUS NTAPI AfdDispatch(PDEVICE_OBJECT DeviceObject, PIRP Irp) @@ -888,6 +935,10 @@ AfdDispatch(PDEVICE_OBJECT DeviceObject, PIRP Irp) case IRP_MJ_READ: return AfdConnectedSocketReadData( DeviceObject, Irp, IrpSp, TRUE ); + /* query volume info */ + case IRP_MJ_QUERY_VOLUME_INFORMATION: + return AfdQueryVolumeInformation(DeviceObject, Irp, IrpSp); + case IRP_MJ_DEVICE_CONTROL: { switch( IrpSp->Parameters.DeviceIoControl.IoControlCode ) { @@ -1265,6 +1316,7 @@ DriverEntry(PDRIVER_OBJECT DriverObject, PUNICODE_STRING RegistryPath) DriverObject->MajorFunction[IRP_MJ_WRITE] = AfdDispatch; DriverObject->MajorFunction[IRP_MJ_READ] = AfdDispatch; DriverObject->MajorFunction[IRP_MJ_DEVICE_CONTROL] = AfdDispatch; + DriverObject->MajorFunction[IRP_MJ_QUERY_VOLUME_INFORMATION] = AfdDispatch; DriverObject->DriverUnload = AfdUnload; Status = IoCreateDevice(DriverObject,
6 years, 9 months
1
0
0
0
01/01: [RICHED20_WINETEST] Sync with Wine Staging 3.3. CORE-14434
by Amine Khaldi
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=348381716e46e019ea854…
commit 348381716e46e019ea854ba65eaf5a778f09c406 Author: Amine Khaldi <amine.khaldi(a)reactos.org> AuthorDate: Wed Mar 21 13:17:51 2018 +0100 Commit: Amine Khaldi <amine.khaldi(a)reactos.org> CommitDate: Wed Mar 21 13:17:51 2018 +0100 [RICHED20_WINETEST] Sync with Wine Staging 3.3. CORE-14434 --- modules/rostests/winetests/riched20/editor.c | 33 ++ modules/rostests/winetests/riched20/richole.c | 457 ++++++++++++++++++++++++++ 2 files changed, 490 insertions(+) diff --git a/modules/rostests/winetests/riched20/editor.c b/modules/rostests/winetests/riched20/editor.c index 9bfbf45837..0e0c960ba2 100644 --- a/modules/rostests/winetests/riched20/editor.c +++ b/modules/rostests/winetests/riched20/editor.c @@ -8798,6 +8798,38 @@ static void test_para_numbering(void) DestroyWindow( edit ); } +static void test_window_classes(void) +{ + static const struct + { + const char *class; + BOOL success; + } test[] = + { + { "RichEdit", FALSE }, + { "RichEdit20A", TRUE }, + { "RichEdit20W", TRUE }, + { "RichEdit50A", FALSE }, + { "RichEdit50W", FALSE } + }; + int i; + HWND hwnd; + + for (i = 0; i < sizeof(test)/sizeof(test[0]); i++) + { + SetLastError(0xdeadbeef); + hwnd = CreateWindowExA(0, test[i].class, NULL, WS_POPUP, 0, 0, 0, 0, 0, 0, 0, NULL); +todo_wine_if(!strcmp(test[i].class, "RichEdit50A") || !strcmp(test[i].class, "RichEdit50W")) + ok(!hwnd == !test[i].success, "CreateWindow(%s) should %s\n", + test[i].class, test[i].success ? "succeed" : "fail"); + if (!hwnd) +todo_wine + ok(GetLastError() == ERROR_CANNOT_FIND_WND_CLASS, "got %d\n", GetLastError()); + else + DestroyWindow(hwnd); + } +} + START_TEST( editor ) { BOOL ret; @@ -8807,6 +8839,7 @@ START_TEST( editor ) ok(hmoduleRichEdit != NULL, "error: %d\n", (int) GetLastError()); is_lang_japanese = (PRIMARYLANGID(GetUserDefaultLangID()) == LANG_JAPANESE); + test_window_classes(); test_WM_CHAR(); test_EM_FINDTEXT(FALSE); test_EM_FINDTEXT(TRUE); diff --git a/modules/rostests/winetests/riched20/richole.c b/modules/rostests/winetests/riched20/richole.c index 656eee1ea4..3a69819630 100644 --- a/modules/rostests/winetests/riched20/richole.c +++ b/modules/rostests/winetests/riched20/richole.c @@ -3396,6 +3396,451 @@ static void test_Expand(void) ITextRange_Release(range); } +static void test_ITextRange_SetStart(void) +{ + HWND w; + IRichEditOle *reOle = NULL; + ITextDocument *txtDoc = NULL; + ITextRange *txtRge = NULL; + HRESULT hres; + LONG first, lim, start, end; + static const CHAR test_text1[] = "TestSomeText"; + + create_interfaces(&w, &reOle, &txtDoc, NULL); + SendMessageA(w, WM_SETTEXT, 0, (LPARAM)test_text1); + + first = 4, lim = 8; + ITextDocument_Range(txtDoc, first, lim, &txtRge); + hres = ITextRange_SetStart(txtRge, first); + ok(hres == S_FALSE, "ITextRange_SetStart\n"); + +#define TEST_TXTRGE_SETSTART(cp, expected_start, expected_end) \ + hres = ITextRange_SetStart(txtRge, cp); \ + ok(hres == S_OK, "ITextRange_SetStart\n"); \ + ITextRange_GetStart(txtRge, &start); \ + ITextRange_GetEnd(txtRge, &end); \ + ok(start == expected_start, "got wrong start value: %d\n", start); \ + ok(end == expected_end, "got wrong end value: %d\n", end); + + TEST_TXTRGE_SETSTART(2, 2, 8) + TEST_TXTRGE_SETSTART(-1, 0, 8) + TEST_TXTRGE_SETSTART(13, 12, 12) + + release_interfaces(&w, &reOle, &txtDoc, NULL); +} + +static void test_ITextRange_SetEnd(void) +{ + HWND w; + IRichEditOle *reOle = NULL; + ITextDocument *txtDoc = NULL; + ITextRange *txtRge = NULL; + HRESULT hres; + LONG first, lim, start, end; + static const CHAR test_text1[] = "TestSomeText"; + + create_interfaces(&w, &reOle, &txtDoc, NULL); + SendMessageA(w, WM_SETTEXT, 0, (LPARAM)test_text1); + + first = 4, lim = 8; + ITextDocument_Range(txtDoc, first, lim, &txtRge); + hres = ITextRange_SetEnd(txtRge, lim); + ok(hres == S_FALSE, "ITextRange_SetEnd\n"); + +#define TEST_TXTRGE_SETEND(cp, expected_start, expected_end) \ + hres = ITextRange_SetEnd(txtRge, cp); \ + ok(hres == S_OK, "ITextRange_SetEnd\n"); \ + ITextRange_GetStart(txtRge, &start); \ + ITextRange_GetEnd(txtRge, &end); \ + ok(start == expected_start, "got wrong start value: %d\n", start); \ + ok(end == expected_end, "got wrong end value: %d\n", end); + + TEST_TXTRGE_SETEND(6, 4, 6) + TEST_TXTRGE_SETEND(14, 4, 13) + TEST_TXTRGE_SETEND(-1, 0, 0) + + ITextRange_Release(txtRge); + release_interfaces(&w, &reOle, &txtDoc, NULL); +} + +static void test_ITextSelection_SetStart(void) +{ + HWND w; + IRichEditOle *reOle = NULL; + ITextDocument *txtDoc = NULL; + ITextSelection *txtSel = NULL; + HRESULT hres; + LONG first, lim, start, end; + static const CHAR test_text1[] = "TestSomeText"; + + create_interfaces(&w, &reOle, &txtDoc, &txtSel); + SendMessageA(w, WM_SETTEXT, 0, (LPARAM)test_text1); + + first = 4, lim = 8; + SendMessageA(w, EM_SETSEL, first, lim); + hres = ITextSelection_SetStart(txtSel, first); + ok(hres == S_FALSE, "ITextSelection_SetStart\n"); + +#define TEST_TXTSEL_SETSTART(cp, expected_start, expected_end) \ + hres = ITextSelection_SetStart(txtSel, cp); \ + ok(hres == S_OK, "ITextSelection_SetStart\n"); \ + SendMessageA(w, EM_GETSEL, (LPARAM)&start, (WPARAM)&end); \ + ok(start == expected_start, "got wrong start value: %d\n", start); \ + ok(end == expected_end, "got wrong end value: %d\n", end); + + TEST_TXTSEL_SETSTART(2, 2, 8) + TEST_TXTSEL_SETSTART(-1, 0, 8) + TEST_TXTSEL_SETSTART(13, 12, 12) + + release_interfaces(&w, &reOle, &txtDoc, &txtSel); +} + +static void test_ITextSelection_SetEnd(void) +{ + HWND w; + IRichEditOle *reOle = NULL; + ITextDocument *txtDoc = NULL; + ITextSelection *txtSel = NULL; + HRESULT hres; + LONG first, lim, start, end; + static const CHAR test_text1[] = "TestSomeText"; + + create_interfaces(&w, &reOle, &txtDoc, &txtSel); + SendMessageA(w, WM_SETTEXT, 0, (LPARAM)test_text1); + + first = 4, lim = 8; + SendMessageA(w, EM_SETSEL, first, lim); + hres = ITextSelection_SetEnd(txtSel, lim); + ok(hres == S_FALSE, "ITextSelection_SetEnd\n"); + +#define TEST_TXTSEL_SETEND(cp, expected_start, expected_end) \ + hres = ITextSelection_SetEnd(txtSel, cp); \ + ok(hres == S_OK, "ITextSelection_SetEnd\n"); \ + SendMessageA(w, EM_GETSEL, (LPARAM)&start, (WPARAM)&end); \ + ok(start == expected_start, "got wrong start value: %d\n", start); \ + ok(end == expected_end, "got wrong end value: %d\n", end); + + TEST_TXTSEL_SETEND(6, 4, 6) + TEST_TXTSEL_SETEND(14, 4, 13) + TEST_TXTSEL_SETEND(-1, 0, 0) + + release_interfaces(&w, &reOle, &txtDoc, &txtSel); +} + +static void test_ITextRange_GetFont(void) +{ + HWND w; + IRichEditOle *reOle = NULL; + ITextDocument *txtDoc = NULL; + ITextRange *txtRge = NULL; + ITextFont *txtFont = NULL, *txtFont1 = NULL; + HRESULT hres; + int first, lim; + int refcount; + static const CHAR test_text1[] = "TestSomeText"; + LONG value; + + create_interfaces(&w, &reOle, &txtDoc, NULL); + SendMessageA(w, WM_SETTEXT, 0, (LPARAM)test_text1); + + first = 4, lim = 4; + ITextDocument_Range(txtDoc, first, lim, &txtRge); + refcount = get_refcount((IUnknown *)txtRge); + ok(refcount == 1, "got wrong ref count: %d\n", refcount); + + hres = ITextRange_GetFont(txtRge, &txtFont); + ok(hres == S_OK, "ITextRange_GetFont\n"); + refcount = get_refcount((IUnknown *)txtFont); + ok(refcount == 1, "got wrong ref count: %d\n", refcount); + refcount = get_refcount((IUnknown *)txtRge); + ok(refcount == 2, "got wrong ref count: %d\n", refcount); + + hres = ITextRange_GetFont(txtRge, &txtFont1); + ok(hres == S_OK, "ITextRange_GetFont\n"); + ok(txtFont1 != txtFont, "A new pointer should be return\n"); + refcount = get_refcount((IUnknown *)txtFont1); + ok(refcount == 1, "got wrong ref count: %d\n", refcount); + ITextFont_Release(txtFont1); + refcount = get_refcount((IUnknown *)txtRge); + ok(refcount == 2, "got wrong ref count: %d\n", refcount); + + ITextRange_Release(txtRge); + release_interfaces(&w, &reOle, &txtDoc, NULL); + + hres = ITextFont_GetOutline(txtFont, &value); + ok(hres == CO_E_RELEASED, "ITextFont after ITextDocument destroyed\n"); + + ITextFont_Release(txtFont); +} + +static void test_ITextSelection_GetFont(void) +{ + HWND w; + IRichEditOle *reOle = NULL; + ITextDocument *txtDoc = NULL; + ITextSelection *txtSel = NULL; + ITextFont *txtFont = NULL, *txtFont1 = NULL; + HRESULT hres; + int first, lim; + int refcount; + static const CHAR test_text1[] = "TestSomeText"; + LONG value; + + create_interfaces(&w, &reOle, &txtDoc, &txtSel); + SendMessageA(w, WM_SETTEXT, 0, (LPARAM)test_text1); + + first = 4, lim = 4; + SendMessageA(w, EM_SETSEL, first, lim); + refcount = get_refcount((IUnknown *)txtSel); + ok(refcount == 2, "got wrong ref count: %d\n", refcount); + + hres = ITextSelection_GetFont(txtSel, &txtFont); + ok(hres == S_OK, "ITextSelection_GetFont\n"); + refcount = get_refcount((IUnknown *)txtFont); + ok(refcount == 1, "got wrong ref count: %d\n", refcount); + refcount = get_refcount((IUnknown *)txtSel); + ok(refcount == 3, "got wrong ref count: %d\n", refcount); + + hres = ITextSelection_GetFont(txtSel, &txtFont1); + ok(hres == S_OK, "ITextSelection_GetFont\n"); + ok(txtFont1 != txtFont, "A new pointer should be return\n"); + refcount = get_refcount((IUnknown *)txtFont1); + ok(refcount == 1, "got wrong ref count: %d\n", refcount); + ITextFont_Release(txtFont1); + refcount = get_refcount((IUnknown *)txtSel); + ok(refcount == 3, "got wrong ref count: %d\n", refcount); + + release_interfaces(&w, &reOle, &txtDoc, &txtSel); + + hres = ITextFont_GetOutline(txtFont, &value); + ok(hres == CO_E_RELEASED, "ITextFont after ITextDocument destroyed\n"); + + ITextFont_Release(txtFont); +} + +static void test_ITextRange_GetPara(void) +{ + HWND w; + IRichEditOle *reOle = NULL; + ITextDocument *txtDoc = NULL; + ITextRange *txtRge = NULL; + ITextPara *txtPara = NULL, *txtPara1 = NULL; + HRESULT hres; + int first, lim; + int refcount; + static const CHAR test_text1[] = "TestSomeText"; + LONG value; + + create_interfaces(&w, &reOle, &txtDoc, NULL); + SendMessageA(w, WM_SETTEXT, 0, (LPARAM)test_text1); + + first = 4, lim = 4; + ITextDocument_Range(txtDoc, first, lim, &txtRge); + refcount = get_refcount((IUnknown *)txtRge); + ok(refcount == 1, "got wrong ref count: %d\n", refcount); + + hres = ITextRange_GetPara(txtRge, &txtPara); + ok(hres == S_OK, "ITextRange_GetPara\n"); + refcount = get_refcount((IUnknown *)txtPara); + ok(refcount == 1, "got wrong ref count: %d\n", refcount); + refcount = get_refcount((IUnknown *)txtRge); + ok(refcount == 2, "got wrong ref count: %d\n", refcount); + + hres = ITextRange_GetPara(txtRge, &txtPara1); + ok(hres == S_OK, "ITextRange_GetPara\n"); + ok(txtPara1 != txtPara, "A new pointer should be return\n"); + refcount = get_refcount((IUnknown *)txtPara1); + ok(refcount == 1, "got wrong ref count: %d\n", refcount); + ITextPara_Release(txtPara1); + refcount = get_refcount((IUnknown *)txtRge); + ok(refcount == 2, "got wrong ref count: %d\n", refcount); + + ITextRange_Release(txtRge); + release_interfaces(&w, &reOle, &txtDoc, NULL); + + hres = ITextPara_GetStyle(txtPara, &value); + ok(hres == CO_E_RELEASED, "ITextPara after ITextDocument destroyed\n"); + + ITextPara_Release(txtPara); +} + +static void test_ITextRange_GetText(void) +{ + HWND w; + IRichEditOle *reOle = NULL; + ITextDocument *txtDoc = NULL; + ITextRange *txtRge = NULL; + HRESULT hres; + BSTR bstr = NULL; + static const CHAR test_text1[] = "TestSomeText"; + static const WCHAR bufW1[] = {'T', 'e', 's', 't', 0}; + static const WCHAR bufW2[] = {'T', 'e', 'x', 't', '\r', 0}; + static const WCHAR bufW3[] = {'T', 'e', 'x', 't', 0}; + static const WCHAR bufW4[] = {'T', 'e', 's', 't', 'S', 'o', 'm', + 'e', 'T', 'e', 'x', 't', '\r', 0}; + static const WCHAR bufW5[] = {'\r', 0}; + + +#define TEST_TXTRGE_GETTEXT(first, lim, expected_string) \ + create_interfaces(&w, &reOle, &txtDoc, NULL); \ + SendMessageA(w, WM_SETTEXT, 0, (LPARAM)test_text1); \ + ITextDocument_Range(txtDoc, first, lim, &txtRge); \ + hres = ITextRange_GetText(txtRge, &bstr); \ + ok(hres == S_OK, "ITextRange_GetText\n"); \ + ok(!lstrcmpW(bstr, expected_string), "got wrong text: %s\n", wine_dbgstr_w(bstr)); \ + SysFreeString(bstr); \ + ITextRange_Release(txtRge); \ + release_interfaces(&w, &reOle, &txtDoc, NULL); + + TEST_TXTRGE_GETTEXT(0, 4, bufW1) + TEST_TXTRGE_GETTEXT(4, 0, bufW1) + TEST_TXTRGE_GETTEXT(8, 12, bufW3) + TEST_TXTRGE_GETTEXT(8, 13, bufW2) + TEST_TXTRGE_GETTEXT(12, 13, bufW5) + TEST_TXTRGE_GETTEXT(0, 13, bufW4) + TEST_TXTRGE_GETTEXT(1, 1, NULL) +} + +static void test_ITextRange_SetRange(void) +{ + HWND w; + IRichEditOle *reOle = NULL; + ITextDocument *txtDoc = NULL; + ITextRange *txtRge = NULL; + HRESULT hres; + int start, end; + static const CHAR test_text1[] = "TestSomeText"; + + create_interfaces(&w, &reOle, &txtDoc, NULL); + SendMessageA(w, WM_SETTEXT, 0, (LPARAM)test_text1); + ITextDocument_Range(txtDoc, 0, 0, &txtRge); + +#define TEST_TXTRGE_SETRANGE(first, lim, expected_start, expected_end, expected_return) \ + hres = ITextRange_SetRange(txtRge, first, lim); \ + ok(hres == expected_return, "ITextRange_SetRange\n"); \ + ITextRange_GetStart(txtRge, &start); \ + ITextRange_GetEnd(txtRge, &end); \ + ok(start == expected_start, "got wrong start value: %d\n", start); \ + ok(end == expected_end, "got wrong end value: %d\n", end); + + TEST_TXTRGE_SETRANGE(2, 4, 2, 4, S_OK) + TEST_TXTRGE_SETRANGE(2, 4, 2, 4, S_FALSE) + TEST_TXTRGE_SETRANGE(4, 2, 2, 4, S_FALSE) + TEST_TXTRGE_SETRANGE(14, 14, 12, 12, S_OK) + TEST_TXTRGE_SETRANGE(15, 15, 12, 12, S_FALSE) + TEST_TXTRGE_SETRANGE(14, 1, 1, 13, S_OK) + TEST_TXTRGE_SETRANGE(-1, 4, 0, 4, S_OK) + + ITextRange_Release(txtRge); + release_interfaces(&w, &reOle, &txtDoc, NULL); +} + +static void test_ITextRange_IsEqual2(void) +{ + HWND w; + IRichEditOle *reOle = NULL; + ITextDocument *txtDoc = NULL; + ITextRange *txtRge1 = NULL, *txtRge2 = NULL; + HRESULT hres; + static const CHAR test_text1[] = "TestSomeText"; + LONG res; + + create_interfaces(&w, &reOle, &txtDoc, NULL); + SendMessageA(w, WM_SETTEXT, 0, (LPARAM)test_text1); + ITextDocument_Range(txtDoc, 2, 4, &txtRge1); + ITextDocument_Range(txtDoc, 2, 4, &txtRge2); + +#define TEST_TXTRGE_ISEQUAL(expected_hres, expected_res) \ + hres = ITextRange_IsEqual(txtRge1, txtRge2, &res); \ + ok(hres == expected_hres, "ITextRange_IsEqual\n"); \ + ok(res == expected_res, "got wrong return value: %d\n", res); + + TEST_TXTRGE_ISEQUAL(S_OK, tomTrue) + ITextRange_SetRange(txtRge2, 1, 2); + TEST_TXTRGE_ISEQUAL(S_FALSE, tomFalse) + + ITextRange_SetRange(txtRge1, 1, 1); + ITextRange_SetRange(txtRge2, 2, 2); + TEST_TXTRGE_ISEQUAL(S_FALSE, tomFalse) + + ITextRange_SetRange(txtRge2, 1, 1); + TEST_TXTRGE_ISEQUAL(S_OK, tomTrue) + + hres = ITextRange_IsEqual(txtRge1, txtRge1, &res); + ok(hres == S_OK, "ITextRange_IsEqual\n"); + ok(res == tomTrue, "got wrong return value: %d\n", res); + + hres = ITextRange_IsEqual(txtRge1, txtRge2, NULL); + ok(hres == S_OK, "ITextRange_IsEqual\n"); + + hres = ITextRange_IsEqual(txtRge1, NULL, NULL); + ok(hres == S_FALSE, "ITextRange_IsEqual\n"); + + ITextRange_Release(txtRge1); + ITextRange_Release(txtRge2); + release_interfaces(&w, &reOle, &txtDoc, NULL); +} + +static void test_ITextRange_GetStoryLength(void) +{ + HWND w; + IRichEditOle *reOle = NULL; + ITextDocument *txtDoc = NULL; + ITextRange *txtRge = NULL; + HRESULT hres; + LONG count; + static const CHAR test_text1[] = "TestSomeText"; + int len = strlen(test_text1) + 1; + + create_interfaces(&w, &reOle, &txtDoc, NULL); + SendMessageA(w, WM_SETTEXT, 0, (LPARAM)test_text1); + ITextDocument_Range(txtDoc, 0, 0, &txtRge); + + hres = ITextRange_GetStoryLength(txtRge, &count); + ok(hres == S_OK, "ITextRange_GetStoryLength\n"); + ok(count == len, "got wrong length: %d\n", count); + + ITextRange_SetRange(txtRge, 1, 2); + hres = ITextRange_GetStoryLength(txtRge, &count); + ok(hres == S_OK, "ITextRange_GetStoryLength\n"); + ok(count == len, "got wrong length: %d\n", count); + + hres = ITextRange_GetStoryLength(txtRge, NULL); + ok(hres == E_INVALIDARG, "ITextRange_GetStoryLength\n"); + + ITextRange_Release(txtRge); + release_interfaces(&w, &reOle, &txtDoc, NULL); +} + +static void test_ITextSelection_GetStoryLength(void) +{ + HWND w; + IRichEditOle *reOle = NULL; + ITextDocument *txtDoc = NULL; + ITextSelection *txtSel = NULL; + HRESULT hres; + LONG count; + static const CHAR test_text1[] = "TestSomeText"; + int len = strlen(test_text1) + 1; + + create_interfaces(&w, &reOle, &txtDoc, &txtSel); + SendMessageA(w, WM_SETTEXT, 0, (LPARAM)test_text1); + + hres = ITextSelection_GetStoryLength(txtSel, &count); + ok(hres == S_OK, "ITextSelection_GetStoryLength\n"); + ok(count == len, "got wrong length: %d\n", count); + + SendMessageA(w, EM_SETSEL, 1, 2); + hres = ITextSelection_GetStoryLength(txtSel, &count); + ok(hres == S_OK, "ITextSelection_GetStoryLength\n"); + ok(count == len, "got wrong length: %d\n", count); + + hres = ITextSelection_GetStoryLength(txtSel, NULL); + ok(hres == E_INVALIDARG, "ITextSelection_GetStoryLength\n"); + + release_interfaces(&w, &reOle, &txtDoc, &txtSel); +} + START_TEST(richole) { /* Must explicitly LoadLibrary(). The test has no references to functions in @@ -3408,13 +3853,25 @@ START_TEST(richole) test_GetText(); test_ITextSelection_GetChar(); test_ITextSelection_GetStart_GetEnd(); + test_ITextSelection_SetStart(); + test_ITextSelection_SetEnd(); test_ITextSelection_Collapse(); + test_ITextSelection_GetFont(); + test_ITextSelection_GetStoryLength(); test_ITextDocument_Range(); test_ITextRange_GetChar(); test_ITextRange_ScrollIntoView(); test_ITextRange_GetStart_GetEnd(); test_ITextRange_GetDuplicate(); + test_ITextRange_SetStart(); + test_ITextRange_SetEnd(); test_ITextRange_Collapse(); + test_ITextRange_GetFont(); + test_ITextRange_GetPara(); + test_ITextRange_GetText(); + test_ITextRange_SetRange(); + test_ITextRange_IsEqual2(); + test_ITextRange_GetStoryLength(); test_GetClientSite(); test_IOleWindow_GetWindow(); test_IOleInPlaceSite_GetWindow();
6 years, 9 months
1
0
0
0
01/01: [RICHED20] Sync with Wine Staging 3.3. CORE-14434
by Amine Khaldi
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=056bdefe4702ed80189cb…
commit 056bdefe4702ed80189cbf4385718adee860d08f Author: Amine Khaldi <amine.khaldi(a)reactos.org> AuthorDate: Wed Mar 21 13:17:10 2018 +0100 Commit: Amine Khaldi <amine.khaldi(a)reactos.org> CommitDate: Wed Mar 21 13:17:10 2018 +0100 [RICHED20] Sync with Wine Staging 3.3. CORE-14434 --- dll/win32/riched20/CMakeLists.txt | 4 +- dll/win32/riched20/caret.c | 2 +- dll/win32/riched20/clipboard.c | 2 + dll/win32/riched20/editor.c | 50 +++---- dll/win32/riched20/editor.h | 58 +------- dll/win32/riched20/editstr.h | 30 ++++ dll/win32/riched20/list.c | 6 +- dll/win32/riched20/paint.c | 16 +-- dll/win32/riched20/precomp.h | 18 +++ dll/win32/riched20/reader.c | 11 ++ dll/win32/riched20/richole.c | 293 +++++++++++++++++++++++++++++++++++--- dll/win32/riched20/rtf.h | 10 ++ dll/win32/riched20/run.c | 9 +- dll/win32/riched20/style.c | 7 +- dll/win32/riched20/table.c | 4 +- dll/win32/riched20/txthost.c | 11 ++ dll/win32/riched20/txtsrv.c | 14 +- dll/win32/riched20/version.rc | 1 + dll/win32/riched20/writer.c | 20 +-- media/doc/README.WINE | 2 +- 20 files changed, 435 insertions(+), 133 deletions(-) diff --git a/dll/win32/riched20/CMakeLists.txt b/dll/win32/riched20/CMakeLists.txt index 002fc5ad9b..a135a70b2a 100644 --- a/dll/win32/riched20/CMakeLists.txt +++ b/dll/win32/riched20/CMakeLists.txt @@ -21,7 +21,7 @@ list(APPEND SOURCE undo.c wrap.c writer.c - editor.h) + precomp.h) if(MSVC) if(ARCH STREQUAL "i386") @@ -49,5 +49,5 @@ add_dependencies(riched20 stdole2) set_module_type(riched20 win32dll) target_link_libraries(riched20 wine uuid) add_importlibs(riched20 ole32 oleaut32 usp10 imm32 user32 gdi32 msvcrt kernel32 ntdll) -add_pch(riched20 editor.h SOURCE) +add_pch(riched20 precomp.h SOURCE) add_cd_file(TARGET riched20 DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/riched20/caret.c b/dll/win32/riched20/caret.c index 8a99394dcb..d676a1bc38 100644 --- a/dll/win32/riched20/caret.c +++ b/dll/win32/riched20/caret.c @@ -484,7 +484,7 @@ void ME_InsertOLEFromCursor(ME_TextEditor *editor, const REOBJECT* reo, int nCur di = ME_InternalInsertTextFromCursor(editor, nCursor, &space, 1, pStyle, MERF_GRAPHICS); - di->member.run.ole_obj = ALLOC_OBJ(*reo); + di->member.run.ole_obj = heap_alloc(sizeof(*reo)); ME_CopyReObject(di->member.run.ole_obj, reo); ME_ReleaseStyle(pStyle); } diff --git a/dll/win32/riched20/clipboard.c b/dll/win32/riched20/clipboard.c index 5328730561..578fb02fd9 100644 --- a/dll/win32/riched20/clipboard.c +++ b/dll/win32/riched20/clipboard.c @@ -18,6 +18,8 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#define NONAMELESSUNION + #include "editor.h" WINE_DEFAULT_DEBUG_CHANNEL(richedit); diff --git a/dll/win32/riched20/editor.c b/dll/win32/riched20/editor.c index 20ffb0cdc1..c0843dd4e5 100644 --- a/dll/win32/riched20/editor.c +++ b/dll/win32/riched20/editor.c @@ -224,14 +224,21 @@ * */ -#include "editor.h" - -#include <commdlg.h> -#include <undocuser.h> +#define NONAMELESSUNION +#include "editor.h" +#include "commdlg.h" +#include "winreg.h" +#define NO_SHLWAPI_STREAM +#include "shlwapi.h" #include "rtf.h" +#include "imm.h" #include "res.h" +#ifdef __REACTOS__ +#include <reactos/undocuser.h> +#endif + #define STACK_SIZE_DEFAULT 100 #define STACK_SIZE_MAX 1000 @@ -258,9 +265,7 @@ static inline BOOL is_version_nt(void) } static ME_TextBuffer *ME_MakeText(void) { - - ME_TextBuffer *buf = ALLOC_OBJ(ME_TextBuffer); - + ME_TextBuffer *buf = heap_alloc(sizeof(*buf)); ME_DisplayItem *p1 = ME_MakeDI(diTextStart); ME_DisplayItem *p2 = ME_MakeDI(diTextEnd); @@ -603,8 +608,7 @@ void ME_RTFParAttrHook(RTF_Info *info) if (!info->editor->bEmulateVersion10) /* v4.1 */ { while (info->rtfParam > info->nestingLevel) { - RTFTable *tableDef = ALLOC_OBJ(RTFTable); - ZeroMemory(tableDef, sizeof(RTFTable)); + RTFTable *tableDef = heap_alloc_zero(sizeof(*tableDef)); tableDef->parent = info->tableDef; info->tableDef = tableDef; @@ -638,10 +642,7 @@ void ME_RTFParAttrHook(RTF_Info *info) { RTFTable *tableDef; if (!info->tableDef) - { - info->tableDef = ALLOC_OBJ(RTFTable); - ZeroMemory(info->tableDef, sizeof(RTFTable)); - } + info->tableDef = heap_alloc_zero(sizeof(*info->tableDef)); tableDef = info->tableDef; RTFFlushOutputBuffer(info); if (tableDef->tableRowStart && @@ -2139,12 +2140,12 @@ static int ME_GetTextRange(ME_TextEditor *editor, WCHAR *strText, return ME_GetTextW(editor, strText, INT_MAX, start, nLen, FALSE, FALSE); } else { int nChars; - WCHAR *p = ALLOC_N_OBJ(WCHAR, nLen+1); + WCHAR *p = heap_alloc((nLen+1) * sizeof(*p)); if (!p) return 0; nChars = ME_GetTextW(editor, p, nLen, start, nLen, FALSE, FALSE); WideCharToMultiByte(CP_ACP, 0, p, nChars+1, (char *)strText, nLen+1, NULL, NULL); - FREE_OBJ(p); + heap_free(p); return nChars; } } @@ -2990,7 +2991,7 @@ static BOOL ME_ShowContextMenu(ME_TextEditor *editor, int x, int y) ME_TextEditor *ME_MakeEditor(ITextHost *texthost, BOOL bEmulateVersion10) { - ME_TextEditor *ed = ALLOC_OBJ(ME_TextEditor); + ME_TextEditor *ed = heap_alloc(sizeof(*ed)); int i; DWORD props; LONG selbarwidth; @@ -3024,7 +3025,7 @@ ME_TextEditor *ME_MakeEditor(ITextHost *texthost, BOOL bEmulateVersion10) * or paragraph selection. */ ed->nCursors = 4; - ed->pCursors = ALLOC_N_OBJ(ME_Cursor, ed->nCursors); + ed->pCursors = heap_alloc(ed->nCursors * sizeof(*ed->pCursors)); ME_SetCursorToStart(ed, &ed->pCursors[0]); ed->pCursors[1] = ed->pCursors[0]; ed->pCursors[2] = ed->pCursors[0]; @@ -3157,10 +3158,9 @@ void ME_DestroyEditor(ME_TextEditor *editor) } OleUninitialize(); - FREE_OBJ(editor->pBuffer); - FREE_OBJ(editor->pCursors); - - FREE_OBJ(editor); + heap_free(editor->pBuffer); + heap_free(editor->pCursors); + heap_free(editor); } BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) @@ -4299,10 +4299,10 @@ LRESULT ME_HandleMessage(ME_TextEditor *editor, UINT msg, WPARAM wParam, int nChars = MultiByteToWideChar(CP_ACP, 0, ft->lpstrText, -1, NULL, 0); WCHAR *tmp; - if ((tmp = ALLOC_N_OBJ(WCHAR, nChars)) != NULL) + if ((tmp = heap_alloc(nChars * sizeof(*tmp))) != NULL) MultiByteToWideChar(CP_ACP, 0, ft->lpstrText, -1, tmp, nChars); r = ME_FindText(editor, wParam, &ft->chrg, tmp, NULL); - FREE_OBJ( tmp ); + heap_free(tmp); }else{ FINDTEXTW *ft = (FINDTEXTW *)lParam; r = ME_FindText(editor, wParam, &ft->chrg, ft->lpstrText, NULL); @@ -4317,10 +4317,10 @@ LRESULT ME_HandleMessage(ME_TextEditor *editor, UINT msg, WPARAM wParam, int nChars = MultiByteToWideChar(CP_ACP, 0, ex->lpstrText, -1, NULL, 0); WCHAR *tmp; - if ((tmp = ALLOC_N_OBJ(WCHAR, nChars)) != NULL) + if ((tmp = heap_alloc(nChars * sizeof(*tmp))) != NULL) MultiByteToWideChar(CP_ACP, 0, ex->lpstrText, -1, tmp, nChars); r = ME_FindText(editor, wParam, &ex->chrg, tmp, &ex->chrgText); - FREE_OBJ( tmp ); + heap_free(tmp); }else{ FINDTEXTEXW *ex = (FINDTEXTEXW *)lParam; r = ME_FindText(editor, wParam, &ex->chrg, ex->lpstrText, &ex->chrgText); diff --git a/dll/win32/riched20/editor.h b/dll/win32/riched20/editor.h index 8da0ed94d7..a4f53138f8 100644 --- a/dll/win32/riched20/editor.h +++ b/dll/win32/riched20/editor.h @@ -18,67 +18,15 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#ifndef _RICHED20_EDITOR_H -#define _RICHED20_EDITOR_H - -#include <config.h> - -#include <assert.h> -#include <stdio.h> - -#ifndef _WIN32_IE -#define _WIN32_IE 0x0400 -#endif - -#define WIN32_NO_STATUS -#define _INC_WINDOWS -#define COM_NO_WINDOWS_H - -#define COBJMACROS -#define NONAMELESSUNION -#define NONAMELESSSTRUCT - -#include <windef.h> -#include <winbase.h> -#include <wingdi.h> -#include <winuser.h> -#include <richedit.h> -#include <ole2.h> -#include <richole.h> -#include <imm.h> -#include <textserv.h> -#include <tom.h> -#include <usp10.h> - -#include <wine/debug.h> -#include <wine/list.h> -#include <wine/unicode.h> +#pragma once #include "editstr.h" +#include "wine/unicode.h" struct _RTF_Info; extern HANDLE me_heap DECLSPEC_HIDDEN; -static inline void * __WINE_ALLOC_SIZE(1) heap_alloc( size_t len ) -{ - return HeapAlloc( me_heap, 0, len ); -} - -static inline BOOL heap_free( void *ptr ) -{ - return HeapFree( me_heap, 0, ptr ); -} - -static inline void * __WINE_ALLOC_SIZE(2) heap_realloc( void *ptr, size_t len ) -{ - return HeapReAlloc( me_heap, 0, ptr, len ); -} - -#define ALLOC_OBJ(type) heap_alloc(sizeof(type)) -#define ALLOC_N_OBJ(type, count) heap_alloc((count)*sizeof(type)) -#define FREE_OBJ(ptr) heap_free(ptr) - #define RUN_IS_HIDDEN(run) ((run)->style->fmt.dwMask & CFM_HIDDEN \ && (run)->style->fmt.dwEffects & CFE_HIDDEN) @@ -393,5 +341,3 @@ LRESULT ME_StreamOut(ME_TextEditor *editor, DWORD dwFormat, EDITSTREAM *stream) HRESULT ME_GetDataObject(ME_TextEditor *editor, const ME_Cursor *start, int nChars, LPDATAOBJECT *lplpdataobj) DECLSPEC_HIDDEN; void release_typelib(void) DECLSPEC_HIDDEN; - -#endif /* _RICHED20_EDITOR_H */ diff --git a/dll/win32/riched20/editstr.h b/dll/win32/riched20/editstr.h index ac7ca31607..a37c4de46e 100644 --- a/dll/win32/riched20/editstr.h +++ b/dll/win32/riched20/editstr.h @@ -21,6 +21,36 @@ #ifndef __EDITSTR_H #define __EDITSTR_H +#ifndef _WIN32_IE +#define _WIN32_IE 0x0400 +#endif + +#include <assert.h> +#include <stdarg.h> +#include <stdio.h> +#include <stdlib.h> +#include <limits.h> + +#define COBJMACROS + +#include <windef.h> +#include <winbase.h> +#include <winnls.h> +#include <winnt.h> +#include <wingdi.h> +#include <winuser.h> +#include <richedit.h> +#include <commctrl.h> +#include <ole2.h> +#include <richole.h> +#include "imm.h" +#include <textserv.h> +#include "usp10.h" + +#include "wine/debug.h" +#include "wine/heap.h" +#include "wine/list.h" + #ifdef __i386__ extern const struct ITextHostVtbl itextHostStdcallVtbl DECLSPEC_HIDDEN; #endif /* __i386__ */ diff --git a/dll/win32/riched20/list.c b/dll/win32/riched20/list.c index d321446684..58b64e8081 100644 --- a/dll/win32/riched20/list.c +++ b/dll/win32/riched20/list.c @@ -174,13 +174,13 @@ void ME_DestroyDisplayItem(ME_DisplayItem *item) heap_free( item->member.run.clusters ); ME_ReleaseStyle(item->member.run.style); } - FREE_OBJ(item); + heap_free(item); } ME_DisplayItem *ME_MakeDI(ME_DIType type) { - ME_DisplayItem *item = ALLOC_OBJ(ME_DisplayItem); - ZeroMemory(item, sizeof(ME_DisplayItem)); + ME_DisplayItem *item = heap_alloc_zero(sizeof(*item)); + item->type = type; item->prev = item->next = NULL; return item; diff --git a/dll/win32/riched20/paint.c b/dll/win32/riched20/paint.c index b4b6697165..fcc4e105a3 100644 --- a/dll/win32/riched20/paint.c +++ b/dll/win32/riched20/paint.c @@ -216,9 +216,11 @@ static COLORREF get_back_color( ME_Context *c, ME_Style *style, BOOL highlight ) return color; } -static void get_underline_pen( ME_Style *style, COLORREF color, HPEN *pen ) +static HPEN get_underline_pen( ME_Style *style, COLORREF color ) { - *pen = NULL; + if (style->fmt.dwEffects & CFE_LINK) + return CreatePen( PS_SOLID, 1, color ); + /* Choose the pen type for underlining the text. */ if (style->fmt.dwEffects & CFE_UNDERLINE) { @@ -227,11 +229,9 @@ static void get_underline_pen( ME_Style *style, COLORREF color, HPEN *pen ) case CFU_UNDERLINE: case CFU_UNDERLINEWORD: /* native seems to map it to simple underline (MSDN) */ case CFU_UNDERLINEDOUBLE: /* native seems to map it to simple underline (MSDN) */ - *pen = CreatePen( PS_SOLID, 1, color ); - break; + return CreatePen( PS_SOLID, 1, color ); case CFU_UNDERLINEDOTTED: - *pen = CreatePen( PS_DOT, 1, color ); - break; + return CreatePen( PS_DOT, 1, color ); default: FIXME( "Unknown underline type (%u)\n", style->fmt.bUnderlineType ); /* fall through */ @@ -240,14 +240,14 @@ static void get_underline_pen( ME_Style *style, COLORREF color, HPEN *pen ) break; } } - return; + return NULL; } static void draw_underline( ME_Context *c, ME_Run *run, int x, int y, COLORREF color ) { HPEN pen; - get_underline_pen( run->style, color, &pen ); + pen = get_underline_pen( run->style, color ); if (pen) { HPEN old_pen = SelectObject( c->hDC, pen ); diff --git a/dll/win32/riched20/precomp.h b/dll/win32/riched20/precomp.h new file mode 100644 index 0000000000..b492ada097 --- /dev/null +++ b/dll/win32/riched20/precomp.h @@ -0,0 +1,18 @@ + +#ifndef _RICHED20_PRECOMP_H +#define _RICHED20_PRECOMP_H + +#include <wine/config.h> + +#define WIN32_NO_STATUS +#define _INC_WINDOWS +#define COM_NO_WINDOWS_H + +#define NONAMELESSUNION +#define NONAMELESSSTRUCT + +#include "editor.h" + +#include <tom.h> + +#endif /* !_RICHED20_PRECOMP_H */ diff --git a/dll/win32/riched20/reader.c b/dll/win32/riched20/reader.c index 57d7d2329f..03101090b3 100644 --- a/dll/win32/riched20/reader.c +++ b/dll/win32/riched20/reader.c @@ -36,6 +36,17 @@ * any purpose whatsoever. */ +#include <stdio.h> +#include <ctype.h> +#include <string.h> +#include <stdarg.h> +#include <stdlib.h> +#include <assert.h> + +#include "windef.h" +#include "winbase.h" +#include "wine/debug.h" + #include "editor.h" #include "rtf.h" diff --git a/dll/win32/riched20/richole.c b/dll/win32/riched20/richole.c index b04b6b10a3..170c426e8a 100644 --- a/dll/win32/riched20/richole.c +++ b/dll/win32/riched20/richole.c @@ -19,13 +19,27 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#include <stdarg.h> + +#define NONAMELESSUNION +#define COBJMACROS + +#include "windef.h" +#include "winbase.h" +#include "wingdi.h" +#include "winuser.h" +#include "ole2.h" +#include "richole.h" #include "editor.h" +#include "richedit.h" +#include "tom.h" +#include "wine/debug.h" WINE_DEFAULT_DEBUG_CHANNEL(richedit); /* there is no way to be consistent across different sets of headers - mingw, Wine, Win32 SDK*/ -#include <initguid.h> +#include "initguid.h" DEFINE_GUID(LIBID_tom, 0x8cc497c9, 0xa1df, 0x11ce, 0x80, 0x98, 0x00, 0xaa, 0x00, 0x47, 0xbe, 0x5d); DEFINE_GUID(IID_ITextServices, 0x8d33f740, 0xcf58, 0x11ce, 0xa8, 0x9d, 0x00, 0xaa, 0x00, 0x6c, 0xad, 0xc5); @@ -936,6 +950,14 @@ static HRESULT WINAPI IRichEditOleImpl_inner_fnQueryInterface(IUnknown *iface, R IUnknown_AddRef((IUnknown *)*ppvObj); return S_OK; } + + if (IsEqualGUID(riid, &IID_ITextServices)) + { + static int once; + if (!once++) FIXME("%p: unhandled interface IID_ITextServices\n", This); + return E_NOINTERFACE; + } + FIXME("%p: unhandled interface %s\n", This, debugstr_guid(riid)); return E_NOINTERFACE; @@ -1971,6 +1993,23 @@ static HRESULT WINAPI ITextRange_fnSetIndex(ITextRange *me, LONG unit, LONG inde return E_NOTIMPL; } +static void cp2range(ME_TextEditor *editor, LONG *cp1, LONG *cp2) +{ + int len = ME_GetTextLength(editor) + 1; + *cp1 = max(*cp1, 0); + *cp2 = max(*cp2, 0); + *cp1 = min(*cp1, len); + *cp2 = min(*cp2, len); + if (*cp1 > *cp2) + { + int tmp = *cp1; + *cp1 = *cp2; + *cp2 = tmp; + } + if (*cp1 == len) + *cp1 = *cp2 = len - 1; +} + static HRESULT WINAPI ITextRange_fnSetRange(ITextRange *me, LONG anchor, LONG active) { ITextRangeImpl *This = impl_from_ITextRange(me); @@ -1980,7 +2019,13 @@ static HRESULT WINAPI ITextRange_fnSetRange(ITextRange *me, LONG anchor, LONG ac if (!This->child.reole) return CO_E_RELEASED; - return E_NOTIMPL; + cp2range(This->child.reole->editor, &anchor, &active); + if (anchor == This->start && active == This->end) + return S_FALSE; + + This->start = anchor; + This->end = active; + return S_OK; } static HRESULT textrange_inrange(LONG start, LONG end, ITextRange *range, LONG *ret) @@ -2593,6 +2638,10 @@ static HRESULT WINAPI TextFont_SetDuplicate(ITextFont *iface, ITextFont *pFont) { ITextFontImpl *This = impl_from_ITextFont(iface); FIXME("(%p)->(%p): stub\n", This, pFont); + + if (This->range && !get_range_reole(This->range)) + return CO_E_RELEASED; + return E_NOTIMPL; } @@ -2600,6 +2649,10 @@ static HRESULT WINAPI TextFont_CanChange(ITextFont *iface, LONG *ret) { ITextFontImpl *This = impl_from_ITextFont(iface); FIXME("(%p)->(%p): stub\n", This, ret); + + if (This->range && !get_range_reole(This->range)) + return CO_E_RELEASED; + return E_NOTIMPL; } @@ -2607,6 +2660,10 @@ static HRESULT WINAPI TextFont_IsEqual(ITextFont *iface, ITextFont *font, LONG * { ITextFontImpl *This = impl_from_ITextFont(iface); FIXME("(%p)->(%p %p): stub\n", This, font, ret); + + if (This->range && !get_range_reole(This->range)) + return CO_E_RELEASED; + return E_NOTIMPL; } @@ -2780,6 +2837,10 @@ static HRESULT WINAPI TextFont_GetStyle(ITextFont *iface, LONG *value) { ITextFontImpl *This = impl_from_ITextFont(iface); FIXME("(%p)->(%p): stub\n", This, value); + + if (This->range && !get_range_reole(This->range)) + return CO_E_RELEASED; + return E_NOTIMPL; } @@ -2787,6 +2848,10 @@ static HRESULT WINAPI TextFont_SetStyle(ITextFont *iface, LONG value) { ITextFontImpl *This = impl_from_ITextFont(iface); FIXME("(%p)->(%d): stub\n", This, value); + + if (This->range && !get_range_reole(This->range)) + return CO_E_RELEASED; + return E_NOTIMPL; } @@ -3293,6 +3358,16 @@ static ULONG WINAPI TextPara_Release(ITextPara *iface) return ref; } +static IRichEditOleImpl *para_get_reole(ITextParaImpl *This) +{ + if (This->range) + { + ITextRangeImpl *rng = impl_from_ITextRange(This->range); + return rng->child.reole; + } + return NULL; +} + static HRESULT WINAPI TextPara_GetTypeInfoCount(ITextPara *iface, UINT *pctinfo) { ITextParaImpl *This = impl_from_ITextPara(iface); @@ -3360,6 +3435,10 @@ static HRESULT WINAPI TextPara_GetDuplicate(ITextPara *iface, ITextPara **ret) { ITextParaImpl *This = impl_from_ITextPara(iface); FIXME("(%p)->(%p)\n", This, ret); + + if (!para_get_reole(This)) + return CO_E_RELEASED; + return E_NOTIMPL; } @@ -3367,6 +3446,10 @@ static HRESULT WINAPI TextPara_SetDuplicate(ITextPara *iface, ITextPara *para) { ITextParaImpl *This = impl_from_ITextPara(iface); FIXME("(%p)->(%p)\n", This, para); + + if (!para_get_reole(This)) + return CO_E_RELEASED; + return E_NOTIMPL; } @@ -3374,6 +3457,10 @@ static HRESULT WINAPI TextPara_CanChange(ITextPara *iface, LONG *ret) { ITextParaImpl *This = impl_from_ITextPara(iface); FIXME("(%p)->(%p)\n", This, ret); + + if (!para_get_reole(This)) + return CO_E_RELEASED; + return E_NOTIMPL; } @@ -3381,6 +3468,10 @@ static HRESULT WINAPI TextPara_IsEqual(ITextPara *iface, ITextPara *para, LONG * { ITextParaImpl *This = impl_from_ITextPara(iface); FIXME("(%p)->(%p %p)\n", This, para, ret); + + if (!para_get_reole(This)) + return CO_E_RELEASED; + return E_NOTIMPL; } @@ -3388,6 +3479,10 @@ static HRESULT WINAPI TextPara_Reset(ITextPara *iface, LONG value) { ITextParaImpl *This = impl_from_ITextPara(iface); FIXME("(%p)->(%d)\n", This, value); + + if (!para_get_reole(This)) + return CO_E_RELEASED; + return E_NOTIMPL; } @@ -3395,6 +3490,10 @@ static HRESULT WINAPI TextPara_GetStyle(ITextPara *iface, LONG *value) { ITextParaImpl *This = impl_from_ITextPara(iface); FIXME("(%p)->(%p)\n", This, value); + + if (!para_get_reole(This)) + return CO_E_RELEASED; + return E_NOTIMPL; } @@ -3402,13 +3501,23 @@ static HRESULT WINAPI TextPara_SetStyle(ITextPara *iface, LONG value) { ITextParaImpl *This = impl_from_ITextPara(iface); FIXME("(%p)->(%d)\n", This, value); + + if (!para_get_reole(This)) + return CO_E_RELEASED; + return E_NOTIMPL; } static HRESULT WINAPI TextPara_GetAlignment(ITextPara *iface, LONG *value) { ITextParaImpl *This = impl_from_ITextPara(iface); - FIXME("(%p)->(%p)\n", This, value); + static int once; + + if (!once++) FIXME("(%p)->(%p)\n", This, value); + + if (!para_get_reole(This)) + return CO_E_RELEASED; + return E_NOTIMPL; } @@ -3416,6 +3525,10 @@ static HRESULT WINAPI TextPara_SetAlignment(ITextPara *iface, LONG value) { ITextParaImpl *This = impl_from_ITextPara(iface); FIXME("(%p)->(%d)\n", This, value); + + if (!para_get_reole(This)) + return CO_E_RELEASED; + return E_NOTIMPL; } @@ -3423,6 +3536,10 @@ static HRESULT WINAPI TextPara_GetHyphenation(ITextPara *iface, LONG *value) { ITextParaImpl *This = impl_from_ITextPara(iface); FIXME("(%p)->(%p)\n", This, value); + + if (!para_get_reole(This)) + return CO_E_RELEASED; + return E_NOTIMPL; } @@ -3430,6 +3547,10 @@ static HRESULT WINAPI TextPara_SetHyphenation(ITextPara *iface, LONG value) { ITextParaImpl *This = impl_from_ITextPara(iface); FIXME("(%p)->(%d)\n", This, value); + + if (!para_get_reole(This)) + return CO_E_RELEASED; + return E_NOTIMPL; } @@ -3437,6 +3558,10 @@ static HRESULT WINAPI TextPara_GetFirstLineIndent(ITextPara *iface, FLOAT *value { ITextParaImpl *This = impl_from_ITextPara(iface); FIXME("(%p)->(%p)\n", This, value); + + if (!para_get_reole(This)) + return CO_E_RELEASED; + return E_NOTIMPL; } @@ -3444,6 +3569,10 @@ static HRESULT WINAPI TextPara_GetKeepTogether(ITextPara *iface, LONG *value) { ITextParaImpl *This = impl_from_ITextPara(iface); FIXME("(%p)->(%p)\n", This, value); + + if (!para_get_reole(This)) + return CO_E_RELEASED; + return E_NOTIMPL; } @@ -3451,6 +3580,10 @@ static HRESULT WINAPI TextPara_SetKeepTogether(ITextPara *iface, LONG value) { ITextParaImpl *This = impl_from_ITextPara(iface); FIXME("(%p)->(%d)\n", This, value); + + if (!para_get_reole(This)) + return CO_E_RELEASED; + return E_NOTIMPL; } @@ -3458,6 +3591,10 @@ static HRESULT WINAPI TextPara_GetKeepWithNext(ITextPara *iface, LONG *value) { ITextParaImpl *This = impl_from_ITextPara(iface); FIXME("(%p)->(%p)\n", This, value); + + if (!para_get_reole(This)) + return CO_E_RELEASED; + return E_NOTIMPL; } @@ -3465,6 +3602,10 @@ static HRESULT WINAPI TextPara_SetKeepWithNext(ITextPara *iface, LONG value) { ITextParaImpl *This = impl_from_ITextPara(iface); FIXME("(%p)->(%d)\n", This, value); + + if (!para_get_reole(This)) + return CO_E_RELEASED; + return E_NOTIMPL; } @@ -3472,6 +3613,10 @@ static HRESULT WINAPI TextPara_GetLeftIndent(ITextPara *iface, FLOAT *value) { ITextParaImpl *This = impl_from_ITextPara(iface); FIXME("(%p)->(%p)\n", This, value); + + if (!para_get_reole(This)) + return CO_E_RELEASED; + return E_NOTIMPL; } @@ -3479,6 +3624,10 @@ static HRESULT WINAPI TextPara_GetLineSpacing(ITextPara *iface, FLOAT *value) { ITextParaImpl *This = impl_from_ITextPara(iface); FIXME("(%p)->(%p)\n", This, value); + + if (!para_get_reole(This)) + return CO_E_RELEASED; + return E_NOTIMPL; } @@ -3486,6 +3635,10 @@ static HRESULT WINAPI TextPara_GetLineSpacingRule(ITextPara *iface, LONG *value) { ITextParaImpl *This = impl_from_ITextPara(iface); FIXME("(%p)->(%p)\n", This, value); + + if (!para_get_reole(This)) + return CO_E_RELEASED; + return E_NOTIMPL; } @@ -3493,6 +3646,10 @@ static HRESULT WINAPI TextPara_GetListAlignment(ITextPara *iface, LONG *value) { ITextParaImpl *This = impl_from_ITextPara(iface); FIXME("(%p)->(%p)\n", This, value); + + if (!para_get_reole(This)) + return CO_E_RELEASED; + return E_NOTIMPL; } @@ -3500,6 +3657,10 @@ static HRESULT WINAPI TextPara_SetListAlignment(ITextPara *iface, LONG value) { ITextParaImpl *This = impl_from_ITextPara(iface); FIXME("(%p)->(%d)\n", This, value); + + if (!para_get_reole(This)) + return CO_E_RELEASED; + return E_NOTIMPL; } @@ -3507,6 +3668,10 @@ static HRESULT WINAPI TextPara_GetListLevelIndex(ITextPara *iface, LONG *value) { ITextParaImpl *This = impl_from_ITextPara(iface); FIXME("(%p)->(%p)\n", This, value); + + if (!para_get_reole(This)) + return CO_E_RELEASED; + return E_NOTIMPL; } @@ -3514,6 +3679,10 @@ static HRESULT WINAPI TextPara_SetListLevelIndex(ITextPara *iface, LONG value) { ITextParaImpl *This = impl_from_ITextPara(iface); FIXME("(%p)->(%d)\n", This, value); + + if (!para_get_reole(This)) + return CO_E_RELEASED; + return E_NOTIMPL; } @@ -3521,6 +3690,10 @@ static HRESULT WINAPI TextPara_GetListStart(ITextPara *iface, LONG *value) { ITextParaImpl *This = impl_from_ITextPara(iface); FIXME("(%p)->(%p)\n", This, value); + + if (!para_get_reole(This)) + return CO_E_RELEASED; + return E_NOTIMPL; } @@ -3528,6 +3701,10 @@ static HRESULT WINAPI TextPara_SetListStart(ITextPara *iface, LONG value) { ITextParaImpl *This = impl_from_ITextPara(iface); FIXME("(%p)->(%d)\n", This, value); + + if (!para_get_reole(This)) + return CO_E_RELEASED; + return E_NOTIMPL; } @@ -3535,6 +3712,10 @@ static HRESULT WINAPI TextPara_GetListTab(ITextPara *iface, FLOAT *value) { ITextParaImpl *This = impl_from_ITextPara(iface); FIXME("(%p)->(%p)\n", This, value); + + if (!para_get_reole(This)) + return CO_E_RELEASED; + return E_NOTIMPL; } @@ -3542,6 +3723,10 @@ static HRESULT WINAPI TextPara_SetListTab(ITextPara *iface, FLOAT value) { ITextParaImpl *This = impl_from_ITextPara(iface); FIXME("(%p)->(%.2f)\n", This, value); + + if (!para_get_reole(This)) + return CO_E_RELEASED; + return E_NOTIMPL; } @@ -3549,6 +3734,10 @@ static HRESULT WINAPI TextPara_GetListType(ITextPara *iface, LONG *value) { ITextParaImpl *This = impl_from_ITextPara(iface); FIXME("(%p)->(%p)\n", This, value); + + if (!para_get_reole(This)) + return CO_E_RELEASED; + return E_NOTIMPL; } @@ -3556,6 +3745,10 @@ static HRESULT WINAPI TextPara_SetListType(ITextPara *iface, LONG value) { ITextParaImpl *This = impl_from_ITextPara(iface); FIXME("(%p)->(%d)\n", This, value); + + if (!para_get_reole(This)) + return CO_E_RELEASED; + return E_NOTIMPL; } @@ -3563,6 +3756,10 @@ static HRESULT WINAPI TextPara_GetNoLineNumber(ITextPara *iface, LONG *value) { ITextParaImpl *This = impl_from_ITextPara(iface); FIXME("(%p)->(%p)\n", This, value); + + if (!para_get_reole(This)) + return CO_E_RELEASED; + return E_NOTIMPL; } @@ -3570,6 +3767,10 @@ static HRESULT WINAPI TextPara_SetNoLineNumber(ITextPara *iface, LONG value) { ITextParaImpl *This = impl_from_ITextPara(iface); FIXME("(%p)->(%d)\n", This, value); + + if (!para_get_reole(This)) + return CO_E_RELEASED; + return E_NOTIMPL; } @@ -3577,6 +3778,10 @@ static HRESULT WINAPI TextPara_GetPageBreakBefore(ITextPara *iface, LONG *value) { ITextParaImpl *This = impl_from_ITextPara(iface); FIXME("(%p)->(%p)\n", This, value); + + if (!para_get_reole(This)) + return CO_E_RELEASED; + return E_NOTIMPL; } @@ -3584,6 +3789,10 @@ static HRESULT WINAPI TextPara_SetPageBreakBefore(ITextPara *iface, LONG value) { ITextParaImpl *This = impl_from_ITextPara(iface); FIXME("(%p)->(%d)\n", This, value); + + if (!para_get_reole(This)) + return CO_E_RELEASED; + return E_NOTIMPL; } @@ -3591,6 +3800,10 @@ static HRESULT WINAPI TextPara_GetRightIndent(ITextPara *iface, FLOAT *value) { ITextParaImpl *This = impl_from_ITextPara(iface); FIXME("(%p)->(%p)\n", This, value); + + if (!para_get_reole(This)) + return CO_E_RELEASED; + return E_NOTIMPL; } @@ -3598,6 +3811,10 @@ static HRESULT WINAPI TextPara_SetRightIndent(ITextPara *iface, FLOAT value) { ITextParaImpl *This = impl_from_ITextPara(iface); FIXME("(%p)->(%.2f)\n", This, value); + + if (!para_get_reole(This)) + return CO_E_RELEASED; + return E_NOTIMPL; } @@ -3605,6 +3822,10 @@ static HRESULT WINAPI TextPara_SetIndents(ITextPara *iface, FLOAT StartIndent, F { ITextParaImpl *This = impl_from_ITextPara(iface); FIXME("(%p)->(%.2f %.2f %.2f)\n", This, StartIndent, LeftIndent, RightIndent); + + if (!para_get_reole(This)) + return CO_E_RELEASED; + return E_NOTIMPL; } @@ -3612,6 +3833,10 @@ static HRESULT WINAPI TextPara_SetLineSpacing(ITextPara *iface, LONG LineSpacing { ITextParaImpl *This = impl_from_ITextPara(iface); FIXME("(%p)->(%d %.2f)\n", This, LineSpacingRule, LineSpacing); + + if (!para_get_reole(This)) + return CO_E_RELEASED; + return E_NOTIMPL; } @@ -3619,6 +3844,10 @@ static HRESULT WINAPI TextPara_GetSpaceAfter(ITextPara *iface, FLOAT *value) { ITextParaImpl *This = impl_from_ITextPara(iface); FIXME("(%p)->(%p)\n", This, value); + + if (!para_get_reole(This)) + return CO_E_RELEASED; + return E_NOTIMPL; } @@ -3626,6 +3855,10 @@ static HRESULT WINAPI TextPara_SetSpaceAfter(ITextPara *iface, FLOAT value) { ITextParaImpl *This = impl_from_ITextPara(iface); FIXME("(%p)->(%.2f)\n", This, value); + + if (!para_get_reole(This)) + return CO_E_RELEASED; + return E_NOTIMPL; } @@ -3633,6 +3866,10 @@ static HRESULT WINAPI TextPara_GetSpaceBefore(ITextPara *iface, FLOAT *value) { ITextParaImpl *This = impl_from_ITextPara(iface); FIXME("(%p)->(%p)\n", This, value); + + if (!para_get_reole(This)) + return CO_E_RELEASED; + return E_NOTIMPL; } @@ -3640,6 +3877,10 @@ static HRESULT WINAPI TextPara_SetSpaceBefore(ITextPara *iface, FLOAT value) { ITextParaImpl *This = impl_from_ITextPara(iface); FIXME("(%p)->(%.2f)\n", This, value); + + if (!para_get_reole(This)) + return CO_E_RELEASED; + return E_NOTIMPL; } @@ -3647,6 +3888,10 @@ static HRESULT WINAPI TextPara_GetWidowControl(ITextPara *iface, LONG *value) { ITextParaImpl *This = impl_from_ITextPara(iface); FIXME("(%p)->(%p)\n", This, value); + + if (!para_get_reole(This)) + return CO_E_RELEASED; + return E_NOTIMPL; } @@ -3654,6 +3899,10 @@ static HRESULT WINAPI TextPara_SetWidowControl(ITextPara *iface, LONG value) { ITextParaImpl *This = impl_from_ITextPara(iface); FIXME("(%p)->(%d)\n", This, value); + + if (!para_get_reole(This)) + return CO_E_RELEASED; + return E_NOTIMPL; } @@ -3661,6 +3910,10 @@ static HRESULT WINAPI TextPara_GetTabCount(ITextPara *iface, LONG *value) { ITextParaImpl *This = impl_from_ITextPara(iface); FIXME("(%p)->(%p)\n", This, value); + + if (!para_get_reole(This)) + return CO_E_RELEASED; + return E_NOTIMPL; } @@ -3668,6 +3921,10 @@ static HRESULT WINAPI TextPara_AddTab(ITextPara *iface, FLOAT tbPos, LONG tbAlig { ITextParaImpl *This = impl_from_ITextPara(iface); FIXME("(%p)->(%.2f %d %d)\n", This, tbPos, tbAlign, tbLeader); + + if (!para_get_reole(This)) + return CO_E_RELEASED; + return E_NOTIMPL; } @@ -3675,6 +3932,10 @@ static HRESULT WINAPI TextPara_ClearAllTabs(ITextPara *iface) { ITextParaImpl *This = impl_from_ITextPara(iface); FIXME("(%p)\n", This); + + if (!para_get_reole(This)) + return CO_E_RELEASED; + return E_NOTIMPL; } @@ -3682,6 +3943,10 @@ static HRESULT WINAPI TextPara_DeleteTab(ITextPara *iface, FLOAT pos) { ITextParaImpl *This = impl_from_ITextPara(iface); FIXME("(%p)->(%.2f)\n", This, pos); + + if (!para_get_reole(This)) + return CO_E_RELEASED; + return E_NOTIMPL; } @@ -3689,6 +3954,10 @@ static HRESULT WINAPI TextPara_GetTab(ITextPara *iface, LONG iTab, FLOAT *ptbPos { ITextParaImpl *This = impl_from_ITextPara(iface); FIXME("(%p)->(%d %p %p %p)\n", This, iTab, ptbPos, ptbAlign, ptbLeader); + + if (!para_get_reole(This)) + return CO_E_RELEASED; + return E_NOTIMPL; } @@ -4027,26 +4296,12 @@ ITextDocument_fnRange(ITextDocument* me, LONG cp1, LONG cp2, ITextRange** ppRange) { IRichEditOleImpl *This = impl_from_ITextDocument(me); - const int len = ME_GetTextLength(This->editor) + 1; TRACE("%p %p %d %d\n", This, ppRange, cp1, cp2); if (!ppRange) return E_INVALIDARG; - cp1 = max(cp1, 0); - cp2 = max(cp2, 0); - cp1 = min(cp1, len); - cp2 = min(cp2, len); - if (cp1 > cp2) - { - LONG tmp; - tmp = cp1; - cp1 = cp2; - cp2 = tmp; - } - if (cp1 == len) - cp1 = cp2 = len - 1; - + cp2range(This->editor, &cp1, &cp2); return CreateITextRange(This, cp1, cp2, ppRange); } @@ -5369,7 +5624,7 @@ void ME_DeleteReObject(REOBJECT* reo) if (reo->poleobj) IOleObject_Release(reo->poleobj); if (reo->pstg) IStorage_Release(reo->pstg); if (reo->polesite) IOleClientSite_Release(reo->polesite); - FREE_OBJ(reo); + heap_free(reo); } void ME_CopyReObject(REOBJECT* dst, const REOBJECT* src) diff --git a/dll/win32/riched20/rtf.h b/dll/win32/riched20/rtf.h index b05c2adfa2..66d88b55da 100644 --- a/dll/win32/riched20/rtf.h +++ b/dll/win32/riched20/rtf.h @@ -1,6 +1,16 @@ #ifndef _RTF #define _RTF +#include <stdarg.h> +#include <stdio.h> + +#include "windef.h" +#include "winbase.h" +#include "wingdi.h" +#include "winuser.h" +#include "richedit.h" + + /* * rtf.h - RTF document processing stuff. Release 1.10. */ diff --git a/dll/win32/riched20/run.c b/dll/win32/riched20/run.c index 098c4f8b4d..445bbc2f91 100644 --- a/dll/win32/riched20/run.c +++ b/dll/win32/riched20/run.c @@ -185,9 +185,10 @@ void ME_RunOfsFromCharOfs(ME_TextEditor *editor, int *pOfs) { ME_DisplayItem *item, *next_item; + int endOfs = nCharOfs, len = ME_GetTextLength(editor); nCharOfs = max(nCharOfs, 0); - nCharOfs = min(nCharOfs, ME_GetTextLength(editor)); + nCharOfs = min(nCharOfs, len); /* Find the paragraph at the offset. */ next_item = editor->pBuffer->pFirst->member.para.next_para; @@ -210,7 +211,11 @@ void ME_RunOfsFromCharOfs(ME_TextEditor *editor, nCharOfs -= item->member.run.nCharOfs; if (ppRun) *ppRun = item; - if (pOfs) *pOfs = nCharOfs; + if (pOfs) { + if (((*ppRun)->member.run.nFlags & MERF_ENDPARA) && endOfs > len) + *pOfs = (*ppRun)->member.run.len; + else *pOfs = nCharOfs; + } } /****************************************************************************** diff --git a/dll/win32/riched20/style.c b/dll/win32/riched20/style.c index 4f08b3b133..0b85d69f6f 100644 --- a/dll/win32/riched20/style.c +++ b/dll/win32/riched20/style.c @@ -113,7 +113,7 @@ void ME_CopyToCFAny(CHARFORMAT2W *to, CHARFORMAT2W *from) ME_Style *ME_MakeStyle(CHARFORMAT2W *style) { - ME_Style *s = ALLOC_OBJ(ME_Style); + ME_Style *s = heap_alloc(sizeof(*s)); assert(style->cbSize == sizeof(CHARFORMAT2W)); s->fmt = *style; @@ -306,7 +306,8 @@ ME_LogFontFromStyle(ME_Context* c, LOGFONTW *lf, const ME_Style *s) lf->lfWeight = s->fmt.wWeight; if (s->fmt.dwEffects & s->fmt.dwMask & CFM_ITALIC) lf->lfItalic = 1; - if ((s->fmt.dwEffects & s->fmt.dwMask & (CFM_UNDERLINE | CFE_LINK)) && + if ((s->fmt.dwEffects & s->fmt.dwMask & CFM_UNDERLINE) && + !(s->fmt.dwEffects & CFE_LINK) && s->fmt.bUnderlineType == CFU_CF1UNDERLINE) lf->lfUnderline = 1; if (s->fmt.dwEffects & s->fmt.dwMask & CFM_STRIKEOUT) @@ -425,7 +426,7 @@ void ME_DestroyStyle(ME_Style *s) s->font_cache = NULL; } ScriptFreeCache( &s->script_cache ); - FREE_OBJ(s); + heap_free(s); } void ME_AddRefStyle(ME_Style *s) diff --git a/dll/win32/riched20/table.c b/dll/win32/riched20/table.c index d2cab9a817..4cd77eb399 100644 --- a/dll/win32/riched20/table.c +++ b/dll/win32/riched20/table.c @@ -637,8 +637,8 @@ void ME_MoveCursorFromTableRowStartParagraph(ME_TextEditor *editor) struct RTFTable *ME_MakeTableDef(ME_TextEditor *editor) { - RTFTable *tableDef = ALLOC_OBJ(RTFTable); - ZeroMemory(tableDef, sizeof(RTFTable)); + RTFTable *tableDef = heap_alloc_zero(sizeof(*tableDef)); + if (!editor->bEmulateVersion10) /* v4.1 */ tableDef->gapH = 10; return tableDef; diff --git a/dll/win32/riched20/txthost.c b/dll/win32/riched20/txthost.c index f926964719..b479bde81b 100644 --- a/dll/win32/riched20/txthost.c +++ b/dll/win32/riched20/txthost.c @@ -18,7 +18,18 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#include "config.h" +#include "wine/port.h" + +#define COBJMACROS + #include "editor.h" +#include "ole2.h" +#include "richole.h" +#include "imm.h" +#include "textserv.h" +#include "wine/debug.h" +#include "editstr.h" WINE_DEFAULT_DEBUG_CHANNEL(richedit); diff --git a/dll/win32/riched20/txtsrv.c b/dll/win32/riched20/txtsrv.c index 869534baec..eb61e4eff6 100644 --- a/dll/win32/riched20/txtsrv.c +++ b/dll/win32/riched20/txtsrv.c @@ -18,8 +18,20 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include "editor.h" +#include "config.h" +#include "wine/port.h" + +#define COBJMACROS +#include "editor.h" +#include "ole2.h" +#include "oleauto.h" +#include "richole.h" +#include "tom.h" +#include "imm.h" +#include "textserv.h" +#include "wine/debug.h" +#include "editstr.h" #ifdef __i386__ /* thiscall functions are i386-specific */ diff --git a/dll/win32/riched20/version.rc b/dll/win32/riched20/version.rc index 22b5a701c6..8b3bbe2141 100644 --- a/dll/win32/riched20/version.rc +++ b/dll/win32/riched20/version.rc @@ -27,6 +27,7 @@ #include "res.h" +/* @makedep: ocr_reverse.cur */ OCR_REVERSE CURSOR ocr_reverse.cur 1 TYPELIB riched_tom.tlb diff --git a/dll/win32/riched20/writer.c b/dll/win32/riched20/writer.c index 3a646b9a24..aad2e44879 100644 --- a/dll/win32/riched20/writer.c +++ b/dll/win32/riched20/writer.c @@ -18,6 +18,11 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#include "config.h" +#include "wine/port.h" + +#define NONAMELESSUNION + #include "editor.h" #include "rtf.h" @@ -52,15 +57,11 @@ ME_StreamOutRTFText(ME_OutStream *pStream, const WCHAR *text, LONG nChars); static ME_OutStream* ME_StreamOutInit(ME_TextEditor *editor, EDITSTREAM *stream) { - ME_OutStream *pStream = ALLOC_OBJ(ME_OutStream); + ME_OutStream *pStream = heap_alloc_zero(sizeof(*pStream)); + pStream->stream = stream; pStream->stream->dwError = 0; - pStream->pos = 0; - pStream->written = 0; - pStream->nFontTblLen = 0; pStream->nColorTblLen = 1; - pStream->nNestingLevel = 0; - memset(&pStream->cur_fmt, 0, sizeof(pStream->cur_fmt)); pStream->cur_fmt.dwEffects = CFE_AUTOCOLOR | CFE_AUTOBACKCOLOR; pStream->cur_fmt.bUnderlineType = CFU_UNDERLINE; return pStream; @@ -96,7 +97,7 @@ ME_StreamOutFree(ME_OutStream *pStream) LONG written = pStream->written; TRACE("total length = %u\n", written); - FREE_OBJ(pStream); + heap_free(pStream); return written; } @@ -1143,8 +1144,7 @@ static BOOL ME_StreamOutText(ME_TextEditor *editor, ME_OutStream *pStream, nSize = WideCharToMultiByte(nCodePage, 0, get_text( &cursor.pRun->member.run, cursor.nOffset ), nLen, NULL, 0, NULL, NULL); if (nSize > nBufLen) { - FREE_OBJ(buffer); - buffer = ALLOC_N_OBJ(char, nSize); + buffer = heap_realloc(buffer, nSize); nBufLen = nSize; } WideCharToMultiByte(nCodePage, 0, get_text( &cursor.pRun->member.run, cursor.nOffset ), @@ -1158,7 +1158,7 @@ static BOOL ME_StreamOutText(ME_TextEditor *editor, ME_OutStream *pStream, cursor.pRun = ME_FindItemFwd(cursor.pRun, diRun); } - FREE_OBJ(buffer); + heap_free(buffer); return success; } diff --git a/media/doc/README.WINE b/media/doc/README.WINE index a3ca247d4d..1b38747c0b 100644 --- a/media/doc/README.WINE +++ b/media/doc/README.WINE @@ -158,7 +158,7 @@ reactos/dll/win32/qmgrprxy # Synced to WineStaging-2.9 reactos/dll/win32/query # Synced to WineStaging-3.3 reactos/dll/win32/rasapi32 # Synced to WineStaging-3.3 reactos/dll/win32/resutils # Synced to WineStaging-3.3 -reactos/dll/win32/riched20 # Synced to Wine-3.0 +reactos/dll/win32/riched20 # Synced to WineStaging-3.3 reactos/dll/win32/riched32 # Synced to WineStaging-2.9 reactos/dll/win32/rpcrt4 # Synced to WineStaging-3.3 reactos/dll/win32/rsabase # Synced to WineStaging-2.9
6 years, 9 months
1
0
0
0
01/01: [RESUTILS] Sync with Wine Staging 3.3. CORE-14434
by Amine Khaldi
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=38cccbd8a77b876b4b3e9…
commit 38cccbd8a77b876b4b3e9cc94ca98f6164d6e7cd Author: Amine Khaldi <amine.khaldi(a)reactos.org> AuthorDate: Wed Mar 21 13:16:02 2018 +0100 Commit: Amine Khaldi <amine.khaldi(a)reactos.org> CommitDate: Wed Mar 21 13:16:02 2018 +0100 [RESUTILS] Sync with Wine Staging 3.3. CORE-14434 --- dll/win32/resutils/resutils.c | 7 +++---- media/doc/README.WINE | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/dll/win32/resutils/resutils.c b/dll/win32/resutils/resutils.c index b72da3473e..b9e3c66fa1 100644 --- a/dll/win32/resutils/resutils.c +++ b/dll/win32/resutils/resutils.c @@ -18,13 +18,12 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#define WIN32_NO_STATUS #include <stdarg.h> -#include <windef.h> -#include <winbase.h> -#include <wine/debug.h> +#include "windef.h" +#include "winbase.h" +#include "wine/debug.h" WINE_DEFAULT_DEBUG_CHANNEL(resutils); diff --git a/media/doc/README.WINE b/media/doc/README.WINE index 2ba9257b54..a3ca247d4d 100644 --- a/media/doc/README.WINE +++ b/media/doc/README.WINE @@ -157,7 +157,7 @@ reactos/dll/win32/qmgr # Synced to WineStaging-3.3 reactos/dll/win32/qmgrprxy # Synced to WineStaging-2.9 reactos/dll/win32/query # Synced to WineStaging-3.3 reactos/dll/win32/rasapi32 # Synced to WineStaging-3.3 -reactos/dll/win32/resutils # Synced to WineStaging-2.9 +reactos/dll/win32/resutils # Synced to WineStaging-3.3 reactos/dll/win32/riched20 # Synced to Wine-3.0 reactos/dll/win32/riched32 # Synced to WineStaging-2.9 reactos/dll/win32/rpcrt4 # Synced to WineStaging-3.3
6 years, 9 months
1
0
0
0
01/01: [RASAPI32] Sync with Wine Staging 3.3. CORE-14434
by Amine Khaldi
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=3cea71896cfdd4beb78e6…
commit 3cea71896cfdd4beb78e60144b8362c43e3a0b51 Author: Amine Khaldi <amine.khaldi(a)reactos.org> AuthorDate: Wed Mar 21 13:15:06 2018 +0100 Commit: Amine Khaldi <amine.khaldi(a)reactos.org> CommitDate: Wed Mar 21 13:15:06 2018 +0100 [RASAPI32] Sync with Wine Staging 3.3. CORE-14434 --- dll/win32/rasapi32/rasapi.c | 14 ++++++-------- dll/win32/rasapi32/rasapi32.spec | 2 +- media/doc/README.WINE | 2 +- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/dll/win32/rasapi32/rasapi.c b/dll/win32/rasapi32/rasapi.c index 259fdd3f97..791b0dab13 100644 --- a/dll/win32/rasapi32/rasapi.c +++ b/dll/win32/rasapi32/rasapi.c @@ -18,15 +18,13 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#define WIN32_NO_STATUS +#include <stdarg.h> -//#include <stdarg.h> - -#include <windef.h> -//#include "winbase.h" -#include <ras.h> -#include <raserror.h> -#include <wine/debug.h> +#include "windef.h" +#include "winbase.h" +#include "ras.h" +#include "raserror.h" +#include "wine/debug.h" WINE_DEFAULT_DEBUG_CHANNEL(ras); diff --git a/dll/win32/rasapi32/rasapi32.spec b/dll/win32/rasapi32/rasapi32.spec index 48d7a73dc8..e8a28a8814 100644 --- a/dll/win32/rasapi32/rasapi32.spec +++ b/dll/win32/rasapi32/rasapi32.spec @@ -29,11 +29,11 @@ @ stdcall RasGetAutodialEnableW(long ptr) @ stdcall RasGetAutodialParamA(long ptr ptr) @ stdcall RasGetAutodialParamW(long ptr ptr) -@ stdcall RasGetConnectionStatistics(ptr ptr) @ stub RasGetConnectResponse @ stdcall RasGetConnectStatusA(ptr ptr) @ stdcall RasGetConnectStatusW(ptr ptr) @ stub RasGetConnectStatusWow +@ stdcall RasGetConnectionStatistics(ptr ptr) @ stub RasGetCountryInfoA @ stub RasGetCountryInfoW @ stub RasGetCredentialsA diff --git a/media/doc/README.WINE b/media/doc/README.WINE index c36e4856f1..2ba9257b54 100644 --- a/media/doc/README.WINE +++ b/media/doc/README.WINE @@ -156,7 +156,7 @@ reactos/dll/win32/pstorec # Synced to WineStaging-3.3 reactos/dll/win32/qmgr # Synced to WineStaging-3.3 reactos/dll/win32/qmgrprxy # Synced to WineStaging-2.9 reactos/dll/win32/query # Synced to WineStaging-3.3 -reactos/dll/win32/rasapi32 # Synced to WineStaging-2.9 +reactos/dll/win32/rasapi32 # Synced to WineStaging-3.3 reactos/dll/win32/resutils # Synced to WineStaging-2.9 reactos/dll/win32/riched20 # Synced to Wine-3.0 reactos/dll/win32/riched32 # Synced to WineStaging-2.9
6 years, 9 months
1
0
0
0
01/01: [QUERY] Sync with Wine Staging 3.3. CORE-14434
by Amine Khaldi
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=842783003af4c2781fb6f…
commit 842783003af4c2781fb6f89fb3b9e53b88669cd0 Author: Amine Khaldi <amine.khaldi(a)reactos.org> AuthorDate: Wed Mar 21 13:14:09 2018 +0100 Commit: Amine Khaldi <amine.khaldi(a)reactos.org> CommitDate: Wed Mar 21 13:14:09 2018 +0100 [QUERY] Sync with Wine Staging 3.3. CORE-14434 --- dll/win32/query/query_main.c | 23 ++++++++++------------- media/doc/README.WINE | 2 +- 2 files changed, 11 insertions(+), 14 deletions(-) diff --git a/dll/win32/query/query_main.c b/dll/win32/query/query_main.c index f85efc8ed0..c6dde22a88 100644 --- a/dll/win32/query/query_main.c +++ b/dll/win32/query/query_main.c @@ -18,25 +18,22 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#define WIN32_NO_STATUS -#define _INC_WINDOWS - #define COBJMACROS -#include <config.h> +#include "config.h" #include <stdarg.h> -#include <windef.h> -#include <winbase.h> -//#include "winuser.h" -//#include "winreg.h" -#include <ole2.h> -#include <ntquery.h> -#include <cierror.h> -//#include "initguid.h" +#include "windef.h" +#include "winbase.h" +#include "winuser.h" +#include "winreg.h" +#include "ole2.h" +#include "ntquery.h" +#include "cierror.h" +#include "initguid.h" -#include <wine/debug.h> +#include "wine/debug.h" WINE_DEFAULT_DEBUG_CHANNEL(query); diff --git a/media/doc/README.WINE b/media/doc/README.WINE index 037d653948..c36e4856f1 100644 --- a/media/doc/README.WINE +++ b/media/doc/README.WINE @@ -155,7 +155,7 @@ reactos/dll/win32/propsys # Synced to WineStaging-3.3 reactos/dll/win32/pstorec # Synced to WineStaging-3.3 reactos/dll/win32/qmgr # Synced to WineStaging-3.3 reactos/dll/win32/qmgrprxy # Synced to WineStaging-2.9 -reactos/dll/win32/query # Synced to WineStaging-2.9 +reactos/dll/win32/query # Synced to WineStaging-3.3 reactos/dll/win32/rasapi32 # Synced to WineStaging-2.9 reactos/dll/win32/resutils # Synced to WineStaging-2.9 reactos/dll/win32/riched20 # Synced to Wine-3.0
6 years, 9 months
1
0
0
0
01/01: [QMGR_WINETEST] Sync with Wine Staging 3.3. CORE-14434
by Amine Khaldi
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=c851a1bf2e171833c17a1…
commit c851a1bf2e171833c17a181b4963c6518275909a Author: Amine Khaldi <amine.khaldi(a)reactos.org> AuthorDate: Wed Mar 21 13:12:52 2018 +0100 Commit: Amine Khaldi <amine.khaldi(a)reactos.org> CommitDate: Wed Mar 21 13:12:52 2018 +0100 [QMGR_WINETEST] Sync with Wine Staging 3.3. CORE-14434 --- modules/rostests/winetests/qmgr/enum_files.c | 17 ++++------------- modules/rostests/winetests/qmgr/enum_jobs.c | 11 +++-------- modules/rostests/winetests/qmgr/file.c | 16 +++------------- modules/rostests/winetests/qmgr/job.c | 17 ++++++----------- modules/rostests/winetests/qmgr/qmgr.c | 14 +++----------- 5 files changed, 19 insertions(+), 56 deletions(-) diff --git a/modules/rostests/winetests/qmgr/enum_files.c b/modules/rostests/winetests/qmgr/enum_files.c index 1a8998359c..9564d7c1ad 100644 --- a/modules/rostests/winetests/qmgr/enum_files.c +++ b/modules/rostests/winetests/qmgr/enum_files.c @@ -18,23 +18,14 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#define WIN32_NO_STATUS -#define _INC_WINDOWS -#define COM_NO_WINDOWS_H - -#include <stdarg.h> - -#include <windef.h> -#include <winbase.h> -#include <winreg.h> - #include <shlwapi.h> -//#include <stdio.h> +#include <stdio.h> #define COBJMACROS -#include <wine/test.h> -#include <bits.h> +#include "wine/test.h" +#include "initguid.h" +#include "bits.h" /* Globals used by many tests */ #define NUM_FILES 2 /* At least two. */ diff --git a/modules/rostests/winetests/qmgr/enum_jobs.c b/modules/rostests/winetests/qmgr/enum_jobs.c index 518a7d2faf..6a1a968838 100644 --- a/modules/rostests/winetests/qmgr/enum_jobs.c +++ b/modules/rostests/winetests/qmgr/enum_jobs.c @@ -18,17 +18,12 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -//#include <stdio.h> - -#define WIN32_NO_STATUS -#define _INC_WINDOWS -#define COM_NO_WINDOWS_H +#include <stdio.h> #define COBJMACROS -#include <wine/test.h> -#include <objbase.h> -#include <bits.h> +#include "wine/test.h" +#include "bits.h" /* Globals used by many tests */ static const WCHAR test_displayNameA[] = {'T','e','s','t','A', 0}; diff --git a/modules/rostests/winetests/qmgr/file.c b/modules/rostests/winetests/qmgr/file.c index 3cee4bdc8c..9fdf08c98a 100644 --- a/modules/rostests/winetests/qmgr/file.c +++ b/modules/rostests/winetests/qmgr/file.c @@ -18,24 +18,14 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -//#include <stdio.h> - -#include <stdarg.h> - -#define WIN32_NO_STATUS -#define _INC_WINDOWS -#define COM_NO_WINDOWS_H - -#include <windef.h> -#include <winbase.h> -#include <winreg.h> +#include <stdio.h> #include <shlwapi.h> #define COBJMACROS -#include <wine/test.h> -#include <bits.h> +#include "wine/test.h" +#include "bits.h" /* Globals used by many tests */ static const WCHAR test_remoteName[] = {'r','e','m','o','t','e', 0}; diff --git a/modules/rostests/winetests/qmgr/job.c b/modules/rostests/winetests/qmgr/job.c index 3ed3425a5d..6d8185a078 100644 --- a/modules/rostests/winetests/qmgr/job.c +++ b/modules/rostests/winetests/qmgr/job.c @@ -18,20 +18,15 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -//#include <stdio.h> - -#define WIN32_NO_STATUS -#define _INC_WINDOWS -#define COM_NO_WINDOWS_H +#include <stdio.h> #define COBJMACROS -#include <wine/test.h> -#include <objbase.h> -#include <bits.h> -#include <initguid.h> -#include <bits2_0.h> -#include <bits2_5.h> +#include "wine/test.h" +#include "bits.h" +#include "initguid.h" +#include "bits2_0.h" +#include "bits2_5.h" /* Globals used by many tests */ static const WCHAR test_displayName[] = {'T', 'e', 's', 't', 0}; diff --git a/modules/rostests/winetests/qmgr/qmgr.c b/modules/rostests/winetests/qmgr/qmgr.c index 67e7d46481..4ab12d3360 100644 --- a/modules/rostests/winetests/qmgr/qmgr.c +++ b/modules/rostests/winetests/qmgr/qmgr.c @@ -18,20 +18,12 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -//#include <stdio.h> - -#define WIN32_NO_STATUS -#define _INC_WINDOWS -#define COM_NO_WINDOWS_H +#include <stdio.h> #define COBJMACROS -#include <wine/test.h> - -#include <winnls.h> -#include <initguid.h> -#include <objbase.h> -#include <bits.h> +#include "wine/test.h" +#include "bits.h" static WCHAR progname[MAX_PATH];
6 years, 9 months
1
0
0
0
01/01: [QMGR] Sync with Wine Staging 3.3. CORE-14434
by Amine Khaldi
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=017748ce69b1c0b36e151…
commit 017748ce69b1c0b36e1519da8c725e250cab027f Author: Amine Khaldi <amine.khaldi(a)reactos.org> AuthorDate: Wed Mar 21 13:12:06 2018 +0100 Commit: Amine Khaldi <amine.khaldi(a)reactos.org> CommitDate: Wed Mar 21 13:12:06 2018 +0100 [QMGR] Sync with Wine Staging 3.3. CORE-14434 --- dll/win32/qmgr/CMakeLists.txt | 4 ++-- dll/win32/qmgr/enum_files.c | 3 +++ dll/win32/qmgr/enum_jobs.c | 3 +++ dll/win32/qmgr/factory.c | 3 +++ dll/win32/qmgr/file.c | 12 ++++++++++-- dll/win32/qmgr/job.c | 7 +++++++ dll/win32/qmgr/precomp.h | 22 ++++++++++++++++++++++ dll/win32/qmgr/qmgr.c | 3 +++ dll/win32/qmgr/qmgr.h | 31 ++++++++++--------------------- dll/win32/qmgr/qmgr_main.c | 19 ++++++++++++------- dll/win32/qmgr/service.c | 5 +++++ media/doc/README.WINE | 2 +- 12 files changed, 81 insertions(+), 33 deletions(-) diff --git a/dll/win32/qmgr/CMakeLists.txt b/dll/win32/qmgr/CMakeLists.txt index c503cf5730..21fec58fe3 100644 --- a/dll/win32/qmgr/CMakeLists.txt +++ b/dll/win32/qmgr/CMakeLists.txt @@ -13,7 +13,7 @@ list(APPEND SOURCE qmgr.c qmgr_main.c service.c - qmgr.h + precomp.h ${CMAKE_CURRENT_BINARY_DIR}/qmgr_local_i.c) add_library(qmgr SHARED @@ -26,6 +26,6 @@ add_idl_headers(qmgr_idlheader qmgr_local.idl) set_module_type(qmgr win32dll) target_link_libraries(qmgr uuid wine) add_importlibs(qmgr winhttp ole32 advapi32 msvcrt kernel32 ntdll) -add_pch(qmgr qmgr.h SOURCE) +add_pch(qmgr precomp.h SOURCE) add_cd_file(TARGET qmgr DESTINATION reactos/system32 FOR all) add_dependencies(qmgr qmgr_idlheader) diff --git a/dll/win32/qmgr/enum_files.c b/dll/win32/qmgr/enum_files.c index 8945370ee9..67953d9e1a 100644 --- a/dll/win32/qmgr/enum_files.c +++ b/dll/win32/qmgr/enum_files.c @@ -19,6 +19,9 @@ */ #include "qmgr.h" +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(qmgr); typedef struct { diff --git a/dll/win32/qmgr/enum_jobs.c b/dll/win32/qmgr/enum_jobs.c index c942547fb9..7fae597a4e 100644 --- a/dll/win32/qmgr/enum_jobs.c +++ b/dll/win32/qmgr/enum_jobs.c @@ -19,6 +19,9 @@ */ #include "qmgr.h" +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(qmgr); typedef struct { diff --git a/dll/win32/qmgr/factory.c b/dll/win32/qmgr/factory.c index 69e6d98d6c..9736e00bf6 100644 --- a/dll/win32/qmgr/factory.c +++ b/dll/win32/qmgr/factory.c @@ -19,6 +19,9 @@ */ #include "qmgr.h" +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(qmgr); static ULONG WINAPI BITS_IClassFactory_AddRef(IClassFactory *iface) diff --git a/dll/win32/qmgr/file.c b/dll/win32/qmgr/file.c index 19154649f7..3673ede142 100644 --- a/dll/win32/qmgr/file.c +++ b/dll/win32/qmgr/file.c @@ -18,10 +18,18 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#include <stdarg.h> + +#include "windef.h" +#include "winbase.h" +#include "winuser.h" +#include "winreg.h" +#include "winhttp.h" +#define COBJMACROS #include "qmgr.h" +#include "wine/debug.h" -#include <urlmon.h> -#include <winhttp.h> +WINE_DEFAULT_DEBUG_CHANNEL(qmgr); static inline BackgroundCopyFileImpl *impl_from_IBackgroundCopyFile2( IBackgroundCopyFile2 *iface) diff --git a/dll/win32/qmgr/job.c b/dll/win32/qmgr/job.c index 8843bfa320..a12e5111c5 100644 --- a/dll/win32/qmgr/job.c +++ b/dll/win32/qmgr/job.c @@ -18,7 +18,14 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#include <stdarg.h> + +#include "windef.h" +#include "winbase.h" #include "qmgr.h" +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(qmgr); BOOL transitionJobState(BackgroundCopyJobImpl *job, BG_JOB_STATE from, BG_JOB_STATE to) { diff --git a/dll/win32/qmgr/precomp.h b/dll/win32/qmgr/precomp.h new file mode 100644 index 0000000000..ee8a716beb --- /dev/null +++ b/dll/win32/qmgr/precomp.h @@ -0,0 +1,22 @@ + +#ifndef _QMGR_PRECOMP_H_ +#define _QMGR_PRECOMP_H_ + +#include <stdarg.h> + +#define WIN32_NO_STATUS +#define _INC_WINDOWS +#define COM_NO_WINDOWS_H + +#define COBJMACROS + +#include <windef.h> +#include <winbase.h> +#include <winsvc.h> +#include <objbase.h> + +#include <wine/debug.h> + +#include "qmgr.h" + +#endif /* !_QMGR_PRECOMP_H_ */ diff --git a/dll/win32/qmgr/qmgr.c b/dll/win32/qmgr/qmgr.c index f0c8462c54..110b87bf7f 100644 --- a/dll/win32/qmgr/qmgr.c +++ b/dll/win32/qmgr/qmgr.c @@ -19,6 +19,9 @@ */ #include "qmgr.h" +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(qmgr); BackgroundCopyManagerImpl globalMgr; diff --git a/dll/win32/qmgr/qmgr.h b/dll/win32/qmgr/qmgr.h index 4615e13cdd..2bc5b8b961 100644 --- a/dll/win32/qmgr/qmgr.h +++ b/dll/win32/qmgr/qmgr.h @@ -21,28 +21,17 @@ #ifndef __QMGR_H__ #define __QMGR_H__ -#include <stdarg.h> - -#define WIN32_NO_STATUS -#define _INC_WINDOWS -#define COM_NO_WINDOWS_H - +#include "windef.h" #define COBJMACROS - -#include <windef.h> -#include <winbase.h> -#include <winsvc.h> -#include <objbase.h> -#include <bits1_5.h> -#include <bits2_0.h> -#include <bits2_5.h> -#include <bits3_0.h> - -#include <wine/list.h> -#include <wine/debug.h> -#include <wine/unicode.h> - -WINE_DEFAULT_DEBUG_CHANNEL(qmgr); +#include "bits.h" +#include "bits1_5.h" +#include "bits2_0.h" +#include "bits2_5.h" +#include "bits3_0.h" + +#include <string.h> +#include "wine/list.h" +#include "wine/unicode.h" /* Background copy job vtbl and related data */ typedef struct diff --git a/dll/win32/qmgr/qmgr_main.c b/dll/win32/qmgr/qmgr_main.c index 7576e4a1c6..7bea214ed2 100644 --- a/dll/win32/qmgr/qmgr_main.c +++ b/dll/win32/qmgr/qmgr_main.c @@ -21,16 +21,21 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#include <stdio.h> + +#define COBJMACROS +#include "objbase.h" +#include "winuser.h" +#include "winreg.h" +#include "advpub.h" +#include "olectl.h" +#include "rpcproxy.h" +#include "winsvc.h" #include "qmgr.h" -#include <stdio.h> +#include "wine/debug.h" -#include <winuser.h> -#include <winreg.h> -#include <advpub.h> -#include <olectl.h> -#include <rpcproxy.h> -#include <initguid.h> +WINE_DEFAULT_DEBUG_CHANNEL(qmgr); /* Handle to the base address of this DLL */ static HINSTANCE hInst; diff --git a/dll/win32/qmgr/service.c b/dll/win32/qmgr/service.c index 43fc091b1b..e856408d8c 100644 --- a/dll/win32/qmgr/service.c +++ b/dll/win32/qmgr/service.c @@ -18,7 +18,12 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#include "windef.h" +#include "winsvc.h" #include "qmgr.h" +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(qmgr); HANDLE stop_event = NULL; diff --git a/media/doc/README.WINE b/media/doc/README.WINE index 32a7264789..037d653948 100644 --- a/media/doc/README.WINE +++ b/media/doc/README.WINE @@ -153,7 +153,7 @@ reactos/dll/win32/powrprof # Forked at Wine-1.0rc5 reactos/dll/win32/printui # Synced to WineStaging-3.3 reactos/dll/win32/propsys # Synced to WineStaging-3.3 reactos/dll/win32/pstorec # Synced to WineStaging-3.3 -reactos/dll/win32/qmgr # Synced to WineStaging-2.9 +reactos/dll/win32/qmgr # Synced to WineStaging-3.3 reactos/dll/win32/qmgrprxy # Synced to WineStaging-2.9 reactos/dll/win32/query # Synced to WineStaging-2.9 reactos/dll/win32/rasapi32 # Synced to WineStaging-2.9
6 years, 9 months
1
0
0
0
← Newer
1
...
17
18
19
20
21
22
23
...
44
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
Results per page:
10
25
50
100
200