Commit aa4e9c39 authored by Piotr Caban's avatar Piotr Caban Committed by Alexandre Julliard

localspl: Fix parameters validation in FILE StartDocPort.

parent 604e7b4e
......@@ -509,7 +509,7 @@ static BOOL WINAPI localmon_StartDocPort(HANDLE hport, WCHAR *printer_name,
if (!doc_info || !doc_info->pOutputFile)
{
FIXME("set error\n");
SetLastError(ERROR_INVALID_PARAMETER);
return FALSE;
}
......
......@@ -914,9 +914,18 @@ static void test_file_port(void)
ok(!res, "WritePort succeeded\n");
ok(GetLastError() == ERROR_INVALID_HANDLE, "GetLastError() = %lu\n", GetLastError());
doc_info.pDocName = (WCHAR *)L"not used";
SetLastError(0xdeadbeef);
res = pStartDocPort(hport, printer_name, 1, 1, NULL);
ok(!res, "StartDocPort succeeded\n");
ok(GetLastError() == ERROR_INVALID_PARAMETER, "GetLastError() = %lu\n", GetLastError());
memset(&doc_info, 0, sizeof(doc_info));
SetLastError(0xdeadbeef);
res = pStartDocPort(hport, printer_name, 1, 1, (BYTE *)&doc_info);
ok(!res, "StartDocPort succeeded\n");
ok(GetLastError() == ERROR_INVALID_PARAMETER, "GetLastError() = %lu\n", GetLastError());
doc_info.pOutputFile = tempfileW;
doc_info.pDatatype = (WCHAR *)L"not used";
res = pStartDocPort(hport, printer_name, 1, 1, (BYTE *)&doc_info);
ok(res, "StartDocPort failed (%lu)\n", GetLastError());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment