mirror of
https://github.com/reactos/reactos.git
synced 2025-01-09 15:51:16 +00:00
[LOCALSPL_APITEST]
Disable fpGetPrintProcessorDirectory tests that use PSEH. For some reason, they can only be run once and corrupt something inside spoolsv, so that spoolsv needs to be restarted afterwards. svn path=/trunk/; revision=73539
This commit is contained in:
parent
12796f8786
commit
4536560a1d
1 changed files with 8 additions and 2 deletions
|
@ -2,7 +2,7 @@
|
||||||
* PROJECT: ReactOS Local Spooler API Tests Injected DLL
|
* PROJECT: ReactOS Local Spooler API Tests Injected DLL
|
||||||
* LICENSE: GNU GPLv2 or any later version as published by the Free Software Foundation
|
* LICENSE: GNU GPLv2 or any later version as published by the Free Software Foundation
|
||||||
* PURPOSE: Tests for fpGetPrintProcessorDirectory
|
* PURPOSE: Tests for fpGetPrintProcessorDirectory
|
||||||
* COPYRIGHT: Copyright 2016 Colin Finck <colin@reactos.org>
|
* COPYRIGHT: Copyright 2016-2017 Colin Finck <colin@reactos.org>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <apitest.h>
|
#include <apitest.h>
|
||||||
|
@ -26,7 +26,7 @@ START_TEST(fpGetPrintProcessorDirectory)
|
||||||
{
|
{
|
||||||
DWORD cbNeeded;
|
DWORD cbNeeded;
|
||||||
DWORD cbTemp;
|
DWORD cbTemp;
|
||||||
DWORD dwReturned;
|
//DWORD dwReturned;
|
||||||
PGetPrintProcessorDirectoryW pGetPrintProcessorDirectoryW;
|
PGetPrintProcessorDirectoryW pGetPrintProcessorDirectoryW;
|
||||||
PRINTPROVIDOR pp;
|
PRINTPROVIDOR pp;
|
||||||
PWSTR pwszBuffer;
|
PWSTR pwszBuffer;
|
||||||
|
@ -48,6 +48,8 @@ START_TEST(fpGetPrintProcessorDirectory)
|
||||||
ok(!pp.fpGetPrintProcessorDirectory(NULL, L"invalid", 0, NULL, 0, NULL), "fpGetPrintProcessorDirectory returns TRUE!\n");
|
ok(!pp.fpGetPrintProcessorDirectory(NULL, L"invalid", 0, NULL, 0, NULL), "fpGetPrintProcessorDirectory returns TRUE!\n");
|
||||||
ok(GetLastError() == ERROR_INVALID_ENVIRONMENT, "fpGetPrintProcessorDirectory returns error %lu!\n", GetLastError());
|
ok(GetLastError() == ERROR_INVALID_ENVIRONMENT, "fpGetPrintProcessorDirectory returns error %lu!\n", GetLastError());
|
||||||
|
|
||||||
|
// This test corrupts something inside spoolsv so that it's only runnable once without restarting spoolsv. Therefore it's disabled.
|
||||||
|
#if 0
|
||||||
// Now provide a valid environment and prove that it is checked case-insensitively.
|
// Now provide a valid environment and prove that it is checked case-insensitively.
|
||||||
// In contrast to GetPrintProcessorDirectoryW, the level isn't the next thing checked here, but fpGetPrintProcessorDirectory
|
// In contrast to GetPrintProcessorDirectoryW, the level isn't the next thing checked here, but fpGetPrintProcessorDirectory
|
||||||
// already tries to access the non-supplied pcbNeeded variable.
|
// already tries to access the non-supplied pcbNeeded variable.
|
||||||
|
@ -63,6 +65,7 @@ START_TEST(fpGetPrintProcessorDirectory)
|
||||||
_SEH2_END;
|
_SEH2_END;
|
||||||
|
|
||||||
ok(dwReturned == EXCEPTION_ACCESS_VIOLATION, "dwReturned is %lu!\n", dwReturned);
|
ok(dwReturned == EXCEPTION_ACCESS_VIOLATION, "dwReturned is %lu!\n", dwReturned);
|
||||||
|
#endif
|
||||||
|
|
||||||
// fpGetPrintProcessorDirectory doesn't care about the supplied level at all. Prove this here.
|
// fpGetPrintProcessorDirectory doesn't care about the supplied level at all. Prove this here.
|
||||||
// With no buffer given, this needs to fail with ERROR_INSUFFICIENT_BUFFER.
|
// With no buffer given, this needs to fail with ERROR_INSUFFICIENT_BUFFER.
|
||||||
|
@ -72,6 +75,8 @@ START_TEST(fpGetPrintProcessorDirectory)
|
||||||
ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, "fpGetPrintProcessorDirectory returns error %lu!\n", GetLastError());
|
ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, "fpGetPrintProcessorDirectory returns error %lu!\n", GetLastError());
|
||||||
ok(cbNeeded > 0, "cbNeeded is %lu!\n", cbNeeded);
|
ok(cbNeeded > 0, "cbNeeded is %lu!\n", cbNeeded);
|
||||||
|
|
||||||
|
// This test corrupts something inside spoolsv so that it's only runnable once without restarting spoolsv. Therefore it's disabled.
|
||||||
|
#if 0
|
||||||
// Now provide the demanded size, but no buffer.
|
// Now provide the demanded size, but no buffer.
|
||||||
// Unlike GetPrintProcessorDirectoryW, fpGetPrintProcessorDirectory doesn't check for this case and tries to access the buffer.
|
// Unlike GetPrintProcessorDirectoryW, fpGetPrintProcessorDirectory doesn't check for this case and tries to access the buffer.
|
||||||
_SEH2_TRY
|
_SEH2_TRY
|
||||||
|
@ -86,6 +91,7 @@ START_TEST(fpGetPrintProcessorDirectory)
|
||||||
_SEH2_END;
|
_SEH2_END;
|
||||||
|
|
||||||
ok(dwReturned == EXCEPTION_ACCESS_VIOLATION, "dwReturned is %lu!\n", dwReturned);
|
ok(dwReturned == EXCEPTION_ACCESS_VIOLATION, "dwReturned is %lu!\n", dwReturned);
|
||||||
|
#endif
|
||||||
|
|
||||||
// Prove that this check is implemented in spoolss' GetPrintProcessorDirectoryW instead.
|
// Prove that this check is implemented in spoolss' GetPrintProcessorDirectoryW instead.
|
||||||
// In contrast to winspool's GetPrintProcessorDirectoryW, cbTemp is left untouched though. This comes from the fact that RPC isn't involved here.
|
// In contrast to winspool's GetPrintProcessorDirectoryW, cbTemp is left untouched though. This comes from the fact that RPC isn't involved here.
|
||||||
|
|
Loading…
Reference in a new issue