winspool: When retrieving PRINTER_INFO_7, the lack of a directory service print queue object is represented with a NULL pointer and a successful return, not an error return.

This commit is contained in:
Jeremy White 2009-11-30 17:04:50 -06:00 committed by Alexandre Julliard
parent eae3c3cacc
commit c5a0f9316d
2 changed files with 11 additions and 15 deletions

View File

@ -3514,16 +3514,18 @@ static BOOL WINSPOOL_GetPrinter_7(HKEY hkeyPrinter, PRINTER_INFO_7W *pi7, LPBYTE
*pcbNeeded = 0;
if (WINSPOOL_GetStringFromReg(hkeyPrinter, ObjectGUIDW, ptr, left, &size, unicode))
if (! WINSPOOL_GetStringFromReg(hkeyPrinter, ObjectGUIDW, ptr, left, &size, unicode))
{
if (space && size <= left) {
pi7->pszObjectGUID = (LPWSTR)ptr;
ptr += size;
left -= size;
} else
space = FALSE;
*pcbNeeded += size;
ptr = NULL;
size = sizeof(pi7->pszObjectGUID);
}
if (space && size <= left) {
pi7->pszObjectGUID = (LPWSTR)ptr;
ptr += size;
left -= size;
} else
space = FALSE;
*pcbNeeded += size;
if (pi7) {
/* We do not have a Directory Service */
pi7->dwAction = DSPRINT_UNPUBLISH;

View File

@ -2260,13 +2260,7 @@ static void test_GetPrinter(void)
SetLastError(0xdeadbeef);
filled = -1;
ret = GetPrinter(hprn, level, buf, needed, &filled);
if (level == 7 && needed == sizeof(PRINTER_INFO_7A))
{
todo_wine
ok(ret, "level %d: GetPrinter error %d\n", level, GetLastError());
}
else
ok(needed == filled, "needed %d != filled %d\n", needed, filled);
ok(needed == filled, "needed %d != filled %d\n", needed, filled);
if (level == 2)
{