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
November 2015
----- 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
14 participants
457 discussions
Start a n
N
ew thread
[akhaldi] 69914: [PSDK] Add missing GetFileInformationByHandleEx().
by akhaldi@svn.reactos.org
Author: akhaldi Date: Tue Nov 17 11:57:59 2015 New Revision: 69914 URL:
http://svn.reactos.org/svn/reactos?rev=69914&view=rev
Log: [PSDK] Add missing GetFileInformationByHandleEx(). Modified: trunk/reactos/include/psdk/winbase.h Modified: trunk/reactos/include/psdk/winbase.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/winbase.h?rev…
============================================================================== --- trunk/reactos/include/psdk/winbase.h [iso-8859-1] (original) +++ trunk/reactos/include/psdk/winbase.h [iso-8859-1] Tue Nov 17 11:57:59 2015 @@ -1949,6 +1949,16 @@ #endif BOOL WINAPI GetFileInformationByHandle(HANDLE,LPBY_HANDLE_FILE_INFORMATION); +#if (_WIN32_WINNT >= 0x0600) +BOOL +WINAPI +GetFileInformationByHandleEx( + _In_ HANDLE hFile, + _In_ FILE_INFO_BY_HANDLE_CLASS FileInformationClass, + _Out_writes_bytes_(dwBufferSize) LPVOID lpFileInformation, + _In_ DWORD dwBufferSize); +#endif + BOOL WINAPI GetFileSecurityA(
9 years, 1 month
1
0
0
0
[akhaldi] 69913: [ADVAPI32_VISTA] Import RegSetKeyValueW() from Wine Staging 1.7.55. CORE-10536
by akhaldi@svn.reactos.org
Author: akhaldi Date: Tue Nov 17 11:17:12 2015 New Revision: 69913 URL:
http://svn.reactos.org/svn/reactos?rev=69913&view=rev
Log: [ADVAPI32_VISTA] Import RegSetKeyValueW() from Wine Staging 1.7.55. CORE-10536 Added: trunk/reactos/dll/win32/advapi32_vista/RegSetKeyValue.c (with props) Modified: trunk/reactos/dll/win32/advapi32_vista/CMakeLists.txt trunk/reactos/dll/win32/advapi32_vista/advapi32_vista.spec Modified: trunk/reactos/dll/win32/advapi32_vista/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/advapi32_vista/C…
============================================================================== --- trunk/reactos/dll/win32/advapi32_vista/CMakeLists.txt [iso-8859-1] (original) +++ trunk/reactos/dll/win32/advapi32_vista/CMakeLists.txt [iso-8859-1] Tue Nov 17 11:17:12 2015 @@ -8,6 +8,7 @@ list(APPEND SOURCE DllMain.c RegDeleteTree.c + RegSetKeyValue.c ${CMAKE_CURRENT_BINARY_DIR}/advapi32_vista.def) add_library(advapi32_vista SHARED ${SOURCE}) Added: trunk/reactos/dll/win32/advapi32_vista/RegSetKeyValue.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/advapi32_vista/R…
============================================================================== --- trunk/reactos/dll/win32/advapi32_vista/RegSetKeyValue.c (added) +++ trunk/reactos/dll/win32/advapi32_vista/RegSetKeyValue.c [iso-8859-1] Tue Nov 17 11:17:12 2015 @@ -0,0 +1,25 @@ + +#include "advapi32_vista.h" + +/* Taken from Wine advapi32/registry.c */ + +/****************************************************************************** + * RegSetKeyValueW [ADVAPI32.@] + */ +LONG WINAPI RegSetKeyValueW( HKEY hkey, LPCWSTR subkey, LPCWSTR name, DWORD type, const void *data, DWORD len ) +{ + HKEY hsubkey = NULL; + DWORD ret; + + //TRACE("(%p,%s,%s,%d,%p,%d)\n", hkey, debugstr_w(subkey), debugstr_w(name), type, data, len ); + + if (subkey && subkey[0]) /* need to create the subkey */ + { + if ((ret = RegCreateKeyW( hkey, subkey, &hsubkey )) != ERROR_SUCCESS) return ret; + hkey = hsubkey; + } + + ret = RegSetValueExW( hkey, name, 0, type, (const BYTE*)data, len ); + if (hsubkey) RegCloseKey( hsubkey ); + return ret; +} Propchange: trunk/reactos/dll/win32/advapi32_vista/RegSetKeyValue.c ------------------------------------------------------------------------------ svn:eol-style = native Modified: trunk/reactos/dll/win32/advapi32_vista/advapi32_vista.spec URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/advapi32_vista/a…
============================================================================== --- trunk/reactos/dll/win32/advapi32_vista/advapi32_vista.spec [iso-8859-1] (original) +++ trunk/reactos/dll/win32/advapi32_vista/advapi32_vista.spec [iso-8859-1] Tue Nov 17 11:17:12 2015 @@ -1,3 +1,4 @@ @ stdcall RegDeleteTreeA(long str) @ stdcall RegDeleteTreeW(long wstr) +@ stdcall RegSetKeyValueW(long wstr wstr long ptr long)
9 years, 1 month
1
0
0
0
[akhaldi] 69912: [PSDK] Update oleauto.h. CORE-10536
by akhaldi@svn.reactos.org
Author: akhaldi Date: Tue Nov 17 11:07:59 2015 New Revision: 69912 URL:
http://svn.reactos.org/svn/reactos?rev=69912&view=rev
Log: [PSDK] Update oleauto.h. CORE-10536 Modified: trunk/reactos/include/psdk/oleauto.h Modified: trunk/reactos/include/psdk/oleauto.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/oleauto.h?rev…
============================================================================== --- trunk/reactos/include/psdk/oleauto.h [iso-8859-1] (original) +++ trunk/reactos/include/psdk/oleauto.h [iso-8859-1] Tue Nov 17 11:07:59 2015 @@ -203,11 +203,15 @@ /* Macros for accessing the fields of the VARIANT type */ #if (__STDC__ && !defined(_FORCENAMELESSUNION)) || defined(NONAMELESSUNION) -#define V_UNION(A,B) ((A)->n1.n2.n3.B) -#define V_VT(A) ((A)->n1.n2.vt) +#define V_VT(A) ((A)->n1.n2.vt) +#define V_UNION(A,B) ((A)->n1.n2.n3.B) +#define V_RECORD(A) (V_UNION(A,brecVal).pvRecord) +#define V_RECORDINFO(A) (V_UNION(A,brecVal).pRecInfo) #else -#define V_UNION(A,B) ((A)->B) -#define V_VT(A) ((A)->vt) +#define V_VT(A) ((A)->vt) +#define V_UNION(A,B) ((A)->B) +#define V_RECORD(A) ((A)->pvRecord) +#define V_RECORDINFO(A) ((A)->pRecInfo) #endif #define V_ISBYREF(A) (V_VT(A) & VT_BYREF)
9 years, 1 month
1
0
0
0
[akhaldi] 69911: [KERNEL32_VISTA] Import GetFileInformationByHandleEx() from Wine Staging 1.7.55. CORE-10536
by akhaldi@svn.reactos.org
Author: akhaldi Date: Tue Nov 17 10:40:04 2015 New Revision: 69911 URL:
http://svn.reactos.org/svn/reactos?rev=69911&view=rev
Log: [KERNEL32_VISTA] Import GetFileInformationByHandleEx() from Wine Staging 1.7.55. CORE-10536 Added: trunk/reactos/dll/win32/kernel32_vista/GetFileInformationByHandleEx.c (with props) Modified: trunk/reactos/dll/win32/kernel32_vista/CMakeLists.txt trunk/reactos/dll/win32/kernel32_vista/kernel32_vista.spec Modified: trunk/reactos/dll/win32/kernel32_vista/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32_vista/C…
============================================================================== --- trunk/reactos/dll/win32/kernel32_vista/CMakeLists.txt [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32_vista/CMakeLists.txt [iso-8859-1] Tue Nov 17 10:40:04 2015 @@ -7,6 +7,7 @@ list(APPEND SOURCE DllMain.c + GetFileInformationByHandleEx.c GetTickCount64.c InitOnceExecuteOnce.c ${CMAKE_CURRENT_BINARY_DIR}/kernel32_vista.def) Added: trunk/reactos/dll/win32/kernel32_vista/GetFileInformationByHandleEx.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32_vista/G…
============================================================================== --- trunk/reactos/dll/win32/kernel32_vista/GetFileInformationByHandleEx.c (added) +++ trunk/reactos/dll/win32/kernel32_vista/GetFileInformationByHandleEx.c [iso-8859-1] Tue Nov 17 10:40:04 2015 @@ -0,0 +1,70 @@ + +#include "k32_vista.h" + +#include <ndk/rtlfuncs.h> +#include <ndk/iofuncs.h> + +/* Taken from Wine kernel32/file.c */ + +/*********************************************************************** +* GetFileInformationByHandleEx (KERNEL32.@) +*/ +BOOL WINAPI GetFileInformationByHandleEx( HANDLE handle, FILE_INFO_BY_HANDLE_CLASS class, + LPVOID info, DWORD size ) +{ + NTSTATUS status; + IO_STATUS_BLOCK io; + + switch (class) + { + case FileStreamInfo: + case FileCompressionInfo: + case FileAttributeTagInfo: + case FileRemoteProtocolInfo: + case FileFullDirectoryInfo: + case FileFullDirectoryRestartInfo: + case FileStorageInfo: + case FileAlignmentInfo: + case FileIdInfo: + case FileIdExtdDirectoryInfo: + case FileIdExtdDirectoryRestartInfo: + //FIXME( "%p, %u, %p, %u\n", handle, class, info, size ); + SetLastError( ERROR_CALL_NOT_IMPLEMENTED ); + return FALSE; + + case FileBasicInfo: + status = NtQueryInformationFile( handle, &io, info, size, FileBasicInformation ); + break; + + case FileStandardInfo: + status = NtQueryInformationFile( handle, &io, info, size, FileStandardInformation ); + break; + + case FileNameInfo: + status = NtQueryInformationFile( handle, &io, info, size, FileNameInformation ); + break; + + case FileIdBothDirectoryRestartInfo: + case FileIdBothDirectoryInfo: + status = NtQueryDirectoryFile( handle, NULL, NULL, NULL, &io, info, size, + FileIdBothDirectoryInformation, FALSE, NULL, + (class == FileIdBothDirectoryRestartInfo) ); + break; + + case FileRenameInfo: + case FileDispositionInfo: + case FileAllocationInfo: + case FileIoPriorityHintInfo: + case FileEndOfFileInfo: + default: + SetLastError( ERROR_INVALID_PARAMETER ); + return FALSE; + } + + if (status != STATUS_SUCCESS) + { + SetLastError( RtlNtStatusToDosError( status ) ); + return FALSE; + } + return TRUE; +} Propchange: trunk/reactos/dll/win32/kernel32_vista/GetFileInformationByHandleEx.c ------------------------------------------------------------------------------ svn:eol-style = native Modified: trunk/reactos/dll/win32/kernel32_vista/kernel32_vista.spec URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32_vista/k…
============================================================================== --- trunk/reactos/dll/win32/kernel32_vista/kernel32_vista.spec [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32_vista/kernel32_vista.spec [iso-8859-1] Tue Nov 17 10:40:04 2015 @@ -1,3 +1,4 @@ +@ stdcall InitOnceExecuteOnce(ptr ptr ptr ptr) +@ stdcall GetFileInformationByHandleEx(long long ptr long) @ stdcall -ret64 GetTickCount64() -@ stdcall InitOnceExecuteOnce(ptr ptr ptr ptr)
9 years, 1 month
1
0
0
0
[akhaldi] 69910: [UNICODE] Sync with Wine Staging 1.7.55. CORE-10536
by akhaldi@svn.reactos.org
Author: akhaldi Date: Tue Nov 17 10:35:27 2015 New Revision: 69910 URL:
http://svn.reactos.org/svn/reactos?rev=69910&view=rev
Log: [UNICODE] Sync with Wine Staging 1.7.55. CORE-10536 Modified: trunk/reactos/media/doc/README.WINE trunk/reactos/tools/unicode/casemap.c trunk/reactos/tools/unicode/sortkey.c trunk/reactos/tools/unicode/wctomb.c trunk/reactos/tools/unicode/wctype.c Modified: trunk/reactos/media/doc/README.WINE URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=…
============================================================================== --- trunk/reactos/media/doc/README.WINE [iso-8859-1] (original) +++ trunk/reactos/media/doc/README.WINE [iso-8859-1] Tue Nov 17 10:35:27 2015 @@ -15,7 +15,7 @@ The following build tools are shared with Wine. -reactos/tools/unicode # Synced to WineStaging-1.7.47 +reactos/tools/unicode # Synced to WineStaging-1.7.55 reactos/tools/widl # Synced to WineStaging-1.7.55 reactos/tools/wpp # Synced to WineStaging-1.7.47 Modified: trunk/reactos/tools/unicode/casemap.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/unicode/casemap.c?re…
============================================================================== --- trunk/reactos/tools/unicode/casemap.c [iso-8859-1] (original) +++ trunk/reactos/tools/unicode/casemap.c [iso-8859-1] Tue Nov 17 10:35:27 2015 @@ -3,41 +3,41 @@ #include "wine/unicode.h" -const WCHAR wine_casemap_lower[3807] = +const WCHAR wine_casemap_lower[4013] = { /* index */ 0x01bf, 0x02bf, 0x03bf, 0x044f, 0x054f, 0x064f, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, - 0x06af, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, - 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x07af, 0x08ae, - 0x0100, 0x09ab, 0x0100, 0x0100, 0x0a2f, 0x0100, 0x0100, 0x0100, - 0x0100, 0x0100, 0x0100, 0x0100, 0x0b2f, 0x0100, 0x0100, 0x0100, - 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, - 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, - 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, - 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, - 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, - 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, - 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, - 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, - 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, - 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, - 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, - 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, - 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, - 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, - 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0c22, 0x0d00, - 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, - 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, - 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, - 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, - 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, - 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, - 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, - 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, - 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, - 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, - 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0ddf, + 0x06af, 0x0100, 0x0100, 0x077d, 0x0100, 0x0100, 0x0100, 0x0100, + 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x087d, 0x097c, + 0x0100, 0x0a79, 0x0100, 0x0100, 0x0afd, 0x0100, 0x0100, 0x0100, + 0x0100, 0x0100, 0x0100, 0x0100, 0x0bfd, 0x0100, 0x0100, 0x0100, + 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, + 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, + 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, + 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, + 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, + 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, + 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, + 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, + 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, + 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, + 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, + 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, + 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, + 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, + 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0cf0, 0x0dce, + 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, + 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, + 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, + 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, + 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, + 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, + 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, + 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, + 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, + 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, + 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0ead, /* defaults */ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, @@ -260,6 +260,33 @@ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + /* 0x1332 .. 0x13ff */ + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x97d0, 0x97d0, + 0x97d0, 0x97d0, 0x97d0, 0x97d0, 0x97d0, 0x97d0, 0x97d0, 0x97d0, + 0x97d0, 0x97d0, 0x97d0, 0x97d0, 0x97d0, 0x97d0, 0x97d0, 0x97d0, + 0x97d0, 0x97d0, 0x97d0, 0x97d0, 0x97d0, 0x97d0, 0x97d0, 0x97d0, + 0x97d0, 0x97d0, 0x97d0, 0x97d0, 0x97d0, 0x97d0, 0x97d0, 0x97d0, + 0x97d0, 0x97d0, 0x97d0, 0x97d0, 0x97d0, 0x97d0, 0x97d0, 0x97d0, + 0x97d0, 0x97d0, 0x97d0, 0x97d0, 0x97d0, 0x97d0, 0x97d0, 0x97d0, + 0x97d0, 0x97d0, 0x97d0, 0x97d0, 0x97d0, 0x97d0, 0x97d0, 0x97d0, + 0x97d0, 0x97d0, 0x97d0, 0x97d0, 0x97d0, 0x97d0, 0x97d0, 0x97d0, + 0x97d0, 0x97d0, 0x97d0, 0x97d0, 0x97d0, 0x97d0, 0x97d0, 0x97d0, + 0x97d0, 0x97d0, 0x97d0, 0x97d0, 0x97d0, 0x97d0, 0x0008, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0008, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, /* 0x1e00 .. 0x1eff */ 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, @@ -461,7 +488,7 @@ 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x5abc, 0x5ab1, 0x5ab5, 0x5abf, 0x0000, 0x0000, 0x5aee, 0x5ad6, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x5aeb, 0x03a0, 0x0001, 0x0000, 0x0001, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, @@ -501,41 +528,41 @@ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 }; -const WCHAR wine_casemap_upper[3994] = +const WCHAR wine_casemap_upper[4433] = { /* index */ 0x019f, 0x029f, 0x039f, 0x045a, 0x0556, 0x0656, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, - 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, - 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x06dd, 0x07dc, 0x08dc, - 0x0100, 0x09d0, 0x0100, 0x0100, 0x0a55, 0x0100, 0x0100, 0x0100, - 0x0100, 0x0100, 0x0100, 0x0100, 0x0b3f, 0x0c3f, 0x0100, 0x0100, - 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, - 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, - 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, - 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, - 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, - 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, - 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, - 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, - 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, - 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, - 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, - 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, - 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, - 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, - 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0cfe, 0x0ddb, - 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, - 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, - 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, - 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, - 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, - 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, - 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, - 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, - 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, - 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, - 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0e9a, + 0x0100, 0x0100, 0x0100, 0x06dd, 0x0100, 0x0100, 0x0100, 0x0100, + 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x07db, 0x08da, 0x09da, + 0x0100, 0x0ace, 0x0100, 0x0100, 0x0b53, 0x0100, 0x0100, 0x0100, + 0x0100, 0x0100, 0x0100, 0x0100, 0x0c3d, 0x0d3d, 0x0100, 0x0100, + 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, + 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, + 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, + 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, + 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, + 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, + 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, + 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, + 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, + 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, + 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, + 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, + 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, + 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, + 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0dfc, 0x0ed9, + 0x0100, 0x0100, 0x0100, 0x0f91, 0x0100, 0x0100, 0x0100, 0x0100, + 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, + 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, + 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, + 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, + 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, + 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, + 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, + 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, + 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, + 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x1051, /* defaults */ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, @@ -643,7 +670,7 @@ 0xff26, 0x0000, 0x0000, 0xff26, 0x0000, 0x0000, 0x0000, 0xa52a, 0xff26, 0xffbb, 0xff27, 0xff27, 0xffb9, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xff25, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xa512, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xa515, 0xa512, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, @@ -747,24 +774,57 @@ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - /* 0x1d79 .. 0x1dff */ - 0x8a04, 0x0000, 0x0000, 0x0000, 0x0ee6, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + /* 0x1379 .. 0x13ff */ + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xfff8, + 0xfff8, 0xfff8, 0xfff8, 0xfff8, 0xfff8, 0x0000, 0x0000, + /* 0x1d02 .. 0x1dff */ + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8a04, + 0x0000, 0x0000, 0x0000, 0x0ee6, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, /* 0x1e01 .. 0x1eff */ 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, @@ -989,7 +1049,7 @@ 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, @@ -999,31 +1059,55 @@ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - /* 0xff41 .. 0xffff */ + /* 0xab48 .. 0xabff */ + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0xfc60, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x6830, 0x6830, 0x6830, 0x6830, 0x6830, 0x6830, 0x6830, 0x6830, + 0x6830, 0x6830, 0x6830, 0x6830, 0x6830, 0x6830, 0x6830, 0x6830, + 0x6830, 0x6830, 0x6830, 0x6830, 0x6830, 0x6830, 0x6830, 0x6830, + 0x6830, 0x6830, 0x6830, 0x6830, 0x6830, 0x6830, 0x6830, 0x6830, + 0x6830, 0x6830, 0x6830, 0x6830, 0x6830, 0x6830, 0x6830, 0x6830, + 0x6830, 0x6830, 0x6830, 0x6830, 0x6830, 0x6830, 0x6830, 0x6830, + 0x6830, 0x6830, 0x6830, 0x6830, 0x6830, 0x6830, 0x6830, 0x6830, + 0x6830, 0x6830, 0x6830, 0x6830, 0x6830, 0x6830, 0x6830, 0x6830, + 0x6830, 0x6830, 0x6830, 0x6830, 0x6830, 0x6830, 0x6830, 0x6830, + 0x6830, 0x6830, 0x6830, 0x6830, 0x6830, 0x6830, 0x6830, 0x6830, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + /* 0xff40 .. 0xffff */ + 0x0000, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, - 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, - 0xffe0, 0xffe0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 + 0xffe0, 0xffe0, 0xffe0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 }; const WCHAR wine_digitmap[5933] = { Modified: trunk/reactos/tools/unicode/sortkey.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/unicode/sortkey.c?re…
============================================================================== --- trunk/reactos/tools/unicode/sortkey.c [iso-8859-1] (original) +++ trunk/reactos/tools/unicode/sortkey.c [iso-8859-1] Tue Nov 17 10:35:27 2015 @@ -223,6 +223,8 @@ len1--; len2--; } + if (len1 && !*str1) len1--; + if (len2 && !*str2) len2--; return len1 - len2; } @@ -272,6 +274,8 @@ len1--; len2--; } + if (len1 && !*str1) len1--; + if (len2 && !*str2) len2--; return len1 - len2; } @@ -321,22 +325,15 @@ len1--; len2--; } + if (len1 && !*str1) len1--; + if (len2 && !*str2) len2--; return len1 - len2; -} - -static inline int real_length(const WCHAR *str, int len) -{ - while (len && !str[len - 1]) len--; - return len; } int wine_compare_string(int flags, const WCHAR *str1, int len1, const WCHAR *str2, int len2) { int ret; - - len1 = real_length(str1, len1); - len2 = real_length(str2, len2); ret = compare_unicode_weights(flags, str1, len1, str2, len2); if (!ret) Modified: trunk/reactos/tools/unicode/wctomb.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/unicode/wctomb.c?rev…
============================================================================== --- trunk/reactos/tools/unicode/wctomb.c [iso-8859-1] (original) +++ trunk/reactos/tools/unicode/wctomb.c [iso-8859-1] Tue Nov 17 10:35:27 2015 @@ -275,6 +275,14 @@ return 1; } +/* compute the default char for the dbcs case */ +static inline WCHAR get_defchar_dbcs( const struct dbcs_table *table, const char *defchar ) +{ + if (!defchar) return table->info.def_char; + if (!defchar[1]) return (unsigned char)defchar[0]; + return ((unsigned char)defchar[0] << 8) | (unsigned char)defchar[1]; +} + /* query necessary dst length for src string */ static int get_length_dbcs( const struct dbcs_table *table, int flags, const WCHAR *src, unsigned int srclen, @@ -282,8 +290,7 @@ { const unsigned short * const uni2cp_low = table->uni2cp_low; const unsigned short * const uni2cp_high = table->uni2cp_high; - WCHAR defchar_value = table->info.def_char; - WCHAR composed; + WCHAR defchar_value, composed; int len, tmp; if (!defchar && !used && !(flags & WC_COMPOSITECHECK)) @@ -295,7 +302,7 @@ return len; } - if (defchar) defchar_value = defchar[1] ? ((defchar[0] << 8) | defchar[1]) : defchar[0]; + defchar_value = get_defchar_dbcs( table, defchar ); if (!used) used = &tmp; /* avoid checking on every char */ *used = 0; for (len = 0; srclen; len++, srclen--, src++) @@ -376,11 +383,10 @@ { const unsigned short * const uni2cp_low = table->uni2cp_low; const unsigned short * const uni2cp_high = table->uni2cp_high; - WCHAR defchar_value = table->info.def_char; + WCHAR defchar_value = get_defchar_dbcs( table, defchar ); WCHAR composed; int len, tmp; - if (defchar) defchar_value = defchar[1] ? ((defchar[0] << 8) | defchar[1]) : defchar[0]; if (!used) used = &tmp; /* avoid checking on every char */ *used = 0; Modified: trunk/reactos/tools/unicode/wctype.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/unicode/wctype.c?rev…
============================================================================== --- trunk/reactos/tools/unicode/wctype.c [iso-8859-1] (original) +++ trunk/reactos/tools/unicode/wctype.c [iso-8859-1] Tue Nov 17 10:35:27 2015 @@ -317,13 +317,13 @@ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xc300, 0xc300, 0xc300, 0xc300, 0xc300, 0xc300, 0xc300, 0xc300, 0xc300, 0xc300, 0xc300, 0xc300, 0xc300, 0xc300, 0xc300, 0xc300, - 0xc300, 0xc300, 0xc300, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0xd200, 0xd200, 0xd200, 0xd200, + 0xc300, 0xc300, 0xc300, 0xc300, 0xc300, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0xd200, 0xd200, 0xd200, 0xd200, 0xd200, 0xd200, 0xd200, 0xd200, 0xd200, 0xd200, 0xd200, 0xd200, 0xd200, 0xd200, 0xd200, 0xd200, 0xd200, 0xd200, 0xd200, 0xd200, 0xd200, 0xd200, 0xd200, 0xd200, 0xd200, 0xd200, 0xd200, 0xd200, 0xd200, @@ -390,7 +390,7 @@ 0x1300, 0x1300, 0xd200, 0xd200, 0x0000, 0x0000, 0x1204, 0x1204, 0x1204, 0x1204, 0x1204, 0x1204, 0x1204, 0x1204, 0x1204, 0x1204, 0x1210, 0x5200, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x1300, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xd200, 0x1200, 0x1200, 0x0000, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x0000, 0x0000, 0x1300, 0x1300, 0x0000, 0x0000, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, @@ -434,7 +434,7 @@ 0xd200, 0x1200, 0x1200, 0x1200, 0x1200, 0x0000, 0xd200, 0xd200, 0xd200, 0x0000, 0xd200, 0xd200, 0xd200, 0xd200, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xd200, 0xd200, 0x0000, - 0x1300, 0x1300, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x1300, 0x1300, 0x1300, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x1300, 0x1300, 0xd200, 0xd200, 0x0000, 0x0000, 0x1204, 0x1204, 0x1204, 0x1204, 0x1204, 0x1204, 0x1204, 0x1204, 0x1204, 0x1204, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, @@ -466,7 +466,7 @@ 0x1200, 0xd200, 0xd200, 0xd200, 0xd200, 0x0000, 0x1200, 0x1200, 0x1200, 0x0000, 0x1200, 0x1200, 0x1200, 0xd200, 0x1300, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x1200, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x1300, 0x1300, 0x1300, 0xd200, 0xd200, 0x0000, 0x0000, 0x1204, 0x1204, 0x1204, 0x1204, 0x1204, 0x1204, 0x1204, 0x1204, 0x1204, 0x1204, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x0000, 0x0000, @@ -667,18 +667,18 @@ 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0xb200, 0xb200, 0xb200, 0xb200, 0xb200, 0xb200, 0xb200, 0xb200, 0xb200, 0xb200, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, - 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, - 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, - 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, - 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, - 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, - 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, - 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, - 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, - 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, - 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x1301, 0x1301, 0x1301, 0x1301, 0x1301, 0x1301, 0x1301, 0x1301, + 0x1301, 0x1301, 0x1301, 0x1301, 0x1301, 0x1301, 0x1301, 0x1301, + 0x1301, 0x1301, 0x1301, 0x1301, 0x1301, 0x1301, 0x1301, 0x1301, + 0x1301, 0x1301, 0x1301, 0x1301, 0x1301, 0x1301, 0x1301, 0x1301, + 0x1301, 0x1301, 0x1301, 0x1301, 0x1301, 0x1301, 0x1301, 0x1301, + 0x1301, 0x1301, 0x1301, 0x1301, 0x1301, 0x1301, 0x1301, 0x1301, + 0x1301, 0x1301, 0x1301, 0x1301, 0x1301, 0x1301, 0x1301, 0x1301, + 0x1301, 0x1301, 0x1301, 0x1301, 0x1301, 0x1301, 0x1301, 0x1301, + 0x1301, 0x1301, 0x1301, 0x1301, 0x1301, 0x1301, 0x1301, 0x1301, + 0x1301, 0x1301, 0x1301, 0x1301, 0x1301, 0x1301, 0x1301, 0x1301, + 0x1301, 0x1301, 0x1301, 0x1301, 0x1301, 0x1301, 0x0000, 0x0000, + 0x1302, 0x1302, 0x1302, 0x1302, 0x1302, 0x1302, 0x0000, 0x0000, 0xb210, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, @@ -829,10 +829,10 @@ 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x0000, 0x0000, 0x0000, 0x0000, - 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, - 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, - 0x1200, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, - 0x1200, 0x1200, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, + 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, + 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, + 0x1300, 0x1300, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x1204, 0x1204, 0x1204, 0x1204, 0x1204, 0x1204, 0x1204, 0x1204, 0x1204, 0x1204, 0x1200, 0x0000, 0x0000, 0x0000, 0xb200, 0xb200, 0xb200, 0xb200, 0xb200, 0xb200, 0xb200, 0xb200, 0xb200, 0xb200, @@ -1054,7 +1054,7 @@ 0x5200, 0x5200, 0x5200, 0x5200, 0x5200, 0x5200, 0x5200, 0x5200, 0x5200, 0x5200, 0x5200, 0x5200, 0x5200, 0x5200, 0x5200, 0x5200, 0x5200, 0x5200, 0x5200, 0x5200, 0x5200, 0x5200, 0x5200, 0x5200, - 0x5200, 0x5200, 0x5200, 0x5200, 0x5200, 0x5200, 0x0000, 0x0000, + 0x5200, 0x5200, 0x5200, 0x5200, 0x5200, 0x5200, 0x5200, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xd200, 0xd200, 0xd200, 0xd200, 0xd200, 0xd200, 0xd200, 0xd200, @@ -1080,7 +1080,7 @@ 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1301, 0x1302, 0x1300, 0x1300, 0x1300, - 0x1300, 0xb200, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x1300, 0xb200, 0xb200, 0xb200, 0x0000, 0x0000, 0x0000, 0x0000, 0xb200, 0xb200, 0xb200, 0xb200, 0xb200, 0xb200, 0xb200, 0xb200, 0xb200, 0xb200, 0xb200, 0xb200, 0xb200, 0xb200, 0xb200, 0xb200, 0xb200, 0xb200, 0xb200, 0xb200, 0xb200, 0xb200, 0xb200, 0xb200, @@ -1380,7 +1380,7 @@ 0xb200, 0xb200, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0xb200, 0xb200, 0xb200, 0xb200, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x1301, 0x1301, 0x1301, 0x1301, 0x1301, 0x1301, 0x1301, 0x1301, @@ -1696,8 +1696,8 @@ 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, - 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, + 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, @@ -1754,7 +1754,7 @@ 0x1301, 0x1302, 0x1301, 0x1302, 0x1301, 0x1302, 0x1301, 0x1302, 0x1301, 0x1302, 0x1301, 0x1302, 0x1301, 0x1302, 0x1301, 0x1302, 0x1301, 0x1302, 0x1301, 0x1302, 0x1301, 0x1302, 0x1301, 0x1302, - 0x1301, 0x1302, 0x1301, 0x1302, 0x1300, 0x1300, 0x0000, 0xd200, + 0x1301, 0x1302, 0x1301, 0x1302, 0x1300, 0x1300, 0xd200, 0xd200, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, @@ -1784,12 +1784,12 @@ 0x1300, 0x1302, 0x1302, 0x1302, 0x1302, 0x1302, 0x1302, 0x1302, 0x1302, 0x1301, 0x1302, 0x1301, 0x1302, 0x1301, 0x1301, 0x1302, 0x1301, 0x1302, 0x1301, 0x1302, 0x1301, 0x1302, 0x1301, 0x1302, - 0xb300, 0x1200, 0x1200, 0x1301, 0x1302, 0x1301, 0x1302, 0x0000, + 0xb300, 0x1200, 0x1200, 0x1301, 0x1302, 0x1301, 0x1302, 0x1300, 0x1301, 0x1302, 0x1301, 0x1302, 0x1302, 0x1302, 0x1301, 0x1302, 0x1301, 0x1302, 0x1301, 0x1302, 0x1301, 0x1302, 0x1301, 0x1302, 0x1301, 0x1302, 0x1301, 0x1302, 0x1301, 0x1302, 0x1301, 0x1302, 0x1301, 0x1302, 0x1301, 0x1301, 0x1301, 0x1301, 0x0000, 0x0000, - 0x1301, 0x1301, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x1301, 0x1301, 0x1301, 0x1301, 0x1301, 0x1302, 0x1301, 0x1302, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, @@ -1830,7 +1830,7 @@ 0xd200, 0xd200, 0xd200, 0xd200, 0xd200, 0xd200, 0xd200, 0xd200, 0xd200, 0xd200, 0xd200, 0xd200, 0xd200, 0xd200, 0xd200, 0xd200, 0xd200, 0xd200, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, - 0x1210, 0x1210, 0x1210, 0x1300, 0x0000, 0x0000, 0x0000, 0x0000, + 0x1210, 0x1210, 0x1210, 0x1300, 0x1210, 0x1300, 0x0000, 0x0000, 0x1204, 0x1204, 0x1204, 0x1204, 0x1204, 0x1204, 0x1204, 0x1204, 0x1204, 0x1204, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, @@ -1907,18 +1907,18 @@ 0x1302, 0x1302, 0x1302, 0x1302, 0x1302, 0x1302, 0x1302, 0x1302, 0x1302, 0x1302, 0x1302, 0x1302, 0x1302, 0x1302, 0x1302, 0x1302, 0x1302, 0x1302, 0x1302, 0x1200, 0x1300, 0x1300, 0x1300, 0x1300, - 0x0000, 0x0000, 0x0000, 0x0000, 0x1302, 0x1302, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x1302, 0x1302, 0x1302, 0x1302, 0x1302, 0x1302, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x1302, 0x1302, 0x1302, 0x1302, 0x1302, 0x1302, 0x1302, 0x1302, + 0x1302, 0x1302, 0x1302, 0x1302, 0x1302, 0x1302, 0x1302, 0x1302, + 0x1302, 0x1302, 0x1302, 0x1302, 0x1302, 0x1302, 0x1302, 0x1302, + 0x1302, 0x1302, 0x1302, 0x1302, 0x1302, 0x1302, 0x1302, 0x1302, + 0x1302, 0x1302, 0x1302, 0x1302, 0x1302, 0x1302, 0x1302, 0x1302, + 0x1302, 0x1302, 0x1302, 0x1302, 0x1302, 0x1302, 0x1302, 0x1302, + 0x1302, 0x1302, 0x1302, 0x1302, 0x1302, 0x1302, 0x1302, 0x1302, + 0x1302, 0x1302, 0x1302, 0x1302, 0x1302, 0x1302, 0x1302, 0x1302, + 0x1302, 0x1302, 0x1302, 0x1302, 0x1302, 0x1302, 0x1302, 0x1302, + 0x1302, 0x1302, 0x1302, 0x1302, 0x1302, 0x1302, 0x1302, 0x1302, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, @@ -2092,7 +2092,7 @@ 0xb210, 0xb210, 0xb210, 0xb210, 0xb210, 0xb210, 0xb210, 0xb210, 0xb210, 0xb210, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xd200, 0xd200, 0xd200, 0xd200, 0xd200, 0xd200, 0xd200, 0xd200, - 0xd200, 0xd200, 0xd200, 0xd200, 0xd200, 0xd200, 0x0000, 0x0000, + 0xd200, 0xd200, 0xd200, 0xd200, 0xd200, 0xd200, 0xd200, 0xd200, 0xb210, 0xb210, 0xb210, 0xb210, 0xb210, 0xb210, 0xb210, 0xb210, 0xb210, 0xb210, 0xb210, 0xb210, 0xb210, 0xb210, 0xb210, 0xb210, 0xb210, 0xb210, 0xb210, 0xb210, 0xb210, 0xb210, 0xb210, 0xb210,
9 years, 1 month
1
0
0
0
[akhaldi] 69909: [OLE32_WINETEST] Sync with Wine Staging 1.7.55. CORE-10536
by akhaldi@svn.reactos.org
Author: akhaldi Date: Tue Nov 17 10:31:59 2015 New Revision: 69909 URL:
http://svn.reactos.org/svn/reactos?rev=69909&view=rev
Log: [OLE32_WINETEST] Sync with Wine Staging 1.7.55. CORE-10536 Modified: trunk/rostests/winetests/ole32/compobj.c trunk/rostests/winetests/ole32/marshal.c trunk/rostests/winetests/ole32/moniker.c trunk/rostests/winetests/ole32/ole2.c trunk/rostests/winetests/ole32/propvariant.c trunk/rostests/winetests/ole32/storage32.c trunk/rostests/winetests/ole32/usrmarshal.c Modified: trunk/rostests/winetests/ole32/compobj.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/ole32/compobj.c…
============================================================================== --- trunk/rostests/winetests/ole32/compobj.c [iso-8859-1] (original) +++ trunk/rostests/winetests/ole32/compobj.c [iso-8859-1] Tue Nov 17 10:31:59 2015 @@ -46,6 +46,32 @@ extern const IID GUID_NULL; +#define DEFINE_EXPECT(func) \ + static BOOL expect_ ## func = FALSE, called_ ## func = FALSE + +#define SET_EXPECT(func) \ + expect_ ## func = TRUE + +#define CHECK_EXPECT2(func) \ + do { \ + ok(expect_ ##func, "unexpected call " #func "\n"); \ + called_ ## func = TRUE; \ + }while(0) + +#define CHECK_EXPECT(func) \ + do { \ + CHECK_EXPECT2(func); \ + expect_ ## func = FALSE; \ + }while(0) + +#define CHECK_CALLED(func) \ + do { \ + ok(called_ ## func, "expected " #func "\n"); \ + expect_ ## func = called_ ## func = FALSE; \ + }while(0) + +DEFINE_EXPECT(CreateStub); + /* functions that are not present on all versions of Windows */ static HRESULT (WINAPI * pCoInitializeEx)(LPVOID lpReserved, DWORD dwCoInit); static HRESULT (WINAPI * pCoGetObjectContext)(REFIID riid, LPVOID *ppv); @@ -135,6 +161,7 @@ return 1; /* non-heap-based object */ } +static IID create_instance_iid; static HRESULT WINAPI Test_IClassFactory_CreateInstance( LPCLASSFACTORY iface, IUnknown *pUnkOuter, @@ -142,6 +169,7 @@ LPVOID *ppvObj) { *ppvObj = NULL; + create_instance_iid = *riid; if (pUnkOuter) return CLASS_E_NOAGGREGATION; return E_NOINTERFACE; } @@ -772,6 +800,30 @@ CoUninitialize(); } +static void test_CoCreateInstanceEx(void) +{ + MULTI_QI qi_res = { &IID_IMoniker }; + DWORD cookie; + HRESULT hr; + + CoInitialize(NULL); + + hr = CoRegisterClassObject(&CLSID_WineOOPTest, (IUnknown *)&Test_ClassFactory, + CLSCTX_INPROC_SERVER, REGCLS_MULTIPLEUSE, &cookie); + ok_ole_success(hr, "CoRegisterClassObject"); + + create_instance_iid = IID_NULL; + hr = CoCreateInstanceEx(&CLSID_WineOOPTest, NULL, CLSCTX_INPROC_SERVER, NULL, 1, &qi_res); + ok(hr == E_NOINTERFACE, "CoCreateInstanceEx failed: %08x\n", hr); + ok(IsEqualGUID(&create_instance_iid, qi_res.pIID), "Unexpected CreateInstance iid %s\n", + wine_dbgstr_guid(&create_instance_iid)); + + hr = CoRevokeClassObject(cookie); + ok_ole_success(hr, "CoRevokeClassObject"); + + CoUninitialize(); +} + static ATOM register_dummy_class(void) { WNDCLASSA wc = @@ -912,6 +964,59 @@ CoUninitialize(); } +static IUnknown Test_Unknown; + +static HRESULT WINAPI EnumOLEVERB_QueryInterface(IEnumOLEVERB *iface, REFIID riid, void **ppv) +{ + return IUnknown_QueryInterface(&Test_Unknown, riid, ppv); +} + +static ULONG WINAPI EnumOLEVERB_AddRef(IEnumOLEVERB *iface) +{ + return 2; +} + +static ULONG WINAPI EnumOLEVERB_Release(IEnumOLEVERB *iface) +{ + return 1; +} + +static HRESULT WINAPI EnumOLEVERB_Next(IEnumOLEVERB *iface, ULONG celt, OLEVERB *rgelt, ULONG *fetched) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI EnumOLEVERB_Skip(IEnumOLEVERB *iface, ULONG celt) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI EnumOLEVERB_Reset(IEnumOLEVERB *iface) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI EnumOLEVERB_Clone(IEnumOLEVERB *iface, IEnumOLEVERB **ppenum) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static const IEnumOLEVERBVtbl EnumOLEVERBVtbl = { + EnumOLEVERB_QueryInterface, + EnumOLEVERB_AddRef, + EnumOLEVERB_Release, + EnumOLEVERB_Next, + EnumOLEVERB_Skip, + EnumOLEVERB_Reset, + EnumOLEVERB_Clone +}; + +static IEnumOLEVERB EnumOLEVERB = { &EnumOLEVERBVtbl }; + static HRESULT WINAPI Test_IUnknown_QueryInterface( IUnknown *iface, REFIID riid, @@ -919,16 +1024,17 @@ { if (ppvObj == NULL) return E_POINTER; - if (IsEqualIID(riid, &IID_IUnknown) || - IsEqualIID(riid, &IID_IWineTest)) - { + if (IsEqualIID(riid, &IID_IUnknown) || IsEqualIID(riid, &IID_IWineTest)) { *ppvObj = iface; - IUnknown_AddRef(iface); - return S_OK; - } - - *ppvObj = NULL; - return E_NOINTERFACE; + }else if(IsEqualIID(riid, &IID_IEnumOLEVERB)) { + *ppvObj = &EnumOLEVERB; + }else { + *ppvObj = NULL; + return E_NOINTERFACE; + } + + IUnknown_AddRef((IUnknown*)*ppvObj); + return S_OK; } static ULONG WINAPI Test_IUnknown_AddRef(IUnknown *iface) @@ -949,6 +1055,8 @@ }; static IUnknown Test_Unknown = { &TestUnknown_Vtbl }; + +static IPSFactoryBuffer *ps_factory_buffer; static HRESULT WINAPI PSFactoryBuffer_QueryInterface( IPSFactoryBuffer * This, @@ -993,7 +1101,13 @@ /* [unique][in] */ IUnknown *pUnkServer, /* [out] */ IRpcStubBuffer **ppStub) { - return E_NOTIMPL; + CHECK_EXPECT(CreateStub); + + ok(pUnkServer == (IUnknown*)&Test_Unknown, "unexpected pUnkServer %p\n", pUnkServer); + if(!ps_factory_buffer) + return E_NOTIMPL; + + return IPSFactoryBuffer_CreateStub(ps_factory_buffer, &IID_IEnumOLEVERB, pUnkServer, ppStub); } static IPSFactoryBufferVtbl PSFactoryBufferVtbl = @@ -1037,9 +1151,31 @@ hr = CreateStreamOnHGlobal(NULL, TRUE, &stream); ok_ole_success(hr, "CreateStreamOnHGlobal"); + SET_EXPECT(CreateStub); hr = CoMarshalInterface(stream, &IID_IWineTest, &Test_Unknown, MSHCTX_INPROC, NULL, MSHLFLAGS_NORMAL); ok(hr == E_NOTIMPL, "CoMarshalInterface should have returned E_NOTIMPL instead of 0x%08x\n", hr); + CHECK_CALLED(CreateStub); + + hr = CoGetPSClsid(&IID_IEnumOLEVERB, &clsid); + ok_ole_success(hr, "CoGetPSClsid"); + + hr = CoGetClassObject(&clsid, CLSCTX_INPROC_SERVER, NULL, &IID_IPSFactoryBuffer, (void **)&ps_factory_buffer); + ok_ole_success(hr, "CoGetClassObject"); + + hr = CoRegisterPSClsid(&IID_IEnumOLEVERB, &CLSID_WineTestPSFactoryBuffer); + ok_ole_success(hr, "CoRegisterPSClsid"); + + SET_EXPECT(CreateStub); + hr = CoMarshalInterface(stream, &IID_IEnumOLEVERB, (IUnknown*)&EnumOLEVERB, MSHCTX_INPROC, NULL, MSHLFLAGS_NORMAL); + ok(hr == S_OK, "CoMarshalInterface should have returned E_NOTIMPL instead of 0x%08x\n", hr); + CHECK_CALLED(CreateStub); + + hr = CoMarshalInterface(stream, &IID_IEnumOLEVERB, &Test_Unknown, MSHCTX_INPROC, NULL, MSHLFLAGS_NORMAL); + ok(hr == S_OK, "CoMarshalInterface should have returned E_NOTIMPL instead of 0x%08x\n", hr); + IStream_Release(stream); + IPSFactoryBuffer_Release(ps_factory_buffer); + ps_factory_buffer = NULL; hr = CoRevokeClassObject(dwRegistrationKey); ok_ole_success(hr, "CoRevokeClassObject"); @@ -2135,9 +2271,45 @@ return 0; } +static const char cls_name[] = "cowait_test_class"; +static DWORD CALLBACK test_CoWaitForMultipleHandles_thread(LPVOID arg) +{ + HANDLE *handles = arg; + BOOL success; + DWORD index; + HRESULT hr; + HWND hWnd; + MSG msg; + + hr = pCoInitializeEx(NULL, COINIT_APARTMENTTHREADED); + ok(hr == S_OK, "CoInitializeEx failed with error 0x%08x\n", hr); + + hWnd = CreateWindowExA(0, cls_name, "Test (thread)", WS_TILEDWINDOW, 0, 0, 640, 480, 0, 0, 0, 0); + ok(hWnd != 0, "CreateWindowExA failed %u\n", GetLastError()); + + index = 0xdeadbeef; + PostMessageA(hWnd, WM_DDE_FIRST, 0, 0); + hr = CoWaitForMultipleHandles(0, 50, 2, handles, &index); + ok(hr == RPC_S_CALLPENDING, "expected RPC_S_CALLPENDING, got 0x%08x\n", hr); + ok(index==0 || index==0xdeadbeef/* Win 8 */, "expected index 0, got %u\n", index); + success = PeekMessageA(&msg, hWnd, WM_DDE_FIRST, WM_DDE_FIRST, PM_REMOVE); + ok(!success, "CoWaitForMultipleHandles didn't pump any messages\n"); + + index = 0xdeadbeef; + PostMessageA(hWnd, WM_USER, 0, 0); + hr = CoWaitForMultipleHandles(0, 50, 2, handles, &index); + ok(hr == RPC_S_CALLPENDING, "expected RPC_S_CALLPENDING, got 0x%08x\n", hr); + ok(index==0 || index==0xdeadbeef/* Win 8 */, "expected index 0, got %u\n", index); + success = PeekMessageA(&msg, hWnd, WM_USER, WM_USER, PM_REMOVE); + ok(success, "CoWaitForMultipleHandles unexpectedly pumped messages\n"); + + DestroyWindow(hWnd); + CoUninitialize(); + return 0; +} + static void test_CoWaitForMultipleHandles(void) { - static const char cls_name[] = "cowait_test_class"; HANDLE handles[2], thread; DWORD index, tid; WNDCLASSEXA wc; @@ -2440,6 +2612,12 @@ CloseHandle(thread); } + /* test message pumping when CoWaitForMultipleHandles is called from non main apartment thread */ + thread = CreateThread(NULL, 0, test_CoWaitForMultipleHandles_thread, handles, 0, &tid); + index = WaitForSingleObject(thread, 500); + ok(index == WAIT_OBJECT_0, "WaitForSingleObject failed\n"); + CloseHandle(thread); + CloseHandle(handles[0]); CloseHandle(handles[1]); DestroyWindow(hWnd); @@ -2493,6 +2671,7 @@ test_CoCreateInstance(); test_ole_menu(); test_CoGetClassObject(); + test_CoCreateInstanceEx(); test_CoRegisterMessageFilter(); test_CoRegisterPSClsid(); test_CoGetPSClsid(); Modified: trunk/rostests/winetests/ole32/marshal.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/ole32/marshal.c…
============================================================================== --- trunk/rostests/winetests/ole32/marshal.c [iso-8859-1] (original) +++ trunk/rostests/winetests/ole32/marshal.c [iso-8859-1] Tue Nov 17 10:31:59 2015 @@ -122,7 +122,7 @@ static HRESULT WINAPI ExternalConnection_QueryInterface(IExternalConnection *iface, REFIID riid, void **ppv) { - ok(0, "unxpected call\n"); + ok(0, "unexpected call\n"); *ppv = NULL; return E_NOINTERFACE; } @@ -202,6 +202,24 @@ static IUnknown Test_Unknown = { &TestUnknown_Vtbl }; +static ULONG WINAPI TestCrash_IUnknown_Release(LPUNKNOWN iface) +{ + UnlockModule(); + if(!cLocks) { + trace("crashing...\n"); + *(int**)0xc = 0; + } + return 1; /* non-heap-based object */ +} + +static const IUnknownVtbl TestCrashUnknown_Vtbl = +{ + Test_IUnknown_QueryInterface, + Test_IUnknown_AddRef, + TestCrash_IUnknown_Release, +}; + +static IUnknown TestCrash_Unknown = { &TestCrashUnknown_Vtbl }; static HRESULT WINAPI Test_IClassFactory_QueryInterface( LPCLASSFACTORY iface, @@ -1087,6 +1105,63 @@ ok_last_release_closes(TRUE); end_host_object(host_tid, host_thread); +} + +static BOOL crash_thread_success; + +static DWORD CALLBACK crash_couninitialize_proc(void *p) +{ + IStream *stream; + HRESULT hr; + + cLocks = 0; + + CoInitialize(NULL); + + hr = CreateStreamOnHGlobal(NULL, TRUE, &stream); + ok_ole_success(hr, CreateStreamOnHGlobal); + + hr = CoMarshalInterface(stream, &IID_IUnknown, &TestCrash_Unknown, MSHCTX_INPROC, NULL, MSHLFLAGS_NORMAL); + ok_ole_success(hr, CoMarshalInterface); + + IStream_Seek(stream, ullZero, STREAM_SEEK_SET, NULL); + + hr = CoReleaseMarshalData(stream); + ok_ole_success(hr, CoReleaseMarshalData); + + ok_no_locks(); + + hr = CoMarshalInterface(stream, &IID_IUnknown, &TestCrash_Unknown, MSHCTX_INPROC, NULL, MSHLFLAGS_NORMAL); + ok_ole_success(hr, CoMarshalInterface); + + ok_more_than_one_lock(); + + trace("CoUninitialize >>>\n"); + CoUninitialize(); + trace("CoUninitialize <<<\n"); + + ok_no_locks(); + + IStream_Release(stream); + crash_thread_success = TRUE; + return 0; +} + +static void test_crash_couninitialize(void) +{ + HANDLE thread; + DWORD tid; + + if(!GetProcAddress(GetModuleHandleA("kernel32.dll"), "CreateActCtxW")) { + win_skip("Skipping crash tests on win2k.\n"); + return; + } + + crash_thread_success = FALSE; + thread = CreateThread(NULL, 0, crash_couninitialize_proc, NULL, 0, &tid); + ok(!WaitForSingleObject(thread, 10000), "wait timed out\n"); + CloseHandle(thread); + ok(crash_thread_success, "Crash thread failed\n"); } /* tests success case of a same-thread table-weak marshal, unmarshal, unmarshal */ @@ -2859,6 +2934,63 @@ static HWND hwnd_app; +struct local_server +{ + IPersist IPersist_iface; /* a nice short interface */ +}; + +static HRESULT WINAPI local_server_QueryInterface(IPersist *iface, REFIID iid, void **obj) +{ + *obj = NULL; + + if (IsEqualGUID(iid, &IID_IUnknown) || + IsEqualGUID(iid, &IID_IPersist)) + *obj = iface; + + if (*obj) + { + IPersist_AddRef(iface); + return S_OK; + } + return E_NOINTERFACE; +} + +static ULONG WINAPI local_server_AddRef(IPersist *iface) +{ + return 2; +} + +static ULONG WINAPI local_server_Release(IPersist *iface) +{ + return 1; +} + +static HRESULT WINAPI local_server_GetClassID(IPersist *iface, CLSID *clsid) +{ + HRESULT hr; + + *clsid = IID_IUnknown; + + /* Test calling CoDisconnectObject within a COM call */ + hr = CoDisconnectObject((IUnknown *)iface, 0); + ok(hr == S_OK, "got %08x\n", hr); + + return S_OK; +} + +static const IPersistVtbl local_server_persist_vtbl = +{ + local_server_QueryInterface, + local_server_AddRef, + local_server_Release, + local_server_GetClassID +}; + +struct local_server local_server_class = +{ + {&local_server_persist_vtbl} +}; + static HRESULT WINAPI TestOOP_IClassFactory_QueryInterface( LPCLASSFACTORY iface, REFIID riid, @@ -2893,12 +3025,12 @@ REFIID riid, LPVOID *ppvObj) { - if (IsEqualIID(riid, &IID_IClassFactory) || IsEqualIID(riid, &IID_IUnknown)) - { - *ppvObj = iface; - return S_OK; - } - return CLASS_E_CLASSNOTAVAILABLE; + IPersist *persist = &local_server_class.IPersist_iface; + HRESULT hr; + IPersist_AddRef( persist ); + hr = IPersist_QueryInterface( persist, riid, ppvObj ); + IPersist_Release( persist ); + return hr; } static HRESULT WINAPI TestOOP_IClassFactory_LockServer( @@ -2928,24 +3060,25 @@ DWORD cookie; HRESULT hr; HANDLE ready_event; - HANDLE quit_event; DWORD wait; + HANDLE handles[2]; heventShutdown = CreateEventA(NULL, TRUE, FALSE, NULL); - + ready_event = CreateEventA(NULL, FALSE, FALSE, "Wine COM Test Ready Event"); + handles[0] = CreateEventA(NULL, FALSE, FALSE, "Wine COM Test Quit Event"); + handles[1] = CreateEventA(NULL, FALSE, FALSE, "Wine COM Test Repeat Event"); + +again: hr = CoRegisterClassObject(&CLSID_WineOOPTest, (IUnknown *)&TestOOP_ClassFactory, CLSCTX_LOCAL_SERVER, REGCLS_SINGLEUSE, &cookie); ok_ole_success(hr, CoRegisterClassObject); - ready_event = CreateEventA(NULL, FALSE, FALSE, "Wine COM Test Ready Event"); SetEvent(ready_event); - quit_event = CreateEventA(NULL, FALSE, FALSE, "Wine COM Test Quit Event"); - do { - wait = MsgWaitForMultipleObjects(1, &quit_event, FALSE, 30000, QS_ALLINPUT); - if (wait == WAIT_OBJECT_0+1) + wait = MsgWaitForMultipleObjects(2, handles, FALSE, 30000, QS_ALLINPUT); + if (wait == WAIT_OBJECT_0+2) { MSG msg; @@ -2956,12 +3089,20 @@ DispatchMessageA(&msg); } } - } - while (wait == WAIT_OBJECT_0+1); + else if (wait == WAIT_OBJECT_0+1) + { + hr = CoRevokeClassObject(cookie); + ok_ole_success(hr, CoRevokeClassObject); + goto again; + } + } + while (wait == WAIT_OBJECT_0+2); ok( wait == WAIT_OBJECT_0, "quit event wait timed out\n" ); hr = CoRevokeClassObject(cookie); ok_ole_success(hr, CoRevokeClassObject); + CloseHandle(handles[0]); + CloseHandle(handles[1]); } static HANDLE create_target_process(const char *arg) @@ -2976,7 +3117,7 @@ pi.hThread = NULL; pi.hProcess = NULL; winetest_get_mainargs( &argv ); - sprintf(cmdline, "%s %s %s", argv[0], argv[1], arg); + sprintf(cmdline, "\"%s\" %s %s", argv[0], argv[1], arg); ret = CreateProcessA(argv[0], cmdline, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi); ok(ret, "CreateProcess failed with error: %u\n", GetLastError()); if (pi.hThread) CloseHandle(pi.hThread); @@ -2989,10 +3130,13 @@ DWORD cookie; HRESULT hr; IClassFactory * cf; + IPersist *persist; DWORD ret; HANDLE process; HANDLE quit_event; HANDLE ready_event; + HANDLE repeat_event; + CLSID clsid; heventShutdown = CreateEventA(NULL, TRUE, FALSE, NULL); @@ -3059,15 +3203,29 @@ ready_event = CreateEventA(NULL, FALSE, FALSE, "Wine COM Test Ready Event"); ok( !WaitForSingleObject(ready_event, 10000), "wait timed out\n" ); + + hr = CoCreateInstance(&CLSID_WineOOPTest, NULL, CLSCTX_LOCAL_SERVER, &IID_IPersist, (void **)&persist); + ok_ole_success(hr, CoCreateInstance); + + IPersist_Release(persist); + + hr = CoCreateInstance(&CLSID_WineOOPTest, NULL, CLSCTX_LOCAL_SERVER, &IID_IPersist, (void **)&persist); + ok(hr == REGDB_E_CLASSNOTREG, "Second CoCreateInstance on REGCLS_SINGLEUSE object should have failed\n"); + + /* Re-register the class and try calling CoDisconnectObject from within a call to that object */ + repeat_event = CreateEventA(NULL, FALSE, FALSE, "Wine COM Test Repeat Event"); + SetEvent(repeat_event); + CloseHandle(repeat_event); + + ok( !WaitForSingleObject(ready_event, 10000), "wait timed out\n" ); CloseHandle(ready_event); - hr = CoCreateInstance(&CLSID_WineOOPTest, NULL, CLSCTX_LOCAL_SERVER, &IID_IClassFactory, (void **)&cf); + hr = CoCreateInstance(&CLSID_WineOOPTest, NULL, CLSCTX_LOCAL_SERVER, &IID_IPersist, (void **)&persist); ok_ole_success(hr, CoCreateInstance); - IClassFactory_Release(cf); - - hr = CoCreateInstance(&CLSID_WineOOPTest, NULL, CLSCTX_LOCAL_SERVER, &IID_IClassFactory, (void **)&cf); - ok(hr == REGDB_E_CLASSNOTREG, "Second CoCreateInstance on REGCLS_SINGLEUSE object should have failed\n"); + /* GetClassID will call CoDisconnectObject */ + IPersist_GetClassID(persist, &clsid); + IPersist_Release(persist); quit_event = CreateEventA(NULL, FALSE, FALSE, "Wine COM Test Quit Event"); SetEvent(quit_event); @@ -3556,6 +3714,7 @@ test_globalinterfacetable(); test_manualresetevent(); + test_crash_couninitialize(); /* must be last test as channel hooks can't be unregistered */ test_channel_hook(); Modified: trunk/rostests/winetests/ole32/moniker.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/ole32/moniker.c…
============================================================================== --- trunk/rostests/winetests/ole32/moniker.c [iso-8859-1] (original) +++ trunk/rostests/winetests/ole32/moniker.c [iso-8859-1] Tue Nov 17 10:31:59 2015 @@ -99,7 +99,7 @@ static HRESULT WINAPI ExternalConnection_QueryInterface(IExternalConnection *iface, REFIID riid, void **ppv) { - ok(0, "unxpected call\n"); + ok(0, "unexpected call\n"); *ppv = NULL; return E_NOINTERFACE; } Modified: trunk/rostests/winetests/ole32/ole2.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/ole32/ole2.c?re…
============================================================================== --- trunk/rostests/winetests/ole32/ole2.c [iso-8859-1] (original) +++ trunk/rostests/winetests/ole32/ole2.c [iso-8859-1] Tue Nov 17 10:31:59 2015 @@ -117,6 +117,32 @@ static HRESULT g_QIFailsWith; static UINT cf_test_1, cf_test_2, cf_test_3; + +/**************************************************************************** + * PresentationDataHeader + * + * This structure represents the header of the \002OlePresXXX stream in + * the OLE object storage. + */ +typedef struct PresentationDataHeader +{ + /* clipformat: + * - standard clipformat: + * DWORD length = 0xffffffff; + * DWORD cfFormat; + * - or custom clipformat: + * DWORD length; + * CHAR format_name[length]; (null-terminated) + */ + DWORD unknown3; /* 4, possibly TYMED_ISTREAM */ + DVASPECT dvAspect; + DWORD lindex; + DWORD tymed; + DWORD unknown7; /* 0 */ + DWORD dwObjectExtentX; + DWORD dwObjectExtentY; + DWORD dwSize; +} PresentationDataHeader; #define CHECK_EXPECTED_METHOD(method_name) \ do { \ @@ -1045,6 +1071,7 @@ { HRESULT hr; IOleObject *pObject; + DWORD fmt; static const struct expected_method methods_oleload[] = { @@ -1101,6 +1128,105 @@ IOleObject_Release(pObject); CHECK_NO_EXTRA_METHODS(); + } + + for (fmt = CF_TEXT; fmt < CF_MAX; fmt++) + { + static const WCHAR olrepres[] = { 2,'O','l','e','P','r','e','s','0','0','0',0 }; + IStorage *stg; + IStream *stream; + IUnknown *obj; + DWORD data, i, tymed, data_size; + PresentationDataHeader header; + HDC hdc; + HGDIOBJ hobj; + RECT rc; + char buf[256]; + + for (i = 0; i < 7; i++) + { + hr = StgCreateDocfile(NULL, STGM_READWRITE | STGM_CREATE | STGM_SHARE_EXCLUSIVE | STGM_DELETEONRELEASE, 0, &stg); + ok(hr == S_OK, "StgCreateDocfile error %#x\n", hr); + + hr = IStorage_SetClass(stg, &CLSID_WineTest); + ok(hr == S_OK, "SetClass error %#x\n", hr); + + hr = IStorage_CreateStream(stg, olrepres, STGM_READWRITE | STGM_SHARE_EXCLUSIVE | STGM_CREATE, 0, 0, &stream); + ok(hr == S_OK, "CreateStream error %#x\n", hr); + + data = ~0; + hr = IStream_Write(stream, &data, sizeof(data), NULL); + ok(hr == S_OK, "Write error %#x\n", hr); + + data = fmt; + hr = IStream_Write(stream, &data, sizeof(data), NULL); + ok(hr == S_OK, "Write error %#x\n", hr); + + switch (fmt) + { + case CF_BITMAP: + /* FIXME: figure out stream format */ + hobj = CreateBitmap(1, 1, 1, 1, NULL); + data_size = GetBitmapBits(hobj, sizeof(buf), buf); + DeleteObject(hobj); + break; + + case CF_METAFILEPICT: + case CF_ENHMETAFILE: + hdc = CreateMetaFileA(NULL); + hobj = CloseMetaFile(hdc); + data_size = GetMetaFileBitsEx(hobj, sizeof(buf), buf); + DeleteMetaFile(hobj); + break; + + default: + data_size = sizeof(buf); + memset(buf, 'A', sizeof(buf)); + break; + } + + tymed = 1 << i; + + header.unknown3 = 4; + header.dvAspect = DVASPECT_CONTENT; + header.lindex = -1; + header.tymed = tymed; + header.unknown7 = 0; + header.dwObjectExtentX = 1; + header.dwObjectExtentY = 1; + header.dwSize = data_size; + hr = IStream_Write(stream, &header, sizeof(header), NULL); + ok(hr == S_OK, "Write error %#x\n", hr); + + hr = IStream_Write(stream, buf, data_size, NULL); + ok(hr == S_OK, "Write error %#x\n", hr); + + IStream_Release(stream); + + hr = OleLoad(stg, &IID_IUnknown, NULL, (void **)&obj); + /* FIXME: figure out stream format */ + if (fmt == CF_BITMAP && hr != S_OK) + { + IStorage_Release(stg); + continue; + } + ok(hr == S_OK, "OleLoad error %#x: cfFormat = %u, tymed = %u\n", hr, fmt, tymed); + + hdc = CreateCompatibleDC(0); + SetRect(&rc, 0, 0, 100, 100); + hr = OleDraw(obj, DVASPECT_CONTENT, hdc, &rc); + DeleteDC(hdc); + if (fmt == CF_METAFILEPICT) + ok(hr == S_OK, "OleDraw error %#x: cfFormat = %u, tymed = %u\n", hr, fmt, tymed); + else if (fmt == CF_ENHMETAFILE) +todo_wine + ok(hr == S_OK, "OleDraw error %#x: cfFormat = %u, tymed = %u\n", hr, fmt, tymed); + else + ok(hr == OLE_E_BLANK || hr == OLE_E_NOTRUNNING || hr == E_FAIL, "OleDraw should fail: %#x, cfFormat = %u, tymed = %u\n", hr, fmt, header.tymed); + + IUnknown_Release(obj); + IStorage_Release(stg); + } } } @@ -1936,7 +2062,6 @@ fmtetc.lindex = -1; fmtetc.tymed = TYMED_ENHMF; hr = IDataObject_QueryGetData(pDataObject, &fmtetc); - todo_wine ok(hr == OLE_E_NOTRUNNING, "IDataObject_QueryGetData should have returned OLE_E_NOTRUNNING instead of 0x%08x\n", hr); fmtetc.cfFormat = CF_TEXT; @@ -1945,7 +2070,6 @@ fmtetc.lindex = -1; fmtetc.tymed = TYMED_NULL; hr = IDataObject_QueryGetData(pDataObject, &fmtetc); - todo_wine ok(hr == OLE_E_NOTRUNNING, "IDataObject_QueryGetData should have returned OLE_E_NOTRUNNING instead of 0x%08x\n", hr); hr = IOleObject_QueryInterface(pObject, &IID_IRunnableObject, (void **)&pRunnableObject); @@ -2107,7 +2231,7 @@ static HRESULT WINAPI OleRun_GetRunningClass(IRunnableObject *iface, CLSID *clsid) { - ok(0, "unxpected\n"); + ok(0, "unexpected\n"); return E_NOTIMPL; } @@ -2119,20 +2243,20 @@ static BOOL WINAPI OleRun_IsRunning(IRunnableObject *iface) { - ok(0, "unxpected\n"); + ok(0, "unexpected\n"); return FALSE; } static HRESULT WINAPI OleRun_LockRunning(IRunnableObject *iface, BOOL lock, BOOL last_unlock_closes) { - ok(0, "unxpected\n"); + ok(0, "unexpected\n"); return E_NOTIMPL; } static HRESULT WINAPI OleRun_SetContainedObject(IRunnableObject *iface, BOOL contained) { - ok(0, "unxpected\n"); + ok(0, "unexpected\n"); return E_NOTIMPL; } Modified: trunk/rostests/winetests/ole32/propvariant.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/ole32/propvaria…
============================================================================== --- trunk/rostests/winetests/ole32/propvariant.c [iso-8859-1] (original) +++ trunk/rostests/winetests/ole32/propvariant.c [iso-8859-1] Tue Nov 17 10:31:59 2015 @@ -140,7 +140,7 @@ }; -static void expect(HRESULT hr, VARTYPE vt, BOOL copy) +static void expect(HRESULT hr, VARTYPE vt, BOOL copy, int line) { int idx = vt & VT_TYPEMASK; BYTE flags; @@ -168,7 +168,12 @@ } if(flags == PROP_INV) - ok(hr == copy ? DISP_E_BADVARTYPE : STG_E_INVALIDPARAMETER, "%s (%s): got %08x\n", wine_vtypes[idx], modifier, hr); + { + if (copy && (vt & VT_VECTOR)) + ok(hr == DISP_E_BADVARTYPE || hr == STG_E_INVALIDPARAMETER, "%s (%s): got %08x (line %d)\n", wine_vtypes[idx], modifier, hr, line); + else + ok(hr == (copy ? DISP_E_BADVARTYPE : STG_E_INVALIDPARAMETER), "%s (%s): got %08x (line %d)\n", wine_vtypes[idx], modifier, hr, line); + } else if(flags == PROP_V0) ok(hr == S_OK, "%s (%s): got %08x\n", wine_vtypes[idx], modifier, hr); else if(flags & PROP_TODO) @@ -220,7 +225,7 @@ vt = propvar.vt = i; memset(©, 0x77, sizeof(copy)); hr = PropVariantCopy(©, &propvar); - expect(hr, vt, TRUE); + expect(hr, vt, TRUE, __LINE__); if (hr == S_OK) { ok(copy.vt == propvar.vt, "expected %d, got %d\n", propvar.vt, copy.vt); @@ -234,7 +239,7 @@ ok(!ret || broken(ret) /* win2000 */, "%d: copy should stay unchanged\n", i); } hr = PropVariantClear(&propvar); - expect(hr, vt, FALSE); + expect(hr, vt, FALSE, __LINE__); ok(propvar.vt == 0, "expected 0, got %d\n", propvar.vt); ok(U(propvar).uhVal.QuadPart == 0, "%u: expected 0, got %#x/%#x\n", i, U(propvar).uhVal.u.LowPart, U(propvar).uhVal.u.HighPart); @@ -244,7 +249,7 @@ vt = propvar.vt = i | VT_ARRAY; memset(©, 0x77, sizeof(copy)); hr = PropVariantCopy(©, &propvar); - expect(hr, vt, TRUE); + expect(hr, vt, TRUE, __LINE__); if (hr == S_OK) { ok(copy.vt == propvar.vt, "expected %d, got %d\n", propvar.vt, copy.vt); @@ -257,7 +262,7 @@ ok(!ret || broken(ret) /* win2000 */, "%d: copy should stay unchanged\n", i); } hr = PropVariantClear(&propvar); - expect(hr, vt, FALSE); + expect(hr, vt, FALSE, __LINE__); ok(propvar.vt == 0, "expected 0, got %d\n", propvar.vt); ok(U(propvar).uhVal.QuadPart == 0, "%u: expected 0, got %#x/%#x\n", i, U(propvar).uhVal.u.LowPart, U(propvar).uhVal.u.HighPart); @@ -268,7 +273,7 @@ vt = propvar.vt = i | VT_VECTOR; memset(©, 0x77, sizeof(copy)); hr = PropVariantCopy(©, &propvar); - expect(hr, vt, TRUE); + expect(hr, vt, TRUE, __LINE__); if (hr == S_OK) { ok(copy.vt == propvar.vt, "expected %d, got %d\n", propvar.vt, copy.vt); @@ -281,7 +286,7 @@ ok(!ret || broken(ret) /* win2000 */, "%d: copy should stay unchanged\n", i); } hr = PropVariantClear(&propvar); - expect(hr, vt, FALSE); + expect(hr, vt, FALSE, __LINE__); ok(propvar.vt == 0, "expected 0, got %d\n", propvar.vt); ok(U(propvar).uhVal.QuadPart == 0, "%u: expected 0, got %#x/%#x\n", i, U(propvar).uhVal.u.LowPart, U(propvar).uhVal.u.HighPart); @@ -291,7 +296,7 @@ vt = propvar.vt = i | VT_BYREF; memset(©, 0x77, sizeof(copy)); hr = PropVariantCopy(©, &propvar); - expect(hr, vt, TRUE); + expect(hr, vt, TRUE, __LINE__); if (hr == S_OK) { ok(copy.vt == propvar.vt, "expected %d, got %d\n", propvar.vt, copy.vt); @@ -305,7 +310,7 @@ ok(!ret || broken(ret) /* win2000 */, "%d: copy should stay unchanged\n", i); } hr = PropVariantClear(&propvar); - expect(hr, vt, FALSE); + expect(hr, vt, FALSE, __LINE__); ok(propvar.vt == 0, "expected 0, got %d\n", propvar.vt); ok(U(propvar).uhVal.QuadPart == 0, "%u: expected 0, got %#x/%#x\n", i, U(propvar).uhVal.u.LowPart, U(propvar).uhVal.u.HighPart); Modified: trunk/rostests/winetests/ole32/storage32.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/ole32/storage32…
============================================================================== --- trunk/rostests/winetests/ole32/storage32.c [iso-8859-1] (original) +++ trunk/rostests/winetests/ole32/storage32.c [iso-8859-1] Tue Nov 17 10:31:59 2015 @@ -224,7 +224,7 @@ return S_OK; } -static ILockBytesVtbl TestLockBytes_Vtbl = { +static /* const */ ILockBytesVtbl TestLockBytes_Vtbl = { TestLockBytes_QueryInterface, TestLockBytes_AddRef, TestLockBytes_Release, @@ -517,6 +517,7 @@ ULARGE_INTEGER p; unsigned char buffer[0x100]; IUnknown *unk; + BOOL ret; DeleteFileA(filenameA); @@ -695,8 +696,8 @@ IStorage_Release(stg); } - r = DeleteFileA(filenameA); - ok(r, "file should exist\n"); + ret = DeleteFileA(filenameA); + ok(ret, "file should exist\n"); } static BOOL touch_file(LPCSTR filename) @@ -743,6 +744,7 @@ IStorage *stg = NULL, *stg2 = NULL; HRESULT r; DWORD stgm; + BOOL ret; /* try opening a zero length file - it should stay zero length */ DeleteFileA(filenameA); @@ -902,8 +904,8 @@ r = StgOpenStorage( filename, NULL, STGM_NOSNAPSHOT | STGM_PRIORITY, NULL, 0, &stg); ok(r == STG_E_INVALIDFLAG, "should fail\n"); - r = DeleteFileA(filenameA); - ok(r, "file didn't exist\n"); + ret = DeleteFileA(filenameA); + ok(ret, "file didn't exist\n"); } static void test_storage_suminfo(void) @@ -1226,6 +1228,7 @@ static const WCHAR stmname[] = { 'C','O','N','T','E','N','T','S',0 }; static const WCHAR stmname2[] = { 'A','B','C','D','E','F','G','H','I',0 }; static const WCHAR stmname3[] = { 'A','B','C','D','E','F','G','H','I','J',0 }; + static const STATSTG stat_null; STATSTG stat; IEnumSTATSTG *ee = NULL; ULONG count; @@ -1271,10 +1274,12 @@ r = IStorage_DestroyElement(stg, stmname); ok(r==S_OK, "IStorage->DestroyElement failed\n"); + memset(&stat, 0xad, sizeof(stat)); count = 0xf00; r = IEnumSTATSTG_Next(ee, 1, &stat, &count); ok(r==S_FALSE, "IEnumSTATSTG->Next failed\n"); ok(count == 0, "count wrong\n"); + ok(memcmp(&stat, &stat_null, sizeof(stat)) == 0, "stat is not zeroed\n"); /* reset and try again */ r = IEnumSTATSTG_Reset(ee); @@ -1401,6 +1406,7 @@ static const WCHAR stmname2[] = { 'F','O','O',0 }; static const WCHAR stgname[] = { 'P','E','R','M','S','T','G',0 }; static const WCHAR stgname2[] = { 'T','E','M','P','S','T','G',0 }; + BOOL ret; DeleteFileA(filenameA); @@ -1521,8 +1527,8 @@ IStorage_Release(stg); - r = DeleteFileA(filenameA); - ok( r == TRUE, "deleted file\n"); + ret = DeleteFileA(filenameA); + ok(ret, "deleted file\n"); } static void test_substorage_share(void) @@ -1533,6 +1539,7 @@ static const WCHAR stgname[] = { 'P','E','R','M','S','T','G',0 }; static const WCHAR stmname[] = { 'C','O','N','T','E','N','T','S',0 }; static const WCHAR othername[] = { 'N','E','W','N','A','M','E',0 }; + BOOL ret; DeleteFileA(filenameA); @@ -1612,8 +1619,8 @@ IStorage_Release(stg); - r = DeleteFileA(filenameA); - ok( r == TRUE, "deleted file\n"); + ret = DeleteFileA(filenameA); + ok(ret, "deleted file\n"); } static void test_revert(void) @@ -1626,6 +1633,7 @@ static const WCHAR stgname[] = { 'P','E','R','M','S','T','G',0 }; static const WCHAR stgname2[] = { 'T','E','M','P','S','T','G',0 }; STATSTG statstg; + BOOL ret; DeleteFileA(filenameA); @@ -1743,8 +1751,8 @@ IStorage_Release(stg); - r = DeleteFileA(filenameA); - ok( r == TRUE, "deleted file\n"); + ret = DeleteFileA(filenameA); + ok(ret, "deleted file\n"); /* Revert only invalidates objects in transacted mode */ r = StgCreateDocfile( filename, STGM_CREATE | STGM_SHARE_EXCLUSIVE | @@ -1763,8 +1771,8 @@ IStream_Release(stm); IStorage_Release(stg); - r = DeleteFileA(filenameA); - ok( r == TRUE, "deleted file\n"); + ret = DeleteFileA(filenameA); + ok(ret, "deleted file\n"); } static void test_parent_free(void) @@ -1776,6 +1784,7 @@ static const WCHAR stgname[] = { 'P','E','R','M','S','T','G',0 }; ULONG ref; STATSTG statstg; + BOOL ret; DeleteFileA(filenameA); @@ -1825,8 +1834,8 @@ IStorage_Release(stg); - r = DeleteFileA(filenameA); - ok( r == TRUE, "deleted file\n"); + ret = DeleteFileA(filenameA); + ok(ret, "deleted file\n"); } static void test_nonroot_transacted(void) @@ -1837,6 +1846,7 @@ static const WCHAR stgname[] = { 'P','E','R','M','S','T','G',0 }; static const WCHAR stmname[] = { 'C','O','N','T','E','N','T','S',0 }; static const WCHAR stmname2[] = { 'F','O','O',0 }; + BOOL ret; DeleteFileA(filenameA); @@ -1945,8 +1955,8 @@ IStorage_Release(stg); - r = DeleteFileA(filenameA); - ok( r == TRUE, "deleted file\n"); + ret = DeleteFileA(filenameA); + ok(ret, "deleted file\n"); } static void test_ReadClassStm(void) @@ -2415,6 +2425,7 @@ static const WCHAR fileW[] = {'f','m','t','t','e','s','t',0}; static WCHAR userTypeW[] = {'S','t','g','U','s','r','T','y','p','e',0}; static const WCHAR strmNameW[] = {1,'C','o','m','p','O','b','j',0}; + static const STATSTG statstg_null; hr = StgCreateDocfile( fileW, STGM_CREATE | STGM_SHARE_EXCLUSIVE | STGM_READWRITE, 0, &stg); ok(hr == S_OK, "should succeed, res=%x\n", hr); @@ -2433,6 +2444,7 @@ BOOL found = FALSE; STATSTG statstg; DWORD got; + memset(&statstg, 0xad, sizeof(statstg)); while ((hr = IEnumSTATSTG_Next(stat, 1, &statstg, &got)) == S_OK && got == 1) { if (strcmp_ww(statstg.pwcsName, strmNameW) == 0) @@ -2441,6 +2453,7 @@ ok(0, "found unexpected stream or storage\n"); CoTaskMemFree(statstg.pwcsName); } + ok(memcmp(&statstg, &statstg_null, sizeof(statstg)) == 0, "statstg is not zeroed\n"); ok(found == TRUE, "expected storage to contain stream \\0001CompObj\n"); IEnumSTATSTG_Release(stat); } @@ -2457,6 +2470,7 @@ BOOL found = FALSE; STATSTG statstg; DWORD got; + memset(&statstg, 0xad, sizeof(statstg)); while ((hr = IEnumSTATSTG_Next(stat, 1, &statstg, &got)) == S_OK && got == 1) { if (strcmp_ww(statstg.pwcsName, strmNameW) == 0) @@ -2465,6 +2479,7 @@ ok(0, "found unexpected stream or storage\n"); CoTaskMemFree(statstg.pwcsName); } + ok(memcmp(&statstg, &statstg_null, sizeof(statstg)) == 0, "statstg is not zeroed\n"); ok(found == TRUE, "expected storage to contain stream \\0001CompObj\n"); IEnumSTATSTG_Release(stat); } @@ -2929,6 +2944,7 @@ static const WCHAR stgname2[] = { 'S','T','G',0 }; static const WCHAR stmname[] = { 'C','O','N','T','E','N','T','S',0 }; static const WCHAR stmname2[] = { 'E','N','T','S',0 }; + BOOL ret; DeleteFileA(filenameA); @@ -2985,8 +3001,8 @@ IStorage_Release(stg); - r = DeleteFileA(filenameA); - ok( r == TRUE, "deleted file\n"); + ret = DeleteFileA(filenameA); + ok(ret, "deleted file\n"); } static void test_toplevel_stat(void) @@ -3072,6 +3088,7 @@ HRESULT r; ULONG ref; static const WCHAR stgname[] = { 'P','E','R','M','S','T','G',0 }; + BOOL ret; DeleteFileA(filenameA); @@ -3107,8 +3124,8 @@ IStorage_Release(stg); - r = DeleteFileA(filenameA); - ok( r == TRUE, "deleted file\n"); + ret = DeleteFileA(filenameA); + ok(ret, "deleted file\n"); } static void test_copyto_locking(void) @@ -3119,6 +3136,7 @@ static const WCHAR stgname[] = { 'S','T','G','1',0 }; static const WCHAR stgname2[] = { 'S','T','G','2',0 }; static const WCHAR stmname[] = { 'C','O','N','T','E','N','T','S',0 }; + BOOL ret; DeleteFileA(filenameA); @@ -3158,8 +3176,8 @@ IStorage_Release(stg2); IStorage_Release(stg); - r = DeleteFileA(filenameA); - ok( r == TRUE, "deleted file\n"); + ret = DeleteFileA(filenameA); + ok(ret, "deleted file\n"); } static void test_copyto_recursive(void) @@ -3168,6 +3186,7 @@ HRESULT r; static const WCHAR stgname[] = { 'S','T','G','1',0 }; static const WCHAR stgname2[] = { 'S','T','G','2',0 }; + BOOL ret; DeleteFileA(filenameA); @@ -3209,8 +3228,8 @@ IStorage_Release(stg2); IStorage_Release(stg); - r = DeleteFileA(filenameA); - ok( r == TRUE, "deleted file\n"); + ret = DeleteFileA(filenameA); + ok(ret, "deleted file\n"); } static void test_hglobal_storage_creation(void) Modified: trunk/rostests/winetests/ole32/usrmarshal.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/ole32/usrmarsha…
============================================================================== --- trunk/rostests/winetests/ole32/usrmarshal.c [iso-8859-1] (original) +++ trunk/rostests/winetests/ole32/usrmarshal.c [iso-8859-1] Tue Nov 17 10:31:59 2015 @@ -89,6 +89,91 @@ umcb->pStubMsg = stub_msg; umcb->Signature = USER_MARSHAL_CB_SIGNATURE; umcb->CBType = buffer ? USER_MARSHAL_CB_UNMARSHALL : USER_MARSHAL_CB_BUFFER_SIZE; +} + +#define RELEASEMARSHALDATA WM_USER + +struct host_object_data +{ + IStream *stream; + IID iid; + IUnknown *object; + MSHLFLAGS marshal_flags; + HANDLE marshal_event; + IMessageFilter *filter; +}; + +static DWORD CALLBACK host_object_proc(LPVOID p) +{ + struct host_object_data *data = p; + HRESULT hr; + MSG msg; + + CoInitializeEx(NULL, COINIT_APARTMENTTHREADED); + + if (data->filter) + { + IMessageFilter * prev_filter = NULL; + hr = CoRegisterMessageFilter(data->filter, &prev_filter); + if (prev_filter) IMessageFilter_Release(prev_filter); + ok(hr == S_OK, "got %08x\n", hr); + } + + hr = CoMarshalInterface(data->stream, &data->iid, data->object, MSHCTX_INPROC, NULL, data->marshal_flags); + ok(hr == S_OK, "got %08x\n", hr); + + /* force the message queue to be created before signaling parent thread */ + PeekMessageA(&msg, NULL, WM_USER, WM_USER, PM_NOREMOVE); + + SetEvent(data->marshal_event); + + while (GetMessageA(&msg, NULL, 0, 0)) + { + if (msg.hwnd == NULL && msg.message == RELEASEMARSHALDATA) + { + CoReleaseMarshalData(data->stream); + SetEvent((HANDLE)msg.lParam); + } + else + DispatchMessageA(&msg); + } + + HeapFree(GetProcessHeap(), 0, data); + + CoUninitialize(); + + return hr; +} + +static DWORD start_host_object2(IStream *stream, REFIID riid, IUnknown *object, MSHLFLAGS marshal_flags, IMessageFilter *filter, HANDLE *thread) +{ + DWORD tid = 0; + HANDLE marshal_event = CreateEventA(NULL, FALSE, FALSE, NULL); + struct host_object_data *data = HeapAlloc(GetProcessHeap(), 0, sizeof(*data)); + + data->stream = stream; + data->iid = *riid; + data->object = object; + data->marshal_flags = marshal_flags; + data->marshal_event = marshal_event; + data->filter = filter; + + *thread = CreateThread(NULL, 0, host_object_proc, data, 0, &tid); + + /* wait for marshaling to complete before returning */ + ok( !WaitForSingleObject(marshal_event, 10000), "wait timed out\n" ); + CloseHandle(marshal_event); + + return tid; +} + +static void end_host_object(DWORD tid, HANDLE thread) +{ + BOOL ret = PostThreadMessageA(tid, WM_QUIT, 0, 0); + ok(ret, "PostThreadMessage failed with error %d\n", GetLastError()); + /* be careful of races - don't return until hosting thread has terminated */ + ok( !WaitForSingleObject(thread, 10000), "wait timed out\n" ); + CloseHandle(thread); } static const char cf_marshaled[] = @@ -533,6 +618,17 @@ Test_IUnknown_Release, }; +struct test_stream +{ + IStream IStream_iface; + LONG refs; +}; + +static inline struct test_stream *impl_from_IStream(IStream *iface) +{ + return CONTAINING_RECORD(iface, struct test_stream, IStream_iface); +} + static HRESULT WINAPI Test_IStream_QueryInterface(IStream *iface, REFIID riid, LPVOID *ppvObj) { @@ -552,12 +648,14 @@ static ULONG WINAPI Test_IStream_AddRef(IStream *iface) { - return 2; /* non-heap-based object */ + struct test_stream *This = impl_from_IStream(iface); + return InterlockedIncrement(&This->refs); } static ULONG WINAPI Test_IStream_Release(IStream *iface) { - return 1; /* non-heap-based object */ + struct test_stream *This = impl_from_IStream(iface); + return InterlockedDecrement(&This->refs); } static const IStreamVtbl TestStream_Vtbl = @@ -569,13 +667,15 @@ }; static TestUnknown Test_Unknown = { {&TestUnknown_Vtbl}, 1 }; -static IStream Test_Stream = { &TestStream_Vtbl }; +static TestUnknown Test_Unknown2 = { {&TestUnknown_Vtbl}, 1 }; +static struct test_stream Test_Stream = { {&TestStream_Vtbl}, 1 }; +static struct test_stream Test_Stream2 = { {&TestStream_Vtbl}, 1 }; ULONG __RPC_USER WdtpInterfacePointer_UserSize(ULONG *, ULONG, ULONG, IUnknown *, REFIID); unsigned char * __RPC_USER WdtpInterfacePointer_UserMarshal(ULONG *, ULONG, unsigned char *, IUnknown *, REFIID); unsigned char * __RPC_USER WdtpInterfacePointer_UserUnmarshal(ULONG *, unsigned char *, IUnknown **, REFIID); -static void marshal_WdtpInterfacePointer(DWORD umcb_ctx, DWORD ctx) +static void marshal_WdtpInterfacePointer(DWORD umcb_ctx, DWORD ctx, BOOL client, BOOL in, BOOL out) { USER_MARSHAL_CB umcb; MIDL_STUB_MESSAGE stub_msg; @@ -644,11 +744,17 @@ CoReleaseMarshalData(stm); IStream_Release(stm); - unk2 = NULL; + Test_Unknown2.refs = 1; + unk2 = &Test_Unknown2.IUnknown_iface; init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, buffer, size, umcb_ctx); + umcb.pStubMsg->IsClient = client; + umcb.pStubMsg->fIsIn = in; + umcb.pStubMsg->fIsOut = out; + WdtpInterfacePointer_UserUnmarshal(&umcb.Flags, buffer, &unk2, &IID_IUnknown); ok(unk2 != NULL, "IUnknown object didn't unmarshal properly\n"); ok(Test_Unknown.refs == 2, "got %d\n", Test_Unknown.refs); + ok(Test_Unknown2.refs == 0, "got %d\n", Test_Unknown2.refs); HeapFree(GetProcessHeap(), 0, buffer); init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, NULL, 0, MSHCTX_INPROC); IUnknown_Release(unk2); @@ -663,17 +769,26 @@ */ /* All three are marshalled as inproc */ - marshal_WdtpInterfacePointer(MSHCTX_INPROC, MSHCTX_INPROC); - marshal_WdtpInterfacePointer(MSHCTX_DIFFERENTMACHINE, MSHCTX_INPROC); - marshal_WdtpInterfacePointer(MSHCTX_INPROC, MAKELONG(MSHCTX_INPROC, 0xffff)); + marshal_WdtpInterfacePointer(MSHCTX_INPROC, MSHCTX_INPROC, 0,0,0); + marshal_WdtpInterfacePointer(MSHCTX_DIFFERENTMACHINE, MSHCTX_INPROC,0,0,0); + marshal_WdtpInterfacePointer(MSHCTX_INPROC, MAKELONG(MSHCTX_INPROC, 0xffff),0,0,0); /* All three are marshalled as remote */ - marshal_WdtpInterfacePointer(MSHCTX_INPROC, MSHCTX_DIFFERENTMACHINE); - marshal_WdtpInterfacePointer(MSHCTX_DIFFERENTMACHINE, MSHCTX_DIFFERENTMACHINE); - marshal_WdtpInterfacePointer(MSHCTX_INPROC, MAKELONG(MSHCTX_DIFFERENTMACHINE, 0xffff)); -} - -static void test_marshal_STGMEDIUM(void) + marshal_WdtpInterfacePointer(MSHCTX_INPROC, MSHCTX_DIFFERENTMACHINE,0,0,0); + marshal_WdtpInterfacePointer(MSHCTX_DIFFERENTMACHINE, MSHCTX_DIFFERENTMACHINE,0,0,0); + marshal_WdtpInterfacePointer(MSHCTX_INPROC, MAKELONG(MSHCTX_DIFFERENTMACHINE, 0xffff),0,0,0); + + /* Test different combinations of client, in and out */ + marshal_WdtpInterfacePointer(MSHCTX_INPROC, MSHCTX_DIFFERENTMACHINE,0,0,1); + marshal_WdtpInterfacePointer(MSHCTX_INPROC, MSHCTX_DIFFERENTMACHINE,0,1,0); + marshal_WdtpInterfacePointer(MSHCTX_INPROC, MSHCTX_DIFFERENTMACHINE,0,1,1); + marshal_WdtpInterfacePointer(MSHCTX_INPROC, MSHCTX_DIFFERENTMACHINE,1,0,0); + marshal_WdtpInterfacePointer(MSHCTX_INPROC, MSHCTX_DIFFERENTMACHINE,1,0,1); + marshal_WdtpInterfacePointer(MSHCTX_INPROC, MSHCTX_DIFFERENTMACHINE,1,1,0); + marshal_WdtpInterfacePointer(MSHCTX_INPROC, MSHCTX_DIFFERENTMACHINE,1,1,1); +} + +static void marshal_STGMEDIUM(BOOL client, BOOL in, BOOL out) { USER_MARSHAL_CB umcb; MIDL_STUB_MESSAGE stub_msg; @@ -682,13 +797,17 @@ ULONG size, expect_size; STGMEDIUM med, med2; IUnknown *unk = &Test_Unknown.IUnknown_iface; - IStream *stm = &Test_Stream; + IStream *stm = &Test_Stream.IStream_iface; /* TYMED_NULL with pUnkForRelease */ + + Test_Unknown.refs = 1; init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, NULL, 0, MSHCTX_DIFFERENTMACHINE); expect_size = WdtpInterfacePointer_UserSize(&umcb.Flags, umcb.Flags, 2 * sizeof(DWORD), unk, &IID_IUnknown); expect_buffer = HeapAlloc(GetProcessHeap(), 0, expect_size); + *(DWORD*)expect_buffer = TYMED_NULL; + *((DWORD*)expect_buffer + 1) = 0xdeadbeef; init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, expect_buffer, expect_size, MSHCTX_DIFFERENTMACHINE); expect_buffer_end = WdtpInterfacePointer_UserMarshal(&umcb.Flags, umcb.Flags, expect_buffer + 2 * sizeof(DWORD), unk, &IID_IUnknown); @@ -709,25 +828,41 @@ ok(!memcmp(buffer+8, expect_buffer + 8, expect_buffer_end - expect_buffer - 8), "buffer mismatch\n"); init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, buffer, size, MSHCTX_DIFFERENTMACHINE); - - /* native crashes if this is uninitialised, presumably because it - tries to release it */ + umcb.pStubMsg->IsClient = client; + umcb.pStubMsg->fIsIn = in; + umcb.pStubMsg->fIsOut = out; + + Test_Unknown2.refs = 1; + med2.tymed = TYMED_NULL; + U(med2).pstm = NULL; + med2.pUnkForRelease = &Test_Unknown2.IUnknown_iface; + + STGMEDIUM_UserUnmarshal(&umcb.Flags, buffer, &med2); + + ok(med2.tymed == TYMED_NULL, "got tymed %x\n", med2.tymed); + ok(med2.pUnkForRelease != NULL, "Incorrectly unmarshalled\n"); + ok(Test_Unknown2.refs == 0, "got %d\n", Test_Unknown2.refs); + + HeapFree(GetProcessHeap(), 0, buffer); + init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, NULL, 0, MSHCTX_DIFFERENTMACHINE); + STGMEDIUM_UserFree(&umcb.Flags, &med2); + + init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, expect_buffer, expect_size, MSHCTX_DIFFERENTMACHINE); med2.tymed = TYMED_NULL; U(med2).pstm = NULL; med2.pUnkForRelease = NULL; - - STGMEDIUM_UserUnmarshal(&umcb.Flags, buffer, &med2); - - ok(med2.tymed == TYMED_NULL, "got tymed %x\n", med2.tymed); - ok(med2.pUnkForRelease != NULL, "Incorrectly unmarshalled\n"); - - HeapFree(GetProcessHeap(), 0, buffer); + STGMEDIUM_UserUnmarshal(&umcb.Flags, expect_buffer, &med2); init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, NULL, 0, MSHCTX_DIFFERENTMACHINE); STGMEDIUM_UserFree(&umcb.Flags, &med2); + ok(Test_Unknown.refs == 1, "got %d\n", Test_Unknown.refs); + HeapFree(GetProcessHeap(), 0, expect_buffer); /* TYMED_ISTREAM with pUnkForRelease */ + + Test_Unknown.refs = 1; + Test_Stream.refs = 1; init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, NULL, 0, MSHCTX_DIFFERENTMACHINE); expect_size = WdtpInterfacePointer_UserSize(&umcb.Flags, umcb.Flags, 3 * sizeof(DWORD), (IUnknown*)stm, &IID_IStream); @@ -736,6 +871,9 @@ expect_buffer = HeapAlloc(GetProcessHeap(), 0, expect_size); /* There may be a hole between the two interfaces so init the buffer to something */ memset(expect_buffer, 0xcc, expect_size); + *(DWORD*)expect_buffer = TYMED_ISTREAM; + *((DWORD*)expect_buffer + 1) = 0xdeadbeef; + *((DWORD*)expect_buffer + 2) = 0xcafe; init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, expect_buffer, expect_size, MSHCTX_DIFFERENTMACHINE); expect_buffer_end = WdtpInterfacePointer_UserMarshal(&umcb.Flags, umcb.Flags, expect_buffer + 3 * sizeof(DWORD), (IUnknown*)stm, &IID_IStream); expect_buffer_end = WdtpInterfacePointer_UserMarshal(&umcb.Flags, umcb.Flags, expect_buffer_end, unk, &IID_IUnknown); @@ -759,24 +897,98 @@ ok(!memcmp(buffer + 12, expect_buffer + 12, (buffer_end - buffer) - 12), "buffer mismatch\n"); init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, buffer, size, MSHCTX_DIFFERENTMACHINE); - - /* native crashes if this is uninitialised, presumably because it - tries to release it */ + umcb.pStubMsg->IsClient = client; + umcb.pStubMsg->fIsIn = in; + umcb.pStubMsg->fIsOut = out; + + Test_Stream2.refs = 1; + Test_Unknown2.refs = 1; + med2.tymed = TYMED_ISTREAM; + U(med2).pstm = &Test_Stream2.IStream_iface; + med2.pUnkForRelease = &Test_Unknown2.IUnknown_iface; + + STGMEDIUM_UserUnmarshal(&umcb.Flags, buffer, &med2); + + ok(med2.tymed == TYMED_ISTREAM, "got tymed %x\n", med2.tymed); + ok(U(med2).pstm != NULL, "Incorrectly unmarshalled\n"); + ok(med2.pUnkForRelease != NULL, "Incorrectly unmarshalled\n"); + ok(Test_Stream2.refs == 0, "got %d\n", Test_Stream2.refs); + ok(Test_Unknown2.refs == 0, "got %d\n", Test_Unknown2.refs); + + HeapFree(GetProcessHeap(), 0, buffer); + init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, NULL, 0, MSHCTX_DIFFERENTMACHINE); + STGMEDIUM_UserFree(&umcb.Flags, &med2); + + init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, expect_buffer, expect_size, MSHCTX_DIFFERENTMACHINE); med2.tymed = TYMED_NULL; U(med2).pstm = NULL; med2.pUnkForRelease = NULL; + STGMEDIUM_UserUnmarshal(&umcb.Flags, expect_buffer, &med2); + init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, NULL, 0, MSHCTX_DIFFERENTMACHINE); + STGMEDIUM_UserFree(&umcb.Flags, &med2); + + ok(Test_Unknown.refs == 1, "got %d\n", Test_Unknown.refs); + ok(Test_Stream.refs == 1, "got %d\n", Test_Stream.refs); + + HeapFree(GetProcessHeap(), 0, expect_buffer); + + /* TYMED_ISTREAM = NULL with pUnkForRelease = NULL */ + + init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, NULL, 0, MSHCTX_DIFFERENTMACHINE); + expect_size = 3 * sizeof(DWORD); + + med.tymed = TYMED_ISTREAM; + U(med).pstm = NULL; + med.pUnkForRelease = NULL; + + init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, NULL, 0, MSHCTX_DIFFERENTMACHINE); + size = STGMEDIUM_UserSize(&umcb.Flags, 0, &med); + ok(size == expect_size, "size %d should be %d bytes\n", size, expect_size); + + buffer = HeapAlloc(GetProcessHeap(), 0, size); + memset(buffer, 0xcc, size); + init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, buffer, size, MSHCTX_DIFFERENTMACHINE); + buffer_end = STGMEDIUM_UserMarshal(&umcb.Flags, buffer, &med); + ok(buffer_end - buffer == expect_size, "buffer size mismatch\n"); + ok(*(DWORD*)buffer == TYMED_ISTREAM, "got %08x\n", *(DWORD*)buffer); + ok(*((DWORD*)buffer+1) == 0, "got %08x\n", *((DWORD*)buffer+1)); + ok(*((DWORD*)buffer+2) == 0, "got %08x\n", *((DWORD*)buffer+2)); + + init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, buffer, size, MSHCTX_DIFFERENTMACHINE); + umcb.pStubMsg->IsClient = client; + umcb.pStubMsg->fIsIn = in; + umcb.pStubMsg->fIsOut = out; + + Test_Stream2.refs = 1; + Test_Unknown2.refs = 1; + med2.tymed = TYMED_ISTREAM; + U(med2).pstm = &Test_Stream2.IStream_iface; + med2.pUnkForRelease = &Test_Unknown2.IUnknown_iface; STGMEDIUM_UserUnmarshal(&umcb.Flags, buffer, &med2); ok(med2.tymed == TYMED_ISTREAM, "got tymed %x\n", med2.tymed); - ok(U(med2).pstm != NULL, "Incorrectly unmarshalled\n"); - ok(med2.pUnkForRelease != NULL, "Incorrectly unmarshalled\n"); + ok(U(med2).pstm == NULL, "Incorrectly unmarshalled\n"); + ok(med2.pUnkForRelease == &Test_Unknown2.IUnknown_iface, "Incorrectly unmarshalled\n"); + ok(Test_Stream2.refs == 0, "got %d\n", Test_Stream2.refs); + ok(Test_Unknown2.refs == 1, "got %d\n", Test_Unknown2.refs); HeapFree(GetProcessHeap(), 0, buffer); init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, NULL, 0, MSHCTX_DIFFERENTMACHINE); STGMEDIUM_UserFree(&umcb.Flags, &med2); - - HeapFree(GetProcessHeap(), 0, expect_buffer); +} + +static void test_marshal_STGMEDIUM(void) +{ + marshal_STGMEDIUM(0, 0, 0); + marshal_STGMEDIUM(0, 0, 1); + marshal_STGMEDIUM(0, 1, 0); + marshal_STGMEDIUM(0, 1, 1); + /* For Windows versions post 2003, client side, non-[in,out] STGMEDIUMs get zero-initialised. + However since inline stubs don't set fIsIn or fIsOut this behaviour would break + ref counting in GetDataHere_Proxy for example, as we'd end up not releasing the original + interface. For simplicity we don't test or implement this. */ + marshal_STGMEDIUM(1, 1, 1); } static void test_marshal_SNB(void) @@ -984,9 +1196,156 @@ DeleteObject(hBrush); } +struct obj +{ + IDataObject IDataObject_iface; +}; + +static HRESULT WINAPI obj_QueryInterface(IDataObject *iface, REFIID iid, void **obj) +{ + *obj = NULL; + + if (IsEqualGUID(iid, &IID_IUnknown) || + IsEqualGUID(iid, &IID_IDataObject)) + *obj = iface; + + if (*obj) + { + IDataObject_AddRef(iface); + return S_OK; + } + + return E_NOINTERFACE; +} + +static ULONG WINAPI obj_AddRef(IDataObject *iface) +{ + return 2; +} + +static ULONG WINAPI obj_Release(IDataObject *iface) +{ + return 1; +} + +static HRESULT WINAPI obj_DO_GetDataHere(IDataObject *iface, FORMATETC *fmt, + STGMEDIUM *med) +{ + ok( med->pUnkForRelease == NULL, "got %p\n", med->pUnkForRelease ); + + if (fmt->cfFormat == 2) + { + IStream_Release(U(med)->pstm); + U(med)->pstm = &Test_Stream2.IStream_iface; + } + + return S_OK; +} + +static const IDataObjectVtbl obj_data_object_vtbl = +{ + obj_QueryInterface, + obj_AddRef, + obj_Release, + NULL, /* GetData */ + obj_DO_GetDataHere, + NULL, /* QueryGetData */ + NULL, /* GetCanonicalFormatEtc */ + NULL, /* SetData */ + NULL, /* EnumFormatEtc */ + NULL, /* DAdvise */ + NULL, /* DUnadvise */ + NULL /* EnumDAdvise */ +}; + +static struct obj obj = +{ + {&obj_data_object_vtbl} +}; + +static void test_GetDataHere_Proxy(void) +{ + HRESULT hr; + IStream *stm; + HANDLE thread; + DWORD tid; + static const LARGE_INTEGER zero; + IDataObject *data; + FORMATETC fmt; + STGMEDIUM med; + + hr = CreateStreamOnHGlobal( NULL, TRUE, &stm ); + ok( hr == S_OK, "got %08x\n", hr ); + tid = start_host_object2( stm, &IID_IDataObject, (IUnknown *)&obj.IDataObject_iface, MSHLFLAGS_NORMAL, NULL, &thread ); + + IStream_Seek( stm, zero, STREAM_SEEK_SET, NULL ); + hr = CoUnmarshalInterface( stm, &IID_IDataObject, (void **)&data ); + ok( hr == S_OK, "got %08x\n", hr ); + IStream_Release( stm ); + + Test_Stream.refs = 1; + Test_Stream2.refs = 1; + Test_Unknown.refs = 1; + + fmt.cfFormat = 1; + fmt.ptd = NULL; + fmt.dwAspect = DVASPECT_CONTENT; + fmt.lindex = -1; + U(med).pstm = NULL; + med.pUnkForRelease = &Test_Unknown.IUnknown_iface; + + fmt.tymed = med.tymed = TYMED_NULL; + hr = IDataObject_GetDataHere( data, &fmt, &med ); + ok( hr == DV_E_TYMED, "got %08x\n", hr ); + + for (fmt.tymed = TYMED_HGLOBAL; fmt.tymed <= TYMED_ENHMF; fmt.tymed <<= 1) + { + med.tymed = fmt.tymed; + hr = IDataObject_GetDataHere( data, &fmt, &med ); + ok( hr == (fmt.tymed <= TYMED_ISTORAGE ? S_OK : DV_E_TYMED), "got %08x for tymed %d\n", hr, fmt.tymed ); + ok( Test_Unknown.refs == 1, "got %d\n", Test_Unknown.refs ); + } + + fmt.tymed = TYMED_ISTREAM; + med.tymed = TYMED_ISTORAGE; + hr = IDataObject_GetDataHere( data, &fmt, &med ); + ok( hr == DV_E_TYMED, "got %08x\n", hr ); + + fmt.tymed = med.tymed = TYMED_ISTREAM; + U(med).pstm = &Test_Stream.IStream_iface; + med.pUnkForRelease = &Test_Unknown.IUnknown_iface; + + hr = IDataObject_GetDataHere( data, &fmt, &med ); + ok( hr == S_OK, "got %08x\n", hr ); + + ok( U(med).pstm == &Test_Stream.IStream_iface, "stm changed\n" ); + ok( med.pUnkForRelease == &Test_Unknown.IUnknown_iface, "punk changed\n" ); + + ok( Test_Stream.refs == 1, "got %d\n", Test_Stream.refs ); + ok( Test_Unknown.refs == 1, "got %d\n", Test_Unknown.refs ); + + fmt.cfFormat = 2; + fmt.tymed = med.tymed = TYMED_ISTREAM; + U(med).pstm = &Test_Stream.IStream_iface; + med.pUnkForRelease = &Test_Unknown.IUnknown_iface; + + hr = IDataObject_GetDataHere( data, &fmt, &med ); + ok( hr == S_OK, "got %08x\n", hr ); + + ok( U(med).pstm == &Test_Stream.IStream_iface, "stm changed\n" ); + ok( med.pUnkForRelease == &Test_Unknown.IUnknown_iface, "punk changed\n" ); + + ok( Test_Stream.refs == 1, "got %d\n", Test_Stream.refs ); + ok( Test_Unknown.refs == 1, "got %d\n", Test_Unknown.refs ); + ok( Test_Stream2.refs == 0, "got %d\n", Test_Stream2.refs ); + + IDataObject_Release( data ); + end_host_object( tid, thread ); +} + START_TEST(usrmarshal) { - CoInitialize(NULL); + CoInitializeEx(NULL, COINIT_APARTMENTTHREADED); test_marshal_CLIPFORMAT(); test_marshal_HWND(); @@ -1001,5 +1360,7 @@ test_marshal_HICON(); test_marshal_HBRUSH(); + test_GetDataHere_Proxy(); + CoUninitialize(); }
9 years, 1 month
1
0
0
0
[akhaldi] 69908: [OLE32] Sync with Wine Staging 1.7.55. CORE-10536
by akhaldi@svn.reactos.org
Author: akhaldi Date: Tue Nov 17 10:30:40 2015 New Revision: 69908 URL:
http://svn.reactos.org/svn/reactos?rev=69908&view=rev
Log: [OLE32] Sync with Wine Staging 1.7.55. CORE-10536 Modified: trunk/reactos/dll/win32/ole32/compobj.c trunk/reactos/dll/win32/ole32/compobj_private.h trunk/reactos/dll/win32/ole32/datacache.c trunk/reactos/dll/win32/ole32/defaulthandler.c trunk/reactos/dll/win32/ole32/filemoniker.c trunk/reactos/dll/win32/ole32/marshal.c trunk/reactos/dll/win32/ole32/ole2.c trunk/reactos/dll/win32/ole32/ole2impl.c trunk/reactos/dll/win32/ole32/ole2stubs.c trunk/reactos/dll/win32/ole32/ole32.spec trunk/reactos/dll/win32/ole32/ole32_main.c trunk/reactos/dll/win32/ole32/rpc.c trunk/reactos/dll/win32/ole32/storage32.c trunk/reactos/dll/win32/ole32/stubmanager.c trunk/reactos/dll/win32/ole32/usrmarshal.c trunk/reactos/media/doc/README.WINE Modified: trunk/reactos/dll/win32/ole32/compobj.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ole32/compobj.c?…
============================================================================== --- trunk/reactos/dll/win32/ole32/compobj.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/ole32/compobj.c [iso-8859-1] Tue Nov 17 10:30:40 2015 @@ -1003,7 +1003,7 @@ * SEE ALSO * CoRegisterClassObject */ -HRESULT WINAPI CoRevokeClassObject( +HRESULT WINAPI DECLSPEC_HOTPATCH CoRevokeClassObject( DWORD dwRegister) { HRESULT hr = E_INVALIDARG; @@ -1851,7 +1851,7 @@ * SEE ALSO * CoUninitialize */ -HRESULT WINAPI CoInitializeEx(LPVOID lpReserved, DWORD dwCoInit) +HRESULT WINAPI DECLSPEC_HOTPATCH CoInitializeEx(LPVOID lpReserved, DWORD dwCoInit) { struct oletls *info = COM_CurrentInfo(); HRESULT hr = S_OK; @@ -1997,6 +1997,7 @@ */ HRESULT WINAPI CoDisconnectObject( LPUNKNOWN lpUnk, DWORD reserved ) { + struct stub_manager *manager; HRESULT hr; IMarshal *marshal; APARTMENT *apt; @@ -2017,7 +2018,13 @@ if (!apt) return CO_E_NOTINITIALIZED; - apartment_disconnectobject(apt, lpUnk); + manager = get_stub_manager_from_object(apt, lpUnk, FALSE); + if (manager) { + stub_manager_disconnect(manager); + /* Release stub manager twice, to remove the apartment reference. */ + stub_manager_int_release(manager); + stub_manager_int_release(manager); + } /* Note: native is pretty broken here because it just silently * fails, without returning an appropriate error code if the object was @@ -3158,10 +3165,8 @@ REFIID iid, LPVOID *ppv) { + MULTI_QI multi_qi = { iid }; HRESULT hres; - LPCLASSFACTORY lpclf = 0; - APARTMENT *apt; - CLSID clsid; TRACE("(rclsid=%s, pUnkOuter=%p, dwClsContext=%08x, riid=%s, ppv=%p)\n", debugstr_guid(rclsid), pUnkOuter, dwClsContext, debugstr_guid(iid), ppv); @@ -3169,65 +3174,8 @@ if (ppv==0) return E_POINTER; - hres = CoGetTreatAsClass(rclsid, &clsid); - if(FAILED(hres)) - clsid = *rclsid; - - *ppv = 0; - - if (!(apt = COM_CurrentApt())) - { - if (!(apt = apartment_find_multi_threaded())) - { - ERR("apartment not initialised\n"); - return CO_E_NOTINITIALIZED; - } - apartment_release(apt); - } - - /* - * The Standard Global Interface Table (GIT) object is a process-wide singleton. - */ - if (IsEqualIID(&clsid, &CLSID_StdGlobalInterfaceTable)) - { - IGlobalInterfaceTable *git = get_std_git(); - hres = IGlobalInterfaceTable_QueryInterface(git, iid, ppv); - if (hres != S_OK) return hres; - - TRACE("Retrieved GIT (%p)\n", *ppv); - return S_OK; - } - - if (IsEqualCLSID(&clsid, &CLSID_ManualResetEvent)) - return ManualResetEvent_Construct(pUnkOuter, iid, ppv); - - /* - * Get a class factory to construct the object we want. - */ - hres = CoGetClassObject(&clsid, - dwClsContext, - NULL, - &IID_IClassFactory, - (LPVOID)&lpclf); - - if (FAILED(hres)) - return hres; - - /* - * Create the object and don't forget to release the factory - */ - hres = IClassFactory_CreateInstance(lpclf, pUnkOuter, iid, ppv); - IClassFactory_Release(lpclf); - if (FAILED(hres)) - { - if (hres == CLASS_E_NOAGGREGATION && pUnkOuter) - FIXME("Class %s does not support aggregation\n", debugstr_guid(&clsid)); - else - FIXME("no instance created for interface %s of class %s, hres is 0x%08x\n", - debugstr_guid(iid), - debugstr_guid(&clsid),hres); - } - + hres = CoCreateInstanceEx(rclsid, pUnkOuter, dwClsContext, NULL, 1, &multi_qi); + *ppv = multi_qi.pItf; return hres; } @@ -3242,18 +3190,26 @@ } } -static HRESULT return_multi_qi(IUnknown *unk, DWORD count, MULTI_QI *mqi) -{ - ULONG index, fetched = 0; - - for (index = 0; index < count; index++) +static HRESULT return_multi_qi(IUnknown *unk, DWORD count, MULTI_QI *mqi, BOOL include_unk) +{ + ULONG index = 0, fetched = 0; + + if (include_unk) + { + mqi[0].hr = S_OK; + mqi[0].pItf = unk; + index = fetched = 1; + } + + for (; index < count; index++) { mqi[index].hr = IUnknown_QueryInterface(unk, mqi[index].pIID, (void**)&mqi[index].pItf); if (mqi[index].hr == S_OK) fetched++; } - IUnknown_Release(unk); + if (!include_unk) + IUnknown_Release(unk); if (fetched == 0) return E_NOINTERFACE; @@ -3272,39 +3228,83 @@ ULONG cmq, MULTI_QI* pResults) { - IUnknown* pUnk = NULL; - HRESULT hr; - - /* - * Sanity check - */ - if ( (cmq==0) || (pResults==NULL)) - return E_INVALIDARG; - - if (pServerInfo!=NULL) - FIXME("() non-NULL pServerInfo not supported!\n"); - - init_multi_qi(cmq, pResults); - - /* - * Get the object and get its IUnknown pointer. - */ - hr = CoCreateInstance(rclsid, - pUnkOuter, - dwClsContext, - &IID_IUnknown, - (VOID**)&pUnk); - - if (hr != S_OK) - return hr; - - return return_multi_qi(pUnk, cmq, pResults); + IUnknown *unk = NULL; + IClassFactory *cf; + APARTMENT *apt; + CLSID clsid; + HRESULT hres; + + TRACE("(%s %p %x %p %u %p)\n", debugstr_guid(rclsid), pUnkOuter, dwClsContext, pServerInfo, cmq, pResults); + + if (!cmq || !pResults) + return E_INVALIDARG; + + if (pServerInfo) + FIXME("() non-NULL pServerInfo not supported!\n"); + + init_multi_qi(cmq, pResults); + + hres = CoGetTreatAsClass(rclsid, &clsid); + if(FAILED(hres)) + clsid = *rclsid; + + if (!(apt = COM_CurrentApt())) + { + if (!(apt = apartment_find_multi_threaded())) + { + ERR("apartment not initialised\n"); + return CO_E_NOTINITIALIZED; + } + apartment_release(apt); + } + + /* + * The Standard Global Interface Table (GIT) object is a process-wide singleton. + */ + if (IsEqualIID(&clsid, &CLSID_StdGlobalInterfaceTable)) + { + IGlobalInterfaceTable *git = get_std_git(); + TRACE("Retrieving GIT\n"); + return return_multi_qi((IUnknown*)git, cmq, pResults, FALSE); + } + + if (IsEqualCLSID(&clsid, &CLSID_ManualResetEvent)) { + hres = ManualResetEvent_Construct(pUnkOuter, pResults[0].pIID, (void**)&unk); + if (FAILED(hres)) + return hres; + return return_multi_qi(unk, cmq, pResults, TRUE); + } + + /* + * Get a class factory to construct the object we want. + */ + hres = CoGetClassObject(&clsid, dwClsContext, NULL, &IID_IClassFactory, (void**)&cf); + if (FAILED(hres)) + return hres; + + /* + * Create the object and don't forget to release the factory + */ + hres = IClassFactory_CreateInstance(cf, pUnkOuter, pResults[0].pIID, (void**)&unk); + IClassFactory_Release(cf); + if (FAILED(hres)) + { + if (hres == CLASS_E_NOAGGREGATION && pUnkOuter) + FIXME("Class %s does not support aggregation\n", debugstr_guid(&clsid)); + else + FIXME("no instance created for interface %s of class %s, hres is 0x%08x\n", + debugstr_guid(pResults[0].pIID), + debugstr_guid(&clsid),hres); + return hres; + } + + return return_multi_qi(unk, cmq, pResults, TRUE); } /*********************************************************************** * CoGetInstanceFromFile [OLE32.@] */ -HRESULT WINAPI CoGetInstanceFromFile( +HRESULT WINAPI DECLSPEC_HOTPATCH CoGetInstanceFromFile( COSERVERINFO *server_info, CLSID *rclsid, IUnknown *outer, @@ -3361,7 +3361,7 @@ IPersistFile_Release(pf); } - return return_multi_qi(unk, count, results); + return return_multi_qi(unk, count, results, FALSE); } /*********************************************************************** @@ -3424,7 +3424,7 @@ IPersistStorage_Release(ps); } - return return_multi_qi(unk, count, results); + return return_multi_qi(unk, count, results, FALSE); } /*********************************************************************** @@ -3583,32 +3583,8 @@ apt = COM_CurrentApt(); if (!apt) return CO_E_NOTINITIALIZED; - stubmgr = get_stub_manager_from_object(apt, pUnk); - - if (stubmgr) - { - if (fLock) - stub_manager_ext_addref(stubmgr, 1, FALSE); - else - stub_manager_ext_release(stubmgr, 1, FALSE, fLastUnlockReleases); - - stub_manager_int_release(stubmgr); - - return S_OK; - } - else if (fLock) - { - stubmgr = new_stub_manager(apt, pUnk); - - if (stubmgr) - { - stub_manager_ext_addref(stubmgr, 1, FALSE); - stub_manager_int_release(stubmgr); - } - - return S_OK; - } - else + stubmgr = get_stub_manager_from_object(apt, pUnk, fLock); + if (!stubmgr) { WARN("stub object not found %p\n", pUnk); /* Note: native is pretty broken here because it just silently @@ -3616,6 +3592,14 @@ * think that the object was disconnected, when it actually wasn't */ return S_OK; } + + if (fLock) + stub_manager_ext_addref(stubmgr, 1, FALSE); + else + stub_manager_ext_release(stubmgr, 1, FALSE, fLastUnlockReleases); + + stub_manager_int_release(stubmgr); + return S_OK; } /*********************************************************************** @@ -4366,7 +4350,7 @@ static BOOL COM_PeekMessage(struct apartment *apt, MSG *msg) { /* first try to retrieve messages for incoming COM calls to the apartment window */ - return PeekMessageW(msg, apt->win, 0, 0, PM_REMOVE|PM_NOYIELD) || + return (apt->win && PeekMessageW(msg, apt->win, 0, 0, PM_REMOVE|PM_NOYIELD)) || /* next retrieve other messages necessary for the app to remain responsive */ PeekMessageW(msg, NULL, WM_DDE_FIRST, WM_DDE_LAST, PM_REMOVE|PM_NOYIELD) || PeekMessageW(msg, NULL, 0, 0, PM_QS_PAINT|PM_QS_SENDMESSAGE|PM_REMOVE|PM_NOYIELD); Modified: trunk/reactos/dll/win32/ole32/compobj_private.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ole32/compobj_pr…
============================================================================== --- trunk/reactos/dll/win32/ole32/compobj_private.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/ole32/compobj_private.h [iso-8859-1] Tue Nov 17 10:30:40 2015 @@ -96,6 +96,7 @@ */ ULONG norm_refs; /* refcount of normal marshals (CS lock) */ + BOOL disconnected; /* CoDisconnectObject has been called (CS lock) */ }; /* imported interface proxy */ @@ -174,18 +175,19 @@ /* Stub Manager */ ULONG stub_manager_int_release(struct stub_manager *This) DECLSPEC_HIDDEN; -struct stub_manager *new_stub_manager(APARTMENT *apt, IUnknown *object) DECLSPEC_HIDDEN; ULONG stub_manager_ext_addref(struct stub_manager *m, ULONG refs, BOOL tableweak) DECLSPEC_HIDDEN; ULONG stub_manager_ext_release(struct stub_manager *m, ULONG refs, BOOL tableweak, BOOL last_unlock_releases) DECLSPEC_HIDDEN; -struct ifstub *stub_manager_new_ifstub(struct stub_manager *m, IRpcStubBuffer *sb, IUnknown *iptr, REFIID iid, +struct ifstub *stub_manager_new_ifstub(struct stub_manager *m, IRpcStubBuffer *sb, REFIID iid, DWORD dest_context, void *dest_context_data, MSHLFLAGS flags) DECLSPEC_HIDDEN; struct ifstub *stub_manager_find_ifstub(struct stub_manager *m, REFIID iid, MSHLFLAGS flags) DECLSPEC_HIDDEN; struct stub_manager *get_stub_manager(APARTMENT *apt, OID oid) DECLSPEC_HIDDEN; -struct stub_manager *get_stub_manager_from_object(APARTMENT *apt, void *object) DECLSPEC_HIDDEN; +struct stub_manager *get_stub_manager_from_object(APARTMENT *apt, IUnknown *object, BOOL alloc) DECLSPEC_HIDDEN; BOOL stub_manager_notify_unmarshal(struct stub_manager *m, const IPID *ipid) DECLSPEC_HIDDEN; BOOL stub_manager_is_table_marshaled(struct stub_manager *m, const IPID *ipid) DECLSPEC_HIDDEN; void stub_manager_release_marshal_data(struct stub_manager *m, ULONG refs, const IPID *ipid, BOOL tableweak) DECLSPEC_HIDDEN; -HRESULT ipid_get_dispatch_params(const IPID *ipid, APARTMENT **stub_apt, IRpcStubBuffer **stub, IRpcChannelBuffer **chan, IID *iid, IUnknown **iface) DECLSPEC_HIDDEN; +void stub_manager_disconnect(struct stub_manager *m) DECLSPEC_HIDDEN; +HRESULT ipid_get_dispatch_params(const IPID *ipid, APARTMENT **stub_apt, struct stub_manager **manager, IRpcStubBuffer **stub, + IRpcChannelBuffer **chan, IID *iid, IUnknown **iface) DECLSPEC_HIDDEN; HRESULT start_apartment_remote_unknown(void) DECLSPEC_HIDDEN; HRESULT marshal_object(APARTMENT *apt, STDOBJREF *stdobjref, REFIID riid, IUnknown *obj, DWORD dest_context, void *dest_context_data, MSHLFLAGS mshlflags) DECLSPEC_HIDDEN; @@ -202,7 +204,7 @@ HRESULT RPC_CreateServerChannel(DWORD dest_context, void *dest_context_data, IRpcChannelBuffer **chan) DECLSPEC_HIDDEN; void RPC_ExecuteCall(struct dispatch_params *params) DECLSPEC_HIDDEN; HRESULT RPC_RegisterInterface(REFIID riid) DECLSPEC_HIDDEN; -void RPC_UnregisterInterface(REFIID riid) DECLSPEC_HIDDEN; +void RPC_UnregisterInterface(REFIID riid, BOOL wait) DECLSPEC_HIDDEN; HRESULT RPC_StartLocalServer(REFCLSID clsid, IStream *stream, BOOL multi_use, void **registration) DECLSPEC_HIDDEN; void RPC_StopLocalServer(void *registration) DECLSPEC_HIDDEN; HRESULT RPC_GetLocalClassObject(REFCLSID rclsid, REFIID iid, LPVOID *ppv) DECLSPEC_HIDDEN; @@ -225,7 +227,6 @@ APARTMENT *apartment_findfromtid(DWORD tid) DECLSPEC_HIDDEN; DWORD apartment_release(struct apartment *apt) DECLSPEC_HIDDEN; HRESULT apartment_disconnectproxies(struct apartment *apt) DECLSPEC_HIDDEN; -void apartment_disconnectobject(struct apartment *apt, void *object) DECLSPEC_HIDDEN; static inline HRESULT apartment_getoxid(const struct apartment *apt, OXID *oxid) { *oxid = apt->oxid; @@ -306,6 +307,8 @@ extern BOOL actctx_get_miscstatus(const CLSID*, DWORD, DWORD*) DECLSPEC_HIDDEN; +extern const char *debugstr_formatetc(const FORMATETC *formatetc) DECLSPEC_HIDDEN; + static inline void *heap_alloc(size_t len) { return HeapAlloc(GetProcessHeap(), 0, len); Modified: trunk/reactos/dll/win32/ole32/datacache.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ole32/datacache.…
============================================================================== --- trunk/reactos/dll/win32/ole32/datacache.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/ole32/datacache.c [iso-8859-1] Tue Nov 17 10:30:40 2015 @@ -202,7 +202,7 @@ return CONTAINING_RECORD(iface, DataCache, IAdviseSink_iface); } -static const char * debugstr_formatetc(const FORMATETC *formatetc) +const char *debugstr_formatetc(const FORMATETC *formatetc) { return wine_dbg_sprintf("{ cfFormat = 0x%x, ptd = %p, dwAspect = %d, lindex = %d, tymed = %d }", formatetc->cfFormat, formatetc->ptd, formatetc->dwAspect, @@ -268,10 +268,10 @@ /* 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 */ -static HRESULT check_valid_clipformat_and_tymed(CLIPFORMAT cfFormat, DWORD tymed) +static HRESULT check_valid_clipformat_and_tymed(CLIPFORMAT cfFormat, DWORD tymed, BOOL load) { if (!cfFormat || !tymed || - (cfFormat == CF_METAFILEPICT && tymed == TYMED_MFPICT) || + (cfFormat == CF_METAFILEPICT && (tymed == TYMED_MFPICT || load)) || (cfFormat == CF_BITMAP && tymed == TYMED_GDI) || (cfFormat == CF_DIB && tymed == TYMED_HGLOBAL) || (cfFormat == CF_ENHMETAFILE && tymed == TYMED_ENHMF)) @@ -285,11 +285,11 @@ } } -static HRESULT DataCache_CreateEntry(DataCache *This, const FORMATETC *formatetc, DataCacheEntry **cache_entry) +static HRESULT DataCache_CreateEntry(DataCache *This, const FORMATETC *formatetc, DataCacheEntry **cache_entry, BOOL load) { HRESULT hr; - hr = check_valid_clipformat_and_tymed(formatetc->cfFormat, formatetc->tymed); + hr = check_valid_clipformat_and_tymed(formatetc->cfFormat, formatetc->tymed, load); if (FAILED(hr)) return hr; if (hr == CACHE_S_FORMATETC_NOTSUPPORTED) @@ -394,7 +394,7 @@ if (length == -1) { DWORD cf; - hr = IStream_Read(stream, &cf, sizeof(cf), 0); + hr = IStream_Read(stream, &cf, sizeof(cf), &read); if (hr != S_OK || read != sizeof(cf)) return DV_E_CLIPFORMAT; *clipformat = cf; @@ -1245,7 +1245,7 @@ cache_entry = DataCache_GetEntryForFormatEtc( This, fmt ); if (!cache_entry) - hr = DataCache_CreateEntry( This, fmt, &cache_entry ); + hr = DataCache_CreateEntry( This, fmt, &cache_entry, TRUE ); if (SUCCEEDED( hr )) { DataCacheEntry_DiscardData( cache_entry ); @@ -1319,7 +1319,10 @@ if (IsEqualCLSID( &stat.clsid, &CLSID_Picture_Dib )) fmt = &static_dib_fmt; else + { + FIXME("unsupported format %s\n", debugstr_guid( &stat.clsid )); return E_FAIL; + } return add_cache_entry( This, fmt, stm, contents_stream ); } @@ -1351,7 +1354,8 @@ hr = parse_contents_stream( This, pStg, stm ); IStream_Release( stm ); } - else + + if (FAILED(hr)) hr = parse_pres_streams( This, pStg ); if (SUCCEEDED( hr )) @@ -1989,7 +1993,7 @@ return CACHE_S_SAMECACHE; } - hr = DataCache_CreateEntry(This, pformatetc, &cache_entry); + hr = DataCache_CreateEntry(This, pformatetc, &cache_entry, FALSE); if (SUCCEEDED(hr)) { Modified: trunk/reactos/dll/win32/ole32/defaulthandler.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ole32/defaulthan…
============================================================================== --- trunk/reactos/dll/win32/ole32/defaulthandler.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/ole32/defaulthandler.c [iso-8859-1] Tue Nov 17 10:30:40 2015 @@ -61,7 +61,8 @@ enum object_state { object_state_not_running, - object_state_running + object_state_running, + object_state_deferred_close }; /**************************************************************************** @@ -117,6 +118,7 @@ /* IDataObject delegate */ IDataObject *pDataDelegate; enum object_state object_state; + ULONG in_call; /* connection cookie for the advise on the delegate OLE object */ DWORD dwAdvConn; @@ -168,6 +170,20 @@ static inline BOOL object_is_running(DefaultHandler *This) { return IRunnableObject_IsRunning(&This->IRunnableObject_iface); +} + +static void DefaultHandler_Stop(DefaultHandler *This); + +static inline void start_object_call(DefaultHandler *This) +{ + This->in_call++; +} + +static inline void end_object_call(DefaultHandler *This) +{ + This->in_call--; + if (This->in_call == 0 && This->object_state == object_state_deferred_close) + DefaultHandler_Stop( This ); } /********************************************************* @@ -336,7 +352,11 @@ TRACE("(%p, %p)\n", iface, pClientSite); if (object_is_running(This)) + { + start_object_call( This ); hr = IOleObject_SetClientSite(This->pOleDelegate, pClientSite); + end_object_call( This ); + } /* * Make sure we release the previous client site if there @@ -399,7 +419,11 @@ debugstr_w(szContainerObj)); if (object_is_running(This)) + { + start_object_call( This ); IOleObject_SetHostNames(This->pOleDelegate, szContainerApp, szContainerObj); + end_object_call( This ); + } /* Be sure to cleanup before re-assigning the strings. */ HeapFree( GetProcessHeap(), 0, This->containerApp ); @@ -445,17 +469,26 @@ /* undoes the work done by DefaultHandler_Run */ static void DefaultHandler_Stop(DefaultHandler *This) { - if (!object_is_running(This)) + IOleCacheControl *cache_ctrl; + HRESULT hr; + + if (This->object_state == object_state_not_running) return; + hr = IUnknown_QueryInterface( This->dataCache, &IID_IOleCacheControl, (void **)&cache_ctrl ); + if (SUCCEEDED(hr)) + { + hr = IOleCacheControl_OnStop( cache_ctrl ); + IOleCacheControl_Release( cache_ctrl ); + } + IOleObject_Unadvise(This->pOleDelegate, This->dwAdvConn); - - /* FIXME: call IOleCache_OnStop */ if (This->dataAdviseHolder) DataAdviseHolder_OnDisconnect(This->dataAdviseHolder); This->object_state = object_state_not_running; + release_delegates( This ); } /************************************************************************ @@ -478,10 +511,11 @@ if (!object_is_running(This)) return S_OK; + start_object_call( This ); hr = IOleObject_Close(This->pOleDelegate, dwSaveOption); + end_object_call( This ); DefaultHandler_Stop(This); - release_delegates(This); return hr; } @@ -499,16 +533,18 @@ IMoniker* pmk) { DefaultHandler *This = impl_from_IOleObject(iface); - - TRACE("(%p, %d, %p)\n", - iface, - dwWhichMoniker, - pmk); + HRESULT hr = S_OK; + + TRACE("(%p, %d, %p)\n", iface, dwWhichMoniker, pmk); if (object_is_running(This)) - return IOleObject_SetMoniker(This->pOleDelegate, dwWhichMoniker, pmk); - - return S_OK; + { + start_object_call( This ); + hr = IOleObject_SetMoniker(This->pOleDelegate, dwWhichMoniker, pmk); + end_object_call( This ); + } + + return hr; } /************************************************************************ @@ -525,13 +561,19 @@ IMoniker** ppmk) { DefaultHandler *This = impl_from_IOleObject(iface); + HRESULT hr; TRACE("(%p, %d, %d, %p)\n", iface, dwAssign, dwWhichMoniker, ppmk); if (object_is_running(This)) - return IOleObject_GetMoniker(This->pOleDelegate, dwAssign, dwWhichMoniker, - ppmk); + { + start_object_call( This ); + hr = IOleObject_GetMoniker(This->pOleDelegate, dwAssign, dwWhichMoniker, + ppmk); + end_object_call( This ); + return hr; + } /* FIXME: dwWhichMoniker == OLEWHICHMK_CONTAINER only? */ if (This->clientSite) @@ -560,14 +602,20 @@ DWORD dwReserved) { DefaultHandler *This = impl_from_IOleObject(iface); + HRESULT hr = OLE_E_NOTRUNNING; TRACE("(%p, %p, %d, %d)\n", iface, pDataObject, fCreation, dwReserved); if (object_is_running(This)) - return IOleObject_InitFromData(This->pOleDelegate, pDataObject, fCreation, + { + start_object_call( This ); + hr = IOleObject_InitFromData(This->pOleDelegate, pDataObject, fCreation, dwReserved); - return OLE_E_NOTRUNNING; + end_object_call( This ); + } + + return hr; } /************************************************************************ @@ -583,15 +631,20 @@ IDataObject** ppDataObject) { DefaultHandler *This = impl_from_IOleObject(iface); + HRESULT hr = OLE_E_NOTRUNNING; TRACE("(%p, %d, %p)\n", iface, dwReserved, ppDataObject); if (object_is_running(This)) - return IOleObject_GetClipboardData(This->pOleDelegate, dwReserved, + { + start_object_call( This ); + hr = IOleObject_GetClipboardData(This->pOleDelegate, dwReserved, ppDataObject); - - return OLE_E_NOTRUNNING; + end_object_call( This ); + } + + return hr; } static HRESULT WINAPI DefaultHandler_DoVerb( @@ -612,8 +665,12 @@ hr = IRunnableObject_Run(pRunnableObj, NULL); if (FAILED(hr)) return hr; - return IOleObject_DoVerb(This->pOleDelegate, iVerb, lpmsg, pActiveSite, + start_object_call( This ); + hr = IOleObject_DoVerb(This->pOleDelegate, iVerb, lpmsg, pActiveSite, lindex, hwndParent, lprcPosRect); + end_object_call( This ); + + return hr; } /************************************************************************ @@ -634,7 +691,11 @@ TRACE("(%p, %p)\n", iface, ppEnumOleVerb); if (object_is_running(This)) + { + start_object_call( This ); hr = IOleObject_EnumVerbs(This->pOleDelegate, ppEnumOleVerb); + end_object_call( This ); + } if (hr == OLE_S_USEREG) return OleRegEnumVerbs(&This->clsid, ppEnumOleVerb); @@ -646,6 +707,8 @@ IOleObject* iface) { DefaultHandler *This = impl_from_IOleObject(iface); + HRESULT hr; + TRACE("(%p)\n", iface); if (!object_is_running(This)) @@ -653,7 +716,12 @@ FIXME("Should run object\n"); return E_NOTIMPL; } - return IOleObject_Update(This->pOleDelegate); + + start_object_call( This ); + hr = IOleObject_Update(This->pOleDelegate); + end_object_call( This ); + + return hr; } /************************************************************************ @@ -667,12 +735,17 @@ IOleObject* iface) { DefaultHandler *This = impl_from_IOleObject(iface); + HRESULT hr = OLE_E_NOTRUNNING; TRACE("(%p)\n", iface); if (object_is_running(This)) - return IOleObject_IsUpToDate(This->pOleDelegate); - - return OLE_E_NOTRUNNING; + { + start_object_call( This ); + hr = IOleObject_IsUpToDate(This->pOleDelegate); + end_object_call( This ); + } + + return hr; } /************************************************************************ @@ -687,11 +760,17 @@ CLSID* pClsid) { DefaultHandler *This = impl_from_IOleObject(iface); + HRESULT hr; TRACE("(%p, %p)\n", iface, pClsid); if (object_is_running(This)) - return IOleObject_GetUserClassID(This->pOleDelegate, pClsid); + { + start_object_call( This ); + hr = IOleObject_GetUserClassID(This->pOleDelegate, pClsid); + end_object_call( This ); + return hr; + } if (!pClsid) return E_POINTER; @@ -715,10 +794,16 @@ LPOLESTR* pszUserType) { DefaultHandler *This = impl_from_IOleObject(iface); + HRESULT hr; TRACE("(%p, %d, %p)\n", iface, dwFormOfType, pszUserType); if (object_is_running(This)) - return IOleObject_GetUserType(This->pOleDelegate, dwFormOfType, pszUserType); + { + start_object_call( This ); + hr = IOleObject_GetUserType(This->pOleDelegate, dwFormOfType, pszUserType); + end_object_call( This ); + return hr; + } return OleRegGetUserType(&This->clsid, dwFormOfType, pszUserType); } @@ -736,14 +821,19 @@ SIZEL* psizel) { DefaultHandler *This = impl_from_IOleObject(iface); + HRESULT hr = OLE_E_NOTRUNNING; TRACE("(%p, %x, (%d x %d))\n", iface, dwDrawAspect, psizel->cx, psizel->cy); if (object_is_running(This)) - return IOleObject_SetExtent(This->pOleDelegate, dwDrawAspect, psizel); - - return OLE_E_NOTRUNNING; + { + start_object_call( This ); + hr = IOleObject_SetExtent(This->pOleDelegate, dwDrawAspect, psizel); + end_object_call( This ); + } + + return hr; } /************************************************************************ @@ -768,7 +858,12 @@ TRACE("(%p, %x, %p)\n", iface, dwDrawAspect, psizel); if (object_is_running(This)) - return IOleObject_GetExtent(This->pOleDelegate, dwDrawAspect, psizel); + { + start_object_call( This ); + hres = IOleObject_GetExtent(This->pOleDelegate, dwDrawAspect, psizel); + end_object_call( This ); + return hres; + } hres = IUnknown_QueryInterface(This->dataCache, &IID_IViewObject2, (void**)&cacheView); if (FAILED(hres)) @@ -898,7 +993,12 @@ TRACE("(%p, %x, %p)\n", iface, dwAspect, pdwStatus); if (object_is_running(This)) - return IOleObject_GetMiscStatus(This->pOleDelegate, dwAspect, pdwStatus); + { + start_object_call( This ); + hres = IOleObject_GetMiscStatus(This->pOleDelegate, dwAspect, pdwStatus); + end_object_call( This ); + return hres; + } hres = OleRegGetMiscStatus(&This->clsid, dwAspect, pdwStatus); @@ -920,13 +1020,18 @@ struct tagLOGPALETTE* pLogpal) { DefaultHandler *This = impl_from_IOleObject(iface); + HRESULT hr = OLE_E_NOTRUNNING; TRACE("(%p, %p))\n", iface, pLogpal); if (object_is_running(This)) - return IOleObject_SetColorScheme(This->pOleDelegate, pLogpal); - - return OLE_E_NOTRUNNING; + { + start_object_call( This ); + hr = IOleObject_SetColorScheme(This->pOleDelegate, pLogpal); + end_object_call( This ); + } + + return hr; } /********************************************************* @@ -1007,8 +1112,19 @@ IDataObject_Release(cacheDataObject); - if (FAILED(hres) && This->pDataDelegate) + if (hres == S_OK) return hres; + + if (object_is_running( This )) + { + start_object_call(This); hres = IDataObject_GetData(This->pDataDelegate, pformatetcIn, pmedium); + end_object_call(This); + if (hres == S_OK) return hres; + } + + /* Query running state again, as the object may have closed during _GetData call */ + if (!object_is_running( This )) + hres = OLE_E_NOTRUNNING; return hres; } @@ -1053,8 +1169,19 @@ IDataObject_Release(cacheDataObject); - if (FAILED(hres) && This->pDataDelegate) + if (hres == S_OK) return hres; + + if (object_is_running( This )) + { + start_object_call( This ); hres = IDataObject_QueryGetData(This->pDataDelegate, pformatetc); + end_object_call( This ); + if (hres == S_OK) return hres; + } + + /* Query running state again, as the object may have closed during _QueryGetData call */ + if (!object_is_running( This )) + hres = OLE_E_NOTRUNNING; return hres; } @@ -1072,13 +1199,18 @@ LPFORMATETC pformatetcOut) { DefaultHandler *This = impl_from_IDataObject(iface); + HRESULT hr; TRACE("(%p, %p, %p)\n", iface, pformatetcIn, pformatetcOut); - if (!This->pDataDelegate) + if (!object_is_running( This )) return OLE_E_NOTRUNNING; - return IDataObject_GetCanonicalFormatEtc(This->pDataDelegate, pformatetcIn, pformatetcOut); + start_object_call( This ); + hr = IDataObject_GetCanonicalFormatEtc(This->pDataDelegate, pformatetcIn, pformatetcOut); + end_object_call( This ); + + return hr; } /************************************************************************ @@ -1163,8 +1295,12 @@ if (!This->dataAdviseHolder) { hres = CreateDataAdviseHolder(&This->dataAdviseHolder); - if (SUCCEEDED(hres) && This->pDataDelegate) + if (SUCCEEDED(hres) && object_is_running( This )) + { + start_object_call( This ); DataAdviseHolder_OnConnect(This->dataAdviseHolder, This->pDataDelegate); + end_object_call( This ); + } } if (SUCCEEDED(hres)) @@ -1299,6 +1435,7 @@ { DefaultHandler *This = impl_from_IRunnableObject(iface); HRESULT hr; + IOleCacheControl *cache_ctrl; FIXME("(%p): semi-stub\n", pbc); @@ -1313,49 +1450,59 @@ if (FAILED(hr)) return hr; - This->object_state = object_state_running; - hr = IOleObject_Advise(This->pOleDelegate, &This->IAdviseSink_iface, &This->dwAdvConn); - - if (SUCCEEDED(hr) && This->clientSite) + if (FAILED(hr)) goto fail; + + if (This->clientSite) + { hr = IOleObject_SetClientSite(This->pOleDelegate, This->clientSite); - - if (SUCCEEDED(hr)) - { - IOleObject_QueryInterface(This->pOleDelegate, &IID_IPersistStorage, - (void **)&This->pPSDelegate); - if (This->pPSDelegate) - { - if(This->storage_state == storage_state_initialised) - hr = IPersistStorage_InitNew(This->pPSDelegate, This->storage); - else if(This->storage_state == storage_state_loaded) - hr = IPersistStorage_Load(This->pPSDelegate, This->storage); - } - } - - if (SUCCEEDED(hr) && This->containerApp) + if (FAILED(hr)) goto fail; + } + + hr = IOleObject_QueryInterface(This->pOleDelegate, &IID_IPersistStorage, + (void **)&This->pPSDelegate); + if (FAILED(hr)) goto fail; + + if (This->storage_state == storage_state_initialised) + hr = IPersistStorage_InitNew(This->pPSDelegate, This->storage); + else if (This->storage_state == storage_state_loaded) + hr = IPersistStorage_Load(This->pPSDelegate, This->storage); + if (FAILED(hr)) goto fail; + + if (This->containerApp) + { hr = IOleObject_SetHostNames(This->pOleDelegate, This->containerApp, This->containerObj); + if (FAILED(hr)) goto fail; + } /* FIXME: do more stuff here: * - IOleObject_GetMiscStatus * - IOleObject_GetMoniker - * - IOleCache_OnRun */ - if (SUCCEEDED(hr)) - hr = IOleObject_QueryInterface(This->pOleDelegate, &IID_IDataObject, - (void **)&This->pDataDelegate); - - if (SUCCEEDED(hr) && This->dataAdviseHolder) + hr = IOleObject_QueryInterface(This->pOleDelegate, &IID_IDataObject, + (void **)&This->pDataDelegate); + if (FAILED(hr)) goto fail; + + This->object_state = object_state_running; + + if (This->dataAdviseHolder) + { hr = DataAdviseHolder_OnConnect(This->dataAdviseHolder, This->pDataDelegate); - - if (FAILED(hr)) - { - DefaultHandler_Stop(This); - release_delegates(This); - } - + if (FAILED(hr)) goto fail; + } + + hr = IUnknown_QueryInterface( This->dataCache, &IID_IOleCacheControl, (void **)&cache_ctrl ); + if (FAILED(hr)) goto fail; + hr = IOleCacheControl_OnRun( cache_ctrl, This->pDataDelegate ); + IOleCacheControl_Release( cache_ctrl ); + if (FAILED(hr)) goto fail; + + return hr; + +fail: + DefaultHandler_Stop(This); return hr; } @@ -1485,9 +1632,14 @@ if (This->oleAdviseHolder) IOleAdviseHolder_SendOnClose(This->oleAdviseHolder); - DefaultHandler_Stop(This); -} - + if(!This->in_call) + DefaultHandler_Stop(This); + else + { + TRACE("OnClose during call. Deferring shutdown\n"); + This->object_state = object_state_deferred_close; + } +} /************************************************************************ * DefaultHandler_IPersistStorage_QueryInterface @@ -1541,7 +1693,11 @@ TRACE("(%p)->(%p)\n", iface, clsid); if(object_is_running(This)) + { + start_object_call( This ); hr = IPersistStorage_GetClassID(This->pPSDelegate, clsid); + end_object_call( This ); + } else hr = IPersistStorage_GetClassID(This->dataCache_PersistStg, clsid); @@ -1564,7 +1720,11 @@ if(hr != S_FALSE) return hr; if(object_is_running(This)) + { + start_object_call( This ); hr = IPersistStorage_IsDirty(This->pPSDelegate); + end_object_call( This ); + } return hr; } @@ -1648,7 +1808,11 @@ hr = IPersistStorage_InitNew(This->dataCache_PersistStg, pStg); if(SUCCEEDED(hr) && object_is_running(This)) + { + start_object_call( This ); hr = IPersistStorage_InitNew(This->pPSDelegate, pStg); + end_object_call( This ); + } if(SUCCEEDED(hr)) { @@ -1680,7 +1844,11 @@ hr = IPersistStorage_Load(This->dataCache_PersistStg, pStg); if(SUCCEEDED(hr) && object_is_running(This)) + { + start_object_call( This ); hr = IPersistStorage_Load(This->pPSDelegate, pStg); + end_object_call( This ); + } if(SUCCEEDED(hr)) { @@ -1708,7 +1876,11 @@ hr = IPersistStorage_Save(This->dataCache_PersistStg, pStgSave, fSameAsLoad); if(SUCCEEDED(hr) && object_is_running(This)) + { + start_object_call( This ); hr = IPersistStorage_Save(This->pPSDelegate, pStgSave, fSameAsLoad); + end_object_call( This ); + } return hr; } @@ -1730,7 +1902,11 @@ hr = IPersistStorage_SaveCompleted(This->dataCache_PersistStg, pStgNew); if(SUCCEEDED(hr) && object_is_running(This)) + { + start_object_call( This ); hr = IPersistStorage_SaveCompleted(This->pPSDelegate, pStgNew); + end_object_call( This ); + } if(pStgNew) { @@ -1759,7 +1935,11 @@ hr = IPersistStorage_HandsOffStorage(This->dataCache_PersistStg); if(SUCCEEDED(hr) && object_is_running(This)) + { + start_object_call( This ); hr = IPersistStorage_HandsOffStorage(This->pPSDelegate); + end_object_call( This ); + } if(This->storage) IStorage_Release(This->storage); This->storage = NULL; @@ -1940,6 +2120,7 @@ This->pPSDelegate = NULL; This->pDataDelegate = NULL; This->object_state = object_state_not_running; + This->in_call = 0; This->dwAdvConn = 0; This->storage = NULL; @@ -1984,7 +2165,6 @@ /* release delegates */ DefaultHandler_Stop(This); - release_delegates(This); HeapFree( GetProcessHeap(), 0, This->containerApp ); This->containerApp = NULL; Modified: trunk/reactos/dll/win32/ole32/filemoniker.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ole32/filemonike…
============================================================================== --- trunk/reactos/dll/win32/ole32/filemoniker.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/ole32/filemoniker.c [iso-8859-1] Tue Nov 17 10:30:40 2015 @@ -484,12 +484,12 @@ /* if the requested class was loaded before ! we don't need to reload it */ res = IRunningObjectTable_GetObject(prot,iface,&pObj); - if (res==S_FALSE){ + if (res != S_OK){ /* first activation of this class */ res=GetClassFile(This->filePathName,&clsID); if (SUCCEEDED(res)){ - res=CoCreateInstance(&clsID,NULL,CLSCTX_ALL,&IID_IPersistFile,(void**)&ppf); + res=CoCreateInstance(&clsID,NULL,CLSCTX_SERVER,&IID_IPersistFile,(void**)&ppf); if (SUCCEEDED(res)){ res=IPersistFile_Load(ppf,This->filePathName,STGM_READ); Modified: trunk/reactos/dll/win32/ole32/marshal.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ole32/marshal.c?…
============================================================================== --- trunk/reactos/dll/win32/ole32/marshal.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/ole32/marshal.c [iso-8859-1] Tue Nov 17 10:30:40 2015 @@ -106,9 +106,7 @@ struct stub_manager *manager; struct ifstub *ifstub; BOOL tablemarshal; - IRpcStubBuffer *stub = NULL; HRESULT hr; - IUnknown *iobject = NULL; /* object of type riid */ hr = apartment_getoxid(apt, &stdobjref->oxid); if (hr != S_OK) @@ -118,78 +116,57 @@ if (hr != S_OK) return hr; - hr = IUnknown_QueryInterface(object, riid, (void **)&iobject); - if (hr != S_OK) - { - ERR("object doesn't expose interface %s, failing with error 0x%08x\n", - debugstr_guid(riid), hr); - return E_NOINTERFACE; - } - - /* IUnknown doesn't require a stub buffer, because it never goes out on - * the wire */ - if (!IsEqualIID(riid, &IID_IUnknown)) - { - IPSFactoryBuffer *psfb; - - hr = get_facbuf_for_iid(riid, &psfb); - if (hr != S_OK) - { - ERR("couldn't get IPSFactory buffer for interface %s\n", debugstr_guid(riid)); - IUnknown_Release(iobject); - return hr; - } - - hr = IPSFactoryBuffer_CreateStub(psfb, riid, iobject, &stub); - IPSFactoryBuffer_Release(psfb); - if (hr != S_OK) - { - ERR("Failed to create an IRpcStubBuffer from IPSFactory for %s with error 0x%08x\n", - debugstr_guid(riid), hr); - IUnknown_Release(iobject); - return hr; - } - } + if (!(manager = get_stub_manager_from_object(apt, object, TRUE))) + return E_OUTOFMEMORY; stdobjref->flags = SORF_NULL; if (mshlflags & MSHLFLAGS_TABLEWEAK) stdobjref->flags |= SORFP_TABLEWEAK; if (mshlflags & MSHLFLAGS_NOPING) stdobjref->flags |= SORF_NOPING; - - if ((manager = get_stub_manager_from_object(apt, object))) - TRACE("registering new ifstub on pre-existing manager\n"); - else - { - TRACE("constructing new stub manager\n"); - - manager = new_stub_manager(apt, object); - if (!manager) - { - if (stub) IRpcStubBuffer_Release(stub); - IUnknown_Release(iobject); - return E_OUTOFMEMORY; - } - } stdobjref->oid = manager->oid; tablemarshal = ((mshlflags & MSHLFLAGS_TABLESTRONG) || (mshlflags & MSHLFLAGS_TABLEWEAK)); /* make sure ifstub that we are creating is unique */ ifstub = stub_manager_find_ifstub(manager, riid, mshlflags); - if (!ifstub) - ifstub = stub_manager_new_ifstub(manager, stub, iobject, riid, dest_context, dest_context_data, mshlflags); - - if (stub) IRpcStubBuffer_Release(stub); - IUnknown_Release(iobject); - - if (!ifstub) - { - stub_manager_int_release(manager); - /* destroy the stub manager if it has no ifstubs by releasing - * zero external references */ - stub_manager_ext_release(manager, 0, FALSE, TRUE); - return E_OUTOFMEMORY; + if (!ifstub) { + IRpcStubBuffer *stub = NULL; + + /* IUnknown doesn't require a stub buffer, because it never goes out on + * the wire */ + if (!IsEqualIID(riid, &IID_IUnknown)) + { + IPSFactoryBuffer *psfb; + + hr = get_facbuf_for_iid(riid, &psfb); + if (hr == S_OK) { + hr = IPSFactoryBuffer_CreateStub(psfb, riid, manager->object, &stub); + IPSFactoryBuffer_Release(psfb); + if (hr != S_OK) + ERR("Failed to create an IRpcStubBuffer from IPSFactory for %s with error 0x%08x\n", + debugstr_guid(riid), hr); + }else { + ERR("couldn't get IPSFactory buffer for interface %s\n", debugstr_guid(riid)); + hr = E_NOINTERFACE; + } + + } + + if (hr == S_OK) { + ifstub = stub_manager_new_ifstub(manager, stub, riid, dest_context, dest_context_data, mshlflags); + if (!ifstub) + hr = E_OUTOFMEMORY; + } + if (stub) IRpcStubBuffer_Release(stub); + + if (hr != S_OK) { + stub_manager_int_release(manager); + /* destroy the stub manager if it has no ifstubs by releasing + * zero external references */ + stub_manager_ext_release(manager, 0, FALSE, TRUE); + return hr; + } } if (!tablemarshal) @@ -1717,7 +1694,7 @@ OBJREF objref; LPMARSHAL pMarshal; - TRACE("(%p, %s, %p, %x, %p,", pStream, debugstr_guid(riid), pUnk, + TRACE("(%p, %s, %p, %x, %p, ", pStream, debugstr_guid(riid), pUnk, dwDestContext, pvDestContext); dump_MSHLFLAGS(mshlFlags); TRACE(")\n"); Modified: trunk/reactos/dll/win32/ole32/ole2.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ole32/ole2.c?rev…
============================================================================== --- trunk/reactos/dll/win32/ole32/ole2.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/ole32/ole2.c [iso-8859-1] Tue Nov 17 10:30:40 2015 @@ -146,7 +146,7 @@ /*********************************************************************** * OleInitialize (OLE32.@) */ -HRESULT WINAPI OleInitialize(LPVOID reserved) +HRESULT WINAPI DECLSPEC_HOTPATCH OleInitialize(LPVOID reserved) { HRESULT hr; @@ -1210,7 +1210,7 @@ * Success: S_OK. * Failure: Any HRESULT code. */ -HRESULT WINAPI OleRun(LPUNKNOWN pUnknown) +HRESULT WINAPI DECLSPEC_HOTPATCH OleRun(LPUNKNOWN pUnknown) { IRunnableObject *runable; HRESULT hres; @@ -3016,7 +3016,7 @@ hr = PROPVARIANT_ValidateType(pvarSrc->vt); if (FAILED(hr)) - return hr; + return DISP_E_BADVARTYPE; /* this will deal with most cases */ *pvarDest = *pvarSrc; Modified: trunk/reactos/dll/win32/ole32/ole2impl.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ole32/ole2impl.c…
============================================================================== --- trunk/reactos/dll/win32/ole32/ole2impl.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/ole32/ole2impl.c [iso-8859-1] Tue Nov 17 10:30:40 2015 @@ -84,7 +84,7 @@ * * FIXME: CF_FILENAME. */ -static HRESULT get_storage(IDataObject *data, IStorage *stg, UINT *src_cf) +static HRESULT get_storage(IDataObject *data, IStorage *stg, UINT *src_cf, BOOL other_fmts) { static const UINT fmt_id[] = { CF_METAFILEPICT, CF_BITMAP, CF_DIB }; UINT i; @@ -94,16 +94,17 @@ IPersistStorage *persist; CLSID clsid; - *src_cf = 0; + if (src_cf) *src_cf = 0; /* CF_EMBEDEDOBJECT */ init_fmtetc(&fmt, embedded_object_clipboard_format, TYMED_ISTORAGE); med.tymed = TYMED_ISTORAGE; med.u.pstg = stg; + med.pUnkForRelease = NULL; hr = IDataObject_GetDataHere(data, &fmt, &med); if(SUCCEEDED(hr)) { - *src_cf = embedded_object_clipboard_format; + if (src_cf) *src_cf = embedded_object_clipboard_format; return hr; } @@ -111,21 +112,25 @@ init_fmtetc(&fmt, embed_source_clipboard_format, TYMED_ISTORAGE); med.tymed = TYMED_ISTORAGE; med.u.pstg = stg; + med.pUnkForRelease = NULL; hr = IDataObject_GetDataHere(data, &fmt, &med); if(SUCCEEDED(hr)) { - *src_cf = embed_source_clipboard_format; + if (src_cf) *src_cf = embed_source_clipboard_format; return hr; } - for (i = 0; i < sizeof(fmt_id)/sizeof(fmt_id[0]); i++) - { - init_fmtetc(&fmt, fmt_id[i], TYMED_ISTORAGE); - hr = IDataObject_QueryGetData(data, &fmt); - if(SUCCEEDED(hr)) - { - *src_cf = fmt_id[i]; - return hr; + if (other_fmts) + { + for (i = 0; i < sizeof(fmt_id)/sizeof(fmt_id[0]); i++) + { + init_fmtetc(&fmt, fmt_id[i], TYMED_ISTORAGE); + hr = IDataObject_QueryGetData(data, &fmt); + if (SUCCEEDED(hr)) + { + if (src_cf) *src_cf = fmt_id[i]; + return hr; + } } } @@ -168,7 +173,7 @@ data, debugstr_guid(iid), flags, renderopt, num_cache_fmts, adv_flags, cache_fmts, sink, conns, client_site, stg, obj); - hr = get_storage(data, stg, &src_cf); + hr = get_storage(data, stg, &src_cf, TRUE); if(FAILED(hr)) return hr; hr = OleLoad(stg, iid, client_site, obj); @@ -217,6 +222,84 @@ FIXME("%p,%s,%08x,%p,%p,%p,%p: semi-stub\n", data, debugstr_guid(iid), renderopt, fmt, client_site, stg, obj); return OleCreateFromData(data, iid, renderopt, fmt, client_site, stg, obj); +} + +/****************************************************************************** + * OleCreateFromFileEx [OLE32.@] + */ +HRESULT WINAPI OleCreateFromFileEx(REFCLSID clsid, const OLECHAR *filename, REFIID iid, DWORD flags, + DWORD renderopt, ULONG num_fmts, DWORD *adv_flags, FORMATETC *fmts, IAdviseSink *sink, + DWORD *conns, IOleClientSite *client_site, IStorage *stg, void **obj) +{ + HRESULT hr; + IMoniker *mon; + IDataObject *data; + IUnknown *unk = NULL; + IOleCache *cache = NULL; + ULONG i; + + TRACE("cls %s, %s, iid %s, flags %d, render opts %d, num fmts %d, adv flags %p, fmts %p\n", debugstr_guid(clsid), + debugstr_w(filename), debugstr_guid(iid), flags, renderopt, num_fmts, adv_flags, fmts); + TRACE("sink %p, conns %p, client site %p, storage %p, obj %p\n", sink, conns, client_site, stg, obj); + for (i = 0; i < num_fmts; i++) + TRACE("\t%d: fmt %s adv flags %d\n", i, debugstr_formatetc(fmts + i), adv_flags[i]); + + hr = CreateFileMoniker( filename, &mon ); + if (FAILED(hr)) return hr; + + hr = BindMoniker( mon, 0, &IID_IDataObject, (void**)&data ); + IMoniker_Release( mon ); + if (FAILED(hr)) return hr; + + hr = get_storage( data, stg, NULL, FALSE ); + if (FAILED(hr)) goto end; + + hr = OleLoad( stg, &IID_IUnknown, client_site, (void**)&unk ); + if (FAILED(hr)) goto end; + + if (renderopt == OLERENDER_FORMAT) + { + hr = IUnknown_QueryInterface( unk, &IID_IOleCache, (void**)&cache ); + if (FAILED(hr)) goto end; + + for (i = 0; i < num_fmts; i++) + { + STGMEDIUM med; + DWORD dummy_conn; + + memset( &med, 0, sizeof(med) ); + hr = IDataObject_GetData( data, fmts + i, &med ); + if (FAILED(hr)) goto end; + hr = IOleCache_Cache( cache, fmts + i, adv_flags[i], &dummy_conn ); + if (SUCCEEDED(hr)) + hr = IOleCache_SetData( cache, fmts + i, &med, TRUE ); + if (FAILED(hr)) + { + ReleaseStgMedium( &med ); + goto end; + } + } + } + + hr = IUnknown_QueryInterface( unk, iid, obj ); + +end: + if (cache) IOleCache_Release( cache ); + if (unk) IUnknown_Release( unk ); + IDataObject_Release( data ); + return hr; +} + +/****************************************************************************** + * OleCreateFromFile [OLE32.@] + */ +HRESULT WINAPI OleCreateFromFile(REFCLSID clsid, const OLECHAR *filename, REFIID iid, DWORD renderopt, + FORMATETC *fmt, IOleClientSite *client_site, IStorage *storage, void **obj) +{ + DWORD advf = ADVF_PRIMEFIRST; + + return OleCreateFromFileEx(clsid, filename, iid, 0, renderopt, fmt ? 1 : 0, fmt ? &advf : NULL, fmt, + NULL, NULL, client_site, storage, obj); } /****************************************************************************** Modified: trunk/reactos/dll/win32/ole32/ole2stubs.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ole32/ole2stubs.…
============================================================================== --- trunk/reactos/dll/win32/ole32/ole2stubs.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/ole32/ole2stubs.c [iso-8859-1] Tue Nov 17 10:30:40 2015 @@ -45,17 +45,6 @@ } /****************************************************************************** - * OleCreateFromFile [OLE32.@] - */ -HRESULT WINAPI OleCreateFromFile(REFCLSID rclsid, LPCOLESTR lpszFileName, REFIID riid, - DWORD renderopt, LPFORMATETC lpFormatEtc, LPOLECLIENTSITE pClientSite, LPSTORAGE pStg, LPVOID* ppvObj) -{ - FIXME("(not shown), stub!\n"); - return E_NOTIMPL; -} - - -/****************************************************************************** * OleGetIconOfClass [OLE32.@] */ HGLOBAL WINAPI OleGetIconOfClass(REFCLSID rclsid, LPOLESTR lpszLabel, BOOL fUseTypeAsLabel) @@ -67,7 +56,7 @@ /*********************************************************************** * OleRegEnumFormatEtc [OLE32.@] */ -HRESULT WINAPI OleRegEnumFormatEtc ( +HRESULT WINAPI DECLSPEC_HOTPATCH OleRegEnumFormatEtc ( REFCLSID clsid, DWORD dwDirection, LPENUMFORMATETC* ppenumFormatetc) Modified: trunk/reactos/dll/win32/ole32/ole32.spec URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ole32/ole32.spec…
============================================================================== --- trunk/reactos/dll/win32/ole32/ole32.spec [iso-8859-1] (original) +++ trunk/reactos/dll/win32/ole32/ole32.spec [iso-8859-1] Tue Nov 17 10:30:40 2015 @@ -218,8 +218,8 @@ @ stub OleCreateEx @ stdcall OleCreateFromData(ptr ptr long ptr ptr ptr ptr) @ stdcall OleCreateFromDataEx(ptr ptr long long long ptr ptr ptr ptr ptr ptr ptr) -@ stdcall OleCreateFromFile(ptr ptr ptr long ptr ptr ptr ptr) -@ stub OleCreateFromFileEx +@ stdcall OleCreateFromFile(ptr wstr ptr long ptr ptr ptr ptr) +@ stdcall OleCreateFromFileEx(ptr wstr ptr long long long ptr ptr ptr ptr ptr ptr ptr) @ stdcall OleCreateLink(ptr ptr long ptr ptr ptr ptr) @ stub OleCreateLinkEx @ stdcall OleCreateLinkFromData(ptr ptr long ptr ptr ptr ptr) Modified: trunk/reactos/dll/win32/ole32/ole32_main.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ole32/ole32_main…
============================================================================== --- trunk/reactos/dll/win32/ole32/ole32_main.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/ole32/ole32_main.c [iso-8859-1] Tue Nov 17 10:30:40 2015 @@ -147,3 +147,21 @@ return hmem; } + +/*********************************************************************** + * CoGetActivationState (ole32.@) + */ +HRESULT WINAPI CoGetActivationState(GUID guid, DWORD unknown, DWORD *unknown2) +{ + FIXME("%s, %x, %p\n", debugstr_guid(&guid), unknown, unknown2); + return E_NOTIMPL; +} + +/*********************************************************************** + * CoGetCallState (ole32.@) + */ +HRESULT WINAPI CoGetCallState(int unknown, PULONG unknown2) +{ + FIXME("%d, %p\n", unknown, unknown2); + return E_NOTIMPL; +} Modified: trunk/reactos/dll/win32/ole32/rpc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ole32/rpc.c?rev=…
============================================================================== --- trunk/reactos/dll/win32/ole32/rpc.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/ole32/rpc.c [iso-8859-1] Tue Nov 17 10:30:40 2015 @@ -661,7 +661,7 @@ } RpcBindingInqObject(message_state->binding_handle, &ipid); - hr = ipid_get_dispatch_params(&ipid, &apt, &message_state->params.stub, + hr = ipid_get_dispatch_params(&ipid, &apt, NULL, &message_state->params.stub, &message_state->params.chan, &message_state->params.iid, &message_state->params.iface); @@ -1420,6 +1420,7 @@ static void __RPC_STUB dispatch_rpc(RPC_MESSAGE *msg) { struct dispatch_params *params; + struct stub_manager *stub_manager; APARTMENT *apt; IPID ipid; HRESULT hr; @@ -1435,7 +1436,7 @@ return; } - hr = ipid_get_dispatch_params(&ipid, &apt, ¶ms->stub, ¶ms->chan, + hr = ipid_get_dispatch_params(&ipid, &apt, &stub_manager, ¶ms->stub, ¶ms->chan, ¶ms->iid, ¶ms->iface); if (hr != S_OK) { @@ -1493,6 +1494,7 @@ IRpcStubBuffer_Release(params->stub); HeapFree(GetProcessHeap(), 0, params); + stub_manager_int_release(stub_manager); apartment_release(apt); /* if IRpcStubBuffer_Invoke fails, we should raise an exception to tell @@ -1558,7 +1560,7 @@ } /* stub unregistration */ -void RPC_UnregisterInterface(REFIID riid) +void RPC_UnregisterInterface(REFIID riid, BOOL wait) { struct registered_if *rif; EnterCriticalSection(&csRegIf); @@ -1568,7 +1570,7 @@ { if (!--rif->refs) { - RpcServerUnregisterIf((RPC_IF_HANDLE)&rif->If, NULL, TRUE); + RpcServerUnregisterIf((RPC_IF_HANDLE)&rif->If, NULL, wait); list_remove(&rif->entry); HeapFree(GetProcessHeap(), 0, rif); } Modified: trunk/reactos/dll/win32/ole32/storage32.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ole32/storage32.…
============================================================================== --- trunk/reactos/dll/win32/ole32/storage32.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/ole32/storage32.c [iso-8859-1] Tue Nov 17 10:30:40 2015 @@ -858,7 +858,7 @@ * IEnumSTATSTGImpl definitions. * * Definition of the implementation structure for the IEnumSTATSTGImpl interface. - * This class allows iterating through the content of a storage and to find + * This class allows iterating through the content of a storage and finding * specific items inside it. */ struct IEnumSTATSTGImpl @@ -890,6 +890,8 @@ { IEnumSTATSTGImpl* const This = impl_from_IEnumSTATSTG(iface); + TRACE("%p,%s,%p\n", iface, debugstr_guid(riid), ppvObject); + if (ppvObject==0) return E_INVALIDARG; @@ -900,9 +902,11 @@ { *ppvObject = &This->IEnumSTATSTG_iface; IEnumSTATSTG_AddRef(&This->IEnumSTATSTG_iface); + TRACE("<-- %p\n", *ppvObject); return S_OK; } + TRACE("<-- E_NOINTERFACE\n"); return E_NOINTERFACE; } @@ -939,6 +943,8 @@ DirEntry entry; HRESULT hr; WCHAR result_name[DIRENTRY_NAME_MAX_LEN]; + + TRACE("%p,%p\n", This, ref); hr = StorageBaseImpl_ReadDirEntry(This->parentStorage, This->parentStorage->storageDirEntry, &entry); @@ -972,6 +978,7 @@ memcpy(This->name, result_name, sizeof(result_name)); } + TRACE("<-- %08x\n", hr); return hr; } @@ -989,11 +996,16 @@ DirRef currentSearchNode; HRESULT hr=S_OK; + TRACE("%p,%u,%p,%p\n", iface, celt, rgelt, pceltFetched); + if ( (rgelt==0) || ( (celt!=1) && (pceltFetched==0) ) ) return E_INVALIDARG; if (This->parentStorage->reverted) + { + TRACE("<-- STG_E_REVERTED\n"); return STG_E_REVERTED; + } /* * To avoid the special case, get another pointer to a ULONG value if @@ -1013,14 +1025,18 @@ hr = IEnumSTATSTGImpl_GetNextRef(This, ¤tSearchNode); if (FAILED(hr) || currentSearchNode == DIRENTRY_NULL) + { + memset(currentReturnStruct, 0, sizeof(*currentReturnStruct)); break; + } /* * Read the entry from the storage. */ - StorageBaseImpl_ReadDirEntry(This->parentStorage, + hr = StorageBaseImpl_ReadDirEntry(This->parentStorage, currentSearchNode, ¤tEntry); + if (FAILED(hr)) break; /* * Copy the information to the return buffer. @@ -1040,6 +1056,7 @@ if (SUCCEEDED(hr) && *pceltFetched != celt) hr = S_FALSE; + TRACE("<-- %08x (asked %u, got %u)\n", hr, celt, *pceltFetched); return hr; } @@ -1054,8 +1071,13 @@ DirRef currentSearchNode; HRESULT hr=S_OK; + TRACE("%p,%u\n", iface, celt); + if (This->parentStorage->reverted) + { + TRACE("<-- STG_E_REVERTED\n"); return STG_E_REVERTED; + } while ( (objectFetched < celt) ) { @@ -1070,6 +1092,7 @@ if (SUCCEEDED(hr) && objectFetched != celt) return S_FALSE; + TRACE("<-- %08x\n", hr); return hr; } @@ -1078,8 +1101,13 @@ { IEnumSTATSTGImpl* const This = impl_from_IEnumSTATSTG(iface); + TRACE("%p\n", iface); + if (This->parentStorage->reverted) + { + TRACE("<-- STG_E_REVERTED\n"); return STG_E_REVERTED; + } This->name[0] = 0; @@ -1095,8 +1123,13 @@ IEnumSTATSTGImpl* const This = impl_from_IEnumSTATSTG(iface); IEnumSTATSTGImpl* newClone; + TRACE("%p,%p\n", iface, ppenum); + if (This->parentStorage->reverted) + { + TRACE("<-- STG_E_REVERTED\n"); return STG_E_REVERTED; + } if (ppenum==0) return E_INVALIDARG; @@ -1186,6 +1219,8 @@ { StorageBaseImpl *This = impl_from_IStorage(iface); + TRACE("%p,%s,%p\n", iface, debugstr_guid(riid), ppvObject); + if (!ppvObject) return E_INVALIDARG; @@ -1206,10 +1241,13 @@ *ppvObject = &This->IDirectWriterLock_iface; } else + { + TRACE("<-- E_NOINTERFACE\n"); return E_NOINTERFACE; + } IStorage_AddRef(iface); - + TRACE("<-- %p\n", *ppvObject); return S_OK; } @@ -1392,6 +1430,7 @@ hr = StorageBaseImpl_CopyChildEntryTo( This, data.rightChild, skip_storage, skip_stream, snbExclude, pstgDest ); + TRACE("<-- %08x\n", hr); return hr; } @@ -1399,6 +1438,8 @@ { StgStreamImpl *strm; + TRACE("%p,%d\n", stg, streamEntry); + LIST_FOR_EACH_ENTRY(strm, &stg->strmHead, StgStreamImpl, StrmListEntry) { if (strm->dirEntry == streamEntry) @@ -1413,6 +1454,8 @@ static BOOL StorageBaseImpl_IsStorageOpen(StorageBaseImpl * stg, DirRef storageEntry) { StorageInternalImpl *childstg; + + TRACE("%p,%d\n", stg, storageEntry); LIST_FOR_EACH_ENTRY(childstg, &stg->storageHead, StorageInternalImpl, ParentListEntry) { @@ -2218,6 +2261,7 @@ hr = StorageBaseImpl_CopyChildEntryTo( This, data.dirRootEntry, skip_storage, skip_stream, snbExclude, pstgDest ); + TRACE("<-- %08x\n", hr); return hr; } @@ -2373,6 +2417,8 @@ HRESULT hr; HRESULT destroyHr = S_OK; StorageInternalImpl *stg, *stg2; + + TRACE("%p,%d\n", parentStorage, indexToDelete); /* Invalidate any open storage objects. */ LIST_FOR_EACH_ENTRY_SAFE(stg, stg2, &parentStorage->storageHead, StorageInternalImpl, ParentListEntry) @@ -2397,6 +2443,7 @@ if (hr != S_OK) { + TRACE("<-- %08x\n", hr); return hr; } @@ -2407,6 +2454,7 @@ if (FAILED(hr)) { IStorage_Release(childStorage); + TRACE("<-- %08x\n", hr); return hr; } @@ -2434,6 +2482,7 @@ IStorage_Release(childStorage); IEnumSTATSTG_Release(elements); + TRACE("%08x\n", hr); return destroyHr; } @@ -2473,6 +2522,7 @@ if (hr!=S_OK) { + TRACE("<-- %08x\n", hr); return(hr); } @@ -2483,6 +2533,7 @@ if(hr != S_OK) { + TRACE("<-- %08x\n", hr); return hr; } @@ -2490,7 +2541,7 @@ * Release the stream object. */ IStream_Release(pis); - + TRACE("<-- %08x\n", hr); return S_OK; } @@ -2500,7 +2551,7 @@ * Strategy: This implementation is built this way for simplicity not for speed. * I always delete the topmost element of the enumeration and adjust * the deleted element pointer all the time. This takes longer to - * do but allow to reinvoke DestroyElement whenever we encounter a + * do but allows reinvoking DestroyElement whenever we encounter a * storage object. The optimisation resides in the usage of another * enumeration strategy that would give all the leaves of a storage * first. (postfix order) @@ -2536,6 +2587,7 @@ if ( entryToDeleteRef == DIRENTRY_NULL ) { + TRACE("<-- STG_E_FILENOTFOUND\n"); return STG_E_FILENOTFOUND; } @@ -2555,7 +2607,10 @@ } if (hr!=S_OK) + { + TRACE("<-- %08x\n", hr); return hr; + } /* * Remove the entry from its parent storage @@ -2574,6 +2629,7 @@ if (SUCCEEDED(hr)) hr = StorageBaseImpl_Flush(This); + TRACE("<-- %08x\n", hr); return hr; } @@ -3428,10 +3484,18 @@ OFFSET_PS_SIZE, &buffer->size.u.LowPart); - StorageUtl_ReadDWord( - currentEntry, - OFFSET_PS_SIZE_HIGH, - &buffer->size.u.HighPart); + if (This->bigBlockSize < 4096) + { + /* Version 3 files may have junk in the high part of size. */ + buffer->size.u.HighPart = 0; + } + else + { + StorageUtl_ReadDWord( + currentEntry, + OFFSET_PS_SIZE_HIGH, + &buffer->size.u.HighPart); + } } return readRes; @@ -6004,6 +6068,7 @@ StorageBaseImpl_UnlockTransaction(This->transactedParent, TRUE); } + TRACE("<-- %08x\n", hr); return hr; } @@ -6110,7 +6175,11 @@ TRACE("%x %s l=%x r=%x d=%x\n", index, debugstr_w(data->name), data->leftChild, data->rightChild, data->dirRootEntry); hr = TransactedSnapshotImpl_EnsureReadEntry(This, index); - if (FAILED(hr)) return hr; + if (FAILED(hr)) + { + TRACE("<-- %08x\n", hr); + return hr; + } memcpy(&This->entries[index].data, data, sizeof(DirEntry)); @@ -6132,7 +6201,7 @@ This->entries[index].transactedParentEntry = This->entries[index].newTransactedParentEntry = DIRENTRY_NULL; } } - + TRACE("<-- S_OK\n"); return S_OK; } @@ -6143,7 +6212,11 @@ HRESULT hr; hr = TransactedSnapshotImpl_EnsureReadEntry(This, index); - if (FAILED(hr)) return hr; + if (FAILED(hr)) + { + TRACE("<-- %08x\n", hr); + return hr; + } memcpy(data, &This->entries[index].data, sizeof(DirEntry)); @@ -6205,10 +6278,18 @@ HRESULT hr; hr = TransactedSnapshotImpl_EnsureReadEntry(This, index); - if (FAILED(hr)) return hr; + if (FAILED(hr)) + { + TRACE("<-- %08x\n", hr); + return hr; + } hr = TransactedSnapshotImpl_MakeStreamDirty(This, index); - if (FAILED(hr)) return hr; + if (FAILED(hr)) + { + TRACE("<-- %08x\n", hr); + return hr; + } hr = StorageBaseImpl_StreamWriteAt(This->scratch, This->entries[index].stream_entry, offset, size, buffer, bytesWritten); @@ -6218,6 +6299,7 @@ This->entries[index].data.size.QuadPart, offset.QuadPart + size); + TRACE("<-- %08x\n", hr); return hr; } @@ -6228,7 +6310,11 @@ HRESULT hr; hr = TransactedSnapshotImpl_EnsureReadEntry(This, index); - if (FAILED(hr)) return hr; + if (FAILED(hr)) + { + TRACE("<-- %08x\n", hr); + return hr; + } if (This->entries[index].data.size.QuadPart == newsize.QuadPart) return S_OK; @@ -6269,6 +6355,7 @@ if (SUCCEEDED(hr)) This->entries[index].data.size = newsize; + TRACE("<-- %08x\n", hr); return hr; } @@ -6280,10 +6367,18 @@ TransactedDirEntry *dst_entry, *src_entry; hr = TransactedSnapshotImpl_EnsureReadEntry(This, src); - if (FAILED(hr)) return hr; + if (FAILED(hr)) + { + TRACE("<-- %08x\n", hr); + return hr; + } hr = TransactedSnapshotImpl_EnsureReadEntry(This, dst); - if (FAILED(hr)) return hr; + if (FAILED(hr)) + { + TRACE("<-- %08x\n", hr); + return hr; + } dst_entry = &This->entries[dst]; src_entry = &This->entries[src]; @@ -6638,7 +6733,7 @@ This->lastTransactionSig = transactionSig+1; } } - + TRACE("<-- %08x\n", hr); return hr; } @@ -9165,7 +9260,10 @@ count = 0; r = IStream_Read( stm, str, len, &count ); if( FAILED( r ) ) + { + CoTaskMemFree( str ); return r; + } if( count != len ) { CoTaskMemFree( str ); Modified: trunk/reactos/dll/win32/ole32/stubmanager.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ole32/stubmanage…
============================================================================== --- trunk/reactos/dll/win32/ole32/stubmanager.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/ole32/stubmanager.c [iso-8859-1] Tue Nov 17 10:30:40 2015 @@ -25,6 +25,8 @@ #include "precomp.h" +#include <wine/exception.h> + WINE_DEFAULT_DEBUG_CHANNEL(ole); /* generates an ipid in the following format (similar to native version): @@ -51,21 +53,28 @@ } /* registers a new interface stub COM object with the stub manager and returns registration record */ -struct ifstub *stub_manager_new_ifstub(struct stub_manager *m, IRpcStubBuffer *sb, IUnknown *iptr, REFIID iid, DWORD dest_context, +struct ifstub *stub_manager_new_ifstub(struct stub_manager *m, IRpcStubBuffer *sb, REFIID iid, DWORD dest_context, void *dest_context_data, MSHLFLAGS flags) { struct ifstub *stub; HRESULT hr; - TRACE("oid=%s, stubbuffer=%p, iptr=%p, iid=%s\n", - wine_dbgstr_longlong(m->oid), sb, iptr, debugstr_guid(iid)); + TRACE("oid=%s, stubbuffer=%p, iid=%s\n", wine_dbgstr_longlong(m->oid), sb, debugstr_guid(iid)); stub = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(struct ifstub)); if (!stub) return NULL; + hr = IUnknown_QueryInterface(m->object, iid, (void **)&stub->iface); + if (hr != S_OK) + { + HeapFree(GetProcessHeap(), 0, stub); + return NULL; + } + hr = RPC_CreateServerChannel(dest_context, dest_context_data, &stub->chan); if (hr != S_OK) { + IUnknown_Release(stub->iface); HeapFree(GetProcessHeap(), 0, stub); return NULL; } @@ -73,8 +82,6 @@ stub->stubbuffer = sb; if (sb) IRpcStubBuffer_AddRef(sb); - IUnknown_AddRef(iptr); - stub->iface = iptr; stub->flags = flags; stub->iid = *iid; @@ -102,7 +109,8 @@ list_remove(&ifstub->entry); - RPC_UnregisterInterface(&ifstub->iid); + if (!m->disconnected) + RPC_UnregisterInterface(&ifstub->iid, TRUE); if (ifstub->stubbuffer) IRpcStubBuffer_Release(ifstub->stubbuffer); IUnknown_Release(ifstub->iface); @@ -154,7 +162,7 @@ /* creates a new stub manager and adds it into the apartment. caller must * release stub manager when it is no longer required. the apartment and * external refs together take one implicit ref */ -struct stub_manager *new_stub_manager(APARTMENT *apt, IUnknown *object) +static struct stub_manager *new_stub_manager(APARTMENT *apt, IUnknown *object) { struct stub_manager *sm; HRESULT hres; @@ -202,6 +210,7 @@ * the marshalled ifptr. */ sm->extrefs = 0; + sm->disconnected = FALSE; hres = IUnknown_QueryInterface(object, &IID_IExternalConnection, (void**)&sm->extern_conn); if(FAILED(hres)) @@ -217,6 +226,21 @@ return sm; } +void stub_manager_disconnect(struct stub_manager *m) +{ + struct ifstub *ifstub; + + EnterCriticalSection(&m->lock); + if (!m->disconnected) + { + LIST_FOR_EACH_ENTRY(ifstub, &m->ifstubs, struct ifstub, entry) + RPC_UnregisterInterface(&ifstub->iid, FALSE); + + m->disconnected = TRUE; + } + LeaveCriticalSection(&m->lock); +} + /* caller must remove stub manager from apartment prior to calling this function */ static void stub_manager_delete(struct stub_manager *m) { @@ -235,7 +259,18 @@ IExternalConnection_Release(m->extern_conn); CoTaskMemFree(m->oxid_info.psa); - IUnknown_Release(m->object); + + /* Some broken apps crash in object destructors. We have a test showing + * that on winxp+ those crashes are caught and ignored. */ + __TRY + { + IUnknown_Release(m->object); + } + __EXCEPT_PAGE_FAULT + { + ERR("Got page fault when releasing stub!\n"); + } + __ENDTRY DEBUG_CLEAR_CRITSEC_NAME(&m->lock); DeleteCriticalSection(&m->lock); @@ -284,10 +319,18 @@ /* gets the stub manager associated with an object - caller must have * a reference to the apartment while a reference to the stub manager is held. * it must also call release on the stub manager when it is no longer needed */ -struct stub_manager *get_stub_manager_from_object(APARTMENT *apt, void *object) +struct stub_manager *get_stub_manager_from_object(APARTMENT *apt, IUnknown *obj, BOOL alloc) { struct stub_manager *result = NULL; struct list *cursor; + IUnknown *object; + HRESULT hres; + + hres = IUnknown_QueryInterface(obj, &IID_IUnknown, (void**)&object); + if (FAILED(hres)) { + ERR("QueryInterface(IID_IUnknown failed): %08x\n", hres); + return NULL; + } EnterCriticalSection(&apt->cs); LIST_FOR_EACH( cursor, &apt->stubmgrs ) @@ -303,37 +346,17 @@ } LeaveCriticalSection(&apt->cs); - if (result) + if (result) { TRACE("found %p for object %p\n", result, object); - else + }else if (alloc) { + TRACE("not found, creating new stub manager...\n"); + result = new_stub_manager(apt, object); + }else { TRACE("not found for object %p\n", object); - + } + + IUnknown_Release(object); return result; -} - -/* removes the apartment reference to an object, destroying it when no other - * threads have a reference to it */ -void apartment_disconnectobject(struct apartment *apt, void *object) -{ - BOOL found = FALSE; - struct stub_manager *stubmgr; - - EnterCriticalSection(&apt->cs); - LIST_FOR_EACH_ENTRY( stubmgr, &apt->stubmgrs, struct stub_manager, entry ) - { - if (stubmgr->object == object) - { - found = TRUE; - stub_manager_int_release(stubmgr); - break; - } - } - LeaveCriticalSection(&apt->cs); - - if (found) - TRACE("disconnect object %p\n", object); - else - WARN("couldn't find object %p\n", object); } /* gets the stub manager associated with an object id - caller must have @@ -486,6 +509,7 @@ * release the references to all objects (except iface) if the function * returned success, otherwise no references are returned. */ HRESULT ipid_get_dispatch_params(const IPID *ipid, APARTMENT **stub_apt, + struct stub_manager **manager, IRpcStubBuffer **stub, IRpcChannelBuffer **chan, IID *iid, IUnknown **iface) { @@ -508,7 +532,10 @@ *iid = ifstub->iid; *iface = ifstub->iface; - stub_manager_int_release(stubmgr); + if (manager) + *manager = stubmgr; + else + stub_manager_int_release(stubmgr); return S_OK; } else @@ -626,7 +653,8 @@ return S_OK; } - FIXME("No interface for iid %s\n", debugstr_guid(riid)); + if (!IsEqualIID(riid, &IID_IExternalConnection)) + FIXME("No interface for iid %s\n", debugstr_guid(riid)); *ppv = NULL; return E_NOINTERFACE; Modified: trunk/reactos/dll/win32/ole32/usrmarshal.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ole32/usrmarshal…
============================================================================== --- trunk/reactos/dll/win32/ole32/usrmarshal.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/ole32/usrmarshal.c [iso-8859-1] Tue Nov 17 10:30:40 2015 @@ -1472,6 +1472,7 @@ IStream *stm; DWORD size; void *ptr; + IUnknown *orig; TRACE("(%s, %p, %p, %s)\n", debugstr_user_flags(pFlags), pBuffer, ppunk, debugstr_guid(riid)); @@ -1499,10 +1500,13 @@ memcpy(ptr, pBuffer, size); GlobalUnlock(h); + orig = *ppunk; hr = CoUnmarshalInterface(stm, riid, (void**)ppunk); IStream_Release(stm); if(hr != S_OK) RaiseException(hr, 0, 0, NULL); + + if(orig) IUnknown_Release(orig); return pBuffer + size; } @@ -1828,7 +1832,10 @@ pBuffer = WdtpInterfacePointer_UserUnmarshal(pFlags, pBuffer, (IUnknown**)&pStgMedium->u.pstm, &IID_IStream); } else + { + if (pStgMedium->u.pstm) IStream_Release( pStgMedium->u.pstm ); pStgMedium->u.pstm = NULL; + } break; case TYMED_ISTORAGE: TRACE("TYMED_ISTORAGE\n"); @@ -1837,7 +1844,10 @@ pBuffer = WdtpInterfacePointer_UserUnmarshal(pFlags, pBuffer, (IUnknown**)&pStgMedium->u.pstg, &IID_IStorage); } else + { + if (pStgMedium->u.pstg) IStorage_Release( pStgMedium->u.pstg ); pStgMedium->u.pstg = NULL; + } break; case TYMED_GDI: TRACE("TYMED_GDI\n"); @@ -1866,9 +1876,10 @@ RaiseException(DV_E_TYMED, 0, 0, NULL); } - pStgMedium->pUnkForRelease = NULL; if (releaseunk) pBuffer = WdtpInterfacePointer_UserUnmarshal(pFlags, pBuffer, &pStgMedium->pUnkForRelease, &IID_IUnknown); + /* Unlike the IStream / IStorage ifaces, the existing pUnkForRelease + is left intact if a NULL ptr is unmarshalled - see the tests. */ return pBuffer; } @@ -2754,13 +2765,39 @@ return IDataObject_GetData(This, pformatetcIn, pRemoteMedium); } -HRESULT CALLBACK IDataObject_GetDataHere_Proxy( - IDataObject* This, - FORMATETC *pformatetc, - STGMEDIUM *pmedium) -{ - TRACE("(%p)->(%p, %p)\n", This, pformatetc, pmedium); - return IDataObject_RemoteGetDataHere_Proxy(This, pformatetc, pmedium); +HRESULT CALLBACK IDataObject_GetDataHere_Proxy(IDataObject *iface, FORMATETC *fmt, STGMEDIUM *med) +{ + IUnknown *release; + IStorage *stg = NULL; + HRESULT hr; + + TRACE("(%p)->(%p, %p)\n", iface, fmt, med); + + if ((med->tymed & (TYMED_HGLOBAL | TYMED_FILE | TYMED_ISTREAM | TYMED_ISTORAGE)) == 0) + return DV_E_TYMED; + if (med->tymed != fmt->tymed) + return DV_E_TYMED; + + release = med->pUnkForRelease; + med->pUnkForRelease = NULL; + + if (med->tymed == TYMED_ISTREAM || med->tymed == TYMED_ISTORAGE) + { + stg = med->u.pstg; /* This may actually be a stream, but that's ok */ + if (stg) IStorage_AddRef( stg ); + } + + hr = IDataObject_RemoteGetDataHere_Proxy(iface, fmt, med); + + med->pUnkForRelease = release; + if (stg) + { + if (med->u.pstg) + IStorage_Release( med->u.pstg ); + med->u.pstg = stg; + } + + return hr; } HRESULT __RPC_STUB IDataObject_GetDataHere_Stub( Modified: trunk/reactos/media/doc/README.WINE URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=…
============================================================================== --- trunk/reactos/media/doc/README.WINE [iso-8859-1] (original) +++ trunk/reactos/media/doc/README.WINE [iso-8859-1] Tue Nov 17 10:30:40 2015 @@ -144,7 +144,7 @@ reactos/dll/win32/objsel # Synced to WineStaging-1.7.47 reactos/dll/win32/odbc32 # Synced to WineStaging-1.7.37. Depends on port of Linux ODBC. reactos/dll/win32/odbccp32 # Synced to WineStaging-1.7.47 -reactos/dll/win32/ole32 # Synced to WineStaging-1.7.47 +reactos/dll/win32/ole32 # Synced to WineStaging-1.7.55 reactos/dll/win32/oleacc # Synced to WineStaging-1.7.47 reactos/dll/win32/oleaut32 # Synced to WineStaging-1.7.47 reactos/dll/win32/olecli32 # Synced to WineStaging-1.7.47
9 years, 1 month
1
0
0
0
[akhaldi] 69907: [RPCRT4_WINETEST] Sync with Wine Staging 1.7.55. CORE-10536
by akhaldi@svn.reactos.org
Author: akhaldi Date: Tue Nov 17 10:08:11 2015 New Revision: 69907 URL:
http://svn.reactos.org/svn/reactos?rev=69907&view=rev
Log: [RPCRT4_WINETEST] Sync with Wine Staging 1.7.55. CORE-10536 Modified: trunk/rostests/winetests/rpcrt4/cstub.c trunk/rostests/winetests/rpcrt4/ndr_marshall.c trunk/rostests/winetests/rpcrt4/rpc.c trunk/rostests/winetests/rpcrt4/server.c Modified: trunk/rostests/winetests/rpcrt4/cstub.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/rpcrt4/cstub.c?…
============================================================================== --- trunk/rostests/winetests/rpcrt4/cstub.c [iso-8859-1] (original) +++ trunk/rostests/winetests/rpcrt4/cstub.c [iso-8859-1] Tue Nov 17 10:08:11 2015 @@ -397,6 +397,8 @@ { static void *ole32_start = NULL; static void *ole32_end = NULL; + static void *combase_start = NULL; + static void *combase_end = NULL; if (actual == expected) return TRUE; @@ -412,7 +414,21 @@ ole32_end = (void *)((char *) ole32_start + nt_headers->OptionalHeader.SizeOfImage); } - return ole32_start <= actual && actual < ole32_end; + if (ole32_start <= actual && actual < ole32_end) + return TRUE; + + /* On Win8, actual can be located inside combase.dll */ + if (combase_start == NULL || combase_end == NULL) + { + PIMAGE_NT_HEADERS nt_headers; + combase_start = (void *) GetModuleHandleA("combase.dll"); + if (combase_start == NULL) + return FALSE; + nt_headers = (PIMAGE_NT_HEADERS)((char *) combase_start + ((PIMAGE_DOS_HEADER) combase_start)->e_lfanew); + combase_end = (void *)((char *) combase_start + nt_headers->OptionalHeader.SizeOfImage); + } + + return (combase_start <= actual && actual < combase_end); } static const ExtendedProxyFileInfo my_proxy_file_info = Modified: trunk/rostests/winetests/rpcrt4/ndr_marshall.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/rpcrt4/ndr_mars…
============================================================================== --- trunk/rostests/winetests/rpcrt4/ndr_marshall.c [iso-8859-1] (original) +++ trunk/rostests/winetests/rpcrt4/ndr_marshall.c [iso-8859-1] Tue Nov 17 10:08:11 2015 @@ -29,11 +29,12 @@ #include <winbase.h> #include <winnt.h> #include <winerror.h> +#include <ole2.h> #include "rpc.h" #include "rpcdce.h" #include "rpcproxy.h" - +#include "midles.h" static int my_alloc_called; static int my_free_called; @@ -964,7 +965,7 @@ s1.c = 0xa5; s1.l1 = 0xdeadbeef; s1.l2 = 0xcafebabe; - s1.ll = ((LONGLONG) 0xbadefeed << 32) | 0x2468ace0; + s1.ll = ((ULONGLONG) 0xbadefeed << 32) | 0x2468ace0; wiredatalen = 24; memcpy(wiredata, &s1, wiredatalen); @@ -1319,9 +1320,9 @@ ok(stubMsg.ReuseBuffer == 0 || broken(stubMsg.ReuseBuffer == 1), /* win2k */ "stubMsg.ReuseBuffer should have been set to zero instead of %d\n", stubMsg.ReuseBuffer); - ok(stubMsg.CorrDespIncrement == 0xcc || - stubMsg.CorrDespIncrement == 0, - "CorrDespIncrement should have been unset instead of 0x%x\n", stubMsg.CorrDespIncrement); + ok(stubMsg.CorrDespIncrement == 0 || + broken(stubMsg.CorrDespIncrement == 0xcc), /* <= Win 2003 */ + "CorrDespIncrement should have been set to zero instead of 0x%x\n", stubMsg.CorrDespIncrement); ok(stubMsg.FullPtrXlatTables == 0, "stubMsg.BufferLength should have been 0 instead of %p\n", stubMsg.FullPtrXlatTables); } @@ -1558,6 +1559,11 @@ ok(mem == mem_orig, "mem not alloced\n"); ok(my_alloc_called == 0, "alloc called %d\n", my_alloc_called); } + + /* Prevent a memory leak when running with Wine. + Remove once the todo_wine block above is fixed. */ + if (mem != mem_orig) + HeapFree(GetProcessHeap(), 0, mem_orig); my_free_called = 0; StubMsg.Buffer = StubMsg.BufferStart; @@ -2404,6 +2410,85 @@ "NdrGetUserMarshalInfo should have failed with RPC_S_INVALID_ARG instead of %d\n", status); } +static void test_MesEncodeFixedBufferHandleCreate(void) +{ + ULONG encoded_size; + RPC_STATUS status; + handle_t handle; + char *buffer; + + status = MesEncodeFixedBufferHandleCreate(NULL, 0, NULL, NULL); + ok(status == RPC_S_INVALID_ARG, "got %d\n", status); + + status = MesEncodeFixedBufferHandleCreate(NULL, 0, NULL, &handle); + ok(status == RPC_S_INVALID_ARG, "got %d\n", status); + + status = MesEncodeFixedBufferHandleCreate((char*)0xdeadbeef, 0, NULL, &handle); + ok(status == RPC_X_INVALID_BUFFER, "got %d\n", status); + + buffer = (void*)((0xdeadbeef + 7) & ~7); + status = MesEncodeFixedBufferHandleCreate(buffer, 0, NULL, &handle); + ok(status == RPC_S_INVALID_ARG, "got %d\n", status); + + status = MesEncodeFixedBufferHandleCreate(buffer, 0, &encoded_size, &handle); +todo_wine + ok(status == RPC_S_INVALID_ARG, "got %d\n", status); +if (status == RPC_S_OK) + MesHandleFree(handle); + + status = MesEncodeFixedBufferHandleCreate(buffer, 32, NULL, &handle); + ok(status == RPC_S_INVALID_ARG, "got %d\n", status); + + status = MesEncodeFixedBufferHandleCreate(buffer, 32, &encoded_size, &handle); + ok(status == RPC_S_OK, "got %d\n", status); + + status = MesBufferHandleReset(NULL, MES_DYNAMIC_BUFFER_HANDLE, MES_ENCODE, + &buffer, 32, &encoded_size); + ok(status == RPC_S_INVALID_ARG, "got %d\n", status); + + /* convert to dynamic buffer handle */ + status = MesBufferHandleReset(handle, MES_DYNAMIC_BUFFER_HANDLE, MES_ENCODE, + &buffer, 32, &encoded_size); + ok(status == RPC_S_OK, "got %d\n", status); + + status = MesBufferHandleReset(handle, MES_DYNAMIC_BUFFER_HANDLE, MES_ENCODE, + NULL, 32, &encoded_size); + ok(status == RPC_S_INVALID_ARG, "got %d\n", status); + + status = MesBufferHandleReset(handle, MES_DYNAMIC_BUFFER_HANDLE, MES_ENCODE, + &buffer, 32, NULL); + ok(status == RPC_S_INVALID_ARG, "got %d\n", status); + + /* invalid handle type */ + status = MesBufferHandleReset(handle, MES_DYNAMIC_BUFFER_HANDLE+1, MES_ENCODE, + &buffer, 32, &encoded_size); + ok(status == RPC_S_INVALID_ARG, "got %d\n", status); + + status = MesHandleFree(handle); + ok(status == RPC_S_OK, "got %d\n", status); +} + +static void test_NdrCorrelationInitialize(void) +{ + MIDL_STUB_MESSAGE stub_msg; + BYTE buf[256]; + + memset( &stub_msg, 0, sizeof(stub_msg) ); + memset( buf, 0, sizeof(buf) ); + + NdrCorrelationInitialize( &stub_msg, buf, sizeof(buf), 0 ); + ok( stub_msg.CorrDespIncrement == 2 || + broken(stub_msg.CorrDespIncrement == 0), /* <= Win 2003 */ + "got %d\n", stub_msg.CorrDespIncrement ); + + memset( &stub_msg, 0, sizeof(stub_msg) ); + memset( buf, 0, sizeof(buf) ); + + stub_msg.CorrDespIncrement = 1; + NdrCorrelationInitialize( &stub_msg, buf, sizeof(buf), 0 ); + ok( stub_msg.CorrDespIncrement == 1, "got %d\n", stub_msg.CorrDespIncrement ); +} + START_TEST( ndr_marshall ) { determine_pointer_marshalling_style(); @@ -2424,4 +2509,6 @@ test_ndr_buffer(); test_NdrMapCommAndFaultStatus(); test_NdrGetUserMarshalInfo(); -} + test_MesEncodeFixedBufferHandleCreate(); + test_NdrCorrelationInitialize(); +} Modified: trunk/rostests/winetests/rpcrt4/rpc.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/rpcrt4/rpc.c?re…
============================================================================== --- trunk/rostests/winetests/rpcrt4/rpc.c [iso-8859-1] (original) +++ trunk/rostests/winetests/rpcrt4/rpc.c [iso-8859-1] Tue Nov 17 10:08:11 2015 @@ -222,10 +222,8 @@ ok(status == RPC_S_OK, "return wrong\n"); status = RpcMgmtStopServerListening(NULL); -todo_wine { ok(status == RPC_S_NOT_LISTENING, "wrong RpcMgmtStopServerListening error (%u)\n", status); -} status = RpcMgmtWaitServerListen(); ok(status == RPC_S_NOT_LISTENING, @@ -242,9 +240,7 @@ ok(status == RPC_S_OK, "RpcServerRegisterIf failed (%u)\n", status); status = RpcServerListen(1, 20, TRUE); -todo_wine { ok(status == RPC_S_OK, "RpcServerListen failed (%u)\n", status); -} status = RpcServerListen(1, 20, TRUE); todo_wine { @@ -663,7 +659,7 @@ if (!pI_RpcExceptionFilter) { - skip("I_RpcExceptionFilter not exported\n"); + win_skip("I_RpcExceptionFilter not exported\n"); return; } @@ -682,9 +678,9 @@ case STATUS_ACCESS_VIOLATION: case STATUS_ILLEGAL_INSTRUCTION: case STATUS_PRIVILEGED_INSTRUCTION: - case 0xc00000aa /* STATUS_INSTRUCTION_MISALIGNMENT */: + case STATUS_INSTRUCTION_MISALIGNMENT: case STATUS_STACK_OVERFLOW: - case 0xc0000194 /* STATUS_POSSIBLE_DEADLOCK */: + case STATUS_POSSIBLE_DEADLOCK: ok(retval == EXCEPTION_CONTINUE_SEARCH, "I_RpcExceptionFilter(0x%x) should have returned %d instead of %d\n", exception, EXCEPTION_CONTINUE_SEARCH, retval); break; @@ -789,13 +785,17 @@ UUID guid1; BYTE version; RPC_STATUS (WINAPI *pUuidCreateSequential)(UUID *) = (void *)GetProcAddress(GetModuleHandleA("rpcrt4.dll"), "UuidCreateSequential"); + RPC_STATUS (WINAPI *pI_UuidCreate)(UUID *) = (void*)GetProcAddress(GetModuleHandleA("rpcrt4.dll"), "I_UuidCreate"); RPC_STATUS ret; if (!pUuidCreateSequential) { - skip("UuidCreateSequential not exported\n"); + win_skip("UuidCreateSequential not exported\n"); return; } + + ok(pI_UuidCreate != pUuidCreateSequential, "got %p, %p\n", pI_UuidCreate, pUuidCreateSequential); + ret = pUuidCreateSequential(&guid1); ok(!ret || ret == RPC_S_UUID_LOCAL_ONLY, "expected RPC_S_OK or RPC_S_UUID_LOCAL_ONLY, got %08x\n", ret); @@ -834,6 +834,14 @@ ok(!memcmp(guid1.Data4, guid2.Data4, sizeof(guid2.Data4)), "unexpected value in MAC address: %s\n", wine_dbgstr_guid(&guid2)); + + /* I_UuidCreate does exactly the same */ + pI_UuidCreate(&guid2); + version = (guid2.Data3 & 0xf000) >> 12; + ok(version == 1, "unexpected version %d\n", version); + ok(!memcmp(guid1.Data4, guid2.Data4, sizeof(guid2.Data4)), + "unexpected value in MAC address: %s\n", + wine_dbgstr_guid(&guid2)); } } Modified: trunk/rostests/winetests/rpcrt4/server.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/rpcrt4/server.c…
============================================================================== --- trunk/rostests/winetests/rpcrt4/server.c [iso-8859-1] (original) +++ trunk/rostests/winetests/rpcrt4/server.c [iso-8859-1] Tue Nov 17 10:08:11 2015 @@ -1531,6 +1531,26 @@ ok(status == RPC_S_OK, "RpcBindingSetAuthInfoExA failed %d\n", status); } +#define test_is_server_listening(a,b) _test_is_server_listening(__LINE__,a,b) +static void _test_is_server_listening(unsigned line, RPC_BINDING_HANDLE binding, RPC_STATUS expected_status) +{ + RPC_STATUS status; + status = RpcMgmtIsServerListening(binding); + ok_(__FILE__,line)(status == expected_status, "RpcMgmtIsServerListening returned %u, expected %u\n", + status, expected_status); +} + +#define test_is_server_listening2(a,b,c) _test_is_server_listening2(__LINE__,a,b,c) +static void _test_is_server_listening2(unsigned line, RPC_BINDING_HANDLE binding, RPC_STATUS expected_status, + RPC_STATUS expected_status2) +{ + RPC_STATUS status; + status = RpcMgmtIsServerListening(binding); + ok_(__FILE__,line)(status == expected_status || status == expected_status2, + "RpcMgmtIsServerListening returned %u, expected %u or %u\n", + status, expected_status, expected_status2); +} + static void client(const char *test) { @@ -1552,6 +1572,7 @@ run_tests(); authinfo_test(RPC_PROTSEQ_TCP, 0); + test_is_server_listening2(IServer_IfHandle, RPC_S_OK, RPC_S_ACCESS_DENIED); ok(RPC_S_OK == RpcStringFreeA(&binding), "RpcStringFree\n"); ok(RPC_S_OK == RpcBindingFree(&IServer_IfHandle), "RpcBindingFree\n"); @@ -1563,6 +1584,7 @@ set_auth_info(IServer_IfHandle); authinfo_test(RPC_PROTSEQ_TCP, 1); + test_is_server_listening(IServer_IfHandle, RPC_S_ACCESS_DENIED); ok(RPC_S_OK == RpcStringFreeA(&binding), "RpcStringFree\n"); ok(RPC_S_OK == RpcBindingFree(&IServer_IfHandle), "RpcBindingFree\n"); @@ -1574,6 +1596,7 @@ run_tests(); /* can cause RPC_X_BAD_STUB_DATA exception */ authinfo_test(RPC_PROTSEQ_LRPC, 0); + test_is_server_listening(IServer_IfHandle, RPC_S_OK); ok(RPC_S_OK == RpcStringFreeA(&binding), "RpcStringFree\n"); ok(RPC_S_OK == RpcBindingFree(&IServer_IfHandle), "RpcBindingFree\n"); @@ -1585,6 +1608,7 @@ set_auth_info(IServer_IfHandle); authinfo_test(RPC_PROTSEQ_LRPC, 1); + test_is_server_listening(IServer_IfHandle, RPC_S_OK); ok(RPC_S_OK == RpcStringFreeA(&binding), "RpcStringFree\n"); ok(RPC_S_OK == RpcBindingFree(&IServer_IfHandle), "RpcBindingFree\n"); @@ -1594,9 +1618,12 @@ ok(RPC_S_OK == RpcStringBindingComposeA(NULL, np, address_np, pipe, NULL, &binding), "RpcStringBindingCompose\n"); ok(RPC_S_OK == RpcBindingFromStringBindingA(binding, &IServer_IfHandle), "RpcBindingFromStringBinding\n"); + test_is_server_listening(IServer_IfHandle, RPC_S_OK); run_tests(); authinfo_test(RPC_PROTSEQ_NMP, 0); + test_is_server_listening(IServer_IfHandle, RPC_S_OK); stop(); + test_is_server_listening(IServer_IfHandle, RPC_S_NOT_LISTENING); ok(RPC_S_OK == RpcStringFreeA(&binding), "RpcStringFree\n"); ok(RPC_S_OK == RpcBindingFree(&IServer_IfHandle), "RpcBindingFree\n"); @@ -1637,8 +1664,10 @@ else status = RpcServerRegisterIf(s_IServer_v0_0_s_ifspec, NULL, NULL); ok(status == RPC_S_OK, "RpcServerRegisterIf failed with status %d\n", status); + test_is_server_listening(NULL, RPC_S_NOT_LISTENING); status = RpcServerListen(1, 20, TRUE); ok(status == RPC_S_OK, "RpcServerListen failed with status %d\n", status); + test_is_server_listening(NULL, RPC_S_OK); stop_event = CreateEventW(NULL, FALSE, FALSE, NULL); ok(stop_event != NULL, "CreateEvent failed with error %d\n", GetLastError());
9 years, 1 month
1
0
0
0
[akhaldi] 69906: [RPCRT4] Sync with Wine Staging 1.7.55. CORE-10536
by akhaldi@svn.reactos.org
Author: akhaldi Date: Tue Nov 17 10:08:00 2015 New Revision: 69906 URL:
http://svn.reactos.org/svn/reactos?rev=69906&view=rev
Log: [RPCRT4] Sync with Wine Staging 1.7.55. CORE-10536 Modified: trunk/reactos/dll/win32/rpcrt4/CMakeLists.txt trunk/reactos/dll/win32/rpcrt4/cpsf.c trunk/reactos/dll/win32/rpcrt4/cstub.c trunk/reactos/dll/win32/rpcrt4/ndr_clientserver.c trunk/reactos/dll/win32/rpcrt4/ndr_contexthandle.c trunk/reactos/dll/win32/rpcrt4/ndr_es.c trunk/reactos/dll/win32/rpcrt4/ndr_marshall.c trunk/reactos/dll/win32/rpcrt4/ndr_ole.c trunk/reactos/dll/win32/rpcrt4/ndr_stubless.c trunk/reactos/dll/win32/rpcrt4/ndr_stubless.h trunk/reactos/dll/win32/rpcrt4/rpc_assoc.c trunk/reactos/dll/win32/rpcrt4/rpc_binding.c trunk/reactos/dll/win32/rpcrt4/rpc_binding.h trunk/reactos/dll/win32/rpcrt4/rpc_epmap.c trunk/reactos/dll/win32/rpcrt4/rpc_server.c trunk/reactos/dll/win32/rpcrt4/rpc_transport.c trunk/reactos/dll/win32/rpcrt4/rpcrt4.spec trunk/reactos/dll/win32/rpcrt4/rpcrt4_main.c trunk/reactos/dll/win32/rpcrt4/rpcrt4_ros.diff trunk/reactos/media/doc/README.WINE Modified: trunk/reactos/dll/win32/rpcrt4/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/rpcrt4/CMakeList…
============================================================================== --- trunk/reactos/dll/win32/rpcrt4/CMakeLists.txt [iso-8859-1] (original) +++ trunk/reactos/dll/win32/rpcrt4/CMakeLists.txt [iso-8859-1] Tue Nov 17 10:08:00 2015 @@ -1,3 +1,6 @@ + +remove_definitions(-D_WIN32_WINNT=0x502) +add_definitions(-D_WIN32_WINNT=0x600) include_directories(BEFORE ${REACTOS_SOURCE_DIR}/include/reactos/wine) spec2def(rpcrt4.dll rpcrt4.spec ADD_IMPORTLIB) @@ -49,6 +52,6 @@ set_module_type(rpcrt4 win32dll) target_link_libraries(rpcrt4 wine uuid ${PSEH_LIB}) add_delay_importlibs(rpcrt4 iphlpapi wininet secur32 user32) -add_importlibs(rpcrt4 advapi32 ws2_32 shlwapi msvcrt kernel32 ntdll) +add_importlibs(rpcrt4 advapi32 advapi32_vista ws2_32 msvcrt kernel32 ntdll) add_pch(rpcrt4 precomp.h SOURCE) add_cd_file(TARGET rpcrt4 DESTINATION reactos/system32 FOR all) Modified: trunk/reactos/dll/win32/rpcrt4/cpsf.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/rpcrt4/cpsf.c?re…
============================================================================== --- trunk/reactos/dll/win32/rpcrt4/cpsf.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/rpcrt4/cpsf.c [iso-8859-1] Tue Nov 17 10:08:00 2015 @@ -314,7 +314,7 @@ strcpyW( keyname, interfaceW ); format_clsid( keyname + strlenW(keyname), proxy->header.piid ); - SHDeleteKeyW(HKEY_CLASSES_ROOT, keyname); + RegDeleteTreeW(HKEY_CLASSES_ROOT, keyname); } pProxyFileList++; } @@ -322,7 +322,7 @@ /* unregister clsid */ strcpyW( keyname, clsidW ); strcatW( keyname, clsid ); - SHDeleteKeyW(HKEY_CLASSES_ROOT, keyname); + RegDeleteTreeW(HKEY_CLASSES_ROOT, keyname); return S_OK; } Modified: trunk/reactos/dll/win32/rpcrt4/cstub.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/rpcrt4/cstub.c?r…
============================================================================== --- trunk/reactos/dll/win32/rpcrt4/cstub.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/rpcrt4/cstub.c [iso-8859-1] Tue Nov 17 10:08:00 2015 @@ -41,7 +41,7 @@ static inline cstdstubbuffer_delegating_t *impl_from_delegating( IRpcStubBuffer *iface ) { - return (cstdstubbuffer_delegating_t*)((char *)iface - FIELD_OFFSET(cstdstubbuffer_delegating_t, stub_buffer)); + return CONTAINING_RECORD(iface, cstdstubbuffer_delegating_t, stub_buffer); } HRESULT CStdStubBuffer_Construct(REFIID riid, Modified: trunk/reactos/dll/win32/rpcrt4/ndr_clientserver.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/rpcrt4/ndr_clien…
============================================================================== --- trunk/reactos/dll/win32/rpcrt4/ndr_clientserver.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/rpcrt4/ndr_clientserver.c [iso-8859-1] Tue Nov 17 10:08:00 2015 @@ -105,6 +105,7 @@ pStubMsg->pPointerQueueState = NULL; pStubMsg->IgnoreEmbeddedPointers = 0; pStubMsg->PointerBufferMark = NULL; + pStubMsg->CorrDespIncrement = 0; pStubMsg->uFlags = 0; pStubMsg->UniquePtrCount = 0; pStubMsg->pfnAllocate = pStubDesc->pfnAllocate; Modified: trunk/reactos/dll/win32/rpcrt4/ndr_contexthandle.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/rpcrt4/ndr_conte…
============================================================================== --- trunk/reactos/dll/win32/rpcrt4/ndr_contexthandle.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/rpcrt4/ndr_contexthandle.c [iso-8859-1] Tue Nov 17 10:08:00 2015 @@ -84,7 +84,7 @@ if (!handle) { ERR("invalid handle %p\n", CContext); - RpcRaiseException(ERROR_INVALID_HANDLE); + RpcRaiseException(RPC_X_SS_CONTEXT_MISMATCH); } return handle; } @@ -150,7 +150,15 @@ RpcRaiseException(status); } -static UINT ndr_update_context_handle(NDR_CCONTEXT *CContext, +/*********************************************************************** + * RpcSsDontSerializeContext [RPCRT4.@] + */ + void WINAPI RpcSsDontSerializeContext(void) +{ + FIXME("stub\n"); +} + +static RPC_STATUS ndr_update_context_handle(NDR_CCONTEXT *CContext, RPC_BINDING_HANDLE hBinding, const ndr_context_handle *chi) { @@ -163,7 +171,7 @@ { che = get_context_entry(*CContext); if (!che) - return ERROR_INVALID_HANDLE; + return RPC_X_SS_CONTEXT_MISMATCH; list_remove(&che->entry); RpcBindingFree(&che->handle); HeapFree(GetProcessHeap(), 0, che); @@ -175,7 +183,7 @@ { che = HeapAlloc(GetProcessHeap(), 0, sizeof *che); if (!che) - return ERROR_NOT_ENOUGH_MEMORY; + return RPC_X_NO_MEMORY; che->magic = NDR_CONTEXT_HANDLE_MAGIC; RpcBindingCopy(hBinding, &che->handle); list_add_tail(&context_handle_list, &che->entry); @@ -184,7 +192,7 @@ *CContext = che; - return ERROR_SUCCESS; + return RPC_S_OK; } /*********************************************************************** @@ -194,16 +202,16 @@ RPC_BINDING_HANDLE hBinding, void *pBuff, ULONG DataRepresentation) { - UINT r; + RPC_STATUS status; TRACE("*%p=(%p) %p %p %08x\n", CContext, *CContext, hBinding, pBuff, DataRepresentation); EnterCriticalSection(&ndr_context_cs); - r = ndr_update_context_handle(CContext, hBinding, pBuff); + status = ndr_update_context_handle(CContext, hBinding, pBuff); LeaveCriticalSection(&ndr_context_cs); - if (r) - RpcRaiseException(r); + if (status) + RpcRaiseException(status); } /*********************************************************************** @@ -248,7 +256,7 @@ hBinding, SContext, pBuff, userRunDownIn, CtxGuard, Flags); if (!binding->server || !binding->Assoc) - RpcRaiseException(ERROR_INVALID_HANDLE); + RpcRaiseException(RPC_S_INVALID_BINDING); if (Flags & RPC_CONTEXT_HANDLE_FLAGS) FIXME("unimplemented flags: 0x%x\n", Flags & RPC_CONTEXT_HANDLE_FLAGS); @@ -267,7 +275,7 @@ else { if (!RpcContextHandle_IsGuardCorrect(SContext, CtxGuard)) - RpcRaiseException(ERROR_INVALID_HANDLE); + RpcRaiseException(RPC_X_SS_CONTEXT_MISMATCH); memset(ndr, 0, sizeof(*ndr)); RPCRT4_RemoveThreadContextHandle(SContext); @@ -322,7 +330,7 @@ hBinding, pBuff, DataRepresentation, CtxGuard, Flags); if (!binding->server || !binding->Assoc) - RpcRaiseException(ERROR_INVALID_HANDLE); + RpcRaiseException(RPC_S_INVALID_BINDING); if (Flags & RPC_CONTEXT_HANDLE_FLAGS) FIXME("unimplemented flags: 0x%x\n", Flags & RPC_CONTEXT_HANDLE_FLAGS); @@ -336,7 +344,7 @@ if (context_ndr->attributes) { ERR("non-null attributes 0x%x\n", context_ndr->attributes); - status = ERROR_INVALID_HANDLE; + status = RPC_X_SS_CONTEXT_MISMATCH; } else status = RpcServerAssoc_FindContextHandle(binding->Assoc, Modified: trunk/reactos/dll/win32/rpcrt4/ndr_es.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/rpcrt4/ndr_es.c?…
============================================================================== --- trunk/reactos/dll/win32/rpcrt4/ndr_es.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/rpcrt4/ndr_es.c [iso-8859-1] Tue Nov 17 10:08:00 2015 @@ -30,6 +30,7 @@ /* even if we are unmarshalling, as we don't want pointers to be pointed * to buffer memory */ pEsMsg->StubMsg.IsClient = TRUE; + pEsMsg->MesVersion = 1; } /*********************************************************************** @@ -45,7 +46,7 @@ pEsMsg = HeapAlloc(GetProcessHeap(), 0, sizeof(*pEsMsg)); if (!pEsMsg) - return ERROR_OUTOFMEMORY; + return RPC_S_OUT_OF_MEMORY; init_MIDL_ES_MESSAGE(pEsMsg); @@ -72,7 +73,7 @@ pEsMsg = HeapAlloc(GetProcessHeap(), 0, sizeof(*pEsMsg)); if (!pEsMsg) - return ERROR_OUTOFMEMORY; + return RPC_S_OUT_OF_MEMORY; init_MIDL_ES_MESSAGE(pEsMsg); @@ -111,6 +112,40 @@ } /*********************************************************************** + * MesBufferHandleReset [RPCRT4.@] + */ +RPC_STATUS WINAPI MesBufferHandleReset(handle_t Handle, ULONG HandleStyle, + MIDL_ES_CODE Operation, char **Buffer, ULONG BufferSize, ULONG *EncodedSize) +{ + MIDL_ES_MESSAGE *pEsMsg = (MIDL_ES_MESSAGE *)Handle; + + TRACE("(%p, %u, %d, %p, %u, %p)\n", Handle, HandleStyle, Operation, Buffer, + BufferSize, EncodedSize); + + if (!Handle || !Buffer || !EncodedSize) + return RPC_S_INVALID_ARG; + + if (Operation != MES_ENCODE && Operation != MES_DECODE && Operation != MES_ENCODE_NDR64) + return RPC_S_INVALID_ARG; + + if (HandleStyle != MES_FIXED_BUFFER_HANDLE && HandleStyle != MES_DYNAMIC_BUFFER_HANDLE) + return RPC_S_INVALID_ARG; + + init_MIDL_ES_MESSAGE(pEsMsg); + + pEsMsg->Operation = Operation; + pEsMsg->HandleStyle = HandleStyle; + if (HandleStyle == MES_FIXED_BUFFER_HANDLE) + pEsMsg->Buffer = (unsigned char*)*Buffer; + else + pEsMsg->pDynBuffer = (unsigned char**)Buffer; + pEsMsg->BufferSize = BufferSize; + pEsMsg->pEncodedSize = EncodedSize; + + return RPC_S_OK; +} + +/*********************************************************************** * MesHandleFree [RPCRT4.@] */ RPC_STATUS WINAPI MesHandleFree(handle_t Handle) @@ -120,6 +155,17 @@ return RPC_S_OK; } +static RPC_STATUS validate_mes_buffer_pointer(const char *Buffer) +{ + if (!Buffer) + return RPC_S_INVALID_ARG; + + if (((ULONG_PTR)Buffer & 7) != 0) + return RPC_X_INVALID_BUFFER; + + return RPC_S_OK; +} + /*********************************************************************** * MesEncodeFixedBufferHandleCreate [RPCRT4.@] */ @@ -127,12 +173,21 @@ char *Buffer, ULONG BufferSize, ULONG *pEncodedSize, handle_t *pHandle) { MIDL_ES_MESSAGE *pEsMsg; + RPC_STATUS status; TRACE("(%p, %d, %p, %p)\n", Buffer, BufferSize, pEncodedSize, pHandle); + + if ((status = validate_mes_buffer_pointer(Buffer))) + return status; + + if (!pEncodedSize) + return RPC_S_INVALID_ARG; + + /* FIXME: check BufferSize too */ pEsMsg = HeapAlloc(GetProcessHeap(), 0, sizeof(*pEsMsg)); if (!pEsMsg) - return ERROR_OUTOFMEMORY; + return RPC_S_OUT_OF_MEMORY; init_MIDL_ES_MESSAGE(pEsMsg); @@ -150,10 +205,29 @@ /*********************************************************************** * MesEncodeDynBufferHandleCreate [RPCRT4.@] */ -RPC_STATUS RPC_ENTRY MesEncodeDynBufferHandleCreate(char **ppBuffer, +RPC_STATUS RPC_ENTRY MesEncodeDynBufferHandleCreate(char **Buffer, ULONG *pEncodedSize, handle_t *pHandle) { - FIXME("%p %p %p stub\n", ppBuffer, pEncodedSize, pHandle); + MIDL_ES_MESSAGE *pEsMsg; + + TRACE("(%p, %p, %p)\n", Buffer, pEncodedSize, pHandle); + + if (!pEncodedSize) + return RPC_S_INVALID_ARG; + + pEsMsg = HeapAlloc(GetProcessHeap(), 0, sizeof(*pEsMsg)); + if (!pEsMsg) + return RPC_S_OUT_OF_MEMORY; + + init_MIDL_ES_MESSAGE(pEsMsg); + + pEsMsg->Operation = MES_ENCODE; + pEsMsg->HandleStyle = MES_DYNAMIC_BUFFER_HANDLE; + pEsMsg->pDynBuffer = (unsigned char **)Buffer; + pEsMsg->pEncodedSize = pEncodedSize; + + *pHandle = (handle_t)pEsMsg; + return RPC_S_OK; } @@ -164,12 +238,16 @@ char *Buffer, ULONG BufferSize, handle_t *pHandle) { MIDL_ES_MESSAGE *pEsMsg; + RPC_STATUS status; TRACE("(%p, %d, %p)\n", Buffer, BufferSize, pHandle); + + if ((status = validate_mes_buffer_pointer(Buffer))) + return status; pEsMsg = HeapAlloc(GetProcessHeap(), 0, sizeof(*pEsMsg)); if (!pEsMsg) - return ERROR_OUTOFMEMORY; + return RPC_S_OUT_OF_MEMORY; init_MIDL_ES_MESSAGE(pEsMsg); @@ -193,7 +271,7 @@ if (tmpsize < size) { ERR("not enough bytes allocated - requested %d, got %d\n", size, tmpsize); - RpcRaiseException(ERROR_OUTOFMEMORY); + RpcRaiseException(RPC_S_OUT_OF_MEMORY); } } else if (pEsMsg->HandleStyle == MES_FIXED_BUFFER_HANDLE) @@ -214,7 +292,7 @@ if (tmpsize < size) { ERR("not enough bytes read - requested %d, got %d\n", size, tmpsize); - RpcRaiseException(ERROR_OUTOFMEMORY); + RpcRaiseException(RPC_S_OUT_OF_MEMORY); } } else Modified: trunk/reactos/dll/win32/rpcrt4/ndr_marshall.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/rpcrt4/ndr_marsh…
============================================================================== --- trunk/reactos/dll/win32/rpcrt4/ndr_marshall.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/rpcrt4/ndr_marshall.c [iso-8859-1] Tue Nov 17 10:08:00 2015 @@ -183,7 +183,9 @@ NdrUserMarshalMarshall, 0, 0, /* 0xb7 */ - NdrRangeMarshall + NdrRangeMarshall, + NdrBaseTypeMarshall, + NdrBaseTypeMarshall }; const NDR_UNMARSHALL NdrUnmarshaller[NDR_TABLE_SIZE] = { 0, @@ -225,7 +227,9 @@ NdrUserMarshalUnmarshall, 0, 0, /* 0xb7 */ - NdrRangeUnmarshall + NdrRangeUnmarshall, + NdrBaseTypeUnmarshall, + NdrBaseTypeUnmarshall }; const NDR_BUFFERSIZE NdrBufferSizer[NDR_TABLE_SIZE] = { 0, @@ -267,7 +271,9 @@ NdrUserMarshalBufferSize, 0, 0, /* 0xb7 */ - NdrRangeBufferSize + NdrRangeBufferSize, + NdrBaseTypeBufferSize, + NdrBaseTypeBufferSize }; const NDR_MEMORYSIZE NdrMemorySizer[NDR_TABLE_SIZE] = { 0, @@ -309,7 +315,9 @@ NdrUserMarshalMemorySize, 0, 0, /* 0xb7 */ - NdrRangeMemorySize + NdrRangeMemorySize, + NdrBaseTypeMemorySize, + NdrBaseTypeMemorySize }; const NDR_FREE NdrFreer[NDR_TABLE_SIZE] = { 0, @@ -350,7 +358,9 @@ NdrUserMarshalFree, 0, 0, /* 0xb7 */ - NdrRangeFree + NdrRangeFree, + NdrBaseTypeFree, + NdrBaseTypeFree }; typedef struct _NDR_MEMORY_LIST @@ -377,7 +387,7 @@ * * NOTES * The memory block is always 8-byte aligned. - * If the function is unable to allocate memory an ERROR_OUTOFMEMORY + * If the function is unable to allocate memory an RPC_X_NO_MEMORY * exception is raised. */ void * WINAPI NdrAllocate(MIDL_STUB_MESSAGE *pStubMsg, SIZE_T len) @@ -397,7 +407,7 @@ } p = pStubMsg->pfnAllocate(adjusted_len); - if (!p) RpcRaiseException(ERROR_OUTOFMEMORY); + if (!p) RpcRaiseException(RPC_X_NO_MEMORY); mem_list = (NDR_MEMORY_LIST *)((char *)p + aligned_len); mem_list->magic = MEML_MAGIC; @@ -422,6 +432,11 @@ return (*(const ULONG *)pFormat != -1); } +static inline PFORMAT_STRING SkipConformance(const PMIDL_STUB_MESSAGE pStubMsg, const PFORMAT_STRING pFormat) +{ + return pFormat + 4 + pStubMsg->CorrDespIncrement; +} + static PFORMAT_STRING ReadConformance(MIDL_STUB_MESSAGE *pStubMsg, PFORMAT_STRING pFormat) { align_pointer(&pStubMsg->Buffer, 4); @@ -430,10 +445,7 @@ pStubMsg->MaxCount = NDR_LOCAL_UINT32_READ(pStubMsg->Buffer); pStubMsg->Buffer += 4; TRACE("unmarshalled conformance is %ld\n", pStubMsg->MaxCount); - if (pStubMsg->fHasNewCorrDesc) - return pFormat+6; - else - return pFormat+4; + return SkipConformance(pStubMsg, pFormat); } static inline PFORMAT_STRING ReadVariance(MIDL_STUB_MESSAGE *pStubMsg, PFORMAT_STRING pFormat, ULONG MaxValue) @@ -465,10 +477,7 @@ } done: - if (pStubMsg->fHasNewCorrDesc) - return pFormat+6; - else - return pFormat+4; + return SkipConformance(pStubMsg, pFormat); } /* writes the conformance value to the buffer */ @@ -646,20 +655,8 @@ finish_conf: TRACE("resulting conformance is %ld\n", *pCount); - if (pStubMsg->fHasNewCorrDesc) - return pFormat+6; - else - return pFormat+4; -} - -static inline PFORMAT_STRING SkipConformance(PMIDL_STUB_MESSAGE pStubMsg, - PFORMAT_STRING pFormat) -{ - if (pStubMsg->fHasNewCorrDesc) - pFormat += 6; - else - pFormat += 4; - return pFormat; + + return SkipConformance(pStubMsg, pFormat); } static inline PFORMAT_STRING SkipVariance(PMIDL_STUB_MESSAGE pStubMsg, PFORMAT_STRING pFormat) @@ -2767,11 +2764,7 @@ } case RPC_FC_NON_ENCAPSULATED_UNION: pFormat += 2; - if (pStubMsg->fHasNewCorrDesc) - pFormat += 6; - else - pFormat += 4; - + pFormat = SkipConformance(pStubMsg, pFormat); pFormat += *(const SHORT*)pFormat; return *(const SHORT*)pFormat; case RPC_FC_IP: @@ -4596,7 +4589,7 @@ if (umcb->pStubMsg->Buffer < buffer_start || umcb->pStubMsg->Buffer > buffer_end) - return ERROR_INVALID_USER_BUFFER; + return RPC_X_INVALID_BUFFER; umi->u1.Level1.Buffer = umcb->pStubMsg->Buffer; umi->u1.Level1.BufferSize = buffer_end - umcb->pStubMsg->Buffer; @@ -6168,10 +6161,7 @@ } (*ppFormat)++; - if (pStubMsg->fHasNewCorrDesc) - *ppFormat += 6; - else - *ppFormat += 4; + *ppFormat = SkipConformance(pStubMsg, *ppFormat); return discriminant; } @@ -7198,7 +7188,11 @@ */ void WINAPI NdrCorrelationInitialize(PMIDL_STUB_MESSAGE pStubMsg, void *pMemory, ULONG CacheSize, ULONG Flags) { - FIXME("(%p, %p, %d, 0x%x): stub\n", pStubMsg, pMemory, CacheSize, Flags); + FIXME("(%p, %p, %d, 0x%x): semi-stub\n", pStubMsg, pMemory, CacheSize, Flags); + + if (pStubMsg->CorrDespIncrement == 0) + pStubMsg->CorrDespIncrement = 2; /* size of the normal (non-range) /robust payload */ + pStubMsg->fHasNewCorrDesc = TRUE; } Modified: trunk/reactos/dll/win32/rpcrt4/ndr_ole.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/rpcrt4/ndr_ole.c…
============================================================================== --- trunk/reactos/dll/win32/rpcrt4/ndr_ole.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/rpcrt4/ndr_ole.c [iso-8859-1] Tue Nov 17 10:08:00 2015 @@ -75,14 +75,15 @@ REFIID riid, LPVOID *obj) { - RpcStreamImpl *This = impl_from_IStream(iface); if (IsEqualGUID(&IID_IUnknown, riid) || IsEqualGUID(&IID_ISequentialStream, riid) || IsEqualGUID(&IID_IStream, riid)) { - *obj = This; - InterlockedIncrement( &This->RefCount ); + *obj = iface; + IStream_AddRef(iface); return S_OK; } + + *obj = NULL; return E_NOINTERFACE; } @@ -100,7 +101,6 @@ TRACE("size=%d\n", *This->size); This->pMsg->Buffer = This->data + *This->size; HeapFree(GetProcessHeap(),0,This); - return 0; } return ref; } @@ -174,6 +174,58 @@ return S_OK; } +static HRESULT WINAPI RpcStream_CopyTo(IStream *iface, IStream *dest, + ULARGE_INTEGER len, ULARGE_INTEGER *read, ULARGE_INTEGER *written) +{ + RpcStreamImpl *This = impl_from_IStream(iface); + FIXME("(%p): stub\n", This); + return E_NOTIMPL; +} + +static HRESULT WINAPI RpcStream_Commit(IStream *iface, DWORD flags) +{ + RpcStreamImpl *This = impl_from_IStream(iface); + FIXME("(%p)->(0x%08x): stub\n", This, flags); + return E_NOTIMPL; +} + +static HRESULT WINAPI RpcStream_Revert(IStream *iface) +{ + RpcStreamImpl *This = impl_from_IStream(iface); + FIXME("(%p): stub\n", This); + return E_NOTIMPL; +} + +static HRESULT WINAPI RpcStream_LockRegion(IStream *iface, + ULARGE_INTEGER offset, ULARGE_INTEGER len, DWORD locktype) +{ + RpcStreamImpl *This = impl_from_IStream(iface); + FIXME("(%p): stub\n", This); + return E_NOTIMPL; +} + +static HRESULT WINAPI RpcStream_UnlockRegion(IStream *iface, + ULARGE_INTEGER offset, ULARGE_INTEGER len, DWORD locktype) +{ + RpcStreamImpl *This = impl_from_IStream(iface); + FIXME("(%p): stub\n", This); + return E_NOTIMPL; +} + +static HRESULT WINAPI RpcStream_Stat(IStream *iface, STATSTG *stat, DWORD flag) +{ + RpcStreamImpl *This = impl_from_IStream(iface); + FIXME("(%p): stub\n", This); + return E_NOTIMPL; +} + +static HRESULT WINAPI RpcStream_Clone(IStream *iface, IStream **cloned) +{ + RpcStreamImpl *This = impl_from_IStream(iface); + FIXME("(%p): stub\n", This); + return E_NOTIMPL; +} + static const IStreamVtbl RpcStream_Vtbl = { RpcStream_QueryInterface, @@ -183,29 +235,34 @@ RpcStream_Write, RpcStream_Seek, RpcStream_SetSize, - NULL, /* CopyTo */ - NULL, /* Commit */ - NULL, /* Revert */ - NULL, /* LockRegion */ - NULL, /* UnlockRegion */ - NULL, /* Stat */ - NULL /* Clone */ + RpcStream_CopyTo, + RpcStream_Commit, + RpcStream_Revert, + RpcStream_LockRegion, + RpcStream_UnlockRegion, + RpcStream_Stat, + RpcStream_Clone }; -static LPSTREAM RpcStream_Create(PMIDL_STUB_MESSAGE pStubMsg, BOOL init) +static HRESULT RpcStream_Create(PMIDL_STUB_MESSAGE pStubMsg, BOOL init, ULONG *size, IStream **stream) { RpcStreamImpl *This; - This = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(RpcStreamImpl)); - if (!This) return NULL; + + *stream = NULL; + This = HeapAlloc(GetProcessHeap(), 0, sizeof(RpcStreamImpl)); + if (!This) return E_OUTOFMEMORY; This->IStream_iface.lpVtbl = &RpcStream_Vtbl; This->RefCount = 1; This->pMsg = pStubMsg; This->size = (LPDWORD)pStubMsg->Buffer; - This->data = (unsigned char*)(This->size + 1); + This->data = pStubMsg->Buffer + sizeof(DWORD); This->pos = 0; if (init) *This->size = 0; TRACE("init size=%d\n", *This->size); - return (LPSTREAM)This; + + if (size) *size = *This->size; + *stream = &This->IStream_iface; + return S_OK; } static const IID* get_ip_iid(PMIDL_STUB_MESSAGE pStubMsg, unsigned char *pMemory, PFORMAT_STRING pFormat) @@ -240,19 +297,17 @@ pStubMsg->MaxCount = 0; if (!LoadCOM()) return NULL; if (pStubMsg->Buffer + sizeof(DWORD) <= (unsigned char *)pStubMsg->RpcMsg->Buffer + pStubMsg->BufferLength) { - stream = RpcStream_Create(pStubMsg, TRUE); - if (stream) { + hr = RpcStream_Create(pStubMsg, TRUE, NULL, &stream); + if (hr == S_OK) { if (pMemory) hr = COM_MarshalInterface(stream, riid, (LPUNKNOWN)pMemory, pStubMsg->dwDestContext, pStubMsg->pvDestContext, MSHLFLAGS_NORMAL); - else - hr = S_OK; - IStream_Release(stream); - if (FAILED(hr)) - RpcRaiseException(hr); } + + if (FAILED(hr)) + RpcRaiseException(hr); } return NULL; } @@ -272,13 +327,16 @@ if (!LoadCOM()) return NULL; *(LPVOID*)ppMemory = NULL; if (pStubMsg->Buffer + sizeof(DWORD) < (unsigned char *)pStubMsg->RpcMsg->Buffer + pStubMsg->BufferLength) { - stream = RpcStream_Create(pStubMsg, FALSE); - if (!stream) RpcRaiseException(E_OUTOFMEMORY); - if (*((RpcStreamImpl *)stream)->size != 0) - hr = COM_UnmarshalInterface(stream, &IID_NULL, (LPVOID*)ppMemory); - else - hr = S_OK; - IStream_Release(stream); + ULONG size; + + hr = RpcStream_Create(pStubMsg, FALSE, &size, &stream); + if (hr == S_OK) { + if (size != 0) + hr = COM_UnmarshalInterface(stream, &IID_NULL, (LPVOID*)ppMemory); + + IStream_Release(stream); + } + if (FAILED(hr)) RpcRaiseException(hr); } Modified: trunk/reactos/dll/win32/rpcrt4/ndr_stubless.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/rpcrt4/ndr_stubl…
============================================================================== --- trunk/reactos/dll/win32/rpcrt4/ndr_stubless.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/rpcrt4/ndr_stubless.c [iso-8859-1] Tue Nov 17 10:08:00 2015 @@ -29,6 +29,11 @@ #define NDR_TABLE_MASK 127 +static inline BOOL is_oicf_stubdesc(const PMIDL_STUB_DESC pStubDesc) +{ + return pStubDesc->Version >= 0x20000; +} + static inline void call_buffer_sizer(PMIDL_STUB_MESSAGE pStubMsg, unsigned char *pMemory, const NDR_PARAM_OIF *param) { @@ -323,7 +328,11 @@ *phBinding = *pStubMsg->StubDesc->IMPLICIT_HANDLE_INFO.pPrimitiveHandle; break; case RPC_FC_CALLBACK_HANDLE: /* implicit callback */ - FIXME("RPC_FC_CALLBACK_HANDLE\n"); + TRACE("RPC_FC_CALLBACK_HANDLE\n"); + /* server calls callback procedures only in response to remote call, and most recent + binding handle is used. Calling back to a client can potentially result in another + callback with different current handle. */ + *phBinding = I_RpcGetCurrentCallHandle(); break; case RPC_FC_AUTO_HANDLE: /* implicit auto handle */ /* strictly speaking, it isn't necessary to set hBinding here @@ -645,7 +654,7 @@ if (!pFormat) goto done; } - if (pStubDesc->Version >= 0x20000) /* -Oicf format */ + if (is_oicf_stubdesc(pStubDesc)) /* -Oicf format */ { const NDR_PROC_PARTIAL_OIF_HEADER *pOIFHeader = (const NDR_PROC_PARTIAL_OIF_HEADER *)pFormat; @@ -706,6 +715,8 @@ { /* initialize extra correlation package */ NdrCorrelationInitialize(&stubMsg, NdrCorrCache, sizeof(NdrCorrCache), 0); + if (ext_flags.Unused & 0x2) /* has range on conformance */ + stubMsg.CorrDespIncrement = 12; } /* order of phases: @@ -1047,10 +1058,10 @@ "movq 8(%rsp),%rdx\n\t" "movq 16(%rsp),%r8\n\t" "movq 24(%rsp),%r9\n\t" - "movq %rcx,%xmm0\n\t" - "movq %rdx,%xmm1\n\t" - "movq %r8,%xmm2\n\t" - "movq %r9,%xmm3\n\t" + "movq 0(%rsp),%xmm0\n\t" + "movq 8(%rsp),%xmm1\n\t" + "movq 16(%rsp),%xmm2\n\t" + "movq 24(%rsp),%xmm3\n\t" "callq *%rax\n\t" "leaq -16(%rbp),%rsp\n\t" /* restore stack */ "popq %rdi\n\t" @@ -1062,13 +1073,40 @@ __ASM_CFI(".cfi_adjust_cfa_offset -8\n\t") __ASM_CFI(".cfi_same_value %rbp\n\t") "ret") -#elif defined(__arm__) -LONG_PTR __cdecl call_server_func(SERVER_ROUTINE func, unsigned char * args, unsigned short stack_size) -{ - FIXME("Not implemented for ARM\n"); - assert(FALSE); - return 0; -} +#elif defined __arm__ +LONG_PTR __cdecl call_server_func(SERVER_ROUTINE func, unsigned char *args, unsigned int stack_size); +__ASM_GLOBAL_FUNC( call_server_func, + ".arm\n\t" + "push {r4, r5, LR}\n\t" + "mov r4, r0\n\t" + "mov r5, SP\n\t" + "lsr r3, r2, #2\n\t" + "cmp r3, #0\n\t" + "beq 5f\n\t" + "sub SP, SP, r2\n\t" + "tst r3, #1\n\t" + "subeq SP, SP, #4\n\t" + "1:\tsub r2, r2, #4\n\t" + "ldr r0, [r1, r2]\n\t" + "str r0, [SP, r2]\n\t" + "cmp r2, #0\n\t" + "bgt 1b\n\t" + "cmp r3, #1\n\t" + "bgt 2f\n\t" + "pop {r0}\n\t" + "b 5f\n\t" + "2:\tcmp r3, #2\n\t" + "bgt 3f\n\t" + "pop {r0-r1}\n\t" + "b 5f\n\t" + "3:\tcmp r3, #3\n\t" + "bgt 4f\n\t" + "pop {r0-r2}\n\t" + "b 5f\n\t" + "4:\tpop {r0-r3}\n\t" + "5:\tblx r4\n\t" + "mov SP, r5\n\t" + "pop {r4, r5, PC}" ) #else #warning call_server_func not implemented for your architecture LONG_PTR __cdecl call_server_func(SERVER_ROUTINE func, unsigned char * args, unsigned short stack_size) @@ -1086,39 +1124,30 @@ unsigned int i; LONG_PTR *retval_ptr = NULL; - if (phase == STUBLESS_FREE) - { - /* Process the params allocated by the application first */ - for (i = 0; i < number_of_params; i++) - { - unsigned char *pArg = pStubMsg->StackTop + params[i].stack_offset; + for (i = 0; i < number_of_params; i++) + { + unsigned char *pArg = pStubMsg->StackTop + params[i].stack_offset; + const unsigned char *pTypeFormat = &pStubMsg->StubDesc->pFormatTypes[params[i].u.type_offset]; + + TRACE("param[%d]: %p -> %p type %02x %s\n", i, + pArg, *(unsigned char **)pArg, + params[i].attr.IsBasetype ? params[i].u.type_format_char : *pTypeFormat, + debugstr_PROC_PF( params[i].attr )); + + switch (phase) + { + case STUBLESS_MARSHAL: + if (params[i].attr.IsOut || params[i].attr.IsReturn) + call_marshaller(pStubMsg, pArg, ¶ms[i]); + break; + case STUBLESS_MUSTFREE: if (params[i].attr.MustFree) { call_freer(pStubMsg, pArg, ¶ms[i]); } - } - } - - for (i = 0; i < number_of_params; i++) - { - unsigned char *pArg = pStubMsg->StackTop + params[i].stack_offset; - const unsigned char *pTypeFormat = &pStubMsg->StubDesc->pFormatTypes[params[i].u.type_offset]; - - TRACE("param[%d]: %p -> %p type %02x %s\n", i, - pArg, *(unsigned char **)pArg, - params[i].attr.IsBasetype ? params[i].u.type_format_char : *pTypeFormat, - debugstr_PROC_PF( params[i].attr )); - - switch (phase) - { - case STUBLESS_MARSHAL: - if (params[i].attr.IsOut || params[i].attr.IsReturn) - call_marshaller(pStubMsg, pArg, ¶ms[i]); break; case STUBLESS_FREE: - if (params[i].attr.MustFree) - break; - else if (params[i].attr.ServerAllocSize) + if (params[i].attr.ServerAllocSize) { HeapFree(GetProcessHeap(), 0, *(void **)pArg); } @@ -1304,7 +1333,7 @@ if (pThis) *(void **)args = ((CStdStubBuffer *)pThis)->pvServerObject; - if (pStubDesc->Version >= 0x20000) /* -Oicf format */ + if (is_oicf_stubdesc(pStubDesc)) { const NDR_PROC_PARTIAL_OIF_HEADER *pOIFHeader = (const NDR_PROC_PARTIAL_OIF_HEADER *)pFormat; @@ -1332,8 +1361,9 @@ if (ext_flags.HasNewCorrDesc) { /* initialize extra correlation package */ - FIXME("new correlation description not implemented\n"); - stubMsg.fHasNewCorrDesc = TRUE; + NdrCorrelationInitialize(&stubMsg, NdrCorrCache, sizeof(NdrCorrCache), 0); + if (ext_flags.Unused & 0x2) /* has range on conformance */ + stubMsg.CorrDespIncrement = 12; } } else @@ -1396,7 +1426,7 @@ pRpcMsg->BufferLength = stubMsg.BufferLength; /* allocate buffer for [out] and [ret] params */ - Status = I_RpcGetBuffer(pRpcMsg); + Status = I_RpcGetBuffer(pRpcMsg); if (Status) RpcRaiseException(Status); stubMsg.Buffer = pRpcMsg->Buffer; @@ -1406,6 +1436,7 @@ case STUBLESS_INITOUT: case STUBLESS_CALCSIZE: case STUBLESS_MARSHAL: + case STUBLESS_MUSTFREE: case STUBLESS_FREE: retval_ptr = stub_do_args(&stubMsg, pFormat, phase, number_of_params); break; @@ -1420,7 +1451,7 @@ if (ext_flags.HasNewCorrDesc) { /* free extra correlation package */ - /* NdrCorrelationFree(&stubMsg); */ + NdrCorrelationFree(&stubMsg); } if (Oif_flags.HasPipes) @@ -1495,8 +1526,6 @@ INTERPRETER_OPT_FLAGS2 ext_flags = { 0 }; /* header for procedure string */ const NDR_PROC_HEADER * pProcHeader = (const NDR_PROC_HEADER *)&pFormat[0]; - /* -Oif or -Oicf generated format */ - BOOL bV2Format = FALSE; RPC_STATUS status; TRACE("pStubDesc %p, pFormat %p, ...\n", pStubDesc, pFormat); @@ -1509,7 +1538,7 @@ } async_call_data = I_RpcAllocate(sizeof(*async_call_data) + sizeof(MIDL_STUB_MESSAGE) + sizeof(RPC_MESSAGE)); - if (!async_call_data) RpcRaiseException(ERROR_OUTOFMEMORY); + if (!async_call_data) RpcRaiseException(RPC_X_NO_MEMORY); async_call_data->pProcHeader = pProcHeader; async_call_data->pStubMsg = pStubMsg = (PMIDL_STUB_MESSAGE)(async_call_data + 1); @@ -1558,9 +1587,7 @@ pFormat = client_get_handle(pStubMsg, pProcHeader, async_call_data->pHandleFormat, &async_call_data->hBinding); if (!pFormat) goto done; - bV2Format = (pStubDesc->Version >= 0x20000); - - if (bV2Format) + if (is_oicf_stubdesc(pStubDesc)) { const NDR_PROC_PARTIAL_OIF_HEADER *pOIFHeader = (const NDR_PROC_PARTIAL_OIF_HEADER *)pFormat; @@ -1611,6 +1638,8 @@ { /* initialize extra correlation package */ NdrCorrelationInitialize(pStubMsg, async_call_data->NdrCorrCache, sizeof(async_call_data->NdrCorrCache), 0); + if (ext_flags.Unused & 0x2) /* has range on conformance */ + pStubMsg->CorrDespIncrement = 12; } /* order of phases: Modified: trunk/reactos/dll/win32/rpcrt4/ndr_stubless.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/rpcrt4/ndr_stubl…
============================================================================== --- trunk/reactos/dll/win32/rpcrt4/ndr_stubless.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/rpcrt4/ndr_stubless.h [iso-8859-1] Tue Nov 17 10:08:00 2015 @@ -37,7 +37,8 @@ * RPC_FC_BIND_PRIMITIVE = 32 - Implicit handle using handle_t created by * calling application * RPC_FC_AUTO_HANDLE = 33 - Automatic handle - * RPC_FC_CALLBACK_HANDLE = 34 - undocumented + * RPC_FC_CALLBACK_HANDLE = 34 - Implicit handle used for a callback: current handle + * from last remote call */ unsigned char handle_type; @@ -235,6 +236,7 @@ STUBLESS_CALCSIZE, STUBLESS_GETBUFFER, STUBLESS_MARSHAL, + STUBLESS_MUSTFREE, STUBLESS_FREE }; Modified: trunk/reactos/dll/win32/rpcrt4/rpc_assoc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/rpcrt4/rpc_assoc…
============================================================================== --- trunk/reactos/dll/win32/rpcrt4/rpc_assoc.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/rpcrt4/rpc_assoc.c [iso-8859-1] Tue Nov 17 10:08:00 2015 @@ -68,6 +68,7 @@ assoc->Endpoint = RPCRT4_strdupA(Endpoint); assoc->NetworkOptions = NetworkOptions ? RPCRT4_strdupW(NetworkOptions) : NULL; assoc->assoc_group_id = 0; + UuidCreate(&assoc->http_uuid); list_init(&assoc->entry); *assoc_out = assoc; return RPC_S_OK; @@ -329,7 +330,7 @@ break; case REJECT_INVALID_CHECKSUM: ERR("invalid checksum\n"); - status = ERROR_ACCESS_DENIED; + status = RPC_S_ACCESS_DENIED; break; default: ERR("rejected bind for reason %d\n", response_hdr->bind_nack.reject_reason); @@ -431,7 +432,7 @@ context_handle = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*context_handle)); if (!context_handle) - return ERROR_OUTOFMEMORY; + return RPC_S_OUT_OF_MEMORY; context_handle->ctx_guard = CtxGuard; RtlInitializeResource(&context_handle->rw_lock); Modified: trunk/reactos/dll/win32/rpcrt4/rpc_binding.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/rpcrt4/rpc_bindi…
============================================================================== --- trunk/reactos/dll/win32/rpcrt4/rpc_binding.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/rpcrt4/rpc_binding.c [iso-8859-1] Tue Nov 17 10:08:00 2015 @@ -1102,7 +1102,7 @@ { RpcAuthInfo *AuthInfo = HeapAlloc(GetProcessHeap(), 0, sizeof(*AuthInfo)); if (!AuthInfo) - return ERROR_OUTOFMEMORY; + return RPC_S_OUT_OF_MEMORY; AuthInfo->refs = 1; AuthInfo->AuthnLevel = AuthnLevel; @@ -1122,7 +1122,7 @@ if (!AuthInfo->nt_identity) { HeapFree(GetProcessHeap(), 0, AuthInfo); - return ERROR_OUTOFMEMORY; + return RPC_S_OUT_OF_MEMORY; } AuthInfo->nt_identity->Flags = SEC_WINNT_AUTH_IDENTITY_UNICODE; @@ -1151,7 +1151,7 @@ HeapFree(GetProcessHeap(), 0, AuthInfo->nt_identity->Password); HeapFree(GetProcessHeap(), 0, AuthInfo->nt_identity); HeapFree(GetProcessHeap(), 0, AuthInfo); - return ERROR_OUTOFMEMORY; + return RPC_S_OUT_OF_MEMORY; } } else @@ -1475,7 +1475,7 @@ { *ServerPrincName = (RPC_CSTR)RPCRT4_strdupWtoA(principal); RpcStringFreeW(&principal); - if (!*ServerPrincName) return ERROR_OUTOFMEMORY; + if (!*ServerPrincName) return RPC_S_OUT_OF_MEMORY; } return status; @@ -1507,7 +1507,7 @@ if (bind->AuthInfo->server_principal_name) { *ServerPrincName = RPCRT4_strdupW(bind->AuthInfo->server_principal_name); - if (!*ServerPrincName) return ERROR_OUTOFMEMORY; + if (!*ServerPrincName) return RPC_S_OUT_OF_MEMORY; } else *ServerPrincName = NULL; } @@ -1588,7 +1588,7 @@ if (status == RPC_S_OK && ServerPrincName) { *ServerPrincName = (RPC_CSTR)RPCRT4_strdupWtoA(principal); - if (!*ServerPrincName && principal) status = ERROR_OUTOFMEMORY; + if (!*ServerPrincName && principal) status = RPC_S_OUT_OF_MEMORY; RpcStringFreeW(&principal); } @@ -1733,7 +1733,7 @@ else { RpcAuthInfo_Release(new_auth_info); - r = ERROR_OUTOFMEMORY; + r = RPC_S_OUT_OF_MEMORY; } } else @@ -1864,7 +1864,7 @@ else { RpcAuthInfo_Release(new_auth_info); - r = ERROR_OUTOFMEMORY; + r = RPC_S_OUT_OF_MEMORY; } } else @@ -1918,7 +1918,7 @@ int len = MultiByteToWideChar(CP_ACP, 0, cookie->Buffer, cookie->BufferSize, NULL, 0); WCHAR *str; - if (!(str = HeapAlloc(GetProcessHeap(), 0, (len + 1) * sizeof(WCHAR)))) return ERROR_OUTOFMEMORY; + if (!(str = HeapAlloc(GetProcessHeap(), 0, (len + 1) * sizeof(WCHAR)))) return RPC_S_OUT_OF_MEMORY; MultiByteToWideChar(CP_ACP, 0, cookie->Buffer, cookie->BufferSize, str, len); str[len] = 0; HeapFree(GetProcessHeap(), 0, binding->CookieAuth); @@ -1931,3 +1931,13 @@ } return RPC_S_OK; } + +/*********************************************************************** + * I_RpcBindingInqLocalClientPID (RPCRT4.@) + */ + +RPC_STATUS WINAPI I_RpcBindingInqLocalClientPID(RPC_BINDING_HANDLE ClientBinding, ULONG *ClientPID) +{ + FIXME("%p %p: stub\n", ClientBinding, ClientPID); + return RPC_S_INVALID_BINDING; +} Modified: trunk/reactos/dll/win32/rpcrt4/rpc_binding.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/rpcrt4/rpc_bindi…
============================================================================== --- trunk/reactos/dll/win32/rpcrt4/rpc_binding.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/rpcrt4/rpc_binding.h [iso-8859-1] Tue Nov 17 10:08:00 2015 @@ -100,6 +100,7 @@ int (*write)(RpcConnection *conn, const void *buffer, unsigned int len); int (*close)(RpcConnection *conn); void (*cancel_call)(RpcConnection *conn); + RPC_STATUS (*is_server_listening)(const char *endpoint); int (*wait_for_incoming_data)(RpcConnection *conn); size_t (*get_top_of_tower)(unsigned char *tower_data, const char *networkaddr, const char *endpoint); RPC_STATUS (*parse_top_of_tower)(const unsigned char *tower_data, size_t tower_size, char **networkaddr, char **endpoint); @@ -158,6 +159,7 @@ RPC_STATUS RPCRT4_ReleaseConnection(RpcConnection* Connection) DECLSPEC_HIDDEN; RPC_STATUS RPCRT4_OpenClientConnection(RpcConnection* Connection) DECLSPEC_HIDDEN; RPC_STATUS RPCRT4_CloseConnection(RpcConnection* Connection) DECLSPEC_HIDDEN; +RPC_STATUS RPCRT4_IsServerListening(const char *protseq, const char *endpoint) DECLSPEC_HIDDEN; RPC_STATUS RPCRT4_ResolveBinding(RpcBinding* Binding, LPCSTR Endpoint) DECLSPEC_HIDDEN; RPC_STATUS RPCRT4_SetBindingObject(RpcBinding* Binding, const UUID* ObjectUuid) DECLSPEC_HIDDEN; Modified: trunk/reactos/dll/win32/rpcrt4/rpc_epmap.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/rpcrt4/rpc_epmap…
============================================================================== --- trunk/reactos/dll/win32/rpcrt4/rpc_epmap.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/rpcrt4/rpc_epmap.c [iso-8859-1] Tue Nov 17 10:08:00 2015 @@ -80,7 +80,7 @@ lstrcatW( cmd, rpcss ); Wow64DisableWow64FsRedirection( &redir ); - rslt = CreateProcessW( cmd, cmd, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi ); + rslt = CreateProcessW( cmd, cmd, NULL, NULL, FALSE, DETACHED_PROCESS, NULL, NULL, &si, &pi ); Wow64RevertWow64FsRedirection( redir ); if (rslt) Modified: trunk/reactos/dll/win32/rpcrt4/rpc_server.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/rpcrt4/rpc_serve…
============================================================================== --- trunk/reactos/dll/win32/rpcrt4/rpc_server.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/rpcrt4/rpc_server.c [iso-8859-1] Tue Nov 17 10:08:00 2015 @@ -740,9 +740,18 @@ return status; } -static void RPCRT4_stop_listen(BOOL auto_listen) -{ +static RPC_STATUS RPCRT4_stop_listen(BOOL auto_listen) +{ + RPC_STATUS status = RPC_S_OK; + EnterCriticalSection(&listen_cs); + + if (!std_listen) + { + status = RPC_S_NOT_LISTENING; + goto done; + } + if (auto_listen || (--manual_listen_count == 0)) { if (listen_count != 0 && --listen_count == 0) { @@ -757,12 +766,14 @@ EnterCriticalSection(&listen_cs); if (listen_done_event) SetEvent( listen_done_event ); listen_done_event = 0; - LeaveCriticalSection(&listen_cs); - return; + goto done; } assert(listen_count >= 0); } + +done: LeaveCriticalSection(&listen_cs); + return status; } static BOOL RPCRT4_protseq_is_endpoint_registered(RpcServerProtseq *protseq, const char *endpoint) @@ -1053,10 +1064,8 @@ EnterCriticalSection(&server_cs); LIST_FOR_EACH_ENTRY_SAFE(cps, cursor2, &protseqs, RpcServerProtseq, entry) { -#ifndef __REACTOS__ if (listen_count != 0) RPCRT4_sync_with_server_thread(cps); -#endif destroy_serverprotoseq(cps); } LeaveCriticalSection(&server_cs); @@ -1540,9 +1549,7 @@ return RPC_S_WRONG_KIND_OF_BINDING; } - RPCRT4_stop_listen(FALSE); - - return RPC_S_OK; + return RPCRT4_stop_listen(FALSE); } /*********************************************************************** @@ -1647,9 +1654,15 @@ TRACE("(%p)\n", Binding); - EnterCriticalSection(&listen_cs); - if (manual_listen_count > 0) status = RPC_S_OK; - LeaveCriticalSection(&listen_cs); + if (Binding) { + RpcBinding *rpc_binding = (RpcBinding*)Binding; + status = RPCRT4_IsServerListening(rpc_binding->Protseq, rpc_binding->Endpoint); + }else { + EnterCriticalSection(&listen_cs); + if (manual_listen_count > 0) status = RPC_S_OK; + LeaveCriticalSection(&listen_cs); + } + return status; } Modified: trunk/reactos/dll/win32/rpcrt4/rpc_transport.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/rpcrt4/rpc_trans…
============================================================================== --- trunk/reactos/dll/win32/rpcrt4/rpc_transport.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/rpcrt4/rpc_transport.c [iso-8859-1] Tue Nov 17 10:08:00 2015 @@ -245,6 +245,18 @@ return RPC_S_OK; } +static char *ncalrpc_pipe_name(const char *endpoint) +{ + static const char prefix[] = "\\\\.\\pipe\\lrpc\\"; + char *pipe_name; + + /* protseq=ncalrpc: supposed to use NT LPC ports, + * but we'll implement it with named pipes for now */ + pipe_name = I_RpcAllocate(sizeof(prefix) + strlen(endpoint)); + strcat(strcpy(pipe_name, prefix), endpoint); + return pipe_name; +} + static RPC_STATUS rpcrt4_ncalrpc_open(RpcConnection* Connection) { RpcConnection_np *npc = (RpcConnection_np *) Connection; @@ -302,6 +314,17 @@ LeaveCriticalSection(&protseq->cs); return r; +} + +static char *ncacn_pipe_name(const char *endpoint) +{ + static const char prefix[] = "\\\\."; + char *pipe_name; + + /* protseq=ncacn_np: named pipes */ + pipe_name = I_RpcAllocate(sizeof(prefix) + strlen(endpoint)); + strcat(strcpy(pipe_name, prefix), endpoint); + return pipe_name; } static RPC_STATUS rpcrt4_ncacn_np_open(RpcConnection* Connection) @@ -408,7 +431,7 @@ } static void rpcrt4_conn_np_handoff(RpcConnection_np *old_npc, RpcConnection_np *new_npc) -{ +{ /* because of the way named pipes work, we'll transfer the connected pipe * to the child, then reopen the server binding to continue listening */ @@ -435,6 +458,33 @@ return status; } +static RPC_STATUS is_pipe_listening(const char *pipe_name) +{ + return WaitNamedPipeA(pipe_name, 1) ? RPC_S_OK : RPC_S_NOT_LISTENING; +} + +static RPC_STATUS rpcrt4_ncacn_np_is_server_listening(const char *endpoint) +{ + char *pipe_name; + RPC_STATUS status; + + pipe_name = ncacn_pipe_name(endpoint); + status = is_pipe_listening(pipe_name); + I_RpcFree(pipe_name); + return status; +} + +static RPC_STATUS rpcrt4_ncalrpc_np_is_server_listening(const char *endpoint) +{ + char *pipe_name; + RPC_STATUS status; + + pipe_name = ncalrpc_pipe_name(endpoint); + status = is_pipe_listening(pipe_name); + I_RpcFree(pipe_name); + return status; +} + static RPC_STATUS rpcrt4_ncalrpc_handoff(RpcConnection *old_conn, RpcConnection *new_conn) { RPC_STATUS status; @@ -449,7 +499,7 @@ strcat(strcpy(pname, prefix), old_conn->Endpoint); status = rpcrt4_conn_create_pipe(old_conn, pname); I_RpcFree(pname); - + return status; } @@ -715,9 +765,9 @@ HANDLE *objs = prev_array; RpcConnection_np *conn; RpcServerProtseq_np *npps = CONTAINING_RECORD(protseq, RpcServerProtseq_np, common); - + EnterCriticalSection(&protseq->cs); - + /* open and count connections */ *count = 1; conn = CONTAINING_RECORD(protseq->conn, RpcConnection_np, common); @@ -727,7 +777,7 @@ (*count)++; conn = CONTAINING_RECORD(conn->common.Next, RpcConnection_np, common); } - + /* make array of connections */ if (objs) objs = HeapReAlloc(GetProcessHeap(), 0, objs, *count*sizeof(HANDLE)); @@ -739,7 +789,7 @@ LeaveCriticalSection(&protseq->cs); return NULL; } - + objs[0] = npps->mgr_event; *count = 1; conn = CONTAINING_RECORD(protseq->conn, RpcConnection_np, common); @@ -764,7 +814,7 @@ DWORD res; RpcConnection *cconn; RpcConnection_np *conn; - + if (!objs) return -1; @@ -994,6 +1044,7 @@ else { ERR("unexpected protocol family %d\n", ai->ai_family); + freeaddrinfo(ai); return 0; } @@ -1473,7 +1524,7 @@ conn->Next = protseq->conn; protseq->conn = first_connection; LeaveCriticalSection(&protseq->cs); - + TRACE("listening on %s\n", endpoint); return RPC_S_OK; } @@ -1517,6 +1568,8 @@ return -1; else if (r > 0) bytes_read += r; + else if (errno == EINTR) + continue; else if (errno != EAGAIN) { WARN("recv() failed: %s\n", strerror(errno)); @@ -1542,6 +1595,8 @@ int r = send(tcpc->sock, (const char *)buffer + bytes_written, count - bytes_written, 0); if (r >= 0) bytes_written += r; + else if (errno == EINTR) + continue; else if (errno != EAGAIN) return -1; else @@ -1574,6 +1629,12 @@ rpcrt4_sock_wait_cancel(tcpc); } +static RPC_STATUS rpcrt4_conn_tcp_is_server_listening(const char *endpoint) +{ + FIXME("\n"); + return RPC_S_ACCESS_DENIED; +} + static int rpcrt4_conn_tcp_wait_for_incoming_data(RpcConnection *Connection) { RpcConnection_tcp *tcpc = (RpcConnection_tcp *) Connection; @@ -1639,7 +1700,7 @@ RpcServerProtseq_sock *sockps = CONTAINING_RECORD(protseq, RpcServerProtseq_sock, common); EnterCriticalSection(&protseq->cs); - + /* open and count connections */ *count = 1; conn = (RpcConnection_tcp *)protseq->conn; @@ -1648,7 +1709,7 @@ (*count)++; conn = (RpcConnection_tcp *)conn->common.Next; } - + /* make array of connections */ if (poll_info) poll_info = HeapReAlloc(GetProcessHeap(), 0, poll_info, *count*sizeof(*poll_info)); @@ -1690,10 +1751,10 @@ unsigned int i; RpcConnection *cconn; RpcConnection_tcp *conn; - + if (!poll_info) return -1; - + ret = poll(poll_info, count, -1); if (ret < 0) { @@ -1902,7 +1963,7 @@ LONG refs; HANDLE completion_event; WORD async_result; - INTERNET_BUFFERSA inet_buffers; + INTERNET_BUFFERSW inet_buffers; CRITICAL_SECTION cs; } RpcHttpAsyncData; @@ -2009,7 +2070,7 @@ TRACE("async data = %p\n", httpc->async_data); httpc->cancel_event = CreateEventW(NULL, FALSE, FALSE, NULL); httpc->async_data->refs = 1; - httpc->async_data->inet_buffers.dwStructSize = sizeof(INTERNET_BUFFERSA); + httpc->async_data->inet_buffers.dwStructSize = sizeof(INTERNET_BUFFERSW); httpc->async_data->inet_buffers.lpvBuffer = NULL; InitializeCriticalSection(&httpc->async_data->cs); httpc->async_data->cs.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": RpcHttpAsyncData.cs"); @@ -2254,9 +2315,47 @@ return RPC_S_OK; } +static int rpcrt4_http_async_read(HINTERNET req, RpcHttpAsyncData *async_data, HANDLE cancel_event, + void *buffer, unsigned int count) +{ + char *buf = buffer; + BOOL ret; + unsigned int bytes_left = count; + RPC_STATUS status = RPC_S_OK; + + async_data->inet_buffers.lpvBuffer = HeapAlloc(GetProcessHeap(), 0, count); + + while (bytes_left) + { + async_data->inet_buffers.dwBufferLength = bytes_left; + prepare_async_request(async_data); + ret = InternetReadFileExW(req, &async_data->inet_buffers, IRF_ASYNC, 0); + status = wait_async_request(async_data, ret, cancel_event); + if (status != RPC_S_OK) + { + if (status == RPC_S_CALL_CANCELLED) + TRACE("call cancelled\n"); + break; + } + + if (!async_data->inet_buffers.dwBufferLength) + break; + memcpy(buf, async_data->inet_buffers.lpvBuffer, + async_data->inet_buffers.dwBufferLength); + + bytes_left -= async_data->inet_buffers.dwBufferLength; + buf += async_data->inet_buffers.dwBufferLength; + } + + HeapFree(GetProcessHeap(), 0, async_data->inet_buffers.lpvBuffer); + async_data->inet_buffers.lpvBuffer = NULL; + + TRACE("%p %p %u -> %u\n", req, buffer, count, status); + return status == RPC_S_OK ? count : -1; +} + static RPC_STATUS send_echo_request(HINTERNET req, RpcHttpAsyncData *async_data, HANDLE cancel_event) { - DWORD bytes_read; BYTE buf[20]; BOOL ret; RPC_STATUS status; @@ -2271,10 +2370,21 @@ status = rpcrt4_http_check_response(req); if (status != RPC_S_OK) return status; - InternetReadFile(req, buf, sizeof(buf), &bytes_read); + rpcrt4_http_async_read(req, async_data, cancel_event, buf, sizeof(buf)); /* FIXME: do something with retrieved data */ return RPC_S_OK; +} + +static RPC_STATUS insert_content_length_header(HINTERNET request, DWORD len) +{ + static const WCHAR fmtW[] = + {'C','o','n','t','e','n','t','-','L','e','n','g','t','h',':',' ','%','u','\r','\n',0}; + WCHAR header[sizeof(fmtW) / sizeof(fmtW[0]) + 10]; + + sprintfW(header, fmtW, len); + if ((HttpAddRequestHeadersW(request, header, -1, HTTP_ADDREQ_FLAG_REPLACE | HTTP_ADDREQ_FLAG_ADD))) return RPC_S_OK; + return RPC_S_SERVER_UNAVAILABLE; } /* prepare the in pipe for use by RPC packets */ @@ -2298,6 +2408,9 @@ buffers_in.dwStructSize = sizeof(buffers_in); /* FIXME: get this from the registry */ buffers_in.dwBufferTotal = 1024 * 1024 * 1024; /* 1Gb */ + status = insert_content_length_header(in_request, buffers_in.dwBufferTotal); + if (status != RPC_S_OK) return status; + prepare_async_request(async_data); ret = HttpSendRequestExW(in_request, &buffers_in, NULL, 0, 0); status = wait_async_request(async_data, ret, cancel_event); @@ -2317,14 +2430,13 @@ return RPC_S_OK; } -static RPC_STATUS rpcrt4_http_read_http_packet(HINTERNET request, RpcPktHdr *hdr, BYTE **data) -{ - BOOL ret; - DWORD bytes_read; +static RPC_STATUS rpcrt4_http_read_http_packet(HINTERNET request, RpcHttpAsyncData *async_data, + HANDLE cancel_event, RpcPktHdr *hdr, BYTE **data) +{ unsigned short data_len; - - ret = InternetReadFile(request, hdr, sizeof(hdr->common), &bytes_read); - if (!ret) + unsigned int size; + + if (rpcrt4_http_async_read(request, async_data, cancel_event, hdr, sizeof(hdr->common)) < 0) return RPC_S_SERVER_UNAVAILABLE; if (hdr->common.ptype != PKT_HTTP || hdr->common.frag_len < sizeof(hdr->http)) { @@ -2333,8 +2445,8 @@ return RPC_S_PROTOCOL_ERROR; } - ret = InternetReadFile(request, &hdr->common + 1, sizeof(hdr->http) - sizeof(hdr->common), &bytes_read); - if (!ret) + size = sizeof(hdr->http) - sizeof(hdr->common); + if (rpcrt4_http_async_read(request, async_data, cancel_event, &hdr->common + 1, size) < 0) return RPC_S_SERVER_UNAVAILABLE; data_len = hdr->common.frag_len - sizeof(hdr->http); @@ -2343,8 +2455,7 @@ *data = HeapAlloc(GetProcessHeap(), 0, data_len); if (!*data) return RPC_S_OUT_OF_RESOURCES; - ret = InternetReadFile(request, *data, data_len, &bytes_read); - if (!ret) + if (rpcrt4_http_async_read(request, async_data, cancel_event, *data, data_len) < 0) { HeapFree(GetProcessHeap(), 0, *data); return RPC_S_SERVER_UNAVAILABLE; @@ -2356,6 +2467,7 @@ if (!RPCRT4_IsValidHttpPacket(hdr, *data, data_len)) { ERR("invalid http packet\n"); + HeapFree(GetProcessHeap(), 0, *data); return RPC_S_PROTOCOL_ERROR; } @@ -2374,7 +2486,6 @@ BYTE *data_from_server; RpcPktHdr pkt_from_server; ULONG field1, field3; - DWORD bytes_read; BYTE buf[20]; if (!authorized) @@ -2384,10 +2495,17 @@ if (status != RPC_S_OK) return status; } else - InternetReadFile(out_request, buf, sizeof(buf), &bytes_read); + rpcrt4_http_async_read(out_request, async_data, cancel_event, buf, sizeof(buf)); hdr = RPCRT4_BuildHttpConnectHeader(TRUE, connection_uuid, out_pipe_uuid, NULL); if (!hdr) return RPC_S_OUT_OF_RESOURCES; + + status = insert_content_length_header(out_request, hdr->common.frag_len); + if (status != RPC_S_OK) + { + RPCRT4_FreeHeader(hdr); + return status; + } TRACE("sending HTTP connect header to server\n"); prepare_async_request(async_data); @@ -2399,8 +2517,8 @@ status = rpcrt4_http_check_response(out_request); if (status != RPC_S_OK) return status; - status = rpcrt4_http_read_http_packet(out_request, &pkt_from_server, - &data_from_server); + status = rpcrt4_http_read_http_packet(out_request, async_data, cancel_event, + &pkt_from_server, &data_from_server); if (status != RPC_S_OK) return status; status = RPCRT4_ParseHttpPrepareHeader1(&pkt_from_server, data_from_server, &field1); @@ -2410,8 +2528,8 @@ for (;;) { - status = rpcrt4_http_read_http_packet(out_request, &pkt_from_server, - &data_from_server); + status = rpcrt4_http_read_http_packet(out_request, async_data, cancel_event, + &pkt_from_server, &data_from_server); if (status != RPC_S_OK) return status; if (pkt_from_server.http.flags != 0x0001) break; @@ -2816,7 +2934,7 @@ return status; } -static void drain_content(HINTERNET request) +static void drain_content(HINTERNET request, RpcHttpAsyncData *async_data, HANDLE cancel_event) { DWORD count, len = 0, size = sizeof(len); char buf[2048]; @@ -2826,7 +2944,7 @@ for (;;) { count = min(sizeof(buf), len); - if (!InternetReadFile(request, buf, count, &count) || !count) return; + if (rpcrt4_http_async_read(request, async_data, cancel_event, buf, count) <= 0) return; len -= count; } } @@ -2853,37 +2971,13 @@ status = rpcrt4_http_check_response(request); if (status != RPC_S_OK && status != ERROR_ACCESS_DENIED) break; - drain_content(request); + drain_content(request, httpc->async_data, httpc->cancel_event); } if (info->scheme != RPC_C_HTTP_AUTHN_SCHEME_BASIC) - HttpAddRequestHeadersW(request, authW, -1, HTTP_ADDREQ_FLAG_REPLACE); + HttpAddRequestHeadersW(request, authW, -1, HTTP_ADDREQ_FLAG_REPLACE | HTTP_ADDREQ_FLAG_ADD); destroy_authinfo(info); - return status; -} - -static RPC_STATUS insert_cookie_header(HINTERNET request, const WCHAR *value) -{ - static const WCHAR cookieW[] = {'C','o','o','k','i','e',':',' '}; - WCHAR *header, *ptr; - int len; - RPC_STATUS status = RPC_S_SERVER_UNAVAILABLE; - - if (!value) return RPC_S_OK; - - len = strlenW(value); - if ((header = HeapAlloc(GetProcessHeap(), 0, sizeof(cookieW) + (len + 3) * sizeof(WCHAR)))) - { - memcpy(header, cookieW, sizeof(cookieW)); - ptr = header + sizeof(cookieW) / sizeof(cookieW[0]); - memcpy(ptr, value, len * sizeof(WCHAR)); - ptr[len++] = '\r'; - ptr[len++] = '\n'; - ptr[len] = 0; - if ((HttpAddRequestHeadersW(request, header, -1, HTTP_ADDREQ_FLAG_ADD_IF_NEW))) status = RPC_S_OK; - HeapFree(GetProcessHeap(), 0, header); - } return status; } @@ -2910,6 +3004,51 @@ return httpc->common.QOS && (httpc->common.QOS->qos->AdditionalSecurityInfoType == RPC_C_AUTHN_INFO_TYPE_HTTP) && (httpc->common.QOS->qos->u.HttpCredentials->Flags & RPC_C_HTTP_FLAG_USE_SSL); +} + +static RPC_STATUS set_auth_cookie(RpcConnection_http *httpc, const WCHAR *value) +{ + static WCHAR httpW[] = {'h','t','t','p',0}; + static WCHAR httpsW[] = {'h','t','t','p','s',0}; + URL_COMPONENTSW uc; + DWORD len; + WCHAR *url; + BOOL ret; + + if (!value) return RPC_S_OK; + + uc.dwStructSize = sizeof(uc); + uc.lpszScheme = is_secure(httpc) ? httpsW : httpW; + uc.dwSchemeLength = 0; + uc.lpszHostName = httpc->servername; + uc.dwHostNameLength = 0; + uc.nPort = 0; + uc.lpszUserName = NULL; + uc.dwUserNameLength = 0; + uc.lpszPassword = NULL; + uc.dwPasswordLength = 0; + uc.lpszUrlPath = NULL; + uc.dwUrlPathLength = 0; + uc.lpszExtraInfo = NULL; + uc.dwExtraInfoLength = 0; + + if (!InternetCreateUrlW(&uc, 0, NULL, &len) && (GetLastError() != ERROR_INSUFFICIENT_BUFFER)) + return RPC_S_SERVER_UNAVAILABLE; + + if (!(url = HeapAlloc(GetProcessHeap(), 0, len))) return RPC_S_OUT_OF_MEMORY; + + len = len / sizeof(WCHAR) - 1; + if (!InternetCreateUrlW(&uc, 0, url, &len)) + { + HeapFree(GetProcessHeap(), 0, url); + return RPC_S_SERVER_UNAVAILABLE; + } + + ret = InternetSetCookieW(url, NULL, value); + HeapFree(GetProcessHeap(), 0, url); + if (!ret) return RPC_S_SERVER_UNAVAILABLE; + + return RPC_S_OK; } static RPC_STATUS rpcrt4_ncacn_http_open(RpcConnection* Connection) @@ -2941,9 +3080,9 @@ httpc->async_data->completion_event = CreateEventW(NULL, FALSE, FALSE, NULL); - status = UuidCreate(&httpc->connection_uuid); - status = UuidCreate(&httpc->in_pipe_uuid); - status = UuidCreate(&httpc->out_pipe_uuid); + UuidCreate(&httpc->connection_uuid); + UuidCreate(&httpc->in_pipe_uuid); + UuidCreate(&httpc->out_pipe_uuid); status = rpcrt4_http_internet_connect(httpc); if (status != RPC_S_OK) @@ -2965,6 +3104,12 @@ if (secure) flags |= INTERNET_FLAG_SECURE; if (credentials) flags |= INTERNET_FLAG_NO_AUTH; + status = set_auth_cookie(httpc, Connection->CookieAuth); + if (status != RPC_S_OK) + { + HeapFree(GetProcessHeap(), 0, url); + return status; + } httpc->in_request = HttpOpenRequestW(httpc->session, wszVerbIn, url, NULL, NULL, wszAcceptTypes, flags, (DWORD_PTR)httpc->async_data); if (!httpc->in_request) @@ -2973,12 +3118,7 @@ HeapFree(GetProcessHeap(), 0, url); return RPC_S_SERVER_UNAVAILABLE; } - status = insert_cookie_header(httpc->in_request, Connection->CookieAuth); - if (status != RPC_S_OK) - { - HeapFree(GetProcessHeap(), 0, url); - return status; - } + if (credentials) { status = authorize_request(httpc, httpc->in_request); @@ -2993,7 +3133,7 @@ HeapFree(GetProcessHeap(), 0, url); return status; } - drain_content(httpc->in_request); + drain_content(httpc->in_request, httpc->async_data, httpc->cancel_event); } httpc->out_request = HttpOpenRequestW(httpc->session, wszVerbOut, url, NULL, NULL, wszAcceptTypes, @@ -3004,9 +3144,6 @@ ERR("HttpOpenRequestW failed with error %d\n", GetLastError()); return RPC_S_SERVER_UNAVAILABLE; } - status = insert_cookie_header(httpc->out_request, Connection->CookieAuth); - if (status != RPC_S_OK) - return status; if (credentials) { @@ -3059,39 +3196,7 @@ void *buffer, unsigned int count) { RpcConnection_http *httpc = (RpcConnection_http *) Connection; - char *buf = buffer; - BOOL ret; - unsigned int bytes_left = count; - RPC_STATUS status = RPC_S_OK; - - httpc->async_data->inet_buffers.lpvBuffer = HeapAlloc(GetProcessHeap(), 0, count); - - while (bytes_left) - { - httpc->async_data->inet_buffers.dwBufferLength = bytes_left; - prepare_async_request(httpc->async_data); - ret = InternetReadFileExA(httpc->out_request, &httpc->async_data->inet_buffers, IRF_ASYNC, 0); - status = wait_async_request(httpc->async_data, ret, httpc->cancel_event); - if(status != RPC_S_OK) { - if(status == RPC_S_CALL_CANCELLED) - TRACE("call cancelled\n"); - break; - } - - if(!httpc->async_data->inet_buffers.dwBufferLength) - break; - memcpy(buf, httpc->async_data->inet_buffers.lpvBuffer, - httpc->async_data->inet_buffers.dwBufferLength); - - bytes_left -= httpc->async_data->inet_buffers.dwBufferLength; - buf += httpc->async_data->inet_buffers.dwBufferLength; - } - - HeapFree(GetProcessHeap(), 0, httpc->async_data->inet_buffers.lpvBuffer); - httpc->async_data->inet_buffers.lpvBuffer = NULL; - - TRACE("%p %p %u -> %u\n", httpc->out_request, buffer, count, status); - return status == RPC_S_OK ? count : -1; + return rpcrt4_http_async_read(httpc->out_request, httpc->async_data, httpc->cancel_event, buffer, count); } static RPC_STATUS rpcrt4_ncacn_http_receive_fragment(RpcConnection *Connection, RpcPktHdr **Header, void **Payload) @@ -3299,6 +3404,12 @@ SetEvent(httpc->cancel_event); } +static RPC_STATUS rpcrt4_ncacn_http_is_server_listening(const char *endpoint) +{ + FIXME("\n"); + return RPC_S_ACCESS_DENIED; +} + static int rpcrt4_ncacn_http_wait_for_incoming_data(RpcConnection *Connection) { RpcConnection_http *httpc = (RpcConnection_http *) Connection; @@ -3340,6 +3451,7 @@ rpcrt4_conn_np_write, rpcrt4_conn_np_close, rpcrt4_conn_np_cancel_call, + rpcrt4_ncacn_np_is_server_listening, rpcrt4_conn_np_wait_for_incoming_data, rpcrt4_ncacn_np_get_top_of_tower, rpcrt4_ncacn_np_parse_top_of_tower, @@ -3360,6 +3472,7 @@ rpcrt4_conn_np_write, rpcrt4_conn_np_close, rpcrt4_conn_np_cancel_call, + rpcrt4_ncalrpc_np_is_server_listening, rpcrt4_conn_np_wait_for_incoming_data, rpcrt4_ncalrpc_get_top_of_tower, rpcrt4_ncalrpc_parse_top_of_tower, @@ -3380,6 +3493,7 @@ rpcrt4_conn_tcp_write, rpcrt4_conn_tcp_close, rpcrt4_conn_tcp_cancel_call, + rpcrt4_conn_tcp_is_server_listening, rpcrt4_conn_tcp_wait_for_incoming_data, rpcrt4_ncacn_ip_tcp_get_top_of_tower, rpcrt4_ncacn_ip_tcp_parse_top_of_tower, @@ -3400,6 +3514,7 @@ rpcrt4_ncacn_http_write, rpcrt4_ncacn_http_close, rpcrt4_ncacn_http_cancel_call, + rpcrt4_ncacn_http_is_server_listening, rpcrt4_ncacn_http_wait_for_incoming_data, rpcrt4_ncacn_http_get_top_of_tower, rpcrt4_ncacn_http_parse_top_of_tower, @@ -3573,6 +3688,20 @@ return RPC_S_OK; } +RPC_STATUS RPCRT4_IsServerListening(const char *protseq, const char *endpoint) +{ + const struct connection_ops *ops; + + ops = rpcrt4_get_conn_protseq_ops(protseq); + if (!ops) + { + FIXME("not supported for protseq %s\n", protseq); + return RPC_S_INVALID_BINDING; + } + + return ops->is_server_listening(endpoint); +} + RPC_STATUS RpcTransport_GetTopOfTower(unsigned char *tower_data, size_t *tower_size, const char *protseq, Modified: trunk/reactos/dll/win32/rpcrt4/rpcrt4.spec URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/rpcrt4/rpcrt4.sp…
============================================================================== --- trunk/reactos/dll/win32/rpcrt4/rpcrt4.spec [iso-8859-1] (original) +++ trunk/reactos/dll/win32/rpcrt4/rpcrt4.spec [iso-8859-1] Tue Nov 17 10:08:00 2015 @@ -32,7 +32,7 @@ 32 stub I_RpcBindingInqDynamicEndPoint 33 stub I_RpcBindingInqDynamicEndPointA 34 stub I_RpcBindingInqDynamicEndPointW -35 stub I_RpcBindingInqLocalClientPID +35 stdcall I_RpcBindingInqLocalClientPID(ptr ptr) # I_RpcBindingInqMarshalledTargetInfo 37 stub I_RpcBindingInqSecurityContext 38 stdcall I_RpcBindingInqTransportType(ptr ptr) @@ -100,10 +100,10 @@ 100 stub I_RpcTransIoCancelled 101 stub I_RpcTransServerNewConnection 102 stub I_RpcTurnOnEEInfoPropagation -103 stub I_UuidCreate +103 stdcall I_UuidCreate(ptr) 104 stub MIDL_wchar_strcpy 105 stub MIDL_wchar_strlen -106 stub MesBufferHandleReset +106 stdcall MesBufferHandleReset(ptr long long ptr long ptr) 107 stdcall MesDecodeBufferHandleCreate(ptr long ptr) 108 stdcall MesDecodeIncrementalHandleCreate(ptr ptr ptr) 109 stdcall MesEncodeDynBufferHandleCreate(ptr ptr ptr) @@ -465,7 +465,7 @@ 465 stub RpcSsContextLockShared 466 stdcall RpcSsDestroyClientContext(ptr) 467 stub RpcSsDisableAllocate -468 stub RpcSsDontSerializeContext +468 stdcall RpcSsDontSerializeContext() 469 stub RpcSsEnableAllocate 470 stub RpcSsFree 471 stub RpcSsGetContextBinding Modified: trunk/reactos/dll/win32/rpcrt4/rpcrt4_main.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/rpcrt4/rpcrt4_ma…
============================================================================== --- trunk/reactos/dll/win32/rpcrt4/rpcrt4_main.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/rpcrt4/rpcrt4_main.c [iso-8859-1] Tue Nov 17 10:08:00 2015 @@ -431,6 +431,15 @@ return status; } +/************************************************************************* + * I_UuidCreate [RPCRT4.@] + * + * See UuidCreateSequential() + */ +RPC_STATUS WINAPI I_UuidCreate(UUID *Uuid) +{ + return UuidCreateSequential(Uuid); +} /************************************************************************* * UuidHash [RPCRT4.@] Modified: trunk/reactos/dll/win32/rpcrt4/rpcrt4_ros.diff URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/rpcrt4/rpcrt4_ro…
============================================================================== --- trunk/reactos/dll/win32/rpcrt4/rpcrt4_ros.diff [iso-8859-1] (original) +++ trunk/reactos/dll/win32/rpcrt4/rpcrt4_ros.diff [iso-8859-1] Tue Nov 17 10:08:00 2015 @@ -1,15 +1,57 @@ -diff -prudN .\wine\dlls\rpcrt4/rpc_epmap.c .\reactos\dll\win32\rpcrt4/rpc_epmap.c ---- .\wine\dlls\rpcrt4/rpc_epmap.c 2014-05-09 03:43:55.965035900 +0200 -+++ .\reactos\dll\win32\rpcrt4/rpc_epmap.c 2013-12-27 18:11:56.421567500 +0100 -@@ -92,7 +80,7 @@ static BOOL start_rpcss(void) - lstrcatW( cmd, rpcss ); - - Wow64DisableWow64FsRedirection( &redir ); -- rslt = CreateProcessW( cmd, cmd, NULL, NULL, FALSE, DETACHED_PROCESS, NULL, NULL, &si, &pi ); -+ rslt = CreateProcessW( cmd, cmd, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi ); - Wow64RevertWow64FsRedirection( redir ); - - if (rslt) +diff -pudN --strip-trailing-cr e:\wine\dlls\rpcrt4/cproxy.c e:\reactos\dll\win32\rpcrt4/cproxy.c +--- e:\wine\dlls\rpcrt4/cproxy.c 2015-02-21 17:13:10 +0100 ++++ e:\reactos\dll\win32\rpcrt4/cproxy.c 2015-08-27 22:03:34 +0100 +@@ -167,6 +150,30 @@ static inline void init_thunk( struct th + thunk->call_stubless = call_stubless_func; + } + ++#elif defined(__arm__) ++ ++extern void call_stubless_func(void); ++__ASM_GLOBAL_FUNC(call_stubless_func, ++ "DCD 0xDEFC\n\t" // _assertfail ++ "" ); ++ ++#include "pshpack1.h" ++struct thunk ++{ ++ DWORD assertfail; ++}; ++#include "poppack.h" ++ ++static const struct thunk thunk_template = ++{ ++ { 0xDEFC } /* _assertfail */ ++}; ++ ++static inline void init_thunk( struct thunk *thunk, unsigned int index ) ++{ ++ *thunk = thunk_template; ++} ++ + #else /* __i386__ */ + + #warning You must implement stubless proxies for your CPU +diff -pudN --strip-trailing-cr e:\wine\dlls\rpcrt4/cstub.c e:\reactos\dll\win32\rpcrt4/cstub.c +--- e:\wine\dlls\rpcrt4/cstub.c 2015-10-30 18:41:53 +0100 ++++ e:\reactos\dll\win32\rpcrt4/cstub.c 2015-11-16 22:55:49 +0100 +@@ -174,6 +156,13 @@ typedef struct + + static const BYTE opcodes[16] = { 0x48, 0x8b, 0x49, 0x20, 0x48, 0x8b, 0x01, + 0xff, 0xa0, 0, 0, 0, 0, 0x48, 0x8d, 0x36 }; ++#elif defined(__arm__) ++typedef struct ++{ ++ DWORD offset; ++} vtbl_method_t; ++static const BYTE opcodes[1]; ++ + #else + + #warning You must implement delegated proxies/stubs for your CPU +diff -pudN --strip-trailing-cr e:\wine\dlls\rpcrt4/rpc_epmap.c e:\reactos\dll\win32\rpcrt4/rpc_epmap.c +--- e:\wine\dlls\rpcrt4/rpc_epmap.c 2015-02-21 17:13:10 +0100 ++++ e:\reactos\dll\win32\rpcrt4/rpc_epmap.c 2015-11-16 22:55:50 +0100 @@ -162,7 +150,7 @@ static RPC_STATUS get_epm_handle_server( static LONG WINAPI rpc_filter(EXCEPTION_POINTERS *__eptr) @@ -19,24 +61,18 @@ { case EXCEPTION_ACCESS_VIOLATION: case EXCEPTION_ILLEGAL_INSTRUCTION: -diff -prudN .\wine\dlls\rpcrt4/rpc_server.c .\reactos\dll\win32\rpcrt4/rpc_server.c ---- .\wine\dlls\rpcrt4/rpc_server.c 2014-05-09 03:43:55.973036400 +0200 -+++ .\reactos\dll\win32\rpcrt4/rpc_server.c 2013-12-27 18:11:56.780368100 +0100 -@@ -1075,8 +1053,10 @@ void RPCRT4_destroy_all_protseqs(void) - EnterCriticalSection(&server_cs); - LIST_FOR_EACH_ENTRY_SAFE(cps, cursor2, &protseqs, RpcServerProtseq, entry) - { -+#ifndef __REACTOS__ - if (listen_count != 0) - RPCRT4_sync_with_server_thread(cps); -+#endif - destroy_serverprotoseq(cps); - } - LeaveCriticalSection(&server_cs); -diff -prudN .\wine\dlls\rpcrt4/rpc_transport.c .\reactos\dll\win32\rpcrt4/rpc_transport.c ---- .\wine\dlls\rpcrt4/rpc_transport.c 2014-05-09 03:43:55.977036600 +0200 -+++ .\reactos\dll\win32\rpcrt4/rpc_transport.c 2014-05-09 03:10:59.250551600 +0200 -@@ -113,31 +91,41 @@ typedef struct _RpcConnection_np +diff -pudN --strip-trailing-cr e:\wine\dlls\rpcrt4/rpc_transport.c e:\reactos\dll\win32\rpcrt4/rpc_transport.c +--- e:\wine\dlls\rpcrt4/rpc_transport.c 2015-11-01 09:49:28 +0100 ++++ e:\reactos\dll\win32\rpcrt4/rpc_transport.c 2015-11-16 22:55:50 +0100 +@@ -102,6 +79,7 @@ + + #define DEFAULT_NCACN_HTTP_TIMEOUT (60 * 1000) + ++#undef ARRAYSIZE + #define ARRAYSIZE(a) (sizeof((a)) / sizeof((a)[0])) + + WINE_DEFAULT_DEBUG_CHANNEL(rpc); +@@ -114,31 +92,41 @@ typedef struct _RpcConnection_np { RpcConnection common; HANDLE pipe; @@ -85,7 +121,7 @@ case ERROR_NO_DATA_DETECTED: /* client has disconnected, retry */ DisconnectNamedPipe( npc->pipe ); -@@ -150,6 +138,7 @@ static DWORD CALLBACK listen_thread(void +@@ -151,6 +139,7 @@ static DWORD CALLBACK listen_thread(void } } @@ -93,7 +129,7 @@ static RPC_STATUS rpcrt4_conn_listen_pipe(RpcConnection_np *npc) { if (npc->listening) -@@ -165,13 +154,14 @@ static RPC_STATUS rpcrt4_conn_listen_pip +@@ -166,13 +155,14 @@ static RPC_STATUS rpcrt4_conn_listen_pip } return RPC_S_OK; } @@ -109,7 +145,7 @@ PIPE_TYPE_MESSAGE | PIPE_READMODE_MESSAGE, PIPE_UNLIMITED_INSTANCES, RPC_MAX_PACKET_SIZE, RPC_MAX_PACKET_SIZE, 5000, NULL); -@@ -183,6 +173,9 @@ static RPC_STATUS rpcrt4_conn_create_pip +@@ -184,6 +174,9 @@ static RPC_STATUS rpcrt4_conn_create_pip return RPC_S_CANT_CREATE_ENDPOINT; } @@ -119,7 +155,7 @@ /* Note: we don't call ConnectNamedPipe here because it must be done in the * server thread as the thread must be alertable */ return RPC_S_OK; -@@ -229,6 +222,9 @@ static RPC_STATUS rpcrt4_conn_open_pipe( +@@ -230,6 +223,9 @@ static RPC_STATUS rpcrt4_conn_open_pipe( if (err == ERROR_PIPE_BUSY) { TRACE("connection failed, error=%x\n", err); return RPC_S_SERVER_TOO_BUSY; @@ -129,7 +165,7 @@ } if (!wait || !WaitNamedPipeA(pname, NMPWAIT_WAIT_FOREVER)) { err = GetLastError(); -@@ -238,9 +234,11 @@ static RPC_STATUS rpcrt4_conn_open_pipe( +@@ -239,9 +235,11 @@ static RPC_STATUS rpcrt4_conn_open_pipe( } /* success */ @@ -141,11 +177,50 @@ npc->pipe = pipe; return RPC_S_OK; -@@ -308,18 +306,64 @@ static RPC_STATUS rpcrt4_protseq_ncalrpc +@@ -262,6 +260,7 @@ static char *ncalrpc_pipe_name(const cha + static RPC_STATUS rpcrt4_ncalrpc_open(RpcConnection* Connection) + { + RpcConnection_np *npc = (RpcConnection_np *) Connection; ++ static const char prefix[] = "\\\\.\\pipe\\lrpc\\"; + RPC_STATUS r; + LPSTR pname; + +@@ -269,7 +268,10 @@ static RPC_STATUS rpcrt4_ncalrpc_open(Rp + if (npc->pipe) + return RPC_S_OK; + +- pname = ncalrpc_pipe_name(Connection->Endpoint); ++ /* protseq=ncalrpc: supposed to use NT LPC ports, ++ * but we'll implement it with named pipes for now */ ++ pname = I_RpcAllocate(strlen(prefix) + strlen(Connection->Endpoint) + 1); ++ strcat(strcpy(pname, prefix), Connection->Endpoint); + r = rpcrt4_conn_open_pipe(Connection, pname, TRUE); + I_RpcFree(pname); + +@@ -278,6 +280,7 @@ static RPC_STATUS rpcrt4_ncalrpc_open(Rp + + static RPC_STATUS rpcrt4_protseq_ncalrpc_open_endpoint(RpcServerProtseq* protseq, const char *endpoint) + { ++ static const char prefix[] = "\\\\.\\pipe\\lrpc\\"; + RPC_STATUS r; + LPSTR pname; + RpcConnection *Connection; +@@ -298,7 +301,10 @@ static RPC_STATUS rpcrt4_protseq_ncalrpc + if (r != RPC_S_OK) + return r; + +- pname = ncalrpc_pipe_name(Connection->Endpoint); ++ /* protseq=ncalrpc: supposed to use NT LPC ports, ++ * but we'll implement it with named pipes for now */ ++ pname = I_RpcAllocate(strlen(prefix) + strlen(Connection->Endpoint) + 1); ++ strcat(strcpy(pname, prefix), Connection->Endpoint); + r = rpcrt4_conn_create_pipe(Connection, pname); + I_RpcFree(pname); + +@@ -324,15 +330,64 @@ static char *ncacn_pipe_name(const char static RPC_STATUS rpcrt4_ncacn_np_open(RpcConnection* Connection) { RpcConnection_np *npc = (RpcConnection_np *) Connection; -- static const char prefix[] = "\\\\."; + static const char prefix[] = "\\\\"; + static const char local[] = "."; + BOOL bUseLocalName = TRUE; @@ -160,10 +235,9 @@ if (npc->pipe) return RPC_S_OK; - /* protseq=ncacn_np: named pipes */ -- pname = I_RpcAllocate(strlen(prefix) + strlen(Connection->Endpoint) + 1); -- strcat(strcpy(pname, prefix), Connection->Endpoint); +- pname = ncacn_pipe_name(Connection->Endpoint); - r = rpcrt4_conn_open_pipe(Connection, pname, FALSE); ++ /* protseq=ncacn_np: named pipes */ + size = strlen(prefix); + + if (Connection->NetworkAddr == NULL || strlen(Connection->NetworkAddr) == 0) @@ -210,7 +284,26 @@ I_RpcFree(pname); return r; -@@ -368,9 +412,9 @@ static void rpcrt4_conn_np_handoff(RpcCo +@@ -340,6 +395,7 @@ static RPC_STATUS rpcrt4_ncacn_np_open(R + + static RPC_STATUS rpcrt4_protseq_ncacn_np_open_endpoint(RpcServerProtseq *protseq, const char *endpoint) + { ++ static const char prefix[] = "\\\\."; + RPC_STATUS r; + LPSTR pname; + RpcConnection *Connection; +@@ -360,7 +416,9 @@ static RPC_STATUS rpcrt4_protseq_ncacn_n + if (r != RPC_S_OK) + return r; + +- pname = ncacn_pipe_name(Connection->Endpoint); ++ /* protseq=ncacn_np: named pipes */ ++ pname = I_RpcAllocate(strlen(prefix) + strlen(Connection->Endpoint) + 1); ++ strcat(strcpy(pname, prefix), Connection->Endpoint); + r = rpcrt4_conn_create_pipe(Connection, pname); + I_RpcFree(pname); + +@@ -378,9 +436,9 @@ static void rpcrt4_conn_np_handoff(RpcCo * to the child, then reopen the server binding to continue listening */ new_npc->pipe = old_npc->pipe; @@ -222,10 +315,41 @@ old_npc->listening = FALSE; } -@@ -415,11 +459,17 @@ static int rpcrt4_conn_np_read(RpcConnec +@@ -388,10 +446,12 @@ static RPC_STATUS rpcrt4_ncacn_np_handof + { + RPC_STATUS status; + LPSTR pname; ++ static const char prefix[] = "\\\\."; + + rpcrt4_conn_np_handoff((RpcConnection_np *)old_conn, (RpcConnection_np *)new_conn); + +- pname = ncacn_pipe_name(old_conn->Endpoint); ++ pname = I_RpcAllocate(strlen(prefix) + strlen(old_conn->Endpoint) + 1); ++ strcat(strcpy(pname, prefix), old_conn->Endpoint); + status = rpcrt4_conn_create_pipe(old_conn, pname); + I_RpcFree(pname); + +@@ -429,12 +489,14 @@ static RPC_STATUS rpcrt4_ncalrpc_handoff + { + RPC_STATUS status; + LPSTR pname; ++ static const char prefix[] = "\\\\.\\pipe\\lrpc\\"; + + TRACE("%s\n", old_conn->Endpoint); + + rpcrt4_conn_np_handoff((RpcConnection_np *)old_conn, (RpcConnection_np *)new_conn); + +- pname = ncalrpc_pipe_name(old_conn->Endpoint); ++ pname = I_RpcAllocate(strlen(prefix) + strlen(old_conn->Endpoint) + 1); ++ strcat(strcpy(pname, prefix), old_conn->Endpoint); + status = rpcrt4_conn_create_pipe(old_conn, pname); + I_RpcFree(pname); + +@@ -448,12 +510,17 @@ static int rpcrt4_conn_np_read(RpcConnec char *buf = buffer; BOOL ret = TRUE; unsigned int bytes_left = count; +- DWORD err = GetLastError(); + OVERLAPPED ovl; + + ZeroMemory(&ovl, sizeof(ovl)); @@ -241,15 +365,16 @@ if (!ret && GetLastError() == ERROR_MORE_DATA) ret = TRUE; if (!ret || !bytes_read) -@@ -427,6 +472,7 @@ static int rpcrt4_conn_np_read(RpcConnec +@@ -461,7 +528,7 @@ static int rpcrt4_conn_np_read(RpcConnec bytes_left -= bytes_read; buf += bytes_read; } +- if (ret) SetLastError(err); + CloseHandle(ovl.hEvent); return ret ? count : -1; } -@@ -437,16 +488,23 @@ static int rpcrt4_conn_np_write(RpcConne +@@ -472,16 +539,23 @@ static int rpcrt4_conn_np_write(RpcConne const char *buf = buffer; BOOL ret = TRUE; unsigned int bytes_left = count; @@ -274,7 +399,7 @@ return ret ? count : -1; } -@@ -458,9 +516,9 @@ static int rpcrt4_conn_np_close(RpcConne +@@ -493,9 +567,9 @@ static int rpcrt4_conn_np_close(RpcConne CloseHandle(npc->pipe); npc->pipe = 0; } @@ -287,7 +412,7 @@ } return 0; } -@@ -664,7 +722,7 @@ static void *rpcrt4_protseq_np_get_wait_ +@@ -699,7 +773,7 @@ static void *rpcrt4_protseq_np_get_wait_ conn = CONTAINING_RECORD(protseq->conn, RpcConnection_np, common); while (conn) { rpcrt4_conn_listen_pipe(conn); @@ -296,7 +421,7 @@ (*count)++; conn = CONTAINING_RECORD(conn->common.Next, RpcConnection_np, common); } -@@ -685,7 +743,7 @@ static void *rpcrt4_protseq_np_get_wait_ +@@ -720,7 +794,7 @@ static void *rpcrt4_protseq_np_get_wait_ *count = 1; conn = CONTAINING_RECORD(protseq->conn, RpcConnection_np, common); while (conn) { @@ -305,7 +430,7 @@ (*count)++; conn = CONTAINING_RECORD(conn->common.Next, RpcConnection_np, common); } -@@ -732,18 +790,12 @@ static int rpcrt4_protseq_np_wait_for_ne +@@ -767,18 +841,12 @@ static int rpcrt4_protseq_np_wait_for_ne EnterCriticalSection(&protseq->cs); conn = CONTAINING_RECORD(protseq->conn, RpcConnection_np, common); while (conn) { @@ -326,15 +451,3 @@ else ERR("failed to locate connection for handle %p\n", b_handle); LeaveCriticalSection(&protseq->cs); -diff -prudN .\wine\dlls\rpcrt4/rpcrt4.spec .\reactos\dll\win32\rpcrt4/rpcrt4.spec ---- .\wine\dlls\rpcrt4/rpcrt4.spec 2014-05-09 03:43:55.911032800 +0200 -+++ .\reactos\dll\win32\rpcrt4/rpcrt4.spec 2013-12-07 15:35:15.331527800 +0100 -@@ -266,7 +266,7 @@ - @ stdcall NdrRangeUnmarshall(ptr ptr ptr long) - @ stub NdrRpcSmClientAllocate - @ stub NdrRpcSmClientFree --@ stub NdrRpcSmSetClientToOsf -+@ stdcall NdrRpcSmSetClientToOsf(ptr) - @ stub NdrRpcSsDefaultAllocate - @ stub NdrRpcSsDefaultFree - @ stub NdrRpcSsDisableAllocate Modified: trunk/reactos/media/doc/README.WINE URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=…
============================================================================== --- trunk/reactos/media/doc/README.WINE [iso-8859-1] (original) +++ trunk/reactos/media/doc/README.WINE [iso-8859-1] Tue Nov 17 10:08:00 2015 @@ -165,7 +165,7 @@ reactos/dll/win32/resutils # Synced to WineStaging-1.7.47 reactos/dll/win32/riched20 # Synced to WineStaging-1.7.47 reactos/dll/win32/riched32 # Synced to WineStaging-1.7.47 -reactos/dll/win32/rpcrt4 # Synced to Wine-1.7.17 +reactos/dll/win32/rpcrt4 # Synced to WineStaging-1.7.55 reactos/dll/win32/rsabase # Synced to WineStaging-1.7.47 reactos/dll/win32/rsaenh # Synced to WineStaging-1.7.47 reactos/dll/win32/sccbase # Synced to WineStaging-1.7.47
9 years, 1 month
1
0
0
0
[akhaldi] 69905: [CRT] Import _snscanf() from Wine Staging 1.7.55. [MSVCRT] Export _snscanf(). CORE-10529 CORE-10536
by akhaldi@svn.reactos.org
Author: akhaldi Date: Mon Nov 16 22:01:01 2015 New Revision: 69905 URL:
http://svn.reactos.org/svn/reactos?rev=69905&view=rev
Log: [CRT] Import _snscanf() from Wine Staging 1.7.55. [MSVCRT] Export _snscanf(). CORE-10529 CORE-10536 Modified: trunk/reactos/dll/win32/msvcrt/msvcrt.spec trunk/reactos/lib/sdk/crt/string/scanf.c Modified: trunk/reactos/dll/win32/msvcrt/msvcrt.spec URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msvcrt/msvcrt.sp…
============================================================================== --- trunk/reactos/dll/win32/msvcrt/msvcrt.spec [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msvcrt/msvcrt.spec [iso-8859-1] Mon Nov 16 22:01:01 2015 @@ -618,7 +618,7 @@ @ cdecl _setsystime(ptr long) @ cdecl _sleep(long) @ varargs _snprintf(ptr long str) -# stub _snscanf +@ varargs _snscanf(str long str) @ varargs _snwprintf(ptr long wstr) # stub _snwscanf @ varargs _sopen(str long long) Modified: trunk/reactos/lib/sdk/crt/string/scanf.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/sdk/crt/string/scanf.c…
============================================================================== --- trunk/reactos/lib/sdk/crt/string/scanf.c [iso-8859-1] (original) +++ trunk/reactos/lib/sdk/crt/string/scanf.c [iso-8859-1] Mon Nov 16 22:01:01 2015 @@ -87,6 +87,14 @@ #undef SECURE #include "scanf.h" +/* vsnscanf_l */ +#undef WIDE_SCANF +#undef CONSOLE +#define STRING 1 +#define STRING_LEN 1 +#undef SECURE +#include "scanf.h" + #ifndef _LIBCNT_ /* vcscanf_l */ #undef WIDE_SCANF @@ -199,3 +207,17 @@ return res; } #endif + +/********************************************************************* + * _snscanf (MSVCRT.@) + */ +int CDECL _snscanf(const char *input, size_t length, const char *format, ...) +{ + __ms_va_list valist; + int res; + + __ms_va_start(valist, format); + res = vsnscanf_l(input, length, format, NULL, valist); + __ms_va_end(valist); + return res; +}
9 years, 1 month
1
0
0
0
← Newer
1
...
29
30
31
32
33
34
35
...
46
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
Results per page:
10
25
50
100
200