[COMDLG32_WINETEST]
authorAmine Khaldi <amine.khaldi@reactos.org>
Tue, 22 Apr 2014 14:40:38 +0000 (14:40 +0000)
committerAmine Khaldi <amine.khaldi@reactos.org>
Tue, 22 Apr 2014 14:40:38 +0000 (14:40 +0000)
* Sync with Wine 1.7.17.
CORE-8080

svn path=/trunk/; revision=62882

rostests/winetests/comdlg32/filedlg.c
rostests/winetests/comdlg32/finddlg.c
rostests/winetests/comdlg32/printdlg.c

index bbbaef5..91919fb 100644 (file)
@@ -39,7 +39,7 @@
 
 /* ##### */
 
-static int resizesupported = TRUE;
+static BOOL resizesupported = TRUE;
 
 static void toolbarcheck( HWND hDlg)
 {
@@ -52,14 +52,14 @@ static void toolbarcheck( HWND hDlg)
 
     for( ctrl = GetWindow( hDlg, GW_CHILD);
             ctrl ; ctrl = GetWindow( ctrl, GW_HWNDNEXT)) {
-        GetClassName( ctrl, classname, 10);
+        GetClassNameA( ctrl, classname, 10);
         classname[7] = '\0';
         if( !strcmp( classname, "Toolbar")) break;
     }
     ok( ctrl != NULL, "could not get the toolbar control\n");
-    ret = SendMessage( ctrl, TB_ADDSTRING, 0, (LPARAM)"winetestwinetest\0\0");
+    ret = SendMessageA( ctrl, TB_ADDSTRINGA, 0, (LPARAM)"winetestwinetest\0\0");
     ok( ret == 0, "addstring returned %d (expected 0)\n", ret);
-    maxtextrows = SendMessage( ctrl, TB_GETTEXTROWS, 0, 0);
+    maxtextrows = SendMessageA( ctrl, TB_GETTEXTROWS, 0, 0);
     ok( maxtextrows == 0 || broken(maxtextrows == 1),  /* Win2k and below */
         "Get(Max)TextRows returned %d (expected 0)\n", maxtextrows);
 }
@@ -74,14 +74,14 @@ static UINT_PTR CALLBACK OFNHookProc( HWND hDlg, UINT msg, WPARAM wParam, LPARAM
         nmh = (LPNMHDR) lParam;
         if( nmh->code == CDN_INITDONE)
         {
-            PostMessage( GetParent(hDlg), WM_COMMAND, IDCANCEL, FALSE);
+            PostMessageA( GetParent(hDlg), WM_COMMAND, IDCANCEL, FALSE);
         } else if (nmh->code == CDN_FOLDERCHANGE )
         {
             char buf[1024];
             int ret;
 
             memset(buf, 0x66, sizeof(buf));
-            ret = SendMessage( GetParent(hDlg), CDM_GETFOLDERIDLIST, 5, (LPARAM)buf);
+            ret = SendMessageA( GetParent(hDlg), CDM_GETFOLDERIDLIST, 5, (LPARAM)buf);
             ok(ret > 0, "CMD_GETFOLDERIDLIST not implemented\n");
             if (ret > 5)
                 ok(buf[0] == 0x66 && buf[1] == 0x66, "CMD_GETFOLDERIDLIST: The buffer was touched on failure\n");
@@ -100,7 +100,7 @@ static void test_DialogCancel(void)
     char szFileName[MAX_PATH] = "";
     char szInitialDir[MAX_PATH];
 
-    GetWindowsDirectory(szInitialDir, MAX_PATH);
+    GetWindowsDirectoryA(szInitialDir, MAX_PATH);
 
     ZeroMemory(&ofn, sizeof(ofn));
 
@@ -119,7 +119,7 @@ static void test_DialogCancel(void)
        "expected CDERR_INITIALIZATION, got %d\n", CommDlgExtendedError());
 
     result = GetOpenFileNameA(&ofn);
-    ok(0 == result, "expected 0, got %d\n", result);
+    ok(FALSE == result, "expected FALSE, got %d\n", result);
     ok(0 == CommDlgExtendedError(), "expected 0, got %d\n",
        CommDlgExtendedError());
 
@@ -128,7 +128,7 @@ static void test_DialogCancel(void)
        "expected CDERR_INITIALIZATION, got %d\n", CommDlgExtendedError());
 
     result = GetSaveFileNameA(&ofn);
-    ok(0 == result, "expected 0, got %d\n", result);
+    ok(FALSE == result, "expected FALSE, got %d\n", result);
     ok(0 == CommDlgExtendedError(), "expected 0, got %d\n",
        CommDlgExtendedError());
 
@@ -151,7 +151,7 @@ static void test_DialogCancel(void)
         win_skip("GetOpenFileNameW is not implemented\n");
     else
     {
-        ok(0 == result, "expected 0, got %d\n", result);
+        ok(FALSE == result, "expected FALSE, got %d\n", result);
         ok(0 == CommDlgExtendedError(), "expected 0, got %d\n", CommDlgExtendedError());
     }
 
@@ -161,7 +161,7 @@ static void test_DialogCancel(void)
         win_skip("GetSaveFileNameW is not implemented\n");
     else
     {
-        ok(0 == result, "expected 0, got %d\n", result);
+        ok(FALSE == result, "expected FALSE, got %d\n", result);
         ok(0 == CommDlgExtendedError(), "expected 0, got %d\n", CommDlgExtendedError());
     }
 }
@@ -172,7 +172,7 @@ static UINT_PTR CALLBACK create_view_window2_hook(HWND dlg, UINT msg, WPARAM wPa
     {
         if (((LPNMHDR)lParam)->code == CDN_FOLDERCHANGE)
         {
-            IShellBrowser *shell_browser = (IShellBrowser *)SendMessage(GetParent(dlg), WM_USER + 7 /* WM_GETISHELLBROWSER */, 0, 0);
+            IShellBrowser *shell_browser = (IShellBrowser *)SendMessageA(GetParent(dlg), WM_USER + 7 /* WM_GETISHELLBROWSER */, 0, 0);
             IShellView *shell_view = NULL;
             IShellView2 *shell_view2 = NULL;
             SV2CVW2_PARAMS view_params;
@@ -244,7 +244,7 @@ static UINT_PTR CALLBACK create_view_window2_hook(HWND dlg, UINT msg, WPARAM wPa
 cleanup:
             if (shell_view2) IShellView2_Release(shell_view2);
             if (shell_view) IShellView_Release(shell_view);
-            PostMessage(GetParent(dlg), WM_COMMAND, IDCANCEL, 0);
+            PostMessageA(GetParent(dlg), WM_COMMAND, IDCANCEL, 0);
         }
     }
     return 0;
@@ -260,13 +260,13 @@ static UINT_PTR WINAPI template_hook(HWND dlg, UINT msg, WPARAM wParam, LPARAM l
         ok(p!=NULL, "Failed to get parent of template\n");
         cb = GetDlgItem(p,0x470);
         ok(cb!=NULL, "Failed to get filter combobox\n");
-        sel = SendMessage(cb, CB_GETCURSEL, 0, 0);
+        sel = SendMessageA(cb, CB_GETCURSEL, 0, 0);
         ok (sel != -1, "Failed to get selection from filter listbox\n");
     }
     if (msg == WM_NOTIFY)
     {
         if (((LPNMHDR)lParam)->code == CDN_FOLDERCHANGE)
-            PostMessage(GetParent(dlg), WM_COMMAND, IDCANCEL, 0);
+            PostMessageA(GetParent(dlg), WM_COMMAND, IDCANCEL, 0);
     }
     return 0;
 }
@@ -333,7 +333,7 @@ static UINT_PTR WINAPI resize_template_hook(HWND dlg, UINT msg, WPARAM wParam, L
 {
     static RECT initrc, rc;
     static int index, count;
-    static int gotSWP_bottom, gotShowWindow;
+    static BOOL gotSWP_bottom, gotShowWindow;
     HWND parent = GetParent( dlg);
     int resize;
 #define MAXNRCTRLS 30
@@ -348,16 +348,16 @@ static UINT_PTR WINAPI resize_template_hook(HWND dlg, UINT msg, WPARAM wParam, L
         {
             DWORD style;
 
-            index = ((OPENFILENAME*)lParam)->lCustData;
+            index = ((OPENFILENAMEA*)lParam)->lCustData;
             count = 0;
-            gotSWP_bottom = gotShowWindow = 0;
+            gotSWP_bottom = gotShowWindow = FALSE;
             /* test style */
-            style = GetWindowLong( parent, GWL_STYLE);
+            style = GetWindowLongA( parent, GWL_STYLE);
             if( resize_testcases[index].flags & OFN_ENABLESIZING)
                 if( !(style & WS_SIZEBOX)) {
                     win_skip( "OFN_ENABLESIZING flag not supported.\n");
                     resizesupported = FALSE;
-                    PostMessage( parent, WM_COMMAND, IDCANCEL, 0);
+                    PostMessageA( parent, WM_COMMAND, IDCANCEL, 0);
                 } else
                     ok( style & WS_SIZEBOX,
                             "testid %d: dialog should have a WS_SIZEBOX style.\n", index);
@@ -514,7 +514,7 @@ todo_wine
                     }
                 }
                 KillTimer( dlg, 0);
-                PostMessage( parent, WM_COMMAND, IDCANCEL, 0);
+                PostMessageA( parent, WM_COMMAND, IDCANCEL, 0);
             }
             count++;
         }
@@ -523,16 +523,16 @@ todo_wine
         {
             WINDOWPOS *pwp = (WINDOWPOS *)lParam;
             if(  !index && pwp->hwndInsertAfter == HWND_BOTTOM){
-                gotSWP_bottom = 1;
-                ok( gotShowWindow == 0, "The WM_WINDOWPOSCHANGING message came after a WM_SHOWWINDOW message\n");
+                gotSWP_bottom = TRUE;
+                ok(!gotShowWindow, "The WM_WINDOWPOSCHANGING message came after a WM_SHOWWINDOW message\n");
             }
         }
         break;
         case WM_SHOWWINDOW:
         {
             if(  !index){
-                gotShowWindow = 1;
-                ok( gotSWP_bottom == 1, "No WM_WINDOWPOSCHANGING message came before a WM_SHOWWINDOW message\n");
+                gotShowWindow = TRUE;
+                ok(gotSWP_bottom, "No WM_WINDOWPOSCHANGING message came before a WM_SHOWWINDOW message\n");
             }
         }
         break;
@@ -542,7 +542,7 @@ todo_wine
 
 static void test_resize(void)
 {
-    OPENFILENAME ofn = { OPENFILENAME_SIZE_VERSION_400 };
+    OPENFILENAMEA ofn = { OPENFILENAME_SIZE_VERSION_400A };
     char filename[1024] = {0};
     DWORD ret;
     int i;
@@ -550,13 +550,13 @@ static void test_resize(void)
     ofn.lpstrFile = filename;
     ofn.nMaxFile = 1024;
     ofn.lpfnHook = resize_template_hook;
-    ofn.hInstance = GetModuleHandle(NULL);
+    ofn.hInstance = GetModuleHandleA(NULL);
     ofn.lpTemplateName = "template_sz";
     for( i = 0; resize_testcases[i].flags != 0xffffffff; i++) {
         ofn.lCustData = i;
         ofn.Flags = resize_testcases[i].flags |
             OFN_ENABLEHOOK | OFN_EXPLORER| OFN_ENABLETEMPLATE | OFN_SHOWHELP ;
-        ret = GetOpenFileName(&ofn);
+        ret = GetOpenFileNameA(&ofn);
         ok(!ret, "GetOpenFileName returned %#x\n", ret);
         ret = CommDlgExtendedError();
         ok(!ret, "CommDlgExtendedError returned %#x\n", ret);
@@ -599,14 +599,14 @@ static UINT_PTR WINAPI test_ok_wndproc(HWND dlg, UINT msg, WPARAM wParam, LPARAM
     static UINT msgFILEOKSTRING;
     if (msg == WM_INITDIALOG)
     {
-        testcase = (ok_wndproc_testcase*)((OPENFILENAME*)lParam)->lCustData;
+        testcase = (ok_wndproc_testcase*)((OPENFILENAMEA*)lParam)->lCustData;
         testcase->actclose = TRUE;
-        msgFILEOKSTRING = RegisterWindowMessageA( FILEOKSTRING);
+        msgFILEOKSTRING = RegisterWindowMessageA( FILEOKSTRINGA);
     }
     if( msg == WM_NOTIFY) {
         if(((LPNMHDR)lParam)->code == CDN_FOLDERCHANGE) {
             SetTimer( dlg, 0, 100, 0);
-            PostMessage( parent, WM_COMMAND, IDOK, 0);
+            PostMessageA( parent, WM_COMMAND, IDOK, 0);
             return FALSE;
         } else if(((LPNMHDR)lParam)->code == CDN_FILEOK) {
             if( testcase->usemsgokstr)
@@ -627,11 +627,11 @@ static UINT_PTR WINAPI test_ok_wndproc(HWND dlg, UINT msg, WPARAM wParam, LPARAM
         /* the dialog did not close automatically */
         testcase->actclose = FALSE;
         KillTimer( dlg, 0);
-        PostMessage( parent, WM_COMMAND, IDCANCEL, 0);
+        PostMessageA( parent, WM_COMMAND, IDCANCEL, 0);
         return FALSE;
     }
     if( testcase && testcase->do_subclass)
-        return DefWindowProc( dlg, msg, wParam, lParam);
+        return DefWindowProcA( dlg, msg, wParam, lParam);
     return FALSE;
 }
 
@@ -644,7 +644,7 @@ static UINT_PTR WINAPI ok_template_hook(HWND dlg, UINT msg, WPARAM wParam, LPARA
 
 static void test_ok(void)
 {
-    OPENFILENAME ofn = { OPENFILENAME_SIZE_VERSION_400 };
+    OPENFILENAMEA ofn = { OPENFILENAME_SIZE_VERSION_400A };
     char filename[1024] = {0};
     char tmpfilename[ MAX_PATH];
     char curdir[MAX_PATH];
@@ -660,7 +660,7 @@ static void test_ok(void)
     }
     ofn.lpstrFile = filename;
     ofn.nMaxFile = 1024;
-    ofn.hInstance = GetModuleHandle(NULL);
+    ofn.hInstance = GetModuleHandleA(NULL);
     ofn.lpTemplateName = "template1";
     ofn.Flags =  OFN_ENABLEHOOK | OFN_EXPLORER| OFN_ENABLETEMPLATE ;
     for( i = 0; ok_testcases[i].retval != -1; i++) {
@@ -725,7 +725,7 @@ static UINT_PTR WINAPI template_hook_arrange(HWND dlgChild, UINT msg, WPARAM wPa
 
     dlgParent = GetParent( dlgChild);
     if (msg == WM_INITDIALOG) {
-        index = ((OPENFILENAME*)lParam)->lCustData;
+        index = ((OPENFILENAMEA*)lParam)->lCustData;
         /* get the positions before rearrangement */
         GetClientRect( dlgParent, &clrcParent);
         GetClientRect( dlgChild, &clrcChild);
@@ -780,7 +780,7 @@ static UINT_PTR WINAPI template_hook_arrange(HWND dlgChild, UINT msg, WPARAM wPa
                 else
                     expectx +=  clrcChild.right - ( rcStc32.right - rcStc32.left) ;
             }
-            style = GetWindowLong( dlgParent, GWL_STYLE);
+            style = GetWindowLongA( dlgParent, GWL_STYLE);
             if( !(style & WS_SIZEBOX)) {
                 /* without the OFN_ENABLESIZING flag */
                 ok( wrcParent.bottom - wrcParent.top == expecty,
@@ -800,7 +800,7 @@ static UINT_PTR WINAPI template_hook_arrange(HWND dlgChild, UINT msg, WPARAM wPa
             }
 
         }
-        PostMessage( dlgParent, WM_COMMAND, IDCANCEL, 0);
+        PostMessageA( dlgParent, WM_COMMAND, IDCANCEL, 0);
     }
     return 0;
 }
@@ -818,8 +818,8 @@ static void test_arrange(void)
     int i;
 
     /* load subdialog template into memory */
-    hRes = FindResource( GetModuleHandle(NULL), "template_stc32", (LPSTR)RT_DIALOG);
-    hDlgTmpl = LoadResource( GetModuleHandle(NULL), hRes );
+    hRes = FindResourceA( GetModuleHandleA(NULL), "template_stc32", (LPSTR)RT_DIALOG);
+    hDlgTmpl = LoadResource( GetModuleHandleA(NULL), hRes );
     /* get pointers to the structures for the dialog and the controls */
     pv = LockResource( hDlgTmpl );
     template = (DLGTEMPLATE*)pv;
@@ -893,7 +893,7 @@ static UINT_PTR CALLBACK path_hook_proc( HWND hDlg, UINT msg, WPARAM wParam, LPA
         nmh = (LPNMHDR) lParam;
         if( nmh->code == CDN_INITDONE)
         {
-            PostMessage( GetParent(hDlg), WM_COMMAND, IDCANCEL, FALSE);
+            PostMessageA( GetParent(hDlg), WM_COMMAND, IDCANCEL, FALSE);
         }
         else if ( nmh->code == CDN_FOLDERCHANGE)
         {
@@ -920,7 +920,7 @@ static void test_getfolderpath(void)
     /* We need to pick a different directory as the other tests because of new
      * Windows 7 behavior.
      */
-    GetSystemDirectory(szInitialDir, MAX_PATH);
+    GetSystemDirectoryA(szInitialDir, MAX_PATH);
     lstrcpyA(SYSDIR, szInitialDir);
 
     ZeroMemory(&ofn, sizeof(ofn));
@@ -936,12 +936,12 @@ static void test_getfolderpath(void)
     ofn.lpstrInitialDir = szInitialDir;
 
     result = GetOpenFileNameA(&ofn);
-    ok(0 == result, "expected 0, got %d\n", result);
+    ok(FALSE == result, "expected FALSE, got %d\n", result);
     ok(0 == CommDlgExtendedError(), "expected 0, got %d\n",
        CommDlgExtendedError());
 
     result = GetSaveFileNameA(&ofn);
-    ok(0 == result, "expected 0, got %d\n", result);
+    ok(FALSE == result, "expected FALSE, got %d\n", result);
     ok(0 == CommDlgExtendedError(), "expected 0, got %d\n",
        CommDlgExtendedError());
 }
@@ -964,7 +964,7 @@ static void test_resizable2(void)
     ofn.hInstance = GetModuleHandleA(NULL);
     ofn.lpTemplateName = "template1";
     ofn.Flags = OFN_EXPLORER;
-#define ISSIZABLE 1
+#define ISSIZABLE TRUE
     ret = GetOpenFileNameA(&ofn);
     ok( ret == ISSIZABLE, "File Dialog should have been sizable\n");
     ret = CommDlgExtendedError();
@@ -975,7 +975,7 @@ static void test_resizable2(void)
     ret = CommDlgExtendedError();
     ok(!ret, "CommDlgExtendedError returned %#x\n", ret);
     ofn.Flags = OFN_EXPLORER | OFN_ENABLETEMPLATEHANDLE;
-    ofn.hInstance = LoadResource( GetModuleHandle(NULL), FindResource( GetModuleHandle(NULL), "template1", (LPSTR)RT_DIALOG));
+    ofn.hInstance = LoadResource( GetModuleHandleA(NULL), FindResourceA( GetModuleHandleA(NULL), "template1", (LPSTR)RT_DIALOG));
     ofn.lpTemplateName = NULL;
     ret = GetOpenFileNameA(&ofn);
     ok( ret != ISSIZABLE, "File Dialog should NOT have been sizable\n");
@@ -992,7 +992,7 @@ static void test_resizable2(void)
 static void test_mru(void)
 {
     ok_wndproc_testcase testcase = {0};
-    OPENFILENAME ofn = { OPENFILENAME_SIZE_VERSION_400 };
+    OPENFILENAMEA ofn = { OPENFILENAME_SIZE_VERSION_400A };
     const char *test_dir_name = "C:\\mru_test";
     const char *test_file_name = "test.txt";
     const char *test_full_path = "C:\\mru_test\\test.txt";
@@ -1002,7 +1002,7 @@ static void test_mru(void)
     ofn.lpstrFile = filename_buf;
     ofn.nMaxFile = sizeof(filename_buf);
     ofn.lpTemplateName = "template1";
-    ofn.hInstance = GetModuleHandle(NULL);
+    ofn.hInstance = GetModuleHandleA(NULL);
     ofn.Flags =  OFN_ENABLEHOOK | OFN_EXPLORER | OFN_ENABLETEMPLATE | OFN_NOCHANGEDIR;
     ofn.lCustData = (LPARAM)&testcase;
     ofn.lpfnHook = test_ok_wndproc;
@@ -1043,19 +1043,19 @@ static UINT_PTR WINAPI test_extension_wndproc(HWND dlg, UINT msg, WPARAM wParam,
     HWND parent = GetParent( dlg);
     if( msg == WM_NOTIFY) {
         SetTimer( dlg, 0, 1000, 0);
-        PostMessage( parent, WM_COMMAND, IDOK, 0);
+        PostMessageA( parent, WM_COMMAND, IDOK, 0);
     }
     if( msg == WM_TIMER) {
         /* the dialog did not close automatically */
         KillTimer( dlg, 0);
-        PostMessage( parent, WM_COMMAND, IDCANCEL, 0);
+        PostMessageA( parent, WM_COMMAND, IDCANCEL, 0);
     }
     return FALSE;
 }
 
 #define ARRAY_SIZE(a) (sizeof(a)/sizeof((a)[0]))
 
-static void test_extension_helper(OPENFILENAME* ofn, const char *filter,
+static void test_extension_helper(OPENFILENAMEA* ofn, const char *filter,
                                   const char *expected_filename)
 {
     char *filename_ptr;
@@ -1078,7 +1078,7 @@ static void test_extension_helper(OPENFILENAME* ofn, const char *filter,
 
 static void test_extension(void)
 {
-    OPENFILENAME ofn = { OPENFILENAME_SIZE_VERSION_400 };
+    OPENFILENAMEA ofn = { OPENFILENAME_SIZE_VERSION_400A };
     char filename[1024] = {0};
     char curdir[MAX_PATH];
     unsigned int i;
@@ -1150,7 +1150,7 @@ static BOOL WINAPI test_null_enum(HWND hwnd, LPARAM lParam)
     CHAR className[20];
     if(GetClassNameA(hwnd, className, sizeof(className)) > 0 && !strcmp("Edit",className))
     {
-        SetWindowText(hwnd, "testfile");
+        SetWindowTextA(hwnd, "testfile");
         return FALSE; /* break window enumeration */
     }
     return TRUE;
@@ -1166,11 +1166,11 @@ static UINT_PTR WINAPI test_null_wndproc(HWND dlg, UINT msg, WPARAM wParam, LPAR
     }
     if( msg == WM_TIMER) {
         if(!wParam)
-            PostMessage( parent, WM_COMMAND, IDOK, 0);
+            PostMessageA( parent, WM_COMMAND, IDOK, 0);
         else {
             /* the dialog did not close automatically */
             KillTimer( dlg, 0);
-            PostMessage( parent, WM_COMMAND, IDCANCEL, 0);
+            PostMessageA( parent, WM_COMMAND, IDCANCEL, 0);
         }
     }
     return FALSE;
index f1c608c..5445d65 100644 (file)
@@ -42,7 +42,7 @@ static LRESULT CALLBACK OwnerWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
     if(msg == ID_FINDMSGSTRING) {
         return handle_findmsg((FINDREPLACEA*)lParam);
     }
-    return DefWindowProc(hwnd, msg, wParam, lParam);
+    return DefWindowProcA(hwnd, msg, wParam, lParam);
 }
 
 static void test_param_check(void)
@@ -133,7 +133,7 @@ static void test_param_check(void)
     CHECK_FINDREPLACE_FAIL(CDERR_FINDRESFAILURE);
     fr.Flags = FR_ENABLETEMPLATEHANDLE;
     CHECK_FINDREPLACE_FAIL(CDERR_NOHINSTANCE);
-    fr.hInstance = GetModuleHandle(NULL);
+    fr.hInstance = GetModuleHandleA(NULL);
 
     /* invalid lpTemplateName (NULL) when Flags has FR_ENABLETEMPLATE */
     fr.Flags = FR_ENABLETEMPLATE;
index c9a1c44..21ea35d 100644 (file)
@@ -52,18 +52,6 @@ static HRESULT (WINAPI * pPrintDlgExW)(LPPRINTDLGEXW);
 static const CHAR emptyA[] = "";
 static const CHAR PrinterPortsA[] = "PrinterPorts";
 
-static const char *debugstr_guid(const GUID *guid)
-{
-    static char buf[50];
-
-    if (!guid) return "(null)";
-    sprintf(buf, "{%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}",
-            guid->Data1, guid->Data2, guid->Data3, guid->Data4[0],
-            guid->Data4[1], guid->Data4[2], guid->Data4[3], guid->Data4[4],
-            guid->Data4[5], guid->Data4[6], guid->Data4[7]);
-    return buf;
-}
-
 /* ########################### */
 
 static void test_PageSetupDlgA(void)
@@ -133,7 +121,7 @@ static UINT_PTR CALLBACK print_hook_proc(HWND hdlg, UINT msg, WPARAM wp, LPARAM
         /* some driver popup a dialog and hung the test or silently limit the number of copies,
            when trying to set more than 999 copies */
         SetDlgItemInt(hdlg, edt3, 123, FALSE);
-        PostMessage(hdlg, WM_COMMAND, IDOK, FALSE);
+        PostMessageA(hdlg, WM_COMMAND, IDOK, FALSE);
     }
     return 0;
 }
@@ -148,7 +136,7 @@ static void test_PrintDlgA(void)
     LPCSTR port;
     CHAR   buffer[MAX_PATH];
     LPSTR  ptr;
-    DEVMODE *dm;
+    DEVMODEA *dm;
 
     pDlg = HeapAlloc(GetProcessHeap(), 0, (sizeof(PRINTDLGA)) * 2);
     if (!pDlg) return;
@@ -232,7 +220,7 @@ static void test_PrintDlgA(void)
         ok( lstrcmpiA(driver, buffer) == 0,
             "got driver '%s' (expected '%s')\n", driver, buffer);
 
-        n_copies = DeviceCapabilities(device, port, DC_COPIES, NULL, NULL);
+        n_copies = DeviceCapabilitiesA(device, port, DC_COPIES, NULL, NULL);
         ok(n_copies > 0, "DeviceCapabilities(DC_COPIES) failed\n");
     }
 
@@ -251,7 +239,7 @@ static void test_PrintDlgA(void)
         pDlg->lStructSize = sizeof(*pDlg);
         pDlg->Flags = PD_ENABLEPRINTHOOK;
         pDlg->lpfnPrintHook = print_hook_proc;
-        res = PrintDlg(pDlg);
+        res = PrintDlgA(pDlg);
         ok(res, "PrintDlg error %#x\n", CommDlgExtendedError());
         /* Version of Microsoft XPS Document Writer driver shipped before Win7
          * reports that it can print multiple copies, but returns 1.
@@ -270,7 +258,7 @@ static void test_PrintDlgA(void)
         pDlg->lStructSize = sizeof(*pDlg);
         pDlg->Flags = PD_ENABLEPRINTHOOK | PD_USEDEVMODECOPIES;
         pDlg->lpfnPrintHook = print_hook_proc;
-        res = PrintDlg(pDlg);
+        res = PrintDlgA(pDlg);
         ok(res, "PrintDlg error %#x\n", CommDlgExtendedError());
         ok(pDlg->nCopies == 1, "expected nCopies 1, got %d\n", pDlg->nCopies);
         ok(pDlg->hDevMode != 0, "hDevMode should not be 0\n");
@@ -289,7 +277,7 @@ static void test_PrintDlgA(void)
 static HRESULT WINAPI callback_QueryInterface(IPrintDialogCallback *iface,
                                               REFIID riid, void **ppv)
 {
-    ok(0, "callback_QueryInterface(%s): unexpected call\n", debugstr_guid(riid));
+    ok(0, "callback_QueryInterface(%s): unexpected call\n", wine_dbgstr_guid(riid));
     return E_NOINTERFACE;
 }
 
@@ -339,7 +327,7 @@ static IPrintDialogCallback callback = { &callback_Vtbl };
 
 static HRESULT WINAPI unknown_QueryInterface(IUnknown *iface, REFIID riid, void **ppv)
 {
-    trace("unknown_QueryInterface %s\n", debugstr_guid(riid));
+    trace("unknown_QueryInterface %s\n", wine_dbgstr_guid(riid));
 
     if (IsEqualGUID(riid, &IID_IPrintDialogCallback))
     {
@@ -352,7 +340,7 @@ static HRESULT WINAPI unknown_QueryInterface(IUnknown *iface, REFIID riid, void
         return E_NOINTERFACE;
     }
 
-    ok(0, "unexpected IID %s\n", debugstr_guid(riid));
+    ok(0, "unexpected IID %s\n", wine_dbgstr_guid(riid));
     *ppv = NULL;
     return E_NOINTERFACE;
 }
@@ -392,7 +380,7 @@ static void test_PrintDlgExW(void)
     }
 
     /* Set CommDlgExtendedError != 0 */
-    PrintDlg(NULL);
+    PrintDlgA(NULL);
     SetLastError(0xdeadbeef);
     res = pPrintDlgExW(NULL);
     ok( (res == E_INVALIDARG),
@@ -406,7 +394,7 @@ static void test_PrintDlgExW(void)
     /* lStructSize must be exact */
     ZeroMemory(pDlg, sizeof(PRINTDLGEXW));
     pDlg->lStructSize = sizeof(PRINTDLGEXW) - 1;
-    PrintDlg(NULL);
+    PrintDlgA(NULL);
     SetLastError(0xdeadbeef);
     res = pPrintDlgExW(pDlg);
     ok( (res == E_INVALIDARG),
@@ -416,7 +404,7 @@ static void test_PrintDlgExW(void)
 
     ZeroMemory(pDlg, sizeof(PRINTDLGEXW));
     pDlg->lStructSize = sizeof(PRINTDLGEXW) + 1;
-    PrintDlg(NULL);
+    PrintDlgA(NULL);
     SetLastError(0xdeadbeef);
     res = pPrintDlgExW(pDlg);
     ok( (res == E_INVALIDARG),