Wine-Devel
Threads by month
- ----- 2026 -----
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 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
- January
- ----- 2003 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2002 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2001 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- 22 participants
- 84527 discussions
[PATCH] xmllite: Avoid out of bounds access in readerinput_get_utf8_convlen().
by Paul Gofman April 15, 2021
by Paul Gofman April 15, 2021
April 15, 2021
And consequently in readerinput_shrinkraw().
Signed-off-by: Paul Gofman <pgofman(a)codeweavers.com>
---
Spotted as a crash reproducible under certain conditions during Forza Horizon 4 start.
The out of bounds access in readerinput_get_utf8_convlen() is reproducible with the
existing tests, that just doesn't usually result in the crash as
'if (!(buffer->data[len-1] & 0x80)) return len;' ends up returning 0 for zero length
most of the time.
dlls/xmllite/reader.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/dlls/xmllite/reader.c b/dlls/xmllite/reader.c
index 13d841eb94d..aa193128e4b 100644
--- a/dlls/xmllite/reader.c
+++ b/dlls/xmllite/reader.c
@@ -929,6 +929,8 @@ static int readerinput_get_utf8_convlen(xmlreaderinput *readerinput)
encoded_buffer *buffer = &readerinput->buffer->encoded;
int len = buffer->written;
+ assert(len);
+
/* complete single byte char */
if (!(buffer->data[len-1] & 0x80)) return len;
@@ -966,6 +968,7 @@ static void readerinput_shrinkraw(xmlreaderinput *readerinput, int len)
if (len == -1)
len = readerinput_get_convlen(readerinput);
+ assert(len >= 0);
memmove(buffer->data, buffer->data + buffer->cur + (buffer->written - len), len);
/* everything below cur is lost too */
buffer->written -= len + buffer->cur;
@@ -1069,6 +1072,9 @@ static HRESULT reader_more(xmlreader *reader)
/* get some raw data from stream first */
hr = readerinput_growraw(readerinput);
+ if (!src->written)
+ return hr ? hr : MX_E_INPUTEND;
+
len = readerinput_get_convlen(readerinput);
prev_len = dest->written / sizeof(WCHAR);
--
2.30.2
2
1
Validating that SendInput with INPUT_HARDWARE type should be no-op.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50506
Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com>
---
v2: Remove the #ifdef _WIN64 and mark 32bit test results as broken.
dlls/user32/input.c | 18 ++++++
dlls/user32/tests/input.c | 113 ++++++++++++++++++++++++++++++++++++++
2 files changed, 131 insertions(+)
diff --git a/dlls/user32/input.c b/dlls/user32/input.c
index 8992c463c48..22e53585f00 100644
--- a/dlls/user32/input.c
+++ b/dlls/user32/input.c
@@ -182,6 +182,24 @@ UINT WINAPI SendInput( UINT count, LPINPUT inputs, int size )
UINT i;
NTSTATUS status;
+ if (size != sizeof(INPUT))
+ {
+ SetLastError( ERROR_INVALID_PARAMETER );
+ return 0;
+ }
+
+ if (!count)
+ {
+ SetLastError( ERROR_INVALID_PARAMETER );
+ return 0;
+ }
+
+ if (!inputs)
+ {
+ SetLastError( ERROR_NOACCESS );
+ return 0;
+ }
+
for (i = 0; i < count; i++)
{
if (inputs[i].type == INPUT_MOUSE)
diff --git a/dlls/user32/tests/input.c b/dlls/user32/tests/input.c
index 646a9a66eb5..0bbd03c615e 100644
--- a/dlls/user32/tests/input.c
+++ b/dlls/user32/tests/input.c
@@ -4212,6 +4212,118 @@ static void test_UnregisterDeviceNotification(void)
ok(ret == FALSE, "Unregistering NULL Device Notification returned: %d\n", ret);
}
+static void test_SendInput(void)
+{
+ INPUT input[16];
+ UINT res, i;
+ HWND hwnd;
+ MSG msg;
+
+ hwnd = CreateWindowW( L"static", L"test", WS_OVERLAPPED, 0, 0, 100, 100, 0, 0, 0, 0 );
+ ok( hwnd != 0, "CreateWindowW failed\n" );
+
+ ShowWindow( hwnd, SW_SHOWNORMAL );
+ UpdateWindow( hwnd );
+ SetForegroundWindow( hwnd );
+ SetFocus( hwnd );
+ empty_message_queue();
+
+ SetLastError( 0xdeadbeef );
+ res = SendInput( 0, NULL, 0 );
+ ok( res == 0 && GetLastError() == ERROR_INVALID_PARAMETER, "SendInput returned %u, error %#x\n", res, GetLastError() );
+ SetLastError( 0xdeadbeef );
+ res = SendInput( 1, NULL, 0 );
+ ok( res == 0 && GetLastError() == ERROR_INVALID_PARAMETER, "SendInput returned %u, error %#x\n", res, GetLastError() );
+ SetLastError( 0xdeadbeef );
+ res = SendInput( 1, NULL, sizeof(*input) );
+ ok( res == 0 && (GetLastError() == ERROR_NOACCESS || GetLastError() == ERROR_INVALID_PARAMETER),
+ "SendInput returned %u, error %#x\n", res, GetLastError() );
+ SetLastError( 0xdeadbeef );
+ res = SendInput( 0, input, sizeof(*input) );
+ ok( res == 0 && GetLastError() == ERROR_INVALID_PARAMETER, "SendInput returned %u, error %#x\n", res, GetLastError() );
+ SetLastError( 0xdeadbeef );
+ res = SendInput( 0, NULL, sizeof(*input) );
+ ok( res == 0 && GetLastError() == ERROR_INVALID_PARAMETER, "SendInput returned %u, error %#x\n", res, GetLastError() );
+
+ memset( input, 0, sizeof(input) );
+ SetLastError( 0xdeadbeef );
+ res = SendInput( 1, input, sizeof(*input) );
+ ok( res == 1 && GetLastError() == 0xdeadbeef, "SendInput returned %u, error %#x\n", res, GetLastError() );
+ SetLastError( 0xdeadbeef );
+ res = SendInput( 16, input, sizeof(*input) );
+ ok( res == 16 && GetLastError() == 0xdeadbeef, "SendInput returned %u, error %#x\n", res, GetLastError() );
+
+ SetLastError( 0xdeadbeef );
+ res = SendInput( 1, input, 0 );
+ ok( res == 0 && GetLastError() == ERROR_INVALID_PARAMETER, "SendInput returned %u, error %#x\n", res, GetLastError() );
+ SetLastError( 0xdeadbeef );
+ res = SendInput( 1, input, sizeof(*input) + 1 );
+ ok( res == 0 && GetLastError() == ERROR_INVALID_PARAMETER, "SendInput returned %u, error %#x\n", res, GetLastError() );
+ SetLastError( 0xdeadbeef );
+ res = SendInput( 1, input, sizeof(*input) - 1 );
+ ok( res == 0 && GetLastError() == ERROR_INVALID_PARAMETER, "SendInput returned %u, error %#x\n", res, GetLastError() );
+
+ for (i = 0; i < ARRAY_SIZE(input); ++i) input[i].type = INPUT_KEYBOARD;
+ SetLastError( 0xdeadbeef );
+ res = SendInput( 16, input, offsetof( INPUT, ki ) + sizeof(KEYBDINPUT) );
+ ok( res == 0 && GetLastError() == ERROR_INVALID_PARAMETER, "SendInput returned %u, error %#x\n", res, GetLastError() );
+ SetLastError( 0xdeadbeef );
+ res = SendInput( 16, input, sizeof(*input) );
+ ok( res == 16 && GetLastError() == 0xdeadbeef, "SendInput returned %u, error %#x\n", res, GetLastError() );
+ empty_message_queue();
+
+ for (i = 0; i < ARRAY_SIZE(input); ++i) input[i].type = INPUT_HARDWARE;
+ SetLastError( 0xdeadbeef );
+ res = SendInput( 16, input, offsetof( INPUT, hi ) + sizeof(HARDWAREINPUT) );
+ ok( res == 0 && GetLastError() == ERROR_INVALID_PARAMETER, "SendInput returned %u, error %#x\n", res, GetLastError() );
+
+ input[0].hi.uMsg = WM_KEYDOWN;
+ input[0].hi.wParamL = 0;
+ input[0].hi.wParamH = 'A';
+ input[1].hi.uMsg = WM_KEYUP;
+ input[1].hi.wParamL = 0;
+ input[1].hi.wParamH = 'A' | 0xc000;
+ SetLastError( 0xdeadbeef );
+ res = SendInput( 16, input, sizeof(*input) );
+ todo_wine
+ ok( (res == 0 && GetLastError() == ERROR_CALL_NOT_IMPLEMENTED) ||
+ broken(res == 16 && GetLastError() == 0xdeadbeef) /* 32bit */,
+ "SendInput returned %u, error %#x\n", res, GetLastError() );
+ while ((res = wait_for_message(&msg)) && msg.message == WM_TIMER) DispatchMessageA(&msg);
+ todo_wine ok( !res, "SendInput triggered unexpected message %#x\n", msg.message );
+ empty_message_queue();
+
+ memset( input, 0, sizeof(input) );
+ input[0].type = INPUT_HARDWARE;
+ input[1].type = INPUT_KEYBOARD;
+ input[1].ki.wVk = 'A';
+ input[1].ki.dwFlags = 0;
+ input[2].type = INPUT_KEYBOARD;
+ input[2].ki.wVk = 'A';
+ input[2].ki.dwFlags = KEYEVENTF_KEYUP;
+ SetLastError( 0xdeadbeef );
+ res = SendInput( 16, input, sizeof(*input) );
+ todo_wine
+ ok( (res == 0 && GetLastError() == ERROR_CALL_NOT_IMPLEMENTED) ||
+ broken(res == 16 && GetLastError() == 0xdeadbeef),
+ "SendInput returned %u, error %#x\n", res, GetLastError() );
+ while ((res = wait_for_message(&msg)) && (msg.message == WM_TIMER || broken(msg.message == WM_KEYDOWN || msg.message == WM_KEYUP)))
+ DispatchMessageA(&msg);
+ todo_wine ok( !res, "SendInput triggered unexpected message %#x\n", msg.message );
+ empty_message_queue();
+
+ for (i = 0; i < ARRAY_SIZE(input); ++i) input[i].type = INPUT_HARDWARE + 1;
+ SetLastError( 0xdeadbeef );
+ res = SendInput( 16, input, sizeof(*input) );
+ todo_wine ok( res == 16 && GetLastError() == 0xdeadbeef, "SendInput returned %u, error %#x\n", res, GetLastError() );
+ while ((res = wait_for_message(&msg)) && msg.message == WM_TIMER) DispatchMessageA(&msg);
+ todo_wine ok( !res, "SendInput triggered unexpected message %#x\n", msg.message );
+ empty_message_queue();
+
+ trace( "done\n" );
+ DestroyWindow( hwnd );
+}
+
START_TEST(input)
{
char **argv;
@@ -4234,6 +4346,7 @@ START_TEST(input)
return;
}
+ test_SendInput();
test_Input_blackbox();
test_Input_whitebox();
test_Input_unicode();
--
2.31.0
4
12
[PATCH 5/5] gdi32: Reselect font and pen when changing world transforms for enhanced metafiles.
by Zhiyi Zhang April 15, 2021
by Zhiyi Zhang April 15, 2021
April 15, 2021
Reselect font and pen into enhanced metafile device contexts after world transform is changed so
that content can be drawn using the correct size. Also modifying the world transform for enhanced
metafiles doesn't generate EMR_SELECTOBJECT records according to winedump outputs.
Fix an issue that Tally may produce a print preview with a too large font or with a black side bar.
Signed-off-by: Zhiyi Zhang <zzhang(a)codeweavers.com>
---
dlls/gdi32/dc.c | 3 +-
dlls/gdi32/enhmfdrv/dc.c | 78 ++++++++++++++++++++++++----
dlls/gdi32/enhmfdrv/enhmetafiledrv.h | 1 +
dlls/gdi32/enhmfdrv/init.c | 1 +
dlls/gdi32/enhmfdrv/objects.c | 2 +
dlls/gdi32/tests/metafile.c | 1 -
6 files changed, 72 insertions(+), 14 deletions(-)
diff --git a/dlls/gdi32/dc.c b/dlls/gdi32/dc.c
index eb9dbf85668..74bf0a8dd50 100644
--- a/dlls/gdi32/dc.c
+++ b/dlls/gdi32/dc.c
@@ -363,8 +363,7 @@ void DC_UpdateXforms( DC *dc )
/* Reselect the font and pen back into the dc so that the size
gets updated. */
- if (linear_xform_cmp( &oldworld2vport, &dc->xformWorld2Vport ) &&
- !GdiIsMetaFileDC(dc->hSelf))
+ if (linear_xform_cmp( &oldworld2vport, &dc->xformWorld2Vport ))
{
SelectObject(dc->hSelf, dc->hFont);
SelectObject(dc->hSelf, dc->hPen);
diff --git a/dlls/gdi32/enhmfdrv/dc.c b/dlls/gdi32/enhmfdrv/dc.c
index 72b6afeee8b..1c87643ea96 100644
--- a/dlls/gdi32/enhmfdrv/dc.c
+++ b/dlls/gdi32/enhmfdrv/dc.c
@@ -235,19 +235,27 @@ INT CDECL EMFDRV_ExtSelectClipRgn( PHYSDEV dev, HRGN hrgn, INT mode )
INT CDECL EMFDRV_SetMapMode( PHYSDEV dev, INT mode )
{
PHYSDEV next = GET_NEXT_PHYSDEV( dev, pSetMapMode );
+ EMFDRV_PDEVICE *physDev = get_emf_physdev( dev );
EMRSETMAPMODE emr;
+ INT ret;
+
emr.emr.iType = EMR_SETMAPMODE;
emr.emr.nSize = sizeof(emr);
emr.iMode = mode;
if (!EMFDRV_WriteRecord( dev, &emr.emr )) return 0;
- return next->funcs->pSetMapMode( next, mode );
+ physDev->modifying_transform++;
+ ret = next->funcs->pSetMapMode( next, mode );
+ physDev->modifying_transform--;
+ return ret;
}
BOOL CDECL EMFDRV_SetViewportExtEx( PHYSDEV dev, INT cx, INT cy, SIZE *size )
{
PHYSDEV next = GET_NEXT_PHYSDEV( dev, pSetViewportExtEx );
+ EMFDRV_PDEVICE *physDev = get_emf_physdev( dev );
EMRSETVIEWPORTEXTEX emr;
+ BOOL ret;
emr.emr.iType = EMR_SETVIEWPORTEXTEX;
emr.emr.nSize = sizeof(emr);
@@ -255,13 +263,18 @@ BOOL CDECL EMFDRV_SetViewportExtEx( PHYSDEV dev, INT cx, INT cy, SIZE *size )
emr.szlExtent.cy = cy;
if (!EMFDRV_WriteRecord( dev, &emr.emr )) return FALSE;
- return next->funcs->pSetViewportExtEx( next, cx, cy, size );
+ physDev->modifying_transform++;
+ ret = next->funcs->pSetViewportExtEx( next, cx, cy, size );
+ physDev->modifying_transform--;
+ return ret;
}
BOOL CDECL EMFDRV_SetWindowExtEx( PHYSDEV dev, INT cx, INT cy, SIZE *size )
{
PHYSDEV next = GET_NEXT_PHYSDEV( dev, pSetWindowExtEx );
+ EMFDRV_PDEVICE *physDev = get_emf_physdev( dev );
EMRSETWINDOWEXTEX emr;
+ BOOL ret;
emr.emr.iType = EMR_SETWINDOWEXTEX;
emr.emr.nSize = sizeof(emr);
@@ -269,13 +282,18 @@ BOOL CDECL EMFDRV_SetWindowExtEx( PHYSDEV dev, INT cx, INT cy, SIZE *size )
emr.szlExtent.cy = cy;
if (!EMFDRV_WriteRecord( dev, &emr.emr )) return FALSE;
- return next->funcs->pSetWindowExtEx( next, cx, cy, size );
+ physDev->modifying_transform++;
+ ret = next->funcs->pSetWindowExtEx( next, cx, cy, size );
+ physDev->modifying_transform--;
+ return ret;
}
BOOL CDECL EMFDRV_SetViewportOrgEx( PHYSDEV dev, INT x, INT y, POINT *pt )
{
PHYSDEV next = GET_NEXT_PHYSDEV( dev, pSetViewportOrgEx );
+ EMFDRV_PDEVICE *physDev = get_emf_physdev( dev );
EMRSETVIEWPORTORGEX emr;
+ BOOL ret;
emr.emr.iType = EMR_SETVIEWPORTORGEX;
emr.emr.nSize = sizeof(emr);
@@ -283,13 +301,18 @@ BOOL CDECL EMFDRV_SetViewportOrgEx( PHYSDEV dev, INT x, INT y, POINT *pt )
emr.ptlOrigin.y = y;
if (!EMFDRV_WriteRecord( dev, &emr.emr )) return FALSE;
- return next->funcs->pSetViewportOrgEx( next, x, y, pt );
+ physDev->modifying_transform++;
+ ret = next->funcs->pSetViewportOrgEx( next, x, y, pt );
+ physDev->modifying_transform--;
+ return ret;
}
BOOL CDECL EMFDRV_SetWindowOrgEx( PHYSDEV dev, INT x, INT y, POINT *pt )
{
PHYSDEV next = GET_NEXT_PHYSDEV( dev, pSetWindowOrgEx );
+ EMFDRV_PDEVICE *physDev = get_emf_physdev( dev );
EMRSETWINDOWORGEX emr;
+ BOOL ret;
emr.emr.iType = EMR_SETWINDOWORGEX;
emr.emr.nSize = sizeof(emr);
@@ -297,13 +320,18 @@ BOOL CDECL EMFDRV_SetWindowOrgEx( PHYSDEV dev, INT x, INT y, POINT *pt )
emr.ptlOrigin.y = y;
if (!EMFDRV_WriteRecord( dev, &emr.emr )) return FALSE;
- return next->funcs->pSetWindowOrgEx( next, x, y, pt );
+ physDev->modifying_transform++;
+ ret = next->funcs->pSetWindowOrgEx( next, x, y, pt );
+ physDev->modifying_transform--;
+ return ret;
}
BOOL CDECL EMFDRV_ScaleViewportExtEx( PHYSDEV dev, INT xNum, INT xDenom, INT yNum, INT yDenom, SIZE *size )
{
PHYSDEV next = GET_NEXT_PHYSDEV( dev, pScaleViewportExtEx );
+ EMFDRV_PDEVICE *physDev = get_emf_physdev( dev );
EMRSCALEVIEWPORTEXTEX emr;
+ BOOL ret;
emr.emr.iType = EMR_SCALEVIEWPORTEXTEX;
emr.emr.nSize = sizeof(emr);
@@ -313,7 +341,10 @@ BOOL CDECL EMFDRV_ScaleViewportExtEx( PHYSDEV dev, INT xNum, INT xDenom, INT yNu
emr.yDenom = yDenom;
if (!EMFDRV_WriteRecord( dev, &emr.emr )) return FALSE;
- return next->funcs->pScaleViewportExtEx( next, xNum, xDenom, yNum, yDenom, size );
+ physDev->modifying_transform++;
+ ret = next->funcs->pScaleViewportExtEx( next, xNum, xDenom, yNum, yDenom, size );
+ physDev->modifying_transform--;
+ return ret;
}
BOOL CDECL EMFDRV_ScaleWindowExtEx( PHYSDEV dev, INT xNum, INT xDenom, INT yNum, INT yDenom, SIZE *size )
@@ -335,32 +366,44 @@ BOOL CDECL EMFDRV_ScaleWindowExtEx( PHYSDEV dev, INT xNum, INT xDenom, INT yNum,
DWORD CDECL EMFDRV_SetLayout( PHYSDEV dev, DWORD layout )
{
PHYSDEV next = GET_NEXT_PHYSDEV( dev, pSetMapMode );
+ EMFDRV_PDEVICE *physDev = get_emf_physdev( dev );
EMRSETLAYOUT emr;
+ DWORD ret;
emr.emr.iType = EMR_SETLAYOUT;
emr.emr.nSize = sizeof(emr);
emr.iMode = layout;
if (!EMFDRV_WriteRecord( dev, &emr.emr )) return GDI_ERROR;
- return next->funcs->pSetLayout( next, layout );
+ physDev->modifying_transform++;
+ ret = next->funcs->pSetLayout( next, layout );
+ physDev->modifying_transform--;
+ return ret;
}
BOOL CDECL EMFDRV_SetWorldTransform( PHYSDEV dev, const XFORM *xform)
{
PHYSDEV next = GET_NEXT_PHYSDEV( dev, pSetWorldTransform );
+ EMFDRV_PDEVICE *physDev = get_emf_physdev( dev );
EMRSETWORLDTRANSFORM emr;
+ BOOL ret;
emr.emr.iType = EMR_SETWORLDTRANSFORM;
emr.emr.nSize = sizeof(emr);
emr.xform = *xform;
if (!EMFDRV_WriteRecord( dev, &emr.emr )) return FALSE;
- return next->funcs->pSetWorldTransform( next, xform );
+ physDev->modifying_transform++;
+ ret = next->funcs->pSetWorldTransform( next, xform );
+ physDev->modifying_transform--;
+ return ret;
}
BOOL CDECL EMFDRV_ModifyWorldTransform( PHYSDEV dev, const XFORM *xform, DWORD mode)
{
PHYSDEV next = GET_NEXT_PHYSDEV( dev, pModifyWorldTransform );
+ EMFDRV_PDEVICE *physDev = get_emf_physdev( dev );
EMRMODIFYWORLDTRANSFORM emr;
+ BOOL ret;
emr.emr.iType = EMR_MODIFYWORLDTRANSFORM;
emr.emr.nSize = sizeof(emr);
@@ -380,14 +423,19 @@ BOOL CDECL EMFDRV_ModifyWorldTransform( PHYSDEV dev, const XFORM *xform, DWORD m
emr.iMode = mode;
if (!EMFDRV_WriteRecord( dev, &emr.emr )) return FALSE;
- return next->funcs->pModifyWorldTransform( next, xform, mode );
+ physDev->modifying_transform++;
+ ret = next->funcs->pModifyWorldTransform( next, xform, mode );
+ physDev->modifying_transform--;
+ return ret;
}
BOOL CDECL EMFDRV_OffsetViewportOrgEx( PHYSDEV dev, INT x, INT y, POINT *pt )
{
PHYSDEV next = GET_NEXT_PHYSDEV( dev, pOffsetViewportOrgEx );
+ EMFDRV_PDEVICE *physDev = get_emf_physdev( dev );
EMRSETVIEWPORTORGEX emr;
POINT prev;
+ BOOL ret;
GetViewportOrgEx( dev->hdc, &prev );
@@ -397,14 +445,19 @@ BOOL CDECL EMFDRV_OffsetViewportOrgEx( PHYSDEV dev, INT x, INT y, POINT *pt )
emr.ptlOrigin.y = prev.y + y;
if (!EMFDRV_WriteRecord( dev, &emr.emr )) return FALSE;
- return next->funcs->pOffsetViewportOrgEx( next, x, y, pt );
+ physDev->modifying_transform++;
+ ret = next->funcs->pOffsetViewportOrgEx( next, x, y, pt );
+ physDev->modifying_transform--;
+ return ret;
}
BOOL CDECL EMFDRV_OffsetWindowOrgEx( PHYSDEV dev, INT x, INT y, POINT *pt )
{
PHYSDEV next = GET_NEXT_PHYSDEV( dev, pOffsetWindowOrgEx );
+ EMFDRV_PDEVICE *physDev = get_emf_physdev( dev );
EMRSETWINDOWORGEX emr;
POINT prev;
+ BOOL ret;
GetWindowOrgEx( dev->hdc, &prev );
@@ -414,7 +467,10 @@ BOOL CDECL EMFDRV_OffsetWindowOrgEx( PHYSDEV dev, INT x, INT y, POINT *pt )
emr.ptlOrigin.y = prev.y + y;
if (!EMFDRV_WriteRecord( dev, &emr.emr )) return FALSE;
- return next->funcs->pOffsetWindowOrgEx( next, x, y, pt );
+ physDev->modifying_transform++;
+ ret = next->funcs->pOffsetWindowOrgEx( next, x, y, pt );
+ physDev->modifying_transform--;
+ return ret;
}
DWORD CDECL EMFDRV_SetMapperFlags( PHYSDEV dev, DWORD flags )
diff --git a/dlls/gdi32/enhmfdrv/enhmetafiledrv.h b/dlls/gdi32/enhmfdrv/enhmetafiledrv.h
index 253f96cd8ec..fd463bd29e3 100644
--- a/dlls/gdi32/enhmfdrv/enhmetafiledrv.h
+++ b/dlls/gdi32/enhmfdrv/enhmetafiledrv.h
@@ -41,6 +41,7 @@ typedef struct
HBRUSH dc_brush;
HPEN dc_pen;
INT restoring; /* RestoreDC counter */
+ INT modifying_transform;/* Counter for functions that can change world transform */
BOOL path;
INT dev_caps[COLORMGMTCAPS + 1];
} EMFDRV_PDEVICE;
diff --git a/dlls/gdi32/enhmfdrv/init.c b/dlls/gdi32/enhmfdrv/init.c
index 07416db265e..6c41aa88feb 100644
--- a/dlls/gdi32/enhmfdrv/init.c
+++ b/dlls/gdi32/enhmfdrv/init.c
@@ -372,6 +372,7 @@ HDC WINAPI CreateEnhMetaFileW(
physDev->dc_brush = 0;
physDev->dc_pen = 0;
physDev->restoring = 0;
+ physDev->modifying_transform = 0;
physDev->path = FALSE;
if (hdc) /* if no ref, use current display */
diff --git a/dlls/gdi32/enhmfdrv/objects.c b/dlls/gdi32/enhmfdrv/objects.c
index e21dfe2a47a..a60ca1a3b82 100644
--- a/dlls/gdi32/enhmfdrv/objects.c
+++ b/dlls/gdi32/enhmfdrv/objects.c
@@ -285,6 +285,7 @@ HFONT CDECL EMFDRV_SelectFont( PHYSDEV dev, HFONT hFont, UINT *aa_flags )
int i;
if (physDev->restoring) goto done; /* don't output SelectObject records during RestoreDC */
+ if (physDev->modifying_transform) goto done; /* don't output SelectObject records when modifying the world transform */
/* If the object is a stock font object, do not need to create it.
* See definitions in wingdi.h for range of stock fonts.
@@ -370,6 +371,7 @@ HPEN CDECL EMFDRV_SelectPen(PHYSDEV dev, HPEN hPen, const struct brush_pattern *
int i;
if (physDev->restoring) return hPen; /* don't output SelectObject records during RestoreDC */
+ if (physDev->modifying_transform) return hPen; /* don't output SelectObject records when modifying the world transform */
/* If the object is a stock pen object, do not need to create it.
* See definitions in wingdi.h for range of stock pens.
diff --git a/dlls/gdi32/tests/metafile.c b/dlls/gdi32/tests/metafile.c
index e2592988cea..bc6ba16b194 100644
--- a/dlls/gdi32/tests/metafile.c
+++ b/dlls/gdi32/tests/metafile.c
@@ -5060,7 +5060,6 @@ static void test_emf_text_extends(void)
ok(ret, "GetTextExtentPoint32W failed, error %d\n", GetLastError());
ret = GetTextExtentPoint32W(emf_dc, L"W", 1, &size2);
ok(ret, "GetTextExtentPoint32W failed, error %d\n", GetLastError());
-todo_wine
ok(size2.cx == size.cx && size2.cy == size.cy, "Expected size %dx%d, got %dx%d\n",
size.cx, size.cy, size2.cx, size2.cy);
--
2.27.0
2
1
April 14, 2021
Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com>
---
dlls/winebus.sys/main.c | 33 +++++++++++++++++----------------
1 file changed, 17 insertions(+), 16 deletions(-)
diff --git a/dlls/winebus.sys/main.c b/dlls/winebus.sys/main.c
index 8d3dec4779a..7d3f5064f84 100644
--- a/dlls/winebus.sys/main.c
+++ b/dlls/winebus.sys/main.c
@@ -112,6 +112,8 @@ struct pnp_device
struct device_extension
{
+ CRITICAL_SECTION cs;
+
struct pnp_device *pnp_device;
WORD vid, pid, input;
@@ -127,7 +129,6 @@ struct device_extension
BOOL last_report_read;
DWORD buffer_size;
LIST_ENTRY irp_queue;
- CRITICAL_SECTION report_cs;
BYTE platform_private[1];
};
@@ -285,8 +286,8 @@ DEVICE_OBJECT *bus_create_hid_device(const WCHAR *busidW, WORD vid, WORD pid,
memset(ext->platform_private, 0, platform_data_size);
InitializeListHead(&ext->irp_queue);
- InitializeCriticalSection(&ext->report_cs);
- ext->report_cs.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": report_cs");
+ InitializeCriticalSection(&ext->cs);
+ ext->cs.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": cs");
/* add to list of pnp devices */
pnp_dev->device = device;
@@ -366,7 +367,7 @@ void bus_remove_hid_device(DEVICE_OBJECT *device)
TRACE("(%p)\n", device);
/* Cancel pending IRPs */
- EnterCriticalSection(&ext->report_cs);
+ EnterCriticalSection(&ext->cs);
while ((entry = RemoveHeadList(&ext->irp_queue)) != &ext->irp_queue)
{
irp = CONTAINING_RECORD(entry, IRP, Tail.Overlay.s.ListEntry);
@@ -374,10 +375,10 @@ void bus_remove_hid_device(DEVICE_OBJECT *device)
irp->IoStatus.Information = 0;
IoCompleteRequest(irp, IO_NO_INCREMENT);
}
- LeaveCriticalSection(&ext->report_cs);
+ LeaveCriticalSection(&ext->cs);
- ext->report_cs.DebugInfo->Spare[0] = 0;
- DeleteCriticalSection(&ext->report_cs);
+ ext->cs.DebugInfo->Spare[0] = 0;
+ DeleteCriticalSection(&ext->cs);
HeapFree(GetProcessHeap(), 0, ext->serial);
HeapFree(GetProcessHeap(), 0, ext->last_report);
@@ -783,12 +784,12 @@ static NTSTATUS WINAPI hid_internal_dispatch(DEVICE_OBJECT *device, IRP *irp)
{
HID_XFER_PACKET *packet = (HID_XFER_PACKET*)(irp->UserBuffer);
TRACE_(hid_report)("IOCTL_HID_GET_INPUT_REPORT\n");
- EnterCriticalSection(&ext->report_cs);
+ EnterCriticalSection(&ext->cs);
status = ext->vtbl->begin_report_processing(device);
if (status != STATUS_SUCCESS)
{
irp->IoStatus.u.Status = status;
- LeaveCriticalSection(&ext->report_cs);
+ LeaveCriticalSection(&ext->cs);
break;
}
@@ -798,18 +799,18 @@ static NTSTATUS WINAPI hid_internal_dispatch(DEVICE_OBJECT *device, IRP *irp)
if (status == STATUS_SUCCESS)
packet->reportBufferLen = irp->IoStatus.Information;
- LeaveCriticalSection(&ext->report_cs);
+ LeaveCriticalSection(&ext->cs);
break;
}
case IOCTL_HID_READ_REPORT:
{
TRACE_(hid_report)("IOCTL_HID_READ_REPORT\n");
- EnterCriticalSection(&ext->report_cs);
+ EnterCriticalSection(&ext->cs);
status = ext->vtbl->begin_report_processing(device);
if (status != STATUS_SUCCESS)
{
irp->IoStatus.u.Status = status;
- LeaveCriticalSection(&ext->report_cs);
+ LeaveCriticalSection(&ext->cs);
break;
}
if (!ext->last_report_read)
@@ -824,7 +825,7 @@ static NTSTATUS WINAPI hid_internal_dispatch(DEVICE_OBJECT *device, IRP *irp)
InsertTailList(&ext->irp_queue, &irp->Tail.Overlay.s.ListEntry);
status = STATUS_PENDING;
}
- LeaveCriticalSection(&ext->report_cs);
+ LeaveCriticalSection(&ext->cs);
break;
}
case IOCTL_HID_SET_OUTPUT_REPORT:
@@ -880,7 +881,7 @@ void process_hid_report(DEVICE_OBJECT *device, BYTE *report, DWORD length)
if (!length || !report)
return;
- EnterCriticalSection(&ext->report_cs);
+ EnterCriticalSection(&ext->cs);
if (length > ext->buffer_size)
{
HeapFree(GetProcessHeap(), 0, ext->last_report);
@@ -891,7 +892,7 @@ void process_hid_report(DEVICE_OBJECT *device, BYTE *report, DWORD length)
ext->buffer_size = 0;
ext->last_report_size = 0;
ext->last_report_read = TRUE;
- LeaveCriticalSection(&ext->report_cs);
+ LeaveCriticalSection(&ext->cs);
return;
}
else
@@ -914,7 +915,7 @@ void process_hid_report(DEVICE_OBJECT *device, BYTE *report, DWORD length)
ext->last_report_read = TRUE;
IoCompleteRequest(irp, IO_NO_INCREMENT);
}
- LeaveCriticalSection(&ext->report_cs);
+ LeaveCriticalSection(&ext->cs);
}
DWORD check_bus_option(const UNICODE_STRING *option, DWORD default_value)
--
2.30.2
1
4
Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com>
---
dlls/combase/tests/Makefile.in | 1 +
dlls/combase/tests/roapi.c | 59 +----
dlls/combase/tests/string.c | 443 +++++++++++++++------------------
include/roapi.h | 2 +
4 files changed, 208 insertions(+), 297 deletions(-)
diff --git a/dlls/combase/tests/Makefile.in b/dlls/combase/tests/Makefile.in
index ca6c48f3f2e..1c3d77725b3 100644
--- a/dlls/combase/tests/Makefile.in
+++ b/dlls/combase/tests/Makefile.in
@@ -1,4 +1,5 @@
TESTDLL = combase.dll
+IMPORTS = combase
C_SRCS = \
roapi.c \
diff --git a/dlls/combase/tests/roapi.c b/dlls/combase/tests/roapi.c
index b9cb476aafe..1efcc801dcb 100644
--- a/dlls/combase/tests/roapi.c
+++ b/dlls/combase/tests/roapi.c
@@ -26,38 +26,8 @@
#include "initguid.h"
#include "roapi.h"
-
#include "wine/test.h"
-static HRESULT (WINAPI *pRoActivateInstance)(HSTRING, IInspectable **);
-static HRESULT (WINAPI *pRoInitialize)(RO_INIT_TYPE);
-static void (WINAPI *pRoUninitialize)(void);
-static HRESULT (WINAPI *pRoGetActivationFactory)(HSTRING, REFIID, void **);
-
-static HRESULT (WINAPI *pWindowsCreateString)(LPCWSTR, UINT32, HSTRING *);
-static HRESULT (WINAPI *pWindowsDeleteString)(HSTRING);
-
-#define SET(x) p##x = (void*)GetProcAddress(hmod, #x)
-
-static BOOL init_functions(void)
-{
- HMODULE hmod = LoadLibraryA("combase.dll");
- if (!hmod)
- {
- win_skip("Failed to load combase.dll, skipping tests\n");
- return FALSE;
- }
- SET(RoActivateInstance);
- SET(RoInitialize);
- SET(RoUninitialize);
- SET(RoGetActivationFactory);
-
- SET(WindowsCreateString);
- SET(WindowsDeleteString);
-
- return TRUE;
-}
-
static void test_ActivationFactories(void)
{
HRESULT hr;
@@ -65,47 +35,38 @@ static void test_ActivationFactories(void)
IActivationFactory *factory = NULL;
IInspectable *inspect = NULL;
- if(!pRoGetActivationFactory || !pRoActivateInstance)
- {
- win_skip("RoGetActivationFactory not available\n");
- return;
- }
-
- hr = pWindowsCreateString(L"Windows.Data.Xml.Dom.XmlDocument",
+ hr = WindowsCreateString(L"Windows.Data.Xml.Dom.XmlDocument",
ARRAY_SIZE(L"Windows.Data.Xml.Dom.XmlDocument") - 1, &str);
ok(hr == S_OK, "got %08x\n", hr);
- hr = pWindowsCreateString(L"Does.Not.Exist", ARRAY_SIZE(L"Does.Not.Exist") - 1, &str2);
+ hr = WindowsCreateString(L"Does.Not.Exist", ARRAY_SIZE(L"Does.Not.Exist") - 1, &str2);
ok(hr == S_OK, "got %08x\n", hr);
- hr = pRoInitialize(RO_INIT_MULTITHREADED);
+ hr = RoInitialize(RO_INIT_MULTITHREADED);
ok(hr == S_OK, "got %08x\n", hr);
- hr = pRoGetActivationFactory(str2, &IID_IActivationFactory, (void **)&factory);
+ hr = RoGetActivationFactory(str2, &IID_IActivationFactory, (void **)&factory);
ok(hr == REGDB_E_CLASSNOTREG, "got %08x\n", hr);
- hr = pRoGetActivationFactory(str, &IID_IActivationFactory, (void **)&factory);
+ hr = RoGetActivationFactory(str, &IID_IActivationFactory, (void **)&factory);
todo_wine ok(hr == S_OK, "got %08x\n", hr);
if(factory)
IActivationFactory_Release(factory);
- hr = pRoActivateInstance(str2, &inspect);
+ hr = RoActivateInstance(str2, &inspect);
ok(hr == REGDB_E_CLASSNOTREG, "got %08x\n", hr);
- hr = pRoActivateInstance(str, &inspect);
+ hr = RoActivateInstance(str, &inspect);
todo_wine ok(hr == S_OK, "got %08x\n", hr);
if(inspect)
IInspectable_Release(inspect);
- pWindowsDeleteString(str2);
- pWindowsDeleteString(str);
- pRoUninitialize();
+ WindowsDeleteString(str2);
+ WindowsDeleteString(str);
+ RoUninitialize();
}
START_TEST(roapi)
{
- if (!init_functions())
- return;
-
test_ActivationFactories();
}
diff --git a/dlls/combase/tests/string.c b/dlls/combase/tests/string.c
index a84973ff56b..5ebf669a426 100644
--- a/dlls/combase/tests/string.c
+++ b/dlls/combase/tests/string.c
@@ -27,57 +27,6 @@
#include "wine/test.h"
-static HRESULT (WINAPI *pWindowsCompareStringOrdinal)(HSTRING, HSTRING, INT32 *);
-static HRESULT (WINAPI *pWindowsConcatString)(HSTRING, HSTRING, HSTRING *);
-static HRESULT (WINAPI *pWindowsCreateString)(LPCWSTR, UINT32, HSTRING *);
-static HRESULT (WINAPI *pWindowsCreateStringReference)(LPCWSTR, UINT32, HSTRING_HEADER *, HSTRING *);
-static HRESULT (WINAPI *pWindowsDeleteString)(HSTRING);
-static HRESULT (WINAPI *pWindowsDeleteStringBuffer)(HSTRING_BUFFER);
-static HRESULT (WINAPI *pWindowsDuplicateString)(HSTRING, HSTRING *);
-static UINT32 (WINAPI *pWindowsGetStringLen)(HSTRING);
-static LPCWSTR (WINAPI *pWindowsGetStringRawBuffer)(HSTRING, UINT32 *);
-static BOOL (WINAPI *pWindowsIsStringEmpty)(HSTRING);
-static HRESULT (WINAPI *pWindowsPreallocateStringBuffer)(UINT32, WCHAR **, HSTRING_BUFFER *);
-static HRESULT (WINAPI *pWindowsPromoteStringBuffer)(HSTRING_BUFFER, HSTRING *);
-static HRESULT (WINAPI *pWindowsStringHasEmbeddedNull)(HSTRING, BOOL *);
-static HRESULT (WINAPI *pWindowsSubstring)(HSTRING, UINT32, HSTRING *);
-static HRESULT (WINAPI *pWindowsSubstringWithSpecifiedLength)(HSTRING, UINT32, UINT32, HSTRING *);
-static HRESULT (WINAPI *pWindowsTrimStringEnd)(HSTRING, HSTRING, HSTRING *);
-static HRESULT (WINAPI *pWindowsTrimStringStart)(HSTRING, HSTRING, HSTRING *);
-
-#define SET(x) p##x = (void*)GetProcAddress(hmod, #x)
-
-static BOOL init_functions(void)
-{
- HMODULE hmod = LoadLibraryA("combase.dll");
- if (!hmod)
- {
- win_skip("Failed to load combase.dll, skipping tests\n");
- return FALSE;
- }
- SET(WindowsCompareStringOrdinal);
- SET(WindowsConcatString);
- SET(WindowsCreateString);
- SET(WindowsCreateStringReference);
- SET(WindowsDeleteString);
- SET(WindowsDeleteStringBuffer);
- SET(WindowsDuplicateString);
- SET(WindowsGetStringLen);
- SET(WindowsGetStringRawBuffer);
- SET(WindowsIsStringEmpty);
- SET(WindowsPreallocateStringBuffer);
- SET(WindowsPromoteStringBuffer);
- SET(WindowsStringHasEmbeddedNull);
- SET(WindowsSubstring);
- SET(WindowsSubstringWithSpecifiedLength);
- SET(WindowsTrimStringEnd);
- SET(WindowsTrimStringStart);
- return TRUE;
-}
-
-#undef SET
-
-
#define check_string(str, content, length, has_null) _check_string(__LINE__, str, content, length, has_null)
static void _check_string(int line, HSTRING str, LPCWSTR content, UINT32 length, BOOL has_null)
{
@@ -86,16 +35,16 @@ static void _check_string(int line, HSTRING str, LPCWSTR content, UINT32 length,
UINT32 out_length;
LPCWSTR ptr;
- ok_(__FILE__, line)(pWindowsIsStringEmpty(str) == empty, "WindowsIsStringEmpty failed\n");
- ok_(__FILE__, line)(pWindowsStringHasEmbeddedNull(str, &out_null) == S_OK, "pWindowsStringHasEmbeddedNull failed\n");
+ ok_(__FILE__, line)(WindowsIsStringEmpty(str) == empty, "WindowsIsStringEmpty failed\n");
+ ok_(__FILE__, line)(WindowsStringHasEmbeddedNull(str, &out_null) == S_OK, "WindowsStringHasEmbeddedNull failed\n");
ok_(__FILE__, line)(out_null == has_null, "WindowsStringHasEmbeddedNull failed\n");
- ok_(__FILE__, line)(pWindowsGetStringLen(str) == length, "WindowsGetStringLen failed\n");
- ptr = pWindowsGetStringRawBuffer(str, &out_length);
+ ok_(__FILE__, line)(WindowsGetStringLen(str) == length, "WindowsGetStringLen failed\n");
+ ptr = WindowsGetStringRawBuffer(str, &out_length);
/* WindowsGetStringRawBuffer should return a non-null, null terminated empty string
* even if str is NULL. */
ok_(__FILE__, line)(ptr != NULL, "WindowsGetStringRawBuffer returned null\n");
ok_(__FILE__, line)(out_length == length, "WindowsGetStringRawBuffer returned incorrect length\n");
- ptr = pWindowsGetStringRawBuffer(str, NULL);
+ ptr = WindowsGetStringRawBuffer(str, NULL);
ok_(__FILE__, line)(ptr != NULL, "WindowsGetStringRawBuffer returned null\n");
ok_(__FILE__, line)(ptr[length] == '\0', "WindowsGetStringRawBuffer doesn't return a null terminated buffer\n");
ok_(__FILE__, line)(memcmp(ptr, content, sizeof(*content) * length) == 0, "Incorrect string content\n");
@@ -113,80 +62,80 @@ static void test_create_delete(void)
HSTRING_HEADER header;
/* Test normal creation of a string */
- ok(pWindowsCreateString(input_string, 6, &str) == S_OK, "Failed to create string\n");
+ ok(WindowsCreateString(input_string, 6, &str) == S_OK, "Failed to create string\n");
check_string(str, input_string, 6, FALSE);
- ok(pWindowsDeleteString(str) == S_OK, "Failed to delete string\n");
+ ok(WindowsDeleteString(str) == S_OK, "Failed to delete string\n");
/* Test error handling in WindowsCreateString */
- ok(pWindowsCreateString(input_string, 6, NULL) == E_INVALIDARG, "Incorrect error handling\n");
- ok(pWindowsCreateString(NULL, 6, &str) == E_POINTER, "Incorrect error handling\n");
+ ok(WindowsCreateString(input_string, 6, NULL) == E_INVALIDARG, "Incorrect error handling\n");
+ ok(WindowsCreateString(NULL, 6, &str) == E_POINTER, "Incorrect error handling\n");
/* Test handling of a NULL string */
- ok(pWindowsDeleteString(NULL) == S_OK, "Failed to delete null string\n");
+ ok(WindowsDeleteString(NULL) == S_OK, "Failed to delete null string\n");
/* Test creation of a string reference */
- ok(pWindowsCreateStringReference(input_string, 6, &header, &str) == S_OK, "Failed to create string ref\n");
+ ok(WindowsCreateStringReference(input_string, 6, &header, &str) == S_OK, "Failed to create string ref\n");
check_string(str, input_string, 6, FALSE);
- ok(pWindowsDeleteString(str) == S_OK, "Failed to delete string ref\n");
+ ok(WindowsDeleteString(str) == S_OK, "Failed to delete string ref\n");
/* Test error handling in WindowsCreateStringReference */
/* Strings to CreateStringReference must be null terminated with the correct
* length. According to MSDN this should be E_INVALIDARG, but it returns
* 0x80000017 in practice. */
- ok(FAILED(pWindowsCreateStringReference(input_string, 5, &header, &str)), "Incorrect error handling\n");
+ ok(FAILED(WindowsCreateStringReference(input_string, 5, &header, &str)), "Incorrect error handling\n");
/* If the input string is non-null, it must be null-terminated even if the
* length is zero. */
- ok(FAILED(pWindowsCreateStringReference(input_string, 0, &header, &str)), "Incorrect error handling\n");
- ok(pWindowsCreateStringReference(input_string, 6, NULL, &str) == E_INVALIDARG, "Incorrect error handling\n");
- ok(pWindowsCreateStringReference(input_string, 6, &header, NULL) == E_INVALIDARG, "Incorrect error handling\n");
- ok(pWindowsCreateStringReference(NULL, 6, &header, &str) == E_POINTER, "Incorrect error handling\n");
+ ok(FAILED(WindowsCreateStringReference(input_string, 0, &header, &str)), "Incorrect error handling\n");
+ ok(WindowsCreateStringReference(input_string, 6, NULL, &str) == E_INVALIDARG, "Incorrect error handling\n");
+ ok(WindowsCreateStringReference(input_string, 6, &header, NULL) == E_INVALIDARG, "Incorrect error handling\n");
+ ok(WindowsCreateStringReference(NULL, 6, &header, &str) == E_POINTER, "Incorrect error handling\n");
/* Test creating a string without a null-termination at the specified length */
- ok(pWindowsCreateString(input_string, 3, &str) == S_OK, "Failed to create string\n");
+ ok(WindowsCreateString(input_string, 3, &str) == S_OK, "Failed to create string\n");
check_string(str, input_string, 3, FALSE);
- ok(pWindowsDeleteString(str) == S_OK, "Failed to delete string\n");
+ ok(WindowsDeleteString(str) == S_OK, "Failed to delete string\n");
/* Test an empty string */
- ok(pWindowsCreateString(L"", 0, &str) == S_OK, "Failed to create string\n");
+ ok(WindowsCreateString(L"", 0, &str) == S_OK, "Failed to create string\n");
ok(str == NULL, "Empty string not a null string\n");
- ok(pWindowsDeleteString(str) == S_OK, "Failed to delete string\n");
+ ok(WindowsDeleteString(str) == S_OK, "Failed to delete string\n");
- ok(pWindowsCreateString(input_string, 0, &str) == S_OK, "Failed to create string\n");
+ ok(WindowsCreateString(input_string, 0, &str) == S_OK, "Failed to create string\n");
ok(str == NULL, "Empty string not a null string\n");
- ok(pWindowsDeleteString(str) == S_OK, "Failed to delete string\n");
+ ok(WindowsDeleteString(str) == S_OK, "Failed to delete string\n");
- ok(pWindowsCreateStringReference(L"", 0, &header, &str) == S_OK, "Failed to create string\n");
+ ok(WindowsCreateStringReference(L"", 0, &header, &str) == S_OK, "Failed to create string\n");
ok(str == NULL, "Empty string not a null string\n");
- ok(pWindowsDeleteString(str) == S_OK, "Failed to delete string\n");
+ ok(WindowsDeleteString(str) == S_OK, "Failed to delete string\n");
- ok(pWindowsCreateString(NULL, 0, &str) == S_OK, "Failed to create string\n");
+ ok(WindowsCreateString(NULL, 0, &str) == S_OK, "Failed to create string\n");
ok(str == NULL, "Empty string not a null string\n");
- ok(pWindowsDeleteString(str) == S_OK, "Failed to delete string\n");
+ ok(WindowsDeleteString(str) == S_OK, "Failed to delete string\n");
- ok(pWindowsCreateStringReference(NULL, 0, &header, &str) == S_OK, "Failed to create string\n");
+ ok(WindowsCreateStringReference(NULL, 0, &header, &str) == S_OK, "Failed to create string\n");
ok(str == NULL, "Empty string not a null string\n");
- ok(pWindowsDeleteString(str) == S_OK, "Failed to delete string\n");
+ ok(WindowsDeleteString(str) == S_OK, "Failed to delete string\n");
}
static void test_duplicate(void)
{
HSTRING str, str2;
HSTRING_HEADER header;
- ok(pWindowsCreateString(input_string, 6, &str) == S_OK, "Failed to create string\n");
- ok(pWindowsDuplicateString(str, NULL) == E_INVALIDARG, "Incorrect error handling\n");
- ok(pWindowsDuplicateString(str, &str2) == S_OK, "Failed to duplicate string\n");
+ ok(WindowsCreateString(input_string, 6, &str) == S_OK, "Failed to create string\n");
+ ok(WindowsDuplicateString(str, NULL) == E_INVALIDARG, "Incorrect error handling\n");
+ ok(WindowsDuplicateString(str, &str2) == S_OK, "Failed to duplicate string\n");
ok(str == str2, "Duplicated string created new string\n");
- ok(pWindowsDeleteString(str) == S_OK, "Failed to delete string\n");
- ok(pWindowsDeleteString(str2) == S_OK, "Failed to delete string\n");
+ ok(WindowsDeleteString(str) == S_OK, "Failed to delete string\n");
+ ok(WindowsDeleteString(str2) == S_OK, "Failed to delete string\n");
- ok(pWindowsCreateStringReference(input_string, 6, &header, &str) == S_OK, "Failed to create string ref\n");
- ok(pWindowsDuplicateString(str, &str2) == S_OK, "Failed to duplicate string\n");
+ ok(WindowsCreateStringReference(input_string, 6, &header, &str) == S_OK, "Failed to create string ref\n");
+ ok(WindowsDuplicateString(str, &str2) == S_OK, "Failed to duplicate string\n");
ok(str != str2, "Duplicated string ref didn't create new string\n");
- ok(pWindowsDeleteString(str) == S_OK, "Failed to delete string\n");
- ok(pWindowsDeleteString(str2) == S_OK, "Failed to delete string ref\n");
+ ok(WindowsDeleteString(str) == S_OK, "Failed to delete string\n");
+ ok(WindowsDeleteString(str2) == S_OK, "Failed to delete string ref\n");
- ok(pWindowsDuplicateString(NULL, &str2) == S_OK, "Failed to duplicate NULL string\n");
+ ok(WindowsDuplicateString(NULL, &str2) == S_OK, "Failed to duplicate NULL string\n");
ok(str2 == NULL, "Duplicated string created new string\n");
- ok(pWindowsDeleteString(str2) == S_OK, "Failed to delete string\n");
+ ok(WindowsDeleteString(str2) == S_OK, "Failed to delete string\n");
}
static void test_access(void)
@@ -198,22 +147,22 @@ static void test_access(void)
check_string(NULL, NULL, 0, FALSE);
/* Test strings with embedded null chars */
- ok(pWindowsCreateString(input_embed_null, 6, &str) == S_OK, "Failed to create string\n");
+ ok(WindowsCreateString(input_embed_null, 6, &str) == S_OK, "Failed to create string\n");
check_string(str, input_embed_null, 6, TRUE);
- ok(pWindowsDeleteString(str) == S_OK, "Failed to delete string\n");
+ ok(WindowsDeleteString(str) == S_OK, "Failed to delete string\n");
- ok(pWindowsCreateStringReference(input_embed_null, 6, &header, &str) == S_OK, "Failed to create string ref\n");
+ ok(WindowsCreateStringReference(input_embed_null, 6, &header, &str) == S_OK, "Failed to create string ref\n");
check_string(str, input_embed_null, 6, TRUE);
- ok(pWindowsDeleteString(str) == S_OK, "Failed to delete string ref\n");
+ ok(WindowsDeleteString(str) == S_OK, "Failed to delete string ref\n");
/* Test normal creation of a string with trailing null */
- ok(pWindowsCreateString(input_string, 7, &str) == S_OK, "Failed to create string\n");
+ ok(WindowsCreateString(input_string, 7, &str) == S_OK, "Failed to create string\n");
check_string(str, input_string, 7, TRUE);
- ok(pWindowsDeleteString(str) == S_OK, "Failed to delete string\n");
+ ok(WindowsDeleteString(str) == S_OK, "Failed to delete string\n");
- ok(pWindowsCreateStringReference(input_string, 7, &header, &str) == S_OK, "Failed to create string ref\n");
+ ok(WindowsCreateStringReference(input_string, 7, &header, &str) == S_OK, "Failed to create string ref\n");
check_string(str, input_string, 7, TRUE);
- ok(pWindowsDeleteString(str) == S_OK, "Failed to delete string ref\n");
+ ok(WindowsDeleteString(str) == S_OK, "Failed to delete string ref\n");
}
static void test_string_buffer(void)
@@ -225,43 +174,43 @@ static void test_string_buffer(void)
HSTRING str;
/* Test creation of an empty buffer */
- ok(pWindowsPreallocateStringBuffer(0, &ptr, &buf) == S_OK, "Failed to preallocate string buffer\n");
+ ok(WindowsPreallocateStringBuffer(0, &ptr, &buf) == S_OK, "Failed to preallocate string buffer\n");
ok(ptr != NULL, "Empty string didn't return a buffer pointer\n");
- ok(pWindowsPromoteStringBuffer(buf, &str) == S_OK, "Failed to promote string buffer\n");
+ ok(WindowsPromoteStringBuffer(buf, &str) == S_OK, "Failed to promote string buffer\n");
ok(str == NULL, "Empty string isn't a null string\n");
check_string(str, L"", 0, FALSE);
- ok(pWindowsDeleteString(str) == S_OK, "Failed to delete string\n");
+ ok(WindowsDeleteString(str) == S_OK, "Failed to delete string\n");
- ok(pWindowsDeleteStringBuffer(NULL) == S_OK, "Failed to delete null string buffer\n");
+ ok(WindowsDeleteStringBuffer(NULL) == S_OK, "Failed to delete null string buffer\n");
/* Test creation and deletion of string buffers */
- ok(pWindowsPreallocateStringBuffer(6, &ptr, &buf) == S_OK, "Failed to preallocate string buffer\n");
- ok(pWindowsDeleteStringBuffer(buf) == S_OK, "Failed to delete string buffer\n");
+ ok(WindowsPreallocateStringBuffer(6, &ptr, &buf) == S_OK, "Failed to preallocate string buffer\n");
+ ok(WindowsDeleteStringBuffer(buf) == S_OK, "Failed to delete string buffer\n");
/* Test creation and promotion of string buffers */
- ok(pWindowsPreallocateStringBuffer(6, &ptr, &buf) == S_OK, "Failed to preallocate string buffer\n");
+ ok(WindowsPreallocateStringBuffer(6, &ptr, &buf) == S_OK, "Failed to preallocate string buffer\n");
ok(ptr[6] == '\0', "Preallocated string buffer didn't have null termination\n");
memcpy(ptr, input_string, 6 * sizeof(*input_string));
- ok(pWindowsPromoteStringBuffer(buf, NULL) == E_POINTER, "Incorrect error handling\n");
- ok(pWindowsPromoteStringBuffer(buf, &str) == S_OK, "Failed to promote string buffer\n");
+ ok(WindowsPromoteStringBuffer(buf, NULL) == E_POINTER, "Incorrect error handling\n");
+ ok(WindowsPromoteStringBuffer(buf, &str) == S_OK, "Failed to promote string buffer\n");
check_string(str, input_string, 6, FALSE);
- ok(pWindowsDeleteString(str) == S_OK, "Failed to delete string\n");
+ ok(WindowsDeleteString(str) == S_OK, "Failed to delete string\n");
/* Test error handling in preallocation */
- ok(pWindowsPreallocateStringBuffer(6, NULL, &buf) == E_POINTER, "Incorrect error handling\n");
- ok(pWindowsPreallocateStringBuffer(6, &ptr, NULL) == E_POINTER, "Incorrect error handling\n");
+ ok(WindowsPreallocateStringBuffer(6, NULL, &buf) == E_POINTER, "Incorrect error handling\n");
+ ok(WindowsPreallocateStringBuffer(6, &ptr, NULL) == E_POINTER, "Incorrect error handling\n");
- ok(pWindowsPreallocateStringBuffer(6, &ptr, &buf) == S_OK, "Failed to preallocate string buffer\n");
+ ok(WindowsPreallocateStringBuffer(6, &ptr, &buf) == S_OK, "Failed to preallocate string buffer\n");
ptr[6] = 'a'; /* Overwrite the buffer's null termination, promotion should fail */
- ok(pWindowsPromoteStringBuffer(buf, &str) == E_INVALIDARG, "Incorrect error handling\n");
- ok(pWindowsDeleteStringBuffer(buf) == S_OK, "Failed to delete string buffer\n");
+ ok(WindowsPromoteStringBuffer(buf, &str) == E_INVALIDARG, "Incorrect error handling\n");
+ ok(WindowsDeleteStringBuffer(buf) == S_OK, "Failed to delete string buffer\n");
/* Test strings with trailing null chars */
- ok(pWindowsPreallocateStringBuffer(7, &ptr, &buf) == S_OK, "Failed to preallocate string buffer\n");
+ ok(WindowsPreallocateStringBuffer(7, &ptr, &buf) == S_OK, "Failed to preallocate string buffer\n");
memcpy(ptr, input_string, 7 * sizeof(*input_string));
- ok(pWindowsPromoteStringBuffer(buf, &str) == S_OK, "Failed to promote string buffer\n");
+ ok(WindowsPromoteStringBuffer(buf, &str) == S_OK, "Failed to promote string buffer\n");
check_string(str, input_string, 7, TRUE);
- ok(pWindowsDeleteString(str) == S_OK, "Failed to delete string\n");
+ ok(WindowsDeleteString(str) == S_OK, "Failed to delete string\n");
}
static void test_substring(void)
@@ -270,76 +219,76 @@ static void test_substring(void)
HSTRING_HEADER header;
/* Test substring of string buffers */
- ok(pWindowsCreateString(input_string, 6, &str) == S_OK, "Failed to create string\n");
- ok(pWindowsSubstring(str, 2, &substr) == S_OK, "Failed to create substring\n");
+ ok(WindowsCreateString(input_string, 6, &str) == S_OK, "Failed to create string\n");
+ ok(WindowsSubstring(str, 2, &substr) == S_OK, "Failed to create substring\n");
check_string(substr, output_substring, 4, FALSE);
- ok(pWindowsDeleteString(substr) == S_OK, "Failed to delete string\n");
- ok(pWindowsSubstringWithSpecifiedLength(str, 2, 3, &substr) == S_OK, "Failed to create substring\n");
+ ok(WindowsDeleteString(substr) == S_OK, "Failed to delete string\n");
+ ok(WindowsSubstringWithSpecifiedLength(str, 2, 3, &substr) == S_OK, "Failed to create substring\n");
check_string(substr, output_substring, 3, FALSE);
- ok(pWindowsDeleteString(substr) == S_OK, "Failed to delete string\n");
- ok(pWindowsDeleteString(str) == S_OK, "Failed to delete string\n");
+ ok(WindowsDeleteString(substr) == S_OK, "Failed to delete string\n");
+ ok(WindowsDeleteString(str) == S_OK, "Failed to delete string\n");
/* Test duplication of string using substring */
- ok(pWindowsCreateString(input_string, 6, &str) == S_OK, "Failed to create string\n");
- ok(pWindowsSubstring(str, 0, &substr) == S_OK, "Failed to create substring\n");
+ ok(WindowsCreateString(input_string, 6, &str) == S_OK, "Failed to create string\n");
+ ok(WindowsSubstring(str, 0, &substr) == S_OK, "Failed to create substring\n");
ok(str != substr, "Duplicated string didn't create new string\n");
check_string(substr, input_string, 6, FALSE);
- ok(pWindowsDeleteString(substr) == S_OK, "Failed to delete string\n");
- ok(pWindowsSubstringWithSpecifiedLength(str, 0, 6, &substr) == S_OK, "Failed to create substring\n");
+ ok(WindowsDeleteString(substr) == S_OK, "Failed to delete string\n");
+ ok(WindowsSubstringWithSpecifiedLength(str, 0, 6, &substr) == S_OK, "Failed to create substring\n");
ok(str != substr, "Duplicated string didn't create new string\n");
check_string(substr, input_string, 6, FALSE);
- ok(pWindowsDeleteString(substr) == S_OK, "Failed to delete string\n");
- ok(pWindowsDeleteString(str) == S_OK, "Failed to delete string\n");
+ ok(WindowsDeleteString(substr) == S_OK, "Failed to delete string\n");
+ ok(WindowsDeleteString(str) == S_OK, "Failed to delete string\n");
/* Test substring of string reference */
- ok(pWindowsCreateStringReference(input_string, 6, &header, &str) == S_OK, "Failed to create string ref\n");
- ok(pWindowsSubstring(str, 2, &substr) == S_OK, "Failed to create substring of string ref\n");
+ ok(WindowsCreateStringReference(input_string, 6, &header, &str) == S_OK, "Failed to create string ref\n");
+ ok(WindowsSubstring(str, 2, &substr) == S_OK, "Failed to create substring of string ref\n");
check_string(substr, output_substring, 4, FALSE);
- ok(pWindowsDeleteString(substr) == S_OK, "Failed to delete string\n");
- ok(pWindowsSubstringWithSpecifiedLength(str, 2, 3, &substr) == S_OK, "Failed to create substring of string ref\n");
+ ok(WindowsDeleteString(substr) == S_OK, "Failed to delete string\n");
+ ok(WindowsSubstringWithSpecifiedLength(str, 2, 3, &substr) == S_OK, "Failed to create substring of string ref\n");
check_string(substr, output_substring, 3, FALSE);
- ok(pWindowsDeleteString(substr) == S_OK, "Failed to delete string\n");
- ok(pWindowsDeleteString(str) == S_OK, "Failed to delete string ref\n");
+ ok(WindowsDeleteString(substr) == S_OK, "Failed to delete string\n");
+ ok(WindowsDeleteString(str) == S_OK, "Failed to delete string ref\n");
/* Test duplication of string reference using substring */
- ok(pWindowsCreateStringReference(input_string, 6, &header, &str) == S_OK, "Failed to create string ref\n");
- ok(pWindowsSubstring(str, 0, &substr) == S_OK, "Failed to create substring of string ref\n");
+ ok(WindowsCreateStringReference(input_string, 6, &header, &str) == S_OK, "Failed to create string ref\n");
+ ok(WindowsSubstring(str, 0, &substr) == S_OK, "Failed to create substring of string ref\n");
ok(str != substr, "Duplicated string ref didn't create new string\n");
check_string(substr, input_string, 6, FALSE);
- ok(pWindowsDeleteString(substr) == S_OK, "Failed to delete string\n");
- ok(pWindowsSubstringWithSpecifiedLength(str, 0, 6, &substr) == S_OK, "Failed to create substring of string ref\n");
+ ok(WindowsDeleteString(substr) == S_OK, "Failed to delete string\n");
+ ok(WindowsSubstringWithSpecifiedLength(str, 0, 6, &substr) == S_OK, "Failed to create substring of string ref\n");
ok(str != substr, "Duplicated string ref didn't create new string\n");
check_string(substr, input_string, 6, FALSE);
- ok(pWindowsDeleteString(substr) == S_OK, "Failed to delete string\n");
- ok(pWindowsDeleteString(str) == S_OK, "Failed to delete string ref\n");
+ ok(WindowsDeleteString(substr) == S_OK, "Failed to delete string\n");
+ ok(WindowsDeleteString(str) == S_OK, "Failed to delete string ref\n");
/* Test get substring of empty string */
- ok(pWindowsSubstring(NULL, 0, &substr) == S_OK, "Failed to duplicate NULL string\n");
+ ok(WindowsSubstring(NULL, 0, &substr) == S_OK, "Failed to duplicate NULL string\n");
ok(substr == NULL, "Substring created new string\n");
- ok(pWindowsSubstringWithSpecifiedLength(NULL, 0, 0, &substr) == S_OK, "Failed to duplicate NULL string\n");
+ ok(WindowsSubstringWithSpecifiedLength(NULL, 0, 0, &substr) == S_OK, "Failed to duplicate NULL string\n");
ok(substr == NULL, "Substring created new string\n");
/* Test get empty substring of string */
- ok(pWindowsCreateString(input_string, 6, &str) == S_OK, "Failed to create string\n");
- ok(pWindowsSubstring(str, 6, &substr) == S_OK, "Failed to create substring\n");
+ ok(WindowsCreateString(input_string, 6, &str) == S_OK, "Failed to create string\n");
+ ok(WindowsSubstring(str, 6, &substr) == S_OK, "Failed to create substring\n");
ok(substr == NULL, "Substring created new string\n");
- ok(pWindowsSubstringWithSpecifiedLength(str, 6, 0, &substr) == S_OK, "Failed to create substring\n");
+ ok(WindowsSubstringWithSpecifiedLength(str, 6, 0, &substr) == S_OK, "Failed to create substring\n");
ok(substr == NULL, "Substring created new string\n");
- ok(pWindowsDeleteString(str) == S_OK, "Failed to delete string\n");
+ ok(WindowsDeleteString(str) == S_OK, "Failed to delete string\n");
/* Test handling of using too high start index or length */
- ok(pWindowsCreateString(input_string, 6, &str) == S_OK, "Failed to create string\n");
- ok(pWindowsSubstring(str, 7, &substr) == E_BOUNDS, "Incorrect error handling\n");
- ok(pWindowsSubstringWithSpecifiedLength(str, 7, 0, &substr) == E_BOUNDS, "Incorrect error handling\n");
- ok(pWindowsSubstringWithSpecifiedLength(str, 6, 1, &substr) == E_BOUNDS, "Incorrect error handling\n");
- ok(pWindowsSubstringWithSpecifiedLength(str, 7, ~0U, &substr) == E_BOUNDS, "Incorrect error handling\n");
- ok(pWindowsDeleteString(str) == S_OK, "Failed to delete string\n");
+ ok(WindowsCreateString(input_string, 6, &str) == S_OK, "Failed to create string\n");
+ ok(WindowsSubstring(str, 7, &substr) == E_BOUNDS, "Incorrect error handling\n");
+ ok(WindowsSubstringWithSpecifiedLength(str, 7, 0, &substr) == E_BOUNDS, "Incorrect error handling\n");
+ ok(WindowsSubstringWithSpecifiedLength(str, 6, 1, &substr) == E_BOUNDS, "Incorrect error handling\n");
+ ok(WindowsSubstringWithSpecifiedLength(str, 7, ~0U, &substr) == E_BOUNDS, "Incorrect error handling\n");
+ ok(WindowsDeleteString(str) == S_OK, "Failed to delete string\n");
/* Test handling of a NULL string */
- ok(pWindowsCreateString(input_string, 6, &str) == S_OK, "Failed to create string\n");
- ok(pWindowsSubstring(str, 7, NULL) == E_INVALIDARG, "Incorrect error handling\n");
- ok(pWindowsSubstringWithSpecifiedLength(str, 7, 0, NULL) == E_INVALIDARG, "Incorrect error handling\n");
- ok(pWindowsDeleteString(str) == S_OK, "Failed to delete string\n");
+ ok(WindowsCreateString(input_string, 6, &str) == S_OK, "Failed to create string\n");
+ ok(WindowsSubstring(str, 7, NULL) == E_INVALIDARG, "Incorrect error handling\n");
+ ok(WindowsSubstringWithSpecifiedLength(str, 7, 0, NULL) == E_INVALIDARG, "Incorrect error handling\n");
+ ok(WindowsDeleteString(str) == S_OK, "Failed to delete string\n");
}
static void test_concat(void)
@@ -348,53 +297,53 @@ static void test_concat(void)
HSTRING_HEADER header1, header2;
/* Test concatenation of string buffers */
- ok(pWindowsCreateString(input_string1, 3, &str1) == S_OK, "Failed to create string\n");
- ok(pWindowsCreateString(input_string2, 3, &str2) == S_OK, "Failed to create string\n");
+ ok(WindowsCreateString(input_string1, 3, &str1) == S_OK, "Failed to create string\n");
+ ok(WindowsCreateString(input_string2, 3, &str2) == S_OK, "Failed to create string\n");
- ok(pWindowsConcatString(str1, NULL, NULL) == E_INVALIDARG, "Incorrect error handling\n");
- ok(pWindowsConcatString(str1, NULL, &concat) == S_OK, "Failed to concatenate string\n");
+ ok(WindowsConcatString(str1, NULL, NULL) == E_INVALIDARG, "Incorrect error handling\n");
+ ok(WindowsConcatString(str1, NULL, &concat) == S_OK, "Failed to concatenate string\n");
ok(str1 == concat, "Concatenate created new string\n");
check_string(concat, input_string1, 3, FALSE);
- ok(pWindowsDeleteString(concat) == S_OK, "Failed to delete string\n");
+ ok(WindowsDeleteString(concat) == S_OK, "Failed to delete string\n");
- ok(pWindowsConcatString(NULL, str2, NULL) == E_INVALIDARG, "Incorrect error handling\n");
- ok(pWindowsConcatString(NULL, str2, &concat) == S_OK, "Failed to concatenate string\n");
+ ok(WindowsConcatString(NULL, str2, NULL) == E_INVALIDARG, "Incorrect error handling\n");
+ ok(WindowsConcatString(NULL, str2, &concat) == S_OK, "Failed to concatenate string\n");
ok(str2 == concat, "Concatenate created new string\n");
check_string(concat, input_string2, 3, FALSE);
- ok(pWindowsDeleteString(concat) == S_OK, "Failed to delete string\n");
+ ok(WindowsDeleteString(concat) == S_OK, "Failed to delete string\n");
- ok(pWindowsConcatString(str1, str2, NULL) == E_INVALIDARG, "Incorrect error handling\n");
- ok(pWindowsConcatString(str1, str2, &concat) == S_OK, "Failed to concatenate string\n");
+ ok(WindowsConcatString(str1, str2, NULL) == E_INVALIDARG, "Incorrect error handling\n");
+ ok(WindowsConcatString(str1, str2, &concat) == S_OK, "Failed to concatenate string\n");
check_string(concat, input_string, 6, FALSE);
- ok(pWindowsDeleteString(concat) == S_OK, "Failed to delete string\n");
+ ok(WindowsDeleteString(concat) == S_OK, "Failed to delete string\n");
- ok(pWindowsDeleteString(str2) == S_OK, "Failed to delete string\n");
- ok(pWindowsDeleteString(str1) == S_OK, "Failed to delete string\n");
+ ok(WindowsDeleteString(str2) == S_OK, "Failed to delete string\n");
+ ok(WindowsDeleteString(str1) == S_OK, "Failed to delete string\n");
/* Test concatenation of string references */
- ok(pWindowsCreateStringReference(input_string1, 3, &header1, &str1) == S_OK, "Failed to create string ref\n");
- ok(pWindowsCreateStringReference(input_string2, 3, &header2, &str2) == S_OK, "Failed to create string ref\n");
+ ok(WindowsCreateStringReference(input_string1, 3, &header1, &str1) == S_OK, "Failed to create string ref\n");
+ ok(WindowsCreateStringReference(input_string2, 3, &header2, &str2) == S_OK, "Failed to create string ref\n");
- ok(pWindowsConcatString(str1, NULL, &concat) == S_OK, "Failed to concatenate string\n");
+ ok(WindowsConcatString(str1, NULL, &concat) == S_OK, "Failed to concatenate string\n");
ok(str1 != concat, "Concatenate string ref didn't create new string\n");
check_string(concat, input_string1, 3, FALSE);
- ok(pWindowsDeleteString(concat) == S_OK, "Failed to delete string\n");
+ ok(WindowsDeleteString(concat) == S_OK, "Failed to delete string\n");
- ok(pWindowsConcatString(NULL, str2, &concat) == S_OK, "Failed to concatenate string\n");
+ ok(WindowsConcatString(NULL, str2, &concat) == S_OK, "Failed to concatenate string\n");
ok(str2 != concat, "Concatenate string ref didn't create new string\n");
check_string(concat, input_string2, 3, FALSE);
- ok(pWindowsDeleteString(concat) == S_OK, "Failed to delete string\n");
+ ok(WindowsDeleteString(concat) == S_OK, "Failed to delete string\n");
- ok(pWindowsConcatString(str1, str2, &concat) == S_OK, "Failed to concatenate string\n");
+ ok(WindowsConcatString(str1, str2, &concat) == S_OK, "Failed to concatenate string\n");
check_string(concat, input_string, 6, FALSE);
- ok(pWindowsDeleteString(concat) == S_OK, "Failed to delete string\n");
+ ok(WindowsDeleteString(concat) == S_OK, "Failed to delete string\n");
- ok(pWindowsDeleteString(str2) == S_OK, "Failed to delete string ref\n");
- ok(pWindowsDeleteString(str1) == S_OK, "Failed to delete string ref\n");
+ ok(WindowsDeleteString(str2) == S_OK, "Failed to delete string ref\n");
+ ok(WindowsDeleteString(str1) == S_OK, "Failed to delete string ref\n");
/* Test concatenation of two empty strings */
- ok(pWindowsConcatString(NULL, NULL, NULL) == E_INVALIDARG, "Incorrect error handling\n");
- ok(pWindowsConcatString(NULL, NULL, &concat) == S_OK, "Failed to concatenate string\n");
+ ok(WindowsConcatString(NULL, NULL, NULL) == E_INVALIDARG, "Incorrect error handling\n");
+ ok(WindowsConcatString(NULL, NULL, &concat) == S_OK, "Failed to concatenate string\n");
ok(concat == NULL, "Concatenate created new string\n");
}
@@ -405,56 +354,56 @@ static void test_compare(void)
INT32 res;
/* Test comparison of string buffers */
- ok(pWindowsCreateString(input_string1, 3, &str1) == S_OK, "Failed to create string\n");
- ok(pWindowsCreateString(input_string2, 3, &str2) == S_OK, "Failed to create string\n");
+ ok(WindowsCreateString(input_string1, 3, &str1) == S_OK, "Failed to create string\n");
+ ok(WindowsCreateString(input_string2, 3, &str2) == S_OK, "Failed to create string\n");
- ok(pWindowsCompareStringOrdinal(str1, str1, &res) == S_OK, "Failed to compare string\n");
+ ok(WindowsCompareStringOrdinal(str1, str1, &res) == S_OK, "Failed to compare string\n");
ok(res == 0, "Expected 0, got %d\n", res);
- ok(pWindowsCompareStringOrdinal(str1, str2, &res) == S_OK, "Failed to compare string\n");
+ ok(WindowsCompareStringOrdinal(str1, str2, &res) == S_OK, "Failed to compare string\n");
ok(res == -1, "Expected -1, got %d\n", res);
- ok(pWindowsCompareStringOrdinal(str2, str1, &res) == S_OK, "Failed to compare string\n");
+ ok(WindowsCompareStringOrdinal(str2, str1, &res) == S_OK, "Failed to compare string\n");
ok(res == 1, "Expected 1, got %d\n", res);
- ok(pWindowsCompareStringOrdinal(str2, str2, &res) == S_OK, "Failed to compare string\n");
+ ok(WindowsCompareStringOrdinal(str2, str2, &res) == S_OK, "Failed to compare string\n");
ok(res == 0, "Expected 0, got %d\n", res);
- ok(pWindowsCompareStringOrdinal(str1, NULL, &res) == S_OK, "Failed to compare string\n");
+ ok(WindowsCompareStringOrdinal(str1, NULL, &res) == S_OK, "Failed to compare string\n");
ok(res == 1, "Expected 1, got %d\n", res);
- ok(pWindowsCompareStringOrdinal(NULL, str1, &res) == S_OK, "Failed to compare string\n");
+ ok(WindowsCompareStringOrdinal(NULL, str1, &res) == S_OK, "Failed to compare string\n");
ok(res == -1, "Expected -1, got %d\n", res);
- ok(pWindowsCompareStringOrdinal(str2, NULL, &res) == S_OK, "Failed to compare string\n");
+ ok(WindowsCompareStringOrdinal(str2, NULL, &res) == S_OK, "Failed to compare string\n");
ok(res == 1, "Expected 1, got %d\n", res);
- ok(pWindowsCompareStringOrdinal(NULL, str2, &res) == S_OK, "Failed to compare string\n");
+ ok(WindowsCompareStringOrdinal(NULL, str2, &res) == S_OK, "Failed to compare string\n");
ok(res == -1, "Expected -1, got %d\n", res);
- ok(pWindowsDeleteString(str2) == S_OK, "Failed to delete string\n");
- ok(pWindowsDeleteString(str1) == S_OK, "Failed to delete string\n");
+ ok(WindowsDeleteString(str2) == S_OK, "Failed to delete string\n");
+ ok(WindowsDeleteString(str1) == S_OK, "Failed to delete string\n");
/* Test comparison of string references */
- ok(pWindowsCreateStringReference(input_string1, 3, &header1, &str1) == S_OK, "Failed to create string ref\n");
- ok(pWindowsCreateStringReference(input_string2, 3, &header2, &str2) == S_OK, "Failed to create string ref\n");
+ ok(WindowsCreateStringReference(input_string1, 3, &header1, &str1) == S_OK, "Failed to create string ref\n");
+ ok(WindowsCreateStringReference(input_string2, 3, &header2, &str2) == S_OK, "Failed to create string ref\n");
- ok(pWindowsCompareStringOrdinal(str1, str1, &res) == S_OK, "Failed to compare string\n");
+ ok(WindowsCompareStringOrdinal(str1, str1, &res) == S_OK, "Failed to compare string\n");
ok(res == 0, "Expected 0, got %d\n", res);
- ok(pWindowsCompareStringOrdinal(str1, str2, &res) == S_OK, "Failed to compare string\n");
+ ok(WindowsCompareStringOrdinal(str1, str2, &res) == S_OK, "Failed to compare string\n");
ok(res == -1, "Expected -1, got %d\n", res);
- ok(pWindowsCompareStringOrdinal(str2, str1, &res) == S_OK, "Failed to compare string\n");
+ ok(WindowsCompareStringOrdinal(str2, str1, &res) == S_OK, "Failed to compare string\n");
ok(res == 1, "Expected 1, got %d\n", res);
- ok(pWindowsCompareStringOrdinal(str2, str2, &res) == S_OK, "Failed to compare string\n");
+ ok(WindowsCompareStringOrdinal(str2, str2, &res) == S_OK, "Failed to compare string\n");
ok(res == 0, "Expected 0, got %d\n", res);
- ok(pWindowsCompareStringOrdinal(str1, NULL, &res) == S_OK, "Failed to compare string\n");
+ ok(WindowsCompareStringOrdinal(str1, NULL, &res) == S_OK, "Failed to compare string\n");
ok(res == 1, "Expected 1, got %d\n", res);
- ok(pWindowsCompareStringOrdinal(NULL, str1, &res) == S_OK, "Failed to compare string\n");
+ ok(WindowsCompareStringOrdinal(NULL, str1, &res) == S_OK, "Failed to compare string\n");
ok(res == -1, "Expected -1, got %d\n", res);
- ok(pWindowsCompareStringOrdinal(str2, NULL, &res) == S_OK, "Failed to compare string\n");
+ ok(WindowsCompareStringOrdinal(str2, NULL, &res) == S_OK, "Failed to compare string\n");
ok(res == 1, "Expected 1, got %d\n", res);
- ok(pWindowsCompareStringOrdinal(NULL, str2, &res) == S_OK, "Failed to compare string\n");
+ ok(WindowsCompareStringOrdinal(NULL, str2, &res) == S_OK, "Failed to compare string\n");
ok(res == -1, "Expected -1, got %d\n", res);
- ok(pWindowsDeleteString(str2) == S_OK, "Failed to delete string ref\n");
- ok(pWindowsDeleteString(str1) == S_OK, "Failed to delete string ref\n");
+ ok(WindowsDeleteString(str2) == S_OK, "Failed to delete string ref\n");
+ ok(WindowsDeleteString(str1) == S_OK, "Failed to delete string ref\n");
/* Test comparison of two empty strings */
- ok(pWindowsCompareStringOrdinal(NULL, NULL, NULL) == E_INVALIDARG, "Incorrect error handling\n");
- ok(pWindowsCompareStringOrdinal(NULL, NULL, &res) == S_OK, "Failed to compare NULL string\n");
+ ok(WindowsCompareStringOrdinal(NULL, NULL, NULL) == E_INVALIDARG, "Incorrect error handling\n");
+ ok(WindowsCompareStringOrdinal(NULL, NULL, &res) == S_OK, "Failed to compare NULL string\n");
ok(res == 0, "Expected 0, got %d\n", res);
}
@@ -464,76 +413,74 @@ static void test_trim(void)
HSTRING_HEADER header1, header2;
/* Test trimming of string buffers */
- ok(pWindowsCreateString(input_string, 6, &str1) == S_OK, "Failed to create string\n");
- ok(pWindowsCreateString(input_string1, 3, &str2) == S_OK, "Failed to create string\n");
+ ok(WindowsCreateString(input_string, 6, &str1) == S_OK, "Failed to create string\n");
+ ok(WindowsCreateString(input_string1, 3, &str2) == S_OK, "Failed to create string\n");
- ok(pWindowsTrimStringStart(str1, str2, &trimmed) == S_OK, "Failed to trim string\n");
+ ok(WindowsTrimStringStart(str1, str2, &trimmed) == S_OK, "Failed to trim string\n");
check_string(trimmed, input_string2, 3, FALSE);
- ok(pWindowsDeleteString(trimmed) == S_OK, "Failed to delete string\n");
- ok(pWindowsTrimStringEnd(str1, str2, &trimmed) == S_OK, "Failed to trim string\n");
+ ok(WindowsDeleteString(trimmed) == S_OK, "Failed to delete string\n");
+ ok(WindowsTrimStringEnd(str1, str2, &trimmed) == S_OK, "Failed to trim string\n");
ok(trimmed == str1, "Trimmed string created new string\n");
check_string(trimmed, input_string, 6, FALSE);
- ok(pWindowsDeleteString(trimmed) == S_OK, "Failed to delete string\n");
+ ok(WindowsDeleteString(trimmed) == S_OK, "Failed to delete string\n");
- ok(pWindowsDeleteString(str2) == S_OK, "Failed to delete string\n");
- ok(pWindowsCreateString(input_string2, 3, &str2) == S_OK, "Failed to create string\n");
+ ok(WindowsDeleteString(str2) == S_OK, "Failed to delete string\n");
+ ok(WindowsCreateString(input_string2, 3, &str2) == S_OK, "Failed to create string\n");
- ok(pWindowsTrimStringStart(str1, str2, &trimmed) == S_OK, "Failed to trim string\n");
+ ok(WindowsTrimStringStart(str1, str2, &trimmed) == S_OK, "Failed to trim string\n");
ok(trimmed == str1, "Trimmed string created new string\n");
check_string(trimmed, input_string, 6, FALSE);
- ok(pWindowsDeleteString(trimmed) == S_OK, "Failed to delete string\n");
- ok(pWindowsTrimStringEnd(str1, str2, &trimmed) == S_OK, "Failed to trim string\n");
+ ok(WindowsDeleteString(trimmed) == S_OK, "Failed to delete string\n");
+ ok(WindowsTrimStringEnd(str1, str2, &trimmed) == S_OK, "Failed to trim string\n");
check_string(trimmed, input_string1, 3, FALSE);
- ok(pWindowsDeleteString(trimmed) == S_OK, "Failed to delete string\n");
+ ok(WindowsDeleteString(trimmed) == S_OK, "Failed to delete string\n");
- ok(pWindowsDeleteString(str2) == S_OK, "Failed to delete string\n");
- ok(pWindowsDeleteString(str1) == S_OK, "Failed to delete string\n");
+ ok(WindowsDeleteString(str2) == S_OK, "Failed to delete string\n");
+ ok(WindowsDeleteString(str1) == S_OK, "Failed to delete string\n");
/* Test trimming of string references */
- ok(pWindowsCreateStringReference(input_string, 6, &header1, &str1) == S_OK, "Failed to create string ref\n");
- ok(pWindowsCreateStringReference(input_string1, 3, &header2, &str2) == S_OK, "Failed to create string ref\n");
+ ok(WindowsCreateStringReference(input_string, 6, &header1, &str1) == S_OK, "Failed to create string ref\n");
+ ok(WindowsCreateStringReference(input_string1, 3, &header2, &str2) == S_OK, "Failed to create string ref\n");
- ok(pWindowsTrimStringStart(str1, str2, &trimmed) == S_OK, "Failed to trim string\n");
+ ok(WindowsTrimStringStart(str1, str2, &trimmed) == S_OK, "Failed to trim string\n");
check_string(trimmed, input_string2, 3, FALSE);
- ok(pWindowsDeleteString(trimmed) == S_OK, "Failed to delete string\n");
- ok(pWindowsTrimStringEnd(str1, str2, &trimmed) == S_OK, "Failed to trim string\n");
+ ok(WindowsDeleteString(trimmed) == S_OK, "Failed to delete string\n");
+ ok(WindowsTrimStringEnd(str1, str2, &trimmed) == S_OK, "Failed to trim string\n");
ok(trimmed != str1, "Trimmed string ref didn't create new string\n");
check_string(trimmed, input_string, 6, FALSE);
- ok(pWindowsDeleteString(trimmed) == S_OK, "Failed to delete string\n");
+ ok(WindowsDeleteString(trimmed) == S_OK, "Failed to delete string\n");
- ok(pWindowsDeleteString(str2) == S_OK, "Failed to delete string ref\n");
- ok(pWindowsCreateStringReference(input_string2, 3, &header2, &str2) == S_OK, "Failed to create string ref\n");
+ ok(WindowsDeleteString(str2) == S_OK, "Failed to delete string ref\n");
+ ok(WindowsCreateStringReference(input_string2, 3, &header2, &str2) == S_OK, "Failed to create string ref\n");
- ok(pWindowsTrimStringStart(str1, str2, &trimmed) == S_OK, "Failed to trim string\n");
+ ok(WindowsTrimStringStart(str1, str2, &trimmed) == S_OK, "Failed to trim string\n");
ok(trimmed != str1, "Trimmed string ref didn't create new string\n");
check_string(trimmed, input_string, 6, FALSE);
- ok(pWindowsDeleteString(trimmed) == S_OK, "Failed to delete string\n");
- ok(pWindowsTrimStringEnd(str1, str2, &trimmed) == S_OK, "Failed to trim string\n");
+ ok(WindowsDeleteString(trimmed) == S_OK, "Failed to delete string\n");
+ ok(WindowsTrimStringEnd(str1, str2, &trimmed) == S_OK, "Failed to trim string\n");
check_string(trimmed, input_string1, 3, FALSE);
- ok(pWindowsDeleteString(trimmed) == S_OK, "Failed to delete string\n");
+ ok(WindowsDeleteString(trimmed) == S_OK, "Failed to delete string\n");
- ok(pWindowsDeleteString(str2) == S_OK, "Failed to delete string ref\n");
- ok(pWindowsDeleteString(str1) == S_OK, "Failed to delete string ref\n");
+ ok(WindowsDeleteString(str2) == S_OK, "Failed to delete string ref\n");
+ ok(WindowsDeleteString(str1) == S_OK, "Failed to delete string ref\n");
/* Test handling of NULL strings */
- ok(pWindowsCreateString(input_string, 6, &str1) == S_OK, "Failed to create string\n");
- ok(pWindowsTrimStringStart(NULL, NULL, NULL) == E_INVALIDARG, "Incorrect error handling\n");
- ok(pWindowsTrimStringStart(NULL, str1, NULL) == E_INVALIDARG, "Incorrect error handling\n");
- ok(pWindowsTrimStringStart(NULL, NULL, &trimmed) == E_INVALIDARG, "Incorrect error handling\n");
- ok(pWindowsTrimStringStart(NULL, str1, &trimmed) == S_OK, "Failed to trim empty string\n");
+ ok(WindowsCreateString(input_string, 6, &str1) == S_OK, "Failed to create string\n");
+ ok(WindowsTrimStringStart(NULL, NULL, NULL) == E_INVALIDARG, "Incorrect error handling\n");
+ ok(WindowsTrimStringStart(NULL, str1, NULL) == E_INVALIDARG, "Incorrect error handling\n");
+ ok(WindowsTrimStringStart(NULL, NULL, &trimmed) == E_INVALIDARG, "Incorrect error handling\n");
+ ok(WindowsTrimStringStart(NULL, str1, &trimmed) == S_OK, "Failed to trim empty string\n");
ok(trimmed == NULL, "Trimming created new string\n");
- ok(pWindowsTrimStringEnd(NULL, NULL, NULL) == E_INVALIDARG, "Incorrect error handling\n");
- ok(pWindowsTrimStringEnd(NULL, str1, NULL) == E_INVALIDARG, "Incorrect error handling\n");
- ok(pWindowsTrimStringEnd(NULL, NULL, &trimmed) == E_INVALIDARG, "Incorrect error handling\n");
- ok(pWindowsTrimStringEnd(NULL, str1, &trimmed) == S_OK, "Failed to trim empty string\n");
+ ok(WindowsTrimStringEnd(NULL, NULL, NULL) == E_INVALIDARG, "Incorrect error handling\n");
+ ok(WindowsTrimStringEnd(NULL, str1, NULL) == E_INVALIDARG, "Incorrect error handling\n");
+ ok(WindowsTrimStringEnd(NULL, NULL, &trimmed) == E_INVALIDARG, "Incorrect error handling\n");
+ ok(WindowsTrimStringEnd(NULL, str1, &trimmed) == S_OK, "Failed to trim empty string\n");
ok(trimmed == NULL, "Trimming created new string\n");
- ok(pWindowsDeleteString(str1) == S_OK, "Failed to delete string\n");
+ ok(WindowsDeleteString(str1) == S_OK, "Failed to delete string\n");
}
START_TEST(string)
{
- if (!init_functions())
- return;
test_create_delete();
test_duplicate();
test_access();
diff --git a/include/roapi.h b/include/roapi.h
index 9f717e88e34..bcaa8e9fea0 100644
--- a/include/roapi.h
+++ b/include/roapi.h
@@ -42,6 +42,8 @@ typedef HRESULT (WINAPI *PFNGETACTIVATIONFACTORY)(HSTRING, IActivationFactory **
extern "C" {
#endif
+HRESULT WINAPI RoActivateInstance(HSTRING classid, IInspectable **instance);
+HRESULT WINAPI RoGetActivationFactory(HSTRING classid, REFIID iid, void **class_factory);
HRESULT WINAPI RoInitialize(RO_INIT_TYPE type);
void WINAPI RoUninitialize(void);
--
2.30.2
1
0
April 14, 2021
There are many Windows 10 versions and mixing them all together makes
for a very large page, with more and more differences between the oldest
and newest versions. So create multiple Windows 10 pages.
Add a new group every couple of years; put the results for the latest
Windows 10 in the Win10 group; and the locale tests in the Win10L one.
Signed-off-by: Francois Gouget <fgouget(a)codeweavers.com>
---
The grouping can be adjusted if desired. With the proposed split we
should have:
Win1507+ -> 8 runs
Win1709+ -> 11 runs
Win1909+ -> 5 runs (will go up as new Windows versions come out)
Win10 -> 10 runs
Win10L -> 11 runs (mostly locales)
Rather than being tied to a specific Windows 10 version, Win10 and
Win10L would be reserved for the two VMs where most test configurations
are run: locales, dual-screen, test signing, etc.
Also any past test result will remain in the Win10 group (unless the
directories are manually renamed from win10_ to the appropriate winXXX_
prefix).
Here is some information on the number of test results we normally have
for each Windows 10 version. These may change if we decide to run more
tests in some old Windows versions, like running both the 32- and
64-bit tests on 1909, or adjusting the set of locales to test:
1507 -> ~6 runs
cw-gtx560-1507-32
cw-gtx560-1507-64
cw-rx460-1507-32
cw-rx460-1507-64
newtb-w1064v1507-32
newtb-w1064v1507-64
1607 -> ~2 run
netwtb-w1064v1607-32
netwtb-w1064v1607-64
1709 -> ~5 runs
cw-gtx560-1709-32
cw-gtx560-1709-64
cw-rx460-1709-32
cw-rx460-1709-64
newtb-w1064v1709-64
1809 -> ~6 runs
cw-gtx560-1809-32
cw-gtx560-1809-64
cw-rx460-1809-32
cw-rx460-1809-64
newtb-w1064v1809-32
newtb-w1064v1809-64
1909 -> ~5 runs
cw-gtx560-1909-32
cw-gtx560-1909-64
cw-rx460-1909-32
cw-rx460-1909-64
newtb-w1064v1909-64
2004 -> ~11 (locale) runs
My current plan is to run the locales tests in the latest spring
release.
newtb-w10pro64-32
newtb-w10pro64-64
newtb-w10pro64-ar-64
newtb-w10pro64-fr-64
newtb-w10pro64-he-64
newtb-w10pro64-hi-64
newtb-w10pro64-ja-64
newtb-w10pro64-ko-64
newtb-w10pro64-pt-BR-64
newtb-w10pro64-ru-64
newtb-w10pro64-zh-CN-64
2009 -> ~10 runs
And to add the fall releases to the VM that tests all the Windows
10 versions. That means ignoring old spring releases.
fgtb-w10pro64-32
fgtb-w10pro64-64
fgtb-w10pro64-rx550-64
newtb-w1064-32
newtb-w1064-64
newtb-w1064-1qxl-64
newtb-w1064-2qxl-64
newtb-w1064-adm-64
newtb-w1064-tsign-32
newtb-w1064-tsign-64
---
winetest/build-index | 11 +++++++++--
winetest/gather | 18 ++++++++++++------
2 files changed, 21 insertions(+), 8 deletions(-)
diff --git a/winetest/build-index b/winetest/build-index
index 01533c4d4..2d25f2cb3 100755
--- a/winetest/build-index
+++ b/winetest/build-index
@@ -94,7 +94,11 @@ my %vista = (name => "Vista");
my %w2k8 = (name => "2008");
my %win7 = (name => "Win7");
my %win8 = (name => "Win8");
+my %win1507 = (name => "Win1507+");
+my %win1709 = (name => "Win1709+");
+my %win1909 = (name => "Win1909+");
my %win10 = (name => "Win10");
+my %win10l = (name => "Win10L");
my %unknown = (name => "Other");
my %linux = (name => "Linux");
my %mac = (name => "Mac");
@@ -103,7 +107,10 @@ my %solaris = (name => "Solaris");
my %wine = (name => "Wine");
# Define the order of version groups in the summary
-my @groups = (\%w95, \%w98, \%me, \%nt3, \%nt4, \%w2k, \%xp, \%w2k3, \%vista, \%w2k8, \%win7, \%win8, \%win10,
+my @groups = (\%w95, \%w98, \%me,
+ \%nt3, \%nt4, \%w2k, \%xp, \%w2k3,
+ \%vista, \%w2k8, \%win7, \%win8,
+ \%win1507, \%win1709, \%win1909, \%win10, \%win10l,
\%unknown, \%linux, \%mac, \%bsd, \%solaris, \%wine);
@@ -384,7 +391,7 @@ foreach my $build (@builds)
{
while (<TOTAL>)
{
- if (/^([A-Za-z0-9]+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)(?:\s+(\d+))?/)
+ if (/^([A-Za-z0-9+]+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)(?:\s+(\d+))?/)
{
my ($name, $runs, $tests, $errors, $todos, $successes) = ($1, $2, $3, $4, $5, $6);
$versions{$name}++;
diff --git a/winetest/gather b/winetest/gather
index 750f0eed4..a0a6d378f 100755
--- a/winetest/gather
+++ b/winetest/gather
@@ -139,7 +139,11 @@ my %vista = (name => "Vista");
my %w2k8 = (name => "2008");
my %win7 = (name => "Win7");
my %win8 = (name => "Win8");
+my %win1507 = (name => "Win1507+");
+my %win1709 = (name => "Win1709+");
+my %win1909 = (name => "Win1909+");
my %win10 = (name => "Win10");
+my %win10l = (name => "Win10L");
my %unknown = (name => "Other");
my %linux = (name => "Linux");
my %mac = (name => "Mac");
@@ -150,7 +154,8 @@ my %wine = (name => "Wine");
# Define the order of version groups in the summary
my @groups = (\%w95, \%w98, \%me,
\%nt3, \%nt4, \%w2k, \%xp, \%w2k3,
- \%vista, \%w2k8, \%win7, \%win8, \%win10,
+ \%vista, \%w2k8, \%win7, \%win8,
+ \%win1507, \%win1709, \%win1909, \%win10, \%win10l,
\%unknown, \%linux, \%mac, \%bsd, \%solaris, \%wine);
# Map dissect's IDs to the above hashes
@@ -160,11 +165,12 @@ my %idmap = (95 => \%w95, 98 => \%w98, me => \%me,
vista => \%vista, 2008 => \%w2k8,
win7 => \%win7,
win8 => \%win8, win81 => \%win8,
- win1507 => \%win10, win1511 => \%win10,
- win1607 => \%win10, win1703 => \%win10,
- win1709 => \%win10, win1803 => \%win10,
- win1809 => \%win10, win1903 => \%win10,
- win1909 => \%win10, win2004 => \%win10,
+ win1507 => \%win1507, win1511 => \%win1507,
+ win1607 => \%win1507, win1703 => \%win1507,
+ win1709 => \%win1709, win1803 => \%win1709,
+ win1809 => \%win1709, win1903 => \%win1709,
+ win1909 => \%win1909,
+ win2004 => \%win10l,
win2009 => \%win10,
win10 => \%win10, # for backward compatibility
unknown => \%unknown,
--
2.20.1
2
2
From: David Torok <dt(a)zeroitlab.com>
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50952
Signed-off-by: David Torok <dt(a)zeroitlab.com>
Signed-off-by: Gijs Vermeulen <gijsvrm(a)gmail.com>
---
dlls/ntdll/ntdll.spec | 4 ++--
dlls/ntdll/unix/thread.c | 10 ++++++++++
2 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/dlls/ntdll/ntdll.spec b/dlls/ntdll/ntdll.spec
index 881b57eb80a..a93fa08c406 100644
--- a/dlls/ntdll/ntdll.spec
+++ b/dlls/ntdll/ntdll.spec
@@ -183,7 +183,7 @@
@ stdcall -syscall NtCreateSection(ptr long ptr ptr long long long)
@ stdcall -syscall NtCreateSemaphore(ptr long ptr long long)
@ stdcall -syscall NtCreateSymbolicLinkObject(ptr long ptr ptr)
-@ stub NtCreateThread
+@ stdcall -syscall NtCreateThread(ptr long ptr long ptr ptr ptr long)
@ stdcall -syscall NtCreateThreadEx(ptr long ptr long ptr ptr long long long long ptr)
@ stdcall -syscall NtCreateTimer(ptr long ptr long)
@ stub NtCreateToken
@@ -1191,7 +1191,7 @@
@ stdcall -private -syscall ZwCreateSection(ptr long ptr ptr long long long) NtCreateSection
@ stdcall -private -syscall ZwCreateSemaphore(ptr long ptr long long) NtCreateSemaphore
@ stdcall -private -syscall ZwCreateSymbolicLinkObject(ptr long ptr ptr) NtCreateSymbolicLinkObject
-@ stub ZwCreateThread
+@ stdcall -private -syscall ZwCreateThread(ptr long ptr long ptr ptr ptr long) NtCreateThread
@ stdcall -private -syscall ZwCreateThreadEx(ptr long ptr long ptr ptr long long long long ptr) NtCreateThreadEx
@ stdcall -private -syscall ZwCreateTimer(ptr long ptr long) NtCreateTimer
@ stub ZwCreateToken
diff --git a/dlls/ntdll/unix/thread.c b/dlls/ntdll/unix/thread.c
index 543a214e056..b1c64f6f7a8 100644
--- a/dlls/ntdll/unix/thread.c
+++ b/dlls/ntdll/unix/thread.c
@@ -144,6 +144,16 @@ static void update_attr_list( PS_ATTRIBUTE_LIST *attr, const CLIENT_ID *id, TEB
}
}
+/***********************************************************************
+ * NtCreateThread (NTDLL.@)
+ */
+NTSTATUS WINAPI NtCreateThread( HANDLE *handle, ACCESS_MASK access, OBJECT_ATTRIBUTES *attr,
+ HANDLE process, CLIENT_ID *id, CONTEXT *ctx, INITIAL_TEB *teb,
+ BOOLEAN suspended )
+{
+ FIXME( "%p %d %p %p %p %p %p %d, stub!\n", handle, access, attr, process, id, ctx, teb, suspended );
+ return STATUS_NOT_IMPLEMENTED;
+}
/***********************************************************************
* NtCreateThreadEx (NTDLL.@)
--
2.31.1
3
3
[PATCH] wined3d: Allow wined3d_stream_info_from_declaration() to include inputs with no buffer set.
by Jan Sikorski April 14, 2021
by Jan Sikorski April 14, 2021
April 14, 2021
Include these inputs in the Vulkan pipeline input descriptor.
This prevents MoltenVK from rejecting the pipeline when they are consumed by the shader.
We should probably also bind a null resource in that case to comply with Vulkan spec.
Signed-off-by: Jan Sikorski <jsikorski(a)codeweavers.com>
---
dlls/wined3d/context.c | 6 +++---
dlls/wined3d/context_vk.c | 2 +-
dlls/wined3d/device.c | 2 +-
dlls/wined3d/wined3d_private.h | 3 ++-
4 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c
index 2debf50de7f..f2fdcddc261 100644
--- a/dlls/wined3d/context.c
+++ b/dlls/wined3d/context.c
@@ -154,7 +154,7 @@ static BOOL fixed_get_input(BYTE usage, BYTE usage_idx, unsigned int *regnum)
/* Context activation is done by the caller. */
void wined3d_stream_info_from_declaration(struct wined3d_stream_info *stream_info,
- const struct wined3d_state *state, const struct wined3d_d3d_info *d3d_info)
+ const struct wined3d_state *state, const struct wined3d_d3d_info *d3d_info, bool require_buffer)
{
/* We need to deal with frequency data! */
struct wined3d_vertex_declaration *declaration = state->vertex_declaration;
@@ -182,7 +182,7 @@ void wined3d_stream_info_from_declaration(struct wined3d_stream_info *stream_inf
TRACE("%p Element %p (%u of %u).\n", declaration->elements,
element, i + 1, declaration->element_count);
- if (!stream->buffer)
+ if (!stream->buffer && require_buffer)
continue;
TRACE("offset %u input_slot %u usage_idx %d.\n", element->offset, element->input_slot, element->usage_idx);
@@ -269,7 +269,7 @@ void context_update_stream_info(struct wined3d_context *context, const struct wi
unsigned int i;
WORD map;
- wined3d_stream_info_from_declaration(stream_info, state, d3d_info);
+ wined3d_stream_info_from_declaration(stream_info, state, d3d_info, true);
stream_info->all_vbo = 1;
for (i = 0, map = stream_info->use_map; map; map >>= 1, ++i)
diff --git a/dlls/wined3d/context_vk.c b/dlls/wined3d/context_vk.c
index 45133eabb69..96b732fb3aa 100644
--- a/dlls/wined3d/context_vk.c
+++ b/dlls/wined3d/context_vk.c
@@ -2032,7 +2032,7 @@ static bool wined3d_context_vk_update_graphics_pipeline_key(struct wined3d_conte
|| wined3d_context_is_graphics_state_dirty(&context_vk->c, STATE_STREAMSRC)
|| wined3d_context_is_graphics_state_dirty(&context_vk->c, STATE_SHADER(WINED3D_SHADER_TYPE_VERTEX)))
{
- wined3d_stream_info_from_declaration(&stream_info, state, d3d_info);
+ wined3d_stream_info_from_declaration(&stream_info, state, d3d_info, false);
divisor_count = 0;
for (i = 0, mask = 0, attribute_count = 0, binding_count = 0; i < ARRAY_SIZE(stream_info.elements); ++i)
{
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 9240bad9d27..4bc683d3c40 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -3789,7 +3789,7 @@ HRESULT CDECL wined3d_device_process_vertices(struct wined3d_device *device,
vs = state->shader[WINED3D_SHADER_TYPE_VERTEX];
state->shader[WINED3D_SHADER_TYPE_VERTEX] = NULL;
- wined3d_stream_info_from_declaration(&stream_info, state, &device->adapter->d3d_info);
+ wined3d_stream_info_from_declaration(&stream_info, state, &device->adapter->d3d_info, true);
state->shader[WINED3D_SHADER_TYPE_VERTEX] = vs;
/* We can't convert FROM a VBO, and vertex buffers used to source into
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 4d5f4765f57..ab5f2253462 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -1678,7 +1678,8 @@ struct wined3d_stream_info
};
void wined3d_stream_info_from_declaration(struct wined3d_stream_info *stream_info,
- const struct wined3d_state *state, const struct wined3d_d3d_info *d3d_info) DECLSPEC_HIDDEN;
+ const struct wined3d_state *state, const struct wined3d_d3d_info *d3d_info,
+ bool require_buffer) DECLSPEC_HIDDEN;
struct wined3d_direct_dispatch_parameters
{
--
2.31.0
2
3
Signed-off-by: Paul Gofman <pgofman(a)codeweavers.com>
---
Used by Forza Horizon 4.
.../api-ms-win-core-memory-l1-1-3.spec | 2 +-
dlls/kernel32/tests/virtual.c | 39 ++++++++++++++++++-
dlls/kernelbase/kernelbase.spec | 2 +-
dlls/kernelbase/memory.c | 22 +++++++++++
include/winbase.h | 1 +
5 files changed, 63 insertions(+), 3 deletions(-)
diff --git a/dlls/api-ms-win-core-memory-l1-1-3/api-ms-win-core-memory-l1-1-3.spec b/dlls/api-ms-win-core-memory-l1-1-3/api-ms-win-core-memory-l1-1-3.spec
index b0d402b24c7..5b143ec1af3 100644
--- a/dlls/api-ms-win-core-memory-l1-1-3/api-ms-win-core-memory-l1-1-3.spec
+++ b/dlls/api-ms-win-core-memory-l1-1-3/api-ms-win-core-memory-l1-1-3.spec
@@ -19,7 +19,7 @@
@ stdcall UnmapViewOfFile(ptr) kernel32.UnmapViewOfFile
@ stub UnmapViewOfFileEx
@ stdcall VirtualAlloc(ptr long long long) kernel32.VirtualAlloc
-@ stub VirtualAllocFromApp
+@ stdcall VirtualAllocFromApp(ptr long long long) kernelbase.VirtualAllocFromApp
@ stdcall VirtualFree(ptr long long) kernel32.VirtualFree
@ stdcall VirtualFreeEx(long ptr long long) kernel32.VirtualFreeEx
@ stdcall VirtualLock(ptr long) kernel32.VirtualLock
diff --git a/dlls/kernel32/tests/virtual.c b/dlls/kernel32/tests/virtual.c
index e6d9e8621a9..4abaa5befd1 100644
--- a/dlls/kernel32/tests/virtual.c
+++ b/dlls/kernel32/tests/virtual.c
@@ -35,7 +35,7 @@
#define NUM_THREADS 4
#define MAPPING_SIZE 0x100000
-static HINSTANCE hkernel32, hntdll;
+static HINSTANCE hkernel32, hkernelbase, hntdll;
static SYSTEM_INFO si;
static UINT (WINAPI *pGetWriteWatch)(DWORD,LPVOID,SIZE_T,LPVOID*,ULONG_PTR*,ULONG*);
static UINT (WINAPI *pResetWriteWatch)(LPVOID,SIZE_T);
@@ -50,6 +50,7 @@ static ULONG (WINAPI *pRtlRemoveVectoredExceptionHandler)(PVOID);
static BOOL (WINAPI *pGetProcessDEPPolicy)(HANDLE, LPDWORD, PBOOL);
static BOOL (WINAPI *pIsWow64Process)(HANDLE, PBOOL);
static NTSTATUS (WINAPI *pNtProtectVirtualMemory)(HANDLE, PVOID *, SIZE_T *, ULONG, ULONG *);
+static PVOID (WINAPI *pVirtualAllocFromApp)(PVOID, SIZE_T, DWORD, DWORD);
/* ############################### */
@@ -443,6 +444,39 @@ static void test_VirtualAlloc(void)
ok(VirtualFree(addr1, 0, MEM_RELEASE), "VirtualFree failed\n");
}
+static void test_VirtualAllocFromApp(void)
+{
+ void *p;
+ BOOL ret;
+ if (!pVirtualAllocFromApp)
+ {
+ win_skip("VirtualAllocFromApp is not available.\n");
+ return;
+ }
+
+ p = GetProcAddress(hkernel32, "VirtualAllocFromApp");
+ ok(!p, "Found VirtualAllocFromApp in kernel32.dll.\n");
+
+ SetLastError(0xdeadbeef);
+ p = pVirtualAllocFromApp(NULL, 0x1000, MEM_RESERVE, PAGE_READWRITE);
+ ok(p && GetLastError() == 0xdeadbeef, "Got unexpected mem %p, GetLastError() %u.\n", p, GetLastError());
+ ret = VirtualFree(p, 0, MEM_RELEASE);
+ ok(ret, "Got unexpected ret %#x, GetLastError() %u.\n", ret, GetLastError());
+
+ SetLastError(0xdeadbeef);
+ p = pVirtualAllocFromApp(NULL, 0x1000, MEM_RESERVE, PAGE_EXECUTE);
+ ok(!p && GetLastError() == ERROR_INVALID_PARAMETER, "Got unexpected mem %p, GetLastError() %u.\n",
+ p, GetLastError());
+ SetLastError(0xdeadbeef);
+ p = pVirtualAllocFromApp(NULL, 0x1000, MEM_RESERVE, PAGE_EXECUTE_READ);
+ ok(!p && GetLastError() == ERROR_INVALID_PARAMETER, "Got unexpected mem %p, GetLastError() %u.\n",
+ p, GetLastError());
+ SetLastError(0xdeadbeef);
+ p = pVirtualAllocFromApp(NULL, 0x1000, MEM_RESERVE, PAGE_EXECUTE_READWRITE);
+ ok(!p && GetLastError() == ERROR_INVALID_PARAMETER, "Got unexpected mem %p, GetLastError() %u.\n",
+ p, GetLastError());
+}
+
static void test_MapViewOfFile(void)
{
static const char testfile[] = "testfile.xxx";
@@ -4238,6 +4272,7 @@ START_TEST(virtual)
}
hkernel32 = GetModuleHandleA("kernel32.dll");
+ hkernelbase = GetModuleHandleA("kernelbase.dll");
hntdll = GetModuleHandleA("ntdll.dll");
pGetWriteWatch = (void *) GetProcAddress(hkernel32, "GetWriteWatch");
@@ -4252,6 +4287,7 @@ START_TEST(virtual)
pRtlAddVectoredExceptionHandler = (void *)GetProcAddress( hntdll, "RtlAddVectoredExceptionHandler" );
pRtlRemoveVectoredExceptionHandler = (void *)GetProcAddress( hntdll, "RtlRemoveVectoredExceptionHandler" );
pNtProtectVirtualMemory = (void *)GetProcAddress( hntdll, "NtProtectVirtualMemory" );
+ pVirtualAllocFromApp = (void *)GetProcAddress( hkernelbase, "VirtualAllocFromApp" );
GetSystemInfo(&si);
trace("system page size %#x\n", si.dwPageSize);
@@ -4266,6 +4302,7 @@ START_TEST(virtual)
test_VirtualProtect();
test_VirtualAllocEx();
test_VirtualAlloc();
+ test_VirtualAllocFromApp();
test_MapViewOfFile();
test_NtAreMappedFilesTheSame();
test_CreateFileMapping();
diff --git a/dlls/kernelbase/kernelbase.spec b/dlls/kernelbase/kernelbase.spec
index 615b928bd22..28cfd842223 100644
--- a/dlls/kernelbase/kernelbase.spec
+++ b/dlls/kernelbase/kernelbase.spec
@@ -1678,7 +1678,7 @@
@ stdcall VirtualAlloc(ptr long long long)
@ stdcall VirtualAllocEx(long ptr long long long)
@ stdcall VirtualAllocExNuma(long ptr long long long long)
-# @ stub VirtualAllocFromApp
+@ stdcall VirtualAllocFromApp(ptr long long long)
@ stdcall VirtualFree(ptr long long)
@ stdcall VirtualFreeEx(long ptr long long)
@ stdcall VirtualLock(ptr long)
diff --git a/dlls/kernelbase/memory.c b/dlls/kernelbase/memory.c
index 60333db242f..4b71c0cc6ec 100644
--- a/dlls/kernelbase/memory.c
+++ b/dlls/kernelbase/memory.c
@@ -314,6 +314,28 @@ LPVOID WINAPI DECLSPEC_HOTPATCH VirtualAlloc2( HANDLE process, void *addr, SIZE_
}
+/***********************************************************************
+ * VirtualAllocFromApp (kernelbase.@)
+ */
+LPVOID WINAPI DECLSPEC_HOTPATCH VirtualAllocFromApp( void *addr, SIZE_T size,
+ DWORD type, DWORD protect )
+{
+ LPVOID ret = addr;
+
+ TRACE_(virtual)( "addr %p, size %p, type %#x, protect %#x.\n", addr, (void *)size, type, protect );
+
+ if (protect == PAGE_EXECUTE || protect == PAGE_EXECUTE_READ || protect == PAGE_EXECUTE_READWRITE
+ || protect == PAGE_EXECUTE_WRITECOPY)
+ {
+ SetLastError( ERROR_INVALID_PARAMETER );
+ return NULL;
+ }
+
+ if (!set_ntstatus( NtAllocateVirtualMemory( GetCurrentProcess(), &ret, 0, &size, type, protect ))) return NULL;
+ return ret;
+}
+
+
/***********************************************************************
* VirtualFree (kernelbase.@)
*/
diff --git a/include/winbase.h b/include/winbase.h
index beb91371bb6..11a92fa84d9 100644
--- a/include/winbase.h
+++ b/include/winbase.h
@@ -2748,6 +2748,7 @@ WINBASEAPI LPVOID WINAPI VirtualAlloc(LPVOID,SIZE_T,DWORD,DWORD);
WINBASEAPI LPVOID WINAPI VirtualAlloc2(HANDLE,LPVOID,SIZE_T,DWORD,DWORD,MEM_EXTENDED_PARAMETER*,ULONG);
WINBASEAPI LPVOID WINAPI VirtualAllocEx(HANDLE,LPVOID,SIZE_T,DWORD,DWORD);
WINBASEAPI LPVOID WINAPI VirtualAllocExNuma(HANDLE,void*,SIZE_T,DWORD,DWORD,DWORD);
+WINBASEAPI LPVOID WINAPI VirtualAllocFromApp(LPVOID,SIZE_T,DWORD,DWORD);
WINBASEAPI BOOL WINAPI VirtualFree(LPVOID,SIZE_T,DWORD);
WINBASEAPI BOOL WINAPI VirtualFreeEx(HANDLE,LPVOID,SIZE_T,DWORD);
WINBASEAPI BOOL WINAPI VirtualLock(LPVOID,SIZE_T);
--
2.30.2
1
0
Signed-off-by: Jacek Caban <jacek(a)codeweavers.com>
---
dlls/winevulkan/loader.c | 67 ++++++++++++++++++++++++++++++++
dlls/winevulkan/vulkan.c | 53 +++----------------------
dlls/winevulkan/vulkan_private.h | 8 ++++
3 files changed, 81 insertions(+), 47 deletions(-)
1
0