Am Mittwoch 15 Januar 2003 16:34 schrieben Sie: > Hi everyone, > > Just a quick note to say the new conformance tests (in > dlls/winspool/tests/info.c) are failing for Wine running as NT-like OSes. > For NT351, the results are: > > info.c:61: Test failed 1 of 1 time (100%): > [test instance 1] > info.c:61: Test failed: expected result == 0, got 1 > > info.c:62: Test failed 1 of 1 time (100%): > [test instance 1] > info.c:62: Test failed: last error set to 87 instead of > ERROR_INVALID_USER_BUFFER > > info.c:74: Test failed 1 of 1 time (100%): > [test instance 1] > info.c:74: Test failed: expected result == 0, got 1 > > info.c:75: Test failed 1 of 1 time (100%): > [test instance 1] > info.c:75: Test failed: last error set to 87 instead of > RPC_X_NULL_REF_POINTER > > info.c:84: Test failed 1 of 1 time (100%): > [test instance 1] > info.c:84: Test failed: expected result == 0, got 1 > > info.c:85: Test failed 1 of 1 time (100%): > [test instance 1] > info.c:85: Test failed: last error set to 87 instead of > RPC_X_NULL_REF_POINTER > ChangeLog ------------- fixed tests in dlls/winspool/tests/info.c when wine runs in NT-like mode --- ../wine/dlls/winspool/info.c Wed Jan 15 23:14:15 2003 +++ dlls/winspool/info.c Sat Jan 18 00:41:13 2003 @@ -2445,11 +2445,15 @@ BOOL WINAPI GetPrinterDriverDirectoryW(LPWSTR pName, LPWSTR pEnvironment, DWORD Level, LPBYTE pDriverDirectory, DWORD cbBuf, LPDWORD pcbNeeded) -{ +{ OSVERSIONINFOA ver; DWORD needed; TRACE("(%s, %s, %ld, %p, %ld, %p)\n", debugstr_w(pName), debugstr_w(pEnvironment), Level, pDriverDirectory, cbBuf, pcbNeeded); + + ver.dwOSVersionInfoSize = sizeof(OSVERSIONINFOA); + GetVersionExA( &ver); + if(pName != NULL) { FIXME("pName = `%s' - unsupported\n", debugstr_w(pName)); SetLastError(ERROR_INVALID_PARAMETER); @@ -2478,6 +2482,13 @@ SetLastError(ERROR_INSUFFICIENT_BUFFER); return FALSE; } + if ((ver.dwPlatformId == VER_PLATFORM_WIN32_NT) && + (!pcbNeeded || !pDriverDirectory)) { + SetLastError(pcbNeeded ? ERROR_INVALID_USER_BUFFER + : RPC_X_NULL_REF_POINTER); + return FALSE; + } + return TRUE; } @@ -2495,7 +2506,8 @@ INT len = cbBuf * sizeof(WCHAR)/sizeof(CHAR); WCHAR *driverDirectoryW = NULL; - if (len) driverDirectoryW = HeapAlloc( GetProcessHeap(), 0, len ); + if (len && pDriverDirectory) + driverDirectoryW = HeapAlloc( GetProcessHeap(), 0, len ); if(pName) RtlCreateUnicodeStringFromAsciiz(&nameW, pName); else nameW.Buffer = NULL; @@ -2503,7 +2515,8 @@ else environmentW.Buffer = NULL; ret = GetPrinterDriverDirectoryW( nameW.Buffer, environmentW.Buffer, Level, - (LPBYTE)driverDirectoryW, len, &pcbNeededW ); + (LPBYTE)driverDirectoryW, len, + pcbNeeded ? &pcbNeededW : NULL); if (ret) { DWORD needed; needed = 1 + WideCharToMultiByte( CP_ACP, 0, driverDirectoryW, -1,