Module: wine Branch: master Commit: c5a0f9316d7c1be8b049919811530d5c580450ed URL: http://source.winehq.org/git/wine.git/?a=commit;h=c5a0f9316d7c1be8b049919811...
Author: Jeremy White jwhite@winehq.org Date: Mon Nov 30 17:04:50 2009 -0600
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.
---
dlls/winspool.drv/info.c | 18 ++++++++++-------- dlls/winspool.drv/tests/info.c | 8 +------- 2 files changed, 11 insertions(+), 15 deletions(-)
diff --git a/dlls/winspool.drv/info.c b/dlls/winspool.drv/info.c index cbd8f27..9ea6443 100644 --- a/dlls/winspool.drv/info.c +++ b/dlls/winspool.drv/info.c @@ -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; diff --git a/dlls/winspool.drv/tests/info.c b/dlls/winspool.drv/tests/info.c index 42a0fa7..a39e935 100644 --- a/dlls/winspool.drv/tests/info.c +++ b/dlls/winspool.drv/tests/info.c @@ -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) {