24#define NONAMELESSSTRUCT
25#define NONAMELESSUNION
38#define MAGIC_DEAD 0xdeadbeef
39#define DEFAULT_PRINTER_SIZE 1000
60static const WCHAR cmd_PortIsValidW[] = {
'P',
'o',
'r',
't',
'I',
's',
'V',
'a',
'l',
'i',
'd',0};
97 static int deactivated_spooler_reported = 0;
98 if (!deactivated_spooler_reported)
100 deactivated_spooler_reported = 1;
101 skip(
"The service 'Spooler' is required for many tests\n");
112 static int access_denied_reported = 0;
113 if (!access_denied_reported)
115 access_denied_reported = 1;
116 skip(
"More access rights are required for many tests\n");
134 res = pGetDefaultPrinterA(
buffer, &needed);
144 "Software\\Microsoft\\Windows NT\\CurrentVersion\\Windows",
214 entry = &monitor_table[
i];
250 ok(
res != 0,
"returned %d with %d and %d: '%s' (expected '!= 0')\n",
272 if (
res == 0)
return;
279 if (
res == 0)
return;
284 if (resint == 0)
return;
289 if (resint == 0)
return;
311 "returned %d with %d (expected '0' with ERROR_INVALID_LEVEL)\n",
317 "returned %d with %d (expected '0' with ERROR_INVALID_LEVEL)\n",
327 "returned %d with %d (expected '0' with: MAGIC_DEAD or "
339 "returned %d with %d (expected '0' with: ERROR_INVALID_PARAMETER or "
343 skip(
"No usable Monitor found\n");
369 "returned %d with %d (expected '0' with: ERROR_INVALID_PARAMETER or "
370 "ERROR_PRIVILEGE_NOT_HELD)\n",
380 "returned %d with %d (expected '0' with: ERROR_INVALID_PARAMETER or "
381 "ERROR_PRIVILEGE_NOT_HELD)\n",
388 "returned %d with %d (expected '0' with ERROR_INVALID_PARAMETER)\n",
398 "returned %d with %d (expected '0' with: ERROR_MOD_NOT_FOUND or "
408 "returned %d with %d (expected '0' with: ERROR_PROC_NOT_FOUND or "
418 "returned %d with %d (expected '!= 0' with ERROR_SUCCESS)\n",
res,
GetLastError());
427 "returned %d with %d (expected '0' with: "
428 "ERROR_PRINT_MONITOR_ALREADY_INSTALLED or ERROR_ALREADY_EXISTS)\n",
453 "returned %d with %d (expected '0' with ERROR_NOT_SUPPORTED or "
465 "returned %d with %d (expected '0' with ERROR_NOT_SUPPORTED or "
474 "returned %d with %d (expected '0' with ERROR_NOT_SUPPORTED or "
488 win_skip(
"AddPortEx not supported\n");
503 skip(
"ACCESS_DENIED (ERROR_INVALID_PARAMETER)\n");
512 "got %u with %u (expected '0' with ERROR_INVALID_PARAMETER)\n",
521 "got %u with %u (expected '0' with ERROR_INVALID_PARAMETER)\n",
528 "got %u with %u (expected '0' with ERROR_INVALID_PARAMETER)\n",
535 "got %u with %u (expected '0' with ERROR_INVALID_PARAMETER)\n",
544 "got %u with %u (expected '0' with ERROR_INVALID_PARAMETER)\n",
551 "got %u with %u (expected '0' with ERROR_INVALID_PARAMETER)\n",
568 "got %u with %u (expected '0' with ERROR_INVALID_LEVEL)\n",
577 "got %u with %u (expected '0' with ERROR_INVALID_LEVEL)\n",
583 "got %u with %u (expected '0' with ERROR_INVALID_LEVEL)\n",
605 "returned %d with %d (expected '0' with ERROR_NOT_SUPPORTED or "
616 "returned %d with %d (expected '0' with ERROR_NOT_SUPPORTED or "
625 "returned %d with %d (expected '0' with ERROR_NOT_SUPPORTED or "
665 "got %d with %d (expected FALSE with ERROR_INVALID_HANDLE)\n",
673 "got %d with %d (expected FALSE with ERROR_INVALID_HANDLE)\n",
692 "got %d with %d (expected FALSE with ERROR_INVALID_HANDLE)\n",
710 skip(
"No usable Monitor found\n");
732 "returned %d with %d (expected '0' with: ERROR_UNKNOWN_PRINT_MONITOR"
760 "returned %d with %d (expected '0' with: ERROR_INVALID_PARAMETER or "
770 "returned %d with %d (expected '0' with: ERROR_INVALID_PARAMETER or "
800 "returned %d with %d (expected '0' with ERROR_NOT_SUPPORTED or "
809 "returned %d with %d (expected '0' with ERROR_NOT_SUPPORTED or "
826 const char *formtype;
827 static const char *
const formtypes[] = {
"FORM_USER",
"FORM_BUILTIN",
"FORM_PRINTER",
"FORM_flag_unknown" };
828#define FORMTYPE_MAX 2
834 if (!
res || !hprinter)
837 if (
pName)
skip(
"Failed to open '%s' (not supported on win9x)\n",
pName);
844 pcReturned = 0xdeadbeef;
860 (
res && (pcReturned == 0)),
861 "(%d) returned %d with %d and 0x%08x (expected '0' with "
862 "ERROR_INVALID_LEVEL or '!=0' and 0x0)\n",
868 "(%d) returned %d with %d (expected '0' with "
876 ok(
res,
"(%d) returned %d with %d (expected '!=0')\n",
880 trace(
"dumping %d forms level %d\n", pcReturned,
level);
883 for (
i = 0;
i < pcReturned;
i++)
887 trace(
"%u (%s): %.03fmm x %.03fmm, %s\n",
i, pFI_1a->
pName,
890 if (
level == 1) pFI_1a ++;
893 trace(
"\tkeyword=%s strtype=%u muidll=%s resid=%u dispname=%s langid=%u\n",
906 ok(
res,
"(%d) returned %d with %d (expected '!=0')\n",
912 "(%d) returned %d with %d (expected '0' with "
919 "(%d) returned %d with %d (expected '0' with "
926 "(%d) returned %d with %d (expected '0' with "
932 "(%d) returned %d with %d (expected '0' with "
938 "(%d) returned %d with %d (expected '0' with "
972 (
res && (pcReturned == 0)),
973 "(%d) returned %d with %d and 0x%08x (expected '0' with "
974 "ERROR_INVALID_LEVEL or '!=0' and 0x0)\n",
986 "(%d) returned %d with %d (expected '0' with "
990 skip(
"no valid buffer size returned\n");
1000 ok(
res,
"(%d) returned %d with %d (expected '!=0')\n",
1002 ok(
pcbNeeded == cbBuf,
"(%d) returned %d (expected %d)\n",
1011 ok(
res,
"(%d) returned %d with %d (expected '!=0')\n",
level,
1020 "(%d) returned %d with %d (expected '0' with "
1040 "(%d) returned %d with %d (expected '!=0' or '0' with "
1048 "(%d) returned %d with %d (expected '!=0' or '0' with "
1070 pcReturned = 0xdeadbeef;
1079 (
res && (pcReturned == 0)),
1080 "(%d) returned %d with %d and 0x%08x (expected '0' with "
1081 "ERROR_INVALID_LEVEL or '!=0' and 0x0)\n",
1089 skip(
"Level %d not supported\n",
level);
1094 "(%d) returned %d with %d (expected '0' with "
1108 pcReturned = 0xdeadbeef;
1118 "(%d) returned %d with %d (expected '0' with "
1135 "(%d) returned %d with %d (expected '0' with "
1136 "RPC_X_NULL_REF_POINTER or '!=0' with NO_ERROR)\n",
1145 "(%d) returned %d with %d (expected '0' with "
1146 "RPC_X_NULL_REF_POINTER or '!=0' with NO_ERROR)\n",
1157 static char env_all[] =
"all";
1169 pcReturned = 0xdeadbeef;
1178 (
res && (pcReturned == 0)),
1179 "(%d) got %u with %u and 0x%x "
1180 "(expected '0' with ERROR_INVALID_LEVEL or '!=0' and 0x0)\n",
1187 skip(
"Level %d not supported\n",
level);
1193 "(%u) got %u with %u for %s (expected '0' with "
1194 "ERROR_INSUFFICIENT_BUFFER or '!= 0' without a printer)\n",
1198 skip(
"no valid buffer size returned\n");
1203 if (pEnumPrinterDriversW)
1205 DWORD double_needed;
1206 DWORD double_returned;
1207 pEnumPrinterDriversW(
NULL,
NULL,
level,
NULL, 0, &double_needed, &double_returned);
1208 ok(double_needed == cbBuf,
"level %d: EnumPrinterDriversA returned different size %d than EnumPrinterDriversW (%d)\n",
level, cbBuf, double_needed);
1225 "(%u) got %s for %s (expected a full path)\n",
1231 pcReturned = 0xdeadbeef;
1241 "(%u) got %u with %u (expected '0' with ERROR_INSUFFICIENT_BUFFER)\n",
1255 pcReturned = 0xdeadbeef;
1258 "(%u) got %u with %u (expected '!=0' or '0' with "
1262 pcReturned = 0xdeadbeef;
1266 "(%u) got %u with %u (expected '!=0' or '0' with "
1278 skip(
"no printer drivers found\n");
1283 win_skip(
"NT4 and below don't support the 'all' environment value\n");
1291 if (
res && pcReturned > 0)
1296 "Driver Information not in sequence; pName %p, top of data %p\n",
1297 di_1->
pName, di_1 + pcReturned);
1315 pcReturned = 0xdeadbeef;
1320 if (
res && !cbBuf) {
1321 skip(
"No Printprocessor installed\n");
1326 "got %u with %u (expected '0' with ERROR_INSUFFICIENT_BUFFER)\n",
1341 pcReturned = 0xdeadbeef;
1350 "got %u with %u (expected '0' with ERROR_INSUFFICIENT_BUFFER)\n",
1358 pcReturned = 0xdeadbeef;
1361 "got %u with %u (expected '0' with ERROR_INVALID_LEVEL)\n",
1368 "got %u with %u (expected '0' with ERROR_INVALID_LEVEL)\n",
1386 "got %u with %u (expected '0' with ERROR_INVALID_ENVIRONMENT or "
1393 pcReturned = 0xdeadbeef;
1397 "got %u with %u (expected '0' with ERROR_INVALID_USER_BUFFER)\n",
1403 pcReturned = 0xdeadbeef;
1407 "got %u with %u (expected '0' with RPC_X_NULL_REF_POINTER)\n",
1411 pcReturned = 0xdeadbeef;
1416 "got %u with %u (expected '0' with RPC_X_NULL_REF_POINTER)\n",
1432 if (!pGetDefaultPrinterA)
return;
1436 retval = pGetDefaultPrinterA(
buffer, &exact);
1437 if (!retval || !exact || !*
buffer ||
1441 trace(
"this test requires a default printer to be set\n");
1443 ok( 0,
"function call GetDefaultPrinterA failed unexpected!\n"
1444 "function returned %s\n"
1445 "last error 0x%08x\n"
1446 "returned buffer size 0x%08x\n"
1447 "returned buffer content %s\n",
1453 retval = pGetDefaultPrinterA(
NULL,
NULL);
1454 ok( !retval,
"function result wrong! False expected\n");
1456 "Last error wrong! ERROR_INVALID_PARAMETER expected, got 0x%08x\n",
1461 ok( !retval,
"function result wrong! False expected\n");
1463 "Last error wrong! ERROR_INVALID_PARAMETER expected, got 0x%08x\n",
1468 retval = pGetDefaultPrinterA(
NULL, &
size);
1469 ok( !retval,
"function result wrong! False expected\n");
1471 "Last error wrong! ERROR_INSUFFICIENT_BUFFER expected, got 0x%08x\n",
1473 ok(
size == exact,
"Parameter size wrong! %d expected got %d\n",
1478 retval = pGetDefaultPrinterA(
NULL, &
size);
1479 ok( !retval,
"function result wrong! False expected\n");
1481 "Last error wrong! ERROR_INSUFFICIENT_BUFFER expected, got 0x%08x\n",
1483 ok(
size == exact,
"Parameter size wrong! %d expected got %d\n",
1488 ok( !retval,
"function result wrong! False expected\n");
1490 "Last error wrong! ERROR_INSUFFICIENT_BUFFER expected, got 0x%08x\n",
1492 ok(
size == exact,
"Parameter size wrong! %d expected got %d\n",
1497 ok( retval,
"function result wrong! True expected\n");
1498 ok(
size == exact,
"Parameter size wrong! %d expected got %d\n",
1513 trace(
"first call returned 0x%04x, with %d: buffer size 0x%08x\n",
1517 "returned %d with lasterror=%d (expected '0' with "
1521 skip(
"no valid buffer size returned\n");
1529 ok(
res,
"expected result != 0, got %d\n",
res);
1530 ok( cbBuf ==
pcbNeeded,
"pcbNeeded set to %d instead of %d\n",
1534 ok(
res,
"expected result != 0, got %d\n",
res);
1535 ok( cbBuf ==
pcbNeeded,
"pcbNeeded set to %d instead of %d\n",
1540 ok( !
res ,
"expected result == 0, got %d\n",
res);
1541 ok( cbBuf ==
pcbNeeded,
"pcbNeeded set to %d instead of %d\n",
1545 "last error set to %d instead of ERROR_INSUFFICIENT_BUFFER\n",
1565 "returned %d with %d (expected '!=0' or '0' with RPC_X_NULL_REF_POINTER "
1574 "returned %d with %d (expected '!=0' or '0' with RPC_X_NULL_REF_POINTER "
1590 "returned %d with lasterror=%d (expected '0' with "
1612 "lasterror=%d and len=%d (expected '1' with 'len > 0')\n",
1634 "returned %d with lasterror=%d and len=%d (expected '!= 0' with "
1635 "'len > 0' or '0' with ERROR_INVALID_ENVIRONMENT)\n",
1669 "returned %d with %d (expected '0' with ERROR_INSUFFICIENT_BUFFER)\n",
1690 "returned %d with %d (expected '0' with ERROR_INSUFFICIENT_BUFFER)\n",
1703 "returned %d with %d (expected '0' with ERROR_INVALID_USER_BUFFER)\n",
1714 "returned %d with %d (expected '0' with RPC_X_NULL_REF_POINTER "
1724 "returned %d with %d (expected '0' with RPC_X_NULL_REF_POINTER "
1734 "returned %d with %d (expected '0' with ERROR_INVALID_LEVEL)\n",
1743 "returned %d with %d (expected '0' with ERROR_INVALID_LEVEL)\n",
1764 "returned %d with %d (expected '!= 0' or '0' with "
1772 "returned %d with %d (expected '0' with ERROR_INVALID_ENVIRONMENT)\n",
1785 ok( !
res,
"expected failure\n");
1807 "returned %d with %d (expected '0' with ERROR_INVALID_PARAMETER)\n",
1817 "returned %d with %d (expected '!=0' or '0' with ERROR_INVALID_PARAMETER)\n",
1838 "returned %d with %d (expected '0' with ERROR_ACCESS_DENIED)\n",
1847 hprinter = (
HANDLE) 0xdeadbeef;
1851 "returned %d with %d (expected '!=0' or '0' with ERROR_INVALID_PARAMETER)\n",
1862 "returned %d with %d (expected '0' with: ERROR_INVALID_PARAMETER or"
1873 "returned %d with %d (expected '0' with: ERROR_INVALID_PRINTER_NAME"
1896 "returned %d with %d (expected '!=0' or '0' with "
1907 "returned %d with %d (expected '!=0' or '0' with "
1920 "returned %d with %d (expected '!=0' or '0' with: "
1921 "ERROR_INVALID_DATATYPE or ERROR_ACCESS_DENIED)\n",
1933 "returned %d with %d (expected '!=0' or '0' with "
1943 "returned %d with %d (expected '!=0' or '0' with "
1960 skip(
"There is no default printer installed\n");
1964 if (!pSetDefaultPrinterA)
return;
1968 org_value[0] =
'\0';
1975 res = pSetDefaultPrinterA(
"no_printer_with_this_name");
1980 trace(
"SetDefaultPrinterA() not implemented yet.\n");
1985 "returned %d with %d (expected '0' with "
1990 res = pSetDefaultPrinterA(
"");
1992 "returned %d with %d (expected '!=0' or '0' with "
1997 res = pSetDefaultPrinterA(
NULL);
1999 "returned %d with %d (expected '!=0' or '0' with "
2006 "returned %d with %d (expected '!=0' or '0' with "
2013 res = pSetDefaultPrinterA(
"no_printer_with_this_name");
2016 "returned %d with %d (expected '0' with "
2021 res = pSetDefaultPrinterA(
"");
2023 goto restore_old_printer;
2027 "returned %d with %d (expected '!=0' or '0' with "
2032 res = pSetDefaultPrinterA(
NULL);
2035 "returned %d with %d (expected '!=0' or '0' with "
2042 "returned %d with %d (expected '!=0' or '0' with "
2072 if (pXcvDataW ==
NULL)
return;
2088 needed = (
DWORD) 0xdeadbeef;
2093 "returned %d with %u and %u for status %u (expected '!= 0' and "
2094 "'<= MAX_PATH' for status ERROR_INSUFFICIENT_BUFFER)\n",
2099 skip(
"buffer overflow (%u)\n", needed);
2105 needed = (
DWORD) 0xdeadbeef;
2110 "returned %d with %u and %u for status %u (expected '!= 0' with "
2113 needed = (
DWORD) 0xdeadbeef;
2118 "returned %d with %u and %u for status %u (expected '0' with "
2122 needed = (
DWORD) 0xdeadbeef;
2127 "returned %d with %u and %u for status %u (expected '0' with "
2130 needed = (
DWORD) 0xdeadbeef;
2135 "returned %d with %u and %u for status %u (expected '0' with "
2138 needed = (
DWORD) 0xdeadbeef;
2143 "returned %d with %u and %u for status %u (expected '0' with "
2147 needed = (
DWORD) 0xdeadbeef;
2152 "returned %d with %u and %u for status %u (expected '!= 0' for status "
2157 needed = (
DWORD) 0xdeadbeef;
2162 "returned %d with %u and %u for status %u (expected '!= 0' for status "
2168 needed = (
DWORD) 0xdeadbeef;
2173 "returned %d with %u and %u for status %u (expected '!= 0' for status "
2190 if (pXcvDataW ==
NULL)
return;
2207 needed = (
DWORD) 0xdeadbeef;
2212 "returned %d with %u and %u for status %u (expected '!= 0' with ERROR_INVALID_PARAMETER)\n",
2216 needed = (
DWORD) 0xdeadbeef;
2221 "returned %d with %u and %u for status %u (expected '!= 0' for status: "
2222 "ERROR_FILE_NOT_FOUND or ERROR_PATH_NOT_FOUND)\n",
2226 needed = (
DWORD) 0xdeadbeef;
2232 "returned %d with %u and %u for status %u (expected '!= 0' for status: "
2233 "ERROR_PATH_NOT_FOUND or ERROR_ACCESS_DENIED)\n",
2237 needed = (
DWORD) 0xdeadbeef;
2242 "returned %d with %u and %u for status %u (expected '!= 0' for ERROR_SUCCESS)\n",
2245 needed = (
DWORD) 0xdeadbeef;
2250 "returned %d with %u and %u for status %u (expected '!= 0' for ERROR_SUCCESS)\n",
2253 needed = (
DWORD) 0xdeadbeef;
2258 "returned %d with %u and %u for status %u (expected '!= 0' for ERROR_SUCCESS)\n",
2261 needed = (
DWORD) 0xdeadbeef;
2266 "returned %d with %u and %u for status %u (expected '!= 0' for ERROR_SUCCESS)\n",
2269 needed = (
DWORD) 0xdeadbeef;
2274 "returned %d with %u and %u for status %u (expected '!= 0' with ERROR_SUCCESS)\n",
2279 needed = (
DWORD) 0xdeadbeef;
2284 "returned %d with %u and %u for status %u (expected '!= 0' with ERROR_SUCCESS)\n",
2298 DWORD needed, filled;
2302 skip(
"There is no default printer installed\n");
2313 ok(hprn != 0,
"wrong hprn %p\n", hprn);
2322 win_skip(
"Level %d is not supported on Win9x/WinMe\n",
level);
2324 ok(needed == 0,
"Expected 0, got %d\n", needed);
2327 ok(!
ret,
"level %d: GetPrinter should fail\n",
level);
2332 skip(
"Level %d not supported\n",
level);
2336 ok(needed > 0,
"not expected needed buffer size %d\n", needed);
2341 DWORD double_needed;
2342 ret = pGetPrinterW(hprn,
level,
NULL, 0, &double_needed);
2344 ok(double_needed == needed,
"level %d: GetPrinterA returned different size %d than GetPrinterW (%d)\n",
level, needed, double_needed);
2353 ok(needed == filled,
"needed %d != filled %d\n", needed, filled);
2397 needed = 0xdeadbeef;
2404 "got %d, type %d, needed: %d and '%s' (expected ERROR_SUCCESS, REG_SZ and %d)\n",
2407 needed = 0xdeadbeef;
2411 "got %d, needed: %d (expected ERROR_MORE_DATA and %d)\n",
res, needed,
len);
2432 if (!pGetPrinterDataExA) {
2433 win_skip(
"GetPrinterDataEx not found\n");
2451 needed = 0xdeadbeef;
2459 "got %d, type %d, needed: %d and '%s' (expected ERROR_SUCCESS, REG_SZ and %d)\n",
2465 needed = 0xdeadbeef;
2471 "got %d, type %d, needed: %d and '%s' (expected ERROR_SUCCESS, REG_SZ and %d)\n",
2477 needed = 0xdeadbeef;
2484 "got %d, type %d, needed: %d and '%s' (expected ERROR_SUCCESS, REG_SZ and %d)\n",
2491 needed = 0xdeadbeef;
2497 "got %d, type %d, needed: %d and '%s' (expected ERROR_SUCCESS, REG_SZ and %d)\n",
2500 needed = 0xdeadbeef;
2506 ((needed ==
len) || (needed == (
len *
sizeof(
WCHAR)))),
2507 "got %d, needed: %d (expected ERROR_MORE_DATA and %d)\n",
res, needed,
len);
2509 needed = 0xdeadbeef;
2513 ((needed ==
len) || (needed == (
len *
sizeof(
WCHAR)))),
2514 "got %d, needed: %d (expected ERROR_MORE_DATA and %d)\n",
res, needed,
len);
2529 DWORD needed, filled;
2533 skip(
"There is no default printer installed\n");
2544 ok(hprn != 0,
"wrong hprn %p\n", hprn);
2551 ok(!
ret,
"level %d: GetPrinterDriver should fail\n",
level);
2557 ok(needed > 0,
"not expected needed buffer size %d\n", needed);
2564 "%d: returned %d with %d (expected '0' with: "
2565 "ERROR_INVALID_LEVEL or ERROR_OUTOFMEMORY)\n",
2573 if (!
ret && pGetPrinterDriverW)
2575 DWORD double_needed;
2578 ok(double_needed == needed,
"GetPrinterDriverA returned different size %d than GetPrinterDriverW (%d)\n", needed, double_needed);
2587 ok(needed == filled,
"needed %d != filled %d\n", needed, filled);
2592 DWORD calculated =
sizeof(*di_2);
2599 ok(di_2->
pName !=
NULL,
"not expected NULL ptr\n");
2635 ok(filled >= calculated,
"calculated %d != filled %d\n", calculated, filled);
2639 ok(!
ret,
"level %d: GetPrinterDriver succeeded with less buffer than it should\n",
level);
2642 "Even on failure, GetPrinterDriver clears the buffer to zeros\n");
2662 "expected '%s', got '%s'\n", exp_prn_name, dm->
dmDeviceName);
2678 skip(
"There is no default printer installed\n");
2689 ok(hprn != 0,
"wrong hprn %p\n", hprn);
2692 trace(
"DEVMODEA required size %d\n", dm_size);
2693 ok(dm_size >=
sizeof(
DEVMODEA),
"unexpected DocumentPropertiesA ret value %d\n", dm_size);
2698 ok(
ret ==
IDOK,
"DocumentPropertiesA ret value %d != expected IDOK\n",
ret);
2701 ok(
ret ==
IDOK,
"DocumentPropertiesA ret value %d != expected IDOK\n",
ret);
2725 ok(neededA > 0,
"Expected neededA to show the number of needed bytes\n");
2731 ok(neededA == 0,
"Expected neededA to be zero\n");
2741 win_skip(
"EnumPrintersW is not implemented\n");
2749 ok(neededW > 0,
"Expected neededW to show the number of needed bytes\n");
2755 ok(neededW == 0,
"Expected neededW to be zero\n");
2761 ok(neededA == neededW,
"neededA %d neededW %d\n", neededA, neededW);
2779 INT n_papers, n_paper_size, n_paper_names, n_copies,
ret;
2787 memset(&prn_dlg, 0,
sizeof(prn_dlg));
2790 ret = pPrintDlgA(&prn_dlg);
2794 skip(
"PrintDlg returned no default printer\n");
2797 ok(prn_dlg.
hDevMode != 0,
"PrintDlg returned hDevMode == NULL\n");
2798 ok(prn_dlg.
hDevNames != 0,
"PrintDlg returned hDevNames == NULL\n");
2801 ok(dm !=
NULL,
"GlobalLock(prn_dlg.hDevMode) failed\n");
2805 ok(dn !=
NULL,
"GlobalLock(prn_dlg.hDevNames) failed\n");
2818 ok(n_papers > 0,
"DeviceCapabilitiesA DC_PAPERS failed\n");
2821 ok(
ret == n_papers,
"expected %d, got %d\n", n_papers,
ret);
2829 ok(n_paper_size > 0,
"DeviceCapabilitiesA DC_PAPERSIZE failed\n");
2830 ok(n_paper_size == n_papers,
"n_paper_size %d != n_papers %d\n", n_paper_size, n_papers);
2833 ok(
ret == n_paper_size,
"expected %d, got %d\n", n_paper_size,
ret);
2835 for (
ret = 0;
ret < n_paper_size;
ret++)
2836 trace(
"paper_size[%d] = %d x %d\n",
ret, paper_size[
ret].
x, paper_size[
ret].
y);
2841 ok(n_paper_names > 0,
"DeviceCapabilitiesA DC_PAPERNAMES failed\n");
2842 ok(n_paper_names == n_papers,
"n_paper_names %d != n_papers %d\n", n_paper_names, n_papers);
2845 ok(
ret == n_paper_names,
"expected %d, got %d\n", n_paper_names,
ret);
2847 for (
ret = 0;
ret < n_paper_names;
ret++)
2853 ok(n_copies > 0,
"DeviceCapabilitiesA DC_COPIES failed\n");
2854 trace(
"n_copies = %d\n", n_copies);
2860 ok(
ret != -1,
"DeviceCapabilitiesA DC_MAXEXTENT failed\n");
2865 ok(
ret != -1,
"DeviceCapabilitiesA DC_MINEXTENT failed\n");
2871 ok(
fields != (
DWORD)-1,
"DeviceCapabilitiesA DC_FIELDS failed\n");
2897 skip(
"There is no default printer installed\n");
2916 default_size =
pi->pDevMode->u1.s1.dmPaperSize;
2925 win_skip(
"AddJob is not supported on this platform\n" );
2944 ok(
job_info->pDevMode->u1.s1.dmPaperSize == default_size,
"got %d default %d\n",
2945 job_info->pDevMode->u1.s1.dmPaperSize, default_size );
2954 memset( &my_dm, 0,
sizeof(my_dm) );
2955 my_dm.
dmSize =
sizeof(my_dm);
2972 ok(
pi->pDevMode->u1.s1.dmPaperSize == default_size,
"got %d default %d\n",
2973 pi->pDevMode->u1.s1.dmPaperSize, default_size );
2993 "got %d new size %d\n",
3038 memset(&dm, 0,
sizeof(dm));
ACPI_SIZE strlen(const char *String)
int strncmp(const char *String1, const char *String2, ACPI_SIZE Count)
char * strchr(const char *String, int ch)
static const TCHAR empty_str[]
#define RegCloseKey(hKey)
#define ERROR_INSUFFICIENT_BUFFER
LONG WINAPI RegOpenKeyExA(_In_ HKEY hKey, _In_ LPCSTR lpSubKey, _In_ DWORD ulOptions, _In_ REGSAM samDesired, _Out_ PHKEY phkResult)
LONG WINAPI RegQueryValueExA(_In_ HKEY hkeyorg, _In_ LPCSTR name, _In_ LPDWORD reserved, _Out_opt_ LPDWORD type, _Out_opt_ LPBYTE data, _Inout_opt_ LPDWORD count)
#define ERROR_CALL_NOT_IMPLEMENTED
#define ERROR_INVALID_PARAMETER
#define ERROR_MOD_NOT_FOUND
#define GetProcAddress(x, y)
#define INVALID_HANDLE_VALUE
#define CreateFileA(a, b, c, d, e, f, g)
#define ERROR_NOT_SUPPORTED
#define HeapFree(x, y, z)
#define ERROR_INVALID_HANDLE
#define FILE_ATTRIBUTE_NORMAL
#define MultiByteToWideChar
#define ERROR_ACCESS_DENIED
#define ERROR_INVALID_NAME
static const WCHAR *const ext[]
BOOL WINAPI DeleteFileA(IN LPCSTR lpFileName)
HINSTANCE WINAPI DECLSPEC_HOTPATCH LoadLibraryA(LPCSTR lpLibFileName)
DWORD WINAPI GetTempPathA(IN DWORD nBufferLength, OUT LPSTR lpBuffer)
BOOL WINAPI WriteProfileStringA(LPCSTR section, LPCSTR entry, LPCSTR string)
INT WINAPI GetProfileStringA(LPCSTR section, LPCSTR entry, LPCSTR def_val, LPSTR buffer, UINT len)
int WINAPI lstrcmpA(LPCSTR str1, LPCSTR str2)
UINT WINAPI GetTempFileNameA(IN LPCSTR lpPathName, IN LPCSTR lpPrefixString, IN UINT uUnique, OUT LPSTR lpTempFileName)
GLint GLint GLint GLint GLint x
GLuint GLuint GLsizei GLenum type
GLint GLint GLint GLint GLint GLint y
GLenum GLuint GLenum GLsizei const GLchar * buf
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
LPVOID NTAPI GlobalLock(HGLOBAL hMem)
HGLOBAL NTAPI GlobalFree(HGLOBAL hMem)
BOOL NTAPI GlobalUnlock(HGLOBAL hMem)
static const WCHAR emptyW[]
int WINAPI lstrlenA(LPCSTR lpString)
#define ERROR_ALREADY_EXISTS
#define ERROR_FILE_NOT_FOUND
static const ASMPROP_RES defaults[ASM_NAME_MAX_PARAMS]
static const void void SIZE_T *static SIZE_T *static const OBJECT_ATTRIBUTES const LARGE_INTEGER HANDLE
static float(__cdecl *square_half_float)(float x
static CHAR version_dll[]
static CHAR invalid_env[]
static void test_EnumPrintProcessors(void)
static void find_local_server(VOID)
static void test_GetPrintProcessorDirectory(void)
#define DEFAULT_PRINTER_SIZE
static void test_ConfigurePort(void)
static struct monitor_entry * find_installed_monitor(void)
static void test_EnumPrinters(void)
static CHAR does_not_exist[]
static void test_XcvDataW_MonitorUI(void)
static void test_DocumentProperties(void)
static void test_DEVMODEA(const DEVMODEA *dm, LONG dmSize, LPCSTR exp_prn_name)
static void test_AddMonitor(void)
static void test_OpenPrinter_defaults(void)
static void test_DeleteMonitor(void)
static CHAR illegal_name[]
static void test_XcvDataW_PortIsValid(void)
static CHAR portname_file[]
static void test_GetPrinterDataEx(void)
static WCHAR portname_lpt1W[]
static CHAR defaultspooldirectory[]
static void test_SetDefaultPrinter(void)
static BOOL is_spooler_deactivated(DWORD res, DWORD lasterror)
static LPSTR default_printer
static void test_AddPort(void)
static void find_tempfile(VOID)
static CHAR server_does_not_exist[]
static const WCHAR cmd_PortIsValidW[]
static CHAR does_not_exist_dll[]
static void test_AddPortEx(void)
static void test_GetPrinter(void)
static void test_GetPrinterData(void)
static CHAR env_win9x_case[]
static CHAR xcv_localport[]
static void test_EnumMonitors(void)
static WCHAR portname_com2W[]
static void test_EnumForms(LPSTR pName)
static void test_GetDefaultPrinter(void)
static WCHAR portname_lpt2W[]
static CHAR portname_lpt1[]
static void find_default_printer(VOID)
static WCHAR portname_com1W[]
static const WCHAR cmd_MonitorUIW[]
static void test_DeviceCapabilities(void)
static BOOL is_access_denied(DWORD res, DWORD lasterror)
static void test_GetPrinterDriver(void)
static WCHAR portname_fileW[]
static void test_IsValidDevmodeW(void)
static void test_GetPrinterDriverDirectory(void)
static void test_DeletePort(void)