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: [OLEDLG_WINETEST] Sync with Wine Staging 3.3. CORE-14434
by Amine Khaldi
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=000789f420a84a90974c3…
commit 000789f420a84a90974c375def1ccb1bcd5d0465 Author: Amine Khaldi <amine.khaldi(a)reactos.org> AuthorDate: Wed Mar 21 12:56:46 2018 +0100 Commit: Amine Khaldi <amine.khaldi(a)reactos.org> CommitDate: Wed Mar 21 12:56:46 2018 +0100 [OLEDLG_WINETEST] Sync with Wine Staging 3.3. CORE-14434 --- modules/rostests/winetests/oledlg/main.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/rostests/winetests/oledlg/main.c b/modules/rostests/winetests/oledlg/main.c index 8c2084f2df..5d452f1b09 100644 --- a/modules/rostests/winetests/oledlg/main.c +++ b/modules/rostests/winetests/oledlg/main.c @@ -20,11 +20,11 @@ #define COBJMACROS -#include <wine/test.h> +#include "wine/test.h" #include <stdio.h> -#include <initguid.h> -#include <oledlg.h> +#include "initguid.h" +#include "oledlg.h" static const WCHAR *strstrW( const WCHAR *str, const WCHAR *sub ) {
6 years, 9 months
1
0
0
0
01/01: [OLEDLG] Sync with Wine Staging 3.3. CORE-14434
by Amine Khaldi
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=8b391603d04b78ee7ba05…
commit 8b391603d04b78ee7ba05f74fb9028e61276c5c7 Author: Amine Khaldi <amine.khaldi(a)reactos.org> AuthorDate: Wed Mar 21 12:56:06 2018 +0100 Commit: Amine Khaldi <amine.khaldi(a)reactos.org> CommitDate: Wed Mar 21 12:56:06 2018 +0100 [OLEDLG] Sync with Wine Staging 3.3. CORE-14434 --- dll/win32/oledlg/CMakeLists.txt | 4 ++-- dll/win32/oledlg/insobjdlg.c | 18 +++++++++++++++--- dll/win32/oledlg/oledlg_main.c | 15 +++++++++++++++ dll/win32/oledlg/oledlg_private.h | 21 --------------------- dll/win32/oledlg/pastespl.c | 17 +++++++++++++++++ dll/win32/oledlg/precomp.h | 27 +++++++++++++++++++++++++++ dll/win32/oledlg/resource.h | 2 ++ media/doc/README.WINE | 2 +- 8 files changed, 79 insertions(+), 27 deletions(-) diff --git a/dll/win32/oledlg/CMakeLists.txt b/dll/win32/oledlg/CMakeLists.txt index ef8e247454..4d568d37e3 100644 --- a/dll/win32/oledlg/CMakeLists.txt +++ b/dll/win32/oledlg/CMakeLists.txt @@ -7,7 +7,7 @@ list(APPEND SOURCE insobjdlg.c oledlg_main.c pastespl.c - oledlg_private.h) + precomp.h) add_library(oledlg SHARED ${SOURCE} @@ -17,5 +17,5 @@ add_library(oledlg SHARED set_module_type(oledlg win32dll) target_link_libraries(oledlg wine) add_importlibs(oledlg ole32 comdlg32 user32 advapi32 msvcrt kernel32 ntdll) -add_pch(oledlg oledlg_private.h SOURCE) +add_pch(oledlg precomp.h SOURCE) add_cd_file(TARGET oledlg DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/oledlg/insobjdlg.c b/dll/win32/oledlg/insobjdlg.c index 349d6bc1fc..8c1d20588e 100644 --- a/dll/win32/oledlg/insobjdlg.c +++ b/dll/win32/oledlg/insobjdlg.c @@ -18,9 +18,21 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include "oledlg_private.h" - -#include <winreg.h> +#include <stdarg.h> +#include <stdio.h> + +#include "windef.h" +#include "winbase.h" +#include "winreg.h" +#include "wine/winternl.h" +#include "winerror.h" +#include "wingdi.h" +#include "winuser.h" +#include "wine/debug.h" +#include "wine/unicode.h" + +#include "oledlg.h" +#include "resource.h" WINE_DEFAULT_DEBUG_CHANNEL(oledlg); diff --git a/dll/win32/oledlg/oledlg_main.c b/dll/win32/oledlg/oledlg_main.c index 44be5eeda6..8ba9f17a7a 100644 --- a/dll/win32/oledlg/oledlg_main.c +++ b/dll/win32/oledlg/oledlg_main.c @@ -18,7 +18,22 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#define COBJMACROS + +#include <stdarg.h> + +#include "windef.h" +#include "winbase.h" +#include "winerror.h" +#include "wingdi.h" +#include "winuser.h" +#include "oledlg.h" +#include "ole2.h" #include "oledlg_private.h" +#include "resource.h" + +#include "wine/debug.h" +#include "wine/unicode.h" WINE_DEFAULT_DEBUG_CHANNEL(ole); diff --git a/dll/win32/oledlg/oledlg_private.h b/dll/win32/oledlg/oledlg_private.h index d9df7c2733..8be1d6b3cb 100644 --- a/dll/win32/oledlg/oledlg_private.h +++ b/dll/win32/oledlg/oledlg_private.h @@ -21,27 +21,6 @@ #ifndef __OLEDLG_PRIVATE_H__ #define __OLEDLG_PRIVATE_H__ -#include <stdarg.h> - -#define WIN32_NO_STATUS -#define _INC_WINDOWS -#define COM_NO_WINDOWS_H - -#define COBJMACROS -#define NONAMELESSSTRUCT -#define NONAMELESSUNION - -#include <windef.h> -#include <winbase.h> -#include <wingdi.h> -#include <winuser.h> -#include <oledlg.h> - -#include <wine/debug.h> -#include <wine/unicode.h> - -#include "resource.h" - extern HINSTANCE OLEDLG_hInstance DECLSPEC_HIDDEN; extern UINT cf_embed_source DECLSPEC_HIDDEN; diff --git a/dll/win32/oledlg/pastespl.c b/dll/win32/oledlg/pastespl.c index ff8ae41dc9..530c4eddda 100644 --- a/dll/win32/oledlg/pastespl.c +++ b/dll/win32/oledlg/pastespl.c @@ -18,7 +18,24 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#define COBJMACROS +#define NONAMELESSUNION + +#include <stdarg.h> + +#include "windef.h" +#include "winbase.h" +#include "winerror.h" +#include "wingdi.h" +#include "winuser.h" +#include "winnls.h" +#include "oledlg.h" + #include "oledlg_private.h" +#include "resource.h" + +#include "wine/debug.h" +#include "wine/unicode.h" WINE_DEFAULT_DEBUG_CHANNEL(ole); diff --git a/dll/win32/oledlg/precomp.h b/dll/win32/oledlg/precomp.h new file mode 100644 index 0000000000..4b6d825d23 --- /dev/null +++ b/dll/win32/oledlg/precomp.h @@ -0,0 +1,27 @@ + +#ifndef _OLEDLG_PRECOMP_H_ +#define _OLEDLG_PRECOMP_H_ + +#include <stdarg.h> + +#define WIN32_NO_STATUS +#define _INC_WINDOWS +#define COM_NO_WINDOWS_H + +#define COBJMACROS +#define NONAMELESSSTRUCT +#define NONAMELESSUNION + +#include <windef.h> +#include <winbase.h> +#include <wingdi.h> +#include <winuser.h> +#include <oledlg.h> + +#include <wine/debug.h> +#include <wine/unicode.h> + +#include "oledlg_private.h" +#include "resource.h" + +#endif /* !_OLEDLG_PRECOMP_H_ */ diff --git a/dll/win32/oledlg/resource.h b/dll/win32/oledlg/resource.h index 73b5365106..0cc5771dd5 100644 --- a/dll/win32/oledlg/resource.h +++ b/dll/win32/oledlg/resource.h @@ -20,6 +20,8 @@ #pragma once +#include <oledlg.h> + #define IDS_RESULTOBJDESC 101 #define IDS_RESULTFILEOBJDESC 102 #define IDS_BROWSE 103 diff --git a/media/doc/README.WINE b/media/doc/README.WINE index 3364224b3b..a577454652 100644 --- a/media/doc/README.WINE +++ b/media/doc/README.WINE @@ -143,7 +143,7 @@ reactos/dll/win32/ole32 # Synced to WineStaging-3.3 reactos/dll/win32/oleacc # Synced to WineStaging-3.3 reactos/dll/win32/oleaut32 # Synced to WineStaging-3.3 reactos/dll/win32/olecli32 # Synced to WineStaging-3.3 -reactos/dll/win32/oledlg # Synced to WineStaging-2.9 +reactos/dll/win32/oledlg # Synced to WineStaging-3.3 reactos/dll/win32/olepro32 # Synced to WineStaging-2.9 reactos/dll/win32/olesvr32 # Synced to WineStaging-2.9 reactos/dll/win32/olethk32 # Synced to WineStaging-2.9
6 years, 9 months
1
0
0
0
01/01: [OLECLI32] Sync with Wine Staging 3.3. CORE-14434
by Amine Khaldi
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=9d816efc05b5be0d7900e…
commit 9d816efc05b5be0d7900e61586fde9b8d5d67e6c Author: Amine Khaldi <amine.khaldi(a)reactos.org> AuthorDate: Wed Mar 21 12:53:19 2018 +0100 Commit: Amine Khaldi <amine.khaldi(a)reactos.org> CommitDate: Wed Mar 21 12:54:15 2018 +0100 [OLECLI32] Sync with Wine Staging 3.3. CORE-14434 --- dll/win32/olecli32/olecli_main.c | 20 +++++++++----------- media/doc/README.WINE | 2 +- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/dll/win32/olecli32/olecli_main.c b/dll/win32/olecli32/olecli_main.c index 01dc2cd766..7abd438372 100644 --- a/dll/win32/olecli32/olecli_main.c +++ b/dll/win32/olecli32/olecli_main.c @@ -21,20 +21,18 @@ /* At the moment, these are only empty stubs. */ -#define WIN32_NO_STATUS +#include "config.h" -#include <config.h> +#include <stdarg.h> -//#include <stdarg.h> - -//#include "windef.h" -#include <wine/windef16.h> -//#include "winbase.h" -#include <wingdi.h> -//#include "wownt32.h" -//#include "objbase.h" +#include "windef.h" +#include "wine/windef16.h" +#include "winbase.h" +#include "wingdi.h" +#include "wownt32.h" +#include "objbase.h" #include "olecli.h" -#include <wine/debug.h> +#include "wine/debug.h" WINE_DEFAULT_DEBUG_CHANNEL(ole); diff --git a/media/doc/README.WINE b/media/doc/README.WINE index 93c8ef96d0..3364224b3b 100644 --- a/media/doc/README.WINE +++ b/media/doc/README.WINE @@ -142,7 +142,7 @@ reactos/dll/win32/odbccp32 # Synced to WineStaging-3.3 reactos/dll/win32/ole32 # Synced to WineStaging-3.3 reactos/dll/win32/oleacc # Synced to WineStaging-3.3 reactos/dll/win32/oleaut32 # Synced to WineStaging-3.3 -reactos/dll/win32/olecli32 # Synced to WineStaging-2.9 +reactos/dll/win32/olecli32 # Synced to WineStaging-3.3 reactos/dll/win32/oledlg # Synced to WineStaging-2.9 reactos/dll/win32/olepro32 # Synced to WineStaging-2.9 reactos/dll/win32/olesvr32 # Synced to WineStaging-2.9
6 years, 9 months
1
0
0
0
01/01: [WS2_32_APITEST] Add additional testcases. CORE-13067
by Mark Jansen
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=47da4337426ee65df93c5…
commit 47da4337426ee65df93c52f0dd774e7bfeaebeea Author: Mark Jansen <mark.jansen(a)reactos.org> AuthorDate: Tue Mar 20 22:07:48 2018 +0100 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Tue Mar 20 22:20:12 2018 +0100 [WS2_32_APITEST] Add additional testcases. CORE-13067 --- modules/rostests/apitests/ws2_32/open_osfhandle.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/modules/rostests/apitests/ws2_32/open_osfhandle.c b/modules/rostests/apitests/ws2_32/open_osfhandle.c index 821b4f3fe7..ffb6691ecf 100644 --- a/modules/rostests/apitests/ws2_32/open_osfhandle.c +++ b/modules/rostests/apitests/ws2_32/open_osfhandle.c @@ -6,14 +6,21 @@ */ #include "ws2_32.h" +#include <ndk/iofuncs.h> +#include <ndk/obfuncs.h> #include <io.h> #include <fcntl.h> +#define WINVER_WIN8 0x0602 static void run_open_osfhandle(void) { DWORD type; int handle, err; + FILE_FS_DEVICE_INFORMATION DeviceInfo; + IO_STATUS_BLOCK StatusBlock; + NTSTATUS Status; + SOCKET fd = WSASocketA(AF_INET, SOCK_STREAM, 0, NULL, 0, 0); ok (fd != INVALID_SOCKET, "Invalid socket\n"); if (fd == INVALID_SOCKET) @@ -22,6 +29,21 @@ static void run_open_osfhandle(void) type = GetFileType((HANDLE)fd); ok(type == FILE_TYPE_PIPE, "Expected type FILE_TYPE_PIPE, was: %lu\n", type); + Status = NtQueryVolumeInformationFile((HANDLE)fd, &StatusBlock, &DeviceInfo, sizeof(DeviceInfo), FileFsDeviceInformation); + ok(Status == STATUS_SUCCESS, "Expected STATUS_SUCCESS, got 0x%lx\n", Status); + if (Status == STATUS_SUCCESS) + { + RTL_OSVERSIONINFOEXW rtlinfo = { sizeof(rtlinfo), 0 }; + ULONG Characteristics; + DWORD dwWinVersion; + ok(DeviceInfo.DeviceType == FILE_DEVICE_NAMED_PIPE, "Expected FILE_DEVICE_NAMED_PIPE, got: 0x%lx\n", DeviceInfo.DeviceType); + + RtlGetVersion((PRTL_OSVERSIONINFOW)&rtlinfo); + dwWinVersion = (rtlinfo.dwMajorVersion << 8) | rtlinfo.dwMinorVersion; + Characteristics = dwWinVersion >= WINVER_WIN8 ? 0x20000 : 0; + ok(DeviceInfo.Characteristics == Characteristics, "Expected 0x%lx, got: 0x%lx\n", Characteristics, DeviceInfo.Characteristics); + } + handle = _open_osfhandle(fd, _O_BINARY | _O_RDWR); err = *_errno();
6 years, 9 months
1
0
0
0
01/01: [INCLUDE/WINE] Addendum to bab6b90 for the MSVC build.
by Amine Khaldi
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=f204f24c98756c8fab033…
commit f204f24c98756c8fab033c3c6354b0e159b96048 Author: Amine Khaldi <amine.khaldi(a)reactos.org> AuthorDate: Tue Mar 20 13:09:18 2018 +0100 Commit: Amine Khaldi <amine.khaldi(a)reactos.org> CommitDate: Tue Mar 20 13:09:18 2018 +0100 [INCLUDE/WINE] Addendum to bab6b90 for the MSVC build. --- sdk/include/reactos/wine/typeof.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sdk/include/reactos/wine/typeof.h b/sdk/include/reactos/wine/typeof.h index b7ab75590b..1a84c5feda 100644 --- a/sdk/include/reactos/wine/typeof.h +++ b/sdk/include/reactos/wine/typeof.h @@ -26,6 +26,9 @@ struct jpeg_decompress_struct; struct _iobuf; struct _xsltTransformContext; struct _xmlOutputBuffer; +struct _xmlXPathParserContext; +struct _xmlDict; +enum xsltLoadType; typedef struct IWineD3D * (__stdcall typeof(WineDirect3DCreate))(unsigned int, struct IUnknown *); typedef struct IWineD3DClipper * (__stdcall typeof(WineDirect3DCreateClipper))(struct IUnknown *); @@ -56,6 +59,11 @@ typedef struct _xsltStylesheet * (__cdecl typeof(xsltNextImport))(struct _xsltSt typedef void (__cdecl typeof(xsltCleanupGlobals))(void); typedef void (__cdecl typeof(xsltFreeStylesheet))(struct _xsltStylesheet *); typedef struct _xsltStylesheet * (__cdecl typeof(xsltParseStylesheetDoc))(struct _xmlDoc *); +typedef void (__cdecl typeof(xsltFunctionNodeSet))(struct _xmlXPathParserContext *, int); +typedef void (__cdecl typeof(xmlXPathFunction))(struct _xmlXPathParserContext *, int); +typedef int (__cdecl typeof(xsltRegisterExtModuleFunction))(const unsigned char *, const unsigned char *, typeof(xmlXPathFunction)); +typedef struct _xmlDoc * (__cdecl typeof(xsltDocLoaderFunc))(const unsigned char *, struct _xmlDict *, int, void *, enum xsltLoadType); +typedef void (__cdecl typeof(xsltSetLoaderFunc))(typeof(xsltDocLoaderFunc)); typedef struct jpeg_error_mgr * (__cdecl typeof(jpeg_std_error))(struct jpeg_error_mgr *); typedef void (__cdecl typeof(jpeg_CreateDecompress))(struct jpeg_decompress_struct *, int, __typeof_size); typedef int (__cdecl typeof(jpeg_read_header))(struct jpeg_decompress_struct *, int);
6 years, 9 months
1
0
0
0
01/01: [OLEACC_WINETEST] Sync with Wine Staging 3.3. CORE-14434
by Amine Khaldi
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=b1433cb645d0519a495c2…
commit b1433cb645d0519a495c200f8c6bba1ccdfcfc56 Author: Amine Khaldi <amine.khaldi(a)reactos.org> AuthorDate: Tue Mar 20 12:40:39 2018 +0100 Commit: Amine Khaldi <amine.khaldi(a)reactos.org> CommitDate: Tue Mar 20 12:40:39 2018 +0100 [OLEACC_WINETEST] Sync with Wine Staging 3.3. CORE-14434 --- modules/rostests/winetests/oleacc/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/rostests/winetests/oleacc/main.c b/modules/rostests/winetests/oleacc/main.c index 88e412e2c3..7a0737caff 100644 --- a/modules/rostests/winetests/oleacc/main.c +++ b/modules/rostests/winetests/oleacc/main.c @@ -20,10 +20,10 @@ #define COBJMACROS -#include <wine/test.h> +#include "wine/test.h" #include <stdio.h> -//#include "initguid.h" +#include "initguid.h" #include <oleacc.h> #define DEFINE_EXPECT(func) \
6 years, 9 months
1
0
0
0
01/01: [OLEACC] Sync with Wine Staging 3.3. CORE-14434
by Amine Khaldi
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=493f429748f353434379d…
commit 493f429748f353434379de02ae3d0458d45ae348 Author: Amine Khaldi <amine.khaldi(a)reactos.org> AuthorDate: Tue Mar 20 12:39:58 2018 +0100 Commit: Amine Khaldi <amine.khaldi(a)reactos.org> CommitDate: Tue Mar 20 12:39:58 2018 +0100 [OLEACC] Sync with Wine Staging 3.3. CORE-14434 --- dll/win32/oleacc/CMakeLists.txt | 4 ++-- dll/win32/oleacc/client.c | 8 ++++++++ dll/win32/oleacc/main.c | 19 ++++++++++++++----- dll/win32/oleacc/oleacc.rc | 6 ++---- dll/win32/oleacc/oleacc_private.h | 29 ++--------------------------- dll/win32/oleacc/precomp.h | 19 +++++++++++++++++++ dll/win32/oleacc/propservice.c | 8 ++++++++ dll/win32/oleacc/window.c | 8 ++++++++ media/doc/README.WINE | 2 +- 9 files changed, 64 insertions(+), 39 deletions(-) diff --git a/dll/win32/oleacc/CMakeLists.txt b/dll/win32/oleacc/CMakeLists.txt index 891784d1e7..9f28fffd6c 100644 --- a/dll/win32/oleacc/CMakeLists.txt +++ b/dll/win32/oleacc/CMakeLists.txt @@ -13,7 +13,7 @@ list(APPEND SOURCE main.c propservice.c window.c - oleacc_private.h + precomp.h ${CMAKE_CURRENT_BINARY_DIR}/proxy.dlldata.c) add_idl_headers(oleacc_idlheader oleacc_classes.idl) @@ -39,5 +39,5 @@ add_dependencies(oleacc oleacc_idlheader stdole2) set_module_type(oleacc win32dll) target_link_libraries(oleacc uuid wine ${PSEH_LIB}) add_importlibs(oleacc oleaut32 ole32 user32 rpcrt4 msvcrt kernel32 ntdll) -add_pch(oleacc oleacc_private.h SOURCE) +add_pch(oleacc precomp.h SOURCE) add_cd_file(TARGET oleacc DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/oleacc/client.c b/dll/win32/oleacc/client.c index b4b8d6525c..5b1f0eee5f 100644 --- a/dll/win32/oleacc/client.c +++ b/dll/win32/oleacc/client.c @@ -16,8 +16,16 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#define COBJMACROS + #include "oleacc_private.h" +#include "wine/unicode.h" +#include "wine/debug.h" +#include "wine/heap.h" + +WINE_DEFAULT_DEBUG_CHANNEL(oleacc); + typedef struct { IAccessible IAccessible_iface; IOleWindow IOleWindow_iface; diff --git a/dll/win32/oleacc/main.c b/dll/win32/oleacc/main.c index ca6c65d86f..ee8a6c03b1 100644 --- a/dll/win32/oleacc/main.c +++ b/dll/win32/oleacc/main.c @@ -18,15 +18,24 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include "oleacc_private.h" - -#include <commctrl.h> -#include <rpcproxy.h> +#define COBJMACROS -#include <wine/unicode.h> +#include <stdarg.h> +#include "windef.h" +#include "winbase.h" +#include "ole2.h" +#include "commctrl.h" +#include "rpcproxy.h" +#include "initguid.h" +#include "oleacc_private.h" #include "resource.h" +#include "wine/unicode.h" +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(oleacc); + static const WCHAR lresult_atom_prefix[] = {'w','i','n','e','_','o','l','e','a','c','c',':'}; static const WCHAR menuW[] = {'#','3','2','7','6','8',0}; diff --git a/dll/win32/oleacc/oleacc.rc b/dll/win32/oleacc/oleacc.rc index aeb2facb5a..6acae631fa 100644 --- a/dll/win32/oleacc/oleacc.rc +++ b/dll/win32/oleacc/oleacc.rc @@ -18,9 +18,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include <windef.h> -#include <oleacc.h> - +#include "oleacc.h" #include "resource.h" 1 TYPELIB "oleacc_classes.tlb" @@ -36,7 +34,7 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL #define WINE_PRODUCTVERSION 6,1,7600,16385 #define WINE_PRODUCTVERSION_STR "6.1.6700.16385" -#include <wine/wine_common_ver.rc> +#include "wine/wine_common_ver.rc" /* UTF-8 */ #pragma code_page(65001) diff --git a/dll/win32/oleacc/oleacc_private.h b/dll/win32/oleacc/oleacc_private.h index d80578f6cd..52186828b1 100644 --- a/dll/win32/oleacc/oleacc_private.h +++ b/dll/win32/oleacc/oleacc_private.h @@ -16,37 +16,12 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#ifndef _OLEACC_PRIVATE_H_ -#define _OLEACC_PRIVATE_H_ +#pragma once -#define WIN32_NO_STATUS -#define _INC_WINDOWS -#define COM_NO_WINDOWS_H - -#define COBJMACROS - -#include <windef.h> -#include <winbase.h> -#include <ole2.h> -#include <oleacc_classes.h> - -#include <wine/debug.h> -WINE_DEFAULT_DEBUG_CHANNEL(oleacc); +#include "oleacc_classes.h" HRESULT create_client_object(HWND, const IID*, void**) DECLSPEC_HIDDEN; HRESULT create_window_object(HWND, const IID*, void**) DECLSPEC_HIDDEN; HRESULT get_accpropservices_factory(REFIID, void**) DECLSPEC_HIDDEN; int convert_child_id(VARIANT *v) DECLSPEC_HIDDEN; - -static inline void * __WINE_ALLOC_SIZE(1) heap_alloc_zero(size_t len) -{ - return HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, len); -} - -static inline BOOL heap_free(void *mem) -{ - return HeapFree(GetProcessHeap(), 0, mem); -} - -#endif /* _OLEACC_PRIVATE_H_ */ diff --git a/dll/win32/oleacc/precomp.h b/dll/win32/oleacc/precomp.h new file mode 100644 index 0000000000..e5b208dd09 --- /dev/null +++ b/dll/win32/oleacc/precomp.h @@ -0,0 +1,19 @@ + +#ifndef _OLEACC_PRECOMP_H_ +#define _OLEACC_PRECOMP_H_ + +#define WIN32_NO_STATUS +#define _INC_WINDOWS +#define COM_NO_WINDOWS_H + +#define COBJMACROS + +#include <windef.h> +#include <winbase.h> +#include <ole2.h> + +#include <wine/debug.h> + +#include "oleacc_private.h" + +#endif /* !_OLEACC_PRECOMP_H_ */ diff --git a/dll/win32/oleacc/propservice.c b/dll/win32/oleacc/propservice.c index bd99831777..3ed1818ef7 100644 --- a/dll/win32/oleacc/propservice.c +++ b/dll/win32/oleacc/propservice.c @@ -16,8 +16,16 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#define COBJMACROS + +#include <stdarg.h> + #include "oleacc_private.h" +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(oleacc); + static HRESULT WINAPI AccPropServices_QueryInterface(IAccPropServices *iface, REFIID riid, void **ppv) { if(IsEqualGUID(&IID_IUnknown, riid)) { diff --git a/dll/win32/oleacc/window.c b/dll/win32/oleacc/window.c index a7efe713f0..32c19fd7c2 100644 --- a/dll/win32/oleacc/window.c +++ b/dll/win32/oleacc/window.c @@ -16,8 +16,16 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#define COBJMACROS + #include "oleacc_private.h" +#include "wine/unicode.h" +#include "wine/debug.h" +#include "wine/heap.h" + +WINE_DEFAULT_DEBUG_CHANNEL(oleacc); + typedef struct { IAccessible IAccessible_iface; IOleWindow IOleWindow_iface; diff --git a/media/doc/README.WINE b/media/doc/README.WINE index 858be58afb..93c8ef96d0 100644 --- a/media/doc/README.WINE +++ b/media/doc/README.WINE @@ -140,7 +140,7 @@ reactos/dll/win32/objsel # Synced to WineStaging-3.3 reactos/dll/win32/odbc32 # Synced to WineStaging-3.3. Depends on port of Linux ODBC. reactos/dll/win32/odbccp32 # Synced to WineStaging-3.3 reactos/dll/win32/ole32 # Synced to WineStaging-3.3 -reactos/dll/win32/oleacc # Synced to WineStaging-2.9 +reactos/dll/win32/oleacc # Synced to WineStaging-3.3 reactos/dll/win32/oleaut32 # Synced to WineStaging-3.3 reactos/dll/win32/olecli32 # Synced to WineStaging-2.9 reactos/dll/win32/oledlg # Synced to WineStaging-2.9
6 years, 9 months
1
0
0
0
01/01: [OLE32_WINETEST] Sync with Wine Staging 3.3. CORE-14434
by Amine Khaldi
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=66f35ef8c98e032a30956…
commit 66f35ef8c98e032a30956814f5278446e6a8d4ee Author: Amine Khaldi <amine.khaldi(a)reactos.org> AuthorDate: Tue Mar 20 12:38:58 2018 +0100 Commit: Amine Khaldi <amine.khaldi(a)reactos.org> CommitDate: Tue Mar 20 12:38:58 2018 +0100 [OLE32_WINETEST] Sync with Wine Staging 3.3. CORE-14434 --- modules/rostests/winetests/ole32/clipboard.c | 14 +- modules/rostests/winetests/ole32/compobj.c | 232 +++++++++++++++++++- modules/rostests/winetests/ole32/defaulthandler.c | 12 +- modules/rostests/winetests/ole32/dragdrop.c | 14 +- modules/rostests/winetests/ole32/errorinfo.c | 11 +- modules/rostests/winetests/ole32/hglobalstream.c | 252 +++++++++++++++++++++- modules/rostests/winetests/ole32/marshal.c | 19 +- modules/rostests/winetests/ole32/moniker.c | 20 +- modules/rostests/winetests/ole32/ole2.c | 77 ++++++- modules/rostests/winetests/ole32/ole_server.c | 10 +- modules/rostests/winetests/ole32/precomp.h | 1 + modules/rostests/winetests/ole32/propvariant.c | 6 +- modules/rostests/winetests/ole32/stg_prop.c | 7 +- modules/rostests/winetests/ole32/storage32.c | 15 +- modules/rostests/winetests/ole32/usrmarshal.c | 11 +- 15 files changed, 652 insertions(+), 49 deletions(-) diff --git a/modules/rostests/winetests/ole32/clipboard.c b/modules/rostests/winetests/ole32/clipboard.c index 64fafaf1f2..002312d448 100644 --- a/modules/rostests/winetests/ole32/clipboard.c +++ b/modules/rostests/winetests/ole32/clipboard.c @@ -18,8 +18,20 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#define COBJMACROS +#define CONST_VTABLE +#ifndef __REACTOS__ +#define NONAMELESSUNION +#endif -#include "precomp.h" +#include <stdarg.h> +#include <stdio.h> + +#include "windef.h" +#include "winbase.h" +#include "objbase.h" + +#include "wine/test.h" #define InitFormatEtc(fe, cf, med) \ {\ diff --git a/modules/rostests/winetests/ole32/compobj.c b/modules/rostests/winetests/ole32/compobj.c index eeb4686f15..06d1914240 100644 --- a/modules/rostests/winetests/ole32/compobj.c +++ b/modules/rostests/winetests/ole32/compobj.c @@ -18,13 +18,31 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include "precomp.h" +#define COBJMACROS +#define CONST_VTABLE -#include <dde.h> -#include <ctxtcall.h> -#include <initguid.h> +#include <stdarg.h> +#include <stdio.h> + +#include "windef.h" +#include "winbase.h" +#define USE_COM_CONTEXT_DEF +#ifndef __REACTOS__ +#include "initguid.h" +#endif +#include "objbase.h" +#include "shlguid.h" +#include "urlmon.h" /* for CLSID_FileProtocol */ +#include "dde.h" +#include "cguid.h" -extern const IID GUID_NULL; +#include "ctxtcall.h" + +#include "wine/test.h" + +#ifdef __REACTOS__ +#include <initguid.h> +#endif #define DEFINE_EXPECT(func) \ static BOOL expect_ ## func = FALSE, called_ ## func = FALSE @@ -926,6 +944,7 @@ static DWORD WINAPI MessageFilter_MessagePending( DWORD dwPendingType) { trace("MessagePending\n"); + todo_wine ok(0, "unexpected call\n"); return PENDINGMSG_WAITNOPROCESS; } @@ -2620,6 +2639,15 @@ static DWORD CALLBACK send_message_thread(LPVOID arg) return 0; } +static DWORD CALLBACK send_and_post_user_message_thread(void *arg) +{ + HWND hwnd = arg; + Sleep(30); + SendMessageA(hwnd, WM_USER, 0, 0); + PostMessageA(hwnd, WM_USER, 0, 0); + return 0; +} + static DWORD CALLBACK post_message_thread(LPVOID arg) { HWND hWnd = arg; @@ -2629,14 +2657,103 @@ static DWORD CALLBACK post_message_thread(LPVOID arg) } static const char cls_name[] = "cowait_test_class"; + +static UINT cowait_msgs[100], cowait_msgs_first, cowait_msgs_last; + +static void cowait_msgs_reset(void) +{ + cowait_msgs_first = cowait_msgs_last = 0; +} + +#define cowait_msgs_expect_empty() _cowait_msgs_expect_empty(__LINE__) +static void _cowait_msgs_expect_empty(unsigned line) +{ + while(cowait_msgs_first < cowait_msgs_last) { + ok_(__FILE__,line)(0, "unexpected message %u\n", cowait_msgs[cowait_msgs_first]); + cowait_msgs_first++; + } + cowait_msgs_reset(); +} + +#define cowait_msgs_expect_notified(a) _cowait_msgs_expect_notified(__LINE__,a) +static void _cowait_msgs_expect_notified(unsigned line, UINT expected_msg) +{ + if(cowait_msgs_first == cowait_msgs_last) { + ok_(__FILE__,line)(0, "expected message %u, received none\n", expected_msg); + }else { + ok_(__FILE__,line)(cowait_msgs[cowait_msgs_first] == expected_msg, + "expected message %u, received %u \n", + expected_msg, cowait_msgs[cowait_msgs_first]); + cowait_msgs_first++; + } +} + +#define cowait_msgs_expect_queued(a,b) _cowait_msgs_expect_queued(__LINE__,a,b) +static void _cowait_msgs_expect_queued(unsigned line, HWND hwnd, UINT expected_msg) +{ + MSG msg; + BOOL success; + + success = PeekMessageA(&msg, hwnd, expected_msg, expected_msg, PM_REMOVE); + ok_(__FILE__,line)(success, "PeekMessageA failed: %u\n", GetLastError()); + if(success) + ok_(__FILE__,line)(msg.message == expected_msg, "unexpected message %u, expected %u\n", + msg.message, expected_msg); +} + +static void flush_messages(void) +{ + MSG msg; + while (PeekMessageA( &msg, 0, 0, 0, PM_REMOVE )); +} + +static LRESULT CALLBACK cowait_window_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) +{ + if(cowait_msgs_last < sizeof(cowait_msgs)/sizeof(*cowait_msgs)) + cowait_msgs[cowait_msgs_last++] = msg; + if(msg == WM_DDE_FIRST) + return 6; + return DefWindowProcA(hwnd, msg, wparam, lparam); +} + +static DWORD CALLBACK cowait_unmarshal_thread(void *arg) +{ + IStream *stream = arg; + IEnumOLEVERB *enum_verb; + LARGE_INTEGER zero; + IUnknown *unk; + HRESULT hr; + + CoInitialize(NULL); + + zero.QuadPart = 0; + hr = IStream_Seek(stream, zero, STREAM_SEEK_SET, NULL); + ok(hr == S_OK, "Seek failed: %08x\n", hr); + + hr = CoUnmarshalInterface(stream, &IID_IUnknown, (void**)&unk); + ok(hr == S_OK, "CoUnmarshalInterface failed: %08x\n", hr); + + hr = IUnknown_QueryInterface(unk, &IID_IEnumOLEVERB, (void**)&enum_verb); + ok(hr == S_OK, "QueryInterface failed: %08x\n", hr); + + IEnumOLEVERB_Release(enum_verb); + IUnknown_Release(unk); + + CoUninitialize(); + return 0; +} + static DWORD CALLBACK test_CoWaitForMultipleHandles_thread(LPVOID arg) { - HANDLE *handles = arg; + HANDLE *handles = arg, event, thread; + IStream *stream; BOOL success; - DWORD index; + DWORD index, tid; HRESULT hr; HWND hWnd; + UINT uMSG = 0xc065; MSG msg; + int ret; hr = pCoInitializeEx(NULL, COINIT_APARTMENTTHREADED); ok(hr == S_OK, "CoInitializeEx failed with error 0x%08x\n", hr); @@ -2660,8 +2777,58 @@ static DWORD CALLBACK test_CoWaitForMultipleHandles_thread(LPVOID arg) success = PeekMessageA(&msg, hWnd, WM_USER, WM_USER, PM_REMOVE); ok(success, "CoWaitForMultipleHandles unexpectedly pumped messages\n"); + /* Even if CoWaitForMultipleHandles does not pump a message it peeks + * at ALL of them */ + index = 0xdeadbeef; + PostMessageA(NULL, uMSG, 0, 0); + + hr = CoWaitForMultipleHandles(COWAIT_ALERTABLE, 50, 2, handles, &index); + ok(hr == RPC_S_CALLPENDING, "expected RPC_S_CALLPENDING, got 0x%08x\n", hr); + ok(index == 0 || broken(index == 0xdeadbeef) /* Win 8 */, "expected index 0, got %u\n", index); + + /* Make sure message was peeked at */ + ret = MsgWaitForMultipleObjectsEx(0, NULL, 2, QS_ALLPOSTMESSAGE, MWMO_ALERTABLE); + ok(ret == WAIT_TIMEOUT, "MsgWaitForMultipleObjects returned %x\n", ret); + + /* But not pumped */ + success = PeekMessageA(&msg, NULL, uMSG, uMSG, PM_REMOVE); + ok(success, "CoWaitForMultipleHandles unexpectedly pumped messages\n"); + DestroyWindow(hWnd); CoUninitialize(); + + hr = pCoInitializeEx(NULL, COINIT_APARTMENTTHREADED); + ok(hr == S_OK, "CoInitializeEx failed with error 0x%08x\n", hr); + + hr = CreateStreamOnHGlobal(NULL, TRUE, &stream); + ok(hr == S_OK, "CreateStreamOnHGlobal failed: %08x\n", hr); + + hr = CoMarshalInterface(stream, &IID_IUnknown, &Test_Unknown, MSHCTX_INPROC, NULL, MSHLFLAGS_NORMAL); + ok(hr == S_OK, "CoMarshalInterface should have returned S_OK instead of 0x%08x\n", hr); + + event = CreateEventW(NULL, TRUE, FALSE, NULL); + + PostQuitMessage(66); + PostThreadMessageW(GetCurrentThreadId(), WM_QUIT, 0, 0); + + hr = CoRegisterMessageFilter(&MessageFilter, NULL); + ok(hr == S_OK, "CoRegisterMessageFilter failed: %08x\n", hr); + + thread = CreateThread(NULL, 0, cowait_unmarshal_thread, stream, 0, &tid); + ok(thread != NULL, "CreateThread failed, error %u\n", GetLastError()); + hr = CoWaitForMultipleHandles(0, 50, 1, &event, &index); + ok(hr == RPC_S_CALLPENDING, "expected RPC_S_CALLPENDING, got 0x%08x\n", hr); + index = WaitForSingleObject(thread, 200); + ok(index == WAIT_OBJECT_0, "WaitForSingleObject failed\n"); + CloseHandle(thread); + + hr = CoRegisterMessageFilter(NULL, NULL); + ok(hr == S_OK, "CoRegisterMessageFilter failed: %08x\n", hr); + + IStream_Release(stream); + + CloseHandle(event); + CoUninitialize(); return 0; } @@ -2685,7 +2852,7 @@ static void test_CoWaitForMultipleHandles(void) wc.hCursor = LoadCursorA(NULL, (LPCSTR)IDC_ARROW); wc.hbrBackground = NULL; wc.lpszClassName = cls_name; - wc.lpfnWndProc = DefWindowProcA; + wc.lpfnWndProc = cowait_window_proc; success = RegisterClassExA(&wc) != 0; ok(success, "RegisterClassExA failed %u\n", GetLastError()); @@ -2860,6 +3027,29 @@ static void test_CoWaitForMultipleHandles(void) ok(index == WAIT_OBJECT_0, "WaitForSingleObject failed\n"); CloseHandle(thread); + cowait_msgs_reset(); + PostMessageA(hWnd, 0, 0, 0); + PostMessageA(hWnd, WM_DDE_FIRST, 0, 0); + PostMessageA(hWnd, WM_USER+1, 0, 0); + PostMessageA(hWnd, WM_DDE_FIRST+1, 0, 0); + thread = CreateThread(NULL, 0, send_and_post_user_message_thread, hWnd, 0, &tid); + ok(thread != NULL, "CreateThread failed, error %u\n", GetLastError()); + + hr = CoWaitForMultipleHandles(0, 100, 2, handles, &index); + ok(hr == RPC_S_CALLPENDING, "expected RPC_S_CALLPENDING, got 0x%08x\n", hr); + + cowait_msgs_expect_notified(WM_DDE_FIRST); + cowait_msgs_expect_notified(WM_DDE_FIRST+1); + cowait_msgs_expect_notified(WM_USER); + cowait_msgs_expect_empty(); + cowait_msgs_expect_queued(hWnd, WM_USER); + cowait_msgs_expect_queued(hWnd, WM_USER+1); + flush_messages(); + + index = WaitForSingleObject(thread, 200); + ok(index == WAIT_OBJECT_0, "WaitForSingleObject failed\n"); + CloseHandle(thread); + /* test behaviour of WM_QUIT (semaphores are still locked) */ PostMessageA(hWnd, WM_QUIT, 40, 0); @@ -2871,6 +3061,29 @@ static void test_CoWaitForMultipleHandles(void) success = PeekMessageA(&msg, hWnd, WM_QUIT, WM_QUIT, PM_REMOVE); ok(!success, "PeekMessageA succeeded\n"); + cowait_msgs_reset(); + PostMessageA(hWnd, WM_QUIT, 40, 0); + PostMessageA(hWnd, 0, 0, 0); + PostMessageA(hWnd, WM_DDE_FIRST, 0, 0); + PostMessageA(hWnd, WM_USER+1, 0, 0); + PostMessageA(hWnd, WM_DDE_FIRST+1, 0, 0); + thread = CreateThread(NULL, 0, send_and_post_user_message_thread, hWnd, 0, &tid); + ok(thread != NULL, "CreateThread failed, error %u\n", GetLastError()); + + hr = CoWaitForMultipleHandles(0, 100, 2, handles, &index); + ok(hr == RPC_S_CALLPENDING, "expected RPC_S_CALLPENDING, got 0x%08x\n", hr); + + cowait_msgs_expect_notified(WM_DDE_FIRST); + cowait_msgs_expect_notified(WM_DDE_FIRST+1); + cowait_msgs_expect_notified(WM_USER); + cowait_msgs_expect_empty(); + cowait_msgs_expect_queued(hWnd, WM_USER); + flush_messages(); + + index = WaitForSingleObject(thread, 200); + ok(index == WAIT_OBJECT_0, "WaitForSingleObject failed\n"); + CloseHandle(thread); + index = 0xdeadbeef; PostMessageA(hWnd, WM_DDE_FIRST, 0, 0); PostMessageA(hWnd, WM_QUIT, 41, 0); @@ -2940,10 +3153,8 @@ static void test_CoWaitForMultipleHandles(void) success = PeekMessageA(&msg, hWnd, WM_DDE_FIRST, WM_DDE_FIRST, PM_REMOVE); ok(success, "PeekMessageA failed, error %u\n", GetLastError()); success = PeekMessageA(&msg, hWnd, WM_DDE_FIRST, WM_DDE_FIRST, PM_REMOVE); - todo_wine ok(!success, "PeekMessageA succeeded\n"); success = PeekMessageA(&msg, hWnd, WM_QUIT, WM_QUIT, PM_REMOVE); - todo_wine ok(!success, "CoWaitForMultipleHandles didn't remove WM_QUIT messages\n"); index = WaitForSingleObject(thread, 200); ok(index == WAIT_OBJECT_0, "WaitForSingleObject failed\n"); @@ -2960,7 +3171,6 @@ static void test_CoWaitForMultipleHandles(void) success = PeekMessageA(&msg, hWnd, WM_DDE_FIRST, WM_DDE_FIRST, PM_REMOVE); ok(success, "PeekMessageA failed, error %u\n", GetLastError()); success = PeekMessageA(&msg, hWnd, WM_DDE_FIRST, WM_DDE_FIRST, PM_REMOVE); - todo_wine ok(!success, "PeekMessageA succeeded\n"); success = PeekMessageA(&msg, hWnd, WM_QUIT, WM_QUIT, PM_REMOVE); ok(!success, "CoWaitForMultipleHandles didn't remove WM_QUIT messages\n"); diff --git a/modules/rostests/winetests/ole32/defaulthandler.c b/modules/rostests/winetests/ole32/defaulthandler.c index c9e6af98b9..60bc29c08d 100644 --- a/modules/rostests/winetests/ole32/defaulthandler.c +++ b/modules/rostests/winetests/ole32/defaulthandler.c @@ -18,7 +18,17 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include "precomp.h" +#define COBJMACROS +#define CONST_VTABLE + +#include <stdarg.h> +#include <stdio.h> + +#include "windef.h" +#include "winbase.h" +#include "objbase.h" + +#include "wine/test.h" #define DEFINE_EXPECT(func) \ static BOOL expect_ ## func = FALSE, called_ ## func = FALSE diff --git a/modules/rostests/winetests/ole32/dragdrop.c b/modules/rostests/winetests/ole32/dragdrop.c index e14e757287..6abe4a9779 100644 --- a/modules/rostests/winetests/ole32/dragdrop.c +++ b/modules/rostests/winetests/ole32/dragdrop.c @@ -18,7 +18,19 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include "precomp.h" +#define _WIN32_DCOM +#define COBJMACROS +#define CONST_VTABLE + +#include <stdarg.h> +#include <stdio.h> + +#include "windef.h" +#include "winbase.h" +#include "objbase.h" + +#include "wine/test.h" + #define METHOD_LIST \ METHOD(DO_EnumFormatEtc), \ diff --git a/modules/rostests/winetests/ole32/errorinfo.c b/modules/rostests/winetests/ole32/errorinfo.c index c3e99a7a7b..bb350aea73 100644 --- a/modules/rostests/winetests/ole32/errorinfo.c +++ b/modules/rostests/winetests/ole32/errorinfo.c @@ -18,7 +18,16 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include "precomp.h" +#define COBJMACROS +#define CONST_VTABLE + +#include <stdarg.h> + +#include "windef.h" +#include "winbase.h" +#include "objbase.h" + +#include "wine/test.h" #define ok_ole_success(hr, func) ok(hr == S_OK, func " failed with error 0x%08x\n", hr) diff --git a/modules/rostests/winetests/ole32/hglobalstream.c b/modules/rostests/winetests/ole32/hglobalstream.c index 9974cd3200..15bf7c29a5 100644 --- a/modules/rostests/winetests/ole32/hglobalstream.c +++ b/modules/rostests/winetests/ole32/hglobalstream.c @@ -2,6 +2,7 @@ * Stream on HGLOBAL Tests * * Copyright 2006 Robert Shearman (for CodeWeavers) + * Copyright 2016 Dmitry Timoshkov * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -18,7 +19,15 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include "precomp.h" +#define COBJMACROS + +#include <stdarg.h> + +#include "windef.h" +#include "winbase.h" +#include "objbase.h" + +#include "wine/test.h" #define ok_ole_success(hr, func) ok(hr == S_OK, func " failed with error 0x%08x\n", hr) @@ -35,16 +44,20 @@ do { \ } \ } while(0) -static void test_streamonhglobal(IStream *pStream) +static void test_streamonhglobal(void) { const char data[] = "Test String"; ULARGE_INTEGER ull; + IStream *pStream; LARGE_INTEGER ll; char buffer[128]; ULONG read; STATSTG statstg; HRESULT hr; + hr = CreateStreamOnHGlobal(NULL, TRUE, &pStream); + ok(hr == S_OK, "Failed to create a stream, hr %#x.\n", hr); + ull.QuadPart = sizeof(data); hr = IStream_SetSize(pStream, ull); ok_ole_success(hr, "IStream_SetSize"); @@ -285,6 +298,8 @@ static void test_streamonhglobal(IStream *pStream) hr = IStream_SetSize(pStream, ull); ok(hr == E_OUTOFMEMORY || broken(hr == S_OK), /* win9x */ "IStream_SetSize with large size should have returned E_OUTOFMEMORY instead of 0x%08x\n", hr); + + IStream_Release(pStream); } static HRESULT WINAPI TestStream_QueryInterface(IStream *iface, REFIID riid, void **ppv) @@ -500,16 +515,237 @@ static void test_freed_hglobal(void) IStream_Release(pStream); } -START_TEST(hglobalstream) +static void stream_info(IStream *stream, HGLOBAL *hmem, int *size, int *pos) { HRESULT hr; - IStream *pStream; + STATSTG stat; + LARGE_INTEGER offset; + ULARGE_INTEGER newpos; + + *hmem = 0; + *size = *pos = -1; + + hr = GetHGlobalFromStream(stream, hmem); + ok(hr == S_OK, "unexpected %#x\n", hr); + + memset(&stat, 0x55, sizeof(stat)); + hr = IStream_Stat(stream, &stat, STATFLAG_DEFAULT); + ok(hr == S_OK, "unexpected %#x\n", hr); + ok(stat.type == STGTY_STREAM, "unexpected %#x\n", stat.type); + ok(!stat.pwcsName, "unexpected %p\n", stat.pwcsName); + ok(IsEqualIID(&stat.clsid, &GUID_NULL), "unexpected %s\n", wine_dbgstr_guid(&stat.clsid)); + ok(!stat.cbSize.HighPart, "unexpected %#x\n", stat.cbSize.HighPart); + *size = stat.cbSize.LowPart; + + offset.QuadPart = 0; + hr = IStream_Seek(stream, offset, STREAM_SEEK_CUR, &newpos); + ok(hr == S_OK, "unexpected %#x\n", hr); + ok(!newpos.HighPart, "unexpected %#x\n", newpos.HighPart); + *pos = newpos.LowPart; +} - hr = CreateStreamOnHGlobal(NULL, TRUE, &pStream); - ok_ole_success(hr, "CreateStreamOnHGlobal"); +static void test_IStream_Clone(void) +{ + static const char hello[] = "Hello World!"; + char buf[32]; + HRESULT hr; + IStream *stream, *clone; + HGLOBAL orig_hmem, hmem, hmem_clone; + ULARGE_INTEGER newsize; + LARGE_INTEGER offset; + int size, pos, ret; + + /* test simple case for Clone */ + orig_hmem = GlobalAlloc(GMEM_MOVEABLE, 0); + ok(orig_hmem != 0, "unexpected %p\n", orig_hmem); + hr = CreateStreamOnHGlobal(orig_hmem, TRUE, &stream); + ok(hr == S_OK, "unexpected %#x\n", hr); + + hr = GetHGlobalFromStream(stream, NULL); + ok(hr == E_INVALIDARG, "unexpected %#x\n", hr); + + hr = GetHGlobalFromStream(NULL, &hmem); + ok(hr == E_INVALIDARG, "unexpected %#x\n", hr); + + stream_info(stream, &hmem, &size, &pos); + ok(hmem == orig_hmem, "handles should match\n"); + ok(size == 0, "unexpected %d\n", size); + ok(pos == 0, "unexpected %d\n", pos); + + hr = IStream_Clone(stream, &clone); + ok(hr == S_OK, "unexpected %#x\n", hr); + + hr = IStream_Write(stream, hello, sizeof(hello), NULL); + ok(hr == S_OK, "unexpected %#x\n", hr); + + stream_info(stream, &hmem, &size, &pos); + ok(hmem != 0, "unexpected %p\n", hmem); + ok(size == 13, "unexpected %d\n", size); + ok(pos == 13, "unexpected %d\n", pos); + + stream_info(clone, &hmem_clone, &size, &pos); + ok(hmem_clone == hmem, "handles should match\n"); + ok(size == 13, "unexpected %d\n", size); + ok(pos == 0, "unexpected %d\n", pos); + + buf[0] = 0; + hr = IStream_Read(clone, buf, sizeof(buf), NULL); + ok(hr == S_OK, "unexpected %#x\n", hr); + ok(!strcmp(buf, hello), "wrong stream contents\n"); + + newsize.QuadPart = 0x8000; + hr = IStream_SetSize(stream, newsize); + ok(hr == S_OK, "unexpected %#x\n", hr); + + stream_info(stream, &hmem, &size, &pos); + ok(hmem != 0, "unexpected %p\n", hmem); + ok(hmem == orig_hmem, "unexpected %p\n", hmem); + ok(size == 0x8000, "unexpected %#x\n", size); + ok(pos == 13, "unexpected %d\n", pos); + + stream_info(clone, &hmem_clone, &size, &pos); + ok(hmem_clone == hmem, "handles should match\n"); + ok(size == 0x8000, "unexpected %#x\n", size); + ok(pos == 13, "unexpected %d\n", pos); + + IStream_Release(clone); + IStream_Release(stream); + + /* exploit GMEM_FIXED forced move for the same base streams */ + orig_hmem = GlobalAlloc(GMEM_FIXED, 1); + ok(orig_hmem != 0, "unexpected %p\n", orig_hmem); + hr = CreateStreamOnHGlobal(orig_hmem, TRUE, &stream); + ok(hr == S_OK, "unexpected %#x\n", hr); + + hr = IStream_Clone(stream, &clone); + ok(hr == S_OK, "unexpected %#x\n", hr); + + stream_info(stream, &hmem, &size, &pos); + ok(hmem != 0, "unexpected %p\n", hmem); + ok(size == 1, "unexpected %d\n", size); + ok(pos == 0, "unexpected %d\n", pos); + + stream_info(clone, &hmem_clone, &size, &pos); + ok(hmem_clone == hmem, "handles should match\n"); + ok(size == 1, "unexpected %d\n", size); + ok(pos == 0, "unexpected %d\n", pos); + + newsize.QuadPart = 0x8000; + hr = IStream_SetSize(stream, newsize); + ok(hr == S_OK, "unexpected %#x\n", hr); + + stream_info(stream, &hmem, &size, &pos); + ok(hmem != 0, "unexpected %p\n", hmem); + ok(hmem != orig_hmem, "unexpected %p\n", hmem); + ok(size == 0x8000, "unexpected %#x\n", size); + ok(pos == 0, "unexpected %d\n", pos); + + stream_info(clone, &hmem_clone, &size, &pos); + ok(hmem_clone == hmem, "handles should match\n"); + ok(size == 0x8000, "unexpected %#x\n", size); + ok(pos == 0, "unexpected %d\n", pos); + + IStream_Release(stream); + IStream_Release(clone); + + /* exploit GMEM_FIXED forced move for different base streams */ + orig_hmem = GlobalAlloc(GMEM_FIXED, 1); + ok(orig_hmem != 0, "unexpected %p\n", orig_hmem); + hr = CreateStreamOnHGlobal(orig_hmem, TRUE, &stream); + ok(hr == S_OK, "unexpected %#x\n", hr); + + hr = CreateStreamOnHGlobal(orig_hmem, TRUE, &clone); + ok(hr == S_OK, "unexpected %#x\n", hr); + + stream_info(stream, &hmem, &size, &pos); + ok(hmem != 0, "unexpected %p\n", hmem); + ok(size == 1, "unexpected %d\n", size); + ok(pos == 0, "unexpected %d\n", pos); + + stream_info(clone, &hmem_clone, &size, &pos); + ok(hmem_clone == hmem, "handles should match\n"); + ok(size == 1, "unexpected %d\n", size); + ok(pos == 0, "unexpected %d\n", pos); + + newsize.QuadPart = 0x8000; + hr = IStream_SetSize(stream, newsize); + ok(hr == S_OK, "unexpected %#x\n", hr); + + stream_info(stream, &hmem, &size, &pos); + ok(hmem != 0, "unexpected %p\n", hmem); + ok(hmem != orig_hmem, "unexpected %p\n", hmem); + ok(size == 0x8000, "unexpected %#x\n", size); + ok(pos == 0, "unexpected %d\n", pos); + + stream_info(clone, &hmem_clone, &size, &pos); + ok(hmem_clone != hmem, "handles should not match\n"); + ok(size == 1, "unexpected %#x\n", size); + ok(pos == 0, "unexpected %d\n", pos); + + IStream_Release(stream); + /* releasing clone leads to test termination under windows + IStream_Release(clone); + */ + + /* test Release for a being cloned stream */ + hr = CreateStreamOnHGlobal(0, TRUE, &stream); + ok(hr == S_OK, "unexpected %#x\n", hr); + + hr = IStream_Clone(stream, &clone); + ok(hr == S_OK, "unexpected %#x\n", hr); + + stream_info(stream, &hmem, &size, &pos); + ok(hmem != 0, "unexpected %p\n", hmem); + ok(size == 0, "unexpected %d\n", size); + ok(pos == 0, "unexpected %d\n", pos); + + stream_info(clone, &hmem_clone, &size, &pos); + ok(hmem_clone == hmem, "handles should match\n"); + ok(size == 0, "unexpected %#x\n", size); + ok(pos == 0, "unexpected %d\n", pos); + + ret = IStream_Release(stream); + ok(ret == 0, "unexpected %d\n", ret); + + newsize.QuadPart = 0x8000; + hr = IStream_SetSize(clone, newsize); + ok(hr == S_OK, "unexpected %#x\n", hr); + + stream_info(clone, &hmem_clone, &size, &pos); + ok(hmem_clone == hmem, "handles should match\n"); + ok(size == 0x8000, "unexpected %#x\n", size); + ok(pos == 0, "unexpected %d\n", pos); + + hr = IStream_Write(clone, hello, sizeof(hello), NULL); + ok(hr == S_OK, "unexpected %#x\n", hr); + + stream_info(clone, &hmem_clone, &size, &pos); + ok(hmem_clone == hmem, "handles should match\n"); + ok(size == 0x8000, "unexpected %#x\n", size); + ok(pos == 13, "unexpected %d\n", pos); + + offset.QuadPart = 0; + hr = IStream_Seek(clone, offset, STREAM_SEEK_SET, NULL); + ok(hr == S_OK, "unexpected %#x\n", hr); + + buf[0] = 0; + hr = IStream_Read(clone, buf, sizeof(buf), NULL); + ok(hr == S_OK, "unexpected %#x\n", hr); + ok(!strcmp(buf, hello), "wrong stream contents\n"); + + stream_info(clone, &hmem_clone, &size, &pos); + ok(hmem_clone == hmem, "handles should match\n"); + ok(size == 0x8000, "unexpected %#x\n", size); + ok(pos == 32, "unexpected %d\n", pos); + + ret = IStream_Release(clone); + ok(ret == 0, "unexpected %d\n", ret); +} - test_streamonhglobal(pStream); - IStream_Release(pStream); +START_TEST(hglobalstream) +{ + test_streamonhglobal(); test_copyto(); test_freed_hglobal(); + test_IStream_Clone(); } diff --git a/modules/rostests/winetests/ole32/marshal.c b/modules/rostests/winetests/ole32/marshal.c index 2a29e66efe..12c46e92df 100644 --- a/modules/rostests/winetests/ole32/marshal.c +++ b/modules/rostests/winetests/ole32/marshal.c @@ -18,9 +18,22 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include "precomp.h" - -#include <shlguid.h> +#define _WIN32_DCOM +#define COBJMACROS +#define CONST_VTABLE + +#include <stdarg.h> +#include <stdio.h> + +#include "windef.h" +#include "winbase.h" +#include "objbase.h" +#include "olectl.h" +#include "shlguid.h" +#include "shobjidl.h" +#include "initguid.h" + +#include "wine/test.h" DEFINE_GUID(CLSID_StdGlobalInterfaceTable,0x00000323,0x0000,0x0000,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x46); DEFINE_GUID(CLSID_ManualResetEvent, 0x0000032c,0x0000,0x0000,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x46); diff --git a/modules/rostests/winetests/ole32/moniker.c b/modules/rostests/winetests/ole32/moniker.c index ca94904696..7b67dfdb95 100644 --- a/modules/rostests/winetests/ole32/moniker.c +++ b/modules/rostests/winetests/ole32/moniker.c @@ -18,10 +18,22 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include "precomp.h" - -#include <comcat.h> -#include <olectl.h> +#define _WIN32_DCOM +#define COBJMACROS +#define CONST_VTABLE + +#include <stdarg.h> +#include <stdio.h> + +#include "windef.h" +#include "winbase.h" +#include "objbase.h" +#include "ocidl.h" +#include "initguid.h" +#include "comcat.h" +#include "olectl.h" + +#include "wine/test.h" #define ok_more_than_one_lock() ok(cLocks > 0, "Number of locks should be > 0, but actually is %d\n", cLocks) #define ok_no_locks() ok(cLocks == 0, "Number of locks should be 0, but actually is %d\n", cLocks) diff --git a/modules/rostests/winetests/ole32/ole2.c b/modules/rostests/winetests/ole32/ole2.c index d6dafc0f63..231f9d2531 100644 --- a/modules/rostests/winetests/ole32/ole2.c +++ b/modules/rostests/winetests/ole32/ole2.c @@ -19,15 +19,25 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include "precomp.h" +#define COBJMACROS +#define CONST_VTABLE +#define WIN32_LEAN_AND_MEAN + +#include <stdarg.h> + +#include "windef.h" +#include "winbase.h" +#include "wingdi.h" +#include "objbase.h" +#include "shlguid.h" + +#include "wine/test.h" -#ifndef __REACTOS__ #include "initguid.h" DEFINE_GUID(CLSID_Picture_Metafile,0x315,0,0,0xc0,0,0,0,0,0,0,0x46); DEFINE_GUID(CLSID_Picture_Dib,0x316,0,0,0xc0,0,0,0,0,0,0,0x46); DEFINE_GUID(CLSID_Picture_EnhMetafile,0x319,0,0,0xc0,0,0,0,0,0,0,0x46); -#endif #define ok_ole_success(hr, func) ok(hr == S_OK, func " failed with error 0x%08x\n", hr) @@ -144,7 +154,11 @@ typedef struct PresentationDataHeader DWORD dwSize; } PresentationDataHeader; +#ifdef __REACTOS__ static inline void check_expected_method_fmt(const char *method_name, const FORMATETC *fmt) +#else +static void inline check_expected_method_fmt(const char *method_name, const FORMATETC *fmt) +#endif { trace("%s\n", method_name); ok(expected_method_list->method != NULL, "Extra method %s called\n", method_name); @@ -2416,6 +2430,40 @@ static void test_data_cache_cache(void) IDataObject_Release( data ); IOleCache2_Release( cache ); + + /* tests for a static class cache */ + hr = CreateDataCache( NULL, &CLSID_Picture_Dib, &IID_IOleCache2, (void **)&cache ); + + fmt.cfFormat = CF_DIB; + fmt.dwAspect = DVASPECT_CONTENT; + fmt.tymed = TYMED_HGLOBAL; + hr = IOleCache2_Cache( cache, &fmt, 0, &conn ); + ok( hr == CACHE_S_SAMECACHE, "got %08x\n", hr ); + + /* aspect other than DVASPECT_CONTENT should fail */ + fmt.dwAspect = DVASPECT_THUMBNAIL; + hr = IOleCache2_Cache( cache, &fmt, 0, &conn ); + ok( FAILED(hr), "got %08x\n", hr ); + + fmt.dwAspect = DVASPECT_DOCPRINT; + hr = IOleCache2_Cache( cache, &fmt, 0, &conn ); + ok( FAILED(hr), "got %08x\n", hr ); + + /* try caching another clip format */ + fmt.cfFormat = CF_METAFILEPICT; + fmt.dwAspect = DVASPECT_CONTENT; + fmt.tymed = TYMED_MFPICT; + hr = IOleCache2_Cache( cache, &fmt, 0, &conn ); + ok( FAILED(hr), "got %08x\n", hr ); + + /* As an exception, it's possible to add an icon aspect */ + fmt.cfFormat = CF_METAFILEPICT; + fmt.dwAspect = DVASPECT_ICON; + fmt.tymed = TYMED_MFPICT; + hr = IOleCache2_Cache( cache, &fmt, 0, &conn ); + ok( hr == S_OK, "got %08x\n", hr ); + + IOleCache2_Release( cache ); } /* The CLSID_Picture_ classes automatically create appropriate cache entries */ @@ -3976,13 +4024,18 @@ static void check_storage_contents(IStorage *stg, const struct storage_def *stg_ hr = IStorage_OpenStream(stg, stat.pwcsName, NULL, STGM_READ | STGM_SHARE_EXCLUSIVE, 0, &stream); ok(hr == S_OK, "unexpected %#x\n", hr); - if (!memcmp(name, "\2OlePres", 7)) + if (!memcmp(name, "\2OlePres", 8)) { + ULONG header_size = sizeof(header); + clipformat = read_clipformat(stream); - hr = IStream_Read(stream, &header, sizeof(header), &bytes); + if (clipformat == 0) /* view cache */ + header_size = FIELD_OFFSET(PresentationDataHeader, unknown7); + + hr = IStream_Read(stream, &header, header_size, &bytes); ok(hr == S_OK, "unexpected %#x\n", hr); - ok(bytes >= 24, "read %u bytes\n", bytes); + ok(bytes == header_size, "read %u bytes, expected %u\n", bytes, header_size); if (winetest_debug > 1) trace("header: tdSize %#x, dvAspect %#x, lindex %#x, advf %#x, unknown7 %#x, dwObjectExtentX %#x, dwObjectExtentY %#x, dwSize %#x\n", @@ -4218,12 +4271,14 @@ static void test_data_cache_save_data(void) { CF_DIB, 0, DVASPECT_CONTENT, -1, TYMED_HGLOBAL }, { CF_METAFILEPICT, 0, DVASPECT_CONTENT, -1, TYMED_MFPICT }, { CF_ENHMETAFILE, 0, DVASPECT_CONTENT, -1, TYMED_ENHMF }, + { 0, 0, DVASPECT_DOCPRINT, -1, TYMED_HGLOBAL }, }, - 3, 3, &CLSID_WineTest, + 4, 3, &CLSID_WineTest, { - &CLSID_WineTestOld, 3, { { "\2OlePres000", CF_DIB, DVASPECT_CONTENT, 0, NULL, 0 }, + &CLSID_WineTestOld, 4, { { "\2OlePres000", CF_DIB, DVASPECT_CONTENT, 0, NULL, 0 }, { "\2OlePres001", CF_METAFILEPICT, DVASPECT_CONTENT, 0, NULL, 0 }, - { "\2OlePres002", CF_ENHMETAFILE, DVASPECT_CONTENT, 0, NULL, 0 } } + { "\2OlePres002", CF_ENHMETAFILE, DVASPECT_CONTENT, 0, NULL, 0 }, + { "\2OlePres003", 0, DVASPECT_DOCPRINT, 0, NULL, 0 } } } }, /* without setting data */ @@ -4410,7 +4465,6 @@ static void test_data_cache_contents(void) ok(hr == S_OK, "unexpected %#x\n", hr); hr = IPersistStorage_IsDirty(stg); -todo_wine_if(test_data[i].in == &stg_def_4 || test_data[i].in == &stg_def_8 || test_data[i].in == &stg_def_9) ok(hr == S_FALSE, "%d: unexpected %#x\n", i, hr); hr = IPersistStorage_Save(stg, doc2, FALSE); @@ -4423,7 +4477,8 @@ todo_wine_if(test_data[i].in == &stg_def_4 || test_data[i].in == &stg_def_8 || t todo_wine_if(!(test_data[i].in == &stg_def_0 || test_data[i].in == &stg_def_1 || test_data[i].in == &stg_def_2)) ok(enumerated_streams == matched_streams, "%d out: enumerated %d != matched %d\n", i, enumerated_streams, matched_streams); -todo_wine_if(!(test_data[i].in == &stg_def_0 || test_data[i].in == &stg_def_5)) +todo_wine_if(!(test_data[i].in == &stg_def_0 || test_data[i].in == &stg_def_4 || test_data[i].in == &stg_def_5 + || test_data[i].in == &stg_def_6)) ok(enumerated_streams == test_data[i].out->stream_count, "%d: saved streams %d != def streams %d\n", i, enumerated_streams, test_data[i].out->stream_count); diff --git a/modules/rostests/winetests/ole32/ole_server.c b/modules/rostests/winetests/ole32/ole_server.c index 9ca8bdf122..77abda47aa 100644 --- a/modules/rostests/winetests/ole32/ole_server.c +++ b/modules/rostests/winetests/ole32/ole_server.c @@ -18,7 +18,15 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include "precomp.h" +#define COBJMACROS +#define CONST_VTABLE + +#include <windows.h> +#include <exdisp.h> +#include <tlhelp32.h> +#include <stdio.h> +#include <assert.h> +#include "wine/test.h" #include <initguid.h> DEFINE_GUID(CLSID_WineTestObject, 0xdeadbeef,0xdead,0xbeef,0xde,0xad,0xbe,0xef,0xde,0xad,0xbe,0xef); diff --git a/modules/rostests/winetests/ole32/precomp.h b/modules/rostests/winetests/ole32/precomp.h index 24b5295b71..86f04814f3 100644 --- a/modules/rostests/winetests/ole32/precomp.h +++ b/modules/rostests/winetests/ole32/precomp.h @@ -1,3 +1,4 @@ + #ifndef _OLE32_WINETEST_PRECOMP_H_ #define _OLE32_WINETEST_PRECOMP_H_ diff --git a/modules/rostests/winetests/ole32/propvariant.c b/modules/rostests/winetests/ole32/propvariant.c index 8c3256621e..ade45fbd42 100644 --- a/modules/rostests/winetests/ole32/propvariant.c +++ b/modules/rostests/winetests/ole32/propvariant.c @@ -18,9 +18,11 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include "precomp.h" +#include "windows.h" +#include "wtypes.h" +#include "ddeml.h" -#include <ddeml.h> +#include "wine/test.h" /* invalid in all versions */ #define PROP_INV 0x7f diff --git a/modules/rostests/winetests/ole32/stg_prop.c b/modules/rostests/winetests/ole32/stg_prop.c index 9b189c64c9..c6d7d3efe9 100644 --- a/modules/rostests/winetests/ole32/stg_prop.c +++ b/modules/rostests/winetests/ole32/stg_prop.c @@ -15,8 +15,11 @@ * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ - -#include "precomp.h" +#include <stdio.h> +#define COBJMACROS +#include "objbase.h" +#include "wine/test.h" +#include "initguid.h" DEFINE_GUID(GUID_NULL,0,0,0,0,0,0,0,0,0,0,0); DEFINE_GUID(FMTID_SummaryInformation,0xF29F85E0,0x4FF9,0x1068,0xAB,0x91,0x08,0x00,0x2B,0x27,0xB3,0xD9); diff --git a/modules/rostests/winetests/ole32/storage32.c b/modules/rostests/winetests/ole32/storage32.c index 756b7691df..89ffc954f2 100644 --- a/modules/rostests/winetests/ole32/storage32.c +++ b/modules/rostests/winetests/ole32/storage32.c @@ -18,9 +18,20 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include "precomp.h" +#include <stdio.h> -#include <initguid.h> +#define COBJMACROS +#ifndef __REACTOS__ +#define NONAMELESSUNION +#define NONAMELESSSTRUCT +#endif + +#include <windows.h> +#include "wine/test.h" + +#include "ole2.h" +#include "objidl.h" +#include "initguid.h" DEFINE_GUID( test_stg_cls, 0x88888888, 0x0425, 0x0000, 0,0,0,0,0,0,0,0); diff --git a/modules/rostests/winetests/ole32/usrmarshal.c b/modules/rostests/winetests/ole32/usrmarshal.c index 8576ed78f2..3919395800 100644 --- a/modules/rostests/winetests/ole32/usrmarshal.c +++ b/modules/rostests/winetests/ole32/usrmarshal.c @@ -18,7 +18,16 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include "precomp.h" +#define COBJMACROS +#define CONST_VTABLE +#include <stdarg.h> + +#include "windef.h" +#include "winbase.h" +#include "objbase.h" +#include "objidl.h" + +#include "wine/test.h" ULONG __RPC_USER HMETAFILE_UserSize(ULONG *, ULONG, HMETAFILE *); unsigned char * __RPC_USER HMETAFILE_UserMarshal(ULONG *, unsigned char *, HMETAFILE *);
6 years, 9 months
1
0
0
0
01/01: [OLE32] Sync with Wine Staging 3.3. CORE-14434
by Amine Khaldi
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=c0f9087299453b4a7ef73…
commit c0f9087299453b4a7ef73bc021fc80ee723a9b4a Author: Amine Khaldi <amine.khaldi(a)reactos.org> AuthorDate: Tue Mar 20 12:38:17 2018 +0100 Commit: Amine Khaldi <amine.khaldi(a)reactos.org> CommitDate: Tue Mar 20 12:38:17 2018 +0100 [OLE32] Sync with Wine Staging 3.3. CORE-14434 --- dll/win32/ole32/antimoniker.c | 14 +- dll/win32/ole32/bindctx.c | 13 +- dll/win32/ole32/classmoniker.c | 15 +- dll/win32/ole32/clipboard.c | 21 +- dll/win32/ole32/comcat.c | 18 +- dll/win32/ole32/compobj.c | 60 ++++-- dll/win32/ole32/compobj_private.h | 24 +-- dll/win32/ole32/compositemoniker.c | 15 +- dll/win32/ole32/datacache.c | 335 +++++++++++++++---------------- dll/win32/ole32/defaulthandler.c | 16 +- dll/win32/ole32/dictionary.c | 8 +- dll/win32/ole32/dictionary.h | 4 + dll/win32/ole32/enumx.c | 29 ++- dll/win32/ole32/enumx.h | 7 +- dll/win32/ole32/errorinfo.c | 16 +- dll/win32/ole32/filelockbytes.c | 22 ++- dll/win32/ole32/filemoniker.c | 18 +- dll/win32/ole32/ftmarshal.c | 18 +- dll/win32/ole32/git.c | 16 +- dll/win32/ole32/hglobalstream.c | 393 +++++++++++++++++++++---------------- dll/win32/ole32/ifs.c | 18 +- dll/win32/ole32/itemmoniker.c | 17 +- dll/win32/ole32/marshal.c | 18 +- dll/win32/ole32/memlockbytes.c | 18 +- dll/win32/ole32/moniker.c | 30 ++- dll/win32/ole32/ole2.c | 28 ++- dll/win32/ole32/ole2impl.c | 15 +- dll/win32/ole32/ole2stubs.c | 11 +- dll/win32/ole32/ole32_main.c | 15 +- dll/win32/ole32/ole32res.rc | 10 +- dll/win32/ole32/oleobj.c | 16 +- dll/win32/ole32/oleproxy.c | 22 ++- dll/win32/ole32/pointermoniker.c | 15 +- dll/win32/ole32/precomp.h | 5 +- dll/win32/ole32/rpc.c | 27 ++- dll/win32/ole32/stg_prop.c | 74 ++++++- dll/win32/ole32/stg_stream.c | 22 ++- dll/win32/ole32/storage32.c | 22 ++- dll/win32/ole32/storage32.h | 11 +- dll/win32/ole32/stubmanager.c | 18 +- dll/win32/ole32/usrmarshal.c | 20 +- media/doc/README.WINE | 2 +- 42 files changed, 1059 insertions(+), 437 deletions(-) diff --git a/dll/win32/ole32/antimoniker.c b/dll/win32/ole32/antimoniker.c index 621a67a804..f7912fad78 100644 --- a/dll/win32/ole32/antimoniker.c +++ b/dll/win32/ole32/antimoniker.c @@ -18,7 +18,19 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include "precomp.h" +#include <assert.h> +#include <stdarg.h> +#include <string.h> + +#define COBJMACROS +#define NONAMELESSUNION + +#include "windef.h" +#include "winbase.h" +#include "winerror.h" +#include "objbase.h" +#include "wine/debug.h" +#include "moniker.h" WINE_DEFAULT_DEBUG_CHANNEL(ole); diff --git a/dll/win32/ole32/bindctx.c b/dll/win32/ole32/bindctx.c index 45013e68e0..8be88a64c0 100644 --- a/dll/win32/ole32/bindctx.c +++ b/dll/win32/ole32/bindctx.c @@ -18,7 +18,18 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include "precomp.h" +#include <stdarg.h> +#include <string.h> + +#define COBJMACROS + +#include "winerror.h" +#include "windef.h" +#include "winbase.h" +#include "winnls.h" +#include "objbase.h" + +#include "wine/debug.h" WINE_DEFAULT_DEBUG_CHANNEL(ole); diff --git a/dll/win32/ole32/classmoniker.c b/dll/win32/ole32/classmoniker.c index dfbc8730fe..ebad7947c6 100644 --- a/dll/win32/ole32/classmoniker.c +++ b/dll/win32/ole32/classmoniker.c @@ -19,7 +19,20 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include "precomp.h" +#include <assert.h> +#include <stdarg.h> +#include <string.h> + +#define COBJMACROS + +#include "winerror.h" +#include "windef.h" +#include "winbase.h" +#include "winuser.h" +#include "wine/debug.h" +#include "ole2.h" +#include "wine/unicode.h" +#include "moniker.h" WINE_DEFAULT_DEBUG_CHANNEL(ole); diff --git a/dll/win32/ole32/clipboard.c b/dll/win32/ole32/clipboard.c index b1bd485282..9448f5bc4a 100644 --- a/dll/win32/ole32/clipboard.c +++ b/dll/win32/ole32/clipboard.c @@ -58,9 +58,28 @@ * */ -#include "precomp.h" +#include <assert.h> +#include <stdarg.h> +#include <string.h> +#include <stdio.h> + +#define COBJMACROS +#define NONAMELESSUNION + +#include "windef.h" +#include "winbase.h" +#include "wingdi.h" +#include "winuser.h" +#include "winerror.h" +#include "winnls.h" +#include "ole2.h" +#include "wine/debug.h" +#include "olestd.h" + #include "storage32.h" +#include "compobj_private.h" + WINE_DEFAULT_DEBUG_CHANNEL(ole); /* Structure of 'Ole Private Data' clipboard format */ diff --git a/dll/win32/ole32/comcat.c b/dll/win32/ole32/comcat.c index 25a88a381e..d43c3afc0d 100644 --- a/dll/win32/ole32/comcat.c +++ b/dll/win32/ole32/comcat.c @@ -18,7 +18,23 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include "precomp.h" +#include <string.h> +#include <stdarg.h> + +#define COBJMACROS + +#include "windef.h" +#include "winbase.h" +#include "winuser.h" +#include "winreg.h" +#include "winerror.h" + +#include "ole2.h" +#include "comcat.h" +#include "compobj_private.h" + +#include "wine/unicode.h" +#include "wine/debug.h" WINE_DEFAULT_DEBUG_CHANNEL(ole); diff --git a/dll/win32/ole32/compobj.c b/dll/win32/ole32/compobj.c index fd912d4e73..4cb8f4be64 100644 --- a/dll/win32/ole32/compobj.c +++ b/dll/win32/ole32/compobj.c @@ -36,10 +36,38 @@ * */ -#include "precomp.h" +#include "config.h" + +#include <stdarg.h> +#include <stdio.h> +#include <string.h> +#include <assert.h> + +#define COBJMACROS +#define NONAMELESSUNION + +#include "ntstatus.h" +#define WIN32_NO_STATUS +#include "windef.h" +#include "winbase.h" +#include "winerror.h" +#include "winreg.h" +#include "winuser.h" +#define USE_COM_CONTEXT_DEF +#include "objbase.h" +#include "ole2.h" +#include "ole2ver.h" +#include "ctxtcall.h" +#include "dde.h" +#include "servprov.h" +#ifndef __REACTOS__ +#include "initguid.h" +#endif +#include "compobj_private.h" +#include "moniker.h" -#include <ctxtcall.h> -#include <dde.h> +#include "wine/unicode.h" +#include "wine/debug.h" WINE_DEFAULT_DEBUG_CHANNEL(ole); @@ -4445,6 +4473,8 @@ HRESULT WINAPI CoWaitForMultipleHandles(DWORD dwFlags, DWORD dwTimeout, APARTMENT *apt = COM_CurrentApt(); BOOL message_loop = apt && !apt->multi_threaded; BOOL check_apc = (dwFlags & COWAIT_ALERTABLE) != 0; + BOOL post_quit = FALSE; + UINT exit_code; TRACE("(0x%08x, 0x%08x, %d, %p, %p)\n", dwFlags, dwTimeout, cHandles, pHandles, lpdwindex); @@ -4525,20 +4555,27 @@ HRESULT WINAPI CoWaitForMultipleHandles(DWORD dwFlags, DWORD dwTimeout, } } + if (!apt->win) + { + /* If window is NULL on apartment, peek at messages so that it will not trigger + * MsgWaitForMultipleObjects next time. */ + PeekMessageW(NULL, NULL, 0, 0, PM_QS_POSTMESSAGE | PM_NOREMOVE | PM_NOYIELD); + } /* some apps (e.g. Visio 2010) don't handle WM_PAINT properly and loop forever, * so after processing 100 messages we go back to checking the wait handles */ while (count++ < 100 && COM_PeekMessage(apt, &msg)) { - TRACE("received message whilst waiting for RPC: 0x%04x\n", msg.message); - TranslateMessage(&msg); - DispatchMessageW(&msg); if (msg.message == WM_QUIT) { - TRACE("resending WM_QUIT to outer message loop\n"); - PostQuitMessage(msg.wParam); - /* no longer need to process messages */ - message_loop = FALSE; - break; + TRACE("received WM_QUIT message\n"); + post_quit = TRUE; + exit_code = msg.wParam; + } + else + { + TRACE("received message whilst waiting for RPC: 0x%04x\n", msg.message); + TranslateMessage(&msg); + DispatchMessageW(&msg); } } continue; @@ -4567,6 +4604,7 @@ HRESULT WINAPI CoWaitForMultipleHandles(DWORD dwFlags, DWORD dwTimeout, } break; } + if (post_quit) PostQuitMessage(exit_code); TRACE("-- 0x%08x\n", hr); return hr; } diff --git a/dll/win32/ole32/compobj_private.h b/dll/win32/ole32/compobj_private.h index c1739f57e9..9e65c3ec0c 100644 --- a/dll/win32/ole32/compobj_private.h +++ b/dll/win32/ole32/compobj_private.h @@ -27,6 +27,18 @@ /* All private prototype functions used by OLE will be added to this header file */ +#include <stdarg.h> + +#include "wine/list.h" +#include "wine/heap.h" + +#include "windef.h" +#include "winbase.h" +#include "wtypes.h" +#include "dcom.h" +#include "winreg.h" +#include "winternl.h" + struct apartment; typedef struct apartment APARTMENT; typedef struct LocalServer LocalServer; @@ -248,7 +260,7 @@ void leave_apartment(struct oletls *info) DECLSPEC_HIDDEN; static inline struct oletls *COM_CurrentInfo(void) { if (!NtCurrentTeb()->ReservedForOle) - NtCurrentTeb()->ReservedForOle = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(struct oletls)); + NtCurrentTeb()->ReservedForOle = heap_alloc_zero(sizeof(struct oletls)); return NtCurrentTeb()->ReservedForOle; } @@ -312,16 +324,6 @@ extern BOOL actctx_get_miscstatus(const CLSID*, DWORD, DWORD*) DECLSPEC_HIDDEN; extern const char *debugstr_formatetc(const FORMATETC *formatetc) DECLSPEC_HIDDEN; -static inline void* __WINE_ALLOC_SIZE(1) heap_alloc(size_t len) -{ - return HeapAlloc(GetProcessHeap(), 0, len); -} - -static inline BOOL heap_free(void *mem) -{ - return HeapFree(GetProcessHeap(), 0, mem); -} - static inline HRESULT copy_formatetc(FORMATETC *dst, const FORMATETC *src) { *dst = *src; diff --git a/dll/win32/ole32/compositemoniker.c b/dll/win32/ole32/compositemoniker.c index 1ad7381c61..75d97fa7e3 100644 --- a/dll/win32/ole32/compositemoniker.c +++ b/dll/win32/ole32/compositemoniker.c @@ -18,7 +18,20 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include "precomp.h" +#include <assert.h> +#include <stdarg.h> +#include <string.h> + +#define COBJMACROS + +#include "windef.h" +#include "winbase.h" +#include "winuser.h" +#include "winerror.h" +#include "wine/debug.h" +#include "wine/unicode.h" +#include "ole2.h" +#include "moniker.h" WINE_DEFAULT_DEBUG_CHANNEL(ole); diff --git a/dll/win32/ole32/datacache.c b/dll/win32/ole32/datacache.c index e3697761e0..325a98b33b 100644 --- a/dll/win32/ole32/datacache.c +++ b/dll/win32/ole32/datacache.c @@ -44,7 +44,22 @@ * was stored and the aspect, but that's about it. */ -#include "precomp.h" +#include <stdarg.h> +#include <string.h> + +#define COBJMACROS +#define NONAMELESSUNION + +#include "windef.h" +#include "winbase.h" +#include "wingdi.h" +#include "winuser.h" +#include "winerror.h" +#include "ole2.h" +#include "compobj_private.h" +#include "wine/unicode.h" +#include "wine/list.h" +#include "wine/debug.h" WINE_DEFAULT_DEBUG_CHANNEL(ole); @@ -75,12 +90,8 @@ typedef struct PresentationDataHeader DWORD dwSize; } PresentationDataHeader; -enum stream_type -{ - no_stream, - pres_stream, - contents_stream -}; +#define STREAM_NUMBER_NOT_SET -2 +#define STREAM_NUMBER_CONTENTS -1 /* CONTENTS stream */ typedef struct DataCacheEntry { @@ -89,19 +100,16 @@ typedef struct DataCacheEntry FORMATETC fmtetc; /* cached data */ STGMEDIUM stgmedium; - /* - * This stream pointer is set through a call to - * IPersistStorage_Load. This is where the visual - * representation of the object is stored. - */ - IStream *stream; - enum stream_type stream_type; /* connection ID */ DWORD id; /* dirty flag */ BOOL dirty; - /* stream number (-1 if not set ) */ - unsigned short stream_number; + /* stream number that the entry was loaded from. + This is used to defer loading until the data is actually needed. */ + int load_stream_num; + /* stream number that the entry will be saved to. + This may differ from above if cache entries have been Uncache()d for example. */ + int save_stream_num; /* sink id set when object is running */ DWORD sink_id; /* Advise sink flags */ @@ -147,6 +155,9 @@ struct DataCache IAdviseSink *sinkInterface; CLSID clsid; + /* Is the clsid one of the CLSID_Picture classes */ + BOOL clsid_static; + IStorage *presentationStorage; /* list of cache entries */ @@ -242,8 +253,6 @@ static int bitmap_info_size( const BITMAPINFO * info, WORD coloruse ) static void DataCacheEntry_Destroy(DataCache *cache, DataCacheEntry *cache_entry) { list_remove(&cache_entry->entry); - if (cache_entry->stream) - IStream_Release(cache_entry->stream); CoTaskMemFree(cache_entry->fmtetc.ptd); ReleaseStgMedium(&cache_entry->stgmedium); if(cache_entry->sink_id) @@ -303,6 +312,29 @@ static DataCacheEntry *DataCache_GetEntryForFormatEtc(DataCache *This, const FOR return NULL; } +/* Returns the cache entry associated with a static CLSID. + This will be first in the list with connection id == 1 */ +static HRESULT get_static_entry( DataCache *cache, DataCacheEntry **cache_entry ) +{ + DataCacheEntry *entry; + struct list *head = list_head( &cache->cache_list ); + HRESULT hr = E_FAIL; + + *cache_entry = NULL; + + if (head) + { + entry = LIST_ENTRY( head, DataCacheEntry, entry ); + if (entry->id == 1) + { + *cache_entry = entry; + hr = S_OK; + } + } + + return hr; +} + /* checks that the clipformat and tymed are valid and returns an error if they * aren't and CACHE_S_NOTSUPPORTED if they are valid, but can't be rendered by * DataCache_Draw */ @@ -337,11 +369,10 @@ static BOOL init_cache_entry(DataCacheEntry *entry, const FORMATETC *fmt, DWORD entry->stgmedium.tymed = TYMED_NULL; entry->stgmedium.pUnkForRelease = NULL; - entry->stream = NULL; - entry->stream_type = no_stream; entry->id = id; entry->dirty = TRUE; - entry->stream_number = -1; + entry->load_stream_num = STREAM_NUMBER_NOT_SET; + entry->save_stream_num = STREAM_NUMBER_NOT_SET; entry->sink_id = 0; entry->advise_flags = advf; @@ -428,23 +459,6 @@ static void DataCache_FireOnViewChange( } } -/* Helper for DataCacheEntry_OpenPresStream */ -static BOOL DataCache_IsPresentationStream(const STATSTG *elem) -{ - /* The presentation streams have names of the form "\002OlePresXXX", - * where XXX goes from 000 to 999. */ - static const WCHAR OlePres[] = { 2,'O','l','e','P','r','e','s' }; - - LPCWSTR name = elem->pwcsName; - - return (elem->type == STGTY_STREAM) - && (strlenW(name) == 11) - && (strncmpW(name, OlePres, 8) == 0) - && (name[8] >= '0') && (name[8] <= '9') - && (name[9] >= '0') && (name[9] <= '9') - && (name[10] >= '0') && (name[10] <= '9'); -} - static HRESULT read_clipformat(IStream *stream, CLIPFORMAT *clipformat) { DWORD length; @@ -491,7 +505,9 @@ static HRESULT write_clipformat(IStream *stream, CLIPFORMAT clipformat) HRESULT hr; char format_name[256]; - if (clipformat < 0xc000) + if (clipformat == 0) + length = 0; + else if (clipformat < 0xc000) length = -1; else { @@ -500,8 +516,9 @@ static HRESULT write_clipformat(IStream *stream, CLIPFORMAT clipformat) if (length) length++; } hr = IStream_Write(stream, &length, sizeof(length), NULL); - if (FAILED(hr)) + if (FAILED(hr) || clipformat == 0) return hr; + if (clipformat < 0xc000) { DWORD cf = clipformat; @@ -514,55 +531,22 @@ static HRESULT write_clipformat(IStream *stream, CLIPFORMAT clipformat) return hr; } -/************************************************************************ - * DataCacheEntry_OpenPresStream - * - * This method will find the stream for the given presentation. It makes - * no attempt at fallback. - * - * Param: - * this - Pointer to the DataCache object - * drawAspect - The aspect of the object that we wish to draw. - * pStm - A returned stream. It points to the beginning of the - * - presentation data, including the header. - * - * Errors: - * S_OK The requested stream has been opened. - * OLE_E_BLANK The requested stream could not be found. - * Quite a few others I'm too lazy to map correctly. - * - * Notes: - * Algorithm: Scan the elements of the presentation storage, looking - * for presentation streams. For each presentation stream, - * load the header and check to see if the aspect matches. - * - * If a fallback is desired, just opening the first presentation stream - * is a possibility. - */ -static HRESULT DataCacheEntry_OpenPresStream(DataCacheEntry *cache_entry, IStream **ppStm) -{ - HRESULT hr; - LARGE_INTEGER offset; +static const WCHAR CONTENTS[] = {'C','O','N','T','E','N','T','S',0}; - if (cache_entry->stream) - { - /* Rewind the stream before returning it. */ - offset.QuadPart = 0; +static HRESULT open_pres_stream( IStorage *stg, int stream_number, IStream **stm ) +{ + WCHAR pres[] = {2,'O','l','e','P','r','e','s', + '0' + (stream_number / 100) % 10, + '0' + (stream_number / 10) % 10, + '0' + stream_number % 10, 0}; + const WCHAR *name = pres; - hr = IStream_Seek( cache_entry->stream, offset, STREAM_SEEK_SET, NULL ); - if (SUCCEEDED( hr )) - { - *ppStm = cache_entry->stream; - IStream_AddRef( cache_entry->stream ); - } - } - else - hr = OLE_E_BLANK; + if (stream_number == STREAM_NUMBER_NOT_SET) return E_FAIL; + if (stream_number == STREAM_NUMBER_CONTENTS) name = CONTENTS; - return hr; + return IStorage_OpenStream( stg, name, NULL, STGM_READ | STGM_SHARE_EXCLUSIVE, 0, stm ); } - static HRESULT load_mf_pict( DataCacheEntry *cache_entry, IStream *stm ) { HRESULT hr; @@ -576,9 +560,9 @@ static HRESULT load_mf_pict( DataCacheEntry *cache_entry, IStream *stm ) static const LARGE_INTEGER offset_zero; ULONG read; - if (cache_entry->stream_type != pres_stream) + if (cache_entry->load_stream_num == STREAM_NUMBER_CONTENTS) { - FIXME( "Unimplemented for stream type %d\n", cache_entry->stream_type ); + FIXME( "Unimplemented for CONTENTS stream\n" ); return E_FAIL; } @@ -645,9 +629,9 @@ static HRESULT load_dib( DataCacheEntry *cache_entry, IStream *stm ) BITMAPFILEHEADER file; BITMAPINFOHEADER *info; - if (cache_entry->stream_type != contents_stream) + if (cache_entry->load_stream_num != STREAM_NUMBER_CONTENTS) { - FIXME( "Unimplemented for stream type %d\n", cache_entry->stream_type ); + FIXME( "Unimplemented for presentation stream\n" ); return E_FAIL; } @@ -733,12 +717,13 @@ fail: * This method returns a metafile handle if it is successful. * it will return 0 if not. */ -static HRESULT DataCacheEntry_LoadData(DataCacheEntry *cache_entry) +static HRESULT DataCacheEntry_LoadData(DataCacheEntry *cache_entry, IStorage *stg) { HRESULT hr; IStream *stm; - hr = DataCacheEntry_OpenPresStream( cache_entry, &stm ); + if (!stg) return OLE_E_BLANK; + hr = open_pres_stream( stg, cache_entry->load_stream_num, &stm ); if (FAILED(hr)) return hr; switch (cache_entry->fmtetc.cfFormat) @@ -978,14 +963,26 @@ static HRESULT save_emf(DataCacheEntry *entry, BOOL contents, IStream *stream) return hr; } -static const WCHAR CONTENTS[] = {'C','O','N','T','E','N','T','S',0}; +static HRESULT save_view_cache(DataCacheEntry *entry, IStream *stream) +{ + HRESULT hr; + PresentationDataHeader header; + + init_stream_header(entry, &header); + hr = write_clipformat(stream, entry->fmtetc.cfFormat); + if (SUCCEEDED(hr)) + hr = IStream_Write(stream, &header, FIELD_OFFSET(PresentationDataHeader, unknown7), NULL); + + return hr; +} + static HRESULT create_stream(DataCacheEntry *cache_entry, IStorage *storage, BOOL contents, IStream **stream) { WCHAR pres[] = {2,'O','l','e','P','r','e','s', - '0' + (cache_entry->stream_number / 100) % 10, - '0' + (cache_entry->stream_number / 10) % 10, - '0' + cache_entry->stream_number % 10, 0}; + '0' + (cache_entry->save_stream_num / 100) % 10, + '0' + (cache_entry->save_stream_num / 10) % 10, + '0' + cache_entry->save_stream_num % 10, 0}; const WCHAR *name; if (contents) @@ -1005,7 +1002,7 @@ static HRESULT DataCacheEntry_Save(DataCacheEntry *cache_entry, IStorage *storag IStream *stream; BOOL contents = (cache_entry->id == 1); - TRACE("stream_number = %d, fmtetc = %s\n", cache_entry->stream_number, debugstr_formatetc(&cache_entry->fmtetc)); + TRACE("stream_number = %d, fmtetc = %s\n", cache_entry->save_stream_num, debugstr_formatetc(&cache_entry->fmtetc)); hr = create_stream(cache_entry, storage, contents, &stream); if (FAILED(hr)) @@ -1022,6 +1019,9 @@ static HRESULT DataCacheEntry_Save(DataCacheEntry *cache_entry, IStorage *storag case CF_ENHMETAFILE: hr = save_emf(cache_entry, contents, stream); break; + case 0: + hr = save_view_cache(cache_entry, stream); + break; default: FIXME("got unsupported clipboard format %x\n", cache_entry->fmtetc.cfFormat); } @@ -1187,11 +1187,11 @@ static HRESULT DataCacheEntry_SetData(DataCacheEntry *cache_entry, return copy_stg_medium(cache_entry->fmtetc.cfFormat, &cache_entry->stgmedium, stgmedium); } -static HRESULT DataCacheEntry_GetData(DataCacheEntry *cache_entry, FORMATETC *fmt, STGMEDIUM *stgmedium) +static HRESULT DataCacheEntry_GetData(DataCacheEntry *cache_entry, IStorage *stg, FORMATETC *fmt, STGMEDIUM *stgmedium) { - if (cache_entry->stgmedium.tymed == TYMED_NULL && cache_entry->stream) + if (cache_entry->stgmedium.tymed == TYMED_NULL && cache_entry->load_stream_num != STREAM_NUMBER_NOT_SET) { - HRESULT hr = DataCacheEntry_LoadData(cache_entry); + HRESULT hr = DataCacheEntry_LoadData(cache_entry, stg); if (FAILED(hr)) return hr; } @@ -1210,15 +1210,6 @@ static inline HRESULT DataCacheEntry_DiscardData(DataCacheEntry *cache_entry) return S_OK; } -static inline void DataCacheEntry_HandsOffStorage(DataCacheEntry *cache_entry) -{ - if (cache_entry->stream) - { - IStream_Release(cache_entry->stream); - cache_entry->stream = NULL; - } -} - static inline DWORD tymed_from_cf( DWORD cf ) { switch( cf ) @@ -1273,9 +1264,13 @@ static HRESULT create_automatic_entry(DataCache *cache, const CLSID *clsid) while (ptr->clsid) { if (IsEqualCLSID( clsid, ptr->clsid )) + { + cache->clsid_static = TRUE; return DataCache_CreateEntry( cache, &ptr->fmt, 0, TRUE, NULL ); + } ptr++; } + cache->clsid_static = FALSE; return S_OK; } @@ -1437,7 +1432,7 @@ static HRESULT WINAPI DataCache_GetData( if (!cache_entry) return OLE_E_BLANK; - return DataCacheEntry_GetData(cache_entry, pformatetcIn, pmedium); + return DataCacheEntry_GetData(cache_entry, This->presentationStorage, pformatetcIn, pmedium); } static HRESULT WINAPI DataCache_GetDataHere( @@ -1670,8 +1665,7 @@ static HRESULT WINAPI DataCache_InitNew( } -static HRESULT add_cache_entry( DataCache *This, const FORMATETC *fmt, DWORD advf, IStream *stm, - enum stream_type type ) +static HRESULT add_cache_entry( DataCache *This, const FORMATETC *fmt, DWORD advf, int stream_number ) { DataCacheEntry *cache_entry; HRESULT hr = S_OK; @@ -1684,82 +1678,68 @@ static HRESULT add_cache_entry( DataCache *This, const FORMATETC *fmt, DWORD adv if (SUCCEEDED( hr )) { DataCacheEntry_DiscardData( cache_entry ); - if (cache_entry->stream) IStream_Release( cache_entry->stream ); - cache_entry->stream = stm; - IStream_AddRef( stm ); - cache_entry->stream_type = type; + cache_entry->load_stream_num = stream_number; + cache_entry->save_stream_num = stream_number; cache_entry->dirty = FALSE; } return hr; } -static HRESULT parse_pres_streams( DataCache *This, IStorage *stg ) +static HRESULT parse_pres_streams( DataCache *cache, IStorage *stg ) { HRESULT hr; - IEnumSTATSTG *stat_enum; - STATSTG stat; IStream *stm; PresentationDataHeader header; ULONG actual_read; CLIPFORMAT clipformat; FORMATETC fmtetc; + int stream_number = 0; - hr = IStorage_EnumElements( stg, 0, NULL, 0, &stat_enum ); - if (FAILED( hr )) return hr; - - while ((hr = IEnumSTATSTG_Next( stat_enum, 1, &stat, NULL )) == S_OK) + do { - if (DataCache_IsPresentationStream( &stat )) - { - hr = IStorage_OpenStream( stg, stat.pwcsName, NULL, STGM_READ | STGM_SHARE_EXCLUSIVE, - 0, &stm ); - if (SUCCEEDED( hr )) - { - hr = read_clipformat( stm, &clipformat ); + hr = open_pres_stream( stg, stream_number, &stm ); + if (FAILED(hr)) break; - if (hr == S_OK) - hr = IStream_Read( stm, &header, sizeof(header), &actual_read ); + hr = read_clipformat( stm, &clipformat ); - if (hr == S_OK && actual_read == sizeof(header)) - { - fmtetc.cfFormat = clipformat; - fmtetc.ptd = NULL; /* FIXME */ - fmtetc.dwAspect = header.dvAspect; - fmtetc.lindex = header.lindex; - fmtetc.tymed = tymed_from_cf( clipformat ); + if (hr == S_OK) hr = IStream_Read( stm, &header, sizeof(header), &actual_read ); - add_cache_entry( This, &fmtetc, header.advf, stm, pres_stream ); - } - IStream_Release( stm ); - } + if (hr == S_OK && actual_read == sizeof(header)) + { + fmtetc.cfFormat = clipformat; + fmtetc.ptd = NULL; /* FIXME */ + fmtetc.dwAspect = header.dvAspect; + fmtetc.lindex = header.lindex; + fmtetc.tymed = tymed_from_cf( clipformat ); + + add_cache_entry( cache, &fmtetc, header.advf, stream_number ); } - CoTaskMemFree( stat.pwcsName ); - } - IEnumSTATSTG_Release( stat_enum ); + IStream_Release( stm ); + stream_number++; + } while (hr == S_OK); return S_OK; } -static const FORMATETC static_dib_fmt = { CF_DIB, NULL, DVASPECT_CONTENT, -1, TYMED_HGLOBAL }; - -static HRESULT parse_contents_stream( DataCache *This, IStorage *stg, IStream *stm ) +static HRESULT parse_contents_stream( DataCache *cache, IStorage *stg ) { HRESULT hr; - STATSTG stat; - const FORMATETC *fmt; + IStream *stm; + DataCacheEntry *cache_entry; - hr = IStorage_Stat( stg, &stat, STATFLAG_NONAME ); + hr = open_pres_stream( stg, STREAM_NUMBER_CONTENTS, &stm ); if (FAILED( hr )) return hr; - if (IsEqualCLSID( &stat.clsid, &CLSID_Picture_Dib )) - fmt = &static_dib_fmt; - else + hr = get_static_entry( cache, &cache_entry ); + if (hr == S_OK) { - FIXME("unsupported format %s\n", debugstr_guid( &stat.clsid )); - return E_FAIL; + cache_entry->load_stream_num = STREAM_NUMBER_CONTENTS; + cache_entry->save_stream_num = STREAM_NUMBER_CONTENTS; + cache_entry->dirty = FALSE; } - return add_cache_entry( This, fmt, 0, stm, contents_stream ); + IStream_Release( stm ); + return hr; } /************************************************************************ @@ -1770,42 +1750,38 @@ static HRESULT parse_contents_stream( DataCache *This, IStorage *stg, IStream *s * and it will load the presentation information when the * IDataObject_GetData or IViewObject2_Draw methods are called. */ -static HRESULT WINAPI DataCache_Load( IPersistStorage *iface, IStorage *pStg ) +static HRESULT WINAPI DataCache_Load( IPersistStorage *iface, IStorage *stg ) { DataCache *This = impl_from_IPersistStorage(iface); HRESULT hr; - IStream *stm; CLSID clsid; DataCacheEntry *entry, *cursor2; - TRACE("(%p, %p)\n", iface, pStg); + TRACE("(%p, %p)\n", iface, stg); IPersistStorage_HandsOffStorage( iface ); LIST_FOR_EACH_ENTRY_SAFE( entry, cursor2, &This->cache_list, DataCacheEntry, entry ) DataCacheEntry_Destroy( This, entry ); - ReadClassStg( pStg, &clsid ); + ReadClassStg( stg, &clsid ); hr = create_automatic_entry( This, &clsid ); if (FAILED( hr )) return hr; This->clsid = clsid; - hr = IStorage_OpenStream( pStg, CONTENTS, NULL, STGM_READ | STGM_SHARE_EXCLUSIVE, - 0, &stm ); - if (SUCCEEDED( hr )) + if (This->clsid_static) { - hr = parse_contents_stream( This, pStg, stm ); - IStream_Release( stm ); + hr = parse_contents_stream( This, stg ); + if (FAILED(hr)) hr = parse_pres_streams( This, stg ); } - - if (FAILED(hr)) - hr = parse_pres_streams( This, pStg ); + else + hr = parse_pres_streams( This, stg ); if (SUCCEEDED( hr )) { This->dirty = FALSE; - This->presentationStorage = pStg; + This->presentationStorage = stg; IStorage_AddRef( This->presentationStorage ); } @@ -1825,17 +1801,17 @@ static HRESULT WINAPI DataCache_Save(IPersistStorage* iface, IStorage *stg, BOOL DataCache *This = impl_from_IPersistStorage(iface); DataCacheEntry *cache_entry; HRESULT hr = S_OK; - unsigned short stream_number = 0; + int stream_number = 0; TRACE("(%p, %p, %d)\n", iface, stg, same_as_load); /* assign stream numbers to the cache entries */ LIST_FOR_EACH_ENTRY(cache_entry, &This->cache_list, DataCacheEntry, entry) { - if (cache_entry->stream_number != stream_number) + if (cache_entry->save_stream_num != stream_number) { cache_entry->dirty = TRUE; /* needs to be written out again */ - cache_entry->stream_number = stream_number; + cache_entry->save_stream_num = stream_number; } stream_number++; } @@ -1889,7 +1865,6 @@ static HRESULT WINAPI DataCache_HandsOffStorage( IPersistStorage* iface) { DataCache *this = impl_from_IPersistStorage(iface); - DataCacheEntry *cache_entry; TRACE("(%p)\n", iface); @@ -1899,9 +1874,6 @@ static HRESULT WINAPI DataCache_HandsOffStorage( this->presentationStorage = NULL; } - LIST_FOR_EACH_ENTRY(cache_entry, &this->cache_list, DataCacheEntry, entry) - DataCacheEntry_HandsOffStorage(cache_entry); - return S_OK; } @@ -1991,9 +1963,9 @@ static HRESULT WINAPI DataCache_Draw( continue; /* if the data hasn't been loaded yet, do it now */ - if ((cache_entry->stgmedium.tymed == TYMED_NULL) && cache_entry->stream) + if ((cache_entry->stgmedium.tymed == TYMED_NULL) && (cache_entry->load_stream_num != STREAM_NUMBER_NOT_SET)) { - hres = DataCacheEntry_LoadData(cache_entry); + hres = DataCacheEntry_LoadData(cache_entry, This->presentationStorage); if (FAILED(hres)) continue; } @@ -2251,9 +2223,9 @@ static HRESULT WINAPI DataCache_GetExtent( continue; /* if the data hasn't been loaded yet, do it now */ - if ((cache_entry->stgmedium.tymed == TYMED_NULL) && cache_entry->stream) + if ((cache_entry->stgmedium.tymed == TYMED_NULL) && (cache_entry->load_stream_num != STREAM_NUMBER_NOT_SET)) { - hres = DataCacheEntry_LoadData(cache_entry); + hres = DataCacheEntry_LoadData(cache_entry, This->presentationStorage); if (FAILED(hres)) continue; } @@ -2426,6 +2398,8 @@ static HRESULT WINAPI DataCache_Cache( return CACHE_S_SAMECACHE; } + if (This->clsid_static && fmt_cpy.dwAspect != DVASPECT_ICON) return DV_E_FORMATETC; + hr = DataCache_CreateEntry(This, &fmt_cpy, advf, FALSE, &cache_entry); if (SUCCEEDED(hr)) @@ -2944,6 +2918,7 @@ static DataCache* DataCache_Construct( newObject->sinkAdviseFlag = 0; newObject->sinkInterface = 0; newObject->clsid = CLSID_NULL; + newObject->clsid_static = FALSE; newObject->presentationStorage = NULL; list_init(&newObject->cache_list); newObject->last_cache_id = 2; diff --git a/dll/win32/ole32/defaulthandler.c b/dll/win32/ole32/defaulthandler.c index 2aec79e1d4..e6c52cd093 100644 --- a/dll/win32/ole32/defaulthandler.c +++ b/dll/win32/ole32/defaulthandler.c @@ -45,10 +45,24 @@ * - All the methods related to notification and advise sinks are * in place but no notifications are sent to the sinks yet. */ +#include <assert.h> +#include <stdarg.h> +#include <string.h> -#include "precomp.h" +#define COBJMACROS + +#include "windef.h" +#include "winbase.h" +#include "winuser.h" +#include "winerror.h" +#include "ole2.h" + +#include "compobj_private.h" #include "storage32.h" +#include "wine/unicode.h" +#include "wine/debug.h" + WINE_DEFAULT_DEBUG_CHANNEL(ole); enum storage_state diff --git a/dll/win32/ole32/dictionary.c b/dll/win32/ole32/dictionary.c index 7441f955eb..593a4ff158 100644 --- a/dll/win32/ole32/dictionary.c +++ b/dll/win32/ole32/dictionary.c @@ -17,8 +17,12 @@ * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ - -#include "precomp.h" +#include <assert.h> +#include <stdarg.h> +#include "windef.h" +#include "winbase.h" +#include "dictionary.h" +#include "wine/debug.h" WINE_DEFAULT_DEBUG_CHANNEL(storage); diff --git a/dll/win32/ole32/dictionary.h b/dll/win32/ole32/dictionary.h index a72157d281..f3693ccc5c 100644 --- a/dll/win32/ole32/dictionary.h +++ b/dll/win32/ole32/dictionary.h @@ -22,6 +22,10 @@ #ifndef __DICTIONARY_H__ #define __DICTIONARY_H__ +#include <stdarg.h> +#include "windef.h" +#include "winbase.h" + struct dictionary; /* Returns whether key a is less than, equal to, or greater than key b, in diff --git a/dll/win32/ole32/enumx.c b/dll/win32/ole32/enumx.c index 7399a0214e..2b53810dad 100644 --- a/dll/win32/ole32/enumx.c +++ b/dll/win32/ole32/enumx.c @@ -18,7 +18,18 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include "precomp.h" +#define COBJMACROS + +#include <stdarg.h> + +#include "windef.h" +#include "winbase.h" +#include "objbase.h" + +#include "enumx.h" + +#include "wine/list.h" +#include "wine/debug.h" WINE_DEFAULT_DEBUG_CHANNEL(ole); @@ -30,6 +41,8 @@ struct tagEnumSTATPROPSETSTG_impl struct list *current; ULONG elem_size; GUID riid; + IUnknown *parent; + enumx_copy_cb copy_cb; }; /************************************************************************ @@ -80,6 +93,7 @@ ULONG WINAPI enumx_Release(enumx_impl *This) list_remove(x); HeapFree(GetProcessHeap(), 0, x); } + IUnknown_Release(This->parent); HeapFree(GetProcessHeap(), 0, This); } return ref; @@ -101,7 +115,10 @@ HRESULT WINAPI enumx_Next(enumx_impl *This, ULONG celt, p = rgelt; while (count < celt && This->current && This->current != &This->elements) { - memcpy(p, &This->current[1], This->elem_size); + if (This->copy_cb) + This->copy_cb(This->parent, &This->current[1], p); + else + memcpy(p, &This->current[1], This->elem_size); p += This->elem_size; This->current = This->current->next; count++; @@ -158,7 +175,8 @@ HRESULT WINAPI enumx_Clone( * * Allocate a generic enumerator */ -enumx_impl *enumx_allocate(REFIID riid, const void *vtbl, ULONG elem_size) +enumx_impl *enumx_allocate(REFIID riid, const void *vtbl, ULONG elem_size, + IUnknown *parent, enumx_copy_cb copy_cb) { enumx_impl *enumx; @@ -170,6 +188,11 @@ enumx_impl *enumx_allocate(REFIID riid, const void *vtbl, ULONG elem_size) enumx->current = NULL; enumx->elem_size = elem_size; enumx->riid = *riid; + enumx->parent = parent; + enumx->copy_cb = copy_cb; + + IUnknown_AddRef(parent); + list_init(&enumx->elements); } diff --git a/dll/win32/ole32/enumx.h b/dll/win32/ole32/enumx.h index d4347d9e33..8a2a2b354d 100644 --- a/dll/win32/ole32/enumx.h +++ b/dll/win32/ole32/enumx.h @@ -21,6 +21,8 @@ typedef struct tagEnumSTATPROPSETSTG_impl enumx_impl; +typedef void (*enumx_copy_cb)(IUnknown *parent, void *orig, void *dest); + extern HRESULT WINAPI enumx_QueryInterface(enumx_impl *, REFIID, void**) DECLSPEC_HIDDEN; extern ULONG WINAPI enumx_AddRef(enumx_impl *) DECLSPEC_HIDDEN; extern ULONG WINAPI enumx_Release(enumx_impl *) DECLSPEC_HIDDEN; @@ -28,7 +30,8 @@ extern HRESULT WINAPI enumx_Next(enumx_impl *, ULONG, void *, ULONG *) DECLSPEC_ extern HRESULT WINAPI enumx_Skip(enumx_impl *, ULONG) DECLSPEC_HIDDEN; extern HRESULT WINAPI enumx_Reset(enumx_impl *) DECLSPEC_HIDDEN; extern HRESULT WINAPI enumx_Clone(enumx_impl *, enumx_impl **) DECLSPEC_HIDDEN; -extern enumx_impl *enumx_allocate(REFIID, const void *, ULONG) DECLSPEC_HIDDEN; +extern enumx_impl *enumx_allocate(REFIID, const void *, ULONG, + IUnknown *, enumx_copy_cb) DECLSPEC_HIDDEN; extern void *enumx_add_element(enumx_impl *, const void *) DECLSPEC_HIDDEN; -#endif /* __OLE_ENUM_H__ */ +#endif diff --git a/dll/win32/ole32/errorinfo.c b/dll/win32/ole32/errorinfo.c index 3fa7726d16..d5ec17207a 100644 --- a/dll/win32/ole32/errorinfo.c +++ b/dll/win32/ole32/errorinfo.c @@ -23,7 +23,21 @@ * TEB at offset 0xf80. */ -#include "precomp.h" +#include <stdarg.h> +#include <string.h> + +#define COBJMACROS + +#include "windef.h" +#include "winbase.h" +#include "objbase.h" +#include "oleauto.h" +#include "winerror.h" + +#include "wine/unicode.h" +#include "compobj_private.h" + +#include "wine/debug.h" WINE_DEFAULT_DEBUG_CHANNEL(ole); diff --git a/dll/win32/ole32/filelockbytes.c b/dll/win32/ole32/filelockbytes.c index ba50adb869..c5cb45f77f 100644 --- a/dll/win32/ole32/filelockbytes.c +++ b/dll/win32/ole32/filelockbytes.c @@ -20,9 +20,29 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include "precomp.h" +#include <assert.h> +#include <stdlib.h> +#include <stdarg.h> +#include <stdio.h> +#include <string.h> +#include <limits.h> + +#define COBJMACROS +#define NONAMELESSUNION +#define NONAMELESSSTRUCT + +#include "windef.h" +#include "winbase.h" +#include "winuser.h" +#include "winerror.h" +#include "objbase.h" +#include "ole2.h" + #include "storage32.h" +#include "wine/debug.h" +#include "wine/unicode.h" + WINE_DEFAULT_DEBUG_CHANNEL(storage); typedef struct FileLockBytesImpl diff --git a/dll/win32/ole32/filemoniker.c b/dll/win32/ole32/filemoniker.c index af53b81e6f..271e5bb8a8 100644 --- a/dll/win32/ole32/filemoniker.c +++ b/dll/win32/ole32/filemoniker.c @@ -19,7 +19,23 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include "precomp.h" +#include <assert.h> +#include <stdarg.h> +#include <string.h> + +#define COBJMACROS +#define NONAMELESSUNION + +#include "windef.h" +#include "winbase.h" +#include "winerror.h" +#include "winnls.h" +#include "wine/unicode.h" +#include "wine/debug.h" +#include "objbase.h" +#include "moniker.h" + +#include "compobj_private.h" WINE_DEFAULT_DEBUG_CHANNEL(ole); diff --git a/dll/win32/ole32/ftmarshal.c b/dll/win32/ole32/ftmarshal.c index 69863d4773..3eb7f877aa 100644 --- a/dll/win32/ole32/ftmarshal.c +++ b/dll/win32/ole32/ftmarshal.c @@ -18,7 +18,23 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include "precomp.h" +#include "config.h" + +#include <stdlib.h> +#include <stdarg.h> +#include <stdio.h> +#include <string.h> +#include <assert.h> + +#define COBJMACROS + +#include "windef.h" +#include "winbase.h" +#include "objbase.h" + +#include "wine/debug.h" + +#include "compobj_private.h" WINE_DEFAULT_DEBUG_CHANNEL(ole); diff --git a/dll/win32/ole32/git.c b/dll/win32/ole32/git.c index 0f20bdf887..f7a0460154 100644 --- a/dll/win32/ole32/git.c +++ b/dll/win32/ole32/git.c @@ -24,7 +24,21 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include "precomp.h" +#include <stdarg.h> + +#define COBJMACROS + +#include "windef.h" +#include "winbase.h" +#include "winuser.h" +#include "objbase.h" +#include "ole2.h" +#include "winerror.h" + +#include "compobj_private.h" + +#include "wine/list.h" +#include "wine/debug.h" WINE_DEFAULT_DEBUG_CHANNEL(ole); diff --git a/dll/win32/ole32/hglobalstream.c b/dll/win32/ole32/hglobalstream.c index 732e6c6c81..2c08710b05 100644 --- a/dll/win32/ole32/hglobalstream.c +++ b/dll/win32/ole32/hglobalstream.c @@ -5,6 +5,7 @@ * for streams contained supported by an HGLOBAL pointer. * * Copyright 1999 Francis Beaudet + * Copyright 2016 Dmitry Timoshkov * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -21,9 +22,179 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include "precomp.h" +#include "config.h" -WINE_DEFAULT_DEBUG_CHANNEL(storage); +#include <assert.h> +#include <stdlib.h> +#include <stdarg.h> +#include <stdio.h> +#include <string.h> + +#define COBJMACROS +#define NONAMELESSUNION + +#include "windef.h" +#include "winbase.h" +#include "winuser.h" +#include "objbase.h" +#include "ole2.h" +#include "winerror.h" +#include "winternl.h" + +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(hglobalstream); + +struct handle_wrapper +{ + LONG ref; + HGLOBAL hglobal; + ULONG size; + BOOL delete_on_release; + CRITICAL_SECTION lock; +}; + +static void handle_addref(struct handle_wrapper *handle) +{ + InterlockedIncrement(&handle->ref); +} + +static void handle_release(struct handle_wrapper *handle) +{ + ULONG ref = InterlockedDecrement(&handle->ref); + + if (!ref) + { + if (handle->delete_on_release) + { + GlobalFree(handle->hglobal); + handle->hglobal = NULL; + } + + handle->lock.DebugInfo->Spare[0] = 0; + DeleteCriticalSection(&handle->lock); + HeapFree(GetProcessHeap(), 0, handle); + } +} + +static ULONG handle_read(struct handle_wrapper *handle, ULONG *pos, void *dest, ULONG len) +{ + void *source; + + EnterCriticalSection(&handle->lock); + + if (*pos < handle->size) + len = min(handle->size - *pos, len); + else + len = 0; + + source = GlobalLock(handle->hglobal); + if (source) + { + memcpy(dest, (char *)source + *pos, len); + *pos += len; + GlobalUnlock(handle->hglobal); + } + else + { + WARN("read from invalid hglobal %p\n", handle->hglobal); + len = 0; + } + + LeaveCriticalSection(&handle->lock); + return len; +} + +static ULONG handle_write(struct handle_wrapper *handle, ULONG *pos, const void *source, ULONG len) +{ + void *dest; + + if (!len) + return 0; + + EnterCriticalSection(&handle->lock); + + if (*pos + len > handle->size) + { + HGLOBAL hglobal = GlobalReAlloc(handle->hglobal, *pos + len, GMEM_MOVEABLE); + if (hglobal) + { + handle->hglobal = hglobal; + handle->size = *pos + len; + } + else + { + len = 0; + goto done; + } + } + + dest = GlobalLock(handle->hglobal); + if (dest) + { + memcpy((char *)dest + *pos, source, len); + *pos += len; + GlobalUnlock(handle->hglobal); + } + else + { + WARN("write to invalid hglobal %p\n", handle->hglobal); + /* len = 0; */ + } + +done: + LeaveCriticalSection(&handle->lock); + return len; +} + +static HGLOBAL handle_gethglobal(struct handle_wrapper *handle) +{ + return handle->hglobal; +} + +static HRESULT handle_setsize(struct handle_wrapper *handle, ULONG size) +{ + HRESULT hr = S_OK; + + EnterCriticalSection(&handle->lock); + + if (handle->size != size) + { + HGLOBAL hglobal = GlobalReAlloc(handle->hglobal, size, GMEM_MOVEABLE); + if (hglobal) + { + handle->hglobal = hglobal; + handle->size = size; + } + else + hr = E_OUTOFMEMORY; + } + + LeaveCriticalSection(&handle->lock); + return hr; +} + +static ULONG handle_getsize(struct handle_wrapper *handle) +{ + return handle->size; +} + +static struct handle_wrapper *handle_create(HGLOBAL hglobal, BOOL delete_on_release) +{ + struct handle_wrapper *handle; + + handle = HeapAlloc(GetProcessHeap(), 0, sizeof(*handle)); + if (handle) + { + handle->ref = 1; + handle->hglobal = hglobal; + handle->size = GlobalSize(hglobal); + handle->delete_on_release = delete_on_release; + InitializeCriticalSection(&handle->lock); + handle->lock.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": handle_wrapper.lock"); + } + return handle; +} /**************************************************************************** * HGLOBALStreamImpl definition. @@ -36,14 +207,7 @@ typedef struct IStream IStream_iface; LONG ref; - /* support for the stream */ - HGLOBAL supportHandle; - - /* if TRUE the HGLOBAL is destroyed when the stream is finally released */ - BOOL deleteOnRelease; - - /* size of the stream */ - ULARGE_INTEGER streamSize; + struct handle_wrapper *handle; /* current position of the cursor */ ULARGE_INTEGER currentPosition; @@ -95,12 +259,7 @@ static ULONG WINAPI HGLOBALStreamImpl_Release( if (!ref) { - if (This->deleteOnRelease) - { - GlobalFree(This->supportHandle); - This->supportHandle = NULL; - } - + handle_release(This->handle); HeapFree(GetProcessHeap(), 0, This); } @@ -123,59 +282,12 @@ static HRESULT WINAPI HGLOBALStreamImpl_Read( ULONG* pcbRead) /* [out] */ { HGLOBALStreamImpl* This = impl_from_IStream(iface); + ULONG num_bytes; - void* supportBuffer; - ULONG bytesReadBuffer; - ULONG bytesToReadFromBuffer; - - TRACE("(%p, %p, %d, %p)\n", iface, - pv, cb, pcbRead); - - /* - * If the caller is not interested in the number of bytes read, - * we use another buffer to avoid "if" statements in the code. - */ - if (pcbRead==0) - pcbRead = &bytesReadBuffer; - - /* - * Using the known size of the stream, calculate the number of bytes - * to read from the block chain - */ - bytesToReadFromBuffer = min( This->streamSize.u.LowPart - This->currentPosition.u.LowPart, cb); - - /* - * Lock the buffer in position and copy the data. - */ - supportBuffer = GlobalLock(This->supportHandle); - if (!supportBuffer) - { - WARN("read from invalid hglobal %p\n", This->supportHandle); - *pcbRead = 0; - return S_OK; - } - - memcpy(pv, (char *) supportBuffer+This->currentPosition.u.LowPart, bytesToReadFromBuffer); + TRACE("(%p, %p, %d, %p)\n", iface, pv, cb, pcbRead); - /* - * Move the current position to the new position - */ - This->currentPosition.u.LowPart+=bytesToReadFromBuffer; - - /* - * Return the number of bytes read. - */ - *pcbRead = bytesToReadFromBuffer; - - /* - * Cleanup - */ - GlobalUnlock(This->supportHandle); - - /* - * Always returns S_OK even if the end of the stream is reached before the - * buffer is filled - */ + num_bytes = handle_read(This->handle, &This->currentPosition.u.LowPart, pv, cb); + if (pcbRead) *pcbRead = num_bytes; return S_OK; } @@ -197,71 +309,14 @@ static HRESULT WINAPI HGLOBALStreamImpl_Write( ULONG* pcbWritten) /* [out] */ { HGLOBALStreamImpl* This = impl_from_IStream(iface); - - void* supportBuffer; - ULARGE_INTEGER newSize; - ULONG bytesWritten = 0; + ULONG num_bytes; TRACE("(%p, %p, %d, %p)\n", iface, pv, cb, pcbWritten); - /* - * If the caller is not interested in the number of bytes written, - * we use another buffer to avoid "if" statements in the code. - */ - if (pcbWritten == 0) - pcbWritten = &bytesWritten; - - if (cb == 0) - goto out; - - *pcbWritten = 0; - - newSize.u.HighPart = 0; - newSize.u.LowPart = This->currentPosition.u.LowPart + cb; - - /* - * Verify if we need to grow the stream - */ - if (newSize.u.LowPart > This->streamSize.u.LowPart) - { - /* grow stream */ - HRESULT hr = IStream_SetSize(iface, newSize); - if (FAILED(hr)) - { - ERR("IStream_SetSize failed with error 0x%08x\n", hr); - return hr; - } - } - - /* - * Lock the buffer in position and copy the data. - */ - supportBuffer = GlobalLock(This->supportHandle); - if (!supportBuffer) - { - WARN("write to invalid hglobal %p\n", This->supportHandle); - return S_OK; - } + num_bytes = handle_write(This->handle, &This->currentPosition.u.LowPart, pv, cb); + if (pcbWritten) *pcbWritten = num_bytes; - memcpy((char *) supportBuffer+This->currentPosition.u.LowPart, pv, cb); - - /* - * Move the current position to the new position - */ - This->currentPosition.u.LowPart+=cb; - - /* - * Cleanup - */ - GlobalUnlock(This->supportHandle); - -out: - /* - * Return the number of bytes read. - */ - *pcbWritten = cb; - - return S_OK; + return (num_bytes < cb) ? E_OUTOFMEMORY : S_OK; } /*** @@ -299,7 +354,7 @@ static HRESULT WINAPI HGLOBALStreamImpl_Seek( case STREAM_SEEK_CUR: break; case STREAM_SEEK_END: - newPosition = This->streamSize; + newPosition.QuadPart = handle_getsize(This->handle); break; default: hr = STG_E_SEEKERROR; @@ -344,29 +399,13 @@ static HRESULT WINAPI HGLOBALStreamImpl_SetSize( ULARGE_INTEGER libNewSize) /* [in] */ { HGLOBALStreamImpl* This = impl_from_IStream(iface); - HGLOBAL supportHandle; TRACE("(%p, %d)\n", iface, libNewSize.u.LowPart); /* * HighPart is ignored as shown in tests */ - - if (This->streamSize.u.LowPart == libNewSize.u.LowPart) - return S_OK; - - /* - * Re allocate the HGlobal to fit the new size of the stream. - */ - supportHandle = GlobalReAlloc(This->supportHandle, libNewSize.u.LowPart, 0); - - if (supportHandle == 0) - return E_OUTOFMEMORY; - - This->supportHandle = supportHandle; - This->streamSize.u.LowPart = libNewSize.u.LowPart; - - return S_OK; + return handle_setsize(This->handle, libNewSize.u.LowPart); } /*** @@ -514,24 +553,49 @@ static HRESULT WINAPI HGLOBALStreamImpl_Stat( pstatstg->pwcsName = NULL; pstatstg->type = STGTY_STREAM; - pstatstg->cbSize = This->streamSize; + pstatstg->cbSize.QuadPart = handle_getsize(This->handle); return S_OK; } +static const IStreamVtbl HGLOBALStreamImplVtbl; + +static HGLOBALStreamImpl *HGLOBALStreamImpl_Create(void) +{ + HGLOBALStreamImpl *This; + + This = HeapAlloc(GetProcessHeap(), 0, sizeof(*This)); + if (This) + { + This->IStream_iface.lpVtbl = &HGLOBALStreamImplVtbl; + This->ref = 1; + } + return This; +} + static HRESULT WINAPI HGLOBALStreamImpl_Clone( IStream* iface, IStream** ppstm) /* [out] */ { HGLOBALStreamImpl* This = impl_from_IStream(iface); + HGLOBALStreamImpl* clone; ULARGE_INTEGER dummy; LARGE_INTEGER offset; - HRESULT hr; - TRACE(" Cloning %p (deleteOnRelease=%d seek position=%ld)\n",iface,This->deleteOnRelease,(long)This->currentPosition.QuadPart); - hr = CreateStreamOnHGlobal(This->supportHandle, FALSE, ppstm); - if(FAILED(hr)) - return hr; + if (!ppstm) return E_INVALIDARG; + + *ppstm = NULL; + + TRACE(" Cloning %p (seek position=%d)\n", iface, This->currentPosition.u.LowPart); + + clone = HGLOBALStreamImpl_Create(); + if (!clone) return E_OUTOFMEMORY; + + *ppstm = &clone->IStream_iface; + + handle_addref(This->handle); + clone->handle = This->handle; + offset.QuadPart = (LONGLONG)This->currentPosition.QuadPart; IStream_Seek(*ppstm, offset, STREAM_SEEK_SET, &dummy); return S_OK; @@ -568,28 +632,19 @@ HRESULT WINAPI CreateStreamOnHGlobal( if (!ppstm) return E_INVALIDARG; - This = HeapAlloc(GetProcessHeap(), 0, sizeof(HGLOBALStreamImpl)); + This = HGLOBALStreamImpl_Create(); if (!This) return E_OUTOFMEMORY; - This->IStream_iface.lpVtbl = &HGLOBALStreamImplVtbl; - This->ref = 1; - - /* initialize the support */ - This->supportHandle = hGlobal; - This->deleteOnRelease = fDeleteOnRelease; - /* allocate a handle if one is not supplied */ - if (!This->supportHandle) - This->supportHandle = GlobalAlloc(GMEM_MOVEABLE|GMEM_NODISCARD|GMEM_SHARE, 0); + if (!hGlobal) + hGlobal = GlobalAlloc(GMEM_MOVEABLE|GMEM_NODISCARD|GMEM_SHARE, 0); + + This->handle = handle_create(hGlobal, fDeleteOnRelease); /* start at the beginning */ This->currentPosition.u.HighPart = 0; This->currentPosition.u.LowPart = 0; - /* initialize the size of the stream to the size of the handle */ - This->streamSize.u.HighPart = 0; - This->streamSize.u.LowPart = GlobalSize(This->supportHandle); - *ppstm = &This->IStream_iface; return S_OK; @@ -602,16 +657,16 @@ HRESULT WINAPI GetHGlobalFromStream(IStream* pstm, HGLOBAL* phglobal) { HGLOBALStreamImpl* pStream; - if (pstm == NULL) + if (!pstm || !phglobal) return E_INVALIDARG; - pStream = (HGLOBALStreamImpl*) pstm; + pStream = impl_from_IStream(pstm); /* * Verify that the stream object was created with CreateStreamOnHGlobal. */ if (pStream->IStream_iface.lpVtbl == &HGLOBALStreamImplVtbl) - *phglobal = pStream->supportHandle; + *phglobal = handle_gethglobal(pStream->handle); else { *phglobal = 0; diff --git a/dll/win32/ole32/ifs.c b/dll/win32/ole32/ifs.c index 0d5bae98ff..c9e5625e91 100644 --- a/dll/win32/ole32/ifs.c +++ b/dll/win32/ole32/ifs.c @@ -18,7 +18,23 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include "precomp.h" +#include "config.h" + +#include <ctype.h> +#include <stdarg.h> +#include <stdlib.h> +#include <string.h> +#include <assert.h> + +#define COBJMACROS + +#include "windef.h" +#include "winbase.h" +#include "winuser.h" +#include "ole2.h" +#include "winerror.h" + +#include "wine/debug.h" WINE_DEFAULT_DEBUG_CHANNEL(olemalloc); diff --git a/dll/win32/ole32/itemmoniker.c b/dll/win32/ole32/itemmoniker.c index e2c7c5956b..14beadadee 100644 --- a/dll/win32/ole32/itemmoniker.c +++ b/dll/win32/ole32/itemmoniker.c @@ -18,7 +18,22 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include "precomp.h" +#include <assert.h> +#include <stdarg.h> +#include <string.h> + +#define COBJMACROS +#define NONAMELESSUNION + +#include "winerror.h" +#include "windef.h" +#include "winbase.h" +#include "winuser.h" +#include "winnls.h" +#include "wine/debug.h" +#include "ole2.h" +#include "wine/unicode.h" +#include "moniker.h" WINE_DEFAULT_DEBUG_CHANNEL(ole); diff --git a/dll/win32/ole32/marshal.c b/dll/win32/ole32/marshal.c index 80aefb0a1f..b39dac0a27 100644 --- a/dll/win32/ole32/marshal.c +++ b/dll/win32/ole32/marshal.c @@ -20,7 +20,23 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include "precomp.h" +#include <stdarg.h> +#include <string.h> +#include <assert.h> + +#define COBJMACROS + +#include "windef.h" +#include "winbase.h" +#include "winuser.h" +#include "objbase.h" +#include "ole2.h" +#include "winerror.h" +#include "wine/unicode.h" + +#include "compobj_private.h" + +#include "wine/debug.h" WINE_DEFAULT_DEBUG_CHANNEL(ole); diff --git a/dll/win32/ole32/memlockbytes.c b/dll/win32/ole32/memlockbytes.c index bef4e80751..b2fc5b4f4d 100644 --- a/dll/win32/ole32/memlockbytes.c +++ b/dll/win32/ole32/memlockbytes.c @@ -19,7 +19,23 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include "precomp.h" +#include "config.h" + +#include <assert.h> +#include <stdarg.h> +#include <string.h> + +#define COBJMACROS +#define NONAMELESSUNION + +#include "windef.h" +#include "winbase.h" +#include "winuser.h" +#include "objbase.h" +#include "ole2.h" +#include "winerror.h" + +#include "wine/debug.h" WINE_DEFAULT_DEBUG_CHANNEL(ole); diff --git a/dll/win32/ole32/moniker.c b/dll/win32/ole32/moniker.c index 915caace50..ffbaa61e50 100644 --- a/dll/win32/ole32/moniker.c +++ b/dll/win32/ole32/moniker.c @@ -21,12 +21,30 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include "precomp.h" - -#include <winsvc.h> -#include <wine/exception.h> - -#include <irot.h> +#include "config.h" +#include "wine/port.h" + +#include <stdarg.h> +#include <string.h> + +#define COBJMACROS + +#include "winerror.h" +#include "windef.h" +#include "winbase.h" +#include "winuser.h" +#include "winsvc.h" +#include "wtypes.h" +#include "ole2.h" + +#include "wine/list.h" +#include "wine/debug.h" +#include "wine/unicode.h" +#include "wine/exception.h" + +#include "compobj_private.h" +#include "moniker.h" +#include "irot.h" WINE_DEFAULT_DEBUG_CHANNEL(ole); diff --git a/dll/win32/ole32/ole2.c b/dll/win32/ole32/ole2.c index 4275b835b4..c7a9b272cb 100644 --- a/dll/win32/ole32/ole2.c +++ b/dll/win32/ole32/ole2.c @@ -23,9 +23,33 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include "precomp.h" - +#include "config.h" + +#include <assert.h> +#include <stdlib.h> +#include <stdarg.h> +#include <stdio.h> +#include <string.h> + +#define COBJMACROS +#define NONAMELESSUNION + +#include "windef.h" +#include "winbase.h" +#include "winerror.h" +#include "wingdi.h" +#include "winuser.h" +#include "winnls.h" +#include "winreg.h" +#include "ole2.h" +#include "ole2ver.h" + +#include "wine/unicode.h" +#include "compobj_private.h" #include "olestd.h" +#include "wine/list.h" + +#include "wine/debug.h" WINE_DEFAULT_DEBUG_CHANNEL(ole); WINE_DECLARE_DEBUG_CHANNEL(accel); diff --git a/dll/win32/ole32/ole2impl.c b/dll/win32/ole32/ole2impl.c index 10b7d5bb45..ccf31fa4f5 100644 --- a/dll/win32/ole32/ole2impl.c +++ b/dll/win32/ole32/ole2impl.c @@ -18,7 +18,20 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include "precomp.h" +#include <stdarg.h> +#include <string.h> + +#define COBJMACROS +#define NONAMELESSUNION + +#include "windef.h" +#include "winbase.h" +#include "wingdi.h" +#include "winuser.h" +#include "wine/debug.h" +#include "ole2.h" +#include "olestd.h" +#include "compobj_private.h" WINE_DEFAULT_DEBUG_CHANNEL(ole); diff --git a/dll/win32/ole32/ole2stubs.c b/dll/win32/ole32/ole2stubs.c index 5e30f1d9ea..d7fd58c526 100644 --- a/dll/win32/ole32/ole2stubs.c +++ b/dll/win32/ole32/ole2stubs.c @@ -19,7 +19,16 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include "precomp.h" +#include "config.h" + +#include <stdarg.h> + +#include "windef.h" +#include "winbase.h" +#include "winuser.h" +#include "ole2.h" +#include "objidl.h" +#include "wine/debug.h" WINE_DEFAULT_DEBUG_CHANNEL(ole); diff --git a/dll/win32/ole32/ole32_main.c b/dll/win32/ole32/ole32_main.c index cf21eef56b..7c12f1ce33 100644 --- a/dll/win32/ole32/ole32_main.c +++ b/dll/win32/ole32/ole32_main.c @@ -18,7 +18,20 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include "precomp.h" +#include "config.h" +#include "wine/port.h" + +#include <stdarg.h> +#include <stdio.h> + +#include "windef.h" +#include "winbase.h" +#include "wingdi.h" +#include "winuser.h" +#include "winnls.h" +#include "objbase.h" +#include "ole2.h" +#include "wine/debug.h" WINE_DEFAULT_DEBUG_CHANNEL(ole); diff --git a/dll/win32/ole32/ole32res.rc b/dll/win32/ole32/ole32res.rc index 71b368236d..4b3cfab8bf 100644 --- a/dll/win32/ole32/ole32res.rc +++ b/dll/win32/ole32/ole32res.rc @@ -18,17 +18,17 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -//#include "windef.h" -//#include "winbase.h" -//#include "winuser.h" -//#include "winnls.h" +#include "windef.h" +#include "winbase.h" +#include "winuser.h" +#include "winnls.h" #include "olestd.h" #define WINE_FILENAME_STR "ole32.dll" #define WINE_EXTRAVALUES VALUE "OLESelfRegister","" -#include <wine/wine_common_ver.rc> +#include "wine/wine_common_ver.rc" /* * Everything that does not depend on language, diff --git a/dll/win32/ole32/oleobj.c b/dll/win32/ole32/oleobj.c index 574e508747..44e15e551f 100644 --- a/dll/win32/ole32/oleobj.c +++ b/dll/win32/ole32/oleobj.c @@ -19,7 +19,21 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include "precomp.h" + +#include <stdarg.h> +#include <string.h> + +#define COBJMACROS +#define NONAMELESSUNION + +#include "windef.h" +#include "winbase.h" +#include "winuser.h" +#include "winerror.h" +#include "wine/debug.h" +#include "ole2.h" + +#include "compobj_private.h" WINE_DEFAULT_DEBUG_CHANNEL(ole); diff --git a/dll/win32/ole32/oleproxy.c b/dll/win32/ole32/oleproxy.c index fd6ae14927..a7b8e39510 100644 --- a/dll/win32/ole32/oleproxy.c +++ b/dll/win32/ole32/oleproxy.c @@ -19,7 +19,27 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include "precomp.h" +#include "config.h" + +#include <stdlib.h> +#include <stdarg.h> +#include <stdio.h> +#include <string.h> + +#define COBJMACROS + +#include "windef.h" +#include "winbase.h" +#include "winuser.h" +#include "objbase.h" +#include "ole2.h" +#include "rpc.h" + +#include "compobj_private.h" +#include "moniker.h" +#include "comcat.h" + +#include "wine/debug.h" WINE_DEFAULT_DEBUG_CHANNEL(ole); diff --git a/dll/win32/ole32/pointermoniker.c b/dll/win32/ole32/pointermoniker.c index 4a460c53fd..a62ce3e7b7 100644 --- a/dll/win32/ole32/pointermoniker.c +++ b/dll/win32/ole32/pointermoniker.c @@ -19,7 +19,20 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include "precomp.h" +#include <stdarg.h> +#include <string.h> + +#define COBJMACROS +#define NONAMELESSUNION + +#include "windef.h" +#include "winbase.h" +#include "winerror.h" +#include "winuser.h" +#include "objbase.h" +#include "oleidl.h" +#include "wine/debug.h" +#include "moniker.h" WINE_DEFAULT_DEBUG_CHANNEL(ole); diff --git a/dll/win32/ole32/precomp.h b/dll/win32/ole32/precomp.h index af33392494..c9ea845841 100644 --- a/dll/win32/ole32/precomp.h +++ b/dll/win32/ole32/precomp.h @@ -1,7 +1,8 @@ + #ifndef _OLE32_PCH_ #define _OLE32_PCH_ -#include <config.h> +#include <wine/config.h> #include <assert.h> #include <stdarg.h> @@ -36,4 +37,4 @@ #include "enumx.h" #include "moniker.h" -#endif /* _OLE32_PCH_ */ +#endif /* !_OLE32_PCH_ */ diff --git a/dll/win32/ole32/rpc.c b/dll/win32/ole32/rpc.c index eb1bf5bb74..8d8276e0cb 100644 --- a/dll/win32/ole32/rpc.c +++ b/dll/win32/ole32/rpc.c @@ -20,9 +20,30 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include "precomp.h" - -#include <winsvc.h> +#include "config.h" +#include "wine/port.h" + +#include <stdarg.h> +#include <string.h> + +#define COBJMACROS +#define NONAMELESSUNION + +#include "windef.h" +#include "winbase.h" +#include "winuser.h" +#include "winsvc.h" +#include "objbase.h" +#include "ole2.h" +#include "rpc.h" +#include "winerror.h" +#include "winreg.h" +#include "servprov.h" +#include "wine/unicode.h" + +#include "compobj_private.h" + +#include "wine/debug.h" WINE_DEFAULT_DEBUG_CHANNEL(ole); diff --git a/dll/win32/ole32/stg_prop.c b/dll/win32/ole32/stg_prop.c index a9308d68da..1d5e03473d 100644 --- a/dll/win32/ole32/stg_prop.c +++ b/dll/win32/ole32/stg_prop.c @@ -36,8 +36,28 @@ * PropertyStorage_ReadFromStream */ -#include "precomp.h" +#include "config.h" +#include "wine/port.h" + +#include <assert.h> +#include <stdarg.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + +#define COBJMACROS +#define NONAMELESSUNION + +#include "windef.h" +#include "winbase.h" +#include "winnls.h" +#include "winuser.h" +#include "wine/unicode.h" +#include "wine/debug.h" +#include "dictionary.h" #include "storage32.h" +#include "enumx.h" +#include "oleauto.h" WINE_DEFAULT_DEBUG_CHANNEL(storage); @@ -1004,15 +1024,18 @@ static HRESULT PropertyStorage_ReadDictionary(PropertyStorage_impl *This, if (This->codePage != CP_UNICODE) ptr[cbEntry - 1] = '\0'; else - *((LPWSTR)ptr + cbEntry / sizeof(WCHAR)) = '\0'; + ((LPWSTR)ptr)[cbEntry - 1] = 0; hr = PropertyStorage_StoreNameWithId(This, (char*)ptr, This->codePage, propid); if (This->codePage == CP_UNICODE) { + /* cbEntry is the number of characters */ + cbEntry *= 2; + /* Unicode entries are padded to DWORD boundaries */ if (cbEntry % sizeof(DWORD)) ptr += sizeof(DWORD) - (cbEntry % sizeof(DWORD)); } - ptr += sizeof(DWORD) + cbEntry; + ptr += cbEntry; } return hr; } @@ -1053,6 +1076,10 @@ static HRESULT PropertyStorage_ReadProperty(PROPVARIANT *prop, const BYTE *data, prop->u.bVal = *data; TRACE("Read byte 0x%x\n", prop->u.bVal); break; + case VT_BOOL: + StorageUtl_ReadWord(data, 0, (WORD*)&prop->u.boolVal); + TRACE("Read bool %d\n", prop->u.boolVal); + break; case VT_I2: StorageUtl_ReadWord(data, 0, (WORD*)&prop->u.iVal); TRACE("Read short %d\n", prop->u.iVal); @@ -1071,6 +1098,18 @@ static HRESULT PropertyStorage_ReadProperty(PROPVARIANT *prop, const BYTE *data, StorageUtl_ReadDWord(data, 0, &prop->u.ulVal); TRACE("Read ulong %d\n", prop->u.ulVal); break; + case VT_I8: + StorageUtl_ReadULargeInteger(data, 0, (ULARGE_INTEGER *)&prop->u.hVal); + TRACE("Read long long %s\n", wine_dbgstr_longlong(prop->u.hVal.QuadPart)); + break; + case VT_UI8: + StorageUtl_ReadULargeInteger(data, 0, &prop->u.uhVal); + TRACE("Read ulong long %s\n", wine_dbgstr_longlong(prop->u.uhVal.QuadPart)); + break; + case VT_R8: + memcpy(&prop->u.dblVal, data, sizeof(double)); + TRACE("Read double %f\n", prop->u.dblVal); + break; case VT_LPSTR: { DWORD count; @@ -2364,7 +2403,9 @@ static HRESULT create_EnumSTATPROPSETSTG( enumx = enumx_allocate(&IID_IEnumSTATPROPSETSTG, &IEnumSTATPROPSETSTG_Vtbl, - sizeof (STATPROPSETSTG)); + sizeof (STATPROPSETSTG), + (IUnknown*)&This->base.IStorage_iface, + NULL); /* add all the property set elements into a list */ r = IStorage_EnumElements(stg, 0, NULL, 0, &penum); @@ -2457,6 +2498,27 @@ static HRESULT WINAPI IEnumSTATPROPSTG_fnClone( return enumx_Clone((enumx_impl*)iface, (enumx_impl**)ppenum); } +static void prop_enum_copy_cb(IUnknown *parent, void *orig, void *dest) +{ + PropertyStorage_impl *storage = impl_from_IPropertyStorage((IPropertyStorage*)parent); + STATPROPSTG *src_prop = orig; + STATPROPSTG *dest_prop = dest; + LPWSTR name; + + dest_prop->propid = src_prop->propid; + dest_prop->vt = src_prop->vt; + dest_prop->lpwstrName = NULL; + + if (dictionary_find(storage->propid_to_name, UlongToPtr(src_prop->propid), (void**)&name)) + { + DWORD size = (strlenW(name) + 1) * sizeof(WCHAR); + + dest_prop->lpwstrName = CoTaskMemAlloc(size); + if (!dest_prop->lpwstrName) return; + memcpy(dest_prop->lpwstrName, name, size); + } +} + static BOOL prop_enum_stat(const void *k, const void *v, void *extra, void *arg) { enumx_impl *enumx = arg; @@ -2483,7 +2545,9 @@ static HRESULT create_EnumSTATPROPSTG( enumx = enumx_allocate(&IID_IEnumSTATPROPSTG, &IEnumSTATPROPSTG_Vtbl, - sizeof (STATPROPSTG)); + sizeof (STATPROPSTG), + (IUnknown*)&This->IPropertyStorage_iface, + prop_enum_copy_cb); dictionary_enumerate(This->propid_to_prop, prop_enum_stat, enumx); diff --git a/dll/win32/ole32/stg_stream.c b/dll/win32/ole32/stg_stream.c index 10ddafe1c0..1a5f061250 100644 --- a/dll/win32/ole32/stg_stream.c +++ b/dll/win32/ole32/stg_stream.c @@ -23,7 +23,20 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include "precomp.h" +#include <stdlib.h> +#include <stdarg.h> +#include <stdio.h> +#include <string.h> + +#define COBJMACROS +#define NONAMELESSUNION + +#include "windef.h" +#include "winbase.h" +#include "winerror.h" +#include "winternl.h" +#include "wine/debug.h" + #include "storage32.h" WINE_DEFAULT_DEBUG_CHANNEL(storage); @@ -590,7 +603,6 @@ static HRESULT WINAPI StgStreamImpl_Clone( IStream** ppstm) /* [out] */ { StgStreamImpl* This = impl_from_IStream(iface); - HRESULT hres; StgStreamImpl* new_stream; LARGE_INTEGER seek_pos; @@ -616,11 +628,7 @@ static HRESULT WINAPI StgStreamImpl_Clone( seek_pos.QuadPart = This->currentPosition.QuadPart; - hres = IStream_Seek(*ppstm, seek_pos, STREAM_SEEK_SET, NULL); - - assert (SUCCEEDED(hres)); - - return S_OK; + return IStream_Seek(*ppstm, seek_pos, STREAM_SEEK_SET, NULL); } /* diff --git a/dll/win32/ole32/storage32.c b/dll/win32/ole32/storage32.c index 6adf3c7c19..51f178be8e 100644 --- a/dll/win32/ole32/storage32.c +++ b/dll/win32/ole32/storage32.c @@ -30,10 +30,28 @@ * residing in a compound file object. */ -#include "precomp.h" +#include <assert.h> +#include <stdarg.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + +#define COBJMACROS +#define NONAMELESSUNION + +#include "windef.h" +#include "winbase.h" +#include "winnls.h" +#include "winuser.h" +#include "wine/unicode.h" +#include "wine/debug.h" + #include "storage32.h" +#include "ole2.h" /* For Write/ReadClassStm */ -#include <wine/wingdi16.h> +#include "winreg.h" +#include "wine/wingdi16.h" +#include "compobj_private.h" WINE_DEFAULT_DEBUG_CHANNEL(storage); diff --git a/dll/win32/ole32/storage32.h b/dll/win32/ole32/storage32.h index 4f692fe585..c628523d09 100644 --- a/dll/win32/ole32/storage32.h +++ b/dll/win32/ole32/storage32.h @@ -27,10 +27,19 @@ * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ - #ifndef __STORAGE32_H__ #define __STORAGE32_H__ +#include <stdarg.h> + +#include "windef.h" +#include "winbase.h" +#include "winnt.h" +#include "objbase.h" +#include "winreg.h" +#include "winternl.h" +#include "wine/list.h" + /* * Definitions for the file format offsets. */ diff --git a/dll/win32/ole32/stubmanager.c b/dll/win32/ole32/stubmanager.c index 07d5d655aa..57048c6306 100644 --- a/dll/win32/ole32/stubmanager.c +++ b/dll/win32/ole32/stubmanager.c @@ -23,12 +23,26 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include "precomp.h" +#define COBJMACROS -#include <wine/exception.h> +#include <assert.h> +#include <stdarg.h> +#include <limits.h> + +#include "windef.h" +#include "winbase.h" +#include "winuser.h" +#include "objbase.h" +#include "rpc.h" + +#include "wine/debug.h" +#include "wine/exception.h" + +#include "compobj_private.h" WINE_DEFAULT_DEBUG_CHANNEL(ole); + /* generates an ipid in the following format (similar to native version): * Data1 = apartment-local ipid counter * Data2 = apartment creator thread ID diff --git a/dll/win32/ole32/usrmarshal.c b/dll/win32/ole32/usrmarshal.c index 9a56bd0933..63eead1b84 100644 --- a/dll/win32/ole32/usrmarshal.c +++ b/dll/win32/ole32/usrmarshal.c @@ -18,7 +18,25 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include "precomp.h" +#include <stdio.h> +#include <stdarg.h> +#include <string.h> + +#define COBJMACROS +#define NONAMELESSUNION + +#include "windef.h" +#include "winbase.h" +#include "wingdi.h" +#include "winuser.h" +#include "winerror.h" + +#include "ole2.h" +#include "oleauto.h" +#include "rpcproxy.h" + +#include "wine/unicode.h" +#include "wine/debug.h" WINE_DEFAULT_DEBUG_CHANNEL(ole); diff --git a/media/doc/README.WINE b/media/doc/README.WINE index f2475663e8..858be58afb 100644 --- a/media/doc/README.WINE +++ b/media/doc/README.WINE @@ -139,7 +139,7 @@ reactos/dll/win32/ntdsapi # Synced to WineStaging-3.3 reactos/dll/win32/objsel # Synced to WineStaging-3.3 reactos/dll/win32/odbc32 # Synced to WineStaging-3.3. Depends on port of Linux ODBC. reactos/dll/win32/odbccp32 # Synced to WineStaging-3.3 -reactos/dll/win32/ole32 # Synced to Wine-3.0 +reactos/dll/win32/ole32 # Synced to WineStaging-3.3 reactos/dll/win32/oleacc # Synced to WineStaging-2.9 reactos/dll/win32/oleaut32 # Synced to WineStaging-3.3 reactos/dll/win32/olecli32 # Synced to WineStaging-2.9
6 years, 9 months
1
0
0
0
01/01: [ODBCCP32] Sync with Wine Staging 3.3. CORE-14434
by Amine Khaldi
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=4ca633cc2a48dabd13249…
commit 4ca633cc2a48dabd13249d7f7c954a74a9451175 Author: Amine Khaldi <amine.khaldi(a)reactos.org> AuthorDate: Tue Mar 20 12:37:14 2018 +0100 Commit: Amine Khaldi <amine.khaldi(a)reactos.org> CommitDate: Tue Mar 20 12:37:14 2018 +0100 [ODBCCP32] Sync with Wine Staging 3.3. CORE-14434 --- dll/win32/odbccp32/odbccp32.c | 26 ++++++++------------------ media/doc/README.WINE | 2 +- 2 files changed, 9 insertions(+), 19 deletions(-) diff --git a/dll/win32/odbccp32/odbccp32.c b/dll/win32/odbccp32/odbccp32.c index 0a41a3d0a9..f9a2269345 100644 --- a/dll/win32/odbccp32/odbccp32.c +++ b/dll/win32/odbccp32/odbccp32.c @@ -20,20 +20,20 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#define WIN32_NO_STATUS - #include <assert.h> #include <stdarg.h> #define COBJMACROS -#include <windef.h> -#include <winbase.h> -#include <winreg.h> -#include <wine/unicode.h> -#include <wine/debug.h> +#include "windef.h" +#include "winbase.h" +#include "winreg.h" +#include "winnls.h" +#include "wine/unicode.h" +#include "wine/debug.h" +#include "wine/heap.h" -#include <odbcinst.h> +#include "odbcinst.h" WINE_DEFAULT_DEBUG_CHANNEL(odbc); @@ -85,16 +85,6 @@ static void clear_errors(void) num_errors = 0; } -static inline void* __WINE_ALLOC_SIZE(1) heap_alloc(size_t size) -{ - return HeapAlloc(GetProcessHeap(), 0, size); -} - -static inline BOOL heap_free(void *mem) -{ - return HeapFree(GetProcessHeap(), 0, mem); -} - static inline WCHAR *heap_strdupAtoW(const char *str) { LPWSTR ret = NULL; diff --git a/media/doc/README.WINE b/media/doc/README.WINE index fd84bb93e7..f2475663e8 100644 --- a/media/doc/README.WINE +++ b/media/doc/README.WINE @@ -138,7 +138,7 @@ reactos/dll/win32/npptools # Synced to WineStaging-3.3 reactos/dll/win32/ntdsapi # Synced to WineStaging-3.3 reactos/dll/win32/objsel # Synced to WineStaging-3.3 reactos/dll/win32/odbc32 # Synced to WineStaging-3.3. Depends on port of Linux ODBC. -reactos/dll/win32/odbccp32 # Synced to WineStaging-2.9 +reactos/dll/win32/odbccp32 # Synced to WineStaging-3.3 reactos/dll/win32/ole32 # Synced to Wine-3.0 reactos/dll/win32/oleacc # Synced to WineStaging-2.9 reactos/dll/win32/oleaut32 # Synced to WineStaging-3.3
6 years, 9 months
1
0
0
0
← Newer
1
...
19
20
21
22
23
24
25
...
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