* PROJECT: ReactOS Spooler API
* LICENSE: GNU LGPL v2.1 or any later version as published by the Free Software Foundation
* PURPOSE: Functions related to Printers and printing
- * COPYRIGHT: Copyright 2015 Colin Finck <colin@reactos.org>
+ * COPYRIGHT: Copyright 2015-2017 Colin Finck <colin@reactos.org>
*/
#include "precomp.h"
DWORD i;
PBYTE p = pPrinterEnum;
+ // Dismiss invalid levels already at this point.
+ if (Level == 3 || Level > 5)
+ {
+ dwErrorCode = ERROR_INVALID_LEVEL;
+ goto Cleanup;
+ }
+
+ if (cbBuf && pPrinterEnum)
+ ZeroMemory(pPrinterEnum, cbBuf);
+
// Do the RPC call
RpcTryExcept
{
}
}
+Cleanup:
SetLastError(dwErrorCode);
return (dwErrorCode == ERROR_SUCCESS);
}