[COMDLG32_WINETEST]
[reactos.git] / rostests / winetests / comdlg32 / printdlg.c
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),