12 changes: 6 additions & 6 deletions dlls/comctl32/tests/progress.c
Original file line number Diff line number Diff line change
Expand Up @@ -222,22 +222,22 @@ static void test_setcolors(void)
progress = create_progress(PBS_SMOOTH);

clr = SendMessageA(progress, PBM_SETBARCOLOR, 0, 0);
ok(clr == CLR_DEFAULT, "got %x\n", clr);
ok(clr == CLR_DEFAULT, "got %lx\n", clr);

clr = SendMessageA(progress, PBM_SETBARCOLOR, 0, RGB(0, 255, 0));
ok(clr == 0, "got %x\n", clr);
ok(clr == 0, "got %lx\n", clr);

clr = SendMessageA(progress, PBM_SETBARCOLOR, 0, CLR_DEFAULT);
ok(clr == RGB(0, 255, 0), "got %x\n", clr);
ok(clr == RGB(0, 255, 0), "got %lx\n", clr);

clr = SendMessageA(progress, PBM_SETBKCOLOR, 0, 0);
ok(clr == CLR_DEFAULT, "got %x\n", clr);
ok(clr == CLR_DEFAULT, "got %lx\n", clr);

clr = SendMessageA(progress, PBM_SETBKCOLOR, 0, RGB(255, 0, 0));
ok(clr == 0, "got %x\n", clr);
ok(clr == 0, "got %lx\n", clr);

clr = SendMessageA(progress, PBM_SETBKCOLOR, 0, CLR_DEFAULT);
ok(clr == RGB(255, 0, 0), "got %x\n", clr);
ok(clr == RGB(255, 0, 0), "got %lx\n", clr);

DestroyWindow(progress);
}
Expand Down
84 changes: 42 additions & 42 deletions dlls/comctl32/tests/propsheet.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ static int CALLBACK sheet_callback(HWND hwnd, UINT msg, LPARAM lparam)
* Arabic Windows 10 allocates 2 * size - 32,
* all others allocate exactly 2 * size */
ok(buffer_size >= 2 * size || broken(buffer_size == 2 * size - 32),
"Unexpected template buffer size %u, resource size %u\n",
"Unexpected template buffer size %lu, resource size %lu\n",
buffer_size, size);
break;
}
Expand Down Expand Up @@ -173,7 +173,7 @@ static void test_title(void)
style = GetWindowLongA(hdlg, GWL_STYLE);
ok(style == (WS_POPUP|WS_VISIBLE|WS_CLIPSIBLINGS|WS_CAPTION|WS_SYSMENU|
DS_CONTEXTHELP|DS_MODALFRAME|DS_SETFONT|DS_3DLOOK),
"got unexpected style: %x\n", style);
"got unexpected style: %lx\n", style);

DestroyWindow(hdlg);
}
Expand Down Expand Up @@ -215,7 +215,7 @@ static void test_nopage(void)
(HWND)SendMessageA(hdlg, PSM_GETCURRENTPAGEHWND, 0, 0);
active_page = /* PropSheet_HwndToIndex(hdlg, hpage)); */
(int)SendMessageA(hdlg, PSM_HWNDTOINDEX, (WPARAM)hpage, 0);
ok(hpage == NULL, "expected no current page, got %p, index=%d\n", hpage, active_page);
ok(hpage == NULL, "expected no current page, got %p, index=%ld\n", hpage, active_page);
flush_events();
RedrawWindow(hdlg,NULL,NULL,RDW_UPDATENOW|RDW_ERASENOW);

Expand Down Expand Up @@ -287,7 +287,7 @@ static void test_disableowner(void)
psh.pfnCallback = disableowner_callback;

p = pPropertySheetA(&psh);
ok(p == 0, "Expected 0, got %ld\n", p);
ok(p == 0, "Expected 0, got %Id\n", p);
ok(IsWindowEnabled(parenthwnd) != 0, "parent window should be enabled\n");
DestroyWindow(parenthwnd);
}
Expand Down Expand Up @@ -402,26 +402,26 @@ static void test_wiznavigation(void)
hdlg = (HWND)pPropertySheetA(&psh);
ok(hdlg != INVALID_HANDLE_VALUE, "got invalid handle %p\n", hdlg);

ok(active_page == 0, "Active page should be 0. Is: %d\n", active_page);
ok(active_page == 0, "Active page should be 0. Is: %ld\n", active_page);

style = GetWindowLongA(hdlg, GWL_STYLE) & ~(DS_CONTEXTHELP|WS_SYSMENU);
ok(style == (WS_POPUP|WS_VISIBLE|WS_CLIPSIBLINGS|WS_CAPTION|
DS_MODALFRAME|DS_SETFONT|DS_3DLOOK),
"got unexpected style: %x\n", style);
"got unexpected style: %lx\n", style);

control = GetFocus();
controlID = GetWindowLongPtrA(control, GWLP_ID);
ok(controlID == nextID, "Focus should have been set to the Next button. Expected: %d, Found: %ld\n", nextID, controlID);
ok(controlID == nextID, "Focus should have been set to the Next button. Expected: %d, Found: %Id\n", nextID, controlID);

/* simulate pressing the Next button */
SendMessageA(hdlg, PSM_PRESSBUTTON, PSBTN_NEXT, 0);
if (!active_page) hwndtoindex_supported = FALSE;
if (hwndtoindex_supported)
ok(active_page == 1, "Active page should be 1 after pressing Next. Is: %d\n", active_page);
ok(active_page == 1, "Active page should be 1 after pressing Next. Is: %ld\n", active_page);

control = GetFocus();
controlID = GetWindowLongPtrA(control, GWLP_ID);
ok(controlID == IDC_PS_EDIT1, "Focus should be set to the first item on the second page. Expected: %d, Found: %ld\n", IDC_PS_EDIT1, controlID);
ok(controlID == IDC_PS_EDIT1, "Focus should be set to the first item on the second page. Expected: %d, Found: %Id\n", IDC_PS_EDIT1, controlID);

defidres = SendMessageA(hdlg, DM_GETDEFID, 0, 0);
ok(defidres == MAKELRESULT(nextID, DC_HASDEFID), "Expected default button ID to be %d, is %d\n", nextID, LOWORD(defidres));
Expand All @@ -432,41 +432,41 @@ static void test_wiznavigation(void)
/* press next again */
SendMessageA(hdlg, PSM_PRESSBUTTON, PSBTN_NEXT, 0);
if (hwndtoindex_supported)
ok(active_page == 2, "Active page should be 2 after pressing Next. Is: %d\n", active_page);
ok(active_page == 2, "Active page should be 2 after pressing Next. Is: %ld\n", active_page);

control = GetFocus();
controlID = GetWindowLongPtrA(control, GWLP_ID);
ok(controlID == IDC_PS_RADIO1, "Focus should have been set to item on third page. Expected: %d, Found %ld\n", IDC_PS_RADIO1, controlID);
ok(controlID == IDC_PS_RADIO1, "Focus should have been set to item on third page. Expected: %d, Found %Id\n", IDC_PS_RADIO1, controlID);

/* back button */
SendMessageA(hdlg, PSM_PRESSBUTTON, PSBTN_BACK, 0);
if (hwndtoindex_supported)
ok(active_page == 1, "Active page should be 1 after pressing Back. Is: %d\n", active_page);
ok(active_page == 1, "Active page should be 1 after pressing Back. Is: %ld\n", active_page);

control = GetFocus();
controlID = GetWindowLongPtrA(control, GWLP_ID);
ok(controlID == IDC_PS_EDIT1, "Focus should have been set to the first item on second page. Expected: %d, Found %ld\n", IDC_PS_EDIT1, controlID);
ok(controlID == IDC_PS_EDIT1, "Focus should have been set to the first item on second page. Expected: %d, Found %Id\n", IDC_PS_EDIT1, controlID);

defidres = SendMessageA(hdlg, DM_GETDEFID, 0, 0);
ok(defidres == MAKELRESULT(backID, DC_HASDEFID), "Expected default button ID to be %d, is %d\n", backID, LOWORD(defidres));

/* press next twice */
SendMessageA(hdlg, PSM_PRESSBUTTON, PSBTN_NEXT, 0);
if (hwndtoindex_supported)
ok(active_page == 2, "Active page should be 2 after pressing Next. Is: %d\n", active_page);
ok(active_page == 2, "Active page should be 2 after pressing Next. Is: %ld\n", active_page);
SendMessageA(hdlg, PSM_PRESSBUTTON, PSBTN_NEXT, 0);
if (hwndtoindex_supported)
ok(active_page == 3, "Active page should be 3 after pressing Next. Is: %d\n", active_page);
ok(active_page == 3, "Active page should be 3 after pressing Next. Is: %ld\n", active_page);
else
active_page = 3;

control = GetFocus();
controlID = GetWindowLongPtrA(control, GWLP_ID);
ok(controlID == nextID, "Focus should have been set to the Next button. Expected: %d, Found: %ld\n", nextID, controlID);
ok(controlID == nextID, "Focus should have been set to the Next button. Expected: %d, Found: %Id\n", nextID, controlID);

/* try to navigate away, but shouldn't be able to */
SendMessageA(hdlg, PSM_PRESSBUTTON, PSBTN_BACK, 0);
ok(active_page == 3, "Active page should still be 3 after pressing Back. Is: %d\n", active_page);
ok(active_page == 3, "Active page should still be 3 after pressing Back. Is: %ld\n", active_page);

defidres = SendMessageA(hdlg, DM_GETDEFID, 0, 0);
ok(defidres == MAKELRESULT(nextID, DC_HASDEFID), "Expected default button ID to be %d, is %d\n", nextID, LOWORD(defidres));
Expand Down Expand Up @@ -892,34 +892,34 @@ if (0)
tab = (HWND)SendMessageA(hdlg, PSM_GETTABCONTROL, 0, 0);

r = SendMessageA(tab, TCM_GETITEMCOUNT, 0, 0);
ok(r == 2, "got %d\n", r);
ok(r == 2, "got %ld\n", r);

ret = SendMessageA(hdlg, PSM_ADDPAGE, 0, (LPARAM)hpsp[2]);
ok(ret == TRUE, "got %d\n", ret);

r = SendMessageA(tab, TCM_GETITEMCOUNT, 0, 0);
ok(r == 3, "got %d\n", r);
ok(r == 3, "got %ld\n", r);

/* add property sheet page that can't be created */
ret = SendMessageA(hdlg, PSM_ADDPAGE, 0, (LPARAM)hpsp[3]);
ok(ret == TRUE, "got %d\n", ret);

r = SendMessageA(tab, TCM_GETITEMCOUNT, 0, 0);
ok(r == 4, "got %d\n", r);
ok(r == 4, "got %ld\n", r);

/* select page that can't be created */
ret = SendMessageA(hdlg, PSM_SETCURSEL, 3, 1);
ok(ret == TRUE, "got %d\n", ret);

r = SendMessageA(tab, TCM_GETITEMCOUNT, 0, 0);
ok(r == 3, "got %d\n", r);
ok(r == 3, "got %ld\n", r);

/* test PSP_PREMATURE flag with incorrect property sheet page */
ret = SendMessageA(hdlg, PSM_ADDPAGE, 0, (LPARAM)hpsp[4]);
ok(ret == FALSE, "got %d\n", ret);

r = SendMessageA(tab, TCM_GETITEMCOUNT, 0, 0);
ok(r == 3, "got %d\n", r);
ok(r == 3, "got %ld\n", r);

pDestroyPropertySheetPage(hpsp[4]);
DestroyWindow(hdlg);
Expand Down Expand Up @@ -986,34 +986,34 @@ if (0)
tab = (HWND)SendMessageA(hdlg, PSM_GETTABCONTROL, 0, 0);

r = SendMessageA(tab, TCM_GETITEMCOUNT, 0, 0);
ok(r == 2, "got %d\n", r);
ok(r == 2, "got %ld\n", r);

ret = SendMessageA(hdlg, PSM_INSERTPAGE, (WPARAM)hpsp[1], (LPARAM)hpsp[2]);
ok(ret == TRUE, "got %d\n", ret);

r = SendMessageA(tab, TCM_GETITEMCOUNT, 0, 0);
ok(r == 3, "got %d\n", r);
ok(r == 3, "got %ld\n", r);

/* add property sheet page that can't be created */
ret = SendMessageA(hdlg, PSM_INSERTPAGE, 1, (LPARAM)hpsp[3]);
ok(ret == TRUE, "got %d\n", ret);

r = SendMessageA(tab, TCM_GETITEMCOUNT, 0, 0);
ok(r == 4, "got %d\n", r);
ok(r == 4, "got %ld\n", r);

/* select page that can't be created */
ret = SendMessageA(hdlg, PSM_SETCURSEL, 1, 0);
ok(ret == TRUE, "got %d\n", ret);

r = SendMessageA(tab, TCM_GETITEMCOUNT, 0, 0);
ok(r == 3, "got %d\n", r);
ok(r == 3, "got %ld\n", r);

/* test PSP_PREMATURE flag with incorrect property sheet page */
ret = SendMessageA(hdlg, PSM_INSERTPAGE, 0, (LPARAM)hpsp[4]);
ok(ret == FALSE, "got %d\n", ret);

r = SendMessageA(tab, TCM_GETITEMCOUNT, 0, 0);
ok(r == 3, "got %d\n", r);
ok(r == 3, "got %ld\n", r);

pDestroyPropertySheetPage(hpsp[4]);
DestroyWindow(hdlg);
Expand All @@ -1037,19 +1037,19 @@ static UINT CALLBACK proppage_callback_a(HWND hwnd, UINT msg, PROPSHEETPAGEA *ps

ok(hwnd == NULL, "Expected NULL hwnd, got %p\n", hwnd);

ok(psp->lParam && psp->lParam != (LPARAM)psp, "Expected newly allocated page description, got %lx, %p\n",
ok(psp->lParam && psp->lParam != (LPARAM)psp, "Expected newly allocated page description, got %Ix, %p\n",
psp->lParam, psp);
ok(psp_orig->pszTitle == psp->pszTitle, "Expected same page title pointer\n");
ok(!lstrcmpA(psp_orig->pszTitle, psp->pszTitle), "Expected same page title string\n");

switch (msg)
{
case PSPCB_ADDREF:
ok(psp->dwSize > PROPSHEETPAGEA_V1_SIZE, "Expected ADDREF for V2+ only, got size %u\n", psp->dwSize);
ok(psp->dwSize > PROPSHEETPAGEA_V1_SIZE, "Expected ADDREF for V2+ only, got size %lu\n", psp->dwSize);
cpage->addref_called++;
break;
case PSPCB_RELEASE:
ok(psp->dwSize >= PROPSHEETPAGEA_V1_SIZE, "Unexpected RELEASE, got size %u\n", psp->dwSize);
ok(psp->dwSize >= PROPSHEETPAGEA_V1_SIZE, "Unexpected RELEASE, got size %lu\n", psp->dwSize);
cpage->release_called++;
break;
default:
Expand All @@ -1065,19 +1065,19 @@ static UINT CALLBACK proppage_callback_w(HWND hwnd, UINT msg, PROPSHEETPAGEW *ps
PROPSHEETPAGEW *psp_orig = &cpage->u.pageW;

ok(hwnd == NULL, "Expected NULL hwnd, got %p\n", hwnd);
ok(psp->lParam && psp->lParam != (LPARAM)psp, "Expected newly allocated page description, got %lx, %p\n",
ok(psp->lParam && psp->lParam != (LPARAM)psp, "Expected newly allocated page description, got %Ix, %p\n",
psp->lParam, psp);
ok(psp_orig->pszTitle == psp->pszTitle, "Expected same page title pointer\n");
ok(!lstrcmpW(psp_orig->pszTitle, psp->pszTitle), "Expected same page title string\n");

switch (msg)
{
case PSPCB_ADDREF:
ok(psp->dwSize > PROPSHEETPAGEW_V1_SIZE, "Expected ADDREF for V2+ only, got size %u\n", psp->dwSize);
ok(psp->dwSize > PROPSHEETPAGEW_V1_SIZE, "Expected ADDREF for V2+ only, got size %lu\n", psp->dwSize);
cpage->addref_called++;
break;
case PSPCB_RELEASE:
ok(psp->dwSize >= PROPSHEETPAGEW_V1_SIZE, "Unexpected RELEASE, got size %u\n", psp->dwSize);
ok(psp->dwSize >= PROPSHEETPAGEW_V1_SIZE, "Unexpected RELEASE, got size %lu\n", psp->dwSize);
cpage->release_called++;
break;
default:
Expand Down Expand Up @@ -1107,10 +1107,10 @@ static void test_CreatePropertySheetPage(void)
hpsp = pCreatePropertySheetPageA(&page.u.pageA);

if (page.u.pageA.dwSize < PROPSHEETPAGEA_V1_SIZE)
ok(hpsp == NULL, "Expected failure, size %u\n", page.u.pageA.dwSize);
ok(hpsp == NULL, "Expected failure, size %lu\n", page.u.pageA.dwSize);
else
{
ok(hpsp != NULL, "Failed to create a page, size %u\n", page.u.pageA.dwSize);
ok(hpsp != NULL, "Failed to create a page, size %lu\n", page.u.pageA.dwSize);
ok(page.addref_called == (page.u.pageA.dwSize > PROPSHEETPAGEA_V1_SIZE) ? 1 : 0, "Expected ADDREF callback message\n");
}

Expand All @@ -1136,10 +1136,10 @@ static void test_CreatePropertySheetPage(void)
hpsp = pCreatePropertySheetPageW(&page.u.pageW);

if (page.u.pageW.dwSize < PROPSHEETPAGEW_V1_SIZE)
ok(hpsp == NULL, "Expected failure, size %u\n", page.u.pageW.dwSize);
ok(hpsp == NULL, "Expected failure, size %lu\n", page.u.pageW.dwSize);
else
{
ok(hpsp != NULL, "Failed to create a page, size %u\n", page.u.pageW.dwSize);
ok(hpsp != NULL, "Failed to create a page, size %lu\n", page.u.pageW.dwSize);
ok(page.addref_called == (page.u.pageW.dwSize > PROPSHEETPAGEW_V1_SIZE) ? 1 : 0, "Expected ADDREF callback message\n");
}

Expand Down Expand Up @@ -1176,7 +1176,7 @@ static void test_bad_control_class(void)
U3(psh).phpage = &hpsp;

ret = pPropertySheetA(&psh);
ok(ret == 0, "got %ld\n", ret);
ok(ret == 0, "got %Id\n", ret);

/* Need to recreate hpsp otherwise the test fails under Windows */
hpsp = pCreatePropertySheetPageA(&psp);
Expand All @@ -1185,9 +1185,9 @@ static void test_bad_control_class(void)

psh.dwFlags = PSH_MODELESS;
ret = pPropertySheetA(&psh);
ok(ret != 0, "got %ld\n", ret);
ok(ret != 0, "got %Id\n", ret);

ok(IsWindow((HWND)ret), "bad window handle %#lx\n", ret);
ok(IsWindow((HWND)ret), "bad window handle %#Ix\n", ret);
DestroyWindow((HWND)ret);
}

Expand Down Expand Up @@ -1236,15 +1236,15 @@ static void test_page_dialog_texture(void)

/* Test that page dialog procedure is unchanged */
dlgproc = GetWindowLongPtrA(sheethwnd, DWLP_DLGPROC);
ok(dlgproc == (ULONG_PTR)test_WM_CTLCOLORSTATIC_proc, "Unexpected dlgproc %#lx.\n", dlgproc);
ok(dlgproc == (ULONG_PTR)test_WM_CTLCOLORSTATIC_proc, "Unexpected dlgproc %#Ix.\n", dlgproc);

/* Test that theme dialog texture is enabled for comctl32 v6, even when theming is off */
ret = pIsThemeDialogTextureEnabled(sheethwnd);
todo_wine_if(!is_v6)
ok(ret == is_v6, "Wrong theme dialog texture status.\n");

hwnd = CreateWindowA(WC_EDITA, "child", WS_POPUP | WS_VISIBLE, 1, 2, 50, 50, 0, 0, 0, NULL);
ok(hwnd != NULL, "CreateWindowA failed, error %d.\n", GetLastError());
ok(hwnd != NULL, "CreateWindowA failed, error %ld.\n", GetLastError());
hdc = GetDC(hwnd);

hbrush = (HBRUSH)SendMessageW(sheethwnd, WM_CTLCOLORSTATIC, (WPARAM)hdc, (LPARAM)hwnd);
Expand Down
22 changes: 11 additions & 11 deletions dlls/comctl32/tests/rebar.c
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ static int string_width(const CHAR *s) {

typedef struct {
RECT rc;
DWORD fStyle;
UINT fStyle;
UINT cx;
} rbband_result_t;

Expand Down Expand Up @@ -930,8 +930,8 @@ static void expect_band_content_(int line, HWND hRebar, UINT uBand, INT fStyle,
rb.cch = MAX_PATH;
ok(SendMessageA(hRebar, RB_GETBANDINFOA, uBand, (LPARAM)&rb), "RB_GETBANDINFOA failed from line %d\n", line);
expect_eq(line, rb.fStyle, fStyle, int, "%x");
expect_eq(line, rb.clrFore, clrFore, COLORREF, "%x");
expect_eq(line, rb.clrBack, clrBack, COLORREF, "%x");
expect_eq(line, rb.clrFore, clrFore, COLORREF, "%lx");
expect_eq(line, rb.clrBack, clrBack, COLORREF, "%lx");
expect_eq(line, strcmp(rb.lpText, lpText), 0, int, "%d");
expect_eq(line, rb.iImage, iImage, int, "%x");
expect_eq(line, rb.hwndChild, hwndChild, HWND, "%p");
Expand All @@ -945,7 +945,7 @@ static void expect_band_content_(int line, HWND hRebar, UINT uBand, INT fStyle,
expect_eq(line, rb.cyMaxChild, cyMaxChild, int, "%x");
expect_eq(line, rb.cyIntegral, cyIntegral, int, "%x");
expect_eq(line, rb.cxIdeal, cxIdeal, int, "%d");
expect_eq(line, rb.lParam, lParam, LPARAM, "%ld");
expect_eq(line, rb.lParam, lParam, LPARAM, "%Id");
ok(rb.cxHeader == cxHeader || rb.cxHeader == cxHeader + 1 || broken(rb.cxHeader == cxHeader_broken),
"expected %d for %d from line %d\n", cxHeader, rb.cxHeader, line);
}
Expand Down Expand Up @@ -1029,18 +1029,18 @@ static void test_colors(void)

/* test default colors */
clr = SendMessageA(hRebar, RB_GETTEXTCOLOR, 0, 0);
compare(clr, CLR_NONE, "%x");
compare(clr, CLR_NONE, "%lx");
clr = SendMessageA(hRebar, RB_GETBKCOLOR, 0, 0);
compare(clr, CLR_NONE, "%x");
compare(clr, CLR_NONE, "%lx");

scheme.dwSize = sizeof(scheme);
scheme.clrBtnHighlight = 0;
scheme.clrBtnShadow = 0;
ret = SendMessageA(hRebar, RB_GETCOLORSCHEME, 0, (LPARAM)&scheme);
if (ret)
{
compare(scheme.clrBtnHighlight, CLR_DEFAULT, "%x");
compare(scheme.clrBtnShadow, CLR_DEFAULT, "%x");
compare(scheme.clrBtnHighlight, CLR_DEFAULT, "%lx");
compare(scheme.clrBtnShadow, CLR_DEFAULT, "%lx");
}
else
skip("RB_GETCOLORSCHEME not supported\n");
Expand All @@ -1052,14 +1052,14 @@ static void test_colors(void)
bi.clrFore = bi.clrBack = 0xc0ffe;
ret = SendMessageA(hRebar, RB_GETBANDINFOA, 0, (LPARAM)&bi);
ok(ret, "RB_GETBANDINFOA failed\n");
compare(bi.clrFore, RGB(0, 0, 0), "%x");
compare(bi.clrBack, GetSysColor(COLOR_3DFACE), "%x");
compare(bi.clrFore, RGB(0, 0, 0), "%lx");
compare(bi.clrBack, GetSysColor(COLOR_3DFACE), "%lx");

SendMessageA(hRebar, RB_SETTEXTCOLOR, 0, RGB(255, 0, 0));
bi.clrFore = bi.clrBack = 0xc0ffe;
ret = SendMessageA(hRebar, RB_GETBANDINFOA, 0, (LPARAM)&bi);
ok(ret, "RB_GETBANDINFOA failed\n");
compare(bi.clrFore, RGB(0, 0, 0), "%x");
compare(bi.clrFore, RGB(0, 0, 0), "%lx");

DestroyWindow(hRebar);
}
Expand Down
6 changes: 2 additions & 4 deletions dlls/comctl32/tests/static.c
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,6 @@ static void test_image(HBITMAP image, BOOL is_dib, BOOL is_premult, BOOL is_alph
ok(bm.bmBits != NULL, "bmBits is NULL\n");
memcpy(bits, bm.bmBits, 4);
if (is_premult)
todo_wine
ok(bits[0] == 0x05 && bits[1] == 0x09 && bits[2] == 0x0e && bits[3] == 0x44,
"bits: %02x %02x %02x %02x\n", bits[0], bits[1], bits[2], bits[3]);
else if (is_alpha)
Expand Down Expand Up @@ -195,7 +194,6 @@ static void test_image(HBITMAP image, BOOL is_dib, BOOL is_premult, BOOL is_alph
DeleteDC(hdc);

if (is_premult)
todo_wine
ok(bits[0] == 0x05 && bits[1] == 0x09 && bits[2] == 0x0e && bits[3] == 0x44,
"bits: %02x %02x %02x %02x\n", bits[0], bits[1], bits[2], bits[3]);
else if (is_alpha)
Expand Down Expand Up @@ -283,10 +281,10 @@ static void test_STM_SETIMAGE(void)

for (type = SS_LEFT; type < SS_ETCHEDFRAME; type++)
{
winetest_push_context("%u", type);
winetest_push_context("%lu", type);

hwnd = create_static(type);
ok(hwnd != 0, "failed to create static type %#x\n", type);
ok(hwnd != 0, "failed to create static type %#lx\n", type);

/* set icon */
g_nReceivedColorStatic = 0;
Expand Down
13 changes: 9 additions & 4 deletions dlls/comctl32/tests/status.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,12 @@

#define SUBCLASS_NAME "MyStatusBar"

#define expect(expected,got) ok (expected == got,"Expected %d, got %d\n",expected,got)
#define expect(expected,got) expect_(__LINE__, expected, got)
static inline void expect_(unsigned line, DWORD expected, DWORD got)
{
ok_(__FILE__, line)(expected == got, "Expected %ld, got %ld\n", expected, got);
}

#define expect_rect(_left,_top,_right,_bottom,got) do { \
RECT exp = {abs(got.left - _left), abs(got.top - _top), \
abs(got.right - _right), abs(got.bottom - _bottom)}; \
Expand Down Expand Up @@ -145,7 +150,7 @@ static int CALLBACK check_height_font_enumproc(ENUMLOGFONTEXA *enumlf, NEWTEXTME
y = tm.tmHeight + (tm.tmInternalLeading ? tm.tmInternalLeading : 2) + 4;

ok( (rcCtrl.bottom == max(y, g_ysize)) || (rcCtrl.bottom == max(y, g_dpisize)),
"got %d (expected %d or %d) for %s #%d\n",
"got %ld (expected %d or %d) for %s #%d\n",
rcCtrl.bottom, max(y, g_ysize), max(y, g_dpisize), facename, sizes[i]);

SelectObject(hdc, hOldFont);
Expand Down Expand Up @@ -370,11 +375,11 @@ static void test_status_control(void)
crColor = SendMessageA(hWndStatus, SB_SETBKCOLOR , 0, RGB(255,0,0));
ok(crColor == CLR_DEFAULT ||
broken(crColor == RGB(0,0,0)), /* win95 */
"Expected 0x%.8x, got 0x%.8x\n", CLR_DEFAULT, crColor);
"Expected 0x%.8lx, got 0x%.8lx\n", CLR_DEFAULT, crColor);
crColor = SendMessageA(hWndStatus, SB_SETBKCOLOR , 0, CLR_DEFAULT);
ok(crColor == RGB(255,0,0) ||
broken(crColor == RGB(0,0,0)), /* win95 */
"Expected 0x%.8x, got 0x%.8x\n", RGB(255,0,0), crColor);
"Expected 0x%.8lx, got 0x%.8lx\n", RGB(255,0,0), crColor);

/* Add an icon to the status bar */
hIcon = LoadIconA(NULL, (LPCSTR)IDI_QUESTION);
Expand Down
2 changes: 1 addition & 1 deletion dlls/comctl32/tests/subclass.c
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ static void ok_sequence(const struct message *expected, const char *context)
"%s: the procnum %d was expected, but got procnum %d instead\n",
context, expected->procnum, actual->procnum);
ok(expected->wParam == actual->wParam,
"%s: in procnum %d expecting wParam 0x%lx got 0x%lx\n",
"%s: in procnum %d expecting wParam 0x%Ix got 0x%Ix\n",
context, expected->procnum, expected->wParam, actual->wParam);
expected++;
actual++;
Expand Down
10 changes: 5 additions & 5 deletions dlls/comctl32/tests/syslink.c
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ static void test_create_syslink(void)
/* Create an invisible SysLink control */
flush_sequences(sequences, NUM_MSG_SEQUENCE);
hWndSysLink = create_syslink(WS_CHILD | WS_TABSTOP, hWndParent);
ok(hWndSysLink != NULL, "Expected non NULL value (le %u)\n", GetLastError());
ok(hWndSysLink != NULL, "Expected non NULL value (le %lu)\n", GetLastError());
flush_events();
ok_sequence(sequences, SYSLINK_SEQ_INDEX, empty_wnd_seq, "create SysLink", FALSE);
ok_sequence(sequences, PARENT_SEQ_INDEX, parent_create_syslink_wnd_seq, "create SysLink (parent)", TRUE);
Expand All @@ -210,7 +210,7 @@ static void test_LM_GETIDEALHEIGHT(void)
ok(hwnd != NULL, "Failed to create SysLink window.\n");

ret = SendMessageA(hwnd, LM_GETIDEALHEIGHT, 0, 0);
ok(ret > 0, "Unexpected ideal height, %d.\n", ret);
ok(ret > 0, "Unexpected ideal height, %ld.\n", ret);

DestroyWindow(hwnd);
}
Expand All @@ -226,13 +226,13 @@ static void test_LM_GETIDEALSIZE(void)

memset(&sz, 0, sizeof(sz));
ret = SendMessageA(hwnd, LM_GETIDEALSIZE, 0, (LPARAM)&sz);
ok(ret > 0, "Unexpected return value, %d.\n", ret);
ok(ret > 0, "Unexpected return value, %ld.\n", ret);
if (sz.cy == 0)
win_skip("LM_GETIDEALSIZE is not supported.\n");
else
{
ok(sz.cx > 5, "Unexpected ideal width, %d.\n", sz.cx);
ok(sz.cy == ret, "Unexpected ideal height, %d.\n", sz.cy);
ok(sz.cx > 5, "Unexpected ideal width, %ld.\n", sz.cx);
ok(sz.cy == ret, "Unexpected ideal height, %ld.\n", sz.cy);
}

DestroyWindow(hwnd);
Expand Down
45 changes: 25 additions & 20 deletions dlls/comctl32/tests/tab.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,12 @@
#define PARENT_SEQ_INDEX 0
#define TAB_SEQ_INDEX 1

#define expect(expected, got) ok ( expected == got, "Expected %d, got %d\n", expected, got)
#define expect(expected,got) expect_(__LINE__, expected, got)
static inline void expect_(unsigned line, DWORD expected, DWORD got)
{
ok_(__FILE__, line)(expected == got, "Expected %ld, got %ld\n", expected, got);
}

#define expect_str(expected, got)\
ok ( strcmp(expected, got) == 0, "Expected '%s', got '%s'\n", expected, got)

Expand All @@ -51,14 +56,14 @@ static void CheckSize(HWND hwnd, INT width, INT height, const char *msg, int lin

SendMessageA(hwnd, TCM_GETITEMRECT, 0, (LPARAM)&r);
if (width >= 0 && height < 0)
ok_(__FILE__,line) (width == r.right - r.left, "%s: Expected width [%d] got [%d]\n",
ok_(__FILE__,line) (width == r.right - r.left, "%s: Expected width [%d] got [%ld]\n",
msg, width, r.right - r.left);
else if (height >= 0 && width < 0)
ok_(__FILE__,line) (height == r.bottom - r.top, "%s: Expected height [%d] got [%d]\n",
ok_(__FILE__,line) (height == r.bottom - r.top, "%s: Expected height [%d] got [%ld]\n",
msg, height, r.bottom - r.top);
else
ok_(__FILE__,line) ((width == r.right - r.left) && (height == r.bottom - r.top ),
"%s: Expected [%d,%d] got [%d,%d]\n", msg, width, height,
"%s: Expected [%d,%d] got [%ld,%ld]\n", msg, width, height,
r.right - r.left, r.bottom - r.top);
}

Expand Down Expand Up @@ -456,7 +461,7 @@ static void test_tab(INT nMinTabWidth)
dpi = GetDeviceCaps(hdc, LOGPIXELSX);
hOldFont = SelectObject(hdc, (HFONT)SendMessageA(hwTab, WM_GETFONT, 0, 0));
GetTextExtentPoint32A(hdc, "Tab 1", strlen("Tab 1"), &size);
trace("Tab1 text size: size.cx=%d size.cy=%d\n", size.cx, size.cy);
trace("Tab1 text size: size.cx=%ld size.cy=%ld\n", size.cx, size.cy);
SelectObject(hdc, hOldFont);
ReleaseDC(hwTab, hdc);

Expand Down Expand Up @@ -527,7 +532,7 @@ static void test_tab(INT nMinTabWidth)
exp = max(size.cx +TAB_PADDING_X*2, (nMinTabWidth < 0) ? DEFAULT_MIN_TAB_WIDTH : nMinTabWidth);
SendMessageA( hwTab, TCM_GETITEMRECT, 0, (LPARAM)&rTab );
ok( rTab.right - rTab.left == exp || broken(rTab.right - rTab.left == DEFAULT_MIN_TAB_WIDTH),
"no icon, default width: Expected width [%d] got [%d]\n", exp, rTab.right - rTab.left );
"no icon, default width: Expected width [%d] got [%ld]\n", exp, rTab.right - rTab.left );

for (i=0; i<8; i++)
{
Expand Down Expand Up @@ -555,7 +560,7 @@ static void test_tab(INT nMinTabWidth)
exp = (nMinTabWidth < 0) ? DEFAULT_MIN_TAB_WIDTH : nMinTabWidth;
SendMessageA( hwTab, TCM_GETITEMRECT, 0, (LPARAM)&rTab );
ok( rTab.right - rTab.left == exp || broken(rTab.right - rTab.left == DEFAULT_MIN_TAB_WIDTH),
"no icon, default width: Expected width [%d] got [%d]\n", exp, rTab.right - rTab.left );
"no icon, default width: Expected width [%d] got [%ld]\n", exp, rTab.right - rTab.left );

for (i=0; i<8; i++)
{
Expand Down Expand Up @@ -825,14 +830,14 @@ static void test_getset_item(void)
ok(GetParent(hTab) == NULL, "got %p, expected null parent\n", GetParent(hTab));

ret = SendMessageA(hTab, TCM_SETITEMEXTRA, sizeof(LPARAM)-1, 0);
ok(ret == TRUE, "got %d\n", ret);
ok(ret == TRUE, "got %ld\n", ret);

/* set some item data */
tcItem.lParam = ~0;
tcItem.mask = TCIF_PARAM;

ret = SendMessageA(hTab, TCM_INSERTITEMA, 0, (LPARAM)&tcItem);
ok(ret == 0, "got %d\n", ret);
ok(ret == 0, "got %ld\n", ret);

/* all sizeof(LPARAM) returned anyway when using sizeof(LPARAM)-1 size */
memset(&lparam, 0xaa, sizeof(lparam));
Expand All @@ -842,7 +847,7 @@ static void test_getset_item(void)
expect(TRUE, ret);
/* everything higher specified size is preserved */
memset(&lparam, 0xff, sizeof(lparam)-1);
ok(tcItem.lParam == lparam, "Expected 0x%lx, got 0x%lx\n", lparam, tcItem.lParam);
ok(tcItem.lParam == lparam, "Expected 0x%Ix, got 0x%Ix\n", lparam, tcItem.lParam);

DestroyWindow(hTab);

Expand All @@ -857,7 +862,7 @@ static void test_getset_item(void)
tcItem.mask = TCIF_PARAM;
ret = SendMessageA(hTab, TCM_GETITEMA, 5, (LPARAM)&tcItem);
expect(FALSE, ret);
ok(tcItem.lParam == 0, "Expected zero lParam, got %lu\n", tcItem.lParam);
ok(tcItem.lParam == 0, "Expected zero lParam, got %Iu\n", tcItem.lParam);

memset(&tcItem, 0xcc, sizeof(tcItem));
tcItem.mask = TCIF_IMAGE;
Expand Down Expand Up @@ -894,13 +899,13 @@ static void test_getset_item(void)
tcItem.mask = TCIF_PARAM;
ret = SendMessageA(hTab, TCM_GETITEMA, -1, (LPARAM)&tcItem);
expect(FALSE, ret);
ok(tcItem.lParam == 0, "Expected zero lParam, got %lu\n", tcItem.lParam);
ok(tcItem.lParam == 0, "Expected zero lParam, got %Iu\n", tcItem.lParam);

memset(&tcItem, 0xcc, sizeof(tcItem));
tcItem.mask = TCIF_PARAM;
ret = SendMessageA(hTab, TCM_GETITEMA, -2, (LPARAM)&tcItem);
expect(FALSE, ret);
ok(tcItem.lParam == 0, "Expected zero lParam, got %lu\n", tcItem.lParam);
ok(tcItem.lParam == 0, "Expected zero lParam, got %Iu\n", tcItem.lParam);

flush_sequences(sequences, NUM_MSG_SEQUENCES);

Expand Down Expand Up @@ -1222,18 +1227,18 @@ static void test_TCM_SETITEMEXTRA(void)
}

ret = SendMessageA(hTab, TCM_SETITEMEXTRA, -1, 0);
ok(ret == FALSE, "got %d\n", ret);
ok(ret == FALSE, "got %ld\n", ret);

ret = SendMessageA(hTab, TCM_SETITEMEXTRA, 2, 0);
ok(ret == TRUE, "got %d\n", ret);
ok(ret == TRUE, "got %ld\n", ret);
DestroyWindow(hTab);

/* it's not possible to change extra data size for control with tabs */
hTab = createFilledTabControl(parent_wnd, TCS_FIXEDWIDTH, TCIF_TEXT|TCIF_IMAGE, 4);
ok(hTab != NULL, "Failed to create tab control\n");

ret = SendMessageA(hTab, TCM_SETITEMEXTRA, 2, 0);
ok(ret == FALSE, "got %d\n", ret);
ok(ret == FALSE, "got %ld\n", ret);
DestroyWindow(hTab);
}

Expand Down Expand Up @@ -1265,7 +1270,7 @@ static void test_TCS_OWNERDRAWFIXED(void)

itemdata = 0;
memset(&itemdata, 0xde, 4);
ok(g_drawitem.itemData == itemdata, "got 0x%lx, expected 0x%lx\n", g_drawitem.itemData, itemdata);
ok(g_drawitem.itemData == itemdata, "got 0x%Ix, expected 0x%Ix\n", g_drawitem.itemData, itemdata);

DestroyWindow(hTab);

Expand Down Expand Up @@ -1296,7 +1301,7 @@ static void test_TCS_OWNERDRAWFIXED(void)
RedrawWindow(hTab, NULL, 0, RDW_UPDATENOW);

memset(&itemdata, 0xde, sizeof(ULONG_PTR));
ok(*(ULONG_PTR*)g_drawitem.itemData == itemdata, "got 0x%lx, expected 0x%lx\n", g_drawitem.itemData, itemdata);
ok(*(ULONG_PTR*)g_drawitem.itemData == itemdata, "got 0x%Ix, expected 0x%Ix\n", g_drawitem.itemData, itemdata);

DestroyWindow(hTab);

Expand Down Expand Up @@ -1329,7 +1334,7 @@ static void test_TCS_OWNERDRAWFIXED(void)
memset(&itemdata, 0xde, 4);
memset(&itemdata2, 0xde, sizeof(LPARAM)-1);
ok(g_drawitem.itemData == itemdata || broken(g_drawitem.itemData == itemdata2) /* win98 */,
"got 0x%lx, expected 0x%lx\n", g_drawitem.itemData, itemdata);
"got 0x%Ix, expected 0x%Ix\n", g_drawitem.itemData, itemdata);

DestroyWindow(hTab);
}
Expand Down Expand Up @@ -1373,7 +1378,7 @@ static void test_create(void)
hTab = CreateWindowA(WC_TABCONTROLA, "TestTab", ptr->style,
10, 10, 300, 100, parent_wnd, NULL, NULL, 0);
style = GetWindowLongA(hTab, GWL_STYLE);
ok(style == ptr->act_style, "expected style 0x%08x, got style 0x%08x\n", ptr->act_style, style);
ok(style == ptr->act_style, "expected style 0x%08lx, got style 0x%08lx\n", ptr->act_style, style);

DestroyWindow(hTab);
ptr++;
Expand Down
16 changes: 8 additions & 8 deletions dlls/comctl32/tests/taskdialog.c
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ static void run_test_(TASKDIALOGCONFIG *info, int expect_button, int expect_radi
flush_sequences(sequences, NUM_MSG_SEQUENCES);

hr = pTaskDialogIndirect(info, &ret_button, &ret_radio, &ret_verification);
ok_(file, line)(hr == S_OK, "TaskDialogIndirect() failed, got %#x.\n", hr);
ok_(file, line)(hr == S_OK, "TaskDialogIndirect() failed, got %#lx.\n", hr);

ok_sequence_(sequences, TASKDIALOG_SEQ_INDEX, msg_start, context, FALSE, file, line);
ok_(file, line)(ret_button == expect_button,
Expand All @@ -437,7 +437,7 @@ static HRESULT CALLBACK taskdialog_callback_proc(HWND hwnd, UINT notification,
const struct message_info *msg_send;
struct message msg;

ok(test_ref_data == ref_data, "Unexpected ref data %lu.\n", ref_data);
ok(test_ref_data == ref_data, "Unexpected ref data %Iu.\n", ref_data);

init_test_message(notification, (short)wParam, lParam, &msg);
add_message(sequences, TASKDIALOG_SEQ_INDEX, &msg);
Expand All @@ -458,19 +458,19 @@ static void test_invalid_parameters(void)
HRESULT hr;

hr = pTaskDialogIndirect(NULL, NULL, NULL, NULL);
ok(hr == E_INVALIDARG, "Unexpected return value %#x.\n", hr);
ok(hr == E_INVALIDARG, "Unexpected return value %#lx.\n", hr);

info.cbSize = 0;
hr = pTaskDialogIndirect(&info, NULL, NULL, NULL);
ok(hr == E_INVALIDARG, "Unexpected return value %#x.\n", hr);
ok(hr == E_INVALIDARG, "Unexpected return value %#lx.\n", hr);

info.cbSize = sizeof(TASKDIALOGCONFIG) - 1;
hr = pTaskDialogIndirect(&info, NULL, NULL, NULL);
ok(hr == E_INVALIDARG, "Unexpected return value %#x.\n", hr);
ok(hr == E_INVALIDARG, "Unexpected return value %#lx.\n", hr);

info.cbSize = sizeof(TASKDIALOGCONFIG) + 1;
hr = pTaskDialogIndirect(&info, NULL, NULL, NULL);
ok(hr == E_INVALIDARG, "Unexpected return value %#x.\n", hr);
ok(hr == E_INVALIDARG, "Unexpected return value %#lx.\n", hr);
}

static void test_callback(void)
Expand Down Expand Up @@ -729,9 +729,9 @@ static HRESULT CALLBACK taskdialog_callback_proc_progress_bar(HWND hwnd, UINT no

/* TDM_SET_PROGRESS_BAR_RANGE */
ret = SendMessageW(hwnd, TDM_SET_PROGRESS_BAR_RANGE, 0, MAKELPARAM(0, 200));
ok(ret == MAKELONG(0, 100), "Expect range:%x got:%lx\n", MAKELONG(0, 100), ret);
ok(ret == MAKELONG(0, 100), "Expect range:%lx got:%lx\n", MAKELONG(0, 100), ret);
ret = SendMessageW(hwnd, TDM_SET_PROGRESS_BAR_RANGE, 0, MAKELPARAM(0, 200));
ok(ret == MAKELONG(0, 200), "Expect range:%x got:%lx\n", MAKELONG(0, 200), ret);
ok(ret == MAKELONG(0, 200), "Expect range:%lx got:%lx\n", MAKELONG(0, 200), ret);

/* TDM_SET_PROGRESS_BAR_POS */
if (flags & TDF_SHOW_MARQUEE_PROGRESS_BAR)
Expand Down
186 changes: 93 additions & 93 deletions dlls/comctl32/tests/toolbar.c

Large diffs are not rendered by default.

82 changes: 41 additions & 41 deletions dlls/comctl32/tests/tooltips.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#include "v6util.h"
#include "msg.h"

#define expect(expected, got) ok(got == expected, "Expected %d, got %d\n", expected, got)
#define expect(expected, got) ok(got == expected, "Expected %d, got %ld\n", expected, got)

enum seq_index
{
Expand Down Expand Up @@ -55,7 +55,7 @@ static void test_create_tooltip(BOOL is_v6)
style = GetWindowLongA(hwnd, GWL_STYLE);
exp_style = 0x7fffffff | WS_POPUP;
exp_style &= ~(WS_CHILD | WS_MAXIMIZE | WS_BORDER | WS_DLGFRAME);
ok(style == exp_style, "wrong style %08x/%08x\n", style, exp_style);
ok(style == exp_style, "wrong style %08lx/%08lx\n", style, exp_style);

DestroyWindow(hwnd);

Expand All @@ -70,7 +70,7 @@ static void test_create_tooltip(BOOL is_v6)
exp_style |= WS_BORDER;
todo_wine_if(is_v6)
ok(style == exp_style || broken(style == (exp_style | WS_BORDER)) /* XP */,
"Unexpected window style %#x.\n", style);
"Unexpected window style %#lx.\n", style);

DestroyWindow(hwnd);

Expand Down Expand Up @@ -196,7 +196,7 @@ static void test_customdraw(void) {
50, 50,
300, 300,
NULL, NULL, NULL, 0);
ok(parent != NULL, "%d: Creation of main window failed\n", iterationNumber);
ok(parent != NULL, "%ld: Creation of main window failed\n", iterationNumber);

/* Make it show */
ShowWindow(parent, SW_SHOWNORMAL);
Expand All @@ -208,7 +208,7 @@ static void test_customdraw(void) {
CW_USEDEFAULT, CW_USEDEFAULT,
CW_USEDEFAULT, CW_USEDEFAULT,
parent, NULL, GetModuleHandleA(NULL), 0);
ok(hwndTip != NULL, "%d: Creation of tooltip window failed\n", iterationNumber);
ok(hwndTip != NULL, "%ld: Creation of tooltip window failed\n", iterationNumber);

/* Set up parms for the wndproc to handle */
CD_Stages = 0;
Expand All @@ -229,7 +229,7 @@ static void test_customdraw(void) {
toolInfo.lParam = 0xdeadbeef;
GetClientRect (parent, &toolInfo.rect);
ret = SendMessageA(hwndTip, TTM_ADDTOOLA, 0, (LPARAM)&toolInfo);
ok(ret, "%d: Failed to add the tool.\n", iterationNumber);
ok(ret, "%ld: Failed to add the tool.\n", iterationNumber);

/* Make tooltip appear quickly */
SendMessageA(hwndTip, TTM_SETDELAYTIME, TTDT_INITIAL, MAKELPARAM(1,0));
Expand All @@ -243,23 +243,23 @@ static void test_customdraw(void) {
{
/* Check CustomDraw results */
ok(CD_Stages == expectedResults[iterationNumber].ExpectedCalls,
"%d: CustomDraw stages %x, expected %x\n", iterationNumber, CD_Stages,
"%ld: CustomDraw stages %x, expected %x\n", iterationNumber, CD_Stages,
expectedResults[iterationNumber].ExpectedCalls);
}

ret = SendMessageA(hwndTip, TTM_GETCURRENTTOOLA, 0, 0);
ok(ret, "%d: Failed to get current tool %#lx.\n", iterationNumber, ret);
ok(ret, "%ld: Failed to get current tool %#Ix.\n", iterationNumber, ret);

memset(&toolInfo, 0xcc, sizeof(toolInfo));
toolInfo.cbSize = sizeof(toolInfo);
toolInfo.lpszText = NULL;
toolInfo.lpReserved = (void *)0xdeadbeef;
SendMessageA(hwndTip, TTM_GETCURRENTTOOLA, 0, (LPARAM)&toolInfo);
ok(toolInfo.hwnd == parent, "%d: Unexpected hwnd %p.\n", iterationNumber, toolInfo.hwnd);
ok(toolInfo.hinst == GetModuleHandleA(NULL), "%d: Unexpected hinst %p.\n", iterationNumber, toolInfo.hinst);
ok(toolInfo.uId == 0x1234abcd, "%d: Unexpected uId %lx.\n", iterationNumber, toolInfo.uId);
ok(toolInfo.lParam == 0, "%d: Unexpected lParam %lx.\n", iterationNumber, toolInfo.lParam);
ok(toolInfo.lpReserved == (void *)0xdeadbeef, "%d: Unexpected lpReserved %p.\n", iterationNumber, toolInfo.lpReserved);
ok(toolInfo.hwnd == parent, "%ld: Unexpected hwnd %p.\n", iterationNumber, toolInfo.hwnd);
ok(toolInfo.hinst == GetModuleHandleA(NULL), "%ld: Unexpected hinst %p.\n", iterationNumber, toolInfo.hinst);
ok(toolInfo.uId == 0x1234abcd, "%ld: Unexpected uId %Ix.\n", iterationNumber, toolInfo.uId);
ok(toolInfo.lParam == 0, "%ld: Unexpected lParam %Ix.\n", iterationNumber, toolInfo.lParam);
ok(toolInfo.lpReserved == (void *)0xdeadbeef, "%ld: Unexpected lpReserved %p.\n", iterationNumber, toolInfo.lpReserved);

/* Clean up */
DestroyWindow(hwndTip);
Expand Down Expand Up @@ -378,19 +378,19 @@ static void test_gettext(void)
toolinfoA.lParam = 0xdeadbeef;
GetClientRect(hwnd, &toolinfoA.rect);
r = SendMessageA(hwnd, TTM_ADDTOOLA, 0, (LPARAM)&toolinfoA);
ok(r, "got %ld\n", r);
ok(r, "got %Id\n", r);

toolinfoA.hwnd = NULL;
toolinfoA.uId = 0x1234abcd;
toolinfoA.lpszText = bufA;
r = SendMessageA(hwnd, TTM_GETTEXTA, 0, (LPARAM)&toolinfoA);
ok(!r, "got %ld\n", r);
ok(!r, "got %Id\n", r);
ok(!*toolinfoA.lpszText, "lpszText should be empty, got %s\n", toolinfoA.lpszText);

toolinfoA.lpszText = bufA;
r = SendMessageA(hwnd, TTM_GETTOOLINFOA, 0, (LPARAM)&toolinfoA);
todo_wine
ok(!r, "got %ld\n", r);
ok(!r, "got %Id\n", r);
ok(toolinfoA.lpszText == NULL, "expected NULL, got %p\n", toolinfoA.lpszText);

/* NULL hinst, valid resource id for text */
Expand All @@ -409,17 +409,17 @@ static void test_gettext(void)
toolinfoA.uId = 0x1233abcd;
toolinfoA.lpszText = bufA;
r = SendMessageA(hwnd, TTM_GETTEXTA, 0, (LPARAM)&toolinfoA);
ok(!r, "got %ld\n", r);
ok(!r, "got %Id\n", r);
ok(!strcmp(toolinfoA.lpszText, "abc"), "got wrong text, %s\n", toolinfoA.lpszText);

toolinfoA.hinst = (HINSTANCE)0xdeadbee;
r = SendMessageA(hwnd, TTM_GETTOOLINFOA, 0, (LPARAM)&toolinfoA);
todo_wine
ok(!r, "got %ld\n", r);
ok(!r, "got %Id\n", r);
ok(toolinfoA.hinst == NULL, "expected NULL, got %p\n", toolinfoA.hinst);

r = SendMessageA(hwnd, TTM_DELTOOLA, 0, (LPARAM)&toolinfoA);
ok(!r, "got %ld\n", r);
ok(!r, "got %Id\n", r);

/* add another tool with text */
toolinfoA.cbSize = sizeof(TTTOOLINFOA);
Expand All @@ -435,24 +435,24 @@ static void test_gettext(void)
ok(r, "Adding the tool to the tooltip failed\n");

length = SendMessageA(hwnd, WM_GETTEXTLENGTH, 0, 0);
ok(length == 0, "Expected 0, got %d\n", length);
ok(length == 0, "Expected 0, got %ld\n", length);

toolinfoA.hwnd = NULL;
toolinfoA.uId = 0x1235abcd;
toolinfoA.lpszText = bufA;
r = SendMessageA(hwnd, TTM_GETTEXTA, 0, (LPARAM)&toolinfoA);
ok(!r, "got %ld\n", r);
ok(!r, "got %Id\n", r);
ok(!strcmp(toolinfoA.lpszText, testtipA), "expected %s, got %p\n", testtipA, toolinfoA.lpszText);

memset(bufA, 0x1f, sizeof(bufA));
toolinfoA.lpszText = bufA;
r = SendMessageA(hwnd, TTM_GETTOOLINFOA, 0, (LPARAM)&toolinfoA);
todo_wine
ok(!r, "got %ld\n", r);
ok(!r, "got %Id\n", r);
ok(!strcmp(toolinfoA.lpszText, testtipA), "expected %s, got %p\n", testtipA, toolinfoA.lpszText);

length = SendMessageA(hwnd, WM_GETTEXTLENGTH, 0, 0);
ok(length == 0, "Expected 0, got %d\n", length);
ok(length == 0, "Expected 0, got %ld\n", length);

/* add another with callback text */
toolinfoA.cbSize = sizeof(TTTOOLINFOA);
Expand All @@ -470,13 +470,13 @@ static void test_gettext(void)
toolinfoA.uId = 0x1236abcd;
toolinfoA.lpszText = bufA;
r = SendMessageA(hwnd, TTM_GETTEXTA, 0, (LPARAM)&toolinfoA);
ok(!r, "got %ld\n", r);
ok(!r, "got %Id\n", r);
ok(!strcmp(toolinfoA.lpszText, testcallbackA), "lpszText should be an (%s) string\n", testcallbackA);

toolinfoA.lpszText = bufA;
r = SendMessageA(hwnd, TTM_GETTOOLINFOA, 0, (LPARAM)&toolinfoA);
todo_wine
ok(!r, "got %ld\n", r);
ok(!r, "got %Id\n", r);
ok(toolinfoA.lpszText == LPSTR_TEXTCALLBACKA, "expected LPSTR_TEXTCALLBACKA, got %p\n", toolinfoA.lpszText);

DestroyWindow(hwnd);
Expand Down Expand Up @@ -518,13 +518,13 @@ static void test_gettext(void)
toolinfoA.lParam = 0xdeadbeef;
GetClientRect(hwnd, &toolinfoA.rect);
r = SendMessageA(hwnd, TTM_ADDTOOLA, 0, (LPARAM)&toolinfoA);
ok(r, "got %ld\n", r);
ok(r, "got %Id\n", r);

toolinfoA.hwnd = NULL;
toolinfoA.uId = 0x1235abce;
toolinfoA.lpszText = bufA;
r = SendMessageA(hwnd, TTM_GETTEXTA, 0, (LPARAM)&toolinfoA);
ok(!r, "got %ld\n", r);
ok(!r, "got %Id\n", r);
ok(!strcmp(toolinfoA.lpszText, testtipA), "expected %s, got %s\n", testtipA, toolinfoA.lpszText);

/* enable TTS_NOPREFIX, original text is retained */
Expand All @@ -535,7 +535,7 @@ static void test_gettext(void)
toolinfoA.uId = 0x1235abce;
toolinfoA.lpszText = bufA;
r = SendMessageA(hwnd, TTM_GETTEXTA, 0, (LPARAM)&toolinfoA);
ok(!r, "got %ld\n", r);
ok(!r, "got %Id\n", r);
ok(!strcmp(toolinfoA.lpszText, testtip2A), "expected %s, got %s\n", testtip2A, toolinfoA.lpszText);

DestroyWindow(hwnd);
Expand Down Expand Up @@ -566,7 +566,7 @@ static void test_ttm_gettoolinfo(void)
ti.lParam = 0xaaaaaaaa;
r = SendMessageA(hwnd, TTM_GETTOOLINFOA, 0, (LPARAM)&ti);
ok(r, "Getting tooltip info failed\n");
ok(0x1abe11ed == ti.lParam, "Expected 0x1abe11ed, got %lx\n", ti.lParam);
ok(0x1abe11ed == ti.lParam, "Expected 0x1abe11ed, got %Ix\n", ti.lParam);

tiW.cbSize = TTTOOLINFOW_V2_SIZE;
tiW.hwnd = NULL;
Expand All @@ -575,7 +575,7 @@ static void test_ttm_gettoolinfo(void)
tiW.lpszText = NULL;
r = SendMessageA(hwnd, TTM_GETTOOLINFOW, 0, (LPARAM)&tiW);
ok(r, "Getting tooltip info failed\n");
ok(0x1abe11ed == tiW.lParam, "Expected 0x1abe11ed, got %lx\n", tiW.lParam);
ok(0x1abe11ed == tiW.lParam, "Expected 0x1abe11ed, got %Ix\n", tiW.lParam);

ti.cbSize = TTTOOLINFOA_V2_SIZE;
ti.uId = 0x1234ABCD;
Expand All @@ -586,7 +586,7 @@ static void test_ttm_gettoolinfo(void)
ti.lParam = 0xdeadbeef;
r = SendMessageA(hwnd, TTM_GETTOOLINFOA, 0, (LPARAM)&ti);
ok(r, "Getting tooltip info failed\n");
ok(0x55555555 == ti.lParam, "Expected 0x55555555, got %lx\n", ti.lParam);
ok(0x55555555 == ti.lParam, "Expected 0x55555555, got %Ix\n", ti.lParam);

DestroyWindow(hwnd);

Expand Down Expand Up @@ -890,16 +890,16 @@ static void test_track(void)
SendMessageW(tt, TTM_TRACKPOSITION, 0, MAKELPARAM(10, 10));

GetWindowRect(tt, &pos);
ok(almost_eq(pos.left, 10), "pos.left = %d\n", pos.left);
ok(almost_eq(pos.top, 10), "pos.top = %d\n", pos.top);
ok(almost_eq(pos.left, 10), "pos.left = %ld\n", pos.left);
ok(almost_eq(pos.top, 10), "pos.top = %ld\n", pos.top);

info.uFlags = TTF_IDISHWND | TTF_ABSOLUTE;
SendMessageW(tt, TTM_SETTOOLINFOW, 0, (LPARAM)&info);
SendMessageW(tt, TTM_TRACKPOSITION, 0, MAKELPARAM(10, 10));

GetWindowRect(tt, &pos);
ok(!almost_eq(pos.left, 10), "pos.left = %d\n", pos.left);
ok(!almost_eq(pos.top, 10), "pos.top = %d\n", pos.top);
ok(!almost_eq(pos.left, 10), "pos.left = %ld\n", pos.left);
ok(!almost_eq(pos.top, 10), "pos.top = %ld\n", pos.top);

DestroyWindow(tt);
DestroyWindow(parent);
Expand Down Expand Up @@ -1066,27 +1066,27 @@ static void test_margin(void)
ok(hwnd != NULL, "failed to create tooltip wnd\n");

ret = SendMessageA(hwnd, TTM_SETMARGIN, 0, 0);
ok(!ret, "got %d\n", ret);
ok(!ret, "got %ld\n", ret);

SetRect(&r, -1, -1, 1, 1);
ret = SendMessageA(hwnd, TTM_SETMARGIN, 0, (LPARAM)&r);
ok(!ret, "got %d\n", ret);
ok(!ret, "got %ld\n", ret);

SetRectEmpty(&r1);
ret = SendMessageA(hwnd, TTM_GETMARGIN, 0, (LPARAM)&r1);
ok(!ret, "got %d\n", ret);
ok(!ret, "got %ld\n", ret);
ok(EqualRect(&r, &r1), "got %s, was %s\n", wine_dbgstr_rect(&r1), wine_dbgstr_rect(&r));

ret = SendMessageA(hwnd, TTM_SETMARGIN, 0, 0);
ok(!ret, "got %d\n", ret);
ok(!ret, "got %ld\n", ret);

SetRectEmpty(&r1);
ret = SendMessageA(hwnd, TTM_GETMARGIN, 0, (LPARAM)&r1);
ok(!ret, "got %d\n", ret);
ok(!ret, "got %ld\n", ret);
ok(EqualRect(&r, &r1), "got %s, was %s\n", wine_dbgstr_rect(&r1), wine_dbgstr_rect(&r));

ret = SendMessageA(hwnd, TTM_GETMARGIN, 0, 0);
ok(!ret, "got %d\n", ret);
ok(!ret, "got %ld\n", ret);

DestroyWindow(hwnd);
}
Expand Down
15 changes: 10 additions & 5 deletions dlls/comctl32/tests/trackbar.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,12 @@
#include "msg.h"
#include "v6util.h"

#define expect(expected, got) ok(got == expected, "Expected %d, got %d\n", expected, got)
#define expect(expected,got) expect_(__LINE__, expected, got)
static inline void expect_(unsigned line, DWORD expected, DWORD got)
{
ok_(__FILE__, line)(expected == got, "Expected %ld, got %ld\n", expected, got);
}

#define NUM_MSG_SEQUENCE 2
#define PARENT_SEQ_INDEX 0
#define TRACKBAR_SEQ_INDEX 1
Expand Down Expand Up @@ -717,21 +722,21 @@ static void test_position(void)
r = SendMessageA(hWndTrackbar, TBM_GETPOS, 0, 0);
ok(r == 25, "got %d\n", r);
SendMessageA(hWndTrackbar, TBM_GETTHUMBRECT, 0, (LPARAM)&rect2);
ok(rect.left == rect2.left, "got %d\n", rect.left);
ok(rect.left == rect2.left, "got %ld\n", rect.left);

/* with repaint */
SendMessageA(hWndTrackbar, TBM_SETPOS, TRUE, 30);
r = SendMessageA(hWndTrackbar, TBM_GETPOS, 0, 0);
ok(r == 30, "got %d\n", r);
SendMessageA(hWndTrackbar, TBM_GETTHUMBRECT, 0, (LPARAM)&rect2);
ok(rect.left != rect2.left, "got %d, expected %d\n", rect2.left, rect.left);
ok(rect.left != rect2.left, "got %ld, expected %ld\n", rect2.left, rect.left);

/* now move it with keys */
SendMessageA(hWndTrackbar, WM_KEYDOWN, VK_END, 0);
r = SendMessageA(hWndTrackbar, TBM_GETPOS, 0, 0);
ok(r == 100, "got %d\n", r);
SendMessageA(hWndTrackbar, TBM_GETTHUMBRECT, 0, (LPARAM)&rect);
ok(rect.left != rect2.left, "got %d, expected %d\n", rect.left, rect2.left);
ok(rect.left != rect2.left, "got %ld, expected %ld\n", rect.left, rect2.left);

DestroyWindow(hWndTrackbar);
}
Expand Down Expand Up @@ -1109,7 +1114,7 @@ static void test_tic_placement(void)
SendMessageA(hWndTrackbar, TBM_SETTICFREQ, 1, 0);

numtics = SendMessageA(hWndTrackbar, TBM_GETNUMTICS, 0, 0);
ok(numtics == 6, "Expected 6, got %d\n", numtics);
ok(numtics == 6, "Expected 6, got %ld\n", numtics);

flush_sequences(sequences, NUM_MSG_SEQUENCE);
/* test TBM_GETPTICS */
Expand Down
62 changes: 33 additions & 29 deletions dlls/comctl32/tests/treeview.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,11 @@ static BOOL g_v6;
#define PARENT_SEQ_INDEX 1
#define PARENT_CD_SEQ_INDEX 2

#define expect(expected, got) ok(got == expected, "Expected %d, got %d\n", expected, got)
#define expect(expected,got) expect_(__LINE__, expected, got)
static inline void expect_(unsigned line, DWORD expected, DWORD got)
{
ok_(__FILE__, line)(expected == got, "Expected %ld, got %ld\n", expected, got);
}

static struct msg_sequence *sequences[NUM_MSG_SEQUENCES];
static struct msg_sequence *item_sequence[1];
Expand Down Expand Up @@ -796,17 +800,17 @@ static void test_get_set_bkcolor(void)

/* If the value is -1, the control is using the system color for the background color. */
crColor = SendMessageA(hTree, TVM_GETBKCOLOR, 0, 0);
ok(crColor == ~0u, "Default background color reported as 0x%.8x\n", crColor);
ok(crColor == ~0u, "Default background color reported as 0x%.8lx\n", crColor);

/* Test for black background */
SendMessageA(hTree, TVM_SETBKCOLOR, 0, RGB(0,0,0));
crColor = SendMessageA(hTree, TVM_GETBKCOLOR, 0, 0);
ok(crColor == RGB(0,0,0), "Black background color reported as 0x%.8x\n", crColor);
ok(crColor == RGB(0,0,0), "Black background color reported as 0x%.8lx\n", crColor);

/* Test for white background */
SendMessageA(hTree, TVM_SETBKCOLOR, 0, RGB(255,255,255));
crColor = SendMessageA(hTree, TVM_GETBKCOLOR, 0, 0);
ok(crColor == RGB(255,255,255), "White background color reported as 0x%.8x\n", crColor);
ok(crColor == RGB(255,255,255), "White background color reported as 0x%.8lx\n", crColor);

/* Reset the default background */
SendMessageA(hTree, TVM_SETBKCOLOR, 0, -1);
Expand Down Expand Up @@ -880,7 +884,7 @@ static void test_get_set_insertmark(void)

SendMessageA(hTree, TVM_SETINSERTMARKCOLOR, 0, crColor);
crColor = SendMessageA(hTree, TVM_GETINSERTMARKCOLOR, 0, 0);
ok(crColor == RGB(0,0,0), "Insert mark color reported as 0x%.8x, expected 0x00000000\n", crColor);
ok(crColor == RGB(0,0,0), "Insert mark color reported as 0x%.8lx, expected 0x00000000\n", crColor);

ok_sequence(sequences, TREEVIEW_SEQ_INDEX, test_get_set_insertmarkcolor_seq,
"test get set insertmark color", FALSE);
Expand Down Expand Up @@ -1053,17 +1057,17 @@ static void test_get_set_textcolor(void)
flush_sequences(sequences, NUM_MSG_SEQUENCES);

crColor = SendMessageA(hTree, TVM_GETTEXTCOLOR, 0, 0);
ok(crColor == ~0u, "Default text color reported as 0x%.8x\n", crColor);
ok(crColor == ~0u, "Default text color reported as 0x%.8lx\n", crColor);

/* Test for black text */
SendMessageA(hTree, TVM_SETTEXTCOLOR, 0, RGB(0,0,0));
crColor = SendMessageA(hTree, TVM_GETTEXTCOLOR, 0, 0);
ok(crColor == RGB(0,0,0), "Black text color reported as 0x%.8x\n", crColor);
ok(crColor == RGB(0,0,0), "Black text color reported as 0x%.8lx\n", crColor);

/* Test for white text */
SendMessageA(hTree, TVM_SETTEXTCOLOR, 0, RGB(255,255,255));
crColor = SendMessageA(hTree, TVM_GETTEXTCOLOR, 0, 0);
ok(crColor == RGB(255,255,255), "White text color reported as 0x%.8x\n", crColor);
ok(crColor == RGB(255,255,255), "White text color reported as 0x%.8lx\n", crColor);

/* Reset the default text color */
SendMessageA(hTree, TVM_SETTEXTCOLOR, 0, CLR_NONE);
Expand Down Expand Up @@ -1355,7 +1359,7 @@ static LRESULT CALLBACK parent_wnd_proc(HWND hWnd, UINT message, WPARAM wParam,
g_item_expanding.mask = TVIF_STATE;
g_item_expanding.hItem = hRoot;
ret = SendMessageA(pHdr->hwndFrom, TVM_GETITEMA, 0, (LPARAM)&g_item_expanding);
ok(ret == TRUE, "got %lu\n", ret);
ok(ret == TRUE, "got %Iu\n", ret);
}
break;
}
Expand All @@ -1371,7 +1375,7 @@ static LRESULT CALLBACK parent_wnd_proc(HWND hWnd, UINT message, WPARAM wParam,
g_item_expanded.mask = TVIF_STATE;
g_item_expanded.hItem = hRoot;
ret = SendMessageA(pHdr->hwndFrom, TVM_GETITEMA, 0, (LPARAM)&g_item_expanded);
ok(ret == TRUE, "got %lu\n", ret);
ok(ret == TRUE, "got %Iu\n", ret);
}
if (g_get_rect_in_expand)
{
Expand Down Expand Up @@ -1420,9 +1424,9 @@ static LRESULT CALLBACK parent_wnd_proc(HWND hWnd, UINT message, WPARAM wParam,
return CDRF_NOTIFYITEMDRAW|CDRF_NOTIFYITEMERASE|CDRF_NOTIFYPOSTPAINT;
case CDDS_ITEMPREPAINT:
ok(text == nmcd->clrText || (g_v6 && nmcd->clrText == 0xffffffff),
"got %08x vs %08x\n", text, nmcd->clrText);
"got %08lx vs %08lx\n", text, nmcd->clrText);
ok(bkgnd == nmcd->clrTextBk || (g_v6 && nmcd->clrTextBk == 0xffffffff),
"got %08x vs %08x\n", bkgnd, nmcd->clrTextBk);
"got %08lx vs %08lx\n", bkgnd, nmcd->clrTextBk);
nmcd->clrText = cafe;
nmcd->clrTextBk = c0ffee;
SetTextColor(nmcd->nmcd.hdc, c0ffee);
Expand All @@ -1432,10 +1436,10 @@ static LRESULT CALLBACK parent_wnd_proc(HWND hWnd, UINT message, WPARAM wParam,
return CDRF_NOTIFYPOSTPAINT|CDRF_NEWFONT;
case CDDS_ITEMPOSTPAINT:
/* at the point of post paint notification colors are already restored */
ok(nmcd->clrText == cafe, "got 0%x\n", nmcd->clrText);
ok(nmcd->clrTextBk == c0ffee, "got 0%x\n", nmcd->clrTextBk);
ok(text != cafe, "got 0%x\n", text);
ok(bkgnd != c0ffee, "got 0%x\n", bkgnd);
ok(nmcd->clrText == cafe, "got 0%lx\n", nmcd->clrText);
ok(nmcd->clrTextBk == c0ffee, "got 0%lx\n", nmcd->clrTextBk);
ok(text != cafe, "got 0%lx\n", text);
ok(bkgnd != c0ffee, "got 0%lx\n", bkgnd);
if (g_customdraw_font)
ok(GetCurrentObject(nmcd->nmcd.hdc, OBJ_FONT) != g_customdraw_font, "got %p\n",
GetCurrentObject(nmcd->nmcd.hdc, OBJ_FONT));
Expand Down Expand Up @@ -1583,8 +1587,8 @@ static void test_expand(void)
*(HTREEITEM *)&rect = first;
visible = SendMessageA(tv, TVM_GETITEMRECT, FALSE, (LPARAM)&rect);
ok(visible, "first node should be visible\n");
ok(!rect.left, "rect.left = %d\n", rect.left);
ok(!rect.top, "rect.top = %d\n", rect.top);
ok(!rect.left, "rect.left = %ld\n", rect.left);
ok(!rect.top, "rect.top = %ld\n", rect.top);
ok(rect.right, "rect.right = 0\n");
ok(rect.bottom, "rect.bottom = 0\n");

Expand Down Expand Up @@ -1701,7 +1705,7 @@ static void test_itemedit(void)
r = SetWindowTextA(edit, buffA);
expect(TRUE, r);
r = GetWindowTextA(edit, buffA, ARRAY_SIZE(buffA));
ok( r == ARRAY_SIZE(buffA) - 1, "got %d\n", r );
ok( r == ARRAY_SIZE(buffA) - 1, "got %ld\n", r );
/* ...but it's trimmed to MAX_PATH chars when editing ends */
r = SendMessageA(hTree, WM_COMMAND, MAKEWPARAM(0, EN_KILLFOCUS), (LPARAM)edit);
expect(0, r);
Expand Down Expand Up @@ -2137,26 +2141,26 @@ static void test_WM_PAINT(void)
hTree = create_treeview_control(0);

clr = SendMessageA(hTree, TVM_SETBKCOLOR, 0, RGB(255, 0, 0));
ok(clr == ~0u, "got %d, expected -1\n", clr);
ok(clr == ~0u, "got %ld, expected -1\n", clr);

hdc = GetDC(hMainWnd);

GetClientRect(hMainWnd, &rc);
FillRect(hdc, &rc, GetStockObject(BLACK_BRUSH));

clr = GetPixel(hdc, 1, 1);
ok(clr == RGB(0, 0, 0), "got 0x%x\n", clr);
ok(clr == RGB(0, 0, 0), "got 0x%lx\n", clr);

ret = SendMessageA(hTree, WM_PAINT, (WPARAM)hdc, 0);
ok(ret == 0, "got %d\n", ret);
ok(ret == 0, "got %ld\n", ret);

clr = GetPixel(hdc, 1, 1);
htheme = pGetWindowTheme(hTree);
is_glyph_transparent = htheme && pIsThemeBackgroundPartiallyTransparent(htheme, TVP_GLYPH, 0);
ok(clr == RGB(255, 0, 0) || broken(clr == RGB(0, 0, 0)) /* win98 */
/* When theming is on and treeview glyphs are transparent, parent window needs to be repainted */
|| (is_glyph_transparent && clr == GetSysColor(COLOR_WINDOW)),
"got 0x%x\n", clr);
"got 0x%lx\n", clr);

ReleaseDC(hMainWnd, hdc);

Expand Down Expand Up @@ -2187,8 +2191,8 @@ static void test_delete_items(void)

if (item_sequence[0]->count == 2)
{
ok(msg[0].lParam == (LPARAM)hChild, "expected %p, got 0x%lx\n", hChild, msg[0].lParam);
ok(msg[1].lParam == (LPARAM)hRoot, "expected %p, got 0x%lx\n", hRoot, msg[1].lParam);
ok(msg[0].lParam == (LPARAM)hChild, "expected %p, got 0x%Ix\n", hChild, msg[0].lParam);
ok(msg[1].lParam == (LPARAM)hRoot, "expected %p, got 0x%Ix\n", hRoot, msg[1].lParam);
}

ret = SendMessageA(hTree, TVM_GETCOUNT, 0, 0);
Expand Down Expand Up @@ -2330,7 +2334,7 @@ static void _check_item(HWND hwnd, HTREEITEM item, BOOL is_version_6, int line)
width = data->width;
todo_wine
ok_(__FILE__, line)(width == (rect.right - rect.left) || broken(is_version_6 && width == 0) /* XP */,
"Width %d, rect width %d.\n", width, rect.right - rect.left);
"Width %d, rect width %ld.\n", width, rect.right - rect.left);
}
}

Expand Down Expand Up @@ -2643,7 +2647,7 @@ static void test_WM_GETDLGCODE(void)
hTree = create_treeview_control(0);

code = SendMessageA(hTree, WM_GETDLGCODE, VK_TAB, 0);
ok(code == (DLGC_WANTCHARS | DLGC_WANTARROWS), "0x%08x\n", code);
ok(code == (DLGC_WANTCHARS | DLGC_WANTARROWS), "0x%08lx\n", code);

DestroyWindow(hTree);
}
Expand Down Expand Up @@ -2703,7 +2707,7 @@ static void test_TVS_FULLROWSELECT(void)
hwnd = create_treeview_control(TVS_FULLROWSELECT);

style = GetWindowLongA(hwnd, GWL_STYLE);
ok((style & (TVS_FULLROWSELECT | TVS_HASLINES)) == (TVS_FULLROWSELECT | TVS_HASLINES), "got style 0x%08x\n", style);
ok((style & (TVS_FULLROWSELECT | TVS_HASLINES)) == (TVS_FULLROWSELECT | TVS_HASLINES), "got style 0x%08lx\n", style);

DestroyWindow(hwnd);

Expand All @@ -2713,7 +2717,7 @@ static void test_TVS_FULLROWSELECT(void)
style = GetWindowLongA(hwnd, GWL_STYLE);
SetWindowLongA(hwnd, GWL_STYLE, style | TVS_FULLROWSELECT);
style = GetWindowLongA(hwnd, GWL_STYLE);
ok(style & TVS_FULLROWSELECT, "got style 0x%08x\n", style);
ok(style & TVS_FULLROWSELECT, "got style 0x%08lx\n", style);

DestroyWindow(hwnd);
}
Expand Down
26 changes: 15 additions & 11 deletions dlls/comctl32/tests/updown.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,11 @@
#include "wine/test.h"
#include "msg.h"

#define expect(EXPECTED,GOT) ok((GOT)==(EXPECTED), "Expected %d, got %d\n", (EXPECTED), (GOT))
#define expect(expected,got) expect_(__LINE__, expected, got)
static inline void expect_(unsigned line, DWORD expected, DWORD got)
{
ok_(__FILE__, line)(expected == got, "Expected %ld, got %ld\n", expected, got);
}

#define NUM_MSG_SEQUENCES 3
#define PARENT_SEQ_INDEX 0
Expand Down Expand Up @@ -802,47 +806,47 @@ static void test_updown_create(void)
ok(updown != NULL, "Failed to create updown control\n");
r.right = 0;
GetClientRect(updown, &r);
ok(r.right > 0, "Expected default width, got %d\n", r.right);
ok(r.right > 0, "Expected default width, got %ld\n", r.right);
DestroyWindow(updown);
/* create with really small width */
updown = CreateWindowA (UPDOWN_CLASSA, 0, WS_CHILD | WS_BORDER | WS_VISIBLE, 0, 0, 2, 0,
parent_wnd, (HMENU)(DWORD_PTR)1, GetModuleHandleA(NULL), 0);
ok(updown != NULL, "Failed to create updown control\n");
r.right = 0;
GetClientRect(updown, &r);
ok(r.right != 2 && r.right > 0, "Expected default width, got %d\n", r.right);
ok(r.right != 2 && r.right > 0, "Expected default width, got %ld\n", r.right);
DestroyWindow(updown);
/* create with width greater than default */
updown = CreateWindowA (UPDOWN_CLASSA, 0, WS_CHILD | WS_BORDER | WS_VISIBLE, 0, 0, 100, 0,
parent_wnd, (HMENU)(DWORD_PTR)1, GetModuleHandleA(NULL), 0);
ok(updown != NULL, "Failed to create updown control\n");
r.right = 0;
GetClientRect(updown, &r);
ok(r.right < 100 && r.right > 0, "Expected default width, got %d\n", r.right);
ok(r.right < 100 && r.right > 0, "Expected default width, got %ld\n", r.right);
DestroyWindow(updown);
/* create with zero height, UDS_HORZ */
updown = CreateWindowA (UPDOWN_CLASSA, 0, UDS_HORZ | WS_CHILD | WS_BORDER | WS_VISIBLE, 0, 0, 0, 0,
parent_wnd, (HMENU)(DWORD_PTR)1, GetModuleHandleA(NULL), 0);
ok(updown != NULL, "Failed to create updown control\n");
r.bottom = 0;
GetClientRect(updown, &r);
ok(r.bottom == 0, "Expected zero height, got %d\n", r.bottom);
ok(r.bottom == 0, "Expected zero height, got %ld\n", r.bottom);
DestroyWindow(updown);
/* create with really small height, UDS_HORZ */
updown = CreateWindowA (UPDOWN_CLASSA, 0, UDS_HORZ | WS_CHILD | WS_BORDER | WS_VISIBLE, 0, 0, 0, 2,
parent_wnd, (HMENU)(DWORD_PTR)1, GetModuleHandleA(NULL), 0);
ok(updown != NULL, "Failed to create updown control\n");
r.bottom = 0;
GetClientRect(updown, &r);
ok(r.bottom == 0, "Expected zero height, got %d\n", r.bottom);
ok(r.bottom == 0, "Expected zero height, got %ld\n", r.bottom);
DestroyWindow(updown);
/* create with height greater than default, UDS_HORZ */
updown = CreateWindowA (UPDOWN_CLASSA, 0, UDS_HORZ | WS_CHILD | WS_BORDER | WS_VISIBLE, 0, 0, 0, 100,
parent_wnd, (HMENU)(DWORD_PTR)1, GetModuleHandleA(NULL), 0);
ok(updown != NULL, "Failed to create updown control\n");
r.bottom = 0;
GetClientRect(updown, &r);
ok(r.bottom < 100 && r.bottom > 0, "Expected default height, got %d\n", r.bottom);
ok(r.bottom < 100 && r.bottom > 0, "Expected default height, got %ld\n", r.bottom);
DestroyWindow(updown);
}

Expand Down Expand Up @@ -983,23 +987,23 @@ static void test_UDS_SETBUDDY(void)

updown = create_updown_control(UDS_ALIGNRIGHT | UDS_SETBUDDYINT | UDS_ARROWKEYS, g_edit);
ret = SetWindowPos(g_edit, 0, 100, 100, start_width, start_height, SWP_NOACTIVATE | SWP_NOZORDER);
ok(ret, "SetWindowPos failed, error %u.\n", GetLastError());
ok(ret, "SetWindowPos failed, error %lu.\n", GetLastError());
ret = GetWindowRect(g_edit, &rect);
ok(ret, "GetWindowRect failed, error %u.\n", GetLastError());
ok(ret, "GetWindowRect failed, error %lu.\n", GetLastError());
width = rect.right - rect.left;
height = rect.bottom - rect.top;
ok(width == start_width, "Expected width %d, got %d.\n", start_width, width);
ok(height == start_height, "Expected height %d, got %d.\n", start_height, height);

SendMessageA(updown, UDM_SETBUDDY, (WPARAM)g_edit, 0);
ret = GetWindowRect(g_edit, &rect);
ok(ret, "GetWindowRect failed, error %u.\n", GetLastError());
ok(ret, "GetWindowRect failed, error %lu.\n", GetLastError());
updown_width = start_width - (rect.right - rect.left);
ok(updown_width > 0, "Expected updown width > 0, got %d.\n", updown_width);

SendMessageA(updown, UDM_SETBUDDY, (WPARAM)g_edit, 0);
ret = GetWindowRect(g_edit, &rect);
ok(ret, "GetWindowRect failed, error %u.\n", GetLastError());
ok(ret, "GetWindowRect failed, error %lu.\n", GetLastError());
width = rect.right - rect.left;
height = rect.bottom - rect.top;
ok(width == start_width - 2 * updown_width, "Expected width %d, got %d.\n",
Expand Down
4 changes: 2 additions & 2 deletions dlls/comctl32/tests/v6util.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ static BOOL load_v6_module(ULONG_PTR *pcookie, HANDLE *hCtx)
hmod = GetModuleHandleA("comctl32.dll");

ret = ActivateActCtx(*hCtx, pcookie);
ok(ret, "Failed to activate context, error %d.\n", GetLastError());
ok(ret, "Failed to activate context, error %ld.\n", GetLastError());

if (!ret)
{
Expand All @@ -118,7 +118,7 @@ static BOOL load_v6_module(ULONG_PTR *pcookie, HANDLE *hCtx)
data.cbSize = sizeof(data);
ret = FindActCtxSectionStringA(0, NULL, ACTIVATION_CONTEXT_SECTION_DLL_REDIRECTION,
"comctl32.dll", &data);
ok(ret, "failed to find comctl32.dll in active context, %u\n", GetLastError());
ok(ret, "failed to find comctl32.dll in active context, %lu\n", GetLastError());
if (ret)
{
FreeLibrary(hmod);
Expand Down
391 changes: 390 additions & 1 deletion dlls/crypt32/decode.c

Large diffs are not rendered by default.

225 changes: 225 additions & 0 deletions dlls/crypt32/encode.c
Original file line number Diff line number Diff line change
Expand Up @@ -4472,6 +4472,225 @@ BOOL CRYPT_AsnEncodePKCSEnvelopedData(const CRYPT_ENVELOPED_DATA *envelopedData,
ARRAY_SIZE(items), 0, NULL, pvData, pcbData);
}

static BOOL WINAPI CRYPT_AsnEncodeCertId(DWORD dwCertEncodingType,
LPCSTR lpszStructType, const void *pvStructInfo, DWORD dwFlags,
PCRYPT_ENCODE_PARA pEncodePara, BYTE *pbEncoded, DWORD *pcbEncoded)
{
BOOL ret;

__TRY
{
const OCSP_CERT_ID *id = pvStructInfo;
struct AsnEncodeSequenceItem items[] = {
{ &id->HashAlgorithm, CRYPT_AsnEncodeAlgorithmIdWithNullParams, 0 },
{ &id->IssuerNameHash, CRYPT_AsnEncodeOctets, 0 },
{ &id->IssuerKeyHash, CRYPT_AsnEncodeOctets, 0 },
{ &id->SerialNumber, CRYPT_AsnEncodeInteger, 0 },
};

ret = CRYPT_AsnEncodeSequence(dwCertEncodingType, items,
ARRAY_SIZE(items), dwFlags, pEncodePara, pbEncoded, pcbEncoded);
}
__EXCEPT_PAGE_FAULT
{
SetLastError(STATUS_ACCESS_VIOLATION);
ret = FALSE;
}
__ENDTRY
return ret;
}

static BOOL WINAPI CRYPT_AsnEncodeOCSPRequestEntry(DWORD dwCertEncodingType,
LPCSTR lpszStructType, const void *pvStructInfo, DWORD dwFlags,
PCRYPT_ENCODE_PARA pEncodePara, BYTE *pbEncoded, DWORD *pcbEncoded)
{
BOOL ret;

__TRY
{
const OCSP_REQUEST_ENTRY *info = pvStructInfo;
struct AsnEncodeSequenceItem items[] = {
{ &info->CertId, CRYPT_AsnEncodeCertId, 0 },
};

if (info->cExtension)
{
FIXME("extensions not supported\n");
SetLastError(E_INVALIDARG);
ret = FALSE;
}
else
{
ret = CRYPT_AsnEncodeSequence(dwCertEncodingType, items,
ARRAY_SIZE(items), dwFlags, pEncodePara, pbEncoded, pcbEncoded);
}
}
__EXCEPT_PAGE_FAULT
{
SetLastError(STATUS_ACCESS_VIOLATION);
ret = FALSE;
}
__ENDTRY
return ret;
}

struct ocsp_request_list
{
DWORD count;
OCSP_REQUEST_ENTRY *entry;
};

static BOOL WINAPI CRYPT_AsnEncodeOCSPRequestEntries(DWORD dwCertEncodingType,
LPCSTR lpszStructType, const void *pvStructInfo, DWORD dwFlags,
PCRYPT_ENCODE_PARA pEncodePara, BYTE *pbEncoded, DWORD *pcbEncoded)
{
BOOL ret;

__TRY
{
DWORD bytesNeeded, dataLen, lenBytes, i;
const struct ocsp_request_list *list = pvStructInfo;

ret = TRUE;
for (i = 0, dataLen = 0; ret && i < list->count; i++)
{
DWORD size;
ret = CRYPT_AsnEncodeOCSPRequestEntry(dwCertEncodingType, lpszStructType, &list->entry[i],
dwFlags, pEncodePara, NULL, &size);
if (ret)
dataLen += size;
}
if (ret)
{
CRYPT_EncodeLen(dataLen, NULL, &lenBytes);
bytesNeeded = 1 + lenBytes + dataLen;
if (!pbEncoded)
*pcbEncoded = bytesNeeded;
else
{
if ((ret = CRYPT_EncodeEnsureSpace(dwFlags, pEncodePara,
pbEncoded, pcbEncoded, bytesNeeded)))
{
BYTE *out;

if (dwFlags & CRYPT_ENCODE_ALLOC_FLAG)
pbEncoded = *(BYTE **)pbEncoded;
out = pbEncoded;
*out++ = ASN_SEQUENCEOF;
CRYPT_EncodeLen(dataLen, out, &lenBytes);
out += lenBytes;
for (i = 0; i < list->count; i++)
{
DWORD size = dataLen;

ret = CRYPT_AsnEncodeOCSPRequestEntry(dwCertEncodingType, lpszStructType,
&list->entry[i], dwFlags, pEncodePara, out, &size);
out += size;
dataLen -= size;
}

if (!ret && (dwFlags & CRYPT_ENCODE_ALLOC_FLAG))
CRYPT_FreeSpace(pEncodePara, pbEncoded);
}
}
}
}
__EXCEPT_PAGE_FAULT
{
SetLastError(STATUS_ACCESS_VIOLATION);
ret = FALSE;
}
__ENDTRY
return ret;
}

static BOOL WINAPI CRYPT_AsnEncodeOCSPRequest(DWORD dwCertEncodingType,
LPCSTR lpszStructType, const void *pvStructInfo, DWORD dwFlags,
PCRYPT_ENCODE_PARA pEncodePara, BYTE *pbEncoded, DWORD *pcbEncoded)
{
BOOL ret;

__TRY
{
const OCSP_REQUEST_INFO *info = pvStructInfo;

if (info->dwVersion != OCSP_REQUEST_V1)
{
FIXME("version %lu not supported\n", info->dwVersion);
SetLastError(E_INVALIDARG);
ret = FALSE;
}
else
{
if (info->cExtension)
{
FIXME("extensions not supported\n");
SetLastError(E_INVALIDARG);
ret = FALSE;
}
else
{
struct AsnConstructedItem name;
struct AsnEncodeSequenceItem items[2];
DWORD count = 0;

if (info->pRequestorName)
{
name.tag = 1;
name.pvStructInfo = info->pRequestorName;
name.encodeFunc = CRYPT_AsnEncodeAltNameEntry;
items[count].pvStructInfo = &name;
items[count].encodeFunc = CRYPT_AsnEncodeConstructed;
count++;
}
if (info->cRequestEntry)
{
items[count].pvStructInfo = &info->cRequestEntry;
items[count].encodeFunc = CRYPT_AsnEncodeOCSPRequestEntries;
count++;
}

ret = CRYPT_AsnEncodeSequence(dwCertEncodingType, items,
count, dwFlags, pEncodePara, pbEncoded, pcbEncoded);
}
}
}
__EXCEPT_PAGE_FAULT
{
SetLastError(STATUS_ACCESS_VIOLATION);
ret = FALSE;
}
__ENDTRY
return ret;
}

static BOOL WINAPI CRYPT_AsnEncodeOCSPSignedRequest(DWORD dwCertEncodingType,
LPCSTR lpszStructType, const void *pvStructInfo, DWORD dwFlags,
PCRYPT_ENCODE_PARA pEncodePara, BYTE *pbEncoded, DWORD *pcbEncoded)
{
BOOL ret;

__TRY
{
const OCSP_SIGNED_REQUEST_INFO *info = pvStructInfo;
struct AsnEncodeSequenceItem items[] = {
{ &info->ToBeSigned, CRYPT_CopyEncodedBlob, 0 },
};

if (info->pOptionalSignatureInfo) FIXME("pOptionalSignatureInfo not supported\n");

ret = CRYPT_AsnEncodeSequence(dwCertEncodingType, items,
ARRAY_SIZE(items), dwFlags, pEncodePara, pbEncoded, pcbEncoded);
}
__EXCEPT_PAGE_FAULT
{
SetLastError(STATUS_ACCESS_VIOLATION);
ret = FALSE;
}
__ENDTRY
return ret;
}

static CryptEncodeObjectExFunc CRYPT_GetBuiltinEncoder(DWORD dwCertEncodingType,
LPCSTR lpszStructType)
{
Expand Down Expand Up @@ -4612,6 +4831,12 @@ static CryptEncodeObjectExFunc CRYPT_GetBuiltinEncoder(DWORD dwCertEncodingType,
case LOWORD(CNG_RSA_PUBLIC_KEY_BLOB):
encodeFunc = CRYPT_AsnEncodeRsaPubKey_Bcrypt;
break;
case LOWORD(OCSP_REQUEST):
encodeFunc = CRYPT_AsnEncodeOCSPRequest;
break;
case LOWORD(OCSP_SIGNED_REQUEST):
encodeFunc = CRYPT_AsnEncodeOCSPSignedRequest;
break;
default:
FIXME("Unimplemented encoder for lpszStructType OID %d\n", LOWORD(lpszStructType));
}
Expand Down
1 change: 1 addition & 0 deletions dlls/crypt32/tests/cert.c
Original file line number Diff line number Diff line change
Expand Up @@ -4318,6 +4318,7 @@ static void test_VerifySignature(void)
BCryptDestroyHash(bhash);
done:
BCryptCloseAlgorithmProvider(alg, 0);
BCryptDestroyKey(bkey);

LocalFree(info);
CertFreeCertificateContext(cert);
Expand Down
376 changes: 376 additions & 0 deletions dlls/crypt32/tests/encode.c

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dlls/crypt32/unixlib.c
Original file line number Diff line number Diff line change
Expand Up @@ -623,7 +623,7 @@ static const char * const CRYPT_knownLocations[] = {

static void load_root_certs(void)
{
DWORD i;
unsigned int i;

#ifdef HAVE_SECURITY_SECURITY_H
const SecTrustSettingsDomain domains[] = {
Expand Down Expand Up @@ -651,7 +651,7 @@ static void load_root_certs(void)
CFRelease(certData);
}
else
WARN("could not export certificate %d to X509 format: 0x%08x\n", i, (unsigned int)status);
WARN("could not export certificate %u to X509 format: 0x%08x\n", i, (unsigned int)status);
}
CFRelease(certs);
}
Expand Down
13 changes: 3 additions & 10 deletions dlls/d2d1/device.c
Original file line number Diff line number Diff line change
Expand Up @@ -2051,6 +2051,7 @@ static void STDMETHODCALLTYPE d2d_device_context_SetTarget(ID2D1DeviceContext *i

if (!(bitmap_impl->options & D2D1_BITMAP_OPTIONS_TARGET))
{
ID2D1Bitmap_Release(bitmap);
d2d_device_context_set_error(context, D2DERR_INVALID_TARGET);
return;
}
Expand All @@ -2068,16 +2069,8 @@ static void STDMETHODCALLTYPE d2d_device_context_SetTarget(ID2D1DeviceContext *i
blend_desc.RenderTarget[0].SrcBlend = D3D11_BLEND_ONE;
blend_desc.RenderTarget[0].DestBlend = D3D11_BLEND_INV_SRC_ALPHA;
blend_desc.RenderTarget[0].BlendOp = D3D11_BLEND_OP_ADD;
if (context->desc.pixelFormat.alphaMode == D2D1_ALPHA_MODE_IGNORE)
{
blend_desc.RenderTarget[0].SrcBlendAlpha = D3D11_BLEND_ZERO;
blend_desc.RenderTarget[0].DestBlendAlpha = D3D11_BLEND_ONE;
}
else
{
blend_desc.RenderTarget[0].SrcBlendAlpha = D3D11_BLEND_ONE;
blend_desc.RenderTarget[0].DestBlendAlpha = D3D11_BLEND_INV_SRC_ALPHA;
}
blend_desc.RenderTarget[0].SrcBlendAlpha = D3D11_BLEND_ONE;
blend_desc.RenderTarget[0].DestBlendAlpha = D3D11_BLEND_INV_SRC_ALPHA;
blend_desc.RenderTarget[0].BlendOpAlpha = D3D11_BLEND_OP_ADD;
blend_desc.RenderTarget[0].RenderTargetWriteMask = D3D11_COLOR_WRITE_ENABLE_ALL;
if (FAILED(hr = ID3D11Device1_CreateBlendState(context->d3d_device, &blend_desc, &context->bs)))
Expand Down
1 change: 1 addition & 0 deletions dlls/d2d1/effect.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ static const struct d2d_effect_info builtin_effects[] =
{&CLSID_D2D13DPerspectiveTransform, 1, 1, 1},
{&CLSID_D2D1Composite, 2, 1, 0xffffffff},
{&CLSID_D2D1Crop, 1, 1, 1},
{&CLSID_D2D1Shadow, 1, 1, 1},
};

static inline struct d2d_effect *impl_from_ID2D1Effect(ID2D1Effect *iface)
Expand Down
4 changes: 4 additions & 0 deletions dlls/d2d1/geometry.c
Original file line number Diff line number Diff line change
Expand Up @@ -5036,9 +5036,13 @@ static HRESULT STDMETHODCALLTYPE d2d_transformed_geometry_StrokeContainsPoint(ID
iface, debug_d2d_point_2f(&point), stroke_width, stroke_style, transform, tolerance, contains);

g = geometry->transform;
stroke_width /= g.m11;
if (transform)
d2d_matrix_multiply(&g, transform);

if (tolerance <= 0.0f)
tolerance = D2D1_DEFAULT_FLATTENING_TOLERANCE;

return ID2D1Geometry_StrokeContainsPoint(geometry->u.transformed.src_geometry, point, stroke_width, stroke_style,
&g, tolerance, contains);
}
Expand Down
105 changes: 99 additions & 6 deletions dlls/d2d1/tests/d2d1.c
Original file line number Diff line number Diff line change
Expand Up @@ -4163,7 +4163,7 @@ static void test_rectangle_geometry(BOOL d3d11)
hr = ID2D1Factory_CreateTransformedGeometry(factory, (ID2D1Geometry *)geometry, &matrix, &transformed_geometry);
ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);

ID2D1TransformedGeometry_GetBounds(transformed_geometry, NULL, &rect);
hr = ID2D1TransformedGeometry_GetBounds(transformed_geometry, NULL, &rect);
ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
match = compare_rect(&rect, -7.85640717e+01f, 1.79903809e+02f, 1.07179594e+01f, 2.73205078e+02f, 1);
ok(match, "Got unexpected bounds {%.8e, %.8e, %.8e, %.8e}.\n",
Expand All @@ -4184,7 +4184,7 @@ static void test_rectangle_geometry(BOOL d3d11)
set_matrix_identity(&matrix);
rotate_matrix(&matrix, M_PI / -3.0f);
scale_matrix(&matrix, 0.25f, 0.2f);
ID2D1TransformedGeometry_GetBounds(transformed_geometry, &matrix, &rect);
hr = ID2D1TransformedGeometry_GetBounds(transformed_geometry, &matrix, &rect);
ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
match = compare_rect(&rect, 30.0f, 20.0f, 40.0f, 40.0f, 2);
ok(match, "Got unexpected bounds {%.8e, %.8e, %.8e, %.8e}.\n",
Expand All @@ -4198,7 +4198,7 @@ static void test_rectangle_geometry(BOOL d3d11)

set_matrix_identity(&matrix);
scale_matrix(&matrix, 2.0f, 0.0f);
ID2D1TransformedGeometry_GetBounds(transformed_geometry, &matrix, &rect);
hr = ID2D1TransformedGeometry_GetBounds(transformed_geometry, &matrix, &rect);
ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
match = compare_rect(&rect, -1.57128143e+02f, 0.00000000e+00f, 2.14359188e+01f, 0.00000000e+00f, 1);
ok(match, "Got unexpected bounds {%.8e, %.8e, %.8e, %.8e}.\n",
Expand All @@ -4212,7 +4212,7 @@ static void test_rectangle_geometry(BOOL d3d11)

set_matrix_identity(&matrix);
scale_matrix(&matrix, 0.0f, 0.5f);
ID2D1TransformedGeometry_GetBounds(transformed_geometry, &matrix, &rect);
hr = ID2D1TransformedGeometry_GetBounds(transformed_geometry, &matrix, &rect);
ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
match = compare_rect(&rect, 0.00000000e+00f, 8.99519043e+01f, 0.00000000e+00, 1.36602539e+02f, 1);
ok(match, "Got unexpected bounds {%.8e, %.8e, %.8e, %.8e}.\n",
Expand Down Expand Up @@ -4341,18 +4341,22 @@ static void test_bitmap_formats(BOOL d3d11)
static void test_alpha_mode(BOOL d3d11)
{
D2D1_RENDER_TARGET_PROPERTIES rt_desc;
D2D1_BITMAP_PROPERTIES1 bitmap_desc1;
D2D1_BITMAP_PROPERTIES bitmap_desc;
ID2D1SolidColorBrush *color_brush;
ID2D1BitmapBrush *bitmap_brush;
struct d2d1_test_context ctx;
ID2D1DeviceContext *context;
ID2D1Bitmap1 *bitmap1;
ID2D1RenderTarget *rt;
IDXGISurface *surface;
ID2D1Bitmap *bitmap;
D2D1_COLOR_F color;
BOOL match, match2;
D2D1_RECT_F rect;
D2D1_SIZE_U size;
ULONG refcount;
HRESULT hr;
BOOL match;

static const DWORD bitmap_data[] =
{
Expand Down Expand Up @@ -4546,8 +4550,49 @@ static void test_alpha_mode(BOOL d3d11)

refcount = ID2D1Bitmap_Release(bitmap);
ok(refcount == 1, "Bitmap has %lu references left.\n", refcount);
ID2D1SolidColorBrush_Release(color_brush);
ID2D1BitmapBrush_Release(bitmap_brush);

hr = ID2D1RenderTarget_QueryInterface(rt, &IID_ID2D1DeviceContext, (void **)&context);
ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);

set_size_u(&size, 4, 4);
memset(&bitmap_desc1, 0, sizeof(bitmap_desc1));
bitmap_desc1.dpiX = 96.0f;
bitmap_desc1.dpiY = 96.0f;
bitmap_desc1.pixelFormat.format = DXGI_FORMAT_B8G8R8A8_UNORM;
bitmap_desc1.pixelFormat.alphaMode = D2D1_ALPHA_MODE_IGNORE;
bitmap_desc1.bitmapOptions = D2D1_BITMAP_OPTIONS_TARGET | D2D1_BITMAP_OPTIONS_CANNOT_DRAW;
hr = ID2D1DeviceContext_CreateBitmap(context, size, bitmap_data, 4 * sizeof(*bitmap_data),
&bitmap_desc1, &bitmap1);
ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);

ID2D1DeviceContext_BeginDraw(context);
ID2D1DeviceContext_SetTarget(context, (ID2D1Image *)bitmap1);
set_rect(&rect, 0.0f, 2.0f, 1.0f, 2.0f);
ID2D1SolidColorBrush_SetOpacity(color_brush, 1.0f);
ID2D1DeviceContext_FillRectangle(context, &rect, (ID2D1Brush *)color_brush);
set_rect(&rect, 1.0f, 2.0f, 3.0f, 3.0f);
ID2D1SolidColorBrush_SetOpacity(color_brush, 0.75f);
ID2D1DeviceContext_FillRectangle(context, &rect, (ID2D1Brush *)color_brush);
set_rect(&rect, 3.0f, 2.0f, 3.0f, 3.0f);
ID2D1SolidColorBrush_SetOpacity(color_brush, 0.25f);
ID2D1DeviceContext_FillRectangle(context, &rect, (ID2D1Brush *)color_brush);
hr = ID2D1DeviceContext_EndDraw(context, NULL, NULL);
ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);

surface = ctx.surface;
hr = ID2D1Bitmap1_GetSurface(bitmap1, &ctx.surface);
ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
match = compare_surface(&ctx, "e7ee77e89745fa5d195fd78bd398738330cfcde8");
match2 = compare_surface(&ctx, "4855c7c082c8ede364cf6e2dcde83f95b88aecbe");
ok(match || broken(match2) /* Win7 TestBots */, "Surface does not match.\n");
IDXGISurface_Release(ctx.surface);
ctx.surface = surface;
ID2D1DeviceContext_SetTarget(context, NULL);

ID2D1Bitmap1_Release(bitmap1);
ID2D1DeviceContext_Release(context);
ID2D1SolidColorBrush_Release(color_brush);
ID2D1RenderTarget_Release(rt);
release_test_context(&ctx);
}
Expand Down Expand Up @@ -9908,6 +9953,7 @@ static void test_effect(BOOL d3d11)
{&CLSID_D2D13DPerspectiveTransform, 1, 1, 1},
{&CLSID_D2D1Composite, 2, 1, 0xffffffff},
{&CLSID_D2D1Crop, 1, 1, 1},
{&CLSID_D2D1Shadow, 1, 1, 1},
};

if (!init_test_context(&ctx, d3d11))
Expand Down Expand Up @@ -10306,7 +10352,9 @@ static void test_effect_crop(BOOL d3d11)

static void test_stroke_contains_point(BOOL d3d11)
{
ID2D1TransformedGeometry *transformed_geometry;
ID2D1RectangleGeometry *rectangle;
D2D1_MATRIX_3X2_F matrix;
ID2D1GeometrySink *sink;
ID2D1PathGeometry *path;
ID2D1Factory *factory;
Expand Down Expand Up @@ -10481,6 +10529,24 @@ static void test_stroke_contains_point(BOOL d3d11)
{{{{1.0f, 0.0f, 1.0f, 1.0f}}}, {1425.0f, 827.6f}, 0.1f, 5.0f, TRUE, FALSE},
{{{{1.0f, 0.0f, 1.0f, 1.0f}}}, {1620.1f, 800.0f}, 0.1f, 5.0f, TRUE, FALSE},
{{{{1.0f, 0.0f, 1.0f, 1.0f}}}, {1620.4f, 800.0f}, 0.1f, 5.0f, TRUE, TRUE},
},
transformed_tests[] =
{
/* 0. Stroked area hittesting. Edge. Tolerance is 0.0f */
{{{{0.0f}}}, {0.74f, 2.5f}, 0.0f, 1.0f, FALSE, TRUE},
{{{{0.0f}}}, {0.75f, 2.5f}, 0.0f, 1.0f, FALSE, FALSE},

/* 2. Stroked area hittesting. Edge. Tolerance is negative */
{{{{0.0f}}}, {0.74f, 2.5f}, -1.0f, 1.0f, FALSE, TRUE},
{{{{0.0f}}}, {0.75f, 2.5f}, -1.0f, 1.0f, FALSE, FALSE},

/* 4. Stroked area hittesting. Edge. Tolerance is close to zero */
{{{{0.0f}}}, {0.501f, 2.5f}, 0.001f, 1.0f, FALSE, TRUE},
{{{{0.0f}}}, {0.502f, 2.5f}, 0.001f, 1.0f, FALSE, FALSE},

/* 6. Stroked area hittesting. Edge. Tolerance is D2D1_DEFAULT_FLATTENING_TOLERANCE */
{{{{0.0f}}}, {0.74f, 2.5f}, 0.25f, 1.0f, FALSE, TRUE},
{{{{0.0f}}}, {0.75f, 2.5f}, 0.25f, 1.0f, FALSE, FALSE},
};

hr = D2D1CreateFactory(D2D1_FACTORY_TYPE_SINGLE_THREADED, &IID_ID2D1Factory, NULL, (void **)&factory);
Expand Down Expand Up @@ -10570,6 +10636,33 @@ static void test_stroke_contains_point(BOOL d3d11)

ID2D1PathGeometry_Release(path);

set_rect(&rect, 0.0f, 0.0f, 5.0f, 5.0f);
hr = ID2D1Factory_CreateRectangleGeometry(factory, &rect, &rectangle);
ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
set_matrix_identity(&matrix);
scale_matrix(&matrix, 2.0f, 4.0f);
hr = ID2D1Factory_CreateTransformedGeometry(factory, (ID2D1Geometry *)rectangle, &matrix,
&transformed_geometry);
ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);

for (i = 0; i < ARRAY_SIZE(transformed_tests); ++i)
{
const struct contains_point_test *test = &transformed_tests[i];

winetest_push_context("Test %u", i);

contains = !test->contains;
hr = ID2D1TransformedGeometry_StrokeContainsPoint(transformed_geometry, test->point,
test->stroke_width, NULL, test->matrix ? &test->transform : NULL, test->tolerance,
&contains);
ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
ok(contains == test->contains, "Got unexpected result %#x.\n", contains);

winetest_pop_context();
}
ID2D1TransformedGeometry_Release(transformed_geometry);
ID2D1RectangleGeometry_Release(rectangle);

ID2D1Factory_Release(factory);
}

Expand Down
5 changes: 4 additions & 1 deletion dlls/d3d10_1/tests/Makefile.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
TESTDLL = d3d10_1.dll
IMPORTS = d3d10_1 user32
EXTRADEFS = -DD3D_COMPILER_VERSION=0
PARENTSRC = ../../d3dcompiler_43/tests

C_SRCS = \
d3d10_1.c
d3d10_1.c \
reflection.c
1 change: 1 addition & 0 deletions dlls/d3d10_1/tests/d3d10_1.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
*/

#define COBJMACROS
#include "d3d10_1.h"
#include "initguid.h"
#include "d3d11_1.h"
#include "wine/test.h"
Expand Down
30 changes: 9 additions & 21 deletions dlls/d3d11/device.c
Original file line number Diff line number Diff line change
Expand Up @@ -730,7 +730,7 @@ static void STDMETHODCALLTYPE d3d11_device_context_PSSetShader(ID3D11DeviceConte
TRACE("iface %p, shader %p, class_instances %p, class_instance_count %u.\n",
iface, shader, class_instances, class_instance_count);

if (class_instances)
if (class_instance_count)
FIXME("Dynamic linking is not implemented yet.\n");

wined3d_device_context_set_shader(context->wined3d_context, WINED3D_SHADER_TYPE_PIXEL,
Expand All @@ -755,7 +755,7 @@ static void STDMETHODCALLTYPE d3d11_device_context_VSSetShader(ID3D11DeviceConte
TRACE("iface %p, shader %p, class_instances %p, class_instance_count %u.\n",
iface, shader, class_instances, class_instance_count);

if (class_instances)
if (class_instance_count)
FIXME("Dynamic linking is not implemented yet.\n");

wined3d_device_context_set_shader(context->wined3d_context, WINED3D_SHADER_TYPE_VERTEX,
Expand Down Expand Up @@ -941,7 +941,7 @@ static void STDMETHODCALLTYPE d3d11_device_context_GSSetShader(ID3D11DeviceConte
TRACE("iface %p, shader %p, class_instances %p, class_instance_count %u.\n",
iface, shader, class_instances, class_instance_count);

if (class_instances)
if (class_instance_count)
FIXME("Dynamic linking is not implemented yet.\n");

wined3d_device_context_set_shader(context->wined3d_context, WINED3D_SHADER_TYPE_GEOMETRY,
Expand Down Expand Up @@ -1544,7 +1544,7 @@ static void STDMETHODCALLTYPE d3d11_device_context_HSSetShader(ID3D11DeviceConte
TRACE("iface %p, shader %p, class_instances %p, class_instance_count %u.\n",
iface, shader, class_instances, class_instance_count);

if (class_instances)
if (class_instance_count)
FIXME("Dynamic linking is not implemented yet.\n");

wined3d_device_context_set_shader(context->wined3d_context, WINED3D_SHADER_TYPE_HULL,
Expand Down Expand Up @@ -1588,7 +1588,7 @@ static void STDMETHODCALLTYPE d3d11_device_context_DSSetShader(ID3D11DeviceConte
TRACE("iface %p, shader %p, class_instances %p, class_instance_count %u.\n",
iface, shader, class_instances, class_instance_count);

if (class_instances)
if (class_instance_count)
FIXME("Dynamic linking is not implemented yet.\n");

wined3d_device_context_set_shader(context->wined3d_context, WINED3D_SHADER_TYPE_DOMAIN,
Expand Down Expand Up @@ -1659,7 +1659,7 @@ static void STDMETHODCALLTYPE d3d11_device_context_CSSetShader(ID3D11DeviceConte
TRACE("iface %p, shader %p, class_instances %p, class_instance_count %u.\n",
iface, shader, class_instances, class_instance_count);

if (class_instances)
if (class_instance_count)
FIXME("Dynamic linking is not implemented yet.\n");

wined3d_device_context_set_shader(context->wined3d_context, WINED3D_SHADER_TYPE_COMPUTE,
Expand Down Expand Up @@ -1734,8 +1734,6 @@ static void STDMETHODCALLTYPE d3d11_device_context_PSGetShader(ID3D11DeviceConte
TRACE("iface %p, shader %p, class_instances %p, class_instance_count %p.\n",
iface, shader, class_instances, class_instance_count);

if (class_instances || class_instance_count)
FIXME("Dynamic linking not implemented yet.\n");
if (class_instance_count)
*class_instance_count = 0;

Expand Down Expand Up @@ -1792,8 +1790,6 @@ static void STDMETHODCALLTYPE d3d11_device_context_VSGetShader(ID3D11DeviceConte
TRACE("iface %p, shader %p, class_instances %p, class_instance_count %p.\n",
iface, shader, class_instances, class_instance_count);

if (class_instances || class_instance_count)
FIXME("Dynamic linking not implemented yet.\n");
if (class_instance_count)
*class_instance_count = 0;

Expand Down Expand Up @@ -1926,8 +1922,6 @@ static void STDMETHODCALLTYPE d3d11_device_context_GSGetShader(ID3D11DeviceConte
TRACE("iface %p, shader %p, class_instances %p, class_instance_count %p.\n",
iface, shader, class_instances, class_instance_count);

if (class_instances || class_instance_count)
FIXME("Dynamic linking not implemented yet.\n");
if (class_instance_count)
*class_instance_count = 0;

Expand Down Expand Up @@ -2393,8 +2387,6 @@ static void STDMETHODCALLTYPE d3d11_device_context_HSGetShader(ID3D11DeviceConte
TRACE("iface %p, shader %p, class_instances %p, class_instance_count %p.\n",
iface, shader, class_instances, class_instance_count);

if (class_instances || class_instance_count)
FIXME("Dynamic linking not implemented yet.\n");
if (class_instance_count)
*class_instance_count = 0;

Expand Down Expand Up @@ -2487,8 +2479,6 @@ static void STDMETHODCALLTYPE d3d11_device_context_DSGetShader(ID3D11DeviceConte
TRACE("iface %p, shader %p, class_instances %p, class_instance_count %p.\n",
iface, shader, class_instances, class_instance_count);

if (class_instances || class_instance_count)
FIXME("Dynamic linking not implemented yet.\n");
if (class_instance_count)
*class_instance_count = 0;

Expand Down Expand Up @@ -2607,8 +2597,6 @@ static void STDMETHODCALLTYPE d3d11_device_context_CSGetShader(ID3D11DeviceConte
TRACE("iface %p, shader %p, class_instances %p, class_instance_count %p.\n",
iface, shader, class_instances, class_instance_count);

if (class_instances || class_instance_count)
FIXME("Dynamic linking not implemented yet.\n");
if (class_instance_count)
*class_instance_count = 0;

Expand Down Expand Up @@ -4099,10 +4087,10 @@ static HRESULT STDMETHODCALLTYPE d3d11_device_CheckFeatureSupport(ID3D11Device2
options->FlagsForUpdateAndCopySeenByDriver = FALSE;
options->ClearView = FALSE;
options->CopyWithOverlap = FALSE;
options->ConstantBufferPartialUpdate = FALSE;
options->ConstantBufferPartialUpdate = TRUE;
options->ConstantBufferOffsetting = TRUE;
options->MapNoOverwriteOnDynamicConstantBuffer = FALSE;
options->MapNoOverwriteOnDynamicBufferSRV = FALSE;
options->MapNoOverwriteOnDynamicConstantBuffer = TRUE;
options->MapNoOverwriteOnDynamicBufferSRV = TRUE;
options->MultisampleRTVWithForcedSampleCountOne = FALSE;
options->SAD4ShaderInstructions = FALSE;
options->ExtendedDoublesShaderInstructions = FALSE;
Expand Down
8 changes: 2 additions & 6 deletions dlls/d3d12/Makefile.in
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
EXTRADEFS = -DWINE_NO_LONG_TYPES
MODULE = d3d12.dll
IMPORTLIB = d3d12
IMPORTS = dxgi dxguid gdi32 user32 uuid win32u
EXTRALIBS = $(VKD3D_LIBS)
EXTRAINCL = $(VKD3D_CFLAGS)

EXTRADLLFLAGS = -mcygwin
IMPORTS = dxgi dxguid wined3d gdi32 user32 uuid win32u
EXTRAINCL = $(VKD3D_PE_CFLAGS)

C_SRCS = \
d3d12_main.c
103 changes: 16 additions & 87 deletions dlls/d3d12/d3d12_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,35 +17,25 @@
*
*/

#include "config.h"

#define COBJMACROS
#define VK_NO_PROTOTYPES
#define VKD3D_NO_VULKAN_H
#define VKD3D_NO_WIN32_TYPES
#ifndef USE_WIN32_VULKAN
#define WINE_VK_HOST
#endif

#include "wine/debug.h"
#include "wine/heap.h"
#include "wine/vulkan.h"
#include "wine/vulkan_driver.h"

#include "windef.h"
#include "dxgi1_6.h"
#include "d3d12.h"
#include "wine/vulkan.h"

#include <vkd3d.h>

#include "initguid.h"
#include "wine/wined3d.h"
#include "wine/winedxgi.h"
#include "wine/debug.h"

WINE_DEFAULT_DEBUG_CHANNEL(d3d12);
WINE_DECLARE_DEBUG_CHANNEL(winediag);

#ifdef USE_WIN32_VULKAN

static HMODULE vulkan_module;

/* FIXME: We should unload vulkan-1.dll. */
Expand All @@ -67,21 +57,6 @@ static PFN_vkGetInstanceProcAddr load_vulkan(void)
return NULL;
}

#else

static PFN_vkGetInstanceProcAddr load_vulkan(void)
{
const struct vulkan_funcs *vk_funcs;

vk_funcs = __wine_get_vulkan_driver(WINE_VULKAN_DRIVER_VERSION);
if (vk_funcs)
return (PFN_vkGetInstanceProcAddr)vk_funcs->p_vkGetInstanceProcAddr;

return NULL;
}

#endif /* USE_WIN32_VULKAN */

HRESULT WINAPI D3D12GetDebugInterface(REFIID iid, void **debug)
{
TRACE("iid %s, debug %p.\n", debugstr_guid(iid), debug);
Expand All @@ -104,52 +79,6 @@ static HRESULT d3d12_signal_event(HANDLE event)
return SetEvent(event) ? S_OK : E_FAIL;
}

struct d3d12_thread_data
{
PFN_vkd3d_thread main_pfn;
void *data;
};

static DWORD WINAPI d3d12_thread_main(void *data)
{
struct d3d12_thread_data *thread_data = data;

thread_data->main_pfn(thread_data->data);
heap_free(thread_data);
return 0;
}

static void *d3d12_create_thread(PFN_vkd3d_thread main_pfn, void *data)
{
struct d3d12_thread_data *thread_data;
HANDLE thread;

if (!(thread_data = heap_alloc(sizeof(*thread_data))))
{
ERR("Failed to allocate thread data.\n");
return NULL;
}

thread_data->main_pfn = main_pfn;
thread_data->data = data;

if (!(thread = CreateThread(NULL, 0, d3d12_thread_main, thread_data, 0, NULL)))
heap_free(thread_data);

return thread;
}

static HRESULT d3d12_join_thread(void *handle)
{
HANDLE thread = handle;
DWORD ret;

if ((ret = WaitForSingleObject(thread, INFINITE)) != WAIT_OBJECT_0)
ERR("Failed to wait for thread, ret %#x.\n", ret);
CloseHandle(thread);
return ret == WAIT_OBJECT_0 ? S_OK : E_FAIL;
}

static HRESULT d3d12_get_adapter(IWineDXGIAdapter **wine_adapter, IUnknown *adapter)
{
IDXGIAdapter *dxgi_adapter = NULL;
Expand All @@ -160,21 +89,21 @@ static HRESULT d3d12_get_adapter(IWineDXGIAdapter **wine_adapter, IUnknown *adap
{
if (FAILED(hr = CreateDXGIFactory2(0, &IID_IDXGIFactory4, (void **)&factory)))
{
WARN("Failed to create DXGI factory, hr %#x.\n", hr);
WARN("Failed to create DXGI factory, hr %#lx.\n", hr);
goto done;
}

if (FAILED(hr = IDXGIFactory4_EnumAdapters(factory, 0, &dxgi_adapter)))
{
WARN("Failed to enumerate primary adapter, hr %#x.\n", hr);
WARN("Failed to enumerate primary adapter, hr %#lx.\n", hr);
goto done;
}

adapter = (IUnknown *)dxgi_adapter;
}

if (FAILED(hr = IUnknown_QueryInterface(adapter, &IID_IWineDXGIAdapter, (void **)wine_adapter)))
WARN("Invalid adapter %p, hr %#x.\n", adapter, hr);
WARN("Invalid adapter %p, hr %#lx.\n", adapter, hr);

done:
if (dxgi_adapter)
Expand All @@ -200,7 +129,7 @@ static BOOL check_vk_instance_extension(VkInstance vk_instance,
if (pfn_vkEnumerateInstanceExtensionProperties(NULL, &count, NULL) < 0)
return FALSE;

if (!(properties = heap_calloc(count, sizeof(*properties))))
if (!(properties = calloc(count, sizeof(*properties))))
return FALSE;

if (pfn_vkEnumerateInstanceExtensionProperties(NULL, &count, properties) >= 0)
Expand All @@ -215,7 +144,7 @@ static BOOL check_vk_instance_extension(VkInstance vk_instance,
}
}

heap_free(properties);
free(properties);
return ret;
}

Expand Down Expand Up @@ -254,7 +183,7 @@ static VkPhysicalDevice d3d12_get_vk_physical_device(struct vkd3d_instance *inst
return VK_NULL_HANDLE;
}

if (!(vk_physical_devices = heap_calloc(count, sizeof(*vk_physical_devices))))
if (!(vk_physical_devices = calloc(count, sizeof(*vk_physical_devices))))
return VK_NULL_HANDLE;

if ((vr = pfn_vkEnumeratePhysicalDevices(vk_instance, &count, vk_physical_devices)) < 0)
Expand Down Expand Up @@ -305,7 +234,7 @@ static VkPhysicalDevice d3d12_get_vk_physical_device(struct vkd3d_instance *inst
FIXME("Could not find Vulkan physical device for DXGI adapter.\n");

done:
heap_free(vk_physical_devices);
free(vk_physical_devices);
return vk_physical_device;
}

Expand Down Expand Up @@ -355,7 +284,7 @@ HRESULT WINAPI D3D12CreateDevice(IUnknown *adapter, D3D_FEATURE_LEVEL minimum_fe

if (FAILED(hr = IWineDXGIAdapter_get_adapter_info(wine_adapter, &adapter_info)))
{
WARN("Failed to get adapter info, hr %#x.\n", hr);
WARN("Failed to get adapter info, hr %#lx.\n", hr);
goto done;
}

Expand All @@ -367,16 +296,16 @@ HRESULT WINAPI D3D12CreateDevice(IUnknown *adapter, D3D_FEATURE_LEVEL minimum_fe
instance_create_info.type = VKD3D_STRUCTURE_TYPE_INSTANCE_CREATE_INFO;
instance_create_info.next = &optional_extensions_info;
instance_create_info.pfn_signal_event = d3d12_signal_event;
instance_create_info.pfn_create_thread = d3d12_create_thread;
instance_create_info.pfn_join_thread = d3d12_join_thread;
instance_create_info.pfn_create_thread = NULL;
instance_create_info.pfn_join_thread = NULL;
instance_create_info.wchar_size = sizeof(WCHAR);
instance_create_info.pfn_vkGetInstanceProcAddr = pfn_vkGetInstanceProcAddr;
instance_create_info.instance_extensions = instance_extensions;
instance_create_info.instance_extension_count = ARRAY_SIZE(instance_extensions);

if (FAILED(hr = vkd3d_create_instance(&instance_create_info, &instance)))
{
WARN("Failed to create vkd3d instance, hr %#x.\n", hr);
WARN("Failed to create vkd3d instance, hr %#lx.\n", hr);
goto done;
}

Expand All @@ -403,7 +332,7 @@ HRESULT WINAPI D3D12CreateDevice(IUnknown *adapter, D3D_FEATURE_LEVEL minimum_fe
HRESULT WINAPI D3D12CreateRootSignatureDeserializer(const void *data, SIZE_T data_size,
REFIID iid, void **deserializer)
{
TRACE("data %p, data_size %lu, iid %s, deserializer %p.\n",
TRACE("data %p, data_size %Iu, iid %s, deserializer %p.\n",
data, data_size, debugstr_guid(iid), deserializer);

return vkd3d_create_root_signature_deserializer(data, data_size, iid, deserializer);
Expand All @@ -412,7 +341,7 @@ HRESULT WINAPI D3D12CreateRootSignatureDeserializer(const void *data, SIZE_T dat
HRESULT WINAPI D3D12CreateVersionedRootSignatureDeserializer(const void *data, SIZE_T data_size,
REFIID iid, void **deserializer)
{
TRACE("data %p, data_size %lu, iid %s, deserializer %p.\n",
TRACE("data %p, data_size %Iu, iid %s, deserializer %p.\n",
data, data_size, debugstr_guid(iid), deserializer);

return vkd3d_create_versioned_root_signature_deserializer(data, data_size, iid, deserializer);
Expand Down
1 change: 0 additions & 1 deletion dlls/d3d12/tests/Makefile.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
EXTRADEFS = -DWINE_NO_LONG_TYPES
TESTDLL = d3d12.dll
IMPORTS = d3d12 dxgi user32

Expand Down
Loading