--- dlls/winspool.drv/tests/info.c | 31 +++++++++++++++++++++++++++++++ 1 files changed, 31 insertions(+), 0 deletions(-) diff --git a/dlls/winspool.drv/tests/info.c b/dlls/winspool.drv/tests/info.c index da4fc38..6ea6cc6 100644 --- a/dlls/winspool.drv/tests/info.c +++ b/dlls/winspool.drv/tests/info.c @@ -2733,6 +2733,36 @@ static void test_EnumPrinters(void) ok(neededA == neededW, "neededA %d neededW %d\n", neededA, neededW); } +static void test_AbortPrinter(void) +{ + DWORD res; + HANDLE hprn; + + SetLastError(MAGIC_DEAD); + res = AbortPrinter(NULL); + ok(!res && (GetLastError() == ERROR_INVALID_HANDLE), + "returned %d with %d (expected '0' with ERROR_INVALID_HANDLE)\n", + res, GetLastError()); + + if(default_printer) + { + res = OpenPrinter(default_printer, &hprn, NULL); + if (!res) + { + skip("Unable to open the default printer (%s)\n", default_printer); + return; + } + + SetLastError(MAGIC_DEAD); + res = AbortPrinter(hprn); + ok(!res && (GetLastError() == ERROR_SPL_NO_STARTDOC), + "returned %d with %d (expected '0' with ERROR_SPL_NO_STARTDOC)\n", + res, GetLastError()); + + ClosePrinter(hprn); + } +} + static void test_DeviceCapabilities(void) { HANDLE hComdlg32; @@ -2898,6 +2928,7 @@ START_TEST(info) test_SetDefaultPrinter(); test_XcvDataW_MonitorUI(); test_XcvDataW_PortIsValid(); + test_AbortPrinter(); /* Cleanup our temporary file */ DeleteFileA(tempfileA); -- 1.7.4.3