Commit ee1cca51 authored by Detlef Riekenberg's avatar Detlef Riekenberg Committed by Alexandre Julliard

winspool: Move more parameter-checks for EnumMonitorsW to localspl.

parent 775d4ebd
......@@ -736,6 +736,12 @@ BOOL WINAPI fpEnumMonitors(LPWSTR pName, DWORD Level, LPBYTE pMonitors, DWORD cb
goto em_cleanup;
}
if (!Level || (Level > 2)) {
WARN("level (%d) is ignored in win9x\n", Level);
SetLastError(ERROR_INVALID_LEVEL);
return FALSE;
}
/* Scan all Monitor-Keys */
numentries = 0;
needed = get_local_monitors(Level, NULL, 0, &numentries);
......@@ -745,10 +751,6 @@ BOOL WINAPI fpEnumMonitors(LPWSTR pName, DWORD Level, LPBYTE pMonitors, DWORD cb
SetLastError(ERROR_INSUFFICIENT_BUFFER);
goto em_cleanup;
}
else if (!pMonitors || !pcReturned) {
SetLastError(RPC_X_NULL_REF_POINTER);
goto em_cleanup;
}
/* fill the Buffer with the Monitor-Keys */
needed = get_local_monitors(Level, pMonitors, cbBuf, &numentries);
......
......@@ -524,7 +524,6 @@ static BOOL CUPS_LoadPrinters(void)
TRACE("Printer already exists\n");
RegDeleteValueW(hkeyPrinter, May_Delete_Value);
RegCloseKey(hkeyPrinter);
add_printer_driver(dests[i].name);
} else {
static CHAR data_type[] = "RAW",
print_proc[] = "WinPrint",
......@@ -662,7 +661,6 @@ PRINTCAP_ParseEntry(const char *pent, BOOL isfirst) {
TRACE("Printer already exists\n");
RegDeleteValueW(hkeyPrinter, May_Delete_Value);
RegCloseKey(hkeyPrinter);
add_printer_driver(devname);
} else {
static CHAR data_type[] = "RAW",
print_proc[] = "WinPrint",
......@@ -7246,13 +7244,7 @@ BOOL WINAPI EnumMonitorsW(LPWSTR pName, DWORD Level, LPBYTE pMonitors,
if ((backend == NULL) && !load_backend()) return FALSE;
/* Level is not checked in win9x */
if (!Level || (Level > 2)) {
WARN("level (%d) is ignored in win9x\n", Level);
SetLastError(ERROR_INVALID_LEVEL);
return FALSE;
}
if (!pcbNeeded) {
if (!pcbNeeded || !pcReturned || (!pMonitors && (cbBuf > 0))) {
SetLastError(RPC_X_NULL_REF_POINTER);
return FALSE;
}
......
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