From 8f082b053240abdd6dd7e639592e36ab16f08882 Mon Sep 17 00:00:00 2001 From: robocop Date: Mon, 26 Sep 2005 08:43:49 +0000 Subject: [PATCH] Gstat will have problems if it has to seek to a db page beyond 4GB from BOF, because we detect a problem that didn't happen. I put the check that appears in my old VC6 MSDN examples and that matches Vulcan's logic. --- src/utilities/gstat/dba.epp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/utilities/gstat/dba.epp b/src/utilities/gstat/dba.epp index 6de73ee39e..1de1f09b0f 100644 --- a/src/utilities/gstat/dba.epp +++ b/src/utilities/gstat/dba.epp @@ -1485,13 +1485,17 @@ static const pag* db_read( SLONG page_number) (fil->fil_desc, (LONG) liOffset.LowPart, &liOffset.HighPart, FILE_BEGIN) == (DWORD) -1) { + int lastError = GetLastError(); + if (lastError != NO_ERROR) + { #ifdef SERVICE_THREAD - CMD_UTIL_put_svc_status(tddba->dba_service_blk->svc_status, - GSTAT_MSG_FAC, 30, - 0, NULL, 0, NULL, 0, NULL, 0, NULL, 0, NULL); - // msg 30: Can't read a database page + CMD_UTIL_put_svc_status(tddba->dba_service_blk->svc_status, + GSTAT_MSG_FAC, 30, + 0, NULL, 0, NULL, 0, NULL, 0, NULL, 0, NULL); + // msg 30: Can't read a database page #endif - db_error(GetLastError()); + db_error(lastError); + } } SLONG actual_length;