Wine-Devel
By message
wine-devel@list.winehq.org
By month
Threads by month
- ----- 2026 -----
- September
- August
- July
- June
- May
- 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
February 2022
- 87 participants
- 926 discussions
[PATCH 1/4] user32/tests: Add some optional messages to WmRestoreMinimizedSeq
by Alex Henrie Feb. 21, 2022
by Alex Henrie Feb. 21, 2022
Feb. 21, 2022
Fixes a testbot failure.
Signed-off-by: Alex Henrie <alexhenrie24(a)gmail.com>
---
dlls/user32/tests/msg.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/dlls/user32/tests/msg.c b/dlls/user32/tests/msg.c
index f0e0d0fba76..001a69fc0a1 100644
--- a/dlls/user32/tests/msg.c
+++ b/dlls/user32/tests/msg.c
@@ -18619,7 +18619,11 @@ static const struct message WmRestoreMinimizedSeq[] =
{ WM_WINDOWPOSCHANGED, sent|wparam|defwinproc, SWP_FRAMECHANGED|SWP_NOCOPYBITS|SWP_STATECHANGED },
{ WM_MOVE, sent|defwinproc },
{ WM_SIZE, sent|defwinproc },
+ { WM_NCCALCSIZE, sent|wparam|defwinproc|optional, 1 }, /* 32-bit Vista sends it */
+ { WM_NCPAINT, sent|wparam|defwinproc|optional, 1 }, /* 32-bit Vista sends it */
+ { WM_ERASEBKGND, sent|defwinproc|optional }, /* 32-bit Vista sends it */
{ EVENT_OBJECT_LOCATIONCHANGE, winevent_hook|wparam|lparam|winevent_hook_todo, 0, 0 },
+ { EVENT_OBJECT_LOCATIONCHANGE, winevent_hook|wparam|lparam|optional, 0, 0 }, /* 32-bit Vista sends it */
{ EVENT_SYSTEM_MINIMIZEEND, winevent_hook|wparam|lparam|winevent_hook_todo, 0, 0 },
{ WM_NCCALCSIZE, sent|wparam|defwinproc|optional, 1 },
{ WM_NCPAINT, sent|wparam|defwinproc|optional, 1 },
--
2.35.1
2
4
Feb. 20, 2022
Signed-off-by: Dmitry Timoshkov <dmitry(a)baikal.ru>
---
dlls/comctl32/tests/listview.c | 182 ++++++++++++++++++++++++++++++---
1 file changed, 169 insertions(+), 13 deletions(-)
diff --git a/dlls/comctl32/tests/listview.c b/dlls/comctl32/tests/listview.c
index bc89e8938be..4c2dd534dbd 100644
--- a/dlls/comctl32/tests/listview.c
+++ b/dlls/comctl32/tests/listview.c
@@ -413,15 +413,6 @@ static const struct message listview_header_set_imagelist[] = {
{ 0 }
};
-static const struct message parent_insert_focused_seq[] = {
- { WM_NOTIFY, sent|id, 0, 0, LVN_ITEMCHANGING },
- { WM_NOTIFY, sent|id, 0, 0, LVN_ITEMCHANGING },
- { WM_NOTIFY, sent|id, 0, 0, LVN_ITEMCHANGED },
- { WM_NOTIFY, sent|id, 0, 0, LVN_ITEMCHANGED },
- { WM_NOTIFY, sent|id, 0, 0, LVN_INSERTITEM },
- { 0 }
-};
-
static const struct message parent_report_cd_seq[] = {
{ WM_NOTIFY, sent|id|custdraw, 0, 0, NM_CUSTOMDRAW, CDDS_PREPAINT },
{ WM_NOTIFY, sent|id|custdraw, 0, 0, NM_CUSTOMDRAW, CDDS_ITEMPREPAINT },
@@ -5920,6 +5911,136 @@ static void test_deleteitem(void)
DestroyWindow(hwnd);
}
+static const struct message parent_insert_focused0_seq[] = {
+ { WM_NOTIFY, sent|id|wparam|lparam, 0, LVIF_STATE, LVN_ITEMCHANGING },
+ { WM_NOTIFY, sent|id|wparam|lparam, 0, LVIF_STATE, LVN_ITEMCHANGED },
+ { WM_NOTIFY, sent|id, 0, 0, LVN_INSERTITEM },
+ { 0 }
+};
+
+static const struct message parent_insert_focused1_seq[] = {
+ { WM_NOTIFY, sent|id|wparam|lparam, 1, LVIF_STATE, LVN_ITEMCHANGING },
+ { WM_NOTIFY, sent|id|wparam|lparam, 0, LVIF_STATE, LVN_ITEMCHANGING },
+ { WM_NOTIFY, sent|id|wparam|lparam, 0, LVIF_STATE, LVN_ITEMCHANGED },
+ { WM_NOTIFY, sent|id|wparam|lparam, 1, LVIF_STATE, LVN_ITEMCHANGED },
+ { WM_NOTIFY, sent|id, 0, 0, LVN_INSERTITEM },
+ { 0 }
+};
+
+static const struct message parent_insert_item_seq[] = {
+ { WM_NOTIFY, sent|id, 0, 0, LVN_INSERTITEM },
+ { 0 }
+};
+
+static const struct message parent_insert_selected_seq[] = {
+ { WM_NOTIFY, sent|id|wparam|lparam, 3, LVIF_STATE, LVN_ITEMCHANGING },
+ { WM_NOTIFY, sent|id|wparam|lparam, 3, LVIF_STATE, LVN_ITEMCHANGED },
+ { WM_NOTIFY, sent|id, 0, 0, LVN_INSERTITEM },
+ { 0 }
+};
+
+#define LVIS_ALL (LVIS_FOCUSED | LVIS_SELECTED | LVIS_CUT | LVIS_DROPHILITED | LVIS_ACTIVATING)
+
+static void test_LVM_INSERTITEM(void)
+{
+ static const struct
+ {
+ UINT mask, state, stateMask;
+ } insert_item[] =
+ {
+ { LVIF_STATE, LVIS_FOCUSED, LVIS_FOCUSED },
+ { LVIF_STATE, LVIS_FOCUSED, 0 },
+ { LVIF_STATE, 0, LVIS_FOCUSED },
+
+ { LVIF_STATE, LVIS_SELECTED, LVIS_SELECTED },
+ { LVIF_STATE, LVIS_SELECTED, 0 },
+ { LVIF_STATE, 0, LVIS_SELECTED },
+
+ { LVIF_STATE, LVIS_FOCUSED | LVIS_SELECTED, LVIS_FOCUSED | LVIS_SELECTED },
+ { LVIF_STATE, LVIS_FOCUSED | LVIS_SELECTED, 0 },
+ { LVIF_STATE, 0, LVIS_FOCUSED | LVIS_SELECTED },
+
+ { LVIF_STATE, LVIS_FOCUSED, LVIS_ALL },
+ { LVIF_STATE, LVIS_SELECTED, LVIS_ALL },
+ { LVIF_STATE, LVIS_CUT, LVIS_ALL },
+ { LVIF_STATE, LVIS_DROPHILITED, LVIS_ALL },
+ { LVIF_STATE, LVIS_ACTIVATING, LVIS_ALL },
+
+ { LVIF_STATE, LVIS_ALL, LVIS_ALL },
+ { LVIF_STATE, LVIS_ALL, 0 },
+ { LVIF_STATE, 0, LVIS_ALL },
+
+ { LVIF_STATE | LVIF_PARAM, 0, 0 },
+ { LVIF_STATE | LVIF_PARAM, LVIS_FOCUSED, LVIS_FOCUSED },
+ { LVIF_STATE | LVIF_PARAM, LVIS_FOCUSED, 0 },
+ { LVIF_STATE | LVIF_PARAM, 0, LVIS_FOCUSED },
+
+ { LVIF_STATE | LVIF_PARAM, LVIS_SELECTED, LVIS_SELECTED },
+ { LVIF_STATE | LVIF_PARAM, LVIS_SELECTED, 0 },
+ { LVIF_STATE | LVIF_PARAM, 0, LVIS_SELECTED },
+
+ { LVIF_STATE, 0, 0 },
+ { LVIF_PARAM, 0, 0 },
+
+ { LVIF_PARAM | LVIF_TEXT | LVIF_IMAGE, 0, 0 },
+ { LVIF_PARAM | LVIF_TEXT | LVIF_IMAGE, LVIS_FOCUSED, LVIS_FOCUSED },
+ { LVIF_PARAM | LVIF_TEXT | LVIF_IMAGE, LVIS_FOCUSED, 0 },
+ { LVIF_PARAM | LVIF_TEXT | LVIF_IMAGE, 0, LVIS_FOCUSED },
+
+ { LVIF_STATE | LVIF_PARAM | LVIF_TEXT | LVIF_IMAGE, 0, 0 },
+ { LVIF_STATE | LVIF_PARAM | LVIF_TEXT | LVIF_IMAGE, LVIS_FOCUSED, LVIS_FOCUSED },
+ { LVIF_STATE | LVIF_PARAM | LVIF_TEXT | LVIF_IMAGE, LVIS_FOCUSED, 0 },
+ { LVIF_STATE | LVIF_PARAM | LVIF_TEXT | LVIF_IMAGE, 0, LVIS_FOCUSED },
+
+ { LVIF_STATE | LVIF_PARAM | LVIF_TEXT | LVIF_IMAGE, 0, 0 },
+ { LVIF_STATE | LVIF_PARAM | LVIF_TEXT | LVIF_IMAGE, LVIS_ALL, LVIS_ALL },
+ { LVIF_STATE | LVIF_PARAM | LVIF_TEXT | LVIF_IMAGE, LVIS_ALL, 0 },
+ { LVIF_STATE | LVIF_PARAM | LVIF_TEXT | LVIF_IMAGE, 0, LVIS_ALL },
+ };
+ LVITEMA item;
+ UINT state;
+ HWND hwnd;
+ INT ret, i;
+ char buf[256];
+
+ for (i = 0; i < ARRAYSIZE(insert_item); i++)
+ {
+ hwnd = create_listview_control(LVS_REPORT);
+
+ flush_sequences(sequences, NUM_MSG_SEQUENCES);
+
+ item.mask = insert_item[i].mask;
+ item.state = insert_item[i].state;
+ item.stateMask = insert_item[i].stateMask;
+ item.pszText = (LPSTR)"Hello World!";
+ item.iImage = I_IMAGECALLBACK;
+ item.iItem = 0;
+ item.iSubItem = 0;
+ item.lParam = 0xdeadbeef;
+ ret = SendMessageA(hwnd, LVM_INSERTITEMA, 0, (LPARAM)&item);
+ ok(ret == 0, "%d: got %d\n", i, ret);
+
+ if ((insert_item[i].mask & LVIF_STATE) && (insert_item[i].state & (LVIS_FOCUSED | LVIS_SELECTED)))
+ {
+ sprintf(buf, "%d: insert focused", i);
+ ok_sequence(sequences, PARENT_SEQ_INDEX, parent_insert_focused0_seq, buf, TRUE);
+ }
+ else
+ {
+ sprintf(buf, "%d: insert item", i);
+ ok_sequence(sequences, PARENT_SEQ_INDEX, parent_insert_item_seq, buf, FALSE);
+ }
+
+ state = SendMessageA(hwnd, LVM_GETITEMSTATE, 0, LVIS_ALL);
+ if ((insert_item[i].mask & LVIF_STATE) && insert_item[i].state)
+ ok(state == insert_item[i].state, "%d: expected %#x, got %#x\n", i, insert_item[i].state, state);
+ else
+ ok(state == 0, "%d: expected 0, got %#x\n", i, state);
+
+ DestroyWindow(hwnd);
+ }
+}
+
static void test_insertitem(void)
{
LVITEMA item;
@@ -5929,6 +6050,8 @@ static void test_insertitem(void)
hwnd = create_listview_control(LVS_REPORT);
+ flush_sequences(sequences, NUM_MSG_SEQUENCES);
+
/* insert item 0 focused */
item.mask = LVIF_STATE;
item.state = LVIS_FOCUSED;
@@ -5937,12 +6060,11 @@ static void test_insertitem(void)
item.iSubItem = 0;
ret = SendMessageA(hwnd, LVM_INSERTITEMA, 0, (LPARAM)&item);
ok(ret == 0, "got %d\n", ret);
+ ok_sequence(sequences, PARENT_SEQ_INDEX, parent_insert_focused0_seq, "insert focused 0", TRUE);
state = SendMessageA(hwnd, LVM_GETITEMSTATE, 0, LVIS_FOCUSED);
ok(state == LVIS_FOCUSED, "got %x\n", state);
- flush_sequences(sequences, NUM_MSG_SEQUENCES);
-
/* insert item 1, focus shift */
item.mask = LVIF_STATE;
item.state = LVIS_FOCUSED;
@@ -5951,8 +6073,7 @@ static void test_insertitem(void)
item.iSubItem = 0;
ret = SendMessageA(hwnd, LVM_INSERTITEMA, 0, (LPARAM)&item);
ok(ret == 1, "got %d\n", ret);
-
- ok_sequence(sequences, PARENT_SEQ_INDEX, parent_insert_focused_seq, "insert focused", TRUE);
+ ok_sequence(sequences, PARENT_SEQ_INDEX, parent_insert_focused1_seq, "insert focused 1", TRUE);
state = SendMessageA(hwnd, LVM_GETITEMSTATE, 1, LVIS_FOCUSED);
ok(state == LVIS_FOCUSED, "got %x\n", state);
@@ -5965,10 +6086,44 @@ static void test_insertitem(void)
item.iSubItem = 0;
ret = SendMessageA(hwnd, LVM_INSERTITEMA, 0, (LPARAM)&item);
ok(ret == 2, "got %d\n", ret);
+ ok_sequence(sequences, PARENT_SEQ_INDEX, parent_insert_item_seq, "insert focused 2", FALSE);
state = SendMessageA(hwnd, LVM_GETITEMSTATE, 1, LVIS_FOCUSED);
ok(state == LVIS_FOCUSED, "got %x\n", state);
+ /* insert item 3 */
+ item.mask = LVIF_STATE | LVIF_PARAM;
+ item.state = LVIS_SELECTED;
+ item.stateMask = LVIS_SELECTED;
+ item.iItem = 3;
+ item.iSubItem = 0;
+ item.lParam = 0xdeadbeef;
+ ret = SendMessageA(hwnd, LVM_INSERTITEMA, 0, (LPARAM)&item);
+ ok(ret == 3, "got %d\n", ret);
+ ok_sequence(sequences, PARENT_SEQ_INDEX, parent_insert_selected_seq, "insert selected", TRUE);
+
+ /* insert item 4 */
+ item.mask = LVIF_PARAM;
+ item.state = 0;
+ item.stateMask = 0;
+ item.iItem = 4;
+ item.iSubItem = 0;
+ item.lParam = 0xdeadbeef;
+ ret = SendMessageA(hwnd, LVM_INSERTITEMA, 0, (LPARAM)&item);
+ ok(ret == 4, "got %d\n", ret);
+ ok_sequence(sequences, PARENT_SEQ_INDEX, parent_insert_item_seq, "insert param", FALSE);
+
+ /* insert item 5 */
+ item.mask = LVIF_STATE;
+ item.state = 0;
+ item.stateMask = 0;
+ item.iItem = 5;
+ item.iSubItem = 0;
+ item.lParam = 0xdeadbeef;
+ ret = SendMessageA(hwnd, LVM_INSERTITEMA, 0, (LPARAM)&item);
+ ok(ret == 5, "got %d\n", ret);
+ ok_sequence(sequences, PARENT_SEQ_INDEX, parent_insert_item_seq, "insert state", FALSE);
+
DestroyWindow(hwnd);
}
@@ -6718,6 +6873,7 @@ START_TEST(listview)
test_imagelists();
test_deleteitem();
test_insertitem();
+ test_LVM_INSERTITEM();
test_header_proc();
test_oneclickactivate();
test_callback_mask();
--
2.35.1
2
1
[PATCH v3 2/5] comctl32/tests: Add iItem and uChanged to LVN_ITEMCHANGING/LVN_ITEMCHANGED context.
by Dmitry Timoshkov Feb. 20, 2022
by Dmitry Timoshkov Feb. 20, 2022
Feb. 20, 2022
Signed-off-by: Dmitry Timoshkov <dmitry(a)baikal.ru>
---
dlls/comctl32/tests/listview.c | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/dlls/comctl32/tests/listview.c b/dlls/comctl32/tests/listview.c
index 5485cd4b4e2..bc89e8938be 100644
--- a/dlls/comctl32/tests/listview.c
+++ b/dlls/comctl32/tests/listview.c
@@ -472,7 +472,17 @@ static LRESULT WINAPI parent_wnd_proc(HWND hwnd, UINT message, WPARAM wParam, LP
if (defwndproc_counter) msg.flags |= defwinproc;
msg.wParam = wParam;
msg.lParam = lParam;
- if (message == WM_NOTIFY && lParam) msg.id = ((NMHDR*)lParam)->code;
+ if (message == WM_NOTIFY && lParam)
+ {
+ NMLISTVIEW *nmlv = (NMLISTVIEW *)lParam;
+
+ msg.id = nmlv->hdr.code;
+ if (msg.id == LVN_ITEMCHANGING || msg.id == LVN_ITEMCHANGED)
+ {
+ msg.wParam = nmlv->iItem;
+ msg.lParam = nmlv->uChanged;
+ }
+ }
if (message == WM_COMMAND) msg.id = HIWORD(wParam);
/* log system messages, except for painting */
--
2.35.1
2
1
Feb. 20, 2022
All the notification codes (printed as an id) have negative base value
(SBN_, UDN_, HDN_, BCN_, TBN_, TTN_, RBN_, TRBN_, PGN_, TVN_, LVN_, TCN_,
CBEN_, IPN_, MCN_, DTN_), and printing them as decimal helps to quickly
identify the corresponding notification value in cases when an id in
the message sequence doesn't match. Custom ids in the message sequences
have small numbers (0, 1, 2, ...), so they also get printed correctly.
Signed-off-by: Dmitry Timoshkov <dmitry(a)baikal.ru>
---
dlls/comctl32/tests/msg.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/dlls/comctl32/tests/msg.h b/dlls/comctl32/tests/msg.h
index 7337c724a5c..8ba2efddb0a 100644
--- a/dlls/comctl32/tests/msg.h
+++ b/dlls/comctl32/tests/msg.h
@@ -261,14 +261,14 @@ static void ok_sequence_(struct msg_sequence **seq, int sequence_index,
failcount++;
dump++;
ok_(file, line) (FALSE,
- "%s: in msg 0x%04x expecting id 0x%x got 0x%x\n",
+ "%s: in msg 0x%04x expecting id %d got %d\n",
context, expected->message, expected->id, actual->id);
}
}
else
{
ok_(file, line) (expected->id == actual->id,
- "%s: in msg 0x%04x expecting id 0x%x got 0x%x\n",
+ "%s: in msg 0x%04x expecting id %d got %d\n",
context, expected->message, expected->id, actual->id);
if (expected->id != actual->id) dump++;
}
--
2.35.1
3
2
Feb. 20, 2022
Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com>
---
dlls/t2embed/tests/Makefile.in | 1 -
dlls/t2embed/tests/t2embed.c | 54 ++++++++++++++++++----------------
2 files changed, 28 insertions(+), 27 deletions(-)
diff --git a/dlls/t2embed/tests/Makefile.in b/dlls/t2embed/tests/Makefile.in
index 69d91384869..c4f49a3f6ca 100644
--- a/dlls/t2embed/tests/Makefile.in
+++ b/dlls/t2embed/tests/Makefile.in
@@ -1,4 +1,3 @@
-EXTRADEFS = -DWINE_NO_LONG_TYPES
TESTDLL = t2embed.dll
IMPORTS = user32 gdi32 t2embed
diff --git a/dlls/t2embed/tests/t2embed.c b/dlls/t2embed/tests/t2embed.c
index 4ffc3daed12..004ba5492ae 100644
--- a/dlls/t2embed/tests/t2embed.c
+++ b/dlls/t2embed/tests/t2embed.c
@@ -43,7 +43,7 @@ static int CALLBACK enum_font_proc(ENUMLOGFONTEXA *enumlf, NEWTEXTMETRICEXA *ntm
UINT fsType = otm.otmfsType & 0xf;
ret = TTGetEmbeddingType(hdc, &status);
- ok(ret == E_NONE || ret == E_NOTATRUETYPEFONT, "Unexpected return value %#x.\n", ret);
+ ok(ret == E_NONE || ret == E_NOTATRUETYPEFONT, "Unexpected return value %#lx.\n", ret);
if (ret == E_NONE)
{
@@ -56,7 +56,7 @@ static int CALLBACK enum_font_proc(ENUMLOGFONTEXA *enumlf, NEWTEXTMETRICEXA *ntm
else if (fsType & LICENSE_NOEMBEDDING)
expected = EMBED_NOEMBEDDING;
- ok(expected == status, "%s: status %d, expected %d, fsType %#x\n", enumlf->elfLogFont.lfFaceName, status,
+ ok(expected == status, "%s: status %ld, expected %ld, fsType %#x\n", enumlf->elfLogFont.lfFaceName, status,
expected, otm.otmfsType);
}
}
@@ -64,8 +64,8 @@ static int CALLBACK enum_font_proc(ENUMLOGFONTEXA *enumlf, NEWTEXTMETRICEXA *ntm
{
status = 0xdeadbeef;
ret = TTGetEmbeddingType(hdc, &status);
- ok(ret == E_NOTATRUETYPEFONT, "%s: got %d\n", enumlf->elfLogFont.lfFaceName, ret);
- ok(status == 0xdeadbeef, "%s: got status %d\n", enumlf->elfLogFont.lfFaceName, status);
+ ok(ret == E_NOTATRUETYPEFONT, "%s: got %ld.\n", enumlf->elfLogFont.lfFaceName, ret);
+ ok(status == 0xdeadbeef, "%s: got status %#lx.\n", enumlf->elfLogFont.lfFaceName, status);
}
SelectObject(hdc, old_font);
@@ -84,27 +84,28 @@ static void test_TTGetEmbeddingType(void)
HDC hdc;
ret = TTGetEmbeddingType(NULL, NULL);
- ok(ret == E_HDCINVALID, "got %d\n", ret);
+ ok(ret == E_HDCINVALID, "Unexpected retval %#lx.\n", ret);
status = 0xdeadbeef;
ret = TTGetEmbeddingType(NULL, &status);
- ok(ret == E_HDCINVALID, "got %#x\n", ret);
- ok(status == 0xdeadbeef, "got %u\n", status);
+ ok(ret == E_HDCINVALID, "Unexpected retval %#lx.\n", ret);
+ ok(status == 0xdeadbeef, "Unexpected status %#lx.\n", status);
status = 0xdeadbeef;
ret = TTGetEmbeddingType((HDC)0xdeadbeef, &status);
- ok(ret == E_NOTATRUETYPEFONT || broken(ret == E_ERRORACCESSINGFONTDATA) /* xp, vista */, "got %#x\n", ret);
- ok(status == 0xdeadbeef, "got %u\n", status);
+ ok(ret == E_NOTATRUETYPEFONT || broken(ret == E_ERRORACCESSINGFONTDATA) /* xp, vista */,
+ "Unexpected retval %#lx.\n", ret);
+ ok(status == 0xdeadbeef, "Unexpected status %#lx.\n", status);
hdc = CreateCompatibleDC(0);
ret = TTGetEmbeddingType(hdc, NULL);
- ok(ret == E_NOTATRUETYPEFONT, "got %#x\n", ret);
+ ok(ret == E_NOTATRUETYPEFONT, "Unexpected retval %#lx.\n", ret);
status = 0xdeadbeef;
ret = TTGetEmbeddingType(hdc, &status);
- ok(ret == E_NOTATRUETYPEFONT, "got %#x\n", ret);
- ok(status == 0xdeadbeef, "got %u\n", status);
+ ok(ret == E_NOTATRUETYPEFONT, "Unexpected retval %#lx.\n", ret);
+ ok(status == 0xdeadbeef, "Unexpected status %#lx.\n", status);
memset(&logfont, 0, sizeof(logfont));
logfont.lfHeight = 12;
@@ -117,11 +118,11 @@ static void test_TTGetEmbeddingType(void)
status = 0;
ret = TTGetEmbeddingType(hdc, &status);
- ok(ret == E_NONE, "got %#x\n", ret);
- ok(status != 0, "got %u\n", status);
+ ok(ret == E_NONE, "Unexpected retval %#lx.\n", ret);
+ ok(status != 0, "Unexpected status %lu.\n", status);
ret = TTGetEmbeddingType(hdc, NULL);
- ok(ret == E_PERMISSIONSINVALID, "got %#x\n", ret);
+ ok(ret == E_PERMISSIONSINVALID, "Unexpected retval %#lx.\n", ret);
SelectObject(hdc, old_font);
DeleteObject(hfont);
@@ -140,36 +141,37 @@ static void test_TTIsEmbeddingEnabledForFacename(void)
LONG ret;
ret = TTIsEmbeddingEnabledForFacename(NULL, NULL);
- ok(ret == E_FACENAMEINVALID, "got %#x\n", ret);
+ ok(ret == E_FACENAMEINVALID, "Unexpected retval %#lx.\n", ret);
status = 123;
ret = TTIsEmbeddingEnabledForFacename(NULL, &status);
- ok(ret == E_FACENAMEINVALID, "got %#x\n", ret);
+ ok(ret == E_FACENAMEINVALID, "Unexpected retval %#lx.\n", ret);
ok(status == 123, "got %d\n", status);
ret = TTIsEmbeddingEnabledForFacename("Arial", NULL);
- ok(ret == E_PBENABLEDINVALID, "got %#x\n", ret);
+ ok(ret == E_PBENABLEDINVALID, "Unexpected retval %#lx.\n", ret);
status = 123;
ret = TTIsEmbeddingEnabledForFacename("Arial", &status);
- ok(ret == E_NONE, "got %#x\n", ret);
+ ok(ret == E_NONE, "Unexpected retval %#lx.\n", ret);
ok(status != 123, "got %d\n", status);
}
static void test_TTIsEmbeddingEnabled(void)
{
HFONT old_font, hfont;
- LONG ret, status;
LOGFONTA logfont;
+ BOOL status;
+ LONG ret;
HDC hdc;
ret = TTIsEmbeddingEnabled(NULL, NULL);
- ok(ret == E_HDCINVALID, "got %#x\n", ret);
+ ok(ret == E_HDCINVALID, "Unexpected retval %#lx.\n", ret);
status = 123;
ret = TTIsEmbeddingEnabled(NULL, &status);
- ok(ret == E_HDCINVALID, "got %#x\n", ret);
- ok(status == 123, "got %d\n", status);
+ ok(ret == E_HDCINVALID, "Unexpected retval %#lx.\n", ret);
+ ok(status == 123, "Unexpected status %d.\n", status);
hdc = CreateCompatibleDC(0);
@@ -183,12 +185,12 @@ static void test_TTIsEmbeddingEnabled(void)
old_font = SelectObject(hdc, hfont);
ret = TTIsEmbeddingEnabled(hdc, NULL);
- ok(ret == E_PBENABLEDINVALID, "Unexpected return value %#x.\n", ret);
+ ok(ret == E_PBENABLEDINVALID, "Unexpected retval %#lx.\n", ret);
status = 123;
ret = TTIsEmbeddingEnabled(hdc, &status);
- ok(ret == E_NONE, "got %#x\n", ret);
- ok(status != 123, "got %u\n", status);
+ ok(ret == E_NONE, "Unexpected retval %#lx.\n", ret);
+ ok(status != 123, "Unexpected status %d.\n", status);
SelectObject(hdc, old_font);
DeleteObject(hfont);
--
2.34.1
2
1
Feb. 20, 2022
Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com>
---
dlls/t2embed/tests/Makefile.in | 1 -
dlls/t2embed/tests/t2embed.c | 54 ++++++++++++++++++----------------
2 files changed, 28 insertions(+), 27 deletions(-)
diff --git a/dlls/t2embed/tests/Makefile.in b/dlls/t2embed/tests/Makefile.in
index 69d91384869..c4f49a3f6ca 100644
--- a/dlls/t2embed/tests/Makefile.in
+++ b/dlls/t2embed/tests/Makefile.in
@@ -1,4 +1,3 @@
-EXTRADEFS = -DWINE_NO_LONG_TYPES
TESTDLL = t2embed.dll
IMPORTS = user32 gdi32 t2embed
diff --git a/dlls/t2embed/tests/t2embed.c b/dlls/t2embed/tests/t2embed.c
index 4ffc3daed12..130b17cd2c3 100644
--- a/dlls/t2embed/tests/t2embed.c
+++ b/dlls/t2embed/tests/t2embed.c
@@ -43,7 +43,7 @@ static int CALLBACK enum_font_proc(ENUMLOGFONTEXA *enumlf, NEWTEXTMETRICEXA *ntm
UINT fsType = otm.otmfsType & 0xf;
ret = TTGetEmbeddingType(hdc, &status);
- ok(ret == E_NONE || ret == E_NOTATRUETYPEFONT, "Unexpected return value %#x.\n", ret);
+ ok(ret == E_NONE || ret == E_NOTATRUETYPEFONT, "Unexpected return value %#lx.\n", ret);
if (ret == E_NONE)
{
@@ -56,7 +56,7 @@ static int CALLBACK enum_font_proc(ENUMLOGFONTEXA *enumlf, NEWTEXTMETRICEXA *ntm
else if (fsType & LICENSE_NOEMBEDDING)
expected = EMBED_NOEMBEDDING;
- ok(expected == status, "%s: status %d, expected %d, fsType %#x\n", enumlf->elfLogFont.lfFaceName, status,
+ ok(expected == status, "%s: status %ld, expected %ld, fsType %#x\n", enumlf->elfLogFont.lfFaceName, status,
expected, otm.otmfsType);
}
}
@@ -64,8 +64,8 @@ static int CALLBACK enum_font_proc(ENUMLOGFONTEXA *enumlf, NEWTEXTMETRICEXA *ntm
{
status = 0xdeadbeef;
ret = TTGetEmbeddingType(hdc, &status);
- ok(ret == E_NOTATRUETYPEFONT, "%s: got %d\n", enumlf->elfLogFont.lfFaceName, ret);
- ok(status == 0xdeadbeef, "%s: got status %d\n", enumlf->elfLogFont.lfFaceName, status);
+ ok(ret == E_NOTATRUETYPEFONT, "%s: got %ld.\n", enumlf->elfLogFont.lfFaceName, ret);
+ ok(status == 0xdeadbeef, "%s: got status %#lx.\n", enumlf->elfLogFont.lfFaceName, status);
}
SelectObject(hdc, old_font);
@@ -84,27 +84,28 @@ static void test_TTGetEmbeddingType(void)
HDC hdc;
ret = TTGetEmbeddingType(NULL, NULL);
- ok(ret == E_HDCINVALID, "got %d\n", ret);
+ ok(ret == E_HDCINVALID, "Unexpected retval %#lx.\n", ret);
status = 0xdeadbeef;
ret = TTGetEmbeddingType(NULL, &status);
- ok(ret == E_HDCINVALID, "got %#x\n", ret);
- ok(status == 0xdeadbeef, "got %u\n", status);
+ ok(ret == E_HDCINVALID, "Unexpected retval %#lx.\n", ret);
+ ok(status == 0xdeadbeef, "Unexpected status %#lx.\n", status);
status = 0xdeadbeef;
ret = TTGetEmbeddingType((HDC)0xdeadbeef, &status);
- ok(ret == E_NOTATRUETYPEFONT || broken(ret == E_ERRORACCESSINGFONTDATA) /* xp, vista */, "got %#x\n", ret);
- ok(status == 0xdeadbeef, "got %u\n", status);
+ ok(ret == E_NOTATRUETYPEFONT || broken(ret == E_ERRORACCESSINGFONTDATA) /* xp, vista */,
+ "Unexpected retval %#lx.\n", ret);
+ ok(status == 0xdeadbeef, "Unexpected status %#lx.\n", status);
hdc = CreateCompatibleDC(0);
ret = TTGetEmbeddingType(hdc, NULL);
- ok(ret == E_NOTATRUETYPEFONT, "got %#x\n", ret);
+ ok(ret == E_NOTATRUETYPEFONT, "Unexpected retval %#lx.\n", ret);
status = 0xdeadbeef;
ret = TTGetEmbeddingType(hdc, &status);
- ok(ret == E_NOTATRUETYPEFONT, "got %#x\n", ret);
- ok(status == 0xdeadbeef, "got %u\n", status);
+ ok(ret == E_NOTATRUETYPEFONT, "Unexpected retval %#lx.\n", ret);
+ ok(status == 0xdeadbeef, "Unexpected status %#lx.\n", status);
memset(&logfont, 0, sizeof(logfont));
logfont.lfHeight = 12;
@@ -117,11 +118,11 @@ static void test_TTGetEmbeddingType(void)
status = 0;
ret = TTGetEmbeddingType(hdc, &status);
- ok(ret == E_NONE, "got %#x\n", ret);
- ok(status != 0, "got %u\n", status);
+ ok(ret == E_NONE, "Unexpected retval %#lx.\n", ret);
+ ok(status != 0, "Unexpected status %lu.\n", status);
ret = TTGetEmbeddingType(hdc, NULL);
- ok(ret == E_PERMISSIONSINVALID, "got %#x\n", ret);
+ ok(ret == E_PERMISSIONSINVALID, "Unexpected retval %#lx.\n", ret);
SelectObject(hdc, old_font);
DeleteObject(hfont);
@@ -140,36 +141,37 @@ static void test_TTIsEmbeddingEnabledForFacename(void)
LONG ret;
ret = TTIsEmbeddingEnabledForFacename(NULL, NULL);
- ok(ret == E_FACENAMEINVALID, "got %#x\n", ret);
+ ok(ret == E_FACENAMEINVALID, "Unexpected retval %#lx.\n", ret);
status = 123;
ret = TTIsEmbeddingEnabledForFacename(NULL, &status);
- ok(ret == E_FACENAMEINVALID, "got %#x\n", ret);
+ ok(ret == E_FACENAMEINVALID, "Unexpected retval %#lx.\n", ret);
ok(status == 123, "got %d\n", status);
ret = TTIsEmbeddingEnabledForFacename("Arial", NULL);
- ok(ret == E_PBENABLEDINVALID, "got %#x\n", ret);
+ ok(ret == E_PBENABLEDINVALID, "Unexpected retval %#lx.\n", ret);
status = 123;
ret = TTIsEmbeddingEnabledForFacename("Arial", &status);
- ok(ret == E_NONE, "got %#x\n", ret);
+ ok(ret == E_NONE, "Unexpected retval %#lx.\n", ret);
ok(status != 123, "got %d\n", status);
}
static void test_TTIsEmbeddingEnabled(void)
{
HFONT old_font, hfont;
- LONG ret, status;
LOGFONTA logfont;
+ BOOL status;
+ LONG ret;
HDC hdc;
ret = TTIsEmbeddingEnabled(NULL, NULL);
- ok(ret == E_HDCINVALID, "got %#x\n", ret);
+ ok(ret == E_HDCINVALID, "Unexpected retval %#lx.\n", ret);
status = 123;
ret = TTIsEmbeddingEnabled(NULL, &status);
- ok(ret == E_HDCINVALID, "got %#x\n", ret);
- ok(status == 123, "got %d\n", status);
+ ok(ret == E_HDCINVALID, "Unexpected retval %#lx.\n", ret);
+ ok(status != 123, "Unexpected status %d.\n", status);
hdc = CreateCompatibleDC(0);
@@ -183,12 +185,12 @@ static void test_TTIsEmbeddingEnabled(void)
old_font = SelectObject(hdc, hfont);
ret = TTIsEmbeddingEnabled(hdc, NULL);
- ok(ret == E_PBENABLEDINVALID, "Unexpected return value %#x.\n", ret);
+ ok(ret == E_PBENABLEDINVALID, "Unexpected retval %#lx.\n", ret);
status = 123;
ret = TTIsEmbeddingEnabled(hdc, &status);
- ok(ret == E_NONE, "got %#x\n", ret);
- ok(status != 123, "got %u\n", status);
+ ok(ret == E_NONE, "Unexpected retval %#lx.\n", ret);
+ ok(status != 123, "Unexpected status %d.\n", status);
SelectObject(hdc, old_font);
DeleteObject(hfont);
--
2.34.1
2
1
Feb. 20, 2022
Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com>
---
dlls/dxva2/tests/Makefile.in | 1 -
dlls/dxva2/tests/dxva2.c | 182 +++++++++++++++++------------------
2 files changed, 91 insertions(+), 92 deletions(-)
diff --git a/dlls/dxva2/tests/Makefile.in b/dlls/dxva2/tests/Makefile.in
index 03e8afa3191..ccd03940a24 100644
--- a/dlls/dxva2/tests/Makefile.in
+++ b/dlls/dxva2/tests/Makefile.in
@@ -1,4 +1,3 @@
-EXTRADEFS = -DWINE_NO_LONG_TYPES
TESTDLL = dxva2.dll
IMPORTS = dxva2 user32 d3d9 ole32
diff --git a/dlls/dxva2/tests/dxva2.c b/dlls/dxva2/tests/dxva2.c
index d94299f0c78..cc5bc3cd76f 100644
--- a/dlls/dxva2/tests/dxva2.c
+++ b/dlls/dxva2/tests/dxva2.c
@@ -66,14 +66,14 @@ static void test_surface_desc(IDirect3DSurface9 *surface)
HRESULT hr;
hr = IDirect3DSurface9_GetDesc(surface, &desc);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(desc.Format == D3DFMT_X8R8G8B8, "Unexpected format %d.\n", desc.Format);
ok(desc.Type == D3DRTYPE_SURFACE, "Unexpected type %d.\n", desc.Type);
- ok(desc.Usage == 0, "Unexpected usage %d.\n", desc.Usage);
+ ok(!desc.Usage, "Unexpected usage %ld.\n", desc.Usage);
ok(desc.Pool == D3DPOOL_DEFAULT, "Unexpected pool %d.\n", desc.Pool);
ok(desc.MultiSampleType == D3DMULTISAMPLE_NONE, "Unexpected multisample type %d.\n", desc.MultiSampleType);
- ok(desc.MultiSampleQuality == 0, "Unexpected multisample quality %d.\n", desc.MultiSampleQuality);
+ ok(!desc.MultiSampleQuality, "Unexpected multisample quality %ld.\n", desc.MultiSampleQuality);
ok(desc.Width == 64, "Unexpected width %u.\n", desc.Width);
ok(desc.Height == 64, "Unexpected height %u.\n", desc.Height);
}
@@ -134,31 +134,31 @@ static void test_device_manager(void)
}
hr = DXVA2CreateDirect3DDeviceManager9(&token, &manager);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDirect3DDeviceManager9_OpenDeviceHandle(manager, &handle);
- ok(hr == DXVA2_E_NOT_INITIALIZED, "Unexpected hr %#x.\n", hr);
+ ok(hr == DXVA2_E_NOT_INITIALIZED, "Unexpected hr %#lx.\n", hr);
hr = IDirect3DDeviceManager9_LockDevice(manager, 0, &device2, FALSE);
- ok(hr == DXVA2_E_NOT_INITIALIZED, "Unexpected hr %#x.\n", hr);
+ ok(hr == DXVA2_E_NOT_INITIALIZED, "Unexpected hr %#lx.\n", hr);
hr = IDirect3DDeviceManager9_CloseDeviceHandle(manager, 0);
- ok(hr == E_HANDLE, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_HANDLE, "Unexpected hr %#lx.\n", hr);
/* Invalid token. */
hr = IDirect3DDeviceManager9_ResetDevice(manager, device, token + 1);
- ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
hr = IDirect3DDeviceManager9_ResetDevice(manager, device, token);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
refcount = get_refcount(device);
hr = IDirect3DDeviceManager9_CloseDeviceHandle(manager, 0);
- ok(hr == E_HANDLE, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_HANDLE, "Unexpected hr %#lx.\n", hr);
handle1 = NULL;
hr = IDirect3DDeviceManager9_OpenDeviceHandle(manager, &handle1);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(!!handle1, "Unexpected handle value.\n");
refcount2 = get_refcount(device);
@@ -166,172 +166,172 @@ static void test_device_manager(void)
handle = NULL;
hr = IDirect3DDeviceManager9_OpenDeviceHandle(manager, &handle);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(handle != handle1, "Unexpected handle.\n");
hr = IDirect3DDeviceManager9_CloseDeviceHandle(manager, handle);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
/* Already closed. */
hr = IDirect3DDeviceManager9_CloseDeviceHandle(manager, handle);
- ok(hr == E_HANDLE, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_HANDLE, "Unexpected hr %#lx.\n", hr);
handle = NULL;
hr = IDirect3DDeviceManager9_OpenDeviceHandle(manager, &handle);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDirect3DDeviceManager9_CloseDeviceHandle(manager, handle1);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDirect3DDeviceManager9_TestDevice(manager, handle1);
- ok(hr == E_HANDLE, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_HANDLE, "Unexpected hr %#lx.\n", hr);
hr = IDirect3DDeviceManager9_TestDevice(manager, 0);
- ok(hr == E_HANDLE, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_HANDLE, "Unexpected hr %#lx.\n", hr);
handle = NULL;
hr = IDirect3DDeviceManager9_OpenDeviceHandle(manager, &handle);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
handle1 = NULL;
hr = IDirect3DDeviceManager9_OpenDeviceHandle(manager, &handle1);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDirect3DDeviceManager9_GetVideoService(manager, handle, &IID_IDirectXVideoProcessorService,
(void **)&processor_service);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
IDirectXVideoProcessorService_Release(processor_service);
device2 = create_device(d3d, window);
hr = IDirect3DDeviceManager9_ResetDevice(manager, device2, token);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDirect3DDeviceManager9_GetVideoService(manager, handle, &IID_IDirectXVideoProcessorService,
(void **)&processor_service);
- ok(hr == DXVA2_E_NEW_VIDEO_DEVICE, "Unexpected hr %#x.\n", hr);
+ ok(hr == DXVA2_E_NEW_VIDEO_DEVICE, "Unexpected hr %#lx.\n", hr);
hr = IDirect3DDeviceManager9_TestDevice(manager, handle);
- ok(hr == DXVA2_E_NEW_VIDEO_DEVICE, "Unexpected hr %#x.\n", hr);
+ ok(hr == DXVA2_E_NEW_VIDEO_DEVICE, "Unexpected hr %#lx.\n", hr);
hr = IDirect3DDeviceManager9_CloseDeviceHandle(manager, handle);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
/* Lock/Unlock. */
hr = IDirect3DDeviceManager9_OpenDeviceHandle(manager, &handle);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDirect3DDeviceManager9_LockDevice(manager, handle, &device3, FALSE);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(device2 == device3, "Unexpected device pointer.\n");
IDirect3DDevice9_Release(device3);
hr = IDirect3DDeviceManager9_UnlockDevice(manager, handle, FALSE);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDirect3DDeviceManager9_UnlockDevice(manager, handle, FALSE);
- ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
hr = IDirect3DDeviceManager9_UnlockDevice(manager, (HANDLE)((ULONG_PTR)handle + 100), FALSE);
- ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
/* Locked with one handle, unlock with another. */
hr = IDirect3DDeviceManager9_OpenDeviceHandle(manager, &handle1);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDirect3DDeviceManager9_LockDevice(manager, handle, &device3, FALSE);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(device2 == device3, "Unexpected device pointer.\n");
IDirect3DDevice9_Release(device3);
hr = IDirect3DDeviceManager9_UnlockDevice(manager, handle1, FALSE);
- ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
/* Closing unlocks the device. */
hr = IDirect3DDeviceManager9_CloseDeviceHandle(manager, handle);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDirect3DDeviceManager9_LockDevice(manager, handle1, &device3, FALSE);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(device2 == device3, "Unexpected device pointer.\n");
IDirect3DDevice9_Release(device3);
hr = IDirect3DDeviceManager9_CloseDeviceHandle(manager, handle1);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
/* Open two handles. */
hr = IDirect3DDeviceManager9_OpenDeviceHandle(manager, &handle);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDirect3DDeviceManager9_OpenDeviceHandle(manager, &handle1);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDirect3DDeviceManager9_LockDevice(manager, handle, &device3, FALSE);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(device2 == device3, "Unexpected device pointer.\n");
IDirect3DDevice9_Release(device3);
hr = IDirect3DDeviceManager9_LockDevice(manager, handle1, &device3, FALSE);
- ok(hr == DXVA2_E_VIDEO_DEVICE_LOCKED, "Unexpected hr %#x.\n", hr);
+ ok(hr == DXVA2_E_VIDEO_DEVICE_LOCKED, "Unexpected hr %#lx.\n", hr);
hr = IDirect3DDeviceManager9_CloseDeviceHandle(manager, handle1);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDirect3DDeviceManager9_CloseDeviceHandle(manager, handle);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
/* State saving function. */
hr = IDirect3DDeviceManager9_OpenDeviceHandle(manager, &handle);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDirect3DDeviceManager9_LockDevice(manager, handle, &device3, FALSE);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(device2 == device3, "Unexpected device pointer.\n");
SetRect(&rect, 50, 60, 70, 80);
hr = IDirect3DDevice9_SetScissorRect(device3, &rect);
- ok(SUCCEEDED(hr), "Failed to set scissor rect, hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDirect3DDeviceManager9_UnlockDevice(manager, handle, TRUE);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
SetRect(&rect, 30, 60, 70, 80);
hr = IDirect3DDevice9_SetScissorRect(device3, &rect);
- ok(SUCCEEDED(hr), "Failed to set scissor rect, hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
IDirect3DDevice9_Release(device3);
hr = IDirect3DDeviceManager9_LockDevice(manager, handle, &device3, FALSE);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(device2 == device3, "Unexpected device pointer.\n");
hr = IDirect3DDevice9_GetScissorRect(device3, &rect);
- ok(SUCCEEDED(hr), "Failed to get scissor rect, hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(rect.left == 50 && rect.top == 60 && rect.right == 70 && rect.bottom == 80,
"Got unexpected scissor rect %s.\n", wine_dbgstr_rect(&rect));
IDirect3DDevice9_Release(device3);
hr = IDirect3DDeviceManager9_UnlockDevice(manager, handle, TRUE);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDirect3DDeviceManager9_CloseDeviceHandle(manager, handle);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
/* Acceleration service. */
hr = DXVA2CreateVideoService(device, &IID_IDirectXVideoAccelerationService, (void **)&accel_service);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
surfaces[0] = surfaces[1] = NULL;
hr = IDirectXVideoAccelerationService_CreateSurface(accel_service, 64, 64, 0, D3DFMT_X8R8G8B8,
D3DPOOL_DEFAULT, 0, DXVA2_VideoProcessorRenderTarget, surfaces, NULL);
- ok(hr == S_OK, "Failed to create a surface, hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(!!surfaces[0] && !surfaces[1], "Unexpected surfaces.\n");
IDirect3DSurface9_Release(surfaces[0]);
hr = IDirectXVideoAccelerationService_CreateSurface(accel_service, 64, 64, 1, D3DFMT_X8R8G8B8,
D3DPOOL_DEFAULT, 0, DXVA2_VideoProcessorRenderTarget, surfaces, NULL);
- ok(hr == S_OK, "Failed to create a surface, hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(!!surfaces[0] && !!surfaces[1], "Unexpected surfaces.\n");
test_surface_desc(surfaces[0]);
IDirect3DSurface9_Release(surfaces[0]);
@@ -341,12 +341,12 @@ static void test_device_manager(void)
/* RT formats. */
hr = DXVA2CreateVideoService(device, &IID_IDirectXVideoProcessorService, (void **)&proc_service);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
init_video_desc(&video_desc, D3DFMT_A8R8G8B8);
hr = IDirectXVideoProcessorService_GetVideoProcessorDeviceGuids(proc_service, &video_desc, &count, &guids);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(count, "Unexpected format count %u.\n", count);
CoTaskMemFree(guids);
@@ -357,7 +357,7 @@ static void test_device_manager(void)
count = 0;
hr = IDirectXVideoProcessorService_GetVideoProcessorDeviceGuids(proc_service, &video_desc, &count, &guids);
todo_wine_if(rt_formats[i] == MAKEFOURCC('A','Y','U','V'))
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
if (FAILED(hr)) continue;
ok(count > 0, "Unexpected device count.\n");
CoTaskMemFree(guids);
@@ -365,7 +365,7 @@ static void test_device_manager(void)
count = 0;
hr = IDirectXVideoProcessorService_GetVideoProcessorRenderTargets(proc_service, &DXVA2_VideoProcSoftwareDevice,
&video_desc, &count, &formats);
- ok(hr == S_OK, "Unexpected hr %#x, format %d.\n", hr, rt_formats[i]);
+ ok(hr == S_OK, "Unexpected hr %#lx, format %d.\n", hr, rt_formats[i]);
ok(count == 2, "Unexpected format count %u.\n", count);
if (count == 2)
ok(formats[0] == D3DFMT_X8R8G8B8 && formats[1] == D3DFMT_A8R8G8B8, "Unexpected formats %d,%d.\n",
@@ -379,27 +379,27 @@ static void test_device_manager(void)
hr = IDirectXVideoProcessorService_GetVideoProcessorRenderTargets(proc_service, &DXVA2_VideoProcSoftwareDevice,
&video_desc, &count, &formats);
- ok(hr == E_FAIL, "Unexpected hr %#x, format %d.\n", hr, rt_unsupported_formats[i]);
+ ok(hr == E_FAIL, "Unexpected hr %#lx, format %d.\n", hr, rt_unsupported_formats[i]);
}
IDirectXVideoProcessorService_Release(proc_service);
hr = IDirect3DDeviceManager9_OpenDeviceHandle(manager, &handle);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDirect3DDeviceManager9_GetVideoService(manager, handle, &IID_IDirectXVideoAccelerationService,
(void **)&accel_service);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDirect3DDeviceManager9_CloseDeviceHandle(manager, handle);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDirectXVideoAccelerationService_CreateSurface(accel_service, 64, 64, 0, D3DFMT_X8R8G8B8,
D3DPOOL_DEFAULT, 0, DXVA2_VideoProcessorRenderTarget, surfaces, NULL);
- ok(hr == S_OK, "Failed to create a surface, hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDirect3DSurface9_GetDevice(surfaces[0], &device3);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(device2 == device3, "Unexpected device.\n");
IDirect3DDevice9_Release(device3);
@@ -443,24 +443,24 @@ static void test_video_processor(void)
}
hr = DXVA2CreateDirect3DDeviceManager9(&token, &manager);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDirect3DDeviceManager9_ResetDevice(manager, device, token);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
handle = NULL;
hr = IDirect3DDeviceManager9_OpenDeviceHandle(manager, &handle);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
handle1 = NULL;
hr = IDirect3DDeviceManager9_OpenDeviceHandle(manager, &handle1);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(get_refcount(manager) == 1, "Unexpected refcount %u.\n", get_refcount(manager));
hr = IDirect3DDeviceManager9_GetVideoService(manager, handle, &IID_IDirectXVideoProcessorService,
(void **)&service);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
memset(&video_desc, 0, sizeof(video_desc));
video_desc.SampleWidth = 64;
@@ -470,24 +470,24 @@ static void test_video_processor(void)
/* Number of substreams does not include reference stream. */
hr = IDirectXVideoProcessorService_CreateVideoProcessor(service, &DXVA2_VideoProcSoftwareDevice, &video_desc,
D3DFMT_A8R8G8B8, 16, &processor);
- ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
hr = IDirectXVideoProcessorService_CreateVideoProcessor(service, &DXVA2_VideoProcSoftwareDevice, &video_desc,
D3DFMT_A8R8G8B8, 15, &processor);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
IDirectXVideoProcessor_Release(processor);
hr = IDirectXVideoProcessorService_CreateVideoProcessor(service, &DXVA2_VideoProcSoftwareDevice, &video_desc,
D3DFMT_A8R8G8B8, 0, &processor);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
IDirectXVideoProcessor_Release(processor);
hr = IDirectXVideoProcessorService_CreateVideoProcessor(service, &DXVA2_VideoProcSoftwareDevice, &video_desc,
D3DFMT_A8R8G8B8, 1, &processor);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDirectXVideoProcessor_GetVideoProcessorCaps(processor, &caps);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(caps.DeviceCaps == DXVA2_VPDev_SoftwareDevice, "Unexpected device type %#x.\n", caps.DeviceCaps);
ok(caps.InputPool == D3DPOOL_SYSTEMMEM, "Unexpected input pool %#x.\n", caps.InputPool);
ok(!caps.NumForwardRefSamples, "Unexpected sample count.\n");
@@ -507,18 +507,18 @@ static void test_video_processor(void)
hr = IDirectXVideoProcessorService_CreateVideoProcessor(service, &DXVA2_VideoProcSoftwareDevice, &video_desc,
D3DFMT_A8R8G8B8, 1, &processor2);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(processor2 != processor, "Unexpected instance.\n");
hr = IDirectXVideoProcessor_GetCreationParameters(processor, NULL, NULL, NULL, NULL);
- ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
hr = IDirectXVideoProcessor_GetCreationParameters(processor, &guid, NULL, NULL, NULL);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(IsEqualGUID(&guid, &DXVA2_VideoProcSoftwareDevice), "Unexpected device guid.\n");
hr = IDirectXVideoProcessor_GetCreationParameters(processor, NULL, NULL, &format, NULL);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(format == D3DFMT_A8R8G8B8, "Unexpected format %u.\n", format);
IDirectXVideoProcessor_Release(processor);
@@ -526,17 +526,17 @@ static void test_video_processor(void)
hr = IDirect3DDeviceManager9_GetVideoService(manager, handle, &IID_IDirectXVideoProcessorService,
(void **)&service2);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(service == service2, "Unexpected pointer.\n");
IDirectXVideoProcessorService_Release(service2);
IDirectXVideoProcessorService_Release(service);
hr = IDirect3DDeviceManager9_CloseDeviceHandle(manager, handle);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDirect3DDeviceManager9_CloseDeviceHandle(manager, handle1);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
IDirect3DDevice9_Release(device);
IDirect3DDeviceManager9_Release(manager);
@@ -597,18 +597,18 @@ static void test_progressive_device(void)
}
hr = DXVA2CreateDirect3DDeviceManager9(&token, &manager);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDirect3DDeviceManager9_ResetDevice(manager, device, token);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
handle = NULL;
hr = IDirect3DDeviceManager9_OpenDeviceHandle(manager, &handle);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDirect3DDeviceManager9_GetVideoService(manager, handle, &IID_IDirectXVideoProcessorService,
(void **)&service);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
memset(&video_desc, 0, sizeof(video_desc));
video_desc.SampleWidth = 64;
@@ -631,7 +631,7 @@ static void test_progressive_device(void)
/* Check that progressive device is returned for given input format. */
count = 0;
hr = IDirectXVideoProcessorService_GetVideoProcessorDeviceGuids(service, &video_desc, &count, &guids);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(count > 0, "Unexpected device count.\n");
for (j = 0; j < count; ++j)
{
@@ -643,7 +643,7 @@ static void test_progressive_device(void)
count = 0;
hr = IDirectXVideoProcessorService_GetVideoProcessorRenderTargets(service, &DXVA2_VideoProcProgressiveDevice,
&video_desc, &count, &rt_formats);
- ok(hr == S_OK, "Unexpected hr %#x, format %d.\n", hr, input_formats[i]);
+ ok(hr == S_OK, "Unexpected hr %#lx, format %d.\n", hr, input_formats[i]);
ok(count > 0, "Unexpected format count %u.\n", count);
for (j = 0; j < count; ++j)
{
@@ -660,10 +660,10 @@ static void test_progressive_device(void)
hr = IDirectXVideoProcessorService_CreateVideoProcessor(service, &DXVA2_VideoProcProgressiveDevice, &video_desc,
D3DFMT_A8R8G8B8, 0, &processor);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDirectXVideoProcessor_GetVideoProcessorCaps(processor, &caps);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(caps.DeviceCaps == DXVA2_VPDev_HardwareDevice, "Unexpected device type %#x.\n", caps.DeviceCaps);
ok(!caps.NumForwardRefSamples, "Unexpected sample count.\n");
ok(!caps.NumBackwardRefSamples, "Unexpected sample count.\n");
@@ -672,7 +672,7 @@ static void test_progressive_device(void)
caps.VideoProcessorOperations);
hr = IDirectXVideoProcessor_GetCreationParameters(processor, &guid, NULL, &format, NULL);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(IsEqualGUID(&guid, &DXVA2_VideoProcProgressiveDevice), "Unexpected device guid.\n");
ok(format == D3DFMT_A8R8G8B8, "Unexpected format %u.\n", format);
@@ -682,7 +682,7 @@ unsupported:
IDirectXVideoProcessorService_Release(service);
hr = IDirect3DDeviceManager9_CloseDeviceHandle(manager, handle);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
IDirect3DDevice9_Release(device);
IDirect3DDeviceManager9_Release(manager);
--
2.34.1
1
0
Feb. 20, 2022
Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com>
---
dlls/shcore/tests/Makefile.in | 1 -
dlls/shcore/tests/shcore.c | 136 +++++++++++++++++-----------------
2 files changed, 68 insertions(+), 69 deletions(-)
diff --git a/dlls/shcore/tests/Makefile.in b/dlls/shcore/tests/Makefile.in
index f20c27aae2d..4f537fa3874 100644
--- a/dlls/shcore/tests/Makefile.in
+++ b/dlls/shcore/tests/Makefile.in
@@ -1,4 +1,3 @@
-EXTRADEFS = -DWINE_NO_LONG_TYPES
TESTDLL = shcore.dll
IMPORTS = advapi32
diff --git a/dlls/shcore/tests/shcore.c b/dlls/shcore/tests/shcore.c
index a75bfd899eb..af6b3b392f3 100644
--- a/dlls/shcore/tests/shcore.c
+++ b/dlls/shcore/tests/shcore.c
@@ -138,30 +138,30 @@ static void test_process_reference(void)
obj = (void *)0xdeadbeef;
hr = pGetProcessReference(&obj);
- ok(hr == E_FAIL, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_FAIL, "Unexpected hr %#lx.\n", hr);
ok(obj == NULL, "Unexpected pointer.\n");
test_unk_init(&test_unk);
test_unk_init(&test_unk2);
pSetProcessReference(&test_unk.IUnknown_iface);
- ok(test_unk.refcount == 1, "Unexpected refcount %u.\n", test_unk.refcount);
+ ok(test_unk.refcount == 1, "Unexpected refcount %lu.\n", test_unk.refcount);
pSetProcessReference(&test_unk2.IUnknown_iface);
- ok(test_unk.refcount == 1, "Unexpected refcount %u.\n", test_unk.refcount);
- ok(test_unk2.refcount == 1, "Unexpected refcount %u.\n", test_unk2.refcount);
+ ok(test_unk.refcount == 1, "Unexpected refcount %lu.\n", test_unk.refcount);
+ ok(test_unk2.refcount == 1, "Unexpected refcount %lu.\n", test_unk2.refcount);
hr = pGetProcessReference(&obj);
- ok(hr == S_OK, "Failed to get reference, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to get reference, hr %#lx.\n", hr);
ok(obj == &test_unk2.IUnknown_iface, "Unexpected pointer.\n");
- ok(test_unk2.refcount == 2, "Unexpected refcount %u.\n", test_unk2.refcount);
+ ok(test_unk2.refcount == 2, "Unexpected refcount %lu.\n", test_unk2.refcount);
hmod = LoadLibraryA("shell32.dll");
pSHGetInstanceExplorer = (void *)GetProcAddress(hmod, "SHGetInstanceExplorer");
hr = pSHGetInstanceExplorer(&obj);
- ok(hr == S_OK, "Failed to get reference, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to get reference, hr %#lx.\n", hr);
ok(obj == &test_unk2.IUnknown_iface, "Unexpected pointer.\n");
- ok(test_unk2.refcount == 3, "Unexpected refcount %u.\n", test_unk2.refcount);
+ ok(test_unk2.refcount == 3, "Unexpected refcount %lu.\n", test_unk2.refcount);
}
static void test_SHUnicodeToAnsi(void)
@@ -334,7 +334,7 @@ static void test_SHRegDuplicateHKey(void)
DWORD ret;
ret = RegCreateKeyA(HKEY_CURRENT_USER, "Software\\Wine\\Test", &hkey);
- ok(!ret, "Failed to create test key, ret %d.\n", ret);
+ ok(!ret, "Failed to create test key, ret %ld.\n", ret);
hkey2 = pSHRegDuplicateHKey(hkey);
ok(hkey2 != NULL && hkey2 != hkey, "Unexpected duplicate key.\n");
@@ -351,20 +351,20 @@ static void test_SHDeleteKey(void)
DWORD ret;
ret = RegCreateKeyA(HKEY_CURRENT_USER, "Software\\Wine\\Test", &hkey);
- ok(!ret, "Failed to create test key, %d.\n", ret);
+ ok(!ret, "Failed to create test key, %ld.\n", ret);
ret = RegCreateKeyA(hkey, "delete_key", &hkey2);
- ok(!ret, "Failed to create test key, %d.\n", ret);
+ ok(!ret, "Failed to create test key, %ld.\n", ret);
RegCloseKey(hkey2);
ret = RegDeleteKeyA(HKEY_CURRENT_USER, "Software\\Wine\\Test");
- ok(ret == ERROR_ACCESS_DENIED, "Unexpected return value %d.\n", ret);
+ ok(ret == ERROR_ACCESS_DENIED, "Unexpected return value %ld.\n", ret);
ret = pSHDeleteKeyA(HKEY_CURRENT_USER, "Software\\Wine\\Test");
- ok(!ret, "Failed to delete a key, %d.\n", ret);
+ ok(!ret, "Unexpected retval %lu.\n", ret);
ret = RegCloseKey(hkey);
- ok(!ret, "Failed to delete a key, %d.\n", ret);
+ ok(!ret, "Unexpected retval %lu.\n", ret);
}
static HKEY create_test_entries(void)
@@ -377,7 +377,7 @@ static HKEY create_test_entries(void)
SetEnvironmentVariableA("FOO", test_envvar2);
ret = RegCreateKeyA(HKEY_CURRENT_USER, REG_TEST_KEY, &hKey);
- ok(!ret, "RegCreateKeyA failed, ret=%u\n", ret);
+ ok(!ret, "Unexpected retval %lu.\n", ret);
if (hKey)
{
@@ -431,18 +431,18 @@ static void test_SHGetValue(void)
size = MAX_PATH;
type = -1;
ret = pSHGetValueA(HKEY_CURRENT_USER, REG_TEST_KEY, "Test1", &type, buf, &size);
- ok(!ret, "Failed to get value, ret %u.\n", ret);
+ ok(!ret, "Failed to get value, ret %lu.\n", ret);
ok(!strcmp(test_exp_path1, buf), "Unexpected value %s.\n", buf);
- ok(type == REG_SZ, "Unexpected value type %d.\n", type);
+ ok(type == REG_SZ, "Unexpected type %ld.\n", type);
strcpy(buf, initial_buffer);
size = MAX_PATH;
type = -1;
ret = pSHGetValueA(HKEY_CURRENT_USER, REG_TEST_KEY, "Test2", &type, buf, &size);
- ok(!ret, "Failed to get value, ret %u.\n", ret);
+ ok(!ret, "Failed to get value, ret %lu.\n", ret);
ok(!strcmp(test_path1, buf), "Unexpected value %s.\n", buf);
- ok(type == REG_SZ, "Unexpected value type %d.\n", type);
+ ok(type == REG_SZ, "Unexpected type %ld.\n", type);
delete_key(hkey, "Software\\Wine", "Test");
}
@@ -457,31 +457,31 @@ static void test_SHRegGetValue(void)
size = MAX_PATH;
ret = pSHRegGetValueA(HKEY_CURRENT_USER, REG_TEST_KEY, "Test1", SRRF_RT_REG_EXPAND_SZ, &type, data, &size);
- ok(ret == ERROR_INVALID_PARAMETER, "SHRegGetValue failed, ret=%u\n", ret);
+ ok(ret == ERROR_INVALID_PARAMETER, "Unexpected retval %lu.\n", ret);
size = MAX_PATH;
ret = pSHRegGetValueA(HKEY_CURRENT_USER, REG_TEST_KEY, "Test1", SRRF_RT_REG_SZ, &type, data, &size);
- ok(ret == ERROR_SUCCESS, "SHRegGetValue failed, ret=%u\n", ret);
+ ok(!ret, "Unexpected retval %lu.\n", ret);
ok(!strcmp(data, test_exp_path1), "data = %s, expected %s\n", data, test_exp_path1);
- ok(type == REG_SZ, "type = %d, expected REG_SZ\n", type);
+ ok(type == REG_SZ, "Unexpected type %ld.\n", type);
size = MAX_PATH;
ret = pSHRegGetValueA(HKEY_CURRENT_USER, REG_TEST_KEY, "Test1", SRRF_RT_REG_DWORD, &type, data, &size);
- ok(ret == ERROR_UNSUPPORTED_TYPE, "SHRegGetValue failed, ret=%u\n", ret);
+ ok(ret == ERROR_UNSUPPORTED_TYPE, "Unexpected retval %lu.\n", ret);
size = MAX_PATH;
ret = pSHRegGetValueA(HKEY_CURRENT_USER, REG_TEST_KEY, "Test2", SRRF_RT_REG_EXPAND_SZ, &type, data, &size);
- ok(ret == ERROR_INVALID_PARAMETER, "SHRegGetValue failed, ret=%u\n", ret);
+ ok(ret == ERROR_INVALID_PARAMETER, "Unexpected retval %lu.\n", ret);
size = MAX_PATH;
ret = pSHRegGetValueA(HKEY_CURRENT_USER, REG_TEST_KEY, "Test2", SRRF_RT_REG_SZ, &type, data, &size);
- ok(ret == ERROR_SUCCESS, "SHRegGetValue failed, ret=%u\n", ret);
+ ok(!ret, "Unexpected retval %lu.\n", ret);
ok(!strcmp(data, test_path1), "data = %s, expected %s\n", data, test_path1);
- ok(type == REG_SZ, "type = %d, expected REG_SZ\n", type);
+ ok(type == REG_SZ, "Unexpected type %ld.\n", type);
size = MAX_PATH;
ret = pSHRegGetValueA(HKEY_CURRENT_USER, REG_TEST_KEY, "Test2", SRRF_RT_REG_QWORD, &type, data, &size);
- ok(ret == ERROR_UNSUPPORTED_TYPE, "SHRegGetValue failed, ret=%u\n", ret);
+ ok(ret == ERROR_UNSUPPORTED_TYPE, "Unexpected retval %lu.\n", ret);
delete_key(hkey, "Software\\Wine", "Test");
}
@@ -496,7 +496,7 @@ static void test_SHQueryValueEx(void)
testkey = create_test_entries();
ret = RegOpenKeyExA(HKEY_CURRENT_USER, REG_TEST_KEY, 0, KEY_QUERY_VALUE, &hKey);
- ok(!ret, "Failed to open a key, ret %u.\n", ret);
+ ok(!ret, "Failed to open a key, ret %lu.\n", ret);
/****** SHQueryValueExA ******/
@@ -507,28 +507,28 @@ static void test_SHQueryValueEx(void)
* Case 1.1 All arguments are NULL
*/
ret = pSHQueryValueExA( hKey, "Test1", NULL, NULL, NULL, NULL);
- ok(!ret, "Failed to query value, ret %u.\n", ret);
+ ok(!ret, "Failed to query value, ret %lu.\n", ret);
/*
* Case 1.2 dwType is set
*/
type = -1;
ret = pSHQueryValueExA( hKey, "Test1", NULL, &type, NULL, NULL);
- ok(!ret, "Failed to query value, ret %u.\n", ret);
- ok(type == REG_SZ, "Expected REG_SZ, got (%u)\n", type);
+ ok(!ret, "Failed to query value, ret %lu.\n", ret);
+ ok(type == REG_SZ, "Unexpected type %ld.\n", type);
size = 6;
ret = pSHQueryValueExA( hKey, "Test1", NULL, NULL, NULL, &size);
- ok(!ret, "Failed to query value, ret %u.\n", ret);
- ok(size == buffer_len1, "Buffer sizes (%u) and (%u) are not equal\n", size, buffer_len1);
+ ok(!ret, "Failed to query value, ret %lu.\n", ret);
+ ok(size == buffer_len1, "Buffer sizes %lu and %lu are not equal\n", size, buffer_len1);
/*
* Expanded > unexpanded
*/
size = 6;
ret = pSHQueryValueExA( hKey, "Test3", NULL, NULL, NULL, &size);
- ok(!ret, "Failed to query value, ret %u.\n", ret);
- ok(size >= buffer_len2, "Buffer size (%u) should be >= (%u)\n", size, buffer_len2);
+ ok(!ret, "Failed to query value, ret %lu.\n", ret);
+ ok(size >= buffer_len2, "Buffer size %lu should be >= %lu.\n", size, buffer_len2);
/*
* Case 1 string shrinks during expanding
@@ -537,10 +537,10 @@ static void test_SHQueryValueEx(void)
size = 6;
type = -1;
ret = pSHQueryValueExA( hKey, "Test1", NULL, &type, buf, &size);
- ok(ret == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got (%u)\n", ret);
+ ok(ret == ERROR_MORE_DATA, "Unexpected retval %ld.\n", ret);
ok(!strcmp(initial_buffer, buf), "Comparing (%s) with (%s) failed\n", buf, initial_buffer);
- ok(size == buffer_len1, "Buffer sizes (%u) and (%u) are not equal\n", size, buffer_len1);
- ok(type == REG_SZ, "Expected REG_SZ, got (%u)\n", type);
+ ok(size == buffer_len1, "Buffer sizes %lu and %lu are not equal\n", size, buffer_len1);
+ ok(type == REG_SZ, "Unexpected type %ld.\n", type);
/*
* string grows during expanding
@@ -550,10 +550,10 @@ static void test_SHQueryValueEx(void)
size = 6;
type = -1;
ret = pSHQueryValueExA( hKey, "Test3", NULL, &type, buf, &size);
- ok(ret == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got (%u)\n", ret);
+ ok(ret == ERROR_MORE_DATA, "Unexpected retval %ld.\n", ret);
ok(!strcmp(initial_buffer, buf), "Comparing (%s) with (%s) failed\n", buf, initial_buffer);
- ok(size >= buffer_len2, "Buffer size (%u) should be >= (%u)\n", size, buffer_len2);
- ok(type == REG_SZ, "Expected REG_SZ, got (%u)\n", type);
+ ok(size >= buffer_len2, "Buffer size %lu should be >= %lu.\n", size, buffer_len2);
+ ok(type == REG_SZ, "Unexpected type %ld.\n", type);
/*
* string grows during expanding
@@ -565,15 +565,15 @@ static void test_SHQueryValueEx(void)
size = strlen(test_envvar2) - 2;
type = -1;
ret = pSHQueryValueExA(hKey, "Test3", NULL, &type, buf, &size);
- ok(ret == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got (%u)\n", ret);
+ ok(ret == ERROR_MORE_DATA, "Unexpected retval %ld.\n", ret);
todo_wine
{
ok(!strcmp("", buf), "Unexpanded string %s.\n", buf);
}
- ok(size >= buffer_len2, "Buffer size (%u) should be >= (%u)\n", size, buffer_len2);
- ok(type == REG_SZ, "Expected REG_SZ, got (%u)\n", type);
+ ok(size >= buffer_len2, "Buffer size %lu should be >= %lu.\n", size, buffer_len2);
+ ok(type == REG_SZ, "Unexpected type %ld.\n", type);
/*
* string grows during expanding
@@ -585,7 +585,7 @@ static void test_SHQueryValueEx(void)
size = exp_len2 - 4;
type = -1;
ret = pSHQueryValueExA( hKey, "Test3", NULL, &type, buf, &size);
- ok(ret == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got (%u)\n", ret);
+ ok(ret == ERROR_MORE_DATA, "Unexpected retval %ld.\n", ret);
todo_wine
{
@@ -593,8 +593,8 @@ static void test_SHQueryValueEx(void)
"Expected empty or first part of the string \"%s\", got \"%s\"\n", test_envvar2, buf);
}
- ok(size >= buffer_len2, "Buffer size (%u) should be >= (%u)\n", size, buffer_len2);
- ok(type == REG_SZ, "Expected REG_SZ, got (%u)\n", type);
+ ok(size >= buffer_len2, "Buffer size %lu should be >= %lu.\n", size, buffer_len2);
+ ok(type == REG_SZ, "Unexpected type %ld.\n", type);
/*
* The buffer is NULL but the size is set
@@ -603,9 +603,9 @@ static void test_SHQueryValueEx(void)
size = 6;
type = -1;
ret = pSHQueryValueExA( hKey, "Test3", NULL, &type, NULL, &size);
- ok(!ret, "Failed to query value, ret %u.\n", ret);
- ok(size >= buffer_len2, "Buffer size (%u) should be >= (%u)\n", size, buffer_len2);
- ok(type == REG_SZ, "Expected REG_SZ, got (%u)\n", type);
+ ok(!ret, "Failed to query value, ret %lu.\n", ret);
+ ok(size >= buffer_len2, "Buffer size %lu should be >= %lu.\n", size, buffer_len2);
+ ok(type == REG_SZ, "Unexpected type %ld.\n", type);
RegCloseKey(hKey);
@@ -622,7 +622,7 @@ static void test_SHRegGetPath(void)
strcpy(buf, initial_buffer);
ret = pSHRegGetPathA(HKEY_CURRENT_USER, REG_TEST_KEY, "Test1", buf, 0);
- ok(!ret, "Failed to get path, ret %u.\n", ret);
+ ok(!ret, "Failed to get path, ret %lu.\n", ret);
ok(!strcmp(test_exp_path1, buf), "Unexpected path %s.\n", buf);
delete_key(hkey, "Software\\Wine", "Test");
@@ -645,14 +645,14 @@ static void test_SHCopyKey(void)
hKeyDst = NULL;
ret = RegCreateKeyA(HKEY_CURRENT_USER, REG_TEST_KEY "\\CopyDestination", &hKeyDst);
- ok(!ret, "Failed to create a test key, ret %d.\n", ret);
+ ok(!ret, "Failed to create a test key, ret %ld.\n", ret);
hKeySrc = NULL;
ret = RegOpenKeyA(HKEY_LOCAL_MACHINE, REG_CURRENT_VERSION, &hKeySrc);
- ok(!ret, "Failed to open a test key, ret %d.\n", ret);
+ ok(!ret, "Failed to open a test key, ret %ld.\n", ret);
ret = pSHCopyKeyA(hKeySrc, NULL, hKeyDst, 0);
- ok(!ret, "Copy failed, ret=(%u)\n", ret);
+ ok(!ret, "Copy failed, ret %lu.\n", ret);
RegCloseKey(hKeySrc);
RegCloseKey(hKeyDst);
@@ -660,7 +660,7 @@ static void test_SHCopyKey(void)
/* Check we copied the sub keys, i.e. something that's on every windows system (including Wine) */
hKeyDst = NULL;
ret = RegOpenKeyA(HKEY_CURRENT_USER, REG_TEST_KEY "\\CopyDestination\\Shell Folders", &hKeyDst);
- ok(!ret, "Failed to open a test key, ret %d.\n", ret);
+ ok(!ret, "Failed to open a test key, ret %ld.\n", ret);
/* And the we copied the values too */
ok(!pSHQueryValueExA(hKeyDst, "Common AppData", NULL, NULL, NULL, NULL), "SHQueryValueExA failed\n");
@@ -676,7 +676,7 @@ static void _check_file_size(const CHAR *filename, LONG exp_size, int line)
DWORD file_size = 0xdeadbeef;
handle = CreateFileA(filename, GENERIC_READ, 0, NULL, OPEN_EXISTING, 0, 0);
file_size = GetFileSize(handle, NULL);
- ok_(__FILE__,line)(file_size == exp_size, "got wrong file size: %d.\n", file_size);
+ ok_(__FILE__,line)(file_size == exp_size, "got wrong file size: %ld.\n", file_size);
CloseHandle(handle);
}
@@ -688,11 +688,11 @@ static void _check_stream_size(IStream *obj, LONG exp_size, int line)
HRESULT hr;
stream_size.QuadPart = 0xdeadbeef;
hr = pIStream_Size(obj, &stream_size);
- ok_(__FILE__,line)(hr == S_OK, "IStream_Size failed: 0x%08x.\n", hr);
+ ok_(__FILE__,line)(hr == S_OK, "IStream_Size failed: hr %#lx.\n", hr);
ok_(__FILE__,line)(stream_size.QuadPart == exp_size, "Size(): got wrong size of stream: %s.\n",
wine_dbgstr_longlong(stream_size.QuadPart));
hr = IStream_Stat(obj, &stat, STATFLAG_NONAME);
- ok_(__FILE__,line)(hr == S_OK, "IStream_Stat failed: 0x%08x.\n", hr);
+ ok_(__FILE__,line)(hr == S_OK, "IStream_Stat failed: hr %#lx.\n", hr);
ok_(__FILE__,line)(stat.cbSize.QuadPart == exp_size, "Stat(): got wrong size of stream: %s.\n",
wine_dbgstr_longlong(stat.cbSize.QuadPart));
}
@@ -706,7 +706,7 @@ static void _check_stream_pos(IStream *obj, LONG exp_pos, int line)
move.QuadPart = 0;
pos.QuadPart = 0xdeadbeef;
hr = IStream_Seek(obj, move, STREAM_SEEK_CUR, &pos);
- ok_(__FILE__,line)(hr == S_OK, "IStream_Seek failed: 0x%08x.\n", hr);
+ ok_(__FILE__,line)(hr == S_OK, "IStream_Seek failed: hr %#lx.\n", hr);
ok_(__FILE__,line)(pos.QuadPart == exp_pos, "got wrong position: %s.\n",
wine_dbgstr_longlong(pos.QuadPart));
}
@@ -722,32 +722,32 @@ static void test_stream_size(void)
HRESULT hr;
handle = CreateFileA(filename, GENERIC_READ|GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, 0);
- ok(handle != INVALID_HANDLE_VALUE, "File creation failed: 0x%08x.\n", GetLastError());
+ ok(handle != INVALID_HANDLE_VALUE, "File creation failed: %lu.\n", GetLastError());
WriteFile(handle, test_data, sizeof(test_data), &written, NULL);
ok(written == sizeof(test_data), "Failed to write data into file.\n");
CloseHandle(handle);
/* in read-only mode, SetSize() will success but it has no effect on Size() and the file */
hr = pSHCreateStreamOnFileA(filename, STGM_FAILIFTHERE|STGM_READ, &stream);
- ok(hr == S_OK, "SHCreateStreamOnFileA failed: 0x%08x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
CHECK_STREAM_SIZE(stream, sizeof(test_data));
stream_size.QuadPart = 0;
hr = IStream_SetSize(stream, stream_size);
- ok(hr == S_OK, "IStream_SetSize failed: 0x%08x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
CHECK_STREAM_SIZE(stream, sizeof(test_data));
CHECK_STREAM_POS(stream, 0);
stream_size.QuadPart = 100;
hr = IStream_SetSize(stream, stream_size);
- ok(hr == S_OK, "IStream_SetSize failed: 0x%08x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
CHECK_STREAM_SIZE(stream, sizeof(test_data));
CHECK_STREAM_POS(stream, 100);
IStream_Release(stream);
CHECK_FILE_SIZE(filename, sizeof(test_data));
hr = pSHCreateStreamOnFileA(filename, STGM_FAILIFTHERE|STGM_WRITE, &stream);
- ok(hr == S_OK, "SHCreateStreamOnFileA failed: 0x%08x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = pSHCreateStreamOnFileA(filename, STGM_FAILIFTHERE|STGM_READ, &stream2);
- ok(hr == S_OK, "SHCreateStreamOnFileA failed: 0x%08x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
CHECK_STREAM_SIZE(stream, sizeof(test_data));
CHECK_STREAM_SIZE(stream2, sizeof(test_data));
CHECK_STREAM_POS(stream, 0);
@@ -755,7 +755,7 @@ static void test_stream_size(void)
stream_size.QuadPart = 0;
hr = IStream_SetSize(stream, stream_size);
- ok(hr == S_OK, "IStream_SetSize failed: 0x%08x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
CHECK_STREAM_SIZE(stream, 0);
CHECK_STREAM_SIZE(stream2, 0);
CHECK_STREAM_POS(stream, 0);
@@ -763,7 +763,7 @@ static void test_stream_size(void)
stream_size.QuadPart = 100;
hr = IStream_SetSize(stream, stream_size);
- ok(hr == S_OK, "IStream_SetSize failed: 0x%08x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
CHECK_STREAM_SIZE(stream, 100);
CHECK_STREAM_SIZE(stream2, 100);
CHECK_STREAM_POS(stream, 0);
@@ -771,7 +771,7 @@ static void test_stream_size(void)
stream_size.QuadPart = 90;
hr = IStream_SetSize(stream2, stream_size);
- ok(hr == S_OK, "IStream_SetSize failed: 0x%08x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
CHECK_STREAM_SIZE(stream, 100);
CHECK_STREAM_SIZE(stream2, 100);
CHECK_STREAM_POS(stream, 0);
--
2.34.1
1
0
[PATCH] user32: Add stubs for RegisterSuspendResumeNotification/UnregisterSuspendResumeNotification.
by Wen Wang Feb. 20, 2022
by Wen Wang Feb. 20, 2022
Feb. 20, 2022
These functions are required for some Steam version of The Legend of
Heroes games to launch.
Signed-off-by: Wen Wang <v72807647(a)gmail.com>
---
dlls/user32/misc.c | 19 +++++++++++++++++++
dlls/user32/user32.spec | 2 ++
include/winuser.h | 2 ++
3 files changed, 23 insertions(+)
diff --git a/dlls/user32/misc.c b/dlls/user32/misc.c
index 25d0b676667..e8b63028460 100644
--- a/dlls/user32/misc.c
+++ b/dlls/user32/misc.c
@@ -443,6 +443,25 @@ BOOL WINAPI UnregisterPowerSettingNotification(HPOWERNOTIFY handle)
return TRUE;
}
+/**********************************************************************
+ * RegisterSuspendResumeNotification [USER32.@]
+ */
+HPOWERNOTIFY WINAPI RegisterSuspendResumeNotification(HANDLE recipient, DWORD flags)
+{
+ FIXME("(%p,%x): stub\n", recipient, flags);
+ return (HPOWERNOTIFY)0xdeadbeef;
+}
+
+/**********************************************************************
+ * UnregisterSuspendResumeNotification [USER32.@]
+ */
+BOOL WINAPI UnregisterSuspendResumeNotification(HPOWERNOTIFY handle)
+{
+ FIXME("(%p): stub\n", handle);
+ return TRUE;
+}
+
+
/*****************************************************************************
* GetGestureConfig (USER32.@)
*/
diff --git a/dlls/user32/user32.spec b/dlls/user32/user32.spec
index 3baa7594e84..432211efb7a 100644
--- a/dlls/user32/user32.spec
+++ b/dlls/user32/user32.spec
@@ -605,6 +605,7 @@
@ stub RegisterNetworkCapabilities
@ stdcall RegisterPointerDeviceNotifications(long long)
@ stdcall RegisterPowerSettingNotification(long ptr long)
+@ stdcall RegisterSuspendResumeNotification(long long)
@ stdcall RegisterRawInputDevices(ptr long long)
@ stdcall RegisterServicesProcess(long)
@ stdcall RegisterShellHookWindow (long)
@@ -783,6 +784,7 @@
@ stdcall UnregisterHotKey(long long) NtUserUnregisterHotKey
# @ stub UnregisterMessagePumpHook
@ stdcall UnregisterPowerSettingNotification(ptr)
+@ stdcall UnregisterSuspendResumeNotification(ptr)
@ stdcall UnregisterTouchWindow(long)
@ stdcall UnregisterUserApiHook()
@ stdcall UpdateLayeredWindow(long long ptr ptr long ptr long ptr long)
diff --git a/include/winuser.h b/include/winuser.h
index 898c9034e33..0197c986033 100644
--- a/include/winuser.h
+++ b/include/winuser.h
@@ -4126,6 +4126,7 @@ WINUSERAPI HDEVNOTIFY WINAPI RegisterDeviceNotificationW(HANDLE,LPVOID,DWORD);
WINUSERAPI BOOL WINAPI RegisterHotKey(HWND,INT,UINT,UINT);
WINUSERAPI BOOL WINAPI RegisterPointerDeviceNotifications(HWND,BOOL);
WINUSERAPI HPOWERNOTIFY WINAPI RegisterPowerSettingNotification(HANDLE,LPCGUID,DWORD);
+WINUSERAPI HPOWERNOTIFY WINAPI RegisterSuspendResumeNotification(HANDLE,DWORD);
WINUSERAPI BOOL WINAPI RegisterRawInputDevices(PRAWINPUTDEVICE,UINT,UINT);
WINUSERAPI BOOL WINAPI RegisterShellHookWindow(HWND);
WINUSERAPI BOOL WINAPI RegisterTouchWindow(HWND,ULONG);
@@ -4300,6 +4301,7 @@ WINUSERAPI BOOL WINAPI UnregisterClassW(LPCWSTR,HINSTANCE);
WINUSERAPI BOOL WINAPI UnregisterDeviceNotification(HDEVNOTIFY);
WINUSERAPI BOOL WINAPI UnregisterHotKey(HWND,INT);
WINUSERAPI BOOL WINAPI UnregisterPowerSettingNotification(HPOWERNOTIFY);
+WINUSERAPI BOOL WINAPI UnregisterSuspendResumeNotification(HPOWERNOTIFY);
WINUSERAPI BOOL WINAPI UnregisterTouchWindow(HWND);
WINUSERAPI BOOL WINAPI UpdateWindow(HWND);
WINUSERAPI BOOL WINAPI UserHandleGrantAccess(HANDLE,HANDLE,BOOL);
--
2.32.0
1
0
Feb. 20, 2022
Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com>
---
dlls/mfplat/mfplat_private.h | 2 ++
1 file changed, 2 insertions(+)
diff --git a/dlls/mfplat/mfplat_private.h b/dlls/mfplat/mfplat_private.h
index dc29545df73..8418c8eb2ef 100644
--- a/dlls/mfplat/mfplat_private.h
+++ b/dlls/mfplat/mfplat_private.h
@@ -133,6 +133,8 @@ static inline const char *debugstr_propvar(const PROPVARIANT *v)
return wine_dbg_sprintf("%p {VT_UI8: %s}", v, wine_dbgstr_longlong(v->uhVal.QuadPart));
case VT_I8:
return wine_dbg_sprintf("%p {VT_I8: %s}", v, wine_dbgstr_longlong(v->hVal.QuadPart));
+ case VT_R4:
+ return wine_dbg_sprintf("%p {VT_R4: %.8e}", v, v->fltVal);
case VT_R8:
return wine_dbg_sprintf("%p {VT_R8: %lf}", v, v->dblVal);
case VT_CLSID:
--
2.34.1
1
0
The first 7 patches have already been sent to wine-devel, but felt into the
void (adding interactive tests framework to cmd, and fixing a couple of
bugs in interactive more handling, including tests). So, resubmitting.
The rest (4) patches implement tab and shift tab completion for filenames
in cmd (trying to mimic native behavior).
NB: I intentionnaly left ioctl 23 unused (as it appears in Roman's patches
about GetConsoleProcessList). Won't resolve the potential merge conflict
though.
A+
---
Eric Pouech (11):
programs/cmd/tests: don't output more data than available
programs/cmd/tests: added ability to run tests in interactive mode
programs/cmd/tests: some interactive test about input echo
programs/cmd/tests: added support for multi-line input
programs/cmd: handle white space only lines within ( ) block
programs/cmd: expand commandline before parsing it (interactive mode)
programs/cmd: detect badly quoted operand in 'if' statement
kernelbase/console, programs/conhost: support CONSOLE_READCONSOLE_CONTROL in ReadConsoleW
dlls/kernelbase, programs/conhost: return key state in ReadConsoleW with completion
programs/cmd: implement filename completion
programs/conhost: handle csi escape sequence for shift tab
dlls/kernelbase/console.c | 36 ++-
include/wine/condrv.h | 1 +
programs/cmd/batch.c | 252 +++++++++++++++++-
programs/cmd/builtins.c | 10 +
programs/cmd/tests/batch.c | 111 ++++++--
programs/cmd/tests/interactive_builtins.cmd | 42 +++
.../cmd/tests/interactive_builtins.cmd.exp | 67 +++++
programs/cmd/tests/rsrc.rc | 10 +
programs/cmd/wcmdmain.c | 34 ++-
programs/conhost/conhost.c | 114 ++++++--
programs/conhost/conhost.h | 2 +
server/console.c | 1 +
12 files changed, 618 insertions(+), 62 deletions(-)
create mode 100644 programs/cmd/tests/interactive_builtins.cmd
create mode 100644 programs/cmd/tests/interactive_builtins.cmd.exp
3
14
Feb. 20, 2022
Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com>
---
dlls/scrrun/filesystem.c | 25 +++++++++++--------------
1 file changed, 11 insertions(+), 14 deletions(-)
diff --git a/dlls/scrrun/filesystem.c b/dlls/scrrun/filesystem.c
index 4794437a71d..0e51929ea54 100644
--- a/dlls/scrrun/filesystem.c
+++ b/dlls/scrrun/filesystem.c
@@ -609,11 +609,14 @@ static HRESULT WINAPI textstream_ReadAll(ITextStream *iface, BSTR *text)
return read_from_buffer(This, This->read_buf_size, text, 0) ? S_FALSE : E_OUTOFMEMORY;
}
-static HRESULT textstream_writestr(struct textstream *stream, BSTR text)
+static HRESULT textstream_write(struct textstream *stream, BSTR text)
{
DWORD written = 0;
BOOL ret;
+ if (textstream_check_iomode(stream, IOWrite))
+ return CTL_E_BADFILEMODE;
+
if (stream->unicode) {
ret = WriteFile(stream->file, text, SysStringByteLen(text), &written, NULL);
return (ret && written == SysStringByteLen(text)) ? S_OK : create_error(GetLastError());
@@ -636,14 +639,11 @@ static HRESULT textstream_writestr(struct textstream *stream, BSTR text)
static HRESULT WINAPI textstream_Write(ITextStream *iface, BSTR text)
{
- struct textstream *This = impl_from_ITextStream(iface);
-
- TRACE("(%p)->(%s)\n", This, debugstr_w(text));
+ struct textstream *stream = impl_from_ITextStream(iface);
- if (textstream_check_iomode(This, IOWrite))
- return CTL_E_BADFILEMODE;
+ TRACE("%p, %s.\n", iface, debugstr_w(text));
- return textstream_writestr(This, text);
+ return textstream_write(stream, text);
}
static HRESULT textstream_writecrlf(struct textstream *stream)
@@ -669,17 +669,14 @@ static HRESULT textstream_writecrlf(struct textstream *stream)
static HRESULT WINAPI textstream_WriteLine(ITextStream *iface, BSTR text)
{
- struct textstream *This = impl_from_ITextStream(iface);
+ struct textstream *stream = impl_from_ITextStream(iface);
HRESULT hr;
- TRACE("(%p)->(%s)\n", This, debugstr_w(text));
-
- if (textstream_check_iomode(This, IOWrite))
- return CTL_E_BADFILEMODE;
+ TRACE("%p, %s.\n", iface, debugstr_w(text));
- hr = textstream_writestr(This, text);
+ hr = textstream_write(stream, text);
if (SUCCEEDED(hr))
- hr = textstream_writecrlf(This);
+ hr = textstream_writecrlf(stream);
return hr;
}
--
2.34.1
1
3
Signed-off-by: Paul Gofman <pgofman(a)codeweavers.com>
---
v4:
- move wine_get_wgl_driver() to user driver and add a special case for dibdrv.
dlls/user32/driver.c | 4 ++-
dlls/win32u/dc.c | 58 +++++++++++++++++++++++++------------
dlls/win32u/dibdrv/dc.c | 11 +------
dlls/win32u/driver.c | 36 +++++++++++++++--------
dlls/win32u/emfdrv.c | 1 -
dlls/win32u/font.c | 1 -
dlls/win32u/ntgdi_private.h | 25 ++++++++++++++++
dlls/win32u/path.c | 1 -
dlls/wineandroid.drv/init.c | 13 ++-------
dlls/winemac.drv/gdi.c | 2 +-
dlls/winemac.drv/macdrv.h | 2 +-
dlls/winemac.drv/opengl.c | 2 +-
dlls/wineps.drv/init.c | 1 -
dlls/winex11.drv/init.c | 13 ++-------
dlls/winex11.drv/xrender.c | 1 -
include/wine/gdi_driver.h | 3 +-
16 files changed, 103 insertions(+), 71 deletions(-)
diff --git a/dlls/user32/driver.c b/dlls/user32/driver.c
index 7e9f63ad1c7..2c5497761a0 100644
--- a/dlls/user32/driver.c
+++ b/dlls/user32/driver.c
@@ -394,7 +394,9 @@ static struct user_driver_funcs lazy_load_driver =
/* vulkan support */
NULL,
/* thread management */
- NULL
+ NULL,
+ /* opengl support */
+ NULL,
};
void CDECL __wine_set_user_driver( const struct user_driver_funcs *funcs, UINT version )
diff --git a/dlls/win32u/dc.c b/dlls/win32u/dc.c
index aed2d3684a7..e7ebb57776b 100644
--- a/dlls/win32u/dc.c
+++ b/dlls/win32u/dc.c
@@ -63,25 +63,6 @@ static const struct gdi_obj_funcs dc_funcs =
};
-static inline DC *get_dc_obj( HDC hdc )
-{
- DWORD type;
- DC *dc = get_any_obj_ptr( hdc, &type );
- if (!dc) return NULL;
-
- switch (type)
- {
- case NTGDI_OBJ_DC:
- case NTGDI_OBJ_MEMDC:
- case NTGDI_OBJ_ENHMETADC:
- return dc;
- default:
- GDI_ReleaseObj( hdc );
- SetLastError( ERROR_INVALID_HANDLE );
- return NULL;
- }
-}
-
/* alloc DC_ATTR from a pool of memory accessible from client */
static DC_ATTR *alloc_dc_attr(void)
{
@@ -310,6 +291,43 @@ DC *get_dc_ptr( HDC hdc )
}
+/***********************************************************************
+ * grab_dc
+ *
+ * Retrieve a DC pointer, increase ref count and release the GDI lock.
+ */
+DC *grab_dc( HDC hdc )
+{
+ DC *dc;
+
+ if (!GDI_inc_ref_count( hdc )) return NULL;
+ if (!(dc = get_dc_obj( hdc )))
+ {
+ GDI_dec_ref_count( hdc );
+ return NULL;
+ }
+ if (dc->attr->disabled)
+ {
+ GDI_dec_ref_count( hdc );
+ GDI_ReleaseObj( hdc );
+ return NULL;
+ }
+ GDI_ReleaseObj( hdc );
+ return dc;
+}
+
+
+/***********************************************************************
+ * put_dc
+ *
+ * Decrease ref count previously increased by grab_dc().
+ */
+void put_dc( HDC hdc )
+{
+ GDI_dec_ref_count( hdc );
+}
+
+
/***********************************************************************
* release_dc_ptr
*/
@@ -816,6 +834,8 @@ HDC WINAPI NtGdiCreateCompatibleDC( HDC hdc )
free_dc_ptr( dc );
return 0;
}
+ dc->dibdrv = TRUE;
+
physDev = GET_DC_PHYSDEV( dc, pSelectBitmap );
physDev->funcs->pSelectBitmap( physDev, dc->hBitmap );
diff --git a/dlls/win32u/dibdrv/dc.c b/dlls/win32u/dibdrv/dc.c
index a96b613d0a3..a91cd76f936 100644
--- a/dlls/win32u/dibdrv/dc.c
+++ b/dlls/win32u/dibdrv/dc.c
@@ -605,7 +605,7 @@ static struct opengl_funcs opengl_funcs =
/**********************************************************************
* dibdrv_wine_get_wgl_driver
*/
-static struct opengl_funcs * CDECL dibdrv_wine_get_wgl_driver( PHYSDEV dev, UINT version )
+struct opengl_funcs *dibdrv_wine_get_wgl_driver( UINT version )
{
if (version != WINE_WGL_DRIVER_VERSION)
{
@@ -715,7 +715,6 @@ const struct gdi_dc_funcs dib_driver =
NULL, /* pUnrealizePalette */
NULL, /* pD3DKMTCheckVidPnExclusiveOwnership */
NULL, /* pD3DKMTSetVidPnSourceOwner */
- dibdrv_wine_get_wgl_driver, /* wine_get_wgl_driver */
GDI_PRIORITY_DIB_DRV /* priority */
};
@@ -1177,13 +1176,6 @@ static INT CDECL windrv_StretchDIBits( PHYSDEV dev, INT x_dst, INT y_dst, INT wi
return ret;
}
-static struct opengl_funcs * CDECL windrv_wine_get_wgl_driver( PHYSDEV dev, UINT version )
-{
- dev = GET_NEXT_PHYSDEV( dev, wine_get_wgl_driver );
- if (dev->funcs == &dib_driver) dev = GET_NEXT_PHYSDEV( dev, wine_get_wgl_driver );
- return dev->funcs->wine_get_wgl_driver( dev, version );
-}
-
static const struct gdi_dc_funcs window_driver =
{
NULL, /* pAbortDoc */
@@ -1277,6 +1269,5 @@ static const struct gdi_dc_funcs window_driver =
NULL, /* pUnrealizePalette */
NULL, /* pD3DKMTCheckVidPnExclusiveOwnership */
NULL, /* pD3DKMTSetVidPnSourceOwner */
- windrv_wine_get_wgl_driver, /* wine_get_wgl_driver */
GDI_PRIORITY_DIB_DRV + 10 /* priority */
};
diff --git a/dlls/win32u/driver.c b/dlls/win32u/driver.c
index 5e6cee33bc6..ea7165bc3ae 100644
--- a/dlls/win32u/driver.c
+++ b/dlls/win32u/driver.c
@@ -571,11 +571,6 @@ static NTSTATUS CDECL nulldrv_D3DKMTSetVidPnSourceOwner( const D3DKMT_SETVIDPNSO
return STATUS_PROCEDURE_NOT_FOUND;
}
-static struct opengl_funcs * CDECL nulldrv_wine_get_wgl_driver( PHYSDEV dev, UINT version )
-{
- return (void *)-1;
-}
-
const struct gdi_dc_funcs null_driver =
{
nulldrv_AbortDoc, /* pAbortDoc */
@@ -669,7 +664,6 @@ const struct gdi_dc_funcs null_driver =
nulldrv_UnrealizePalette, /* pUnrealizePalette */
nulldrv_D3DKMTCheckVidPnExclusiveOwnership, /* pD3DKMTCheckVidPnExclusiveOwnership */
nulldrv_D3DKMTSetVidPnSourceOwner, /* pD3DKMTSetVidPnSourceOwner */
- nulldrv_wine_get_wgl_driver, /* wine_get_wgl_driver */
GDI_PRIORITY_NULL_DRV /* priority */
};
@@ -1373,14 +1367,32 @@ NTSTATUS WINAPI NtGdiDdDDICheckVidPnExclusiveOwnership( const D3DKMT_CHECKVIDPNE
*/
struct opengl_funcs * CDECL __wine_get_wgl_driver( HDC hdc, UINT version )
{
- struct opengl_funcs *ret = NULL;
- DC * dc = get_dc_ptr( hdc );
+ struct opengl_funcs *ret;
+ PHYSDEV physdev;
+ BOOL dibdrv;
+ DC * dc;
+
+ if (!(dc = get_dc_obj( hdc ))) return NULL;
+ if (dc->attr->disabled)
+ {
+ GDI_ReleaseObj( hdc );
+ return NULL;
+ }
+ ret = dc->gl_funcs;
+ dibdrv = dc->dibdrv;
+ GDI_ReleaseObj( hdc );
+
+ if (ret) return ret;
- if (dc)
+ if (dibdrv) ret = dibdrv_wine_get_wgl_driver( version );
+ else
{
- PHYSDEV physdev = GET_DC_PHYSDEV( dc, wine_get_wgl_driver );
- ret = physdev->funcs->wine_get_wgl_driver( physdev, version );
- release_dc_ptr( dc );
+ if (user_driver->pwine_get_wgl_driver) ret = user_driver->pwine_get_wgl_driver( version );
+ else ret = (void *)-1;
}
+ if (!(dc = get_dc_obj( hdc ))) return NULL;
+ if (!dc->gl_funcs) dc->gl_funcs = ret;
+ else ret = dc->gl_funcs;
+ GDI_ReleaseObj( hdc );
return ret;
}
diff --git a/dlls/win32u/emfdrv.c b/dlls/win32u/emfdrv.c
index f261a86e392..81481953288 100644
--- a/dlls/win32u/emfdrv.c
+++ b/dlls/win32u/emfdrv.c
@@ -524,7 +524,6 @@ static const struct gdi_dc_funcs emfdrv_driver =
NULL, /* pUnrealizePalette */
NULL, /* pD3DKMTCheckVidPnExclusiveOwnership */
NULL, /* pD3DKMTSetVidPnSourceOwner */
- NULL, /* wine_get_wgl_driver */
GDI_PRIORITY_GRAPHICS_DRV /* priority */
};
diff --git a/dlls/win32u/font.c b/dlls/win32u/font.c
index b8213ac9e6a..87ef75f04af 100644
--- a/dlls/win32u/font.c
+++ b/dlls/win32u/font.c
@@ -4351,7 +4351,6 @@ const struct gdi_dc_funcs font_driver =
NULL, /* pUnrealizePalette */
NULL, /* pD3DKMTCheckVidPnExclusiveOwnership */
NULL, /* pD3DKMTSetVidPnSourceOwner */
- NULL, /* wine_get_wgl_driver */
GDI_PRIORITY_FONT_DRV /* priority */
};
diff --git a/dlls/win32u/ntgdi_private.h b/dlls/win32u/ntgdi_private.h
index bfeb4557da7..f256ed36d38 100644
--- a/dlls/win32u/ntgdi_private.h
+++ b/dlls/win32u/ntgdi_private.h
@@ -59,6 +59,7 @@ typedef struct tagDC
DCHOOKPROC hookProc; /* DC hook */
BOOL bounds_enabled:1; /* bounds tracking is enabled */
BOOL path_open:1; /* path is currently open (only for saved DCs) */
+ BOOL dibdrv:1; /* memory DC */
RECT device_rect; /* rectangle for the whole device */
int pixel_format; /* pixel format (for memory DCs) */
@@ -87,6 +88,8 @@ typedef struct tagDC
XFORM xformVport2World; /* Inverse of the above transformation */
BOOL vport2WorldValid; /* Is xformVport2World valid? */
RECT bounds; /* Current bounding rect */
+
+ struct opengl_funcs *gl_funcs; /* Opengl driver functions */
} DC;
/* Certain functions will do no further processing if the driver returns this.
@@ -170,6 +173,8 @@ static inline HRGN get_dc_region( DC *dc )
extern DC *alloc_dc_ptr( DWORD magic ) DECLSPEC_HIDDEN;
extern void free_dc_ptr( DC *dc ) DECLSPEC_HIDDEN;
extern DC *get_dc_ptr( HDC hdc ) DECLSPEC_HIDDEN;
+extern DC *grab_dc( HDC hdc ) DECLSPEC_HIDDEN;
+extern void put_dc( HDC hdc ) DECLSPEC_HIDDEN;
extern void release_dc_ptr( DC *dc ) DECLSPEC_HIDDEN;
extern void update_dc( DC *dc ) DECLSPEC_HIDDEN;
extern void DC_InitDC( DC * dc ) DECLSPEC_HIDDEN;
@@ -206,6 +211,7 @@ extern UINT get_dib_dc_color_table( HDC hdc, UINT startpos, UINT entries,
extern UINT set_dib_dc_color_table( HDC hdc, UINT startpos, UINT entries,
const RGBQUAD *colors ) DECLSPEC_HIDDEN;
extern void dibdrv_set_window_surface( DC *dc, struct window_surface *surface ) DECLSPEC_HIDDEN;
+extern struct opengl_funcs *dibdrv_wine_get_wgl_driver( UINT version ) DECLSPEC_HIDDEN;
/* driver.c */
extern const struct gdi_dc_funcs null_driver DECLSPEC_HIDDEN;
@@ -660,6 +666,25 @@ static inline void copy_bitmapinfo( BITMAPINFO *dst, const BITMAPINFO *src )
memcpy( dst, src, get_dib_info_size( src, DIB_RGB_COLORS ));
}
+static inline DC *get_dc_obj( HDC hdc )
+{
+ DWORD type;
+ DC *dc = get_any_obj_ptr( hdc, &type );
+ if (!dc) return NULL;
+
+ switch (type)
+ {
+ case NTGDI_OBJ_DC:
+ case NTGDI_OBJ_MEMDC:
+ case NTGDI_OBJ_ENHMETADC:
+ return dc;
+ default:
+ GDI_ReleaseObj( hdc );
+ SetLastError( ERROR_INVALID_HANDLE );
+ return NULL;
+ }
+}
+
extern void CDECL free_heap_bits( struct gdi_image_bits *bits ) DECLSPEC_HIDDEN;
void set_gdi_client_ptr( HGDIOBJ handle, void *ptr ) DECLSPEC_HIDDEN;
diff --git a/dlls/win32u/path.c b/dlls/win32u/path.c
index a87a7ab06c2..93a124953af 100644
--- a/dlls/win32u/path.c
+++ b/dlls/win32u/path.c
@@ -2121,6 +2121,5 @@ const struct gdi_dc_funcs path_driver =
NULL, /* pUnrealizePalette */
NULL, /* pD3DKMTCheckVidPnExclusiveOwnership */
NULL, /* pD3DKMTSetVidPnSourceOwner */
- NULL, /* wine_get_wgl_driver */
GDI_PRIORITY_PATH_DRV /* priority */
};
diff --git a/dlls/wineandroid.drv/init.c b/dlls/wineandroid.drv/init.c
index ed9116eb47e..7c103475e6b 100644
--- a/dlls/wineandroid.drv/init.c
+++ b/dlls/wineandroid.drv/init.c
@@ -261,16 +261,9 @@ BOOL CDECL ANDROID_EnumDisplaySettingsEx( LPCWSTR name, DWORD n, LPDEVMODEW devm
/**********************************************************************
* ANDROID_wine_get_wgl_driver
*/
-static struct opengl_funcs * CDECL ANDROID_wine_get_wgl_driver( PHYSDEV dev, UINT version )
+static struct opengl_funcs * CDECL ANDROID_wine_get_wgl_driver( UINT version )
{
- struct opengl_funcs *ret;
-
- if (!(ret = get_wgl_driver( version )))
- {
- dev = GET_NEXT_PHYSDEV( dev, wine_get_wgl_driver );
- ret = dev->funcs->wine_get_wgl_driver( dev, version );
- }
- return ret;
+ return get_wgl_driver( version );
}
@@ -279,7 +272,6 @@ static const struct user_driver_funcs android_drv_funcs =
.dc_funcs.pCreateCompatibleDC = ANDROID_CreateCompatibleDC,
.dc_funcs.pCreateDC = ANDROID_CreateDC,
.dc_funcs.pDeleteDC = ANDROID_DeleteDC,
- .dc_funcs.wine_get_wgl_driver = ANDROID_wine_get_wgl_driver,
.dc_funcs.priority = GDI_PRIORITY_GRAPHICS_DRV,
.pGetKeyNameText = ANDROID_GetKeyNameText,
@@ -302,6 +294,7 @@ static const struct user_driver_funcs android_drv_funcs =
.pWindowMessage = ANDROID_WindowMessage,
.pWindowPosChanging = ANDROID_WindowPosChanging,
.pWindowPosChanged = ANDROID_WindowPosChanged,
+ .pwine_get_wgl_driver = ANDROID_wine_get_wgl_driver,
};
diff --git a/dlls/winemac.drv/gdi.c b/dlls/winemac.drv/gdi.c
index 40ba4c570c5..264781c6ac1 100644
--- a/dlls/winemac.drv/gdi.c
+++ b/dlls/winemac.drv/gdi.c
@@ -268,7 +268,6 @@ static const struct user_driver_funcs macdrv_funcs =
.dc_funcs.pGetDeviceCaps = macdrv_GetDeviceCaps,
.dc_funcs.pGetDeviceGammaRamp = macdrv_GetDeviceGammaRamp,
.dc_funcs.pSetDeviceGammaRamp = macdrv_SetDeviceGammaRamp,
- .dc_funcs.wine_get_wgl_driver = macdrv_wine_get_wgl_driver,
.dc_funcs.priority = GDI_PRIORITY_GRAPHICS_DRV,
.pActivateKeyboardLayout = macdrv_ActivateKeyboardLayout,
@@ -309,6 +308,7 @@ static const struct user_driver_funcs macdrv_funcs =
.pWindowPosChanged = macdrv_WindowPosChanged,
.pWindowPosChanging = macdrv_WindowPosChanging,
.pwine_get_vulkan_driver = macdrv_wine_get_vulkan_driver,
+ .pwine_get_wgl_driver = macdrv_wine_get_wgl_driver,
};
diff --git a/dlls/winemac.drv/macdrv.h b/dlls/winemac.drv/macdrv.h
index 0bd0a18f111..4e4524722af 100644
--- a/dlls/winemac.drv/macdrv.h
+++ b/dlls/winemac.drv/macdrv.h
@@ -263,7 +263,7 @@ extern DWORD CDECL macdrv_MsgWaitForMultipleObjectsEx(DWORD count, const HANDLE
extern BOOL query_drag_exited(macdrv_query* query) DECLSPEC_HIDDEN;
extern BOOL query_drag_drop(macdrv_query* query) DECLSPEC_HIDDEN;
-extern struct opengl_funcs * CDECL macdrv_wine_get_wgl_driver(PHYSDEV dev, UINT version) DECLSPEC_HIDDEN;
+extern struct opengl_funcs * CDECL macdrv_wine_get_wgl_driver(UINT version) DECLSPEC_HIDDEN;
extern const struct vulkan_funcs * CDECL macdrv_wine_get_vulkan_driver(UINT version) DECLSPEC_HIDDEN;
extern void sync_gl_view(struct macdrv_win_data* data, const RECT* old_whole_rect, const RECT* old_client_rect) DECLSPEC_HIDDEN;
diff --git a/dlls/winemac.drv/opengl.c b/dlls/winemac.drv/opengl.c
index daf194c2aec..02ac613ddc9 100644
--- a/dlls/winemac.drv/opengl.c
+++ b/dlls/winemac.drv/opengl.c
@@ -4632,7 +4632,7 @@ static struct opengl_funcs opengl_funcs =
/**********************************************************************
* macdrv_wine_get_wgl_driver
*/
-struct opengl_funcs * CDECL macdrv_wine_get_wgl_driver(PHYSDEV dev, UINT version)
+struct opengl_funcs * CDECL macdrv_wine_get_wgl_driver(UINT version)
{
static INIT_ONCE opengl_init = INIT_ONCE_STATIC_INIT;
diff --git a/dlls/wineps.drv/init.c b/dlls/wineps.drv/init.c
index 9e32bf31d1f..5a01a97973f 100644
--- a/dlls/wineps.drv/init.c
+++ b/dlls/wineps.drv/init.c
@@ -858,7 +858,6 @@ static const struct gdi_dc_funcs psdrv_funcs =
NULL, /* pUnrealizePalette */
NULL, /* pD3DKMTCheckVidPnExclusiveOwnership */
NULL, /* pD3DKMTSetVidPnSourceOwner */
- NULL, /* wine_get_wgl_driver */
GDI_PRIORITY_GRAPHICS_DRV /* priority */
};
diff --git a/dlls/winex11.drv/init.c b/dlls/winex11.drv/init.c
index 5b31c352a23..35bf47c2e74 100644
--- a/dlls/winex11.drv/init.c
+++ b/dlls/winex11.drv/init.c
@@ -312,16 +312,9 @@ static INT CDECL X11DRV_ExtEscape( PHYSDEV dev, INT escape, INT in_count, LPCVOI
/**********************************************************************
* X11DRV_wine_get_wgl_driver
*/
-static struct opengl_funcs * CDECL X11DRV_wine_get_wgl_driver( PHYSDEV dev, UINT version )
+static struct opengl_funcs * CDECL X11DRV_wine_get_wgl_driver( UINT version )
{
- struct opengl_funcs *ret;
-
- if (!(ret = get_glx_driver( version )))
- {
- dev = GET_NEXT_PHYSDEV( dev, wine_get_wgl_driver );
- ret = dev->funcs->wine_get_wgl_driver( dev, version );
- }
- return ret;
+ return get_glx_driver( version );
}
/**********************************************************************
@@ -377,7 +370,6 @@ static const struct user_driver_funcs x11drv_funcs =
.dc_funcs.pUnrealizePalette = X11DRV_UnrealizePalette,
.dc_funcs.pD3DKMTCheckVidPnExclusiveOwnership = X11DRV_D3DKMTCheckVidPnExclusiveOwnership,
.dc_funcs.pD3DKMTSetVidPnSourceOwner = X11DRV_D3DKMTSetVidPnSourceOwner,
- .dc_funcs.wine_get_wgl_driver = X11DRV_wine_get_wgl_driver,
.dc_funcs.priority = GDI_PRIORITY_GRAPHICS_DRV,
.pActivateKeyboardLayout = X11DRV_ActivateKeyboardLayout,
@@ -418,6 +410,7 @@ static const struct user_driver_funcs x11drv_funcs =
.pWindowPosChanging = X11DRV_WindowPosChanging,
.pWindowPosChanged = X11DRV_WindowPosChanged,
.pSystemParametersInfo = X11DRV_SystemParametersInfo,
+ .pwine_get_wgl_driver = X11DRV_wine_get_wgl_driver,
.pwine_get_vulkan_driver = X11DRV_wine_get_vulkan_driver,
.pThreadDetach = X11DRV_ThreadDetach,
};
diff --git a/dlls/winex11.drv/xrender.c b/dlls/winex11.drv/xrender.c
index 92dc35fa9e1..5ede97fb026 100644
--- a/dlls/winex11.drv/xrender.c
+++ b/dlls/winex11.drv/xrender.c
@@ -2246,7 +2246,6 @@ static const struct gdi_dc_funcs xrender_funcs =
NULL, /* pUnrealizePalette */
NULL, /* pD3DKMTCheckVidPnExclusiveOwnership */
NULL, /* pD3DKMTSetVidPnSourceOwner */
- NULL, /* wine_get_wgl_driver */
GDI_PRIORITY_GRAPHICS_DRV + 10 /* priority */
};
diff --git a/include/wine/gdi_driver.h b/include/wine/gdi_driver.h
index 567a6c21608..24a4bba1c8b 100644
--- a/include/wine/gdi_driver.h
+++ b/include/wine/gdi_driver.h
@@ -159,7 +159,6 @@ struct gdi_dc_funcs
BOOL (CDECL *pUnrealizePalette)(HPALETTE);
NTSTATUS (CDECL *pD3DKMTCheckVidPnExclusiveOwnership)(const D3DKMT_CHECKVIDPNEXCLUSIVEOWNERSHIP *);
NTSTATUS (CDECL *pD3DKMTSetVidPnSourceOwner)(const D3DKMT_SETVIDPNSOURCEOWNER *);
- struct opengl_funcs * (CDECL *wine_get_wgl_driver)(PHYSDEV,UINT);
/* priority order for the driver on the stack */
UINT priority;
@@ -323,6 +322,8 @@ struct user_driver_funcs
const struct vulkan_funcs * (CDECL *pwine_get_vulkan_driver)(UINT);
/* thread management */
void (CDECL *pThreadDetach)(void);
+ /* opengl support */
+ struct opengl_funcs * (CDECL *pwine_get_wgl_driver)(UINT);
};
extern void CDECL __wine_set_user_driver( const struct user_driver_funcs *funcs, UINT version );
--
2.35.1
2
3
[PATCH] mfreadwrite: Return IMFSourceReaderEx interface for source reader.
by Alistair Leslie-Hughes Feb. 20, 2022
by Alistair Leslie-Hughes Feb. 20, 2022
Feb. 20, 2022
Windows 8 and above return an IMFSourceReaderEx interface by default.
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com>
---
dlls/mfreadwrite/reader.c | 108 +++++++++++++++++++++-----------
dlls/mfreadwrite/tests/mfplat.c | 6 ++
2 files changed, 78 insertions(+), 36 deletions(-)
diff --git a/dlls/mfreadwrite/reader.c b/dlls/mfreadwrite/reader.c
index bdf2e7f5a6f..133403f77d3 100644
--- a/dlls/mfreadwrite/reader.c
+++ b/dlls/mfreadwrite/reader.c
@@ -150,7 +150,7 @@ enum source_reader_flags
struct source_reader
{
- IMFSourceReader IMFSourceReader_iface;
+ IMFSourceReaderEx IMFSourceReaderEx_iface;
IMFAsyncCallback source_events_callback;
IMFAsyncCallback stream_events_callback;
IMFAsyncCallback async_commands_callback;
@@ -176,9 +176,9 @@ struct source_reader
CONDITION_VARIABLE stop_event;
};
-static inline struct source_reader *impl_from_IMFSourceReader(IMFSourceReader *iface)
+static inline struct source_reader *impl_from_IMFSourceReaderEx(IMFSourceReaderEx *iface)
{
- return CONTAINING_RECORD(iface, struct source_reader, IMFSourceReader_iface);
+ return CONTAINING_RECORD(iface, struct source_reader, IMFSourceReaderEx_iface);
}
static struct source_reader *impl_from_source_callback_IMFAsyncCallback(IMFAsyncCallback *iface)
@@ -1360,16 +1360,17 @@ static const IMFAsyncCallbackVtbl async_commands_callback_vtbl =
source_reader_async_commands_callback_Invoke,
};
-static HRESULT WINAPI src_reader_QueryInterface(IMFSourceReader *iface, REFIID riid, void **out)
+static HRESULT WINAPI src_reader_QueryInterface(IMFSourceReaderEx *iface, REFIID riid, void **out)
{
- struct source_reader *reader = impl_from_IMFSourceReader(iface);
+ struct source_reader *reader = impl_from_IMFSourceReaderEx(iface);
TRACE("%p, %s, %p.\n", iface, debugstr_guid(riid), out);
if(IsEqualGUID(riid, &IID_IUnknown) ||
- IsEqualGUID(riid, &IID_IMFSourceReader))
+ IsEqualGUID(riid, &IID_IMFSourceReader) ||
+ IsEqualGUID(riid, &IID_IMFSourceReaderEx))
{
- *out = &reader->IMFSourceReader_iface;
+ *out = &reader->IMFSourceReaderEx_iface;
}
else
{
@@ -1382,9 +1383,9 @@ static HRESULT WINAPI src_reader_QueryInterface(IMFSourceReader *iface, REFIID r
return S_OK;
}
-static ULONG WINAPI src_reader_AddRef(IMFSourceReader *iface)
+static ULONG WINAPI src_reader_AddRef(IMFSourceReaderEx *iface)
{
- struct source_reader *reader = impl_from_IMFSourceReader(iface);
+ struct source_reader *reader = impl_from_IMFSourceReaderEx(iface);
ULONG refcount = InterlockedIncrement(&reader->public_refcount);
TRACE("%p, refcount %lu.\n", iface, refcount);
@@ -1408,9 +1409,9 @@ static BOOL source_reader_is_source_stopped(const struct source_reader *reader)
return TRUE;
}
-static ULONG WINAPI src_reader_Release(IMFSourceReader *iface)
+static ULONG WINAPI src_reader_Release(IMFSourceReaderEx *iface)
{
- struct source_reader *reader = impl_from_IMFSourceReader(iface);
+ struct source_reader *reader = impl_from_IMFSourceReaderEx(iface);
ULONG refcount = InterlockedDecrement(&reader->public_refcount);
TRACE("%p, refcount %lu.\n", iface, refcount);
@@ -1436,9 +1437,9 @@ static ULONG WINAPI src_reader_Release(IMFSourceReader *iface)
return refcount;
}
-static HRESULT WINAPI src_reader_GetStreamSelection(IMFSourceReader *iface, DWORD index, BOOL *selected)
+static HRESULT WINAPI src_reader_GetStreamSelection(IMFSourceReaderEx *iface, DWORD index, BOOL *selected)
{
- struct source_reader *reader = impl_from_IMFSourceReader(iface);
+ struct source_reader *reader = impl_from_IMFSourceReaderEx(iface);
TRACE("%p, %#lx, %p.\n", iface, index, selected);
@@ -1457,9 +1458,9 @@ static HRESULT WINAPI src_reader_GetStreamSelection(IMFSourceReader *iface, DWOR
return source_reader_get_stream_selection(reader, index, selected);
}
-static HRESULT WINAPI src_reader_SetStreamSelection(IMFSourceReader *iface, DWORD index, BOOL selection)
+static HRESULT WINAPI src_reader_SetStreamSelection(IMFSourceReaderEx *iface, DWORD index, BOOL selection)
{
- struct source_reader *reader = impl_from_IMFSourceReader(iface);
+ struct source_reader *reader = impl_from_IMFSourceReaderEx(iface);
HRESULT hr = S_OK;
BOOL selection_changed = FALSE, selected;
unsigned int i;
@@ -1562,19 +1563,19 @@ static HRESULT source_reader_get_native_media_type(struct source_reader *reader,
return hr;
}
-static HRESULT WINAPI src_reader_GetNativeMediaType(IMFSourceReader *iface, DWORD index, DWORD type_index,
+static HRESULT WINAPI src_reader_GetNativeMediaType(IMFSourceReaderEx *iface, DWORD index, DWORD type_index,
IMFMediaType **type)
{
- struct source_reader *reader = impl_from_IMFSourceReader(iface);
+ struct source_reader *reader = impl_from_IMFSourceReaderEx(iface);
TRACE("%p, %#lx, %#lx, %p.\n", iface, index, type_index, type);
return source_reader_get_native_media_type(reader, index, type_index, type);
}
-static HRESULT WINAPI src_reader_GetCurrentMediaType(IMFSourceReader *iface, DWORD index, IMFMediaType **type)
+static HRESULT WINAPI src_reader_GetCurrentMediaType(IMFSourceReaderEx *iface, DWORD index, IMFMediaType **type)
{
- struct source_reader *reader = impl_from_IMFSourceReader(iface);
+ struct source_reader *reader = impl_from_IMFSourceReaderEx(iface);
HRESULT hr;
TRACE("%p, %#lx, %p.\n", iface, index, type);
@@ -1832,10 +1833,10 @@ static HRESULT source_reader_create_decoder_for_stream(struct source_reader *rea
return MF_E_TOPO_CODEC_NOT_FOUND;
}
-static HRESULT WINAPI src_reader_SetCurrentMediaType(IMFSourceReader *iface, DWORD index, DWORD *reserved,
+static HRESULT WINAPI src_reader_SetCurrentMediaType(IMFSourceReaderEx *iface, DWORD index, DWORD *reserved,
IMFMediaType *type)
{
- struct source_reader *reader = impl_from_IMFSourceReader(iface);
+ struct source_reader *reader = impl_from_IMFSourceReaderEx(iface);
HRESULT hr;
TRACE("%p, %#lx, %p, %p.\n", iface, index, reserved, type);
@@ -1870,9 +1871,9 @@ static HRESULT WINAPI src_reader_SetCurrentMediaType(IMFSourceReader *iface, DWO
return hr;
}
-static HRESULT WINAPI src_reader_SetCurrentPosition(IMFSourceReader *iface, REFGUID format, REFPROPVARIANT position)
+static HRESULT WINAPI src_reader_SetCurrentPosition(IMFSourceReaderEx *iface, REFGUID format, REFPROPVARIANT position)
{
- struct source_reader *reader = impl_from_IMFSourceReader(iface);
+ struct source_reader *reader = impl_from_IMFSourceReaderEx(iface);
struct source_reader_async_command *command;
unsigned int i;
DWORD flags;
@@ -2017,10 +2018,10 @@ static HRESULT source_reader_read_sample_async(struct source_reader *reader, uns
return hr;
}
-static HRESULT WINAPI src_reader_ReadSample(IMFSourceReader *iface, DWORD index, DWORD flags, DWORD *actual_index,
+static HRESULT WINAPI src_reader_ReadSample(IMFSourceReaderEx *iface, DWORD index, DWORD flags, DWORD *actual_index,
DWORD *stream_flags, LONGLONG *timestamp, IMFSample **sample)
{
- struct source_reader *reader = impl_from_IMFSourceReader(iface);
+ struct source_reader *reader = impl_from_IMFSourceReaderEx(iface);
HRESULT hr;
TRACE("%p, %#lx, %#lx, %p, %p, %p, %p\n", iface, index, flags, actual_index, stream_flags, timestamp, sample);
@@ -2079,9 +2080,9 @@ static HRESULT source_reader_flush_async(struct source_reader *reader, unsigned
return hr;
}
-static HRESULT WINAPI src_reader_Flush(IMFSourceReader *iface, DWORD index)
+static HRESULT WINAPI src_reader_Flush(IMFSourceReaderEx *iface, DWORD index)
{
- struct source_reader *reader = impl_from_IMFSourceReader(iface);
+ struct source_reader *reader = impl_from_IMFSourceReaderEx(iface);
HRESULT hr;
TRACE("%p, %#lx.\n", iface, index);
@@ -2098,10 +2099,10 @@ static HRESULT WINAPI src_reader_Flush(IMFSourceReader *iface, DWORD index)
return hr;
}
-static HRESULT WINAPI src_reader_GetServiceForStream(IMFSourceReader *iface, DWORD index, REFGUID service,
+static HRESULT WINAPI src_reader_GetServiceForStream(IMFSourceReaderEx *iface, DWORD index, REFGUID service,
REFIID riid, void **object)
{
- struct source_reader *reader = impl_from_IMFSourceReader(iface);
+ struct source_reader *reader = impl_from_IMFSourceReaderEx(iface);
IUnknown *obj = NULL;
HRESULT hr = S_OK;
@@ -2160,10 +2161,10 @@ static HRESULT WINAPI src_reader_GetServiceForStream(IMFSourceReader *iface, DWO
return hr;
}
-static HRESULT WINAPI src_reader_GetPresentationAttribute(IMFSourceReader *iface, DWORD index,
+static HRESULT WINAPI src_reader_GetPresentationAttribute(IMFSourceReaderEx *iface, DWORD index,
REFGUID guid, PROPVARIANT *value)
{
- struct source_reader *reader = impl_from_IMFSourceReader(iface);
+ struct source_reader *reader = impl_from_IMFSourceReaderEx(iface);
IMFStreamDescriptor *sd;
BOOL selected;
HRESULT hr;
@@ -2208,7 +2209,38 @@ static HRESULT WINAPI src_reader_GetPresentationAttribute(IMFSourceReader *iface
return hr;
}
-static const IMFSourceReaderVtbl srcreader_vtbl =
+static HRESULT WINAPI src_reader_SetNativeMediaType(IMFSourceReaderEx *iface, DWORD stream_index,
+ IMFMediaType *media_type, DWORD *stream_flags)
+{
+ FIXME("%p, %#lx, %p, %p\n", iface, stream_index, media_type, stream_flags);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI src_reader_AddTransformForStream(IMFSourceReaderEx *iface, DWORD stream_index,
+ IUnknown *transform)
+{
+ FIXME("%p, %#lx, %p\n", iface, stream_index, transform);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI src_reader_RemoveAllTransformsForStream(IMFSourceReaderEx *iface, DWORD stream_index)
+{
+ FIXME("%p, %#lx\n", iface, stream_index);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI src_reader_GetTransformForStream(IMFSourceReaderEx *iface, DWORD stream_index,
+ DWORD transform_index, GUID *category, IMFTransform **transform)
+{
+ FIXME("%p, %#lx, %#lx, %p, %p\n", iface, stream_index, transform_index, category, transform);
+
+ return E_NOTIMPL;
+}
+
+static const IMFSourceReaderExVtbl srcreader_vtbl =
{
src_reader_QueryInterface,
src_reader_AddRef,
@@ -2222,7 +2254,11 @@ static const IMFSourceReaderVtbl srcreader_vtbl =
src_reader_ReadSample,
src_reader_Flush,
src_reader_GetServiceForStream,
- src_reader_GetPresentationAttribute
+ src_reader_GetPresentationAttribute,
+ src_reader_SetNativeMediaType,
+ src_reader_AddTransformForStream,
+ src_reader_RemoveAllTransformsForStream,
+ src_reader_GetTransformForStream
};
static DWORD reader_get_first_stream_index(IMFPresentationDescriptor *descriptor, const GUID *major)
@@ -2324,7 +2360,7 @@ static HRESULT create_source_reader_from_source(IMFMediaSource *source, IMFAttri
if (!object)
return E_OUTOFMEMORY;
- object->IMFSourceReader_iface.lpVtbl = &srcreader_vtbl;
+ object->IMFSourceReaderEx_iface.lpVtbl = &srcreader_vtbl;
object->source_events_callback.lpVtbl = &source_events_callback_vtbl;
object->stream_events_callback.lpVtbl = &stream_events_callback_vtbl;
object->async_commands_callback.lpVtbl = &async_commands_callback_vtbl;
@@ -2445,10 +2481,10 @@ static HRESULT create_source_reader_from_source(IMFMediaSource *source, IMFAttri
WARN("Failed to acquired shared queue, hr %#lx.\n", hr);
if (SUCCEEDED(hr))
- hr = IMFSourceReader_QueryInterface(&object->IMFSourceReader_iface, riid, out);
+ hr = IMFSourceReaderEx_QueryInterface(&object->IMFSourceReaderEx_iface, riid, out);
failed:
- IMFSourceReader_Release(&object->IMFSourceReader_iface);
+ IMFSourceReaderEx_Release(&object->IMFSourceReaderEx_iface);
return hr;
}
diff --git a/dlls/mfreadwrite/tests/mfplat.c b/dlls/mfreadwrite/tests/mfplat.c
index fcf642859d5..01881bcb387 100644
--- a/dlls/mfreadwrite/tests/mfplat.c
+++ b/dlls/mfreadwrite/tests/mfplat.c
@@ -890,6 +890,7 @@ static void test_source_reader_from_media_source(void)
{
struct async_callback *callback;
IMFSourceReader *reader;
+ IMFSourceReaderEx *readerex;
IMFMediaSource *source;
IMFMediaType *media_type;
HRESULT hr;
@@ -907,6 +908,11 @@ static void test_source_reader_from_media_source(void)
hr = MFCreateSourceReaderFromMediaSource(source, NULL, &reader);
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
+ hr = IMFSourceReader_QueryInterface(reader, &IID_IMFSourceReaderEx, (void**)&readerex);
+ ok(hr == S_OK || broken(hr == E_NOINTERFACE) /* Windows 7 and below.*/, "Unexpected hr %#lx.\n", hr);
+ if (readerex)
+ IMFSourceReaderEx_Release(readerex);
+
/* MF_SOURCE_READER_ANY_STREAM */
hr = IMFSourceReader_SetStreamSelection(reader, 0, FALSE);
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
--
2.34.1
2
1
[PATCH 1/2] Add test for RedrawWindow with both validate and internal paint flags.
by Roman Pišl Feb. 19, 2022
by Roman Pišl Feb. 19, 2022
Feb. 19, 2022
Signed-off-by: Roman Pišl <rpisl(a)seznam.cz>
---
dlls/user32/tests/msg.c | 32 +++++++++++++++++++++++++++++++-
1 file changed, 31 insertions(+), 1 deletion(-)
diff --git a/dlls/user32/tests/msg.c b/dlls/user32/tests/msg.c
index f0e0d0fba76..689ad7161f5 100644
--- a/dlls/user32/tests/msg.c
+++ b/dlls/user32/tests/msg.c
@@ -140,7 +140,8 @@ typedef enum {
hook=0x100,
winevent_hook=0x200,
kbd_hook=0x400,
- winevent_hook_todo=0x800
+ winevent_hook_todo=0x800,
+ has_update=0x1000
} msg_flags_t;
struct message {
@@ -2819,6 +2820,10 @@ static void ok_sequence_(const struct message *expected_list, const char *contex
context, count, expected->message);
if ((expected->flags & kbd_hook) != (actual->flags & kbd_hook)) dump++;
+ todo_wine_if(expected->flags & has_update)
+ ok_( file, line) (!(expected->flags & has_update) || (actual->flags & has_update),
+ "%s: %u: the msg 0x%04x should have update region\n", context, count, expected->message );
+
expected++;
actual++;
}
@@ -8270,6 +8275,11 @@ static const struct message WmPaint[] = {
{ 0 }
};
+static const struct message WmPaintUpdate[] = {
+ { WM_PAINT, sent|has_update },
+ { 0 }
+};
+
static const struct message WmParentOnlyPaint[] = {
{ WM_PAINT, sent|parent },
{ 0 }
@@ -8585,6 +8595,13 @@ static void test_paint_messages(void)
RedrawWindow( hwnd, NULL, hrgn, RDW_VALIDATE | RDW_NOERASE | RDW_UPDATENOW );
ok_sequence( WmPaint, "Paint", FALSE );
+ flush_sequence();
+ SetRectRgn( hrgn, 0, 0, 100, 100 );
+ RedrawWindow( hwnd, NULL, hrgn, RDW_INVALIDATE | RDW_ERASE );
+ SetRectRgn( hrgn, 0, 0, 50, 50 );
+ RedrawWindow( hwnd, NULL, hrgn, RDW_VALIDATE | RDW_NOERASE | RDW_UPDATENOW | RDW_NOFRAME );
+ ok_sequence( WmPaint, "Paint", FALSE );
+
flush_sequence();
SetRectRgn( hrgn, -4, -4, -2, -2 );
RedrawWindow( hwnd, NULL, hrgn, RDW_INVALIDATE | RDW_FRAME );
@@ -8629,6 +8646,16 @@ static void test_paint_messages(void)
}
ok_sequence( WmGetUpdateRect, "GetUpdateRect", FALSE );
+ /* RedrawWindow with both RDW_VALIDATE and RDW_INTERNALPAINT triggers WM_PAINT with non-empty update region */
+ flush_sequence();
+ InvalidateRect( hwnd, NULL, FALSE );
+ GetClientRect( hwnd, &rect );
+ SetRectRgn(hrgn, rect.left, rect.top, rect.right, rect.bottom );
+ check_update_rgn( hwnd, hrgn );
+ RedrawWindow( hwnd, &rect, NULL, RDW_VALIDATE | RDW_NOERASE | RDW_UPDATENOW | RDW_NOFRAME | RDW_INTERNALPAINT );
+ check_update_rgn( hwnd, 0 );
+ ok_sequence( WmPaintUpdate, "PaintUpdate", FALSE );
+
DestroyWindow( hwnd );
/* now test with a child window */
@@ -9949,6 +9976,9 @@ static LRESULT MsgCheckProc (BOOL unicode, HWND hwnd, UINT message,
msg.flags = sent|wparam|lparam;
if (defwndproc_counter) msg.flags |= defwinproc;
if (beginpaint_counter) msg.flags |= beginpaint;
+
+ if (message == WM_PAINT && GetUpdateRect(hwnd, NULL, FALSE)) msg.flags |= has_update;
+
msg.wParam = wParam;
msg.lParam = lParam;
msg.descr = "MsgCheckProc";
--
2.30.2
3
5
Feb. 19, 2022
A search with wMin != 0xFFFF should match only if the actual version found
matches the major and is is >= the minor version requested (preferring
an exact match if one is available)
Signed-off-by: Kevin Puetz <PuetzKevinA(a)JohnDeere.com>
--
Wine's RegisterTypeLib and QueryPathOfRegTypeLib format typelib version
in the registery keys as hex. This appears to be correct.
However, do_typelib_reg_key in oleaut32/tests was inconsistent with this
and formatted them in decimal. This caused the 3.40 test case to not be
checking what it meant to; it *should* failing because there is nothing
registered >= 3.40. But it succeeded because we had actually registered
the string "3.37", which means 0x37 == 3.55 (which meets >= 3.40).
This didn't trip up the other cases becuase 1 == 0x1. and 0x22 == 34 <= 3.37.
so their choice between 3.0,3.1, and 3.37 still reached the same answer.
This seems to have just been a latent bug (in the test) all the way
back to the introduction of the test in a1914dbbb8. do_typelib_reg_key
got overlooked when wine was fixed to match windows and format these
in hex in a59e4899f5, and this hex-vs-decimal mismatch vs windows
hid the version-comparison bug.
---
dlls/oleaut32/tests/typelib.c | 4 ++--
dlls/oleaut32/typelib.c | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/dlls/oleaut32/tests/typelib.c b/dlls/oleaut32/tests/typelib.c
index 4266243c1ba..6bfc50642a4 100644
--- a/dlls/oleaut32/tests/typelib.c
+++ b/dlls/oleaut32/tests/typelib.c
@@ -1521,7 +1521,7 @@ cleanup:
static BOOL do_typelib_reg_key(GUID *uid, WORD maj, WORD min, DWORD arch, LPCWSTR base, BOOL remove)
{
static const WCHAR typelibW[] = {'T','y','p','e','l','i','b','\\',0};
- static const WCHAR formatW[] = {'\\','%','u','.','%','u','\\','0','\\','w','i','n','%','u',0};
+ static const WCHAR formatW[] = {'\\','%','x','.','%','x','\\','0','\\','w','i','n','%','u',0};
static const WCHAR format2W[] = {'%','s','_','%','u','_','%','u','.','d','l','l',0};
WCHAR buf[128];
HKEY hkey;
@@ -1578,7 +1578,7 @@ static void test_QueryPathOfRegTypeLib(DWORD arch)
{ 3, 1, S_OK, {'f','a','k','e','_','3','_','1','.','d','l','l',0 } },
{ 3, 22, S_OK, {'f','a','k','e','_','3','_','3','7','.','d','l','l',0 } },
{ 3, 37, S_OK, {'f','a','k','e','_','3','_','3','7','.','d','l','l',0 } },
- { 3, 40, S_OK, {'f','a','k','e','_','3','_','3','7','.','d','l','l',0 } },
+ { 3, 40, TYPE_E_LIBNOTREGISTERED, { 0 } },
{ 0xffff, 0xffff, S_OK, {'f','a','k','e','_','5','_','3','7','.','d','l','l',0 } },
{ 0xffff, 0, TYPE_E_LIBNOTREGISTERED, { 0 } },
{ 3, 0xffff, TYPE_E_LIBNOTREGISTERED, { 0 } },
diff --git a/dlls/oleaut32/typelib.c b/dlls/oleaut32/typelib.c
index cdc48e9c7fe..7f10bcc968d 100644
--- a/dlls/oleaut32/typelib.c
+++ b/dlls/oleaut32/typelib.c
@@ -207,7 +207,7 @@ static BOOL find_typelib_key( REFGUID guid, WORD *wMaj, WORD *wMin )
best_min = v_min;
break; /* exact match */
}
- if (*wMin != 0xffff && v_min > best_min) best_min = v_min;
+ if (*wMin != 0xffff && v_min >= *wMin && v_min > best_min) best_min = v_min;
}
}
len = sizeof(key_name);
--
2.34.1
1
0
Over the years, Wine prefixes have gotten bigger and bigger, for a
number of reasons. Creating a new Wine prefix for each application is
still the current recommendation, as despite the best efforts of Wine
developers, some applications still require system-wide workarounds.
This leads to significant bloat for each application installed. With a
MinGW build of Wine without Mono or Gecko, new 32-bit prefixes are over
150 MB, and new 64-bit prefixes are over 300 MB. The vast majority of
these files are byte-for-byte identical to Wine's central DLL copies.
This patch set implements reflink support in Wine via the
copy_file_range syscall. The reasons for selecting copy_file_range over
FICLONE are outlined in patch 2. A previous unpublished version of this
patch set used FICLONERANGE, but it was less convenient to use from
setupapi and has inferior system support.
When reflink is supported by the underlying filesystem, new Wine prefix
sizes with Mono and Gecko disabled are reduced to less than 1 MB. The
resulting Wine prefix is byte-for-byte identical to one created without
reflink, but occupies less space on disk. If hard links or symlinks were
used, if an application such as winetricks writes to a system file, it
would overwrite the central copy. With reflink, the file blocks will be
transparently copied by the Linux kernel so that each Wine prefix can be
independent.
Some files cannot be deduplicated in the current Wine system, as they
are dynamically generated during the Wine prefix installation process.
These include 16-bit fake DLLs and manifest files. In theory, it should
be possible to pre-generate these files, but considering the Wine prefix
size is already reduced to less than 1 MB, the extra space savings are
likely not worth the effort.
v1->v2: Fix/improve errno handling.
v2->v3: Rebase.
Alex Xu (Hello71) (5):
ntdll: add support for IOCTL_COPYCHUNK.
kernelbase: use IOCTL_COPYCHUNK in CopyFile*
setupapi: Use IOCTL_COPYCHUNK, avoid buffering whole file
lmshare.h: define STYPE_TEMPORARY
kernel32/tests: add IOCTL_COPYCHUNK test
configure | 6 ++
configure.ac | 1 +
dlls/kernel32/tests/file.c | 137 +++++++++++++++++++++++++
dlls/kernelbase/file.c | 44 ++++-----
dlls/ntdll/unix/file.c | 121 +++++++++++++++++++++++
dlls/setupapi/fakedll.c | 198 ++++++++++++++++++++-----------------
include/config.h.in | 3 +
include/lmshare.h | 11 ++-
include/winioctl.h | 34 +++++++
9 files changed, 434 insertions(+), 121 deletions(-)
--
2.35.0
4
11
[PATCH] winex11.drv: Change fullscreen state even when processing events.
by Esme Povirk Feb. 19, 2022
by Esme Povirk Feb. 19, 2022
Feb. 19, 2022
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=52532
Signed-off-by: Esme Povirk <esme(a)codeweavers.com>
---
dlls/winex11.drv/window.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c
index 36fb41ac710..42f25e9f534 100644
--- a/dlls/winex11.drv/window.c
+++ b/dlls/winex11.drv/window.c
@@ -2536,7 +2536,10 @@ void CDECL X11DRV_WindowPosChanged( HWND hwnd, HWND insert_after, UINT swp_flags
else
{
if (swp_flags & (SWP_FRAMECHANGED|SWP_STATECHANGED)) set_wm_hints( data );
- if (!event_type) update_net_wm_states( data );
+ if (!event_type ||
+ ((swp_flags & (SWP_NOMOVE|SWP_NOSIZE)) != (SWP_NOMOVE|SWP_NOSIZE) &&
+ (is_window_rect_full_screen( &old_whole_rect ) != is_window_rect_full_screen( &data->whole_rect ))))
+ update_net_wm_states( data );
}
}
--
2.30.2
1
0
Hello,
I'm trying to build latest WINE.git for Aarch64.
My system is:
uname -a
Linux debian 5.14.0-4-amd64 #1 SMP Debian 5.14.16-1 (2021-11-03) x86_64 GNU/Linux
I compiled successfully WINE for AMD64, so I have the tools.
Next, I installed the aarch64-linux-gnu cross compiler and the latest clang packages available.
Finally, I configured with:
../configure --host=aarch64-linux-gnu host_alias=aarch64-linux-gnu --with-wine-tools=../wine_amd64_build/ --without-freetype --without-x --enable-win64
as it is described here:
https://wiki.winehq.org/ARM64
but unfortunately it does not work.
The configure process hangs with this message:
checking whether aarch64-linux-gnu-gcc supports __builtin_ms_va_list... no
configure: error: You need clang >= 5.0 to build Wine for arm64.
It seems that I'm missing something and sadly the wiki does not give enough information.
I suspect that those information are completely wrong or just outdated, if you need to use clang for building for ARM64.
Can you give me some advice about which other packages I must install (if any) and/or if there are more things to do, like setting the clang options like target/sysroot/etc?
Talking about the build process, in my opinion it would be worth to integrate that wiki page with such information, if it's possible.
Sincerely.
3
2
Feb. 19, 2022
Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com>
---
dlls/usp10/tests/Makefile.in | 1 -
dlls/usp10/tests/usp10.c | 473 +++++++++++++++++------------------
2 files changed, 234 insertions(+), 240 deletions(-)
diff --git a/dlls/usp10/tests/Makefile.in b/dlls/usp10/tests/Makefile.in
index c0a51922332..131bcee1727 100644
--- a/dlls/usp10/tests/Makefile.in
+++ b/dlls/usp10/tests/Makefile.in
@@ -1,4 +1,3 @@
-EXTRADEFS = -DWINE_NO_LONG_TYPES
TESTDLL = usp10.dll
IMPORTS = usp10 user32 gdi32
diff --git a/dlls/usp10/tests/usp10.c b/dlls/usp10/tests/usp10.c
index 9e870ee3a5f..473b69749d6 100644
--- a/dlls/usp10/tests/usp10.c
+++ b/dlls/usp10/tests/usp10.c
@@ -82,7 +82,7 @@ static inline void _test_items_ok(LPCWSTR string, DWORD cchString,
else
hr = ScriptItemize(string, cchString, 15, Control, State, outpItems, &outnItems);
- winetest_ok(hr == S_OK, "ScriptItemize should return S_OK not %08x\n", hr);
+ winetest_ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
if (nItemsBroken && (broken(nItemsBroken[0] == outnItems) || broken(nItemsBroken[1] == outnItems)))
{
winetest_win_skip("This test broken on this platform: nitems %d\n", outnItems);
@@ -123,9 +123,9 @@ static inline void _test_items_ok(LPCWSTR string, DWORD cchString,
if (pScriptItemizeOpenType)
{
if (items[x].isBroken && broken(tags[x] == items[x].broken_value[5]))
- winetest_win_skip("This test broken on this platform: item %d Script Tag %x\n", x, tags[x]);
+ winetest_win_skip("This test broken on this platform: item %d Script Tag %lx\n", x, tags[x]);
else todo_wine_if (items[x].todo_flag[5])
- winetest_ok(tags[x] == items[x].scriptTag,"%i:Incorrect Script Tag %x != %x\n",x,tags[x],items[x].scriptTag);
+ winetest_ok(tags[x] == items[x].scriptTag,"%i:Incorrect Script Tag %lx != %lx\n",x,tags[x],items[x].scriptTag);
}
}
@@ -950,7 +950,7 @@ static void test_ScriptItemize_surrogates(void)
/* Find Script_Surrogates */
surrogate[0] = 0xd800;
hr = ScriptItemize( surrogate, 1, 2, NULL, NULL, items, &num );
- ok( hr == S_OK, "got %08x\n", hr );
+ ok( hr == S_OK, "Unexpected hr %#lx.\n", hr );
ok( num == 1, "got %d\n", num );
ok( items[0].a.eScript != SCRIPT_UNDEFINED, "got script %x\n", items[0].a.eScript );
Script_Surrogates = items[0].a.eScript;
@@ -958,7 +958,7 @@ static void test_ScriptItemize_surrogates(void)
/* Show that an invalid character has script Script_Surrogates */
make_surrogate( 0x01ffff, surrogate );
hr = ScriptItemize( surrogate, 2, 2, NULL, NULL, items, &num );
- ok( hr == S_OK, "got %08x\n", hr );
+ ok( hr == S_OK, "Unexpected hr %#lx.\n", hr );
ok( num == 1, "got %d\n", num );
ok( items[0].a.eScript == Script_Surrogates, "got script %x\n", items[0].a.eScript );
}
@@ -985,13 +985,13 @@ static inline void _test_shape_ok(int valid, HDC hdc, LPCWSTR string,
ULONG tags[15];
hr = ScriptGetProperties(&script_properties, &script_count);
- winetest_ok(SUCCEEDED(hr), "Failed to get script properties, hr %#x.\n", hr);
+ winetest_ok(SUCCEEDED(hr), "Unexpected hr %#lx.\n", hr);
hr = pScriptItemizeOpenType(string, cchString, 15, Control, State, outpItems, tags, &outnItems);
if (valid > 0)
- winetest_ok(hr == S_OK, "ScriptItemizeOpenType should return S_OK not %08x\n", hr);
+ winetest_ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
else if (hr != S_OK)
- winetest_trace("ScriptItemizeOpenType should return S_OK not %08x\n", hr);
+ winetest_trace("ScriptItemizeOpenType returned %#lx.\n", hr);
if (outnItems <= item)
{
@@ -1025,9 +1025,9 @@ static inline void _test_shape_ok(int valid, HDC hdc, LPCWSTR string,
outpItems[item].a.fLogicalOrder);
hr = pScriptShapeOpenType(hdc, &sc, &outpItems[item].a, tags[item], 0x00000000, NULL, NULL, 0, string, cchString, maxGlyphs, logclust, charProp, glyphs, glyphProp, &outnGlyphs);
if (valid > 0)
- winetest_ok(hr == S_OK, "ScriptShapeOpenType failed (%x)\n",hr);
+ winetest_ok(hr == S_OK, "Unexpected hr %#lx.\n",hr);
else if (hr != S_OK)
- winetest_trace("ScriptShapeOpenType failed (%x)\n",hr);
+ winetest_trace("ScriptShapeOpenType failed hr %#lx.\n",hr);
if (FAILED(hr))
goto cleanup;
@@ -1097,7 +1097,7 @@ static inline void _test_shape_ok(int valid, HDC hdc, LPCWSTR string,
outpItems[item].a.fLogicalOrder = 1;
hr = pScriptShapeOpenType(hdc, &sc, &outpItems[item].a, tags[item], 0x00000000, NULL, NULL, 0,
string, cchString, maxGlyphs, logclust2, charProp2, glyphs2, glyphProp2, &outnGlyphs2);
- winetest_ok(hr == S_OK, "ScriptShapeOpenType failed (%x)\n",hr);
+ winetest_ok(hr == S_OK, "Unexpected hr %#lx.\n",hr);
/* Cluster maps are hard. */
if (tags[item] != thaa_tag && tags[item] != syrc_tag)
{
@@ -1150,7 +1150,7 @@ static inline void _test_shape_ok(int valid, HDC hdc, LPCWSTR string,
outpItems[item].a.fRTL = !outpItems[item].a.fRTL;
hr = pScriptShapeOpenType(hdc, &sc, &outpItems[item].a, tags[item], 0x00000000, NULL, NULL, 0,
string2, cchString, maxGlyphs, logclust2, charProp2, glyphs2, glyphProp2, &outnGlyphs2);
- winetest_ok(hr == S_OK, "ScriptShapeOpenType failed (%x)\n",hr);
+ winetest_ok(hr == S_OK, "Unexpected hr %#lx.\n",hr);
for (x = 0; x < cchString; ++x)
{
unsigned int compare_idx = cchString - x - 1;
@@ -1182,7 +1182,7 @@ static inline void _test_shape_ok(int valid, HDC hdc, LPCWSTR string,
outpItems[item].a.fLogicalOrder = 1;
hr = pScriptShapeOpenType(hdc, &sc, &outpItems[item].a, tags[item], 0x00000000, NULL, NULL, 0,
string2, cchString, maxGlyphs, logclust2, charProp2, glyphs2, glyphProp2, &outnGlyphs2);
- winetest_ok(hr == S_OK, "ScriptShapeOpenType failed (%x)\n",hr);
+ winetest_ok(hr == S_OK, "Unexpected hr %#lx.\n",hr);
for (x = 0; x < cchString; ++x)
{
unsigned int compare_idx = outpItems[item].a.fRTL ? x : cchString - x - 1;
@@ -1649,23 +1649,22 @@ static void test_ScriptShapeOpenType(HDC hdc)
memset(&State, 0 , sizeof(State));
hr = pScriptItemizeOpenType(test1, 4, 2, &Control, &State, items, tags, &outnItems);
- ok(hr == S_OK, "ScriptItemizeOpenType should return S_OK not %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(items[0].a.fNoGlyphIndex == FALSE, "fNoGlyphIndex TRUE\n");
hr = pScriptShapeOpenType(hdc, &sc, &items[0].a, tags[0], 0x00000000, NULL, NULL, 0, test1, 4, 4, NULL, NULL, glyphs, NULL, &nb);
- ok(hr == E_INVALIDARG, "ScriptShapeOpenType should return E_INVALIDARG not %08x\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
hr = pScriptShapeOpenType(hdc, &sc, &items[0].a, tags[0], 0x00000000, NULL, NULL, 0, test1, 4, 4, NULL, NULL, glyphs, glyphProp, NULL);
- ok(hr == E_INVALIDARG, "ScriptShapeOpenType should return E_INVALIDARG not %08x\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
hr = pScriptShapeOpenType(NULL, &sc, &items[0].a, tags[0], 0x00000000, NULL, NULL, 0, test1, 4, 4, NULL, NULL, glyphs, glyphProp, &nb);
- ok(hr == E_INVALIDARG, "ScriptShapeOpenType should return E_PENDING not %08x\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
hr = pScriptShapeOpenType(hdc, &sc, &items[0].a, tags[0], 0x00000000, NULL, NULL, 0, test1, 4, 4, NULL, NULL, glyphs, glyphProp, &nb);
- ok( hr == E_INVALIDARG,
- "ScriptShapeOpenType should return E_FAIL or E_INVALIDARG, not %08x\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
hr = pScriptShapeOpenType(hdc, &sc, &items[0].a, tags[0], 0x00000000, NULL, NULL, 0, test1, 4, 4, logclust, NULL, glyphs, glyphProp, &nb);
- ok(hr == E_INVALIDARG, "ScriptShapeOpenType should return E_INVALIDARG not %08x\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
ScriptFreeCache(&sc);
@@ -1842,31 +1841,31 @@ static void test_ScriptShape(HDC hdc)
int nb, i, j;
hr = ScriptItemize(test1, 4, 2, NULL, NULL, items, NULL);
- ok(hr == S_OK, "ScriptItemize should return S_OK not %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(items[0].a.fNoGlyphIndex == FALSE, "fNoGlyphIndex TRUE\n");
hr = ScriptShape(hdc, &sc, test1, 4, 4, &items[0].a, glyphs, NULL, NULL, &nb);
- ok(hr == E_INVALIDARG, "ScriptShape should return E_INVALIDARG not %08x\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
hr = ScriptShape(hdc, &sc, test1, 4, 4, &items[0].a, glyphs, NULL, attrs, NULL);
- ok(hr == E_INVALIDARG, "ScriptShape should return E_INVALIDARG not %08x\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
hr = ScriptShape(NULL, &sc, test1, 4, 4, &items[0].a, glyphs, NULL, attrs, &nb);
- ok(hr == E_PENDING, "ScriptShape should return E_PENDING not %08x\n", hr);
+ ok(hr == E_PENDING, "Unexpected hr %#lx.\n", hr);
hr = ScriptShape(hdc, &sc, test1, 4, 4, &items[0].a, glyphs, NULL, attrs, &nb);
ok(broken(hr == S_OK) ||
hr == E_INVALIDARG || /* Vista, W2K8 */
hr == E_FAIL, /* WIN7 */
- "ScriptShape should return E_FAIL or E_INVALIDARG, not %08x\n", hr);
+ "Unexpected hr %#lx.\n", hr);
ok(items[0].a.fNoGlyphIndex == FALSE, "fNoGlyphIndex TRUE\n");
hr = ScriptShape(hdc, &sc, test1, 4, 4, &items[0].a, glyphs, logclust, attrs, &nb);
- ok(hr == S_OK, "ScriptShape should return S_OK not %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(items[0].a.fNoGlyphIndex == FALSE, "fNoGlyphIndex TRUE\n");
hr = ScriptShape(hdc, &sc2, test1, 4, 4, &items[0].a, glyphs, logclust, attrs, &nb);
- ok(hr == S_OK, "ScriptShape should return S_OK not %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(sc2 == sc, "caches %p, %p not identical\n", sc, sc2);
ScriptFreeCache(&sc2);
@@ -1874,7 +1873,7 @@ static void test_ScriptShape(HDC hdc)
memset(logclust,-1,sizeof(logclust));
memset(attrs,-1,sizeof(attrs));
hr = ScriptShape(NULL, &sc, test1, 4, 4, &items[0].a, glyphs, logclust, attrs, &nb);
- ok(hr == S_OK, "ScriptShape should return S_OK not %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(nb == 4, "Wrong number of items\n");
ok(logclust[0] == 0, "clusters out of order\n");
ok(logclust[1] == 1, "clusters out of order\n");
@@ -1908,7 +1907,7 @@ static void test_ScriptShape(HDC hdc)
GetGlyphIndicesW(hdc, test2, 4, glyphs3, 0);
hr = ScriptShape(hdc, &sc, test2, 4, 4, &items[0].a, glyphs2, logclust, attrs, &nb);
- ok(hr == S_OK, "ScriptShape should return S_OK not %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(nb == 4, "Wrong number of items\n");
ok(glyphs2[0] == glyphs3[0], "Incorrect glyph for 0x202B\n");
ok(glyphs2[3] == glyphs3[3], "Incorrect glyph for 0x202C\n");
@@ -1939,7 +1938,7 @@ static void test_ScriptShape(HDC hdc)
memset(logclust,-1,sizeof(logclust));
memset(attrs,-1,sizeof(attrs));
hr = ScriptShape(hdc, &sc, test1, 4, 4, &items[0].a, glyphs2, logclust, attrs, &nb);
- ok(hr == S_OK, "ScriptShape should return S_OK not %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(nb == 4, "Wrong number of items\n");
ok(glyphs2[0] == glyphs[3], "Glyphs not reordered properly\n");
ok(glyphs2[1] == glyphs[2], "Glyphs not reordered properly\n");
@@ -2011,10 +2010,10 @@ static void test_ScriptShape(HDC hdc)
}
hr = ScriptItemize(space, 1, 2, NULL, NULL, items, NULL);
- ok(hr == S_OK, "%s: expected S_OK, got %08x\n", lf.lfFaceName, hr);
+ ok(hr == S_OK, "%s: unexpected hr %#lx.\n", lf.lfFaceName, hr);
hr = ScriptShape(hdc, &sc, space, 1, 1, &items[0].a, glyphs, logclust, attrs, &nb);
- ok(hr == S_OK, "%s: expected S_OK, got %08x\n", lf.lfFaceName, hr);
+ ok(hr == S_OK, "%s: unexpected hr %#lx.\n", lf.lfFaceName, hr);
ok(nb == 1, "%s: expected 1, got %d\n", lf.lfFaceName, nb);
chars[0] = 'A';
@@ -2026,7 +2025,7 @@ static void test_ScriptShape(HDC hdc)
chars[1] = c;
hr = ScriptItemize(chars, 3, 4, NULL, NULL, items, &nb);
- ok(hr == S_OK, "%s: [%02x] expected S_OK, got %08x\n", lf.lfFaceName, c, hr);
+ ok(hr == S_OK, "%s: [%02x] unexpected hr %#lx.\n", lf.lfFaceName, c, hr);
ok(nb == test_data[j].item_count, "%s: [%02x] Got unexpected item count %d.\n",
lf.lfFaceName, c, nb);
item = &items[test_data[j].item];
@@ -2034,7 +2033,7 @@ static void test_ScriptShape(HDC hdc)
ok(!item->a.fNoGlyphIndex, "%s: [%02x] got unexpected fNoGlyphIndex %#x.\n",
lf.lfFaceName, c, item->a.fNoGlyphIndex);
hr = ScriptShape(hdc, &sc, chars, 3, 3, &item->a, glyphs2, logclust, attrs, &nb);
- ok(hr == S_OK, "%s: [%02x] expected S_OK, got %08x\n", lf.lfFaceName, c, hr);
+ ok(hr == S_OK, "%s: [%02x] unexpected hr %#lx.\n", lf.lfFaceName, c, hr);
ok(nb == 3, "%s: [%02x] expected 3, got %d\n", lf.lfFaceName, c, nb);
ok(!item->a.fNoGlyphIndex, "%s: [%02x] got unexpected fNoGlyphIndex %#x.\n",
lf.lfFaceName, c, item->a.fNoGlyphIndex);
@@ -2047,7 +2046,7 @@ static void test_ScriptShape(HDC hdc)
item->a.fNoGlyphIndex = 1;
hr = ScriptShape(hdc, &sc, chars, 3, 3, &item->a, glyphs2, logclust, attrs, &nb);
- ok(hr == S_OK, "%s: [%02x] expected S_OK, got %08x\n", lf.lfFaceName, c, hr);
+ ok(hr == S_OK, "%s: [%02x] unexpected hr %#lx.\n", lf.lfFaceName, c, hr);
ok(nb == 3, "%s: [%02x] expected 1, got %d\n", lf.lfFaceName, c, nb);
if (c == 0x200b || c == 0x200c || c == 0x200d)
@@ -2074,7 +2073,7 @@ static void test_ScriptShape(HDC hdc)
memset(items, 0, sizeof(items));
nb = 0;
hr = ScriptItemize(test3, ARRAY_SIZE(test3), ARRAY_SIZE(items), NULL, NULL, items, &nb);
- ok(hr == S_OK, "ScriptItemize failed, hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(items[0].a.eScript > 0, "Expected script id.\n");
ok(nb == 1, "Unexpected number of items.\n");
@@ -2082,7 +2081,7 @@ static void test_ScriptShape(HDC hdc)
nb = 0;
hr = ScriptShape(hdc, &sc, test3, ARRAY_SIZE(test3), ARRAY_SIZE(glyphs),
&items[0].a, glyphs, logclust, attrs, &nb);
- ok(hr == S_OK, "ScriptShape failed, hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(nb == 1, "Unexpected glyph count %u\n", nb);
ok(glyphs[0] == 0, "Unexpected glyph id\n");
ScriptFreeCache(&sc);
@@ -2107,37 +2106,37 @@ static void test_ScriptPlace(HDC hdc)
TEXTMETRICW tm;
hr = ScriptItemize(test1, 4, 2, NULL, NULL, items, NULL);
- ok(hr == S_OK, "ScriptItemize should return S_OK not %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(items[0].a.fNoGlyphIndex == FALSE, "fNoGlyphIndex TRUE\n");
hr = ScriptShape(hdc, &sc, test1, 4, 4, &items[0].a, glyphs, logclust, attrs, &nb);
- ok(hr == S_OK, "ScriptShape should return S_OK not %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(items[0].a.fNoGlyphIndex == FALSE, "fNoGlyphIndex TRUE\n");
hr = ScriptPlace(hdc, &sc, glyphs, 4, NULL, &items[0].a, widths, NULL, NULL);
- ok(hr == E_INVALIDARG, "ScriptPlace should return E_INVALIDARG not %08x\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
hr = ScriptPlace(NULL, &sc, glyphs, 4, attrs, &items[0].a, widths, NULL, NULL);
ok(broken(hr == E_PENDING) ||
hr == E_INVALIDARG || /* Vista, W2K8 */
hr == E_FAIL, /* WIN7 */
- "ScriptPlace should return E_FAIL or E_INVALIDARG, not %08x\n", hr);
+ "Unexpected hr %#lx.\n", hr);
hr = ScriptPlace(NULL, &sc, glyphs, 4, attrs, &items[0].a, widths, offset, NULL);
- ok(hr == E_PENDING, "ScriptPlace should return E_PENDING not %08x\n", hr);
+ ok(hr == E_PENDING, "Unexpected hr %#lx.\n", hr);
hr = ScriptPlace(NULL, &sc, glyphs, 4, attrs, &items[0].a, widths, NULL, abc);
ok(broken(hr == E_PENDING) ||
hr == E_INVALIDARG || /* Vista, W2K8 */
hr == E_FAIL, /* WIN7 */
- "ScriptPlace should return E_FAIL or E_INVALIDARG, not %08x\n", hr);
+ "Unexpected hr %#lx.\n", hr);
hr = ScriptPlace(hdc, &sc, glyphs, 4, attrs, &items[0].a, widths, offset, NULL);
- ok(hr == S_OK, "ScriptPlace should return S_OK not %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(items[0].a.fNoGlyphIndex == FALSE, "fNoGlyphIndex TRUE\n");
hr = ScriptPlace(hdc, &sc2, glyphs, 4, attrs, &items[0].a, widths, offset, NULL);
- ok(hr == S_OK, "ScriptPlace should return S_OK not %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(sc2 == sc, "caches %p, %p not identical\n", sc, sc2);
ScriptFreeCache(&sc2);
@@ -2147,7 +2146,7 @@ static void test_ScriptPlace(HDC hdc)
attrs[0].fZeroWidth = 1;
hr = ScriptPlace(hdc, &sc, glyphs, 4, attrs, &items[0].a, widths, offset, NULL);
- ok(hr == S_OK, "ScriptPlace should return S_OK not %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(widths[0] == 0, "got width %d\n", widths[0]);
widths[0] = old_width;
}
@@ -2182,28 +2181,28 @@ static void test_ScriptPlace(HDC hdc)
if (sz.cx > len * tm.tmAveCharWidth)
{
hr = ScriptItemize(test2, len, 2, NULL, NULL, items, NULL);
- ok(hr == S_OK, "ScriptItemize should return S_OK not %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(items[0].a.fNoGlyphIndex == FALSE, "fNoGlyphIndex TRUE\n");
items[0].a.fNoGlyphIndex = TRUE;
memset(glyphs, 'a', sizeof(glyphs));
hr = ScriptShape(hdc, &sc, test2, len, ARRAY_SIZE(glyphs), &items[0].a, glyphs, logclust, attrs, &nb);
- ok(hr == S_OK, "ScriptShape should return S_OK not %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
memset(offset, 'a', sizeof(offset));
memset(widths, 'a', sizeof(widths));
hr = ScriptPlace(hdc, &sc, glyphs, ARRAY_SIZE(widths), attrs, &items[0].a, widths, offset, NULL);
- ok(hr == S_OK, "ScriptPlace should return S_OK not %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
for (total = 0, i = 0; i < nb; i++)
{
- ok(offset[i].du == 0, "[%d] expected 0, got %d\n", i, offset[i].du);
- ok(offset[i].dv == 0, "[%d] expected 0, got %d\n", i, offset[i].dv);
- ok(widths[i] > tm.tmAveCharWidth, "[%d] expected greater than %d, got %d\n",
+ ok(offset[i].du == 0, "[%ld] expected 0, got %ld\n", i, offset[i].du);
+ ok(offset[i].dv == 0, "[%ld] expected 0, got %ld\n", i, offset[i].dv);
+ ok(widths[i] > tm.tmAveCharWidth, "[%ld] expected greater than %ld, got %d\n",
i, tm.tmAveCharWidth, widths[i]);
total += widths[i];
}
- ok(total == sz.cx, "expected %d, got %d\n", sz.cx, total);
+ ok(total == sz.cx, "expected %ld, got %ld\n", sz.cx, total);
}
else
skip("Associated font is unavailable\n");
@@ -2244,7 +2243,7 @@ static void test_ScriptItemIzeShapePlace(HDC hdc, unsigned short pwOutGlyphs[256
/* Verify we get a valid pointer from ScriptGetProperties(). */
hr = ScriptGetProperties(&ppSp, &iMaxProps);
- ok(hr == S_OK, "ScriptGetProperties failed: 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
trace("number of script properties %d\n", iMaxProps);
ok(iMaxProps > 0, "Got unexpected script count %d.\n", iMaxProps);
ok(ppSp[0]->langid == 0, "Got unexpected langid %#x.\n", ppSp[0]->langid);
@@ -2252,7 +2251,7 @@ static void test_ScriptItemIzeShapePlace(HDC hdc, unsigned short pwOutGlyphs[256
/* This is a valid test that will cause parsing to take place. */
cInChars = lstrlenW(TestItem1);
hr = ScriptItemize(TestItem1, cInChars, ARRAY_SIZE(pItem), NULL, NULL, pItem, &pcItems);
- ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
/* This test is for the interim operation of ScriptItemize() where only
* one SCRIPT_ITEM is returned. */
ok(pcItems == 1, "Got unexpected item count %d.\n", pcItems);
@@ -2263,15 +2262,15 @@ static void test_ScriptItemIzeShapePlace(HDC hdc, unsigned short pwOutGlyphs[256
psc = NULL;
hr = ScriptShape(NULL, &psc, TestItem1, cInChars, cInChars,
&pItem[0].a, pwOutGlyphs1, pwLogClust, psva, &pcGlyphs);
- ok(hr == E_PENDING, "Got unexpected hr %#x.\n", hr);
+ ok(hr == E_PENDING, "Unexpected hr %#lx.\n", hr);
hr = ScriptShape(hdc, &psc, TestItem1, cInChars, cInChars - 1,
&pItem[0].a, pwOutGlyphs1, pwLogClust, psva, &pcGlyphs);
- ok(hr == E_OUTOFMEMORY, "Got unexpected hr %#x.\n", hr);
+ ok(hr == E_OUTOFMEMORY, "Unexpected hr %#lx.\n", hr);
hr = ScriptShape(hdc, &psc, TestItem1, cInChars, ARRAY_SIZE(pwOutGlyphs1),
&pItem[0].a, pwOutGlyphs1, pwLogClust, psva, &pcGlyphs);
- ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(!!psc, "Got unexpected psc %p.\n", psc);
ok(pcGlyphs == cInChars, "Got unexpected glyph count %d, expected %d.\n", pcGlyphs, cInChars);
@@ -2280,16 +2279,16 @@ static void test_ScriptItemIzeShapePlace(HDC hdc, unsigned short pwOutGlyphs[256
hr = ScriptPlace(hdc, &psc, pwOutGlyphs1, pcGlyphs,
psva, &pItem[0].a, piAdvance, pGoffset, pABC);
- ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = ScriptPlace(NULL, &psc, pwOutGlyphs1, pcGlyphs,
psva, &pItem[0].a, piAdvance, pGoffset, pABC);
- ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
/* This test verifies that SCRIPT_CACHE is reused and that no translation
* takes place if fNoGlyphIndex is set. */
cInChars = lstrlenW(TestItem2);
hr = ScriptItemize(TestItem2, cInChars, ARRAY_SIZE(pItem), NULL, NULL, pItem, &pcItems);
- ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
/* This test is for the interim operation of ScriptItemize() where only
* one SCRIPT_ITEM is returned. */
ok(pcItems == 1, "Got unexpected item count %d.\n", pcItems);
@@ -2300,7 +2299,7 @@ static void test_ScriptItemIzeShapePlace(HDC hdc, unsigned short pwOutGlyphs[256
pItem[0].a.fNoGlyphIndex = 1; /* No translation. */
hr = ScriptShape(NULL, &psc, TestItem2, cInChars, ARRAY_SIZE(pwOutGlyphs1),
&pItem[0].a, pwOutGlyphs1, pwLogClust, psva, &pcGlyphs);
- ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(!!psc, "Got unexpected psc %p.\n", psc);
ok(pcGlyphs == cInChars, "Got unexpected glyph count %d, expected %d.\n", pcGlyphs, cInChars);
@@ -2313,7 +2312,7 @@ static void test_ScriptItemIzeShapePlace(HDC hdc, unsigned short pwOutGlyphs[256
hr = ScriptPlace(hdc, &psc, pwOutGlyphs1, pcGlyphs,
psva, &pItem[0].a, piAdvance, pGoffset, pABC);
- ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ScriptFreeCache(&psc);
ok(!psc, "Got unexpected psc %p.\n", psc);
@@ -2321,7 +2320,7 @@ static void test_ScriptItemIzeShapePlace(HDC hdc, unsigned short pwOutGlyphs[256
* script_items. */
cInChars = lstrlenW(TestItem3);
hr = ScriptItemize(TestItem3, cInChars, ARRAY_SIZE(pItem), NULL, NULL, pItem, &pcItems);
- ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(pcItems == 3, "Got unexpected item count %d.\n", pcItems);
ok(pItem[0].iCharPos == 0, "Got unexpected character position %d.\n", pItem[0].iCharPos);
ok(pItem[1].iCharPos == 6, "Got unexpected character position %d.\n", pItem[1].iCharPos);
@@ -2333,7 +2332,7 @@ static void test_ScriptItemIzeShapePlace(HDC hdc, unsigned short pwOutGlyphs[256
* script_items. */
cInChars = lstrlenW(TestItem4);
hr = ScriptItemize(TestItem4, cInChars, ARRAY_SIZE(pItem), NULL, NULL, pItem, &pcItems);
- ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(pcItems == 5, "Got unexpected item count %d.\n", pcItems);
ok(pItem[0].iCharPos == 0, "Got unexpected character position %d.\n", pItem[0].iCharPos);
@@ -2352,7 +2351,7 @@ static void test_ScriptItemIzeShapePlace(HDC hdc, unsigned short pwOutGlyphs[256
/* This test is for when the first Unicode character requires BiDi support. */
hr = ScriptItemize(TestItem5, lstrlenW(TestItem5), ARRAY_SIZE(pItem), NULL, NULL, pItem, &pcItems);
- ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(pcItems == 4, "Got unexpected item count %d.\n", pcItems);
ok(pItem[0].a.s.uBidiLevel == 1, "Got unexpected bidi level %u.\n", pItem[0].a.s.uBidiLevel);
@@ -2361,7 +2360,7 @@ static void test_ScriptItemIzeShapePlace(HDC hdc, unsigned short pwOutGlyphs[256
* often needs a greater number of SCRIPT_ITEMS to process a string than
* is returned in pcItems. */
hr = ScriptItemize(TestItem6, lstrlenW(TestItem6), 4, NULL, NULL, pItem, &pcItems);
- ok(hr == E_OUTOFMEMORY, "Got unexpected hr %#x.\n", hr);
+ ok(hr == E_OUTOFMEMORY, "Unexpected hr %#lx.\n", hr);
}
static void test_ScriptGetCMap(HDC hdc, unsigned short pwOutGlyphs[256])
@@ -2386,36 +2385,32 @@ static void test_ScriptGetCMap(HDC hdc, unsigned short pwOutGlyphs[256])
/* Some sanity checks for ScriptGetCMap */
hr = ScriptGetCMap(NULL, NULL, NULL, 0, 0, NULL);
- ok( hr == E_INVALIDARG, "(NULL,NULL,NULL,0,0,NULL), "
- "expected E_INVALIDARG, got %08x\n", hr);
+ ok( hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
hr = ScriptGetCMap(NULL, NULL, TestItem1, cInChars, dwFlags, pwOutGlyphs3);
- ok( hr == E_INVALIDARG, "(NULL,NULL,TestItem1, cInChars, dwFlags, pwOutGlyphs3), "
- "expected E_INVALIDARG, got %08x\n", hr);
+ ok( hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
/* Set psc to NULL, to be able to check if a pointer is returned in psc */
psc = NULL;
hr = ScriptGetCMap(NULL, &psc, TestItem1, cInChars, 0, pwOutGlyphs3);
- ok( hr == E_PENDING, "(NULL,&psc,NULL,0,0,NULL), expected E_PENDING, "
- "got %08x\n", hr);
+ ok( hr == E_PENDING, "Unexpected hr %#lx.\n", hr);
ok( psc == NULL, "Expected psc to be NULL, got %p\n", psc);
/* Set psc to NULL but add hdc, to be able to check if a pointer is returned in psc */
psc = NULL;
hr = ScriptGetCMap(hdc, &psc, TestItem1, cInChars, 0, pwOutGlyphs3);
- ok( hr == S_OK, "ScriptGetCMap(NULL,&psc,NULL,0,0,NULL), expected S_OK, "
- "got %08x\n", hr);
+ ok (hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok( psc != NULL, "ScriptGetCMap expected psc to be not NULL\n");
ScriptFreeCache( &psc);
/* Set psc to NULL, to be able to check if a pointer is returned in psc */
psc = NULL;
hr = ScriptGetCMap(NULL, &psc, TestItem1, cInChars, dwFlags, pwOutGlyphs3);
- ok( hr == E_PENDING, "(NULL,&psc,), expected E_PENDING, got %08x\n", hr);
+ ok( hr == E_PENDING, "Unexpected hr %#lx.\n", hr);
ok( psc == NULL, "Expected psc to be NULL, got %p\n", psc);
/* Check to see if the results are the same as those returned by ScriptShape */
hr = ScriptGetCMap(hdc, &psc, TestItem1, cInChars, dwFlags, pwOutGlyphs3);
- ok (hr == S_OK, "ScriptGetCMap should return S_OK not (%08x)\n", hr);
+ ok (hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok (psc != NULL, "psc should not be null and have SCRIPT_CACHE buffer address\n");
for (cnt=0; cnt < cChars && pwOutGlyphs[cnt] == pwOutGlyphs3[cnt]; cnt++) {}
ok (cnt == cInChars, "Translation not correct. WCHAR %d - %04x != %04x\n",
@@ -2430,9 +2425,9 @@ static void test_ScriptGetCMap(HDC hdc, unsigned short pwOutGlyphs[256])
hr = ScriptGetCMap(hdc, &psc, TestItem2, cInChars, dwFlags, pwOutGlyphs3);
if (pwOutGlyphs3[0] == 0 || pwOutGlyphs3[3] == 0)
- ok(hr == S_FALSE, "ScriptGetCMap should return S_FALSE not (%08x)\n", hr);
+ ok(hr == S_FALSE, "Unexpected hr %#lx.\n", hr);
else
- ok(hr == S_OK, "ScriptGetCMap should return S_OK not (%08x)\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(psc != NULL, "psc should not be null and have SCRIPT_CACHE buffer address\n");
ok(pwOutGlyphs3[0] == pwOutGlyphs2[0], "expected glyph %d, got %d\n", pwOutGlyphs2[0], pwOutGlyphs3[0]);
@@ -2440,14 +2435,14 @@ static void test_ScriptGetCMap(HDC hdc, unsigned short pwOutGlyphs[256])
cInChars = cChars = 9;
hr = ScriptGetCMap(hdc, &psc, TestItem3b, cInChars, dwFlags, pwOutGlyphs2);
- ok (hr == S_OK, "ScriptGetCMap should return S_OK not (%08x)\n", hr);
- ok (psc != NULL, "psc should not be null and have SCRIPT_CACHE buffer address\n");
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
+ ok(psc != NULL, "psc should not be null and have SCRIPT_CACHE buffer address\n");
cInChars = cChars = 9;
dwFlags = SGCM_RTL;
hr = ScriptGetCMap(hdc, &psc, TestItem3, cInChars, dwFlags, pwOutGlyphs3);
- ok (hr == S_OK, "ScriptGetCMap should return S_OK not (%08x)\n", hr);
- ok (psc != NULL, "psc should not be null and have SCRIPT_CACHE buffer address\n");
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
+ ok(psc != NULL, "psc should not be null and have SCRIPT_CACHE buffer address\n");
ok(pwOutGlyphs3[0] == pwOutGlyphs2[0], "glyph incorrectly altered\n");
ok(pwOutGlyphs3[1] == pwOutGlyphs2[1], "glyph incorrectly altered\n");
ok(pwOutGlyphs3[2] == pwOutGlyphs2[2], "glyph incorrectly altered\n");
@@ -2524,40 +2519,40 @@ static void test_ScriptGetFontProperties(HDC hdc)
/* Some sanity checks for ScriptGetFontProperties */
hr = ScriptGetFontProperties(NULL,NULL,NULL);
- ok( hr == E_INVALIDARG, "(NULL,NULL,NULL), expected E_INVALIDARG, got %08x\n", hr);
+ ok( hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
hr = ScriptGetFontProperties(NULL,NULL,&sfp);
- ok( hr == E_INVALIDARG, "(NULL,NULL,&sfp), expected E_INVALIDARG, got %08x\n", hr);
+ ok( hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
/* Set psc to NULL, to be able to check if a pointer is returned in psc */
psc = NULL;
hr = ScriptGetFontProperties(NULL,&psc,NULL);
- ok( hr == E_INVALIDARG, "(NULL,&psc,NULL), expected E_INVALIDARG, got %08x\n", hr);
+ ok( hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
ok( psc == NULL, "Expected psc to be NULL, got %p\n", psc);
/* Set psc to NULL, to be able to check if a pointer is returned in psc */
psc = NULL;
hr = ScriptGetFontProperties(NULL,&psc,&sfp);
- ok( hr == E_PENDING, "(NULL,&psc,&sfp), expected E_PENDING, got %08x\n", hr);
+ ok( hr == E_PENDING, "Unexpected hr %#lx.\n", hr);
ok( psc == NULL, "Expected psc to be NULL, got %p\n", psc);
hr = ScriptGetFontProperties(hdc,NULL,NULL);
- ok( hr == E_INVALIDARG, "(hdc,NULL,NULL), expected E_INVALIDARG, got %08x\n", hr);
+ ok( hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
hr = ScriptGetFontProperties(hdc,NULL,&sfp);
- ok( hr == E_INVALIDARG, "(hdc,NULL,&sfp), expected E_INVALIDARG, got %08x\n", hr);
+ ok( hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
/* Set psc to NULL, to be able to check if a pointer is returned in psc */
psc = NULL;
hr = ScriptGetFontProperties(hdc,&psc,NULL);
- ok( hr == E_INVALIDARG, "(hdc,&psc,NULL), expected E_INVALIDARG, got %08x\n", hr);
+ ok( hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
ok( psc == NULL, "Expected psc to be NULL, got %p\n", psc);
/* Pass an invalid sfp */
psc = NULL;
sfp.cBytes = sizeof(SCRIPT_FONTPROPERTIES) - 1;
hr = ScriptGetFontProperties(hdc,&psc,&sfp);
- ok( hr == E_INVALIDARG, "(hdc,&psc,&sfp) invalid, expected E_INVALIDARG, got %08x\n", hr);
+ ok( hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
ok( psc != NULL, "Expected a pointer in psc, got NULL\n");
ok( sfp.cBytes == sizeof(SCRIPT_FONTPROPERTIES) - 1, "Unexpected cBytes.\n");
ScriptFreeCache(&psc);
@@ -2567,14 +2562,14 @@ static void test_ScriptGetFontProperties(HDC hdc)
sfp.cBytes = sizeof(SCRIPT_FONTPROPERTIES);
psc = NULL;
hr = ScriptGetFontProperties(hdc,&psc,&sfp);
- ok( hr == S_OK, "(hdc,&psc,&sfp) partly initialized, expected S_OK, got %08x\n", hr);
+ ok( hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok( psc != NULL, "Expected a pointer in psc, got NULL\n");
/* Save the psc pointer */
old_psc = psc;
/* Now a NULL hdc again */
hr = ScriptGetFontProperties(NULL,&psc,&sfp);
- ok( hr == S_OK, "(NULL,&psc,&sfp), expected S_OK, got %08x\n", hr);
+ ok( hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok( psc == old_psc, "Expected psc not to be changed, was %p is now %p\n", old_psc, psc);
ScriptFreeCache(&psc);
ok( psc == NULL, "Expected psc to be NULL, got %p\n", psc);
@@ -2598,7 +2593,7 @@ static void test_ScriptGetFontProperties(HDC hdc)
sfp.cBytes = sizeof(SCRIPT_FONTPROPERTIES);
psc = NULL;
hr = ScriptGetFontProperties(hdc, &psc, &sfp);
- ok(hr == S_OK, "ScriptGetFontProperties expected S_OK, got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
if (winetest_interactive)
{
trace("bitmap font %s\n", lf.lfFaceName);
@@ -2646,7 +2641,7 @@ static void test_ScriptGetFontProperties(HDC hdc)
sfp.cBytes = sizeof(SCRIPT_FONTPROPERTIES);
psc = NULL;
hr = ScriptGetFontProperties(hdc, &psc, &sfp);
- ok(hr == S_OK, "ScriptGetFontProperties expected S_OK, got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
if (winetest_interactive)
{
trace("truetype font %s\n", lf.lfFaceName);
@@ -2713,7 +2708,7 @@ static void test_ScriptTextOut(HDC hdc)
/* This is a valid test that will cause parsing to take place. */
cInChars = lstrlenW(TestItem1);
hr = ScriptItemize(TestItem1, cInChars, ARRAY_SIZE(pItem), NULL, NULL, pItem, &pcItems);
- ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
/* This test is for the interim operation of ScriptItemize() where only
* one SCRIPT_ITEM is returned. */
ok(pcItems == 1, "Got unexpected item count %d.\n", pcItems);
@@ -2725,49 +2720,49 @@ static void test_ScriptTextOut(HDC hdc)
cInChars = 5;
hr = ScriptShape(hdc, &psc, TestItem1, cInChars, ARRAY_SIZE(pwOutGlyphs1),
&pItem[0].a, pwOutGlyphs1, pwLogClust, psva, &pcGlyphs);
- ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(!!psc, "Got unexpected psc %p.\n", psc);
ok(pcGlyphs == cInChars, "Got unexpected glyph count %d, expected %d.\n", pcGlyphs, cInChars);
/* Note hdc is needed as glyph info is not yet in psc. */
hr = ScriptPlace(hdc, &psc, pwOutGlyphs1, pcGlyphs,
psva, &pItem[0].a, piAdvance, pGoffset, pABC);
- ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
/* Get rid of psc for next test set. */
ScriptFreeCache(&psc);
ok(!psc, "Got unexpected psc %p.\n", psc);
hr = ScriptTextOut(NULL, NULL, 0, 0, 0, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL);
- ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
hr = ScriptTextOut(NULL, NULL, 0, 0, 0, NULL, &pItem[0].a, NULL, 0,
pwOutGlyphs1, pcGlyphs, piAdvance, NULL, pGoffset);
- ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
hr = ScriptTextOut(NULL, &psc, 0, 0, 0, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL);
- ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
ok(!psc, "Got unexpected psc %p.\n", psc);
/* hdc is required. */
hr = ScriptTextOut(NULL, &psc, 0, 0, 0, NULL, &pItem[0].a, NULL, 0,
pwOutGlyphs1, pcGlyphs, piAdvance, NULL, pGoffset);
- ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
ok(!psc, "Got unexpected psc %p.\n", psc);
hr = ScriptTextOut(hdc, &psc, 0, 0, 0, NULL, &pItem[0].a, NULL, 0,
pwOutGlyphs1, pcGlyphs, piAdvance, NULL, pGoffset);
- ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
/* Test Rect Rgn is acceptable. */
SetRect(&rect, 10, 10, 40, 20);
hr = ScriptTextOut(hdc, &psc, 0, 0, 0, &rect, &pItem[0].a, NULL, 0,
pwOutGlyphs1, pcGlyphs, piAdvance, NULL, pGoffset);
- ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = ScriptCPtoX(1, FALSE, cInChars, pcGlyphs, pwLogClust, psva, piAdvance, &pItem[0].a, &piX);
- ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = ScriptBreak(TestItem1, cInChars, &pItem[0].a, sla);
- ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ScriptFreeCache(&psc);
ok(!psc, "Got unexpected psc %p.\n", psc);
@@ -2804,7 +2799,7 @@ static void test_ScriptTextOut2(HDC hdc)
/* This is a valid test that will cause parsing to take place. */
cInChars = lstrlenW(TestItem1);
hr = ScriptItemize(TestItem1, cInChars, ARRAY_SIZE(pItem), NULL, NULL, pItem, &pcItems);
- ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
/* This test is for the interim operation of ScriptItemize() where only
* one SCRIPT_ITEM is returned. */
ok(pcItems == 1, "Got unexpected item count %d.\n", pcItems);
@@ -2815,14 +2810,14 @@ static void test_ScriptTextOut2(HDC hdc)
psc = NULL;
hr = ScriptShape(hdc2, &psc, TestItem1, cInChars, ARRAY_SIZE(pwOutGlyphs1),
&pItem[0].a, pwOutGlyphs1, pwLogClust, psva, &pcGlyphs);
- ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(!!psc, "Got unexpected psc %p.\n", psc);
ok(pcGlyphs == cInChars, "Got unexpected glyph count %d, expected %d.\n", pcGlyphs, cInChars);
/* Note hdc is needed as glyph info is not yet in psc. */
hr = ScriptPlace(hdc2, &psc, pwOutGlyphs1, pcGlyphs,
psva, &pItem[0].a, piAdvance, pGoffset, pABC);
- ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
/* Key part! Cached DC is being deleted. */
ret = DeleteDC(hdc2);
@@ -2833,7 +2828,7 @@ static void test_ScriptTextOut2(HDC hdc)
* that DC. */
hr = ScriptTextOut(hdc1, &psc, 0, 0, 0, NULL, &pItem[0].a, NULL, 0,
pwOutGlyphs1, pcGlyphs, piAdvance, NULL, pGoffset);
- ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(!!psc, "Got unexpected psc %p.\n", psc);
DeleteDC(hdc1);
@@ -2865,7 +2860,7 @@ static void test_ScriptTextOut3(HDC hdc)
* glyph number. */
cInChars = lstrlenW(TestItem1);
hr = ScriptItemize(TestItem1, cInChars, ARRAY_SIZE(pItem), NULL, NULL, pItem, &pcItems);
- ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
/* This test is for the interim operation of ScriptItemize() where only
* one SCRIPT_ITEM is returned. */
ok(pcItems == 2, "Got unexpected item count %d.\n", pcItems);
@@ -2877,20 +2872,20 @@ static void test_ScriptTextOut3(HDC hdc)
psc = NULL;
hr = ScriptShape(hdc, &psc, TestItem1, cInChars, ARRAY_SIZE(pwOutGlyphs1),
&pItem[0].a, pwOutGlyphs1, pwLogClust, psva, &pcGlyphs);
- ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(!!psc, "Got unexpected psc %p.\n", psc);
ok(pcGlyphs == cInChars, "Got unexpected glyph count %d, expected %d.\n", pcGlyphs, cInChars);
/* Note hdc is needed as glyph info is not yet in psc. */
hr = ScriptPlace(hdc, &psc, pwOutGlyphs1, pcGlyphs,
psva, &pItem[0].a, piAdvance, pGoffset, pABC);
- ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
/* Test Rect Rgn is acceptable. */
SetRect(&rect, 10, 10, 40, 20);
hr = ScriptTextOut(hdc, &psc, 0, 0, 0, &rect, &pItem[0].a, NULL, 0,
pwOutGlyphs1, pcGlyphs, piAdvance, NULL, pGoffset);
- ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ScriptFreeCache(&psc);
ok(!psc, "Got unexpected psc %p.\n", psc);
@@ -2918,7 +2913,7 @@ static void _test_item_ScriptXtoX(SCRIPT_ANALYSIS *psa, int cChars, int cGlyphs,
icChars = cChars;
icGlyphs = cGlyphs;
hr = ScriptXtoCP(iX, icChars, icGlyphs, pwLogClust, psva, piAdvance, psa, &piCP, &piTrailing);
- winetest_ok(hr == S_OK, "ScriptXtoCP: should return S_OK not %08x\n", hr);
+ winetest_ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
winetest_ok(piCP == iCP, "ScriptXtoCP: iX=%d should return piCP=%d not %d\n", iX, iCP, piCP);
winetest_ok(piTrailing == 0, "ScriptXtoCP: iX=%d should return piTrailing=0 not %d\n", iX, piTrailing);
}
@@ -2929,7 +2924,7 @@ static void _test_item_ScriptXtoX(SCRIPT_ANALYSIS *psa, int cChars, int cGlyphs,
icChars = cChars;
icGlyphs = cGlyphs;
hr = ScriptXtoCP(iX, icChars, icGlyphs, pwLogClust, psva, piAdvance, psa, &piCP, &piTrailing);
- winetest_ok(hr == S_OK, "ScriptXtoCP leading: should return S_OK not %08x\n", hr);
+ winetest_ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
winetest_ok(piCP == iCP, "ScriptXtoCP leading: iX=%d should return piCP=%d not %d\n", iX, iCP, piCP);
winetest_ok(piTrailing == 0, "ScriptXtoCP leading: iX=%d should return piTrailing=0 not %d\n", iX, piTrailing);
}
@@ -2940,7 +2935,7 @@ static void _test_item_ScriptXtoX(SCRIPT_ANALYSIS *psa, int cChars, int cGlyphs,
icChars = cChars;
icGlyphs = cGlyphs;
hr = ScriptXtoCP(iX, icChars, icGlyphs, pwLogClust, psva, piAdvance, psa, &piCP, &piTrailing);
- winetest_ok(hr == S_OK, "ScriptXtoCP trailing: should return S_OK not %08x\n", hr);
+ winetest_ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
winetest_ok(piCP == iCP, "ScriptXtoCP trailing: iX=%d should return piCP=%d not %d\n", iX, iCP, piCP);
winetest_ok(piTrailing == 1, "ScriptXtoCP trailing: iX=%d should return piTrailing=1 not %d\n", iX, piTrailing);
}
@@ -2951,7 +2946,7 @@ static void _test_item_ScriptXtoX(SCRIPT_ANALYSIS *psa, int cChars, int cGlyphs,
icChars = cChars;
icGlyphs = cGlyphs;
hr = ScriptCPtoX(iCP, fTrailing, icChars, icGlyphs, pwLogClust, psva, piAdvance, psa, &piX);
- winetest_ok(hr == S_OK, "ScriptCPtoX: should return S_OK not %08x\n", hr);
+ winetest_ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
winetest_ok(piX == offsets[iCP],
"ScriptCPtoX: iCP=%d should return piX=%d not %d\n", iCP, offsets[iCP], piX);
}
@@ -2962,7 +2957,7 @@ static void _test_item_ScriptXtoX(SCRIPT_ANALYSIS *psa, int cChars, int cGlyphs,
icChars = cChars;
icGlyphs = cGlyphs;
hr = ScriptCPtoX(iCP, fTrailing, icChars, icGlyphs, pwLogClust, psva, piAdvance, psa, &piX);
- winetest_ok(hr == S_OK, "ScriptCPtoX trailing: should return S_OK not %08x\n", hr);
+ winetest_ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
winetest_ok(piX == offsets[iCP+1],
"ScriptCPtoX trailing: iCP=%d should return piX=%d not %d\n", iCP, offsets[iCP+1], piX);
}
@@ -2994,7 +2989,7 @@ static void _test_caret_item_ScriptXtoCP(int line, SCRIPT_ANALYSIS *psa, int cCh
icChars = cChars;
icGlyphs = cGlyphs;
hr = ScriptXtoCP(iX, icChars, icGlyphs, pwLogClust, psva, piAdvance, psa, &piCP, &piTrailing);
- ok_(__FILE__,line)(hr == S_OK, "ScriptXtoCP: should return S_OK not %08x\n", hr);
+ ok_(__FILE__,line)(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok_(__FILE__,line)(piCP == iCP, "ScriptXtoCP: iX=%d should return piCP=%d not %d\n", iX, iCP, piCP);
ok_(__FILE__,line)(piTrailing == 0, "ScriptXtoCP: iX=%d should return piTrailing=0 not %d\n", iX, piTrailing);
}
@@ -3009,7 +3004,7 @@ static void _test_caret_item_ScriptXtoCP(int line, SCRIPT_ANALYSIS *psa, int cCh
icChars = cChars;
icGlyphs = cGlyphs;
hr = ScriptXtoCP(iX, icChars, icGlyphs, pwLogClust, psva, piAdvance, psa, &piCP, &piTrailing);
- ok_(__FILE__,line)(hr == S_OK, "ScriptXtoCP leading: should return S_OK not %08x\n", hr);
+ ok_(__FILE__,line)(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok_(__FILE__,line)(piCP == iCP, "ScriptXtoCP leading: iX=%d should return piCP=%d not %d\n", iX, iCP, piCP);
ok_(__FILE__,line)(piTrailing == 0, "ScriptXtoCP leading: iX=%d should return piTrailing=0 not %d\n", iX, piTrailing);
}
@@ -3023,7 +3018,7 @@ static void _test_caret_item_ScriptXtoCP(int line, SCRIPT_ANALYSIS *psa, int cCh
icChars = cChars;
icGlyphs = cGlyphs;
hr = ScriptXtoCP(iX, icChars, icGlyphs, pwLogClust, psva, piAdvance, psa, &piCP, &piTrailing);
- ok_(__FILE__,line)(hr == S_OK, "ScriptXtoCP trailing: should return S_OK not %08x\n", hr);
+ ok_(__FILE__,line)(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok_(__FILE__,line)(piCP == iCP, "ScriptXtoCP trailing: iX=%d should return piCP=%d not %d\n", iX, iCP, piCP);
ok_(__FILE__,line)(piTrailing == clusterSize, "ScriptXtoCP trailing: iX=%d should return piTrailing=%d not %d\n", iX, clusterSize, piTrailing);
iCP = i+1;
@@ -3068,7 +3063,7 @@ static void test_ScriptXtoX(void)
sa.fRTL = FALSE;
hr = ScriptXtoCP(-1, 10, 10, pwLogClust, psva, piAdvance, &sa, &piCP, &piTrailing);
- ok(hr == S_OK, "ScriptXtoCP should return S_OK not %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
if (piTrailing)
ok(piCP == -1, "Negative iX should return piCP=-1 not %d\n", piCP);
else /* win2k3 */
@@ -3079,7 +3074,7 @@ static void test_ScriptXtoX(void)
WORD clust = 0;
INT advance = 16;
hr = ScriptXtoCP(iX, 1, 1, &clust, psva, &advance, &sa, &piCP, &piTrailing);
- ok(hr == S_OK, "ScriptXtoCP failed, hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(piCP==0 && piTrailing==0,"%i should return 0(%i) and 0(%i)\n",iX, piCP,piTrailing);
}
for (iX = 8; iX < 16; iX++)
@@ -3087,13 +3082,13 @@ static void test_ScriptXtoX(void)
WORD clust = 0;
INT advance = 16;
hr = ScriptXtoCP(iX, 1, 1, &clust, psva, &advance, &sa, &piCP, &piTrailing);
- ok(hr == S_OK, "ScriptXtoCP failed, hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(piCP==0 && piTrailing==1,"%i should return 0(%i) and 1(%i)\n",iX, piCP,piTrailing);
}
sa.fRTL = TRUE;
hr = ScriptXtoCP(-1, 10, 10, pwLogClust_RTL, psva, piAdvance, &sa, &piCP, &piTrailing);
- ok(hr == S_OK, "ScriptXtoCP should return S_OK not %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
if (piTrailing)
ok(piCP == -1, "Negative iX should return piCP=-1 not %d\n", piCP);
else /* win2k3 */
@@ -3101,7 +3096,7 @@ static void test_ScriptXtoX(void)
iX = 1954;
hr = ScriptXtoCP(1954, 10, 10, pwLogClust_RTL, psva, piAdvance, &sa, &piCP, &piTrailing);
- ok(hr == S_OK, "ScriptXtoCP should return S_OK not %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(piCP == -1, "iX=%d should return piCP=-1 not %d\n", iX, piCP);
ok(piTrailing == 1, "iX=%d should return piTrailing=1 not %d\n", iX, piTrailing);
@@ -3110,7 +3105,7 @@ static void test_ScriptXtoX(void)
WORD clust = 0;
INT advance = 16;
hr = ScriptXtoCP(iX, 1, 1, &clust, psva, &advance, &sa, &piCP, &piTrailing);
- ok(hr == S_OK, "ScriptXtoCP() failed, hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(piCP==0 && piTrailing==1,"%i should return 0(%i) and 1(%i)\n",iX,piCP,piTrailing);
}
for (iX = 9; iX < 16; iX++)
@@ -3118,7 +3113,7 @@ static void test_ScriptXtoX(void)
WORD clust = 0;
INT advance = 16;
hr = ScriptXtoCP(iX, 1, 1, &clust, psva, &advance, &sa, &piCP, &piTrailing);
- ok(hr == S_OK, "ScriptXtoCP() failed, hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(piCP==0 && piTrailing==0,"%i should return 0(%i) and 0(%i)\n",iX,piCP,piTrailing);
}
@@ -3130,7 +3125,7 @@ static void test_ScriptXtoX(void)
/* Get thai eScript, This will do LTR and fNeedsCaretInfo */
hr = ScriptItemize(thaiW, 1, 2, NULL, NULL, items, &i);
- ok(hr == S_OK, "got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(i == 1, "got %d\n", i);
sa = items[0].a;
@@ -3138,7 +3133,7 @@ static void test_ScriptXtoX(void)
/* Get hebrew eScript, This will do RTL and fNeedsCaretInfo */
hr = ScriptItemize(hebrW, 1, 2, NULL, NULL, items, &i);
- ok(hr == S_OK, "got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(i == 1, "got %d\n", i);
sa = items[0].a;
@@ -3149,7 +3144,7 @@ static void test_ScriptXtoX(void)
{
test_caret_item_ScriptXtoCP(&sa, 17, 15, offsets_3_RTL, pwLogClust_3_RTL, piAdvance_3);
hr = ScriptXtoCP(0, 17, 15, pwLogClust_3_RTL, psva, piAdvance_3, &sa, &piCP, &piTrailing);
- ok(hr == S_OK, "ScriptXtoCP: should return S_OK not %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(piCP == 16, "ScriptXtoCP: iX=0 should return piCP=16 not %d\n", piCP);
ok(piTrailing == 1, "ScriptXtoCP: iX=0 should return piTrailing=1 not %d\n", piTrailing);
}
@@ -3190,34 +3185,34 @@ static void test_ScriptString(HDC hdc)
/* Test without hdc to get E_PENDING. */
hr = ScriptStringAnalyse(NULL, teststr, len, Glyphs, -1,
Flags, ReqWidth, NULL, NULL, Dx, NULL, InClass, &ssa);
- ok(hr == E_PENDING, "Got unexpected hr %#x.\n", hr);
+ ok(hr == E_PENDING, "Unexpected hr %#lx.\n", hr);
/* Test that 0 length string returns E_INVALIDARG. */
hr = ScriptStringAnalyse(hdc, teststr, 0, Glyphs, -1,
Flags, ReqWidth, NULL, NULL, Dx, NULL, InClass, &ssa);
- ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
/* Test with hdc, this should be a valid test. */
hr = ScriptStringAnalyse(hdc, teststr, len, Glyphs, -1,
Flags, ReqWidth, NULL, NULL, Dx, NULL, InClass, &ssa);
- ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ScriptStringFree(&ssa);
/* Test makes sure that a call with a valid pssa still works. */
hr = ScriptStringAnalyse(hdc, teststr, len, Glyphs, -1,
Flags, ReqWidth, NULL, NULL, Dx, NULL, InClass, &ssa);
- ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(!!ssa, "Got unexpected ssa %p.\n", ssa);
hr = ScriptStringOut(ssa, X, Y, Options, &rc, MinSel, MaxSel, Disabled);
- ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
clip_len = ScriptString_pcOutChars(ssa);
ok(*clip_len == len, "Got unexpected *clip_len %d, expected %d.\n", *clip_len, len);
order = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, *clip_len * sizeof(*order));
hr = ScriptStringGetOrder(ssa, order);
- ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
for (i = 0; i < *clip_len; ++i)
{
@@ -3226,7 +3221,7 @@ static void test_ScriptString(HDC hdc)
HeapFree(GetProcessHeap(), 0, order);
hr = ScriptStringFree(&ssa);
- ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
}
/* Test ScriptStringXtoCP() and ScriptStringCPtoX(). Since fonts may differ
@@ -3254,7 +3249,7 @@ static void test_ScriptStringXtoCP_CPtoX(HDC hdc)
hr = ScriptStringAnalyse(hdc, &teststr1, String_len, Glyphs, -1,
SSA_GLYPHS, 100, NULL, NULL, NULL, NULL, InClass, &ssa);
ok(hr == S_OK || broken(hr == E_INVALIDARG) /* NT */,
- "Got unexpected hr %08x.\n", hr);
+ "Got unexpected hr %#lx.\n", hr);
if (hr != S_OK)
return;
ok(!!ssa, "Got unexpected ssa %p.\n", ssa);
@@ -3270,9 +3265,9 @@ static void test_ScriptStringXtoCP_CPtoX(HDC hdc)
* character and iTrailing is FALSE. So for this loop iTrailing will
* be FALSE in both cases. */
hr = ScriptStringCPtoX(ssa, Cp, TRUE, &trail);
- ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = ScriptStringCPtoX(ssa, Cp, FALSE, &lead);
- ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(rtl[Cp] ? lead > trail : lead < trail,
"Got unexpected lead %d, trail %d, for rtl[%u] %u.\n",
lead, trail, Cp, rtl[Cp]);
@@ -3284,14 +3279,14 @@ static void test_ScriptStringXtoCP_CPtoX(HDC hdc)
/* Inside the leading edge. */
X = rtl[Cp] ? lead - 1 : lead + 1;
hr = ScriptStringXtoCP(ssa, X, &Ch, &iTrailing);
- ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(Ch == Cp, "Got unexpected Ch %d for X %d, expected %d.\n", Ch, X, Cp);
ok(!iTrailing, "Got unexpected iTrailing %#x for X %d.\n", iTrailing, X);
/* Inside the trailing edge. */
X = rtl[Cp] ? trail + 1 : trail - 1;
hr = ScriptStringXtoCP(ssa, X, &Ch, &iTrailing);
- ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(Ch == Cp, "Got unexpected Ch %d for X %d, expected %d.\n", Ch, X, Cp);
ok(iTrailing, "Got unexpected iTrailing %#x for X %d.\n", iTrailing, X);
@@ -3300,7 +3295,7 @@ static void test_ScriptStringXtoCP_CPtoX(HDC hdc)
{
X = rtl[Cp] ? lead + 1 : trail + 1;
hr = ScriptStringXtoCP(ssa, X, &Ch, &iTrailing);
- ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(Ch == Cp + 1, "Got unexpected Ch %d for X %d, expected %d.\n", Ch, X, Cp + 1);
ok(iTrailing == !!rtl[Cp + 1], "Got unexpected iTrailing %#x for X %d, expected %#x.\n",
iTrailing, X, !!rtl[Cp + 1]);
@@ -3311,7 +3306,7 @@ static void test_ScriptStringXtoCP_CPtoX(HDC hdc)
{
X = rtl[Cp] ? trail - 1 : lead - 1;
hr = ScriptStringXtoCP(ssa, X, &Ch, &iTrailing);
- ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(Ch == Cp - 1, "Got unexpected Ch %d for X %d, expected %d.\n", Ch, X, Cp - 1);
ok(iTrailing == !rtl[Cp - 1], "Got unexpected iTrailing %#x for X %d, expected %#x.\n",
iTrailing, X, !rtl[Cp - 1]);
@@ -3324,20 +3319,20 @@ static void test_ScriptStringXtoCP_CPtoX(HDC hdc)
/* Having a leading RTL character seems to confuse usp. This looks to
* be a Windows bug we should emulate. */
hr = ScriptStringCPtoX(ssa, 0, TRUE, &X);
- ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
--X;
hr = ScriptStringXtoCP(ssa, X, &Ch, &iTrailing);
- ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(Ch == 1, "Got unexpected Ch %d.\n", Ch);
ok(!iTrailing, "Got unexpected iTrailing %#x.\n", iTrailing);
}
else
{
hr = ScriptStringCPtoX(ssa, 0, FALSE, &X);
- ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
--X;
hr = ScriptStringXtoCP(ssa, X, &Ch, &iTrailing);
- ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(Ch == -1, "Got unexpected Ch %d.\n", Ch);
ok(iTrailing, "Got unexpected iTrailing %#x.\n", iTrailing);
}
@@ -3346,34 +3341,34 @@ static void test_ScriptStringXtoCP_CPtoX(HDC hdc)
if (rtl[String_len - 1])
{
hr = ScriptStringCPtoX(ssa, String_len - 1, FALSE, &X);
- ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
}
else
{
hr = ScriptStringCPtoX(ssa, String_len - 1, TRUE, &X);
- ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
}
++X;
hr = ScriptStringXtoCP(ssa, X, &Ch, &iTrailing);
- ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(Ch == String_len, "Got unexpected Ch %d, expected %d.\n", Ch, String_len);
ok(!iTrailing, "Got unexpected iTrailing %#x.\n", iTrailing);
/* Cleanup the SSA for the next round of tests. */
hr = ScriptStringFree(&ssa);
- ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
/* Test to see that exceeding the number of characters returns
* E_INVALIDARG. First generate an SSA for the subsequent tests. */
hr = ScriptStringAnalyse(hdc, &teststr1, String_len, Glyphs, -1,
SSA_GLYPHS, 100, NULL, NULL, NULL, NULL, InClass, &ssa);
- ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
/* When ScriptStringCPtoX() is called with a character position that
* exceeds the string length, return E_INVALIDARG. This also invalidates
* the ssa so a ScriptStringFree() should also fail. */
hr = ScriptStringCPtoX(ssa, String_len + 1, FALSE, &X);
- ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
ScriptStringFree(&ssa);
}
@@ -3401,33 +3396,33 @@ static void test_ScriptCacheGetHeight(HDC hdc)
HDC hdc2;
hr = ScriptCacheGetHeight(NULL, NULL, NULL);
- ok(hr == E_INVALIDARG, "expected E_INVALIDARG, got 0x%08x\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
hr = ScriptCacheGetHeight(NULL, &sc, NULL);
- ok(hr == E_INVALIDARG, "expected E_INVALIDARG, got 0x%08x\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
hr = ScriptCacheGetHeight(NULL, &sc, &height);
- ok(hr == E_PENDING, "expected E_PENDING, got 0x%08x\n", hr);
+ ok(hr == E_PENDING, "Unexpected hr %#lx.\n", hr);
height = 123;
hr = ScriptCacheGetHeight(hdc, NULL, &height);
- ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
ok(height == 123, "Unexpected height.\n");
memset(&tm, 0, sizeof(tm));
GetTextMetricsW(hdc, &tm);
- ok(tm.tmHeight > 0, "Unexpected tmHeight %u.\n", tm.tmHeight);
+ ok(tm.tmHeight > 0, "Unexpected tmHeight %lu.\n", tm.tmHeight);
height = 0;
hr = ScriptCacheGetHeight(hdc, &sc, &height);
- ok(hr == S_OK, "expected S_OK, got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(height == tm.tmHeight, "expected height > 0\n");
/* Try again with NULL dc. */
height2 = 0;
hr = ScriptCacheGetHeight(NULL, &sc, &height2);
- ok(hr == S_OK, "Failed to get cached height, hr %#x.\n", hr);
- ok(height2 == height, "Unexpected height %u.\n", height2);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
+ ok(height2 == height, "Unexpected height %lu.\n", height2);
hwnd = create_test_window();
@@ -3445,11 +3440,11 @@ static void test_ScriptCacheGetHeight(HDC hdc)
memset(&tm, 0, sizeof(tm));
GetTextMetricsW(hdc2, &tm);
- ok(tm.tmHeight > height, "Unexpected tmHeight %u.\n", tm.tmHeight);
+ ok(tm.tmHeight > height, "Unexpected tmHeight %lu.\n", tm.tmHeight);
height2 = 0;
hr = ScriptCacheGetHeight(hdc2, &sc, &height2);
- ok(hr == S_OK, "Failed to get cached height, hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(height2 == height, "Unexpected height.\n");
SelectObject(hdc2, prev_hfont);
@@ -3479,23 +3474,23 @@ static void test_ScriptGetGlyphABCWidth(HDC hdc)
ok(glyph != 0, "Unexpected glyph index.\n");
hr = ScriptGetGlyphABCWidth(NULL, NULL, glyph, NULL);
- ok(hr == E_INVALIDARG, "expected E_INVALIDARG, got 0x%08x\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
hr = ScriptGetGlyphABCWidth(NULL, &sc, glyph, NULL);
ok(broken(hr == E_PENDING) ||
hr == E_INVALIDARG, /* WIN7 */
- "expected E_INVALIDARG, got 0x%08x\n", hr);
+ "Unexpected hr %#lx.\n", hr);
hr = ScriptGetGlyphABCWidth(NULL, &sc, glyph, &abc);
- ok(hr == E_PENDING, "expected E_PENDING, got 0x%08x\n", hr);
+ ok(hr == E_PENDING, "Unexpected hr %#lx.\n", hr);
if (0) { /* crashes on WinXP */
hr = ScriptGetGlyphABCWidth(hdc, &sc, glyph, NULL);
- ok(hr == E_INVALIDARG, "expected E_INVALIDARG, got 0x%08x\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
}
hr = ScriptGetGlyphABCWidth(hdc, &sc, glyph, &abc);
- ok(hr == S_OK, "expected S_OK, got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(abc.abcB != 0, "Unexpected width.\n");
ret = GetCharABCWidthsI(hdc, glyph, 1, NULL, &abc2);
@@ -3524,7 +3519,7 @@ static void test_ScriptGetGlyphABCWidth(HDC hdc)
sc = NULL;
hr = ScriptGetGlyphABCWidth(hdc, &sc, glyph, &abc);
- ok(hr == S_OK, "Failed to get glyph width, hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(abc.abcB != 0, "Unexpected width.\n");
ret = GetCharWidthI(hdc, glyph, 1, NULL, &width);
@@ -3609,15 +3604,15 @@ static void test_ScriptLayout(void)
int i, j, vistolog[sizeof(levels[0])], logtovis[sizeof(levels[0])];
hr = ScriptLayout(sizeof(levels[0]), NULL, vistolog, logtovis);
- ok(hr == E_INVALIDARG, "expected E_INVALIDARG, got 0x%08x\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
hr = ScriptLayout(sizeof(levels[0]), levels[0], NULL, NULL);
- ok(hr == E_INVALIDARG, "expected E_INVALIDARG, got 0x%08x\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
for (i = 0; i < ARRAY_SIZE(levels); ++i)
{
hr = ScriptLayout(sizeof(levels[0]), levels[i], vistolog, logtovis);
- ok(hr == S_OK, "expected S_OK, got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
for (j = 0; j < sizeof(levels[i]); j++)
{
@@ -3653,10 +3648,10 @@ static BOOL CALLBACK enum_proc(LGRPID group, LCID lcid, LPSTR locale, LONG_PTR l
if (!SetThreadLocale(lcid)) return TRUE;
hr = ScriptRecordDigitSubstitution(lcid, &sds);
- ok(hr == S_OK, "ScriptRecordDigitSubstitution failed: 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = ScriptApplyDigitSubstitution(&sds, &sc, &ss);
- ok(hr == S_OK, "ScriptApplyDigitSubstitution failed: 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
SetThreadLocale(lcid_old);
return TRUE;
@@ -3690,7 +3685,7 @@ static void test_digit_substitution(void)
for (i = 0; i < ARRAY_SIZE(groups); ++i)
{
ret = EnumLanguageGroupLocalesA(enum_proc, groups[i], 0, 0);
- ok(ret, "EnumLanguageGroupLocalesA failed unexpectedly: %u\n", GetLastError());
+ ok(ret, "EnumLanguageGroupLocalesA failed unexpectedly: %lu\n", GetLastError());
}
}
@@ -3701,16 +3696,16 @@ static void test_ScriptGetProperties(void)
int num;
hr = ScriptGetProperties(NULL, NULL);
- ok(hr == E_INVALIDARG, "ScriptGetProperties succeeded\n");
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
hr = ScriptGetProperties(NULL, &num);
- ok(hr == S_OK, "ScriptGetProperties failed: 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = ScriptGetProperties(&props, NULL);
- ok(hr == S_OK, "ScriptGetProperties failed: 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = ScriptGetProperties(&props, &num);
- ok(hr == S_OK, "ScriptGetProperties failed: 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
}
static void test_ScriptBreak(void)
@@ -3721,7 +3716,7 @@ static void test_ScriptBreak(void)
HRESULT hr;
hr = ScriptItemize(test, 3, 4, NULL, NULL, items, NULL);
- ok(hr == S_OK, "ScriptItemize should return S_OK not %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
/*
* This Test crashes pre Vista.
@@ -3731,14 +3726,14 @@ static void test_ScriptBreak(void)
*/
hr = ScriptBreak(test, 0, &items[0].a, &la);
- ok(hr == E_FAIL || broken(hr == S_OK), "ScriptBreak should return E_FAIL not %08x\n", hr);
+ ok(hr == E_FAIL || broken(hr == S_OK), "Unexpected hr %#lx.\n", hr);
hr = ScriptBreak(test, -1, &items[0].a, &la);
- ok(hr == E_INVALIDARG || broken(hr == S_OK), "ScriptBreak should return E_INVALIDARG not %08x\n", hr);
+ ok(hr == E_INVALIDARG || broken(hr == S_OK), "Unexpected hr %#lx.\n", hr);
memset(&la, 0, sizeof(la));
hr = ScriptBreak(test, 1, &items[0].a, &la);
- ok(hr == S_OK, "ScriptBreak should return S_OK not %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(!la.fSoftBreak, "fSoftBreak set\n");
ok(la.fWhiteSpace, "fWhiteSpace not set\n");
@@ -3749,7 +3744,7 @@ static void test_ScriptBreak(void)
memset(&la, 0, sizeof(la));
hr = ScriptBreak(test + 1, 1, &items[1].a, &la);
- ok(hr == S_OK, "ScriptBreak should return S_OK not %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(!la.fSoftBreak, "fSoftBreak set\n");
ok(!la.fWhiteSpace, "fWhiteSpace set\n");
@@ -3760,7 +3755,7 @@ static void test_ScriptBreak(void)
memset(&la, 0, sizeof(la));
hr = ScriptBreak(test + 2, 1, &items[2].a, &la);
- ok(hr == S_OK, "ScriptBreak should return S_OK not %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(!la.fSoftBreak, "fSoftBreak set\n");
ok(!la.fWhiteSpace, "fWhiteSpace set\n");
@@ -3783,27 +3778,27 @@ static void test_newlines(void)
count = 0;
hr = ScriptItemize(test1, lstrlenW(test1), 5, NULL, NULL, items, &count);
- ok(hr == S_OK, "ScriptItemize failed: 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(count == 3, "got %d expected 3\n", count);
count = 0;
hr = ScriptItemize(test2, lstrlenW(test2), 5, NULL, NULL, items, &count);
- ok(hr == S_OK, "ScriptItemize failed: 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(count == 3, "got %d expected 3\n", count);
count = 0;
hr = ScriptItemize(test3, lstrlenW(test3), 5, NULL, NULL, items, &count);
- ok(hr == S_OK, "ScriptItemize failed: 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(count == 4, "got %d expected 4\n", count);
count = 0;
hr = ScriptItemize(test4, lstrlenW(test4), 5, NULL, NULL, items, &count);
- ok(hr == S_OK, "ScriptItemize failed: 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(count == 4, "got %d expected 4\n", count);
count = 0;
hr = ScriptItemize(test5, lstrlenW(test5), 5, NULL, NULL, items, &count);
- ok(hr == S_OK, "ScriptItemize failed: 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(count == 4, "got %d expected 4\n", count);
}
@@ -3827,22 +3822,22 @@ static void test_ScriptGetFontFunctions(HDC hdc)
}
hr = pScriptGetFontScriptTags(hdc, &sc, NULL, 0, NULL, NULL);
- ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
ok(!sc, "Got unexpected script cache %p.\n", sc);
hr = pScriptGetFontScriptTags(hdc, &sc, NULL, 0, NULL, &count);
- ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
ok(!sc, "Got unexpected script cache %p.\n", sc);
hr = pScriptGetFontScriptTags(hdc, &sc, NULL, ARRAY_SIZE(tags), tags, NULL);
- ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
ok(!sc, "Got unexpected script cache %p.\n", sc);
hr = pScriptGetFontScriptTags(hdc, &sc, NULL, 0, tags, &count);
- ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
ok(!sc, "Got unexpected script cache %p.\n", sc);
hr = pScriptGetFontScriptTags(NULL, &sc, NULL, ARRAY_SIZE(tags), tags, &count);
- ok(hr == E_PENDING, "Got unexpected hr %#x.\n", hr);
+ ok(hr == E_PENDING, "Unexpected hr %#lx.\n", hr);
ok(!sc, "Got unexpected script cache %p.\n", sc);
hr = pScriptGetFontScriptTags(hdc, &sc, NULL, ARRAY_SIZE(tags), tags, &count);
- ok(hr == S_OK || hr == E_OUTOFMEMORY, "Got unexpected hr %#x.\n", hr);
+ ok(hr == S_OK || hr == E_OUTOFMEMORY, "Unexpected hr %#lx.\n", hr);
if (hr == S_OK)
ok(count <= 5, "Got unexpected count %d.\n", count);
else
@@ -3853,22 +3848,22 @@ static void test_ScriptGetFontFunctions(HDC hdc)
sc = NULL;
hr = pScriptGetFontLanguageTags(hdc, &sc, NULL, latn_tag, 0, NULL, NULL);
- ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
ok(!sc, "Got unexpected script cache %p.\n", sc);
hr = pScriptGetFontLanguageTags(hdc, &sc, NULL, latn_tag, 0, NULL, &count);
- ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
ok(!sc, "Got unexpected script cache %p.\n", sc);
hr = pScriptGetFontLanguageTags(hdc, &sc, NULL, latn_tag, ARRAY_SIZE(tags), tags, NULL);
- ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
ok(!sc, "Got unexpected script cache %p.\n", sc);
hr = pScriptGetFontLanguageTags(hdc, &sc, NULL, latn_tag, 0, tags, &count);
- ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
ok(!sc, "Got unexpected script cache %p.\n", sc);
hr = pScriptGetFontLanguageTags(NULL, &sc, NULL, latn_tag, ARRAY_SIZE(tags), tags, &count);
- ok(hr == E_PENDING, "Got unexpected hr %#x.\n", hr);
+ ok(hr == E_PENDING, "Unexpected hr %#lx.\n", hr);
ok(!sc, "Got unexpected script cache %p.\n", sc);
hr = pScriptGetFontLanguageTags(hdc, &sc, NULL, latn_tag, ARRAY_SIZE(tags), tags, &count);
- ok(hr == S_OK || hr == E_OUTOFMEMORY, "Got unexpected hr %#x.\n", hr);
+ ok(hr == S_OK || hr == E_OUTOFMEMORY, "Unexpected hr %#lx.\n", hr);
if (hr == S_OK)
ok(count <= 5, "Got unexpected count %d.\n", count);
else
@@ -3878,22 +3873,22 @@ static void test_ScriptGetFontFunctions(HDC hdc)
sc = NULL;
hr = pScriptGetFontFeatureTags(hdc, &sc, NULL, latn_tag, 0x0, 0, NULL, NULL);
- ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
ok(!sc, "Got unexpected script cache %p.\n", sc);
hr = pScriptGetFontFeatureTags(hdc, &sc, NULL, latn_tag, 0x0, 0, NULL, &count);
- ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
ok(!sc, "Got unexpected script cache %p.\n", sc);
hr = pScriptGetFontFeatureTags(hdc, &sc, NULL, latn_tag, 0x0, ARRAY_SIZE(tags), tags, NULL);
- ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
ok(!sc, "Got unexpected script cache %p.\n", sc);
hr = pScriptGetFontFeatureTags(hdc, &sc, NULL, latn_tag, 0x0, 0, tags, &count);
- ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
ok(!sc, "Got unexpected script cache %p.\n", sc);
hr = pScriptGetFontFeatureTags(NULL, &sc, NULL, latn_tag, 0x0, ARRAY_SIZE(tags), tags, &count);
- ok(hr == E_PENDING, "Got unexpected hr %#x.\n", hr);
+ ok(hr == E_PENDING, "Unexpected hr %#lx.\n", hr);
ok(!sc, "Got unexpected script cache %p.\n", sc);
hr = pScriptGetFontFeatureTags(hdc, &sc, NULL, latn_tag, 0x0, ARRAY_SIZE(tags), tags, &count);
- ok(hr == S_OK || hr == E_OUTOFMEMORY, "Got unexpected hr %#x.\n", hr);
+ ok(hr == S_OK || hr == E_OUTOFMEMORY, "Unexpected hr %#lx.\n", hr);
if (hr == S_OK)
ok(count <= 5, "Got unexpected count %d.\n", count);
else
@@ -3904,20 +3899,20 @@ static void test_ScriptGetFontFunctions(HDC hdc)
hr = ScriptItemize(test_phagspa, ARRAY_SIZE(test_phagspa), ARRAY_SIZE(items),
&control, &state, items, &count);
- ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
memset(tags, 0, sizeof(tags));
hr = pScriptGetFontScriptTags(hdc, &sc, &items[0].a, ARRAY_SIZE(tags), tags, &count);
- ok(hr == USP_E_SCRIPT_NOT_IN_FONT || broken(hr == S_OK), "Got unexpected hr %#x.\n", hr);
+ ok(hr == USP_E_SCRIPT_NOT_IN_FONT || broken(hr == S_OK), "Unexpected hr %#lx.\n", hr);
hr = pScriptGetFontLanguageTags(hdc, &sc, NULL, dsrt_tag, ARRAY_SIZE(tags), tags, &count);
- ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = pScriptGetFontLanguageTags(hdc, &sc, &items[0].a, dsrt_tag, ARRAY_SIZE(tags), tags, &count);
- ok(hr == E_INVALIDARG || broken(hr == S_OK), "Got unexpected hr %#x.\n", hr);
+ ok(hr == E_INVALIDARG || broken(hr == S_OK), "Unexpected hr %#lx.\n", hr);
hr = pScriptGetFontFeatureTags(hdc, &sc, NULL, dsrt_tag, 0x0, ARRAY_SIZE(tags), tags, &count);
- ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = pScriptGetFontFeatureTags(hdc, &sc, &items[0].a, dsrt_tag, 0x0, ARRAY_SIZE(tags), tags, &count);
- ok(hr == E_INVALIDARG || broken(hr == S_OK), "Got unexpected hr %#x.\n", hr);
+ ok(hr == E_INVALIDARG || broken(hr == S_OK), "Unexpected hr %#lx.\n", hr);
ScriptFreeCache(&sc);
}
@@ -3967,7 +3962,7 @@ static void test_ScriptGetLogicalWidths(void)
}
hr = ScriptGetLogicalWidths(&sa, ptr->char_count, ptr->glyph_count, ptr->advances, ptr->map, attrs, widths);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
todo_wine_if(ptr->todo)
ok(!memcmp(ptr->widths, widths, sizeof(widths)), "test %u: got wrong widths\n", i);
@@ -3998,42 +3993,42 @@ static void test_ScriptIsComplex(void)
HRESULT hr;
hr = ScriptIsComplex(NULL, 0, 0);
- ok(hr == E_INVALIDARG || broken(hr == S_FALSE) /* winxp/vista */, "got 0x%08x\n", hr);
+ ok(hr == E_INVALIDARG || broken(hr == S_FALSE) /* winxp/vista */, "Unexpected hr %#lx.\n", hr);
if (hr == E_INVALIDARG)
{
hr = ScriptIsComplex(NULL, 1, 0);
- ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
}
hr = ScriptIsComplex(test2W, -1, SIC_ASCIIDIGIT);
- ok(hr == E_INVALIDARG || broken(hr == S_FALSE) /* winxp/vista */, "got 0x%08x\n", hr);
+ ok(hr == E_INVALIDARG || broken(hr == S_FALSE) /* winxp/vista */, "Unexpected hr %#lx.\n", hr);
hr = ScriptIsComplex(test2W, 0, SIC_ASCIIDIGIT);
- ok(hr == S_FALSE, "got 0x%08x\n", hr);
+ ok(hr == S_FALSE, "Unexpected hr %#lx.\n", hr);
for (i = 0; i < ARRAY_SIZE(complex_tests); ++i)
{
hr = ScriptIsComplex(complex_tests[i].text, lstrlenW(complex_tests[i].text), complex_tests[i].flags);
todo_wine_if(complex_tests[i].todo)
- ok(hr == complex_tests[i].hr, "%u: got %#x, expected %#x, flags %#x\n", i, hr, complex_tests[i].hr,
+ ok(hr == complex_tests[i].hr, "%u: got %#lx, expected %#lx, flags %#lx.\n", i, hr, complex_tests[i].hr,
complex_tests[i].flags);
}
hr = ScriptIsComplex(test2W, 1, ~0u);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = ScriptIsComplex(testW, 3, 0);
- ok(hr == S_FALSE, "got 0x%08x\n", hr);
+ ok(hr == S_FALSE, "Unexpected hr %#lx.\n", hr);
hr = ScriptIsComplex(testW, 3, SIC_NEUTRAL | SIC_COMPLEX);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = ScriptIsComplex(testW, 3, SIC_COMPLEX);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = ScriptIsComplex(test2W, 1, SIC_COMPLEX);
- ok(hr == S_FALSE, "got 0x%08x\n", hr);
+ ok(hr == S_FALSE, "Unexpected hr %#lx.\n", hr);
}
static void test_ScriptString_pSize(HDC hdc)
@@ -4046,7 +4041,7 @@ static void test_ScriptString_pSize(HDC hdc)
ABC abc;
hr = ScriptStringAnalyse(hdc, textW, 1, 16, -1, SSA_GLYPHS, 0, NULL, NULL, NULL, NULL, NULL, &ssa);
- ok(hr == S_OK, "ScriptStringAnalyse failed, hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
size = ScriptString_pSize(NULL);
ok(size == NULL || broken(size != NULL) /* <win7 */, "Unexpected size pointer.\n");
@@ -4059,11 +4054,11 @@ static void test_ScriptString_pSize(HDC hdc)
size = ScriptString_pSize(ssa);
ok(size != NULL, "Unexpected size pointer.\n");
- ok(size->cx == abc.abcA + abc.abcB + abc.abcC, "Unexpected cx size %d.\n", size->cx);
- ok(size->cy == tm.tmHeight, "Unexpected cy size %d.\n", size->cy);
+ ok(size->cx == abc.abcA + abc.abcB + abc.abcC, "Unexpected cx size %ld.\n", size->cx);
+ ok(size->cy == tm.tmHeight, "Unexpected cy size %ld.\n", size->cy);
hr = ScriptStringFree(&ssa);
- ok(hr == S_OK, "Failed to free ssa, hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
}
static void test_script_cache_reuse(void)
@@ -4102,13 +4097,13 @@ static void test_script_cache_reuse(void)
/* Get a script cache */
hr = ScriptCacheGetHeight(hdc1, &sc, &height);
- ok(hr == S_OK, "expected S_OK, got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(sc != NULL, "Script cache is NULL\n");
/* Same font, same DC -> same SCRIPT_CACHE */
sc2 = NULL;
hr = ScriptCacheGetHeight(hdc1, &sc2, &height);
- ok(hr == S_OK, "expected S_OK, got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(sc2 != NULL, "Script cache is NULL\n");
ok(sc == sc2, "Expected caches %p, %p to be identical\n", sc, sc2);
ScriptFreeCache(&sc2);
@@ -4116,7 +4111,7 @@ static void test_script_cache_reuse(void)
/* Same font in different DC -> same SCRIPT_CACHE */
sc2 = NULL;
hr = ScriptCacheGetHeight(hdc2, &sc2, &height);
- ok(hr == S_OK, "expected S_OK, got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(sc2 != NULL, "Script cache is NULL\n");
ok(sc == sc2, "Expected caches %p, %p to be identical\n", sc, sc2);
ScriptFreeCache(&sc2);
@@ -4127,14 +4122,14 @@ static void test_script_cache_reuse(void)
sc2 = NULL;
hr = ScriptCacheGetHeight(hdc1, &sc2, &height);
- ok(hr == S_OK, "expected S_OK, got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(sc2 != NULL, "Script cache is NULL\n");
ok(sc == sc2, "Expected caches %p, %p to be identical\n", sc, sc2);
ScriptFreeCache(&sc2);
sc2 = NULL;
hr = ScriptCacheGetHeight(hdc2, &sc2, &height);
- ok(hr == S_OK, "expected S_OK, got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(sc2 != NULL, "Script cache is NULL\n");
ok(sc == sc2, "Expected caches %p, %p to be identical\n", sc, sc2);
ScriptFreeCache(&sc2);
@@ -4151,14 +4146,14 @@ static void test_script_cache_reuse(void)
sc2 = NULL;
hr = ScriptCacheGetHeight(hdc1, &sc2, &height);
- ok(hr == S_OK, "expected S_OK, got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(sc2 != NULL, "Script cache is NULL\n");
ok(sc != sc2, "Expected caches %p, %p to be different\n", sc, sc2);
ScriptFreeCache(&sc2);
sc2 = NULL;
hr = ScriptCacheGetHeight(hdc2, &sc2, &height);
- ok(hr == S_OK, "expected S_OK, got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(sc2 != NULL, "Script cache is NULL\n");
ok(sc != sc2, "Expected caches %p, %p to be different\n", sc, sc2);
ScriptFreeCache(&sc2);
--
2.34.1
1
1
Feb. 19, 2022
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=45988
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=47084
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=49715
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=52183
Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com>
---
v2: Fix bug URLs, support Win7 results.
dlls/mf/tests/mf.c | 60 ++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 60 insertions(+)
diff --git a/dlls/mf/tests/mf.c b/dlls/mf/tests/mf.c
index c4d318a9e43..add48be964a 100644
--- a/dlls/mf/tests/mf.c
+++ b/dlls/mf/tests/mf.c
@@ -6135,6 +6135,65 @@ failed:
CoUninitialize();
}
+static void test_h264_decoder(void)
+{
+ static const media_type_desc transform_inputs[] =
+ {
+ {
+ ATTR_GUID(MF_MT_MAJOR_TYPE, MFMediaType_Video),
+ ATTR_GUID(MF_MT_SUBTYPE, MFVideoFormat_H264),
+ },
+ {
+ ATTR_GUID(MF_MT_MAJOR_TYPE, MFMediaType_Video),
+ ATTR_GUID(MF_MT_SUBTYPE, MFVideoFormat_H264_ES),
+ },
+ };
+ static const media_type_desc transform_outputs[] =
+ {
+ {
+ ATTR_GUID(MF_MT_MAJOR_TYPE, MFMediaType_Video),
+ ATTR_GUID(MF_MT_SUBTYPE, MFVideoFormat_NV12),
+ },
+ {
+ ATTR_GUID(MF_MT_MAJOR_TYPE, MFMediaType_Video),
+ ATTR_GUID(MF_MT_SUBTYPE, MFVideoFormat_YV12),
+ },
+ {
+ ATTR_GUID(MF_MT_MAJOR_TYPE, MFMediaType_Video),
+ ATTR_GUID(MF_MT_SUBTYPE, MFVideoFormat_IYUV),
+ },
+ {
+ ATTR_GUID(MF_MT_MAJOR_TYPE, MFMediaType_Video),
+ ATTR_GUID(MF_MT_SUBTYPE, MFVideoFormat_I420),
+ },
+ {
+ ATTR_GUID(MF_MT_MAJOR_TYPE, MFMediaType_Video),
+ ATTR_GUID(MF_MT_SUBTYPE, MFVideoFormat_YUY2),
+ },
+ };
+
+ MFT_REGISTER_TYPE_INFO input_type = {MFMediaType_Video, MFVideoFormat_H264};
+ MFT_REGISTER_TYPE_INFO output_type = {MFMediaType_Video, MFVideoFormat_NV12};
+ IMFTransform *transform;
+ GUID class_id;
+ HRESULT hr;
+ ULONG ret;
+
+ hr = CoInitialize(NULL);
+ ok(hr == S_OK, "Failed to initialize, hr %#x.\n", hr);
+
+ if (!create_transform(MFT_CATEGORY_VIDEO_DECODER, &input_type, &output_type, L"Microsoft H264 Video Decoder MFT",
+ transform_inputs, ARRAY_SIZE(transform_inputs), transform_outputs, ARRAY_SIZE(transform_outputs),
+ &transform, &class_id))
+ goto failed;
+
+ ret = IMFTransform_Release(transform);
+ ok(ret == 0, "Release returned %u\n", ret);
+
+failed:
+ CoUninitialize();
+}
+
START_TEST(mf)
{
init_functions();
@@ -6170,4 +6229,5 @@ START_TEST(mf)
test_MFRequireProtectedEnvironment();
test_wma_encoder();
test_wma_decoder();
+ test_h264_decoder();
}
--
2.34.1
2
9
Feb. 18, 2022
Signed-off-by: Sven Baars <sbaars(a)codeweavers.com>
---
v2: Remove changes that crashed the tests.
dlls/crypt32/tests/cert.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/dlls/crypt32/tests/cert.c b/dlls/crypt32/tests/cert.c
index b96f94cc662..27685da1512 100644
--- a/dlls/crypt32/tests/cert.c
+++ b/dlls/crypt32/tests/cert.c
@@ -4318,6 +4318,7 @@ static void test_VerifySignature(void)
BCryptDestroyHash(bhash);
done:
BCryptCloseAlgorithmProvider(alg, 0);
+ BCryptDestroyKey(bkey);
LocalFree(info);
CertFreeCertificateContext(cert);
--
2.30.0.335.ge6362826a0
1
4
[PATCH] ntoskrnl.exe/tests: Let CertCloseStore() delete the certificate context.
by Sven Baars Feb. 18, 2022
by Sven Baars Feb. 18, 2022
Feb. 18, 2022
This should fix test failures caused by ef437b41eebcb54a3576741fc52dbc29caa1590f.
Signed-off-by: Sven Baars <sbaars(a)codeweavers.com>
---
Apparently our implementation of CertDeleteCertificateFromStore() is wrong instead.
It seems like it should always call CertFreeCertificateContext() internally.
I'm not sure yet of the best way to do this.
dlls/ntoskrnl.exe/tests/ntoskrnl.c | 4 ----
1 file changed, 4 deletions(-)
diff --git a/dlls/ntoskrnl.exe/tests/ntoskrnl.c b/dlls/ntoskrnl.exe/tests/ntoskrnl.c
index 6207ce00ccb..13d1af4e7cd 100644
--- a/dlls/ntoskrnl.exe/tests/ntoskrnl.c
+++ b/dlls/ntoskrnl.exe/tests/ntoskrnl.c
@@ -233,15 +233,11 @@ static void testsign_cleanup(struct testsign_context *ctx)
ret = CertFreeCertificateContext(ctx->cert);
ok(ret, "Failed to free certificate, error %u\n", GetLastError());
- ret = CertDeleteCertificateFromStore(ctx->root_cert);
- ok(ret, "Failed to remove certificate, error %u\n", GetLastError());
ret = CertFreeCertificateContext(ctx->root_cert);
ok(ret, "Failed to free certificate context, error %u\n", GetLastError());
ret = CertCloseStore(ctx->root_store, CERT_CLOSE_STORE_CHECK_FLAG);
ok(ret, "Failed to close store, error %u\n", GetLastError());
- ret = CertDeleteCertificateFromStore(ctx->publisher_cert);
- ok(ret, "Failed to remove certificate, error %u\n", GetLastError());
ret = CertFreeCertificateContext(ctx->publisher_cert);
ok(ret, "Failed to free certificate context, error %u\n", GetLastError());
ret = CertCloseStore(ctx->publisher_store, CERT_CLOSE_STORE_CHECK_FLAG);
--
2.30.0.335.ge6362826a0
1
0
Feb. 18, 2022
Signed-off-by: Sven Baars <sbaars(a)codeweavers.com>
---
dlls/crypt32/tests/cert.c | 29 +++++++++++++----------------
1 file changed, 13 insertions(+), 16 deletions(-)
diff --git a/dlls/crypt32/tests/cert.c b/dlls/crypt32/tests/cert.c
index b96f94cc662..f0750cfc826 100644
--- a/dlls/crypt32/tests/cert.c
+++ b/dlls/crypt32/tests/cert.c
@@ -205,10 +205,9 @@ static void testAddCert(void)
{
CRYPT_DATA_BLOB hash = { sizeof(bigCert2Hash), bigCert2Hash };
- /* Duplicate (AddRef) the context so we can still use it after
- * deleting it from the store.
- */
- CertDuplicateCertificateContext(context);
+ /* We always need to call CertFreeCertificateContext after calling
+ CertAddEncodedCertificateToStore, which means that we can use
+ the context after deleting it from the store */
CertDeleteCertificateFromStore(context);
/* Set the same hash as bigCert2, and try to readd it */
ret = CertSetCertificateContextProperty(context, CERT_HASH_PROP_ID,
@@ -243,10 +242,9 @@ static void testAddCert(void)
ret = CertAddEncodedCertificateToStore(store, X509_ASN_ENCODING,
bigCert2WithDifferentSerial, sizeof(bigCert2WithDifferentSerial),
CERT_STORE_ADD_NEW, &context);
- ok(ret, "CertAddEncodedCertificateToStore failed: %08x\n",
- GetLastError());
- if (context)
- CertDeleteCertificateFromStore(context);
+ ok(ret, "CertAddEncodedCertificateToStore failed: %08x\n", GetLastError());
+ CertDeleteCertificateFromStore(context);
+ CertFreeCertificateContext(context);
/* Adding a cert with the same subject name and serial number (but
* different issuer) as an existing cert succeeds.
@@ -255,10 +253,9 @@ static void testAddCert(void)
ret = CertAddEncodedCertificateToStore(store, X509_ASN_ENCODING,
bigCertWithDifferentSubject, sizeof(bigCertWithDifferentSubject),
CERT_STORE_ADD_NEW, &context);
- ok(ret, "CertAddEncodedCertificateToStore failed: %08x\n",
- GetLastError());
- if (context)
- CertDeleteCertificateFromStore(context);
+ ok(ret, "CertAddEncodedCertificateToStore failed: %08x\n", GetLastError());
+ CertDeleteCertificateFromStore(context);
+ CertFreeCertificateContext(context);
/* Adding a cert with the same issuer name and serial number (but
* different otherwise) as an existing cert succeeds.
@@ -267,10 +264,9 @@ static void testAddCert(void)
ret = CertAddEncodedCertificateToStore(store, X509_ASN_ENCODING,
bigCertWithDifferentIssuer, sizeof(bigCertWithDifferentIssuer),
CERT_STORE_ADD_NEW, &context);
- ok(ret, "CertAddEncodedCertificateToStore failed: %08x\n",
- GetLastError());
- if (context)
- CertDeleteCertificateFromStore(context);
+ ok(ret, "CertAddEncodedCertificateToStore failed: %08x\n", GetLastError());
+ CertDeleteCertificateFromStore(context);
+ CertFreeCertificateContext(context);
collection = CertOpenStore(CERT_STORE_PROV_COLLECTION, 0, 0,
CERT_STORE_CREATE_NEW_FLAG, NULL);
@@ -4318,6 +4314,7 @@ static void test_VerifySignature(void)
BCryptDestroyHash(bhash);
done:
BCryptCloseAlgorithmProvider(alg, 0);
+ BCryptDestroyKey(bkey);
LocalFree(info);
CertFreeCertificateContext(cert);
--
2.30.0.335.ge6362826a0
2
5
[PATCH v2 1/4] ncrypt: Validate existence of property before creating one.
by Santino Mazza Feb. 18, 2022
by Santino Mazza Feb. 18, 2022
Feb. 18, 2022
Signed-off-by: Santino Mazza <mazzasantino1206(a)gmail.com>
---
dlls/ncrypt/main.c | 15 ++++++++++++---
1 file changed, 12 insertions(+), 3 deletions(-)
diff --git a/dlls/ncrypt/main.c b/dlls/ncrypt/main.c
index 8e789573924..dbcb0087445 100644
--- a/dlls/ncrypt/main.c
+++ b/dlls/ncrypt/main.c
@@ -181,11 +181,10 @@ static struct object *allocate_object(enum object_type type)
return ret;
}
-static SECURITY_STATUS set_object_property(struct object *object, const WCHAR *name, BYTE *value, DWORD value_size)
+struct object_property *create_object_property(struct object *object, const WCHAR *name)
{
struct object_property *property;
- FIXME("check duplicates\n");
if (!object->num_properties)
{
if (!(object->properties = malloc(sizeof(*property))))
@@ -215,8 +214,18 @@ static SECURITY_STATUS set_object_property(struct object *object, const WCHAR *n
}
lstrcpyW(property->key, name);
+
+ return property;
+}
+
+static SECURITY_STATUS set_object_property(struct object *object, const WCHAR *name, BYTE *value, DWORD value_size)
+{
+ struct object_property *property = get_object_property(object, name);
+
+ if(!property) property = create_object_property(object, name);
+
property->value_size = value_size;
- if (!(property->value = malloc(value_size)))
+ if (!(property->value = realloc(property->value, value_size)))
{
ERR("Error allocating memory.");
free(property->key);
--
2.32.0
1
3