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
February 2020
----- 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
27 participants
239 discussions
Start a n
N
ew thread
[reactos] 02/04: [CONSRV] Rephrase/complete some comments.
by Hermès Bélusca-Maïto
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=07f8b9fe0939a562dfbef…
commit 07f8b9fe0939a562dfbef6b44c51404d6801c485 Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> AuthorDate: Sun Feb 9 00:18:40 2020 +0100 Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> CommitDate: Sun Feb 9 00:37:43 2020 +0100 [CONSRV] Rephrase/complete some comments. --- win32ss/user/winsrv/consrv/condrv/graphics.c | 2 +- win32ss/user/winsrv/consrv/conoutput.c | 6 +++--- win32ss/user/winsrv/consrv/console.c | 1 + win32ss/user/winsrv/consrv/frontends/gui/conwnd.c | 1 + win32ss/user/winsrv/consrv/frontends/gui/guiterm.c | 2 +- 5 files changed, 7 insertions(+), 5 deletions(-) diff --git a/win32ss/user/winsrv/consrv/condrv/graphics.c b/win32ss/user/winsrv/consrv/condrv/graphics.c index cc168cb8930..04341c6b663 100644 --- a/win32ss/user/winsrv/consrv/condrv/graphics.c +++ b/win32ss/user/winsrv/consrv/condrv/graphics.c @@ -71,7 +71,7 @@ GRAPHICS_BUFFER_Initialize(OUT PCONSOLE_SCREEN_BUFFER* Buffer, */ NewBuffer->ClientProcess = ProcessHandle; - /* Get infos from the graphics buffer information structure */ + /* Get information from the graphics buffer information structure */ NewBuffer->BitMapInfoLength = GraphicsInfo->Info.dwBitMapInfoLength; NewBuffer->BitMapInfo = ConsoleAllocHeap(HEAP_ZERO_MEMORY, NewBuffer->BitMapInfoLength); diff --git a/win32ss/user/winsrv/consrv/conoutput.c b/win32ss/user/winsrv/consrv/conoutput.c index b09e7012bdc..0f8bc2bd3d3 100644 --- a/win32ss/user/winsrv/consrv/conoutput.c +++ b/win32ss/user/winsrv/consrv/conoutput.c @@ -236,10 +236,10 @@ CSR_API(SrvCreateConsoleScreenBuffer) */ /* - * This is Windows' behaviour + * This is Windows behaviour. */ - /* Use the current console size. Regularize it if needed. */ + /* Use the current console size. Normalize it if needed */ TextModeInfo.ScreenBufferSize = Console->ConsoleSize; if (TextModeInfo.ScreenBufferSize.X == 0) TextModeInfo.ScreenBufferSize.X = 1; if (TextModeInfo.ScreenBufferSize.Y == 0) TextModeInfo.ScreenBufferSize.Y = 1; @@ -258,7 +258,7 @@ CSR_API(SrvCreateConsoleScreenBuffer) } else if (CreateScreenBufferRequest->ScreenBufferType == CONSOLE_GRAPHICS_BUFFER) { - /* Get infos from the graphics buffer information structure */ + /* Get information from the graphics buffer information structure */ if (!CsrValidateMessageBuffer(ApiMessage, (PVOID*)&CreateScreenBufferRequest->GraphicsBufferInfo.lpBitMapInfo, CreateScreenBufferRequest->GraphicsBufferInfo.dwBitMapInfoLength, diff --git a/win32ss/user/winsrv/consrv/console.c b/win32ss/user/winsrv/consrv/console.c index 80a2f4c0f23..b4e4668b5d5 100644 --- a/win32ss/user/winsrv/consrv/console.c +++ b/win32ss/user/winsrv/consrv/console.c @@ -1200,6 +1200,7 @@ CSR_API(SrvSetConsoleMode) { #define CONSOLE_VALID_CONTROL_MODES ( ENABLE_EXTENDED_FLAGS | \ ENABLE_INSERT_MODE | ENABLE_QUICK_EDIT_MODE ) +// NOTE: Vista+ ENABLE_AUTO_POSITION is also a control mode. NTSTATUS Status; PCONSOLE_GETSETCONSOLEMODE ConsoleModeRequest = &((PCONSOLE_API_MESSAGE)ApiMessage)->Data.ConsoleModeRequest; diff --git a/win32ss/user/winsrv/consrv/frontends/gui/conwnd.c b/win32ss/user/winsrv/consrv/frontends/gui/conwnd.c index 633317cd039..ffc6939aa0c 100644 --- a/win32ss/user/winsrv/consrv/frontends/gui/conwnd.c +++ b/win32ss/user/winsrv/consrv/frontends/gui/conwnd.c @@ -1255,6 +1255,7 @@ OnTimer(PGUI_CONSOLE_DATA GuiData) if (GetType(Buff) == TEXTMODE_BUFFER) { + /* Repaint the caret */ InvalidateCell(GuiData, Buff->CursorPosition.X, Buff->CursorPosition.Y); Buff->CursorBlinkOn = !Buff->CursorBlinkOn; diff --git a/win32ss/user/winsrv/consrv/frontends/gui/guiterm.c b/win32ss/user/winsrv/consrv/frontends/gui/guiterm.c index afca59331a6..10142943520 100644 --- a/win32ss/user/winsrv/consrv/frontends/gui/guiterm.c +++ b/win32ss/user/winsrv/consrv/frontends/gui/guiterm.c @@ -1238,7 +1238,7 @@ GuiLoadFrontEnd(IN OUT PFRONTEND FrontEnd, if ((ConsoleStartInfo->dwStartupFlags & STARTF_TITLEISLINKNAME) == 0) { #if 0 - /* Load the terminal infos from the registry */ + /* Load the terminal information from the registry */ GuiConsoleReadUserSettings(&GuiInitInfo->TermInfo); #endif
4 years, 10 months
1
0
0
0
[reactos] 01/04: [SDK] wincon.h: Use explicit _WIN32_WINNT_* values. Add some missing flags.
by Hermès Bélusca-Maïto
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=b4e40f21c3f402ae1e7ac…
commit b4e40f21c3f402ae1e7ac201fbacb3ab03a7d594 Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> AuthorDate: Sun Feb 9 00:13:30 2020 +0100 Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> CommitDate: Sun Feb 9 00:37:43 2020 +0100 [SDK] wincon.h: Use explicit _WIN32_WINNT_* values. Add some missing flags. --- sdk/include/psdk/wincon.h | 45 ++++++++++++++++++++++++++++++--------------- 1 file changed, 30 insertions(+), 15 deletions(-) diff --git a/sdk/include/psdk/wincon.h b/sdk/include/psdk/wincon.h index 5182282d2a9..6145b93cf1c 100644 --- a/sdk/include/psdk/wincon.h +++ b/sdk/include/psdk/wincon.h @@ -5,7 +5,7 @@ extern "C" { #endif -#if (_WIN32_WINNT >= 0x0600) && !defined(NOGDI) +#if (_WIN32_WINNT >= _WIN32_WINNT_VISTA) && !defined(NOGDI) # include "wingdi.h" #endif @@ -17,7 +17,7 @@ extern "C" { /* * Special PID for parent process for AttachConsole API */ -#if (_WIN32_WINNT >= 0x0501) +#if (_WIN32_WINNT >= _WIN32_WINNT_WINXP) #define ATTACH_PARENT_PROCESS ((DWORD)-1) #endif @@ -45,13 +45,16 @@ extern "C" { #define BACKGROUND_RED 0x0040 #define BACKGROUND_INTENSITY 0x0080 -#define COMMON_LVB_LEADING_BYTE 0x0100 -#define COMMON_LVB_TRAILING_BYTE 0x0200 -#define COMMON_LVB_GRID_HORIZONTAL 0x0400 -#define COMMON_LVB_GRID_LVERTICAL 0x0800 -#define COMMON_LVB_GRID_RVERTICAL 0x1000 -#define COMMON_LVB_REVERSE_VIDEO 0x4000 -#define COMMON_LVB_UNDERSCORE 0x8000 +#define COMMON_LVB_LEADING_BYTE 0x0100 /* DBCS Leading Byte */ +#define COMMON_LVB_TRAILING_BYTE 0x0200 /* DBCS Trailing Byte */ +#define COMMON_LVB_GRID_HORIZONTAL 0x0400 /* Grid attribute: Top Horizontal */ +#define COMMON_LVB_GRID_LVERTICAL 0x0800 /* Grid attribute: Left Vertical */ +#define COMMON_LVB_GRID_RVERTICAL 0x1000 /* Grid attribute: Right Vertical */ +#define COMMON_LVB_REVERSE_VIDEO 0x4000 /* Reverse fore/back ground attribute */ +#define COMMON_LVB_UNDERSCORE 0x8000 /* Underscore */ + +#define COMMON_LVB_SBCSDBCS \ + (COMMON_LVB_LEADING_BYTE | COMMON_LVB_TRAILING_BYTE) /* == 0x0300 */ /* * Screen buffer types @@ -80,9 +83,12 @@ extern "C" { #define ENABLE_INSERT_MODE 0x0020 #define ENABLE_QUICK_EDIT_MODE 0x0040 #define ENABLE_EXTENDED_FLAGS 0x0080 -#if (_WIN32_WINNT >= 0x0600) +#if (_WIN32_WINNT >= _WIN32_WINNT_VISTA) #define ENABLE_AUTO_POSITION 0x0100 #endif +#if (_WIN32_WINNT >= _WIN32_WINNT_WIN10) +#define ENABLE_VIRTUAL_TERMINAL_INPUT 0x0200 +#endif /* * Output mode flags @@ -102,7 +108,7 @@ extern "C" { /* * History information and mode flags */ -#if (_WIN32_WINNT >= 0x0600) +#if (_WIN32_WINNT >= _WIN32_WINNT_VISTA) // For Get/SetConsoleHistoryInfo #define HISTORY_NO_DUP_FLAG 0x0001 // For SetConsoleCommandHistoryMode @@ -138,6 +144,15 @@ extern "C" { #define CAPSLOCK_ON 0x0080 #define ENHANCED_KEY 0x0100 +// NLS Japanese flags +#define NLS_DBCSCHAR 0x00010000 /* SBCS/DBCS mode */ +#define NLS_ALPHANUMERIC 0x00000000 /* Alphanumeric mode */ +#define NLS_KATAKANA 0x00020000 /* Katakana mode */ +#define NLS_HIRAGANA 0x00040000 /* Hiragana mode */ +#define NLS_ROMAN 0x00400000 /* Roman/Noroman mode */ +#define NLS_IME_CONVERSION 0x00800000 /* IME conversion */ +#define NLS_IME_DISABLE 0x20000000 /* IME enable/disable */ + /* * ButtonState flags */ @@ -153,7 +168,7 @@ extern "C" { #define MOUSE_MOVED 0x0001 #define DOUBLE_CLICK 0x0002 #define MOUSE_WHEELED 0x0004 -#if (_WIN32_WINNT >= 0x0600) +#if (_WIN32_WINNT >= _WIN32_WINNT_VISTA) #define MOUSE_HWHEELED 0x0008 #endif @@ -268,7 +283,7 @@ typedef struct _INPUT_RECORD { } Event; } INPUT_RECORD, *PINPUT_RECORD; -#if (_WIN32_WINNT >= 0x0600) +#if (_WIN32_WINNT >= _WIN32_WINNT_VISTA) typedef struct _CONSOLE_HISTORY_INFO { UINT cbSize; UINT HistoryBufferSize; @@ -302,7 +317,7 @@ typedef struct _CONSOLE_FONT_INFOEX { BOOL WINAPI AllocConsole(VOID); -#if (_WIN32_WINNT >= 0x0501) +#if (_WIN32_WINNT >= _WIN32_WINNT_WINXP) BOOL WINAPI AttachConsole(_In_ DWORD); BOOL WINAPI AddConsoleAliasA(_In_ LPCSTR, _In_ LPCSTR, _In_ LPCSTR); @@ -435,7 +450,7 @@ GetCurrentConsoleFont( _In_ BOOL bMaximumWindow, _Out_ PCONSOLE_FONT_INFO lpConsoleCurrentFont); -#if (_WIN32_WINNT >= 0x0500) +#if (_WIN32_WINNT >= _WIN32_WINNT_WIN2K) HWND WINAPI GetConsoleWindow(VOID); BOOL WINAPI GetConsoleDisplayMode(_Out_ LPDWORD lpModeFlags);
4 years, 10 months
1
0
0
0
[reactos] 08/08: [SDK] Silence a GCC warning on RtlAssert
by Mark Jansen
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=fc744405fd8ab50eeb695…
commit fc744405fd8ab50eeb6955a8bc6a12bb7518ba6c Author: Mark Jansen <mark.jansen(a)reactos.org> AuthorDate: Sun Jan 12 00:13:24 2020 +0100 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Sat Feb 8 22:09:14 2020 +0100 [SDK] Silence a GCC warning on RtlAssert --- sdk/include/reactos/debug.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sdk/include/reactos/debug.h b/sdk/include/reactos/debug.h index ab332fda181..81357acadd6 100644 --- a/sdk/include/reactos/debug.h +++ b/sdk/include/reactos/debug.h @@ -66,7 +66,7 @@ RtlAssert( #ifndef assert #if DBG && !defined(NASSERT) -#define assert(x) if (!(x)) { RtlAssert((PVOID)#x, (PVOID)__RELFILE__, __LINE__, ""); } +#define assert(x) if (!(x)) { RtlAssert((PVOID)#x, (PVOID)__RELFILE__, __LINE__, (PCHAR)""); } #else #define assert(x) ((VOID) 0) #endif @@ -74,7 +74,7 @@ RtlAssert( #ifndef ASSERT #if DBG && !defined(NASSERT) -#define ASSERT(x) if (!(x)) { RtlAssert((PVOID)#x, (PVOID)__RELFILE__, __LINE__, ""); } +#define ASSERT(x) if (!(x)) { RtlAssert((PVOID)#x, (PVOID)__RELFILE__, __LINE__, (PCHAR)""); } #else #define ASSERT(x) ((VOID) 0) #endif
4 years, 10 months
1
0
0
0
[reactos] 07/08: [ATL][ATL_APITEST] Test + implement CHeapPtrList
by Mark Jansen
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=008745d951ac973060cbc…
commit 008745d951ac973060cbc0ff5aa456f384f7bd73 Author: Mark Jansen <mark.jansen(a)reactos.org> AuthorDate: Wed Jan 8 23:26:06 2020 +0100 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Sat Feb 8 22:09:14 2020 +0100 [ATL][ATL_APITEST] Test + implement CHeapPtrList --- modules/rostests/apitests/atl/CComVariant.cpp | 1 + modules/rostests/apitests/atl/CHeapPtrList.cpp | 117 ++++++++++++++ modules/rostests/apitests/atl/CMakeLists.txt | 3 +- modules/rostests/apitests/atl/devenv/ATLTest.sln | 10 ++ .../apitests/atl/devenv/CHeapPtrList.vcxproj | 180 +++++++++++++++++++++ modules/rostests/apitests/atl/testlist.c | 2 + sdk/lib/atl/atlcoll.h | 28 ++++ 7 files changed, 340 insertions(+), 1 deletion(-) diff --git a/modules/rostests/apitests/atl/CComVariant.cpp b/modules/rostests/apitests/atl/CComVariant.cpp index cd6cd605301..77e217e57c5 100644 --- a/modules/rostests/apitests/atl/CComVariant.cpp +++ b/modules/rostests/apitests/atl/CComVariant.cpp @@ -6,6 +6,7 @@ */ /* In case we are building against the MS headers, we need to disable assertions. */ +#undef ATLASSERT #define ATLASSERT(x) #define _ATL_NO_VARIANT_THROW diff --git a/modules/rostests/apitests/atl/CHeapPtrList.cpp b/modules/rostests/apitests/atl/CHeapPtrList.cpp new file mode 100644 index 00000000000..41da433b427 --- /dev/null +++ b/modules/rostests/apitests/atl/CHeapPtrList.cpp @@ -0,0 +1,117 @@ +/* + * PROJECT: ReactOS api tests + * LICENSE: LGPL-2.1-or-later (
https://spdx.org/licenses/LGPL-2.1-or-later
) + * PURPOSE: Test for CHeapPtrList + * COPYRIGHT: Copyright 2020 Mark Jansen (mark.jansen(a)reactos.org) + */ + +#ifdef HAVE_APITEST +#include <apitest.h> +#else +#include "atltest.h" +#endif +#include <atlcoll.h> + +static PDWORD +test_Alloc(DWORD value) +{ + PDWORD ptr = (PDWORD)::CoTaskMemAlloc(sizeof(DWORD)); + *ptr = value; + return ptr; +} + +// We use the CComAllocator, so we can easily spy on it +template <typename T> +class CComHeapPtrList : + public CHeapPtrList<T, CComAllocator> +{ +public: + CComHeapPtrList(_In_ UINT nBlockSize = 10) throw() + :CHeapPtrList<T, CComAllocator>(nBlockSize) + { + } +}; + + + +static LONG g_OpenAllocations = 0; +static LONG g_Reallocations = 0; + +struct CHeapPtrListMallocSpy : public IMallocSpy +{ + STDMETHODIMP QueryInterface(REFIID riid, void **ppvObject) + { + if (IsEqualGUID(riid, IID_IMallocSpy)) + { + *ppvObject = this; + } + return S_OK; + } + + virtual ULONG STDMETHODCALLTYPE AddRef() { return 1; } + virtual ULONG STDMETHODCALLTYPE Release() { return 1; } + virtual SIZE_T STDMETHODCALLTYPE PreAlloc(SIZE_T cbRequest) { return cbRequest; } + virtual LPVOID STDMETHODCALLTYPE PostAlloc(LPVOID pActual) + { + InterlockedIncrement(&g_OpenAllocations); + return pActual; + } + virtual LPVOID STDMETHODCALLTYPE PreFree(LPVOID pRequest, BOOL) { return pRequest; } + virtual void STDMETHODCALLTYPE PostFree(BOOL fSpyed) + { + if (fSpyed) + InterlockedDecrement(&g_OpenAllocations); + } + virtual SIZE_T STDMETHODCALLTYPE PreRealloc(LPVOID pRequest, SIZE_T cbRequest, LPVOID *ppNewRequest, BOOL) + { + *ppNewRequest = pRequest; + return cbRequest; + } + virtual LPVOID STDMETHODCALLTYPE PostRealloc(LPVOID pActual, BOOL fSpyed) + { + if (fSpyed) + InterlockedIncrement(&g_Reallocations); + return pActual; + } + virtual LPVOID STDMETHODCALLTYPE PreGetSize(LPVOID pRequest, BOOL) { return pRequest; } + virtual SIZE_T STDMETHODCALLTYPE PostGetSize(SIZE_T cbActual, BOOL) { return cbActual; } + virtual LPVOID STDMETHODCALLTYPE PreDidAlloc(LPVOID pRequest, BOOL) { return pRequest; } + virtual int STDMETHODCALLTYPE PostDidAlloc(LPVOID, BOOL, int fActual) { return fActual; } + virtual void STDMETHODCALLTYPE PreHeapMinimize() {} + virtual void STDMETHODCALLTYPE PostHeapMinimize() {} +}; + +static CHeapPtrListMallocSpy g_Spy; + + +START_TEST(CHeapPtrList) +{ + HRESULT hr = CoRegisterMallocSpy(&g_Spy); + ok(SUCCEEDED(hr), "Expected CoRegisterMallocSpy to succeed, but it failed: 0x%lx\n", hr); + + { + ok(g_OpenAllocations == 0, "Expected there to be 0 allocations, was: %ld\n", g_OpenAllocations); + CComHeapPtrList<DWORD> heapPtr1; + ok(g_OpenAllocations == 0, "Expected there to be 0 allocations, was: %ld\n", g_OpenAllocations); + PDWORD Ptr = test_Alloc(0x11111111); + ok(g_OpenAllocations == 1, "Expected there to be 1 allocations, was: %ld\n", g_OpenAllocations); + CComHeapPtr<DWORD> tmp(Ptr); + ok(g_OpenAllocations == 1, "Expected there to be 1 allocations, was: %ld\n", g_OpenAllocations); + heapPtr1.AddTail(tmp); + ok(tmp.m_pData == NULL, "Expected m_pData to be transfered\n"); + ok(g_OpenAllocations == 1, "Expected there to be 1 allocations, was: %ld\n", g_OpenAllocations); + Ptr = test_Alloc(0x22222222); + ok(g_OpenAllocations == 2, "Expected there to be 1 allocations, was: %ld\n", g_OpenAllocations); +#ifdef _MSC_VER + heapPtr1.AddTail(CComHeapPtr<DWORD>(Ptr)); +#else + CComHeapPtr<DWORD> xxx(Ptr); + heapPtr1.AddTail(xxx); +#endif + ok(g_OpenAllocations == 2, "Expected there to be 1 allocations, was: %ld\n", g_OpenAllocations); + } + ok(g_OpenAllocations == 0, "Expected there to be 0 allocations, was: %ld\n", g_OpenAllocations); + + hr = CoRevokeMallocSpy(); + ok(SUCCEEDED(hr), "Expected CoRevokeMallocSpy to succeed, but it failed: 0x%lx\n", hr); +} diff --git a/modules/rostests/apitests/atl/CMakeLists.txt b/modules/rostests/apitests/atl/CMakeLists.txt index 8bbd802c4a5..b3e12092ece 100644 --- a/modules/rostests/apitests/atl/CMakeLists.txt +++ b/modules/rostests/apitests/atl/CMakeLists.txt @@ -13,6 +13,8 @@ list(APPEND SOURCE CComHeapPtr.cpp CComObject.cpp CComQIPtr.cpp + CComVariant.cpp + CHeapPtrList.cpp CImage.cpp CRegKey.cpp CSimpleArray.cpp @@ -22,7 +24,6 @@ list(APPEND SOURCE add_executable(atl_apitest ${SOURCE} - CComVariant.cpp testlist.c atl_apitest.rc) diff --git a/modules/rostests/apitests/atl/devenv/ATLTest.sln b/modules/rostests/apitests/atl/devenv/ATLTest.sln index 125d96ce315..8fd0e07a092 100644 --- a/modules/rostests/apitests/atl/devenv/ATLTest.sln +++ b/modules/rostests/apitests/atl/devenv/ATLTest.sln @@ -21,6 +21,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CAtlArray", "CAtlArray.vcxp EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CAtlList", "CAtlList.vcxproj", "{00C3325D-0E3D-43F1-92C8-F7D5C32F70C6}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CHeapPtrList", "CHeapPtrList.vcxproj", "{83D1D036-02AC-4DC5-B061-1F47F7065661}" +EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CComHeapPtr", "CComHeapPtr.vcxproj", "{F10E34E3-FB53-4650-985A-28BD1905D65C}" EndProject Global @@ -103,6 +105,14 @@ Global {00C3325D-0E3D-43F1-92C8-F7D5C32F70C6}.Release|x64.Build.0 = Release|x64 {00C3325D-0E3D-43F1-92C8-F7D5C32F70C6}.Release|x86.ActiveCfg = Release|Win32 {00C3325D-0E3D-43F1-92C8-F7D5C32F70C6}.Release|x86.Build.0 = Release|Win32 + {83D1D036-02AC-4DC5-B061-1F47F7065661}.Debug|x64.ActiveCfg = Debug|x64 + {83D1D036-02AC-4DC5-B061-1F47F7065661}.Debug|x64.Build.0 = Debug|x64 + {83D1D036-02AC-4DC5-B061-1F47F7065661}.Debug|x86.ActiveCfg = Debug|Win32 + {83D1D036-02AC-4DC5-B061-1F47F7065661}.Debug|x86.Build.0 = Debug|Win32 + {83D1D036-02AC-4DC5-B061-1F47F7065661}.Release|x64.ActiveCfg = Release|x64 + {83D1D036-02AC-4DC5-B061-1F47F7065661}.Release|x64.Build.0 = Release|x64 + {83D1D036-02AC-4DC5-B061-1F47F7065661}.Release|x86.ActiveCfg = Release|Win32 + {83D1D036-02AC-4DC5-B061-1F47F7065661}.Release|x86.Build.0 = Release|Win32 {F10E34E3-FB53-4650-985A-28BD1905D65C}.Debug|x64.ActiveCfg = Debug|x64 {F10E34E3-FB53-4650-985A-28BD1905D65C}.Debug|x64.Build.0 = Debug|x64 {F10E34E3-FB53-4650-985A-28BD1905D65C}.Debug|x86.ActiveCfg = Debug|Win32 diff --git a/modules/rostests/apitests/atl/devenv/CHeapPtrList.vcxproj b/modules/rostests/apitests/atl/devenv/CHeapPtrList.vcxproj new file mode 100644 index 00000000000..28f9f52ab5e --- /dev/null +++ b/modules/rostests/apitests/atl/devenv/CHeapPtrList.vcxproj @@ -0,0 +1,180 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="
http://schemas.microsoft.com/developer/msbuild/2003
"> + <ItemGroup Label="ProjectConfigurations"> + <ProjectConfiguration Include="Debug|Win32"> + <Configuration>Debug</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Release|Win32"> + <Configuration>Release</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Debug|x64"> + <Configuration>Debug</Configuration> + <Platform>x64</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Release|x64"> + <Configuration>Release</Configuration> + <Platform>x64</Platform> + </ProjectConfiguration> + </ItemGroup> + <PropertyGroup Label="Globals"> + <ProjectGuid>{83D1D036-02AC-4DC5-B061-1F47F7065661}</ProjectGuid> + <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion> + <Keyword>AtlProj</Keyword> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> + <ConfigurationType>Application</ConfigurationType> + <UseDebugLibraries>true</UseDebugLibraries> + <PlatformToolset>v140_xp</PlatformToolset> + <CharacterSet>Unicode</CharacterSet> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> + <ConfigurationType>Application</ConfigurationType> + <UseDebugLibraries>false</UseDebugLibraries> + <PlatformToolset>v140_xp</PlatformToolset> + <CharacterSet>Unicode</CharacterSet> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration"> + <ConfigurationType>Application</ConfigurationType> + <UseDebugLibraries>true</UseDebugLibraries> + <CharacterSet>Unicode</CharacterSet> + <PlatformToolset>v140_xp</PlatformToolset> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> + <ConfigurationType>Application</ConfigurationType> + <UseDebugLibraries>false</UseDebugLibraries> + <PlatformToolset>v140_xp</PlatformToolset> + <CharacterSet>Unicode</CharacterSet> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> + <ImportGroup Label="ExtensionSettings"> + </ImportGroup> + <ImportGroup Label="Shared"> + </ImportGroup> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <PropertyGroup Label="UserMacros" /> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + <IgnoreImportLibrary>true</IgnoreImportLibrary> + <LinkIncremental>true</LinkIncremental> + <IntDir>$(ProjectName)\$(Configuration)\</IntDir> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> + <IgnoreImportLibrary>true</IgnoreImportLibrary> + <LinkIncremental>true</LinkIncremental> + <IntDir>$(ProjectName)\$(Platform)\$(Configuration)\</IntDir> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + <IgnoreImportLibrary>true</IgnoreImportLibrary> + <LinkIncremental>false</LinkIncremental> + <IntDir>$(ProjectName)\$(Configuration)\</IntDir> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> + <IgnoreImportLibrary>true</IgnoreImportLibrary> + <LinkIncremental>false</LinkIncremental> + <IntDir>$(ProjectName)\$(Platform)\$(Configuration)\</IntDir> + </PropertyGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + <ClCompile> + <PrecompiledHeader>NotUsing</PrecompiledHeader> + <WarningLevel>Level3</WarningLevel> + <Optimization>Disabled</Optimization> + <PreprocessorDefinitions>WIN32;_WINDOWS;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <SDLCheck>true</SDLCheck> + </ClCompile> + <ResourceCompile> + <Culture>0x0409</Culture> + <AdditionalIncludeDirectories>$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> + </ResourceCompile> + <Link> + <SubSystem>Console</SubSystem> + <GenerateDebugInformation>true</GenerateDebugInformation> + </Link> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> + <ClCompile> + <PrecompiledHeader>NotUsing</PrecompiledHeader> + <WarningLevel>Level3</WarningLevel> + <Optimization>Disabled</Optimization> + <PreprocessorDefinitions>_WINDOWS;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <SDLCheck>true</SDLCheck> + </ClCompile> + <ResourceCompile> + <Culture>0x0409</Culture> + <AdditionalIncludeDirectories>$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> + </ResourceCompile> + <Link> + <SubSystem>Console</SubSystem> + <GenerateDebugInformation>true</GenerateDebugInformation> + </Link> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + <ClCompile> + <PrecompiledHeader>NotUsing</PrecompiledHeader> + <WarningLevel>Level3</WarningLevel> + <Optimization>MaxSpeed</Optimization> + <PreprocessorDefinitions>WIN32;_WINDOWS;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <SDLCheck>true</SDLCheck> + </ClCompile> + <ResourceCompile> + <Culture>0x0409</Culture> + <AdditionalIncludeDirectories>$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> + </ResourceCompile> + <Link> + <SubSystem>Console</SubSystem> + <GenerateDebugInformation>true</GenerateDebugInformation> + <EnableCOMDATFolding>true</EnableCOMDATFolding> + <OptimizeReferences>true</OptimizeReferences> + </Link> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> + <ClCompile> + <PrecompiledHeader>NotUsing</PrecompiledHeader> + <WarningLevel>Level3</WarningLevel> + <Optimization>MaxSpeed</Optimization> + <PreprocessorDefinitions>_WINDOWS;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <SDLCheck>true</SDLCheck> + </ClCompile> + <ResourceCompile> + <Culture>0x0409</Culture> + <AdditionalIncludeDirectories>$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> + </ResourceCompile> + <Link> + <SubSystem>Console</SubSystem> + <GenerateDebugInformation>true</GenerateDebugInformation> + <EnableCOMDATFolding>true</EnableCOMDATFolding> + <OptimizeReferences>true</OptimizeReferences> + </Link> + </ItemDefinitionGroup> + <ItemGroup> + <ClCompile Include="../CHeapPtrList.cpp"> + <RuntimeLibrary Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MultiThreaded</RuntimeLibrary> + <RuntimeLibrary Condition="'$(Configuration)|$(Platform)'=='Release|x64'">MultiThreaded</RuntimeLibrary> + <RuntimeLibrary Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">MultiThreadedDebug</RuntimeLibrary> + <RuntimeLibrary Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">MultiThreadedDebug</RuntimeLibrary> + <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">NotUsing</PrecompiledHeader> + <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">NotUsing</PrecompiledHeader> + <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">NotUsing</PrecompiledHeader> + <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">NotUsing</PrecompiledHeader> + </ClCompile> + </ItemGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> + <ImportGroup Label="ExtensionTargets"> + </ImportGroup> +</Project> \ No newline at end of file diff --git a/modules/rostests/apitests/atl/testlist.c b/modules/rostests/apitests/atl/testlist.c index d9a88545f2c..028063f826e 100644 --- a/modules/rostests/apitests/atl/testlist.c +++ b/modules/rostests/apitests/atl/testlist.c @@ -10,6 +10,7 @@ extern void func_CComHeapPtr(void); extern void func_CComObject(void); extern void func_CComQIPtr(void); extern void func_CComVariant(void); +extern void func_CHeapPtrList(void); extern void func_CImage(void); extern void func_CRegKey(void); extern void func_CSimpleArray(void); @@ -27,6 +28,7 @@ const struct test winetest_testlist[] = { "CComObject", func_CComObject }, { "CComQIPtr", func_CComQIPtr }, { "CComVariant", func_CComVariant }, + { "CHeapPtrList", func_CHeapPtrList }, { "CImage", func_CImage }, { "CRegKey", func_CRegKey }, { "CSimpleArray", func_CSimpleArray }, diff --git a/sdk/lib/atl/atlcoll.h b/sdk/lib/atl/atlcoll.h index 6775a0281a3..32b9b46362d 100644 --- a/sdk/lib/atl/atlcoll.h +++ b/sdk/lib/atl/atlcoll.h @@ -157,6 +157,17 @@ class CElementTraits : }; +template<typename T, class Allocator = CCRTAllocator> +class CHeapPtrElementTraits : + public CDefaultElementTraits< CHeapPtr<T, Allocator> > +{ +public: + typedef CHeapPtr<T, Allocator>& INARGTYPE; + typedef T*& OUTARGTYPE; +}; + + + template<typename E, class ETraits = CElementTraits<E> > class CAtlArray { @@ -852,6 +863,23 @@ typename CAtlList<E, ETraits>::CNode* CAtlList< E, ETraits>::GetFreeNode() return m_FreeNode; } + +template<typename E, class Allocator = CCRTAllocator > +class CHeapPtrList : + public CAtlList<CHeapPtr<E, Allocator>, CHeapPtrElementTraits<E, Allocator> > +{ +public: + CHeapPtrList(_In_ UINT nBlockSize = 10) : + CAtlList<CHeapPtr<E, Allocator>, CHeapPtrElementTraits<E, Allocator> >(nBlockSize) + { + } + +private: + CHeapPtrList(const CHeapPtrList&); + CHeapPtrList& operator=(const CHeapPtrList*); +}; + + } #endif \ No newline at end of file
4 years, 10 months
1
0
0
0
[reactos] 06/08: [ATL_APITEST] Add standalone CComHeapPtr project
by Mark Jansen
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=09cfb2823c068a04d2984…
commit 09cfb2823c068a04d2984cce6f52012b05c7292f Author: Mark Jansen <mark.jansen(a)reactos.org> AuthorDate: Wed Jan 8 23:20:41 2020 +0100 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Sat Feb 8 22:09:14 2020 +0100 [ATL_APITEST] Add standalone CComHeapPtr project --- modules/rostests/apitests/atl/CComHeapPtr.cpp | 15 +- modules/rostests/apitests/atl/devenv/ATLTest.sln | 10 ++ .../apitests/atl/devenv/CComHeapPtr.vcxproj | 180 +++++++++++++++++++++ 3 files changed, 200 insertions(+), 5 deletions(-) diff --git a/modules/rostests/apitests/atl/CComHeapPtr.cpp b/modules/rostests/apitests/atl/CComHeapPtr.cpp index 30fb99abd0f..da44a2930b1 100644 --- a/modules/rostests/apitests/atl/CComHeapPtr.cpp +++ b/modules/rostests/apitests/atl/CComHeapPtr.cpp @@ -1,14 +1,19 @@ /* - * PROJECT: ReactOS api tests - * LICENSE: LGPLv2.1+ - See COPYING.LIB in the top level directory - * PURPOSE: Test for CComHeapPtr - * PROGRAMMER: Mark Jansen + * PROJECT: ReactOS api tests + * LICENSE: LGPL-2.1-or-later (
https://spdx.org/licenses/LGPL-2.1-or-later
) + * PURPOSE: Test for CComHeapPtr + * COPYRIGHT: Copyright 2015-2020 Mark Jansen (mark.jansen(a)reactos.org) */ +#ifdef HAVE_APITEST #include <apitest.h> +#else +#include "atltest.h" +#endif #include <atlbase.h> -static PDWORD test_Alloc(DWORD value) +static PDWORD +test_Alloc(DWORD value) { PDWORD ptr = (PDWORD)::CoTaskMemAlloc(sizeof(DWORD)); *ptr = value; diff --git a/modules/rostests/apitests/atl/devenv/ATLTest.sln b/modules/rostests/apitests/atl/devenv/ATLTest.sln index bfb2408196e..125d96ce315 100644 --- a/modules/rostests/apitests/atl/devenv/ATLTest.sln +++ b/modules/rostests/apitests/atl/devenv/ATLTest.sln @@ -21,6 +21,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CAtlArray", "CAtlArray.vcxp EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CAtlList", "CAtlList.vcxproj", "{00C3325D-0E3D-43F1-92C8-F7D5C32F70C6}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CComHeapPtr", "CComHeapPtr.vcxproj", "{F10E34E3-FB53-4650-985A-28BD1905D65C}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|x64 = Debug|x64 @@ -101,6 +103,14 @@ Global {00C3325D-0E3D-43F1-92C8-F7D5C32F70C6}.Release|x64.Build.0 = Release|x64 {00C3325D-0E3D-43F1-92C8-F7D5C32F70C6}.Release|x86.ActiveCfg = Release|Win32 {00C3325D-0E3D-43F1-92C8-F7D5C32F70C6}.Release|x86.Build.0 = Release|Win32 + {F10E34E3-FB53-4650-985A-28BD1905D65C}.Debug|x64.ActiveCfg = Debug|x64 + {F10E34E3-FB53-4650-985A-28BD1905D65C}.Debug|x64.Build.0 = Debug|x64 + {F10E34E3-FB53-4650-985A-28BD1905D65C}.Debug|x86.ActiveCfg = Debug|Win32 + {F10E34E3-FB53-4650-985A-28BD1905D65C}.Debug|x86.Build.0 = Debug|Win32 + {F10E34E3-FB53-4650-985A-28BD1905D65C}.Release|x64.ActiveCfg = Release|x64 + {F10E34E3-FB53-4650-985A-28BD1905D65C}.Release|x64.Build.0 = Release|x64 + {F10E34E3-FB53-4650-985A-28BD1905D65C}.Release|x86.ActiveCfg = Release|Win32 + {F10E34E3-FB53-4650-985A-28BD1905D65C}.Release|x86.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/modules/rostests/apitests/atl/devenv/CComHeapPtr.vcxproj b/modules/rostests/apitests/atl/devenv/CComHeapPtr.vcxproj new file mode 100644 index 00000000000..09d8570de67 --- /dev/null +++ b/modules/rostests/apitests/atl/devenv/CComHeapPtr.vcxproj @@ -0,0 +1,180 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="
http://schemas.microsoft.com/developer/msbuild/2003
"> + <ItemGroup Label="ProjectConfigurations"> + <ProjectConfiguration Include="Debug|Win32"> + <Configuration>Debug</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Release|Win32"> + <Configuration>Release</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Debug|x64"> + <Configuration>Debug</Configuration> + <Platform>x64</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Release|x64"> + <Configuration>Release</Configuration> + <Platform>x64</Platform> + </ProjectConfiguration> + </ItemGroup> + <PropertyGroup Label="Globals"> + <ProjectGuid>{F10E34E3-FB53-4650-985A-28BD1905D65C}</ProjectGuid> + <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion> + <Keyword>AtlProj</Keyword> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> + <ConfigurationType>Application</ConfigurationType> + <UseDebugLibraries>true</UseDebugLibraries> + <PlatformToolset>v140_xp</PlatformToolset> + <CharacterSet>Unicode</CharacterSet> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> + <ConfigurationType>Application</ConfigurationType> + <UseDebugLibraries>false</UseDebugLibraries> + <PlatformToolset>v140_xp</PlatformToolset> + <CharacterSet>Unicode</CharacterSet> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration"> + <ConfigurationType>Application</ConfigurationType> + <UseDebugLibraries>true</UseDebugLibraries> + <PlatformToolset>v140_xp</PlatformToolset> + <CharacterSet>Unicode</CharacterSet> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> + <ConfigurationType>Application</ConfigurationType> + <UseDebugLibraries>false</UseDebugLibraries> + <PlatformToolset>v140_xp</PlatformToolset> + <CharacterSet>Unicode</CharacterSet> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> + <ImportGroup Label="ExtensionSettings"> + </ImportGroup> + <ImportGroup Label="Shared"> + </ImportGroup> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <PropertyGroup Label="UserMacros" /> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + <IgnoreImportLibrary>true</IgnoreImportLibrary> + <LinkIncremental>true</LinkIncremental> + <IntDir>$(ProjectName)\$(Configuration)\</IntDir> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> + <IgnoreImportLibrary>true</IgnoreImportLibrary> + <LinkIncremental>true</LinkIncremental> + <IntDir>$(ProjectName)\$(Platform)\$(Configuration)\</IntDir> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + <IgnoreImportLibrary>true</IgnoreImportLibrary> + <LinkIncremental>false</LinkIncremental> + <IntDir>$(ProjectName)\$(Configuration)\</IntDir> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> + <IgnoreImportLibrary>true</IgnoreImportLibrary> + <LinkIncremental>false</LinkIncremental> + <IntDir>$(ProjectName)\$(Platform)\$(Configuration)\</IntDir> + </PropertyGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + <ClCompile> + <PrecompiledHeader>NotUsing</PrecompiledHeader> + <WarningLevel>Level3</WarningLevel> + <Optimization>Disabled</Optimization> + <PreprocessorDefinitions>WIN32;_WINDOWS;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <SDLCheck>true</SDLCheck> + </ClCompile> + <ResourceCompile> + <Culture>0x0409</Culture> + <AdditionalIncludeDirectories>$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> + </ResourceCompile> + <Link> + <SubSystem>Console</SubSystem> + <GenerateDebugInformation>true</GenerateDebugInformation> + </Link> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> + <ClCompile> + <PrecompiledHeader>NotUsing</PrecompiledHeader> + <WarningLevel>Level3</WarningLevel> + <Optimization>Disabled</Optimization> + <PreprocessorDefinitions>_WINDOWS;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <SDLCheck>true</SDLCheck> + </ClCompile> + <ResourceCompile> + <Culture>0x0409</Culture> + <AdditionalIncludeDirectories>$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> + </ResourceCompile> + <Link> + <SubSystem>Console</SubSystem> + <GenerateDebugInformation>true</GenerateDebugInformation> + </Link> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + <ClCompile> + <PrecompiledHeader>NotUsing</PrecompiledHeader> + <WarningLevel>Level3</WarningLevel> + <Optimization>MaxSpeed</Optimization> + <PreprocessorDefinitions>WIN32;_WINDOWS;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <SDLCheck>true</SDLCheck> + </ClCompile> + <ResourceCompile> + <Culture>0x0409</Culture> + <AdditionalIncludeDirectories>$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> + </ResourceCompile> + <Link> + <SubSystem>Console</SubSystem> + <GenerateDebugInformation>true</GenerateDebugInformation> + <EnableCOMDATFolding>true</EnableCOMDATFolding> + <OptimizeReferences>true</OptimizeReferences> + </Link> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> + <ClCompile> + <PrecompiledHeader>NotUsing</PrecompiledHeader> + <WarningLevel>Level3</WarningLevel> + <Optimization>MaxSpeed</Optimization> + <PreprocessorDefinitions>_WINDOWS;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <SDLCheck>true</SDLCheck> + </ClCompile> + <ResourceCompile> + <Culture>0x0409</Culture> + <AdditionalIncludeDirectories>$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> + </ResourceCompile> + <Link> + <SubSystem>Console</SubSystem> + <GenerateDebugInformation>true</GenerateDebugInformation> + <EnableCOMDATFolding>true</EnableCOMDATFolding> + <OptimizeReferences>true</OptimizeReferences> + </Link> + </ItemDefinitionGroup> + <ItemGroup> + <ClCompile Include="../CComHeapPtr.cpp"> + <RuntimeLibrary Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MultiThreaded</RuntimeLibrary> + <RuntimeLibrary Condition="'$(Configuration)|$(Platform)'=='Release|x64'">MultiThreaded</RuntimeLibrary> + <RuntimeLibrary Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">MultiThreadedDebug</RuntimeLibrary> + <RuntimeLibrary Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">MultiThreadedDebug</RuntimeLibrary> + <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">NotUsing</PrecompiledHeader> + <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">NotUsing</PrecompiledHeader> + <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">NotUsing</PrecompiledHeader> + <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">NotUsing</PrecompiledHeader> + </ClCompile> + </ItemGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> + <ImportGroup Label="ExtensionTargets"> + </ImportGroup> +</Project> \ No newline at end of file
4 years, 10 months
1
0
0
0
[reactos] 05/08: [ATL] Rename CHeapPtr data member, since it is public
by Mark Jansen
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=45d33582e7fbb99f05b57…
commit 45d33582e7fbb99f05b57780809203ea2682045d Author: Mark Jansen <mark.jansen(a)reactos.org> AuthorDate: Sat Jan 11 14:38:08 2020 +0100 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Sat Feb 8 22:09:14 2020 +0100 [ATL] Rename CHeapPtr data member, since it is public --- sdk/lib/atl/atlalloc.h | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/sdk/lib/atl/atlalloc.h b/sdk/lib/atl/atlalloc.h index 431bddf0a94..757b822ba5d 100644 --- a/sdk/lib/atl/atlalloc.h +++ b/sdk/lib/atl/atlalloc.h @@ -98,18 +98,18 @@ class CHeapPtr { public: CHeapPtr() : - m_Data(NULL) + m_pData(NULL) { } explicit CHeapPtr(T *lp) : - m_Data(lp) + m_pData(lp) { } explicit CHeapPtr(CHeapPtr<T, Allocator> &lp) { - m_Data = lp.Detach(); + m_pData = lp.Detach(); } ~CHeapPtr() @@ -119,24 +119,24 @@ public: CHeapPtr<T, Allocator>& operator = (CHeapPtr<T, Allocator> &lp) { - if (lp.m_Data != m_Data) + if (lp.m_pData != m_pData) Attach(lp.Detach()); return *this; } bool AllocateBytes(_In_ size_t nBytes) { - ATLASSERT(m_Data == NULL); - m_Data = static_cast<T*>(Allocator::Allocate(nBytes)); - return m_Data != NULL; + ATLASSERT(m_pData == NULL); + m_pData = static_cast<T*>(Allocator::Allocate(nBytes)); + return m_pData != NULL; } bool ReallocateBytes(_In_ size_t nBytes) { - T* newData = static_cast<T*>(Allocator::Reallocate(m_Data, nBytes)); + T* newData = static_cast<T*>(Allocator::Reallocate(m_pData, nBytes)); if (newData == NULL) return false; - m_Data = newData; + m_pData = newData; return true; } @@ -152,43 +152,43 @@ public: void Free() { - if (m_Data) + if (m_pData) { - Allocator::Free(m_Data); - m_Data = NULL; + Allocator::Free(m_pData); + m_pData = NULL; } } void Attach(T *lp) { - Allocator::Free(m_Data); - m_Data = lp; + Allocator::Free(m_pData); + m_pData = lp; } T *Detach() { - T *saveP = m_Data; - m_Data = NULL; + T *saveP = m_pData; + m_pData = NULL; return saveP; } T **operator &() { - ATLASSERT(m_Data == NULL); - return &m_Data; + ATLASSERT(m_pData == NULL); + return &m_pData; } operator T* () const { - return m_Data; + return m_pData; } T* operator->() const { - return m_Data; + return m_pData; } -protected: - T *m_Data; +public: + T *m_pData; };
4 years, 10 months
1
0
0
0
[reactos] 04/08: [ROSTESTS] Fix result being evaluated twice, and in the process fix gcc signed/unsigned errors
by Mark Jansen
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=55032c31220554d724ec2…
commit 55032c31220554d724ec20b33f29447fff3162ee Author: Mark Jansen <mark.jansen(a)reactos.org> AuthorDate: Sun Jan 5 02:23:04 2020 +0100 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Sat Feb 8 22:09:13 2020 +0100 [ROSTESTS] Fix result being evaluated twice, and in the process fix gcc signed/unsigned errors --- modules/rostests/apitests/dbghelp/rsym.c | 14 ++------------ sdk/include/reactos/wine/test.h | 22 +++++++++++++--------- 2 files changed, 15 insertions(+), 21 deletions(-) diff --git a/modules/rostests/apitests/dbghelp/rsym.c b/modules/rostests/apitests/dbghelp/rsym.c index 16b759c9418..fa4e3218011 100644 --- a/modules/rostests/apitests/dbghelp/rsym.c +++ b/modules/rostests/apitests/dbghelp/rsym.c @@ -20,7 +20,7 @@ do { \ ULONG64 _value = (expression); \ ULONG64 _result = (result); \ - ok(_value == (result), "Wrong value for '%s', expected: " #result " (%s), got: %s\n", \ + ok(_value == _result, "Wrong value for '%s', expected: " #result " (%s), got: %s\n", \ #expression, wine_dbgstr_longlong(_result), wine_dbgstr_longlong(_value)); \ } while (0) @@ -28,20 +28,10 @@ do { \ ULONG64 _value = (expression); \ ULONG64 _result = (result); \ - ok_(file, line)(_value == (result), "Wrong value for '%s', expected: " #result " (%s), got: %s\n", \ + ok_(file, line)(_value == _result, "Wrong value for '%s', expected: " #result " (%s), got: %s\n", \ #expression, wine_dbgstr_longlong(_result), wine_dbgstr_longlong(_value)); \ } while (0) -#define ok_hex_(file, line, expression, result) \ - do { \ - int _value = (expression); \ - ok_(file, line)(_value == (result), "Wrong value for '%s', expected: " #result " (0x%x), got: 0x%x\n", \ - #expression, (int)(result), _value); \ - } while (0) - -#define ok_str_(file, line, x, y) \ - ok_(file, line)(strcmp(x, y) == 0, "Wrong string. Expected '%s', got '%s'\n", y, x) - // data.c void dump_rsym(const char* filename); diff --git a/sdk/include/reactos/wine/test.h b/sdk/include/reactos/wine/test.h index d3e0c76d8ff..5eb52d80e36 100644 --- a/sdk/include/reactos/wine/test.h +++ b/sdk/include/reactos/wine/test.h @@ -824,32 +824,36 @@ int main( int argc, char **argv ) #define ok_hex_(file, line, expression, result) \ do { \ int _value = (expression); \ - ok_(file, line)(_value == (result), "Wrong value for '%s', expected: " #result " (0x%x), got: 0x%x\n", \ - #expression, (int)(result), _value); \ + int _result = (result); \ + ok_(file, line)(_value == _result, "Wrong value for '%s', expected: " #result " (0x%x), got: 0x%x\n", \ + #expression, _result, _value); \ } while (0) #define ok_hex(expression, result) ok_hex_(__FILE__, __LINE__, expression, result) #define ok_dec_(file, line, expression, result) \ do { \ int _value = (expression); \ - ok_(file, line)(_value == (result), "Wrong value for '%s', expected: " #result " (%d), got: %d\n", \ - #expression, (int)(result), _value); \ + int _result = (result); \ + ok_(file, line)(_value == _result, "Wrong value for '%s', expected: " #result " (%d), got: %d\n", \ + #expression, _result, _value); \ } while (0) #define ok_dec(expression, result) ok_dec_(__FILE__, __LINE__, expression, result) #define ok_ptr_(file, line, expression, result) \ do { \ - void *_value = (expression); \ - ok_(file, line)(_value == (result), "Wrong value for '%s', expected: " #result " (%p), got: %p\n", \ - #expression, (void*)(result), _value); \ + const void *_value = (expression); \ + const void *_result = (result); \ + ok_(file, line)(_value == _result, "Wrong value for '%s', expected: " #result " (%p), got: %p\n", \ + #expression, _result, _value); \ } while (0) #define ok_ptr(expression, result) ok_ptr_(__FILE__, __LINE__, expression, result) #define ok_size_t_(file, line, expression, result) \ do { \ size_t _value = (expression); \ - ok_(file, line)(_value == (result), "Wrong value for '%s', expected: " #result " (%Ix), got: %Ix\n", \ - #expression, (size_t)(result), _value); \ + size_t _result = (result); \ + ok_(file, line)(_value == _result, "Wrong value for '%s', expected: " #result " (%Ix), got: %Ix\n", \ + #expression, _result, _value); \ } while (0) #define ok_size_t(expression, result) ok_size_t_(__FILE__, __LINE__, expression, result)
4 years, 10 months
1
0
0
0
[reactos] 03/08: [ROSTESTS] Update test helpers to allow custom file/line info
by Mark Jansen
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=2eb96f0c40d4431b0d7d1…
commit 2eb96f0c40d4431b0d7d1de211494375302ec611 Author: Mark Jansen <mark.jansen(a)reactos.org> AuthorDate: Sun Jan 5 00:51:13 2020 +0100 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Sat Feb 8 22:09:13 2020 +0100 [ROSTESTS] Update test helpers to allow custom file/line info --- .../rostests/apitests/browseui/IACLCustomMRU.cpp | 10 +++--- .../apitests/ntdll/RtlNtPathNameToDosPathName.c | 34 ++++++++++---------- modules/rostests/apitests/user32/CreateWindowEx.c | 3 +- sdk/include/reactos/wine/test.h | 36 +++++++++++++--------- 4 files changed, 46 insertions(+), 37 deletions(-) diff --git a/modules/rostests/apitests/browseui/IACLCustomMRU.cpp b/modules/rostests/apitests/browseui/IACLCustomMRU.cpp index 1f2025daca9..9cf5ef765d4 100644 --- a/modules/rostests/apitests/browseui/IACLCustomMRU.cpp +++ b/modules/rostests/apitests/browseui/IACLCustomMRU.cpp @@ -1,8 +1,8 @@ /* * PROJECT: ReactOS api tests - * LICENSE: GPL-2.0+ (
https://spdx.org/licenses/GPL-2.0+
) + * LICENSE: GPL-2.0-or-later (
https://spdx.org/licenses/GPL-2.0-or-later
) * PURPOSE: Test for IACLCustomMRU objects - * COPYRIGHT: Copyright 2017 Mark Jansen (mark.jansen(a)reactos.org) + * COPYRIGHT: Copyright 2017-2020 Mark Jansen (mark.jansen(a)reactos.org) */ #define _UNICODE @@ -22,7 +22,7 @@ ULONG DbgPrint(PCH Format,...); #include <strsafe.h> #include <initguid.h> -#define ok_hex_(file, line, key, expression, result) \ +#define ok_hex2(file, line, key, expression, result) \ do { \ int _value = (expression); \ ok_(file, line)(_value == (result), "Wrong value for '%s', expected: " #result " (0x%x), got: 0x%x for %c\n", \ @@ -84,7 +84,7 @@ static void verify_mru_(const char* file, int line, IACLCustomMRU* mru, PCWSTR M CStringW tmp; tmp += Key; LSTATUS Status = key.QueryStringValue(tmp, Value, &nChars); - ok_hex_(file, line, Key, Status, ERROR_SUCCESS); + ok_hex2(file, line, Key, Status, ERROR_SUCCESS); if (Status == ERROR_SUCCESS) { ok_(file, line)(!wcscmp(Value, Entry), "Expected value %c to be %S, was %S\n", (char)Key, Entry, Value); @@ -98,7 +98,7 @@ static void verify_mru_(const char* file, int line, IACLCustomMRU* mru, PCWSTR M WCHAR Value[MAX_PATH]; ULONG nChars = _countof(Value); LSTATUS Status = key.QueryStringValue(L"MRUList", Value, &nChars); - ok_hex_(file, line, Key, Status, ERROR_SUCCESS); + ok_hex2(file, line, Key, Status, ERROR_SUCCESS); if (Status == ERROR_SUCCESS) { ok_(file, line)(!wcscmp(Value, MRUString), "Expected MRUList to be %S, was %S\n", MRUString, Value); diff --git a/modules/rostests/apitests/ntdll/RtlNtPathNameToDosPathName.c b/modules/rostests/apitests/ntdll/RtlNtPathNameToDosPathName.c index 311dfd8d535..44309249dd5 100644 --- a/modules/rostests/apitests/ntdll/RtlNtPathNameToDosPathName.c +++ b/modules/rostests/apitests/ntdll/RtlNtPathNameToDosPathName.c @@ -1,15 +1,15 @@ /* - * PROJECT: ReactOS api tests - * LICENSE: GPLv2+ - See COPYING in the top level directory - * PURPOSE: Test for RtlNtPathNameToDosPathName - * PROGRAMMER: Mark Jansen + * PROJECT: ReactOS api tests + * LICENSE: GPL-2.0-or-later (
https://spdx.org/licenses/GPL-2.0-or-later
) + * PURPOSE: Test for RtlNtPathNameToDosPathName + * COPYRIGHT: Copyright 2017-2020 Mark Jansen (mark.jansen(a)reactos.org) */ #include "precomp.h" NTSTATUS (NTAPI *pRtlNtPathNameToDosPathName)(ULONG Flags, PRTL_UNICODE_STRING_BUFFER Path, PULONG Type, PULONG Unknown4); -#define ok_hex_(expression, result) \ +#define ok_hex2(expression, result) \ do { \ int _value = (expression); \ winetest_ok(_value == (result), "Wrong value for '%s', expected: " #result " (0x%x), got: 0x%x\n", \ @@ -17,14 +17,14 @@ NTSTATUS (NTAPI *pRtlNtPathNameToDosPathName)(ULONG Flags, PRTL_UNICODE_STRING_B } while (0) -#define ok_ptr_(expression, result) \ +#define ok_ptr2(expression, result) \ do { \ void *_value = (expression); \ winetest_ok(_value == (result), "Wrong value for '%s', expected: " #result " (%p), got: %p\n", \ #expression, (void*)(result), _value); \ } while (0) -#define ok_wstr_(x, y) \ +#define ok_wstr2(x, y) \ winetest_ok(wcscmp(x, y) == 0, "Wrong string. Expected '%S', got '%S'\n", y, x) @@ -369,14 +369,14 @@ static void test_table(struct test_entry* Entry) RtlEnsureBufferSize(RTL_SKIP_BUFFER_COPY, &Buffer.ByteBuffer, Buffer.String.MaximumLength); memcpy(Buffer.ByteBuffer.Buffer, Buffer.String.Buffer, Buffer.String.MaximumLength); - ok_hex_(pRtlNtPathNameToDosPathName(0, &Buffer, &Type, NULL), STATUS_SUCCESS); + ok_hex2(pRtlNtPathNameToDosPathName(0, &Buffer, &Type, NULL), STATUS_SUCCESS); - ok_hex_(Type, Entry->Type); - ok_wstr_(Buffer.String.Buffer, Entry->OutputPath); + ok_hex2(Type, Entry->Type); + ok_wstr2(Buffer.String.Buffer, Entry->OutputPath); /* If there is no change in the path, the pointer is unchanged */ if (!wcscmp(Entry->InputPath, Entry->OutputPath)) { - ok_ptr_(Buffer.String.Buffer, Entry->InputPath); + ok_ptr2(Buffer.String.Buffer, Entry->InputPath); } else { @@ -385,16 +385,16 @@ static void test_table(struct test_entry* Entry) (PUCHAR)Buffer.String.Buffer <= (Buffer.ByteBuffer.StaticBuffer + Buffer.ByteBuffer.StaticSize), "Expected Buffer to point inside StaticBuffer\n"); } - ok_wstr_((const WCHAR *)Buffer.ByteBuffer.Buffer, Entry->OutputPath); + ok_wstr2((const WCHAR *)Buffer.ByteBuffer.Buffer, Entry->OutputPath); - ok_hex_(Buffer.MinimumStaticBufferForTerminalNul, 0); + ok_hex2(Buffer.MinimumStaticBufferForTerminalNul, 0); /* For none of our tests should we exceed the StaticBuffer size! */ - ok_ptr_(Buffer.ByteBuffer.Buffer, Buffer.ByteBuffer.StaticBuffer); - ok_hex_(Buffer.ByteBuffer.Size, Buffer.ByteBuffer.StaticSize); + ok_ptr2(Buffer.ByteBuffer.Buffer, Buffer.ByteBuffer.StaticBuffer); + ok_hex2(Buffer.ByteBuffer.Size, Buffer.ByteBuffer.StaticSize); - ok_hex_(Buffer.ByteBuffer.ReservedForAllocatedSize, 0); - ok_ptr_(Buffer.ByteBuffer.ReservedForIMalloc, NULL); + ok_hex2(Buffer.ByteBuffer.ReservedForAllocatedSize, 0); + ok_ptr2(Buffer.ByteBuffer.ReservedForIMalloc, NULL); RtlFreeBuffer(&Buffer.ByteBuffer); } diff --git a/modules/rostests/apitests/user32/CreateWindowEx.c b/modules/rostests/apitests/user32/CreateWindowEx.c index 068dbc5208f..c048f903469 100644 --- a/modules/rostests/apitests/user32/CreateWindowEx.c +++ b/modules/rostests/apitests/user32/CreateWindowEx.c @@ -3,7 +3,7 @@ * LICENSE: LGPLv2.1+ - See COPYING.LIB in the top level directory * PURPOSE: Test for CreateWindowEx * PROGRAMMERS: Thomas Faber <thomas.faber(a)reactos.org> - * Mark Jansen + * Mark Jansen (mark.jansen(a)reactos.org) */ #include "precomp.h" @@ -94,6 +94,7 @@ DWORD g_ChildNcExpectExStyle = 0; DWORD g_ChildExpectStyle = 0; DWORD g_ChildExpectExStyle = 0; +#undef ok_hex_ #define ok_hex_(expression, result) \ do { \ int _value = (expression); \ diff --git a/sdk/include/reactos/wine/test.h b/sdk/include/reactos/wine/test.h index 4da38a4533a..d3e0c76d8ff 100644 --- a/sdk/include/reactos/wine/test.h +++ b/sdk/include/reactos/wine/test.h @@ -821,47 +821,55 @@ int main( int argc, char **argv ) // Some helpful definitions -#define ok_hex(expression, result) \ +#define ok_hex_(file, line, expression, result) \ do { \ int _value = (expression); \ - ok(_value == (result), "Wrong value for '%s', expected: " #result " (0x%x), got: 0x%x\n", \ + ok_(file, line)(_value == (result), "Wrong value for '%s', expected: " #result " (0x%x), got: 0x%x\n", \ #expression, (int)(result), _value); \ } while (0) +#define ok_hex(expression, result) ok_hex_(__FILE__, __LINE__, expression, result) -#define ok_dec(expression, result) \ +#define ok_dec_(file, line, expression, result) \ do { \ int _value = (expression); \ - ok(_value == (result), "Wrong value for '%s', expected: " #result " (%d), got: %d\n", \ + ok_(file, line)(_value == (result), "Wrong value for '%s', expected: " #result " (%d), got: %d\n", \ #expression, (int)(result), _value); \ } while (0) +#define ok_dec(expression, result) ok_dec_(__FILE__, __LINE__, expression, result) -#define ok_ptr(expression, result) \ +#define ok_ptr_(file, line, expression, result) \ do { \ void *_value = (expression); \ - ok(_value == (result), "Wrong value for '%s', expected: " #result " (%p), got: %p\n", \ + ok_(file, line)(_value == (result), "Wrong value for '%s', expected: " #result " (%p), got: %p\n", \ #expression, (void*)(result), _value); \ } while (0) +#define ok_ptr(expression, result) ok_ptr_(__FILE__, __LINE__, expression, result) -#define ok_size_t(expression, result) \ +#define ok_size_t_(file, line, expression, result) \ do { \ size_t _value = (expression); \ - ok(_value == (result), "Wrong value for '%s', expected: " #result " (%Ix), got: %Ix\n", \ + ok_(file, line)(_value == (result), "Wrong value for '%s', expected: " #result " (%Ix), got: %Ix\n", \ #expression, (size_t)(result), _value); \ } while (0) +#define ok_size_t(expression, result) ok_size_t_(__FILE__, __LINE__, expression, result) #define ok_char(expression, result) ok_hex(expression, result) -#define ok_err(error) \ - ok(GetLastError() == (error), "Wrong last error. Expected " #error ", got 0x%lx\n", GetLastError()) +#define ok_err_(file, line, error) \ + ok_(file, line)(GetLastError() == (error), "Wrong last error. Expected " #error ", got 0x%lx\n", GetLastError()) +#define ok_err(error) ok_err_(__FILE__, __LINE__, error) -#define ok_str(x, y) \ - ok(strcmp(x, y) == 0, "Wrong string. Expected '%s', got '%s'\n", y, x) +#define ok_str_(file, line, x, y) \ + ok_(file, line)(strcmp(x, y) == 0, "Wrong string. Expected '%s', got '%s'\n", y, x) +#define ok_str(x, y) ok_str_(__FILE__, __LINE__, x, y) -#define ok_wstr(x, y) \ - ok(wcscmp(x, y) == 0, "Wrong string. Expected '%S', got '%S'\n", y, x) +#define ok_wstr_(file, line, x, y) \ + ok_(file, line)(wcscmp(x, y) == 0, "Wrong string. Expected '%S', got '%S'\n", y, x) +#define ok_wstr(x, y) ok_wstr_(__FILE__, __LINE__, x, y) #define ok_long(expression, result) ok_hex(expression, result) #define ok_int(expression, result) ok_dec(expression, result) +#define ok_int_(file, line, expression, result) ok_dec_(file, line, expression, result) #define ok_ntstatus(status, expected) ok_hex(status, expected) #define ok_hdl ok_ptr
4 years, 10 months
1
0
0
0
[reactos] 02/08: [PSDK] Add FileDescriptor.dwFlags constants
by Mark Jansen
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=2fc872895bbe9db49f2e1…
commit 2fc872895bbe9db49f2e1fbb667537aca7b430ac Author: Mark Jansen <mark.jansen(a)reactos.org> AuthorDate: Sat Jan 4 21:23:53 2020 +0100 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Sat Feb 8 22:09:13 2020 +0100 [PSDK] Add FileDescriptor.dwFlags constants --- sdk/include/psdk/shlobj.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/sdk/include/psdk/shlobj.h b/sdk/include/psdk/shlobj.h index 82df46527fe..973f923a5d6 100644 --- a/sdk/include/psdk/shlobj.h +++ b/sdk/include/psdk/shlobj.h @@ -2126,6 +2126,23 @@ typedef struct _DROPFILES BOOL fWide; } DROPFILES, *LPDROPFILES; + +/* + * FILEDESCRIPTOR[A|W].dwFlags + */ +#define FD_CLSID 0x00000001 +#define FD_SIZEPOINT 0x00000002 +#define FD_ATTRIBUTES 0x00000004 +#define FD_CREATETIME 0x00000008 +#define FD_ACCESSTIME 0x00000010 +#define FD_WRITESTIME 0x00000020 +#define FD_FILESIZE 0x00000040 +#define FD_PROGRESSUI 0x00004000 +#define FD_LINKUI 0x00008000 +#if (NTDDI_VERSION >= NTDDI_VISTA) +#define FD_UNICODE 0x80000000 +#endif + /* * Properties of a file in the clipboard */
4 years, 10 months
1
0
0
0
[reactos] 01/08: [SDK] Move HIDA helper functions to shellutils.h
by Mark Jansen
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=0c7b07dc89a4425a3d6ba…
commit 0c7b07dc89a4425a3d6ba0926abb396733096ed5 Author: Mark Jansen <mark.jansen(a)reactos.org> AuthorDate: Thu Nov 21 22:35:52 2019 +0100 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Sat Feb 8 22:09:13 2020 +0100 [SDK] Move HIDA helper functions to shellutils.h --- dll/shellext/fontext/precomp.h | 10 ---------- modules/rostests/apitests/shell32/CIDLData.cpp | 10 ---------- modules/rostests/apitests/shell32/SHCreateDataObject.cpp | 10 ---------- sdk/include/reactos/shellutils.h | 12 ++++++++++++ 4 files changed, 12 insertions(+), 30 deletions(-) diff --git a/dll/shellext/fontext/precomp.h b/dll/shellext/fontext/precomp.h index c17b4e53c71..8037e4cd064 100644 --- a/dll/shellext/fontext/precomp.h +++ b/dll/shellext/fontext/precomp.h @@ -38,16 +38,6 @@ HRESULT _CDataObject_CreateInstance(PCIDLIST_ABSOLUTE folder, UINT cidl, PCUITEM HRESULT _GetCidlFromDataObject(IDataObject *pDataObject, CIDA** ppcida); -inline PCUIDLIST_ABSOLUTE HIDA_GetPIDLFolder(CIDA const* pida) -{ - return (PCUIDLIST_ABSOLUTE)(((LPBYTE)pida) + (pida)->aoffset[0]); -} - -inline PCUIDLIST_RELATIVE HIDA_GetPIDLItem(CIDA const* pida, SIZE_T i) -{ - return (PCUIDLIST_RELATIVE)(((LPBYTE)pida) + (pida)->aoffset[i + 1]); -} - inline BOOL IsFontDotExt(LPCWSTR pchDotExt) { static const LPCWSTR array[] = diff --git a/modules/rostests/apitests/shell32/CIDLData.cpp b/modules/rostests/apitests/shell32/CIDLData.cpp index 502a1b321fa..28fa0d2aef8 100644 --- a/modules/rostests/apitests/shell32/CIDLData.cpp +++ b/modules/rostests/apitests/shell32/CIDLData.cpp @@ -60,16 +60,6 @@ static void TestAdviseAndCanonical(PCIDLIST_ABSOLUTE pidlFolder, UINT cidl, PCUI } -static inline PCUIDLIST_ABSOLUTE HIDA_GetPIDLFolder(CIDA const* pida) -{ - return (PCUIDLIST_ABSOLUTE)(((LPBYTE)pida) + (pida)->aoffset[0]); -} - -static inline PCUIDLIST_RELATIVE HIDA_GetPIDLItem(CIDA const* pida, SIZE_T i) -{ - return (PCUIDLIST_RELATIVE)(((LPBYTE)pida) + (pida)->aoffset[i + 1]); -} - #define ok_wstri(x, y) \ ok(wcsicmp(x, y) == 0, "Wrong string. Expected '%S', got '%S'\n", y, x) diff --git a/modules/rostests/apitests/shell32/SHCreateDataObject.cpp b/modules/rostests/apitests/shell32/SHCreateDataObject.cpp index 927afa28d23..00f4ec11077 100644 --- a/modules/rostests/apitests/shell32/SHCreateDataObject.cpp +++ b/modules/rostests/apitests/shell32/SHCreateDataObject.cpp @@ -63,16 +63,6 @@ static void TestAdviseAndCanonical(PCIDLIST_ABSOLUTE pidlFolder, UINT cidl, PCUI } -static inline PCUIDLIST_ABSOLUTE HIDA_GetPIDLFolder(CIDA const* pida) -{ - return (PCUIDLIST_ABSOLUTE)(((LPBYTE)pida) + (pida)->aoffset[0]); -} - -static inline PCUIDLIST_RELATIVE HIDA_GetPIDLItem(CIDA const* pida, SIZE_T i) -{ - return (PCUIDLIST_RELATIVE)(((LPBYTE)pida) + (pida)->aoffset[i + 1]); -} - #define ok_wstri(x, y) \ ok(wcsicmp(x, y) == 0, "Wrong string. Expected '%S', got '%S'\n", y, x) diff --git a/sdk/include/reactos/shellutils.h b/sdk/include/reactos/shellutils.h index 467f142c4ae..8cc51f379d4 100644 --- a/sdk/include/reactos/shellutils.h +++ b/sdk/include/reactos/shellutils.h @@ -534,4 +534,16 @@ void DumpIdList(LPCITEMIDLIST pcidl) #define S_GREATERTHAN S_FALSE #define MAKE_COMPARE_HRESULT(x) ((x)>0 ? S_GREATERTHAN : ((x)<0 ? S_LESSTHAN : S_EQUAL)) + +static inline PCUIDLIST_ABSOLUTE HIDA_GetPIDLFolder(CIDA const* pida) +{ + return (PCUIDLIST_ABSOLUTE)(((LPBYTE)pida) + (pida)->aoffset[0]); +} + +static inline PCUIDLIST_RELATIVE HIDA_GetPIDLItem(CIDA const* pida, SIZE_T i) +{ + return (PCUIDLIST_RELATIVE)(((LPBYTE)pida) + (pida)->aoffset[i + 1]); +} + + #endif /* __ROS_SHELL_UTILS_H */
4 years, 10 months
1
0
0
0
← Newer
1
...
18
19
20
21
22
23
24
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
Results per page:
10
25
50
100
200