Received: from sgi.sgi.com (192.48.153.1) by cerious.com
 with SMTP (Apple Internet Mail Server 1.1.1); Wed, 8 Jan 1997 14:01:55 -0500
Received: from cthulhu.engr.sgi.com (cthulhu.engr.sgi.com [192.26.80.2]) by sgi.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id KAA23423; Wed, 8 Jan 1997 10:49:17 -0800
Received: (from daemon@localhost) by cthulhu.engr.sgi.com (950413.SGI.8.6.12/960327.SGI.AUTOCF) id RAA29823 for tiff-list; Wed, 8 Jan 1997 17:13:03 GMT
Received: from sgi.sgi.com (sgi.engr.sgi.com [192.26.80.37]) by cthulhu.engr.sgi.com (950413.SGI.8.6.12/960327.SGI.AUTOCF) via ESMTP id JAA29812 for <tiff-relay@relay.engr.sgi.com>; Wed, 8 Jan 1997 09:13:02 -0800
Received: from unix1.glink.net.hk (unix1.glink.net.hk [202.72.0.43]) by sgi.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id JAA01261 for <tiff@sgi.com>; Wed, 8 Jan 1997 09:13:00 -0800
Received: from dialup66.glink.net.hk (dialup66 [202.72.1.66])
          by unix1.glink.net.hk (8.8.4/8.8.4) with SMTP
	  id BAA17197 for <tiff@sgi.com>; Thu, 9 Jan 1997 01:12:33 +0800 (HKT)
From: occam@glink.net.hk (Albert Ling)
To: tiff@sgi.com
Subject: LIBFIFF caused first chance exception in NTDLL.DLL
Date: Wed, 08 Jan 1997 17:14:46 GMT
Message-ID: <32d3cf2b.60508045@mail.glink.net.hk>
X-Mailer: Forte Agent .99g/32.339
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Sender: owner-tiff@relay.engr.SGI.COM
Precedence: bulk

Hello folks,

I am using libtiff v3.4beta035 with VC++ 4.1b in my application for
reading fax images on Windows NT 4.0b1. For some images (but not all),
the library causes a first chance exception in NTDLL.DLL during debug
session. If I ignore it and continue--or if I'm using the release
build--things seem to be OK.

I've traced the problem to the exact location in tif_win32.c:

static void
_tiffUnmapProc(thandle_t fd, tdata_t base, toff_t map_handle)
{
	UnmapViewOfFile(base);
	//first chance exception happens here
	//when calling CloseHandle()
	CloseHandle((HANDLE)map_handle);
	return;
}

I end up looking at some disassembled code in NTDLL.DLL which I am not
inclined to understand. I guess I could just ignore it since it hasn't
caused any real problem. But if anyone knows what's happening
here---or better yet, can offer a way to eliminate it, I'll be much
obliged.

Albert Ling
