From flan at real.com  Wed Sep  1 23:35:15 2010
From: flan at real.com (Frank Lan)
Date: Thu Sep  2 06:01:44 2010
Subject: [Common-dev] CR: [Re-send] SQLite based preference implementation
In-Reply-To: <766B5A29D28DA442AB229AAEE2AFC4450804432585@SEAMBX.corp.real.com>
References: <766B5A29D28DA442AB229AAEE2AFC4450804432585@SEAMBX.corp.real.com>
Message-ID: <7ECCEA249B7CDC49A079EC0075E999AA07F424F583@SEAMBX.corp.real.com>

Qiang / Sheldon (or other experts):

Would you help to take a review on below changes? It's designed for Android platform. Thanks.

Regards,
Frank Lan

-----Original Message-----
From: android-port-dev-bounces@lists.helixcommunity.org [mailto:android-port-dev-bounces@lists.helixcommunity.org] On Behalf Of Xiaolu Zhao
Sent: Thursday, August 26, 2010 7:47 PM
To: common-dev@helixcommunity.org; android-port-dev@helixcommunity.org
Subject: [Android-port-dev] CR: SQLite based preference implementation

eModified by: xzhao@real.com
Date: 2010.08.26
Project: RealPlayer for Android Smartphones

Bug Number: NA

Bug URL:  NA

Synopsis: SQLite based preference implementation

Overview: This feature is to add new preference implementation based on SQLite, that is use DB to store key/item instead of file. I am here to send review request on behalf of Lenovo Guys, which have completed this feature.

 Two implementation thoughts lists as below:
1. Use a in-memory DB(http://www.sqlite.org/inmemorydb.html) supported by sqlite3 to boost performance. We created a in-memory DB at init-time, and read all the items from file db into it. When write_pref happens, just write new item into this in-memory DB. And commit all the changes to file DB during quit.

2. Use file-lock mechanism to protect the file DB from being accessed simultaneously within two different process. This case may happen if playing some media file during initial boot time, or after unmount sdcard from PC immediately, which will trigger media scanning to happen. Since media scanning happened in a different process other than /system/bin/mediaserver.

Files Added:
common/util/platform/android/sqlite_pref.cpp
common/util/pub/platform/android/sqlite_pref.h
common/util/android.pcf
 
Files Modified:
helix-client-android-full.pf
common/util/pref.cpp

Image Size and Heap Use impact (Client -Only):
None

Platforms and Profiles Affected:
Platform: hxclient_3_6_1_atlas
Profile: helix-client-android-full

Distribution Libraries Affected:
NA 

Distribution library impact and planned action:
NA 

Platforms and Profiles Build Verified:
Platform: hxclient_3_6_1_atlas
Profile:  helix-client-android-full

Platforms and Profiles Functionality verified:
Platform: hxclient_3_6_1_atlas
Profile: helix-client-android-full

Branch: hxclient_3_6_1_atlas 

Copyright assignment: I am a RealNetworks employee or contractor


Best Regards
Zhao Xiaolu

From qluo at real.com  Thu Sep  2 03:17:37 2010
From: qluo at real.com (Qiang Luo)
Date: Thu Sep  2 09:43:30 2010
Subject: [Common-dev] Re: [Android-port-dev] CR: SQLite based preference
	implementation
In-Reply-To: <766B5A29D28DA442AB229AAEE2AFC4450804432585@SEAMBX.corp.real.com>
References: <766B5A29D28DA442AB229AAEE2AFC4450804432585@SEAMBX.corp.real.com>
Message-ID: <4C7F87D1.8090701@real.com>

  Looks good overall to me.

A few comments:
1) please use helix coding style.
2) although there are a few android specific config to find the header 
and lib, the implementation is mostly generic.  It would be useful to 
make this cross platform.  Just like that we have file-based perf, xml 
based perf and now sqlite db based perf.

Since this is new code, you can check in and improve.

Qiang

On 8/26/2010 4:47 AM, Xiaolu Zhao wrote:
> eModified by: xzhao@real.com
> Date: 2010.08.26
> Project: RealPlayer for Android Smartphones
>
> Bug Number: NA
>
> Bug URL:  NA
>
> Synopsis: SQLite based preference implementation
>
> Overview: This feature is to add new preference implementation based on SQLite, that is use DB to store key/item instead of file. I am here to send review request on behalf of Lenovo Guys, which have completed this feature.
>
>   Two implementation thoughts lists as below:
> 1. Use a in-memory DB(http://www.sqlite.org/inmemorydb.html) supported by sqlite3 to boost performance. We created a in-memory DB at init-time, and read all the items from file db into it. When write_pref happens, just write new item into this in-memory DB. And commit all the changes to file DB during quit.
>
> 2. Use file-lock mechanism to protect the file DB from being accessed simultaneously within two different process. This case may happen if playing some media file during initial boot time, or after unmount sdcard from PC immediately, which will trigger media scanning to happen. Since media scanning happened in a different process other than /system/bin/mediaserver.
>
> Files Added:
> common/util/platform/android/sqlite_pref.cpp
> common/util/pub/platform/android/sqlite_pref.h
> common/util/android.pcf
>
> Files Modified:
> helix-client-android-full.pf
> common/util/pref.cpp
>
> Image Size and Heap Use impact (Client -Only):
> None
>
> Platforms and Profiles Affected:
> Platform: hxclient_3_6_1_atlas
> Profile: helix-client-android-full
>
> Distribution Libraries Affected:
> NA
>
> Distribution library impact and planned action:
> NA
>
> Platforms and Profiles Build Verified:
> Platform: hxclient_3_6_1_atlas
> Profile:  helix-client-android-full
>
> Platforms and Profiles Functionality verified:
> Platform: hxclient_3_6_1_atlas
> Profile: helix-client-android-full
>
> Branch: hxclient_3_6_1_atlas
>
> Copyright assignment: I am a RealNetworks employee or contractor
>
>
> Best Regards
> Zhao Xiaolu


From dcollins at real.com  Fri Sep 10 08:38:41 2010
From: dcollins at real.com (Dean Collins)
Date: Fri Sep 10 14:59:57 2010
Subject: [Common-dev] CR: Helix API enhancements related to 64-bit Large
	File Support
Message-ID: <20100910163841.GF20409@dropzone.prognet.com>

Synopsis
========
Implements Helix API enhancements related to 64-bit Large File Support

Branches: SERVER_CURRENT_RN (HEAD)
Reviewer: Chytanya (already reviewed)


Description
===========

This implements some Helix API updates related to supporting large
files (greater than 4GB) in our 64-bit server builds.  (There is some
already-existing Helix code related to supporting large (>4GB) files
with 32-bit builds.  This is unaffected.)

For example, IHXDataFile::Seek() is changed from this:
    STDMETHOD(Seek)     (THIS_
                         ULONG32 offset, UINT16 fromWhere) PURE;

To this:
    STDMETHOD(Seek)     (THIS_
                         HX_OFF_T offset, UINT16 fromWhere) PURE;

The HX_OFF_T type is defined like this:

#if defined(_LONG_IS_64)
typedef off_t HX_OFF_T;
#elif defined(_WIN64)
typedef INT64 HX_OFF_T;
#else
#define HX_OFF_T ULONG32
#endif
...

Because the default non-64-bit definition of HX_OFF_T is identical
to the existing type (ULONG32), 32-bit builds should be unaffected by
these changes.

Similar updates are included for:

IHXFileObject::Seek()
IHXFileStatResponse::StatDone()
IHXDataFile::Tell()
IHXCacheFile::AddBlock()
IHXCacheFile::VerifyBlock()
IHXCacheFile::ReadBlock()
IHXCacheFile::SetStat()
IHXAsyncDataFile::Seek()

Others will be added as needed in the future.

(This feature requires quite a few updates to other modules which
are not in this diff.)


Files Affected
==============
common/include/hxtypes.h
common/include/hxdataf.h
common/include/hxfiles.h
common/include/hxcache.h


Testing Performed
=================

Unit Tests:
- N/A

Integration Tests:
- RTSP streaming and HTTP download of several media clips.

Leak Tests:
- N/A

Performance Tests:
- N/A

Platforms Tested: linux-rhel5-x86_64
Build verified: linux-rhel5-x86_64, linux-rhel5-x86, sunos-5.10-sparc64, win-x86_64-vc10


QA Hints
========
* N/A
-------------- next part --------------
Index: common/include/hxtypes.h
===================================================================
RCS file: /cvsroot/common/include/hxtypes.h,v
retrieving revision 1.52
diff -u -r1.52 hxtypes.h
--- common/include/hxtypes.h	5 May 2010 22:38:49 -0000	1.52
+++ common/include/hxtypes.h	8 Sep 2010 20:49:20 -0000
@@ -764,7 +764,9 @@
 #endif
 
 
-
+//
+// HX_SIZE_T
+//
 #if defined(_WINDOWS)
 typedef SIZE_T HX_SIZE_T;
 #else
@@ -773,6 +775,21 @@
 #endif
 
 //
+// HX_OFF_T -- File seek offset type
+//
+#if defined(_LONG_IS_64)
+#include  // ensure off_t is defined
+typedef off_t HX_OFF_T;
+#elif defined(_WIN64)
+//typedef LARGE_INTEGER HX_OFF_T;
+typedef INT64 HX_OFF_T;
+#else // 32-bit file seek/tell offsets
+// Historically seek/tell offsets were unsigned in Helix, unlike the modern 64-bit variation
+// Use a define rather than a typedef so we break less legacy code
+#define HX_OFF_T ULONG32
+#endif
+
+//
 // PTR_INT - an unsigned integer type the same size as a pointer.
 //
 #if defined(_LONG_IS_64)
Index: common/include/hxdataf.h
===================================================================
RCS file: /cvsroot/common/include/hxdataf.h,v
retrieving revision 1.10
diff -u -r1.10 hxdataf.h
--- common/include/hxdataf.h	16 Nov 2009 22:26:03 -0000	1.10
+++ common/include/hxdataf.h	8 Sep 2010 20:49:20 -0000
@@ -263,10 +263,10 @@
      * error.
      */
     STDMETHOD(Seek)			(THIS_
-					ULONG32 offset, UINT16 fromWhere) PURE;
+					HX_OFF_T offset, UINT16 fromWhere) PURE;
 
     /* Tell returns the current file position in the file */
-    STDMETHOD_(ULONG32, Tell)		(THIS) PURE;
+    STDMETHOD_(HX_OFF_T, Tell)		(THIS) PURE;
 
     /* Read reads up to count bytes of data into buf.
      * returns the number of bytes read, EOF, or -1 if the read failed OR one of the following status codes
@@ -389,10 +389,10 @@
      * error.
      */
     STDMETHOD(Seek)			(THIS_
-					ULONG32 offset, UINT16 fromWhere) PURE;
+					HX_OFF_T offset, UINT16 fromWhere) PURE;
 
     /* Tell returns the current file position in the file */
-    STDMETHOD_(ULONG32, Tell)		(THIS) PURE;
+    STDMETHOD_(HX_OFF_T, Tell)		(THIS) PURE;
 
     /* Read reads up to count bytes of data into buf.
      * returns the number of bytes read, EOF, or -1 if the read failed 
Index: common/include/hxfiles.h
===================================================================
RCS file: /cvsroot/common/include/hxfiles.h,v
retrieving revision 1.21
diff -u -r1.21 hxfiles.h
--- common/include/hxfiles.h	15 Oct 2009 20:30:33 -0000	1.21
+++ common/include/hxfiles.h	8 Sep 2010 20:49:20 -0000
@@ -158,6 +158,17 @@
 #define HX_S_IFREG  0100000
 #endif
 
+#if defined(_WIN64)
+#define HX_STAT_TIME_T time_t
+#define HX_STAT_MODE_T UINT64
+#elif defined(_LONG_IS_64)
+#define HX_STAT_TIME_T time_t
+#define HX_STAT_MODE_T mode_t
+#else
+#define HX_STAT_TIME_T UINT32
+#define HX_STAT_MODE_T UINT32
+#endif
+
 
 /****************************************************************************
  *
@@ -267,7 +278,7 @@
      *      an absolute seek.
      */
     STDMETHOD(Seek)     (THIS_
-                        ULONG32 ulOffset,
+                        HX_OFF_T  ulOffset,
                         HXBOOL    bRelative) PURE;
 
     /************************************************************************
@@ -889,11 +900,11 @@
 
     STDMETHOD(StatDone)         (THIS_
                                  HX_RESULT status,
-                                 UINT32 ulSize,
-                                 UINT32 ulCreationTime,
-                                 UINT32 ulAccessTime,
-                                 UINT32 ulModificationTime,
-                                 UINT32 ulMode) PURE;
+                                 HX_OFF_T size,
+                                 HX_STAT_TIME_T tCreationTime,
+                                 HX_STAT_TIME_T tAccessTime,
+                                 HX_STAT_TIME_T tModificationTime,
+                                 HX_STAT_MODE_T mode) PURE;
 };
 
 /****************************************************************************
Index: common/include/hxcache.h
===================================================================
RCS file: /cvsroot/common/include/hxcache.h,v
retrieving revision 1.5
diff -u -r1.5 hxcache.h
--- common/include/hxcache.h	6 Jul 2007 20:43:41 -0000	1.5
+++ common/include/hxcache.h	8 Sep 2010 20:49:20 -0000
@@ -50,6 +50,8 @@
 #ifndef _HXCACHE_H_
 #define _HXCACHE_H_
 
+#include "hxfiles.h"
+
 /*
  * Forward declarations of some interfaces defined herein.
  */
@@ -209,7 +211,7 @@
      *	    Adds a block of data to the cache
      */
     STDMETHOD(AddBlock)	(THIS_
-			 UINT32			/*IN*/	ulBlockOffset,
+			 HX_OFF_T		/*IN*/	nBlockOffset,
 			 IHXBuffer*		/*IN*/	pBlock) PURE;
 
     /************************************************************************
@@ -219,7 +221,7 @@
      *	    Verify that a block of data is in the cache.
      */
     STDMETHOD(VerifyBlock)	(THIS_
-				 UINT32		/*IN*/	ulBlockOffset,
+				 HX_OFF_T	/*IN*/	nBlockOffset,
 				 UINT32		/*IN*/	ulBlockLength) PURE;
 
     /************************************************************************
@@ -229,7 +231,7 @@
      *	    Read a block out of the cache.
      */
     STDMETHOD(ReadBlock)	(THIS_
-				 UINT32		/*IN*/	ulBlockOffset,
+				 HX_OFF_T	/*IN*/	nBlockOffset,
 				 UINT32		/*IN*/	ulBlockLength) PURE;
 
     /************************************************************************
@@ -247,10 +249,10 @@
      *	    Store size and timestamp information for a cached file.
      */
     STDMETHOD(SetStat)	(THIS_
-			 UINT32		/*IN*/	ulSize,
-			 UINT32		/*IN*/	ulCreationTime,
-			 UINT32		/*IN*/	ulAccessTime,
-			 UINT32		/*IN*/	ulModificationTime) PURE;
+			 HX_OFF_T	/*IN*/	size,
+			 HX_STAT_TIME_T	/*IN*/	tCreationTime,
+			 HX_STAT_TIME_T	/*IN*/	tAccessTime,
+			 HX_STAT_TIME_T	/*IN*/	tModificationTime) PURE;
 
     /************************************************************************
      *	Method:
@@ -365,10 +367,10 @@
      */
     STDMETHOD(StatDone)		(THIS_
 				 HX_RESULT	/*IN*/	status,
-				 UINT32		/*IN*/ ulSize,
-				 UINT32		/*IN*/ ulCreationTime,
-				 UINT32		/*IN*/ ulAccessTime,
-				 UINT32		/*IN*/ ulModificationTime) PURE;
+				 HX_OFF_T	/*IN*/  size,
+				 HX_STAT_TIME_T	/*IN*/  tCreationTime,
+				 HX_STAT_TIME_T	/*IN*/  tAccessTime,
+				 HX_STAT_TIME_T	/*IN*/  tModificationTime) PURE;
 
     /************************************************************************
      *	Method:
@@ -434,7 +436,7 @@
      * IHXMIIFetch Methods.
      */
     STDMETHOD(RequestRemoteBlock)   (THIS_
-				    UINT32 ulBlockOffset,
+				    HX_OFF_T nBlockOffset,
 				    UINT32 ulBlockLen) PURE;
 
 };
From jgordon at real.com  Fri Sep 10 09:31:07 2010
From: jgordon at real.com (Jamie Gordon)
Date: Fri Sep 10 15:55:14 2010
Subject: [Common-dev] CR: Helix API enhancements related to 64-bit Large
	File Support
In-Reply-To: <20100910163841.GF20409@dropzone.prognet.com>
References: <20100910163841.GF20409@dropzone.prognet.com>
Message-ID: <4C8A6B5B.5030604@real.com>

looks good :)

On 9/10/2010 9:38 AM, Dean Collins wrote:
> Synopsis
> ========
> Implements Helix API enhancements related to 64-bit Large File Support
>
> Branches: SERVER_CURRENT_RN (HEAD)
> Reviewer: Chytanya (already reviewed)
>
>
> Description
> ===========
>
> This implements some Helix API updates related to supporting large
> files (greater than 4GB) in our 64-bit server builds.  (There is some
> already-existing Helix code related to supporting large (>4GB) files
> with 32-bit builds.  This is unaffected.)
>
> For example, IHXDataFile::Seek() is changed from this:
>      STDMETHOD(Seek)     (THIS_
>                           ULONG32 offset, UINT16 fromWhere) PURE;
>
> To this:
>      STDMETHOD(Seek)     (THIS_
>                           HX_OFF_T offset, UINT16 fromWhere) PURE;
>
> The HX_OFF_T type is defined like this:
>
> #if defined(_LONG_IS_64)
> typedef off_t HX_OFF_T;
> #elif defined(_WIN64)
> typedef INT64 HX_OFF_T;
> #else
> #define HX_OFF_T ULONG32
> #endif
> ...
>
> Because the default non-64-bit definition of HX_OFF_T is identical
> to the existing type (ULONG32), 32-bit builds should be unaffected by
> these changes.
>
> Similar updates are included for:
>
> IHXFileObject::Seek()
> IHXFileStatResponse::StatDone()
> IHXDataFile::Tell()
> IHXCacheFile::AddBlock()
> IHXCacheFile::VerifyBlock()
> IHXCacheFile::ReadBlock()
> IHXCacheFile::SetStat()
> IHXAsyncDataFile::Seek()
>
> Others will be added as needed in the future.
>
> (This feature requires quite a few updates to other modules which
> are not in this diff.)
>
>
> Files Affected
> ==============
> common/include/hxtypes.h
> common/include/hxdataf.h
> common/include/hxfiles.h
> common/include/hxcache.h
>
>
> Testing Performed
> =================
>
> Unit Tests:
> - N/A
>
> Integration Tests:
> - RTSP streaming and HTTP download of several media clips.
>
> Leak Tests:
> - N/A
>
> Performance Tests:
> - N/A
>
> Platforms Tested: linux-rhel5-x86_64
> Build verified: linux-rhel5-x86_64, linux-rhel5-x86, sunos-5.10-sparc64, win-x86_64-vc10
>
>
> QA Hints
> ========
> * N/A

From dcollins at real.com  Fri Sep 10 13:06:03 2010
From: dcollins at real.com (Dean Collins)
Date: Fri Sep 10 19:27:15 2010
Subject: [Common-dev] CR: Implements common/fileio enhancements related to
	64-bit Large File Support
Message-ID: <20100910210603.GI20409@dropzone.prognet.com>

Synopsis
========
Implements common/fileio enhancements related to 64-bit Large File Support

Branches: SERVER_CURRENT_RN (HEAD)
Suggested Reviewer: Chytanya


Description
===========

This implements some common/fileio related updates necessary for
supporting large files (greater than 4GB) in our 64-bit Helix Server
builds.  These updates relate primarily to the seek/tell/stat types
of calls.

In some cases, the underlying implementation remains 32-bit, in which
case a comment is typically added to help me find these as I continue
enhancing and extending 64-bit/LFS functionality.

For Win64, this depends on inline wrapper routines for fseek, ftell, and
lseek, which are added to the Helix runtime library for this platform.
On this platform, these calls will be mapped to their 64-bit variations
(_fseeki64(), etc.).  The 32-bit variation is still available as _fseek,
_ftell, and _lseek, if required.

These changes are implented so that the impact on non-64-bit builds,
and non-server builds, should be minimal.  However, something that
subclasses from one of the modified common/fileio classes might not build
on Win32 since off_t has been changed to HX_OFF_T in several places.
(Due to COM API compatability constraints, HX_OFF_T is UINT32 on Win32).
Just change off_t to HX_OFF_T in the affected class and it should build.
They're both 32-bits on Win32.  Also note that if you use off_t it will
not be 64-bit safe since this is 32-bits even in 64-bit Windows builds.


Files Affected
==============
common/runtime/pub/hlxclib/stdio.h
common/fileio/bufdataf.cpp
common/fileio/bufdataf.h
common/fileio/cchx2ihxdataf.cpp
common/fileio/cchx2ihxdataf.h
common/fileio/chunkres.cpp
common/fileio/chxdataf_stdio.cpp
common/fileio/chxdfmem.cpp
common/fileio/cihx2chxdataf.cpp
common/fileio/cihx2chxdataf.h
common/fileio/fdbufdataf.cpp
common/fileio/fdbufdataf.h
common/fileio/fmemio.cpp
common/fileio/fsio.cpp
common/fileio/hxbufdataf.h
common/fileio/hxdatasource.cpp
common/fileio/hxxfile.cpp
common/fileio/packet_file_object.cpp
common/fileio/single_buffer_file_object.cpp
common/fileio/sio.cpp
common/fileio/unbufdataf.h
common/fileio/platform/unix/cunixf.cpp
common/fileio/platform/unix/cunixf.h
common/fileio/platform/unix/hxbufdataf.cpp
common/fileio/platform/unix/mmapdatf.cpp
common/fileio/platform/unix/mmapdatf.h
common/fileio/platform/unix/unbufdataf.cpp
common/fileio/platform/win/cwinfile.cpp
common/fileio/platform/win/filespecutils.cpp
common/fileio/platform/win/mmapdatf.cpp
common/fileio/platform/win/mmapdatf.h
common/fileio/platform/win/mmfile.cpp
common/fileio/platform/win/winff.cpp
common/fileio/platform/win/winfile.cpp
common/fileio/platform/win/winfile.h
common/fileio/pub/bio.h
common/fileio/pub/chxdataf_stdio.h
common/fileio/pub/chxdataf_virtual.h
common/fileio/pub/chxdfmem.h
common/fileio/pub/fmemio.h
common/fileio/pub/fsio.h
common/fileio/pub/hxdatasource.h
common/fileio/pub/hxxfile.h
common/fileio/pub/packet_file_object.h
common/fileio/pub/single_buffer_file_object.h
common/fileio/pub/sio.h
common/fileio/pub/platform/win/cwin32file.h
common/fileio/pub/platform/win/cwinfile.h
common/fileio/pub/platform/win/fio.h
common/fileio/pub/platform/win/mmfile.h
common/fileio/pub/platform/win/winff.h


Testing Performed
=================

Unit Tests:
- N/A

Integration Tests:
- RTSP streaming and HTTP download of realvideo10.rm.

Leak Tests:
- N/A

Performance Tests:
- N/A

Platforms Tested: linux-rhel5-x86_64, sunos-5.10-sparc64, win-x86_64-vc10, win-x86-vc10
Build verified:
  * Server: linux-rhel5-x86_64, sunos-5.10-sparc64, win-x86_64-vc10, win-x86-vc10
  * splay_rn: win32-i386-vc7 (there were build-busters in my build but these
      happened before patching-in the changes as well, I'll look at this again
      using the build-farm post-checkin.)


QA Hints
========
* N/A
-------------- next part --------------
Index: common/runtime/pub/hlxclib/stdio.h
===================================================================
RCS file: /cvsroot/common/runtime/pub/hlxclib/stdio.h,v
retrieving revision 1.12
diff -u -r1.12 stdio.h
--- common/runtime/pub/hlxclib/stdio.h	1 Sep 2009 21:40:25 -0000	1.12
+++ common/runtime/pub/hlxclib/stdio.h	10 Sep 2010 16:42:14 -0000
@@ -244,6 +244,34 @@
 #define snprintf _snprintf
 #define vsnprintf _vsnprintf
 
+#if defined(_WIN64) && defined(_MSC_VER) && (_MSC_VER >= 1600) //64-bit build w/ VC10 or later
+
+HLX_INLINE __int64
+__helix_fseek(FILE *fp, __int64 offset, int origin)
+{
+    return _fseeki64(fp, offset, origin);
+}
+
+HLX_INLINE __int64
+__helix_ftell(FILE *fp)
+{
+    return _ftelli64(fp);
+}
+
+#include  //for _lseeki64
+HLX_INLINE __int64
+__helix_lseek(int fd, __int64 offset, int origin)
+{
+    return _lseeki64(fd, offset, origin);
+}
+
+
+#define fseek __helix_fseek
+#define ftell __helix_ftell
+#define lseek __helix_lseek
+
+#endif // end of 64-bit build w/ VC10 or later
+
 #elif defined(_SYMBIAN) || defined(_WINCE) || defined(_IRIX)
 #if !defined(HELIX_CONFIG_SYMBIAN_USE_STDAPIS)
 #define snprintf __helix_snprintf
-------------- next part --------------
Index: common/fileio/bufdataf.cpp
===================================================================
RCS file: /cvsroot/common/fileio/bufdataf.cpp,v
retrieving revision 1.14
diff -u -r1.14 bufdataf.cpp
--- common/fileio/bufdataf.cpp	6 Jul 2007 20:35:11 -0000	1.14
+++ common/fileio/bufdataf.cpp	10 Sep 2010 18:14:56 -0000
@@ -160,7 +160,7 @@
 STDMETHODIMP_(void)
 BufferedDataFile::Bind(const char* pFilename)
 {
-    m_pFilename->Set((BYTE *)pFilename, strlen(pFilename)+1);
+    m_pFilename->Set((BYTE *)pFilename, (ULONG32)strlen(pFilename)+1);
 
     DPRINTF(0x5d000000, ("BufferedDataFile::Bind(%s)\n", 
 	    (const char *)m_pFilename->GetBuffer()));
@@ -352,7 +352,7 @@
  * error.
  */
 STDMETHODIMP
-BufferedDataFile::Seek(ULONG32 offset, UINT16 fromWhere)
+BufferedDataFile::Seek(HX_OFF_T offset, UINT16 fromWhere)
 {
     if (m_pFile)
     {
@@ -369,10 +369,10 @@
 
 
 /* Tell returns the current file position in the file */
-STDMETHODIMP_(ULONG32)
+STDMETHODIMP_(HX_OFF_T)
 BufferedDataFile::Tell()
 {
-    INT32 offset = -1;
+    HX_OFF_T offset = (HX_OFF_T)-1;
     m_ulLastError = (UINT32)HXR_FAIL;
     if (m_pFile)
     {
@@ -382,7 +382,7 @@
 	    m_ulLastError = HXR_OK;       
 	}
     }
-    return (ULONG32) offset;
+    return offset;
 }
 
 
@@ -419,8 +419,8 @@
 
 	if (m_ulLastError == HXR_OK)
 	{
-	    if ((ncnt = fread((void *)pBuf->GetBuffer(), sizeof(char), 
-			      count, m_pFile)) < (int)count)
+	    if ((ncnt = (int)fread((void *)pBuf->GetBuffer(), sizeof(char), 
+			           count, m_pFile)) < (int)count)
 	    {
 		m_ulLastError = ferror(m_pFile) ? HXR_FAIL : HXR_OK;
 	    }
@@ -457,7 +457,7 @@
     {
 	m_ulLastError = HXR_OK;
 
-	if ((ncnt = fwrite(pBuf->GetBuffer(), sizeof(char), 
+	if ((ncnt = (int)fwrite(pBuf->GetBuffer(), sizeof(char), 
 	    pBuf->GetSize(), m_pFile)) < (int)(pBuf->GetSize()))
 	{
 	    m_ulLastError = (UINT32)HXR_FAIL;
Index: common/fileio/bufdataf.h
===================================================================
RCS file: /cvsroot/common/fileio/bufdataf.h,v
retrieving revision 1.8
diff -u -r1.8 bufdataf.h
--- common/fileio/bufdataf.h	6 Jul 2007 20:35:11 -0000	1.8
+++ common/fileio/bufdataf.h	10 Sep 2010 18:14:56 -0000
@@ -116,10 +116,10 @@
      * error.
      */
     STDMETHOD(Seek)			(THIS_
-					ULONG32 offset, UINT16 fromWhere);
+					HX_OFF_T offset, UINT16 fromWhere);
 
     /* Tell returns the current file position in the file */
-    STDMETHOD_(ULONG32, Tell)		(THIS);
+    STDMETHOD_(HX_OFF_T, Tell)		(THIS);
 
     /* Read reads up to count bytes of data into buf.
      * returns the number of bytes read, EOF, or -1 if the read failed 
Index: common/fileio/cchx2ihxdataf.cpp
===================================================================
RCS file: /cvsroot/common/fileio/cchx2ihxdataf.cpp,v
retrieving revision 1.10
diff -u -r1.10 cchx2ihxdataf.cpp
--- common/fileio/cchx2ihxdataf.cpp	6 Jul 2007 20:35:11 -0000	1.10
+++ common/fileio/cchx2ihxdataf.cpp	10 Sep 2010 18:14:56 -0000
@@ -172,7 +172,7 @@
 
 	if (m_pIHXFile->IsOpen())
 	{
-	    ULONG32 ulCurrPos = m_pIHXFile->Tell();
+	    ULONG32 ulCurrPos = (ULONG32)m_pIHXFile->Tell(); //XXX not 64-bit safe
 
 	    ulSize = m_pIHXFile->Seek(0, SEEK_END);
 
@@ -187,7 +187,7 @@
     return ulSize;
 }
 
-HX_RESULT CCHX2IHXDataFile::Seek(ULONG32 offset, UINT16 fromWhere)
+HX_RESULT CCHX2IHXDataFile::Seek(HX_OFF_T offset, UINT16 fromWhere)
 {
     HX_RESULT retVal = HXR_FAIL;
 
@@ -199,9 +199,9 @@
     return retVal;
 }
 
-ULONG32 CCHX2IHXDataFile::Tell(void)
+HX_OFF_T CCHX2IHXDataFile::Tell(void)
 {
-    ULONG32 ulPos = 0;
+    HX_OFF_T ulPos = 0;
 
     if (m_pIHXFile)
     {
Index: common/fileio/cchx2ihxdataf.h
===================================================================
RCS file: /cvsroot/common/fileio/cchx2ihxdataf.h,v
retrieving revision 1.8
diff -u -r1.8 cchx2ihxdataf.h
--- common/fileio/cchx2ihxdataf.h	6 Jul 2007 20:35:11 -0000	1.8
+++ common/fileio/cchx2ihxdataf.h	10 Sep 2010 18:14:56 -0000
@@ -104,10 +104,10 @@
 	virtual ULONG32		GetSize			(void);
 	
 	/* Seek moves the current file position to the offset from the fromWhere specifier */
-	virtual HX_RESULT	Seek			(ULONG32 offset, UINT16 fromWhere);
+	virtual HX_RESULT	Seek			(HX_OFF_T offset, UINT16 fromWhere);
 
 	/* Tell returns the current file position in the ra file */
-	virtual ULONG32		Tell			(void);
+	virtual HX_OFF_T	Tell			(void);
 
 	/* Read reads up to count bytes of data into buf.
 	returns the number of bytes read, EOF, or -1 if the read failed */
Index: common/fileio/chunkres.cpp
===================================================================
RCS file: /cvsroot/common/fileio/chunkres.cpp,v
retrieving revision 1.29
diff -u -r1.29 chunkres.cpp
--- common/fileio/chunkres.cpp	5 Feb 2008 06:06:08 -0000	1.29
+++ common/fileio/chunkres.cpp	10 Sep 2010 18:14:57 -0000
@@ -624,7 +624,7 @@
     
     Lock();
     
-    if (m_Chunks.GetSize() < ulLastChunk)
+    if ((ULONG32)m_Chunks.GetSize() < ulLastChunk)
     {
 	ulLastChunk = m_Chunks.GetSize();
     }
@@ -950,7 +950,7 @@
 	ULONG32 chunkCount  = count;
 	ULONG32 baseOffset  = 0;
 	
-	if (nFirstChunk < m_ulFirstChunkIdx)
+	if ((ULONG32)nFirstChunk < m_ulFirstChunkIdx)
 	{
 	    m_ulFirstChunkIdx = nFirstChunk;
 	}
Index: common/fileio/chxdataf_stdio.cpp
===================================================================
RCS file: /cvsroot/common/fileio/chxdataf_stdio.cpp,v
retrieving revision 1.11
diff -u -r1.11 chxdataf_stdio.cpp
--- common/fileio/chxdataf_stdio.cpp	6 Jul 2007 20:35:11 -0000	1.11
+++ common/fileio/chxdataf_stdio.cpp	10 Sep 2010 18:14:57 -0000
@@ -223,7 +223,7 @@
 
 /* Seek moves the current file position to the offset from the fromWhere specifier */
 HX_RESULT
-CHXDataFile::Seek(ULONG32 offset, UINT16 fromWhere)
+CHXDataFile::Seek(HX_OFF_T offset, UINT16 fromWhere)
 {
     if(!m_FP)
     {
@@ -234,7 +234,7 @@
 }
 
 /* Tell returns the current file position in the ra file */
-ULONG32	
+HX_OFF_T	
 CHXDataFile::Tell(void)
 {
     if(!m_FP)
Index: common/fileio/chxdfmem.cpp
===================================================================
RCS file: /cvsroot/common/fileio/chxdfmem.cpp,v
retrieving revision 1.11
diff -u -r1.11 chxdfmem.cpp
--- common/fileio/chxdfmem.cpp	5 Feb 2008 06:06:08 -0000	1.11
+++ common/fileio/chxdfmem.cpp	10 Sep 2010 18:14:57 -0000
@@ -78,7 +78,7 @@
 
 /*	Seek moves the current file position to the offset from the fromWhere specifier */
 
-HX_RESULT CHXDataFileMem::Seek(ULONG32 offset, UINT16 fromWhere)
+HX_RESULT CHXDataFileMem::Seek(HX_OFF_T offset, UINT16 fromWhere)
 {
 	switch(fromWhere)
 	{
@@ -114,7 +114,7 @@
 }
 
 /* 	Tell returns the current file position in the ra file */
-ULONG32	CHXDataFileMem::Tell()
+HX_OFF_T CHXDataFileMem::Tell()
 {
 	return m_Offset;
 }
@@ -169,12 +169,13 @@
 	// count to what we have available.
 	if (m_Offset + actual > m_pChunkyRes->GetContiguousLength())
 	{
-		actual = m_pChunkyRes->GetContiguousLength()-m_Offset;
+		actual = (ULONG32)(m_pChunkyRes->GetContiguousLength() - m_Offset);
 	}
 
 	if (actual > 0)
 	{
-		HX_RESULT tempErr = m_pChunkyRes->GetData(m_Offset,buf,actual,&actual);
+		HX_RESULT tempErr = m_pChunkyRes->GetData((ULONG32)m_Offset,
+                    buf, actual, &actual); //XXX not 64-bit safe
 		if (tempErr != HXR_OK)
 		{
 			mLastError = tempErr;
Index: common/fileio/cihx2chxdataf.cpp
===================================================================
RCS file: /cvsroot/common/fileio/cihx2chxdataf.cpp,v
retrieving revision 1.10
diff -u -r1.10 cihx2chxdataf.cpp
--- common/fileio/cihx2chxdataf.cpp	6 Jul 2007 20:35:11 -0000	1.10
+++ common/fileio/cihx2chxdataf.cpp	10 Sep 2010 18:14:57 -0000
@@ -103,7 +103,7 @@
 
     if (m_pFileName && pFileName)
     {
-	if (m_pFileName->Set((UINT8*)pFileName, ::strlen(pFileName) + 1) != HXR_OK)
+	if (m_pFileName->Set((UINT8*)pFileName, (UINT32)::strlen(pFileName) + 1) != HXR_OK)
 	{
 	    HX_RELEASE(m_pFileName);
 	}
@@ -191,7 +191,7 @@
     return m_bOpen;
 }
 
-STDMETHODIMP CIHX2CHXDataFile::Seek(ULONG32 offset, UINT16 fromWhere)
+STDMETHODIMP CIHX2CHXDataFile::Seek(HX_OFF_T offset, UINT16 fromWhere)
 {
     HX_RESULT retVal = HXR_FAIL;
 
@@ -203,9 +203,9 @@
     return retVal;
 }
 
-STDMETHODIMP_(ULONG32) CIHX2CHXDataFile::Tell()
+STDMETHODIMP_(HX_OFF_T) CIHX2CHXDataFile::Tell()
 {
-    ULONG32 ulPos = 0;
+    HX_OFF_T ulPos = 0;
 
     if (m_pCHXFile)
     {
Index: common/fileio/cihx2chxdataf.h
===================================================================
RCS file: /cvsroot/common/fileio/cihx2chxdataf.h,v
retrieving revision 1.7
diff -u -r1.7 cihx2chxdataf.h
--- common/fileio/cihx2chxdataf.h	6 Jul 2007 20:35:11 -0000	1.7
+++ common/fileio/cihx2chxdataf.h	10 Sep 2010 18:14:57 -0000
@@ -113,10 +113,10 @@
 	 * error.
 	 */
 	STDMETHOD(Seek)				(THIS_
-						ULONG32 offset, UINT16 fromWhere);
+						HX_OFF_T offset, UINT16 fromWhere);
 	
 	/* Tell returns the current file position in the file */
-	STDMETHOD_(ULONG32, Tell)		(THIS);
+	STDMETHOD_(HX_OFF_T, Tell)		(THIS);
 	
 	/* Read reads up to count bytes of data into buf.
 	 * returns the number of bytes read, EOF, or -1 if the read failed 
Index: common/fileio/fdbufdataf.cpp
===================================================================
RCS file: /cvsroot/common/fileio/fdbufdataf.cpp,v
retrieving revision 1.3
diff -u -r1.3 fdbufdataf.cpp
--- common/fileio/fdbufdataf.cpp	17 Nov 2009 21:18:55 -0000	1.3
+++ common/fileio/fdbufdataf.cpp	10 Sep 2010 18:14:57 -0000
@@ -147,7 +147,7 @@
 {
     if (m_pFilename)
     {
-	m_pFilename->Set((BYTE *)pFilename, strlen(pFilename)+1);
+	m_pFilename->Set((BYTE *)pFilename, (UINT32)strlen(pFilename)+1);
     }
 }
 
@@ -333,45 +333,45 @@
 }
 
 STDMETHODIMP
-FDBufferedDataFile::Seek(ULONG32 offset, UINT16 fromWhere)
+FDBufferedDataFile::Seek(HX_OFF_T offset, UINT16 fromWhere)
 {
     if (m_pFile)
     {
-	m_ulLastError = HXR_OK;       
-    //Always add m_ulBaseOffset in Seek and 
-    //always subtract m_ulBaseOffset  in Tell 
-    //to completely hide the fact m_ulBaseOffset exists.
-    offset += m_ulBaseOffset;
-	if (fseek(m_pFile, offset, fromWhere) < 0)
-	{
-	    m_ulLastError = errno;
-	    return HXR_INVALID_FILE;
-	}
-	return HXR_OK;
+        m_ulLastError = HXR_OK;       
+        //Always add m_ulBaseOffset in Seek and 
+        //always subtract m_ulBaseOffset  in Tell 
+        //to completely hide the fact m_ulBaseOffset exists.
+        offset += m_ulBaseOffset;
+        if (fseek(m_pFile, offset, fromWhere) < 0)
+        {
+            m_ulLastError = errno;
+            return HXR_INVALID_FILE;
+        }
+        return HXR_OK;
     }
     return HXR_INVALID_FILE;
 }
 
-STDMETHODIMP_(ULONG32)
+STDMETHODIMP_(HX_OFF_T)
 FDBufferedDataFile::Tell()
 {
-    INT32 offset = -1;
+    HX_OFF_T offset = (HX_OFF_T)-1;
     m_ulLastError = (UINT32)HXR_FAIL;
     if (m_pFile)
     {
-	if ((offset = ftell(m_pFile)) != -1)
-	{
-        offset -= m_ulBaseOffset;
-	    m_ulLastError = HXR_OK;       
-	}
+        if ((offset = ftell(m_pFile)) != -1)
+        {
+            offset -= m_ulBaseOffset;
+            m_ulLastError = HXR_OK;       
+        }
     }
-    return (ULONG32) offset;
+    return offset;
 }
 
 STDMETHODIMP_(ULONG32)
 FDBufferedDataFile::Read(REF(IHXBuffer*) pOutBuf, ULONG32 count)
 {
-    int ncnt = 0;
+    HX_OFF_T ncnt = 0;
     IHXBuffer* pBuf = NULL;
 
     if (m_pFile)
@@ -398,13 +398,13 @@
 
 	if (m_ulLastError == HXR_OK)
 	{
-	    if ((ncnt = fread((void *)pBuf->GetBuffer(), sizeof(char), count, m_pFile)) < (int)count)
+	    if ((ncnt = fread((void *)pBuf->GetBuffer(), sizeof(char), count, m_pFile)) < (HX_OFF_T)count)
 	    {
 		m_ulLastError = ferror(m_pFile) ? HXR_FAIL : HXR_OK;
 	    }
-	    if (ncnt < (int)count)
+	    if (ncnt < (HX_OFF_T)count)
 	    {
-		pBuf->SetSize(ncnt);
+		pBuf->SetSize((UINT32)ncnt);
 	    }
 	    if (pBuf != pOutBuf)
 	    {
@@ -425,13 +425,13 @@
 STDMETHODIMP_(ULONG32)
 FDBufferedDataFile::Write(REF(IHXBuffer *) pBuf)
 {
-    int ncnt = -1;
+    ULONG32 ncnt = (ULONG32)-1;
 
     if (m_pFile)
     {
 	m_ulLastError = HXR_OK;
 
-	if ((ncnt = fwrite(pBuf->GetBuffer(), sizeof(char), 
+	if ((ncnt = (ULONG32)fwrite(pBuf->GetBuffer(), sizeof(char), 
 	    pBuf->GetSize(), m_pFile)) < (int)(pBuf->GetSize()))
 	{
 	    m_ulLastError = (UINT32)HXR_FAIL;
@@ -465,7 +465,7 @@
     {
 	if (!fstat(m_nExternalFD, statbuf))
 	{
-	    if (statbuf->st_size > m_ulLength)
+	    if (statbuf->st_size > (HX_OFF_T)m_ulLength)
 	    {
 		statbuf->st_size = m_ulLength;
 	    }
@@ -544,12 +544,14 @@
 	    CHXURL hxurl(pszURL, m_pContext);
 	    pURLOptions = hxurl.GetOptions();
 	    ULONG32 ulFD;
+            ULONG32 ulOffset;
 
 	    if (pURLOptions &&
 		HXR_OK == pURLOptions->GetPropertyULONG32("FileDescriptor", ulFD) &&
-		HXR_OK == pURLOptions->GetPropertyULONG32("Offset", m_ulBaseOffset) &&
+		HXR_OK == pURLOptions->GetPropertyULONG32("Offset", ulOffset) &&
 		HXR_OK == pURLOptions->GetPropertyULONG32("Length", m_ulLength))
 	    {
+		m_ulBaseOffset = (HX_OFF_T)ulOffset;
 		//m_ulLength += m_ulBaseOffset;
 		m_nExternalFD = (int)ulFD;
 		retVal = HXR_OK;
Index: common/fileio/fdbufdataf.h
===================================================================
RCS file: /cvsroot/common/fileio/fdbufdataf.h,v
retrieving revision 1.2
diff -u -r1.2 fdbufdataf.h
--- common/fileio/fdbufdataf.h	16 Nov 2009 22:26:02 -0000	1.2
+++ common/fileio/fdbufdataf.h	10 Sep 2010 18:14:57 -0000
@@ -78,8 +78,8 @@
     STDMETHOD(Close)			(THIS);
     STDMETHOD_(HXBOOL, Name)		(THIS_ REF(IHXBuffer*) pFileName);
     STDMETHOD_(HXBOOL, IsOpen)		(THIS);
-    STDMETHOD(Seek)			(THIS_ ULONG32 offset, UINT16 fromWhere);
-    STDMETHOD_(ULONG32, Tell)		(THIS);
+    STDMETHOD(Seek)			(THIS_ HX_OFF_T offset, UINT16 fromWhere);
+    STDMETHOD_(HX_OFF_T, Tell)		(THIS);
     STDMETHOD_(ULONG32, Read)		(THIS_ REF(IHXBuffer*) pBuf, ULONG32 count);
     STDMETHOD_(ULONG32, Write)		(THIS_ REF(IHXBuffer*) pBuf); 
     STDMETHOD(Flush)			(THIS);
@@ -106,7 +106,7 @@
 	
     int					m_nExternalFD;
     int					m_nMyFD;
-    UINT32				m_ulBaseOffset;
+    HX_OFF_T				m_ulBaseOffset;
     UINT32				m_ulLength;
 };
 
Index: common/fileio/fmemio.cpp
===================================================================
RCS file: /cvsroot/common/fileio/fmemio.cpp,v
retrieving revision 1.9
diff -u -r1.9 fmemio.cpp
--- common/fileio/fmemio.cpp	6 Jul 2007 20:35:11 -0000	1.9
+++ common/fileio/fmemio.cpp	10 Sep 2010 18:14:57 -0000
@@ -114,8 +114,8 @@
     return 0;
 }
 
-off_t 
-FMEMIO::seek(off_t off, LONG32 whence)
+HX_OFF_T 
+FMEMIO::seek(HX_OFF_T off, LONG32 whence)
 {
     HX_RESULT theErr = HXR_OK;
 
@@ -124,12 +124,12 @@
     if (!theErr)
     {
 	err = 0;
-	return (off_t) mMemFile->Tell();
+	return (HX_OFF_T) mMemFile->Tell();
     }
     else
     {
 	err = theErr;
-	return (off_t) -1;
+	return (HX_OFF_T) -1;
     }
 }
 
@@ -141,7 +141,7 @@
     return 0;
 }
 
-off_t
+HX_OFF_T
 FMEMIO::file_size()
 {
     HX_ASSERT(FALSE);
@@ -159,7 +159,7 @@
        mMemFile->Seek(lCurrPos, SEEK_SET);
 
        err = 0;
-       return (off_t) lFileSize;
+       return (HX_OFF_T) lFileSize;
      */
 }
 
Index: common/fileio/fsio.cpp
===================================================================
RCS file: /cvsroot/common/fileio/fsio.cpp,v
retrieving revision 1.13
diff -u -r1.13 fsio.cpp
--- common/fileio/fsio.cpp	5 Feb 2008 06:06:08 -0000	1.13
+++ common/fileio/fsio.cpp	10 Sep 2010 18:14:57 -0000
@@ -174,7 +174,7 @@
 
     ASSERT(reader.ptr <= reader.end);
 
-    off_t off = read_offset();
+    HX_OFF_T off = read_offset();
 
     Byte* b = reader.ptr;
     reader.ptr += size;
@@ -243,7 +243,7 @@
     /* truncate request if not enough data was read in */
     if (reader.ptr > reader.end)
     {
-	size = reader.end - b;
+	size = (int)(reader.end - b);
 	ASSERT(size >= 0);
 	reader.ptr = reader.end;
     }
@@ -251,14 +251,14 @@
     return b;
 }
 
-off_t
-FSIO::read_seek(off_t new_off, int whence)
+HX_OFF_T
+FSIO::read_seek(HX_OFF_T new_off, int whence)
 {
     // reset error
     err = 0;
 
     // Compute actual offset
-    off_t offset = read_offset();
+    HX_OFF_T offset = read_offset();
     switch (whence)
     {
 	case SEEK_SET:
@@ -328,9 +328,9 @@
 }
 
 Byte*
-FSIO::read_alloc(int& size, off_t new_off, int whence)
+FSIO::read_alloc(int& size, HX_OFF_T new_off, int whence)
 {
-    if (read_seek(new_off, whence) == (off_t)-1)
+    if (read_seek(new_off, whence) == (HX_OFF_T)-1)
 	return 0;
     return SIO::read_alloc(size);
 }
@@ -364,7 +364,7 @@
 
     ASSERT(writer.ptr <= writer.end);
 
-    off_t off = write_offset();
+    HX_OFF_T off = write_offset();
 
     Byte* b = writer.ptr;
     writer.ptr += size;
@@ -407,8 +407,8 @@
     return b;
 }
 
-off_t
-FSIO::write_seek(off_t new_off, int whence)
+HX_OFF_T
+FSIO::write_seek(HX_OFF_T new_off, int whence)
 {
     /*
      * Before calling write_seek, the program must ensure that all
@@ -423,7 +423,7 @@
     }
 
     // Compute actual offset
-    off_t offset = writer.creg->off;
+    HX_OFF_T offset = writer.creg->off;
 
     switch (whence)
     {
@@ -457,7 +457,7 @@
 }
 
 Byte*
-FSIO::write_alloc(int& size, off_t seek, int whence)
+FSIO::write_alloc(int& size, HX_OFF_T seek, int whence)
 {
     // XXX this code's been disabled since 1996 so it was removed
     // XXX incomplete
@@ -482,7 +482,7 @@
     {
 	if (reg == writer.creg)
 	{
-	    off_t off = write_offset();
+	    HX_OFF_T off = write_offset();
 
 	    writer.creg->limit = writer.end;
 	    writer.creg = new Region(writer.creg);
@@ -524,7 +524,7 @@
 	Region* next;
 	int flush_count = HX_SAFEINT(r->flush_off - r->off);
 	Byte* b = r->base + flush_count;
-	int count = r->limit - r->base - flush_count;
+	int count = (int)(r->limit - r->base - flush_count);
 
 	INT32 writecount = io->write(b, count);
 	would_block = 0;
@@ -605,7 +605,7 @@
 int
 FSIO::read_pushback(Byte* buf, int len)
 {
-	int space = reader.creg->limit - reader.end;
+	int space = (int)(reader.creg->limit - reader.end);
 	if (space < len)
 		len = space;
 	memcpy(reader.end, buf, len); /* Flawfinder: ignore */
@@ -614,7 +614,7 @@
 	return len;
 }
 
-off_t
+HX_OFF_T
 FSIO::file_size()
 {
     return io->file_size();
Index: common/fileio/hxbufdataf.h
===================================================================
RCS file: /cvsroot/common/fileio/hxbufdataf.h,v
retrieving revision 1.7
diff -u -r1.7 hxbufdataf.h
--- common/fileio/hxbufdataf.h	6 Jul 2007 20:35:11 -0000	1.7
+++ common/fileio/hxbufdataf.h	10 Sep 2010 18:14:57 -0000
@@ -114,10 +114,10 @@
      * error.
      */
     STDMETHOD(Seek)			(THIS_
-					ULONG32 offset, UINT16 fromWhere);
+					HX_OFF_T offset, UINT16 fromWhere);
 
     /* Tell returns the current file position in the file */
-    STDMETHOD_(ULONG32, Tell)		(THIS);
+    STDMETHOD_(HX_OFF_T, Tell)		(THIS);
 
     /* Read reads up to count bytes of data into buf.
      * returns the number of bytes read, EOF, or -1 if the read failed 
@@ -184,8 +184,8 @@
     ULONG32 m_Begin;		// beginning of buffer
     UINT32 m_BufSize;		// buffer size
     UINT32 m_BufFill;		// bytes in buffer from last fill
-    ULONG32 m_Offset;		// current seek offset
-    ULONG32 m_FileOffset;	// current seek offset in file
+    HX_OFF_T m_Offset;		// current seek offset
+    HX_OFF_T m_FileOffset;	// current seek offset in file
     ULONG32 m_FlushSize;	// current flushed size of file
     char* m_pBuf;		// buffer
     UINT32 m_Dirty;		// buffer has been written over
Index: common/fileio/hxdatasource.cpp
===================================================================
RCS file: /cvsroot/common/fileio/hxdatasource.cpp,v
retrieving revision 1.8
diff -u -r1.8 hxdatasource.cpp
--- common/fileio/hxdatasource.cpp	14 Mar 2008 18:28:31 -0000	1.8
+++ common/fileio/hxdatasource.cpp	10 Sep 2010 18:14:57 -0000
@@ -123,7 +123,7 @@
 }
 
 STDMETHODIMP CHXDataSource::Seek(
-            UINT32 offset, INT32 fromWhere)
+            HX_OFF_T offset, INT32 fromWhere)
 {
     HX_RESULT hxr = HXR_OK;
     if(fromWhere == SEEK_SET)
Index: common/fileio/hxxfile.cpp
===================================================================
RCS file: /cvsroot/common/fileio/hxxfile.cpp,v
retrieving revision 1.16
diff -u -r1.16 hxxfile.cpp
--- common/fileio/hxxfile.cpp	23 Feb 2010 18:57:49 -0000	1.16
+++ common/fileio/hxxfile.cpp	10 Sep 2010 18:14:57 -0000
@@ -241,14 +241,14 @@
 }
 
 
-ULONG32 HXXFile::GetFileLength(FILE* in)
+HX_OFF_T HXXFile::GetFileLength(FILE* in)
 {
 #ifdef _OPENWAVE
     HX_ASSERT(!"HXXFile::GetFileLength() not implemented!");
     return 0;
 #else
-	ULONG32 was;
-	ULONG32	length;
+	HX_OFF_T was;
+	HX_OFF_T length;
 
 	was = ftell(in);
 	fseek(in, 0, 2);
@@ -276,7 +276,7 @@
 	FILE*		fileIn = NULL;
 	FILE*		fileOut = NULL;
 	HXBOOL		bTheResult = FALSE;
-	ULONG32 	length = 0;
+	HX_OFF_T 	length = 0;
 
 	GetReasonableLocalFileName(fileNameIn);
 	GetReasonableLocalFileName(fileNameOut);
Index: common/fileio/packet_file_object.cpp
===================================================================
RCS file: /cvsroot/common/fileio/packet_file_object.cpp,v
retrieving revision 1.3
diff -u -r1.3 packet_file_object.cpp
--- common/fileio/packet_file_object.cpp	17 Aug 2009 16:15:40 -0000	1.3
+++ common/fileio/packet_file_object.cpp	10 Sep 2010 18:14:57 -0000
@@ -215,8 +215,10 @@
     return HXR_NOTIMPL;
 }
 
-STDMETHODIMP CHXPacketFileObject::Seek(ULONG32 ulOffset, HXBOOL bRelative)
+STDMETHODIMP CHXPacketFileObject::Seek(HX_OFF_T offset, HXBOOL bRelative)
 {
+    UINT32 ulOffset = (UINT32)offset; //XXX not 64-bit safe
+
     HXLOGL4(HXLOG_GENE, "CHXPacketFileObject[%p]::Seek(offset=%lu,bRelative=%lu)", this, ulOffset, bRelative);
     HX_RESULT retVal = HXR_UNEXPECTED;
 
@@ -237,7 +239,7 @@
         UINT32 ulNewOffset = ulOffset;
         if (bRelative)
         {
-            ulNewOffset = m_ulFileOffset + ulOffset;
+            ulNewOffset = (UINT32)m_ulFileOffset + ulOffset;
         }
         // We will allow seeks to the very end of the file, but not beyond
         if (m_ulFileSize && ulNewOffset > m_ulFileSize)
@@ -663,7 +665,7 @@
     }
 }
 
-void CHXPacketFileObject::PurgeQueueToOffset(UINT32 ulFileOffset)
+void CHXPacketFileObject::PurgeQueueToOffset(HX_OFF_T ulFileOffset)
 {
     // Lock the mutex
     if (m_pBufferQueueMutex)
@@ -708,8 +710,9 @@
     }
 }
 
-HX_RESULT CHXPacketFileObject::ReadFromBufferQueue(UINT32 ulFileOffset, UINT32 ulNumBytes, REF(IHXBuffer*) rpBuffer)
+HX_RESULT CHXPacketFileObject::ReadFromBufferQueue(HX_OFF_T offset, UINT32 ulNumBytes, REF(IHXBuffer*) rpBuffer)
 {
+    UINT32 ulFileOffset = (UINT32)offset; //XXX not 64-bit safe
     HX_RESULT retVal = HXR_UNEXPECTED;
 
     HX_ASSERT(rpBuffer == NULL);
@@ -850,7 +853,7 @@
     // m_ulFileOffset is the file offset from the last successful read.
     else if (m_ulFileOffset)
     {
-        ulRet = m_ulFileOffset - 1;
+        ulRet = (UINT32)m_ulFileOffset - 1; //XXX not 64-bit safe
     }
 
     return ulRet;
@@ -879,7 +882,7 @@
     // m_ulFileOffset is the file offset from the last successful read.
     else if (m_ulFileOffset)
     {
-        ulRet = m_ulFileOffset - 1;
+        ulRet = (UINT32)m_ulFileOffset - 1; //XXX not 64-bit safe
     }
 
     return ulRet;
@@ -906,7 +909,7 @@
                 // extend past the end of the file
                 if (m_ulFileSize && m_ulFileOffset + ulCount > m_ulFileSize)
                 {
-                    ulCount = m_ulFileSize - m_ulFileOffset;
+                    ulCount = m_ulFileSize - (UINT32)m_ulFileOffset; //XXX not 64-bit safe
                 }
                 // See if we can fulfill the request
                 IHXBuffer* pBuffer = NULL;
Index: common/fileio/single_buffer_file_object.cpp
===================================================================
RCS file: /cvsroot/common/fileio/single_buffer_file_object.cpp,v
retrieving revision 1.5
diff -u -r1.5 single_buffer_file_object.cpp
--- common/fileio/single_buffer_file_object.cpp	2 Dec 2008 14:01:05 -0000	1.5
+++ common/fileio/single_buffer_file_object.cpp	10 Sep 2010 18:14:57 -0000
@@ -186,12 +186,13 @@
                 UINT32 ulBytesToRead = ulCount;
                 if (m_ulFileOffset + ulCount > m_pBuffer->GetSize())
                 {
-                    ulBytesToRead = m_pBuffer->GetSize() - m_ulFileOffset;
+                    ulBytesToRead =
+                        (UINT32)(m_pBuffer->GetSize() - m_ulFileOffset);
                 }
                 // Construct a nested buffer of this size
                 IHXBuffer* pReadBuffer = NULL;
-                retVal = CHXNestedBuffer::CreateNestedBuffer(m_pBuffer, m_ulFileOffset,
-                                                             ulBytesToRead, pReadBuffer);
+                retVal = CHXNestedBuffer::CreateNestedBuffer(m_pBuffer,
+                    (UINT32)m_ulFileOffset, ulBytesToRead, pReadBuffer);
                 if (SUCCEEDED(retVal))
                 {
                     // Update the file offset
@@ -222,8 +223,10 @@
     return HXR_NOTIMPL;
 }
 
-STDMETHODIMP CHXSingleBufferFileObject::Seek(ULONG32 ulOffset, HXBOOL bRelative)
+STDMETHODIMP CHXSingleBufferFileObject::Seek(HX_OFF_T offset, HXBOOL bRelative)
 {
+    UINT32 ulOffset = (UINT32)offset; //XXX not 64-but safe, but this is a single-buffer file, so this should be fine
+
     HXLOGL4(HXLOG_FLVR, "CHXSingleBufferFileObject[%p]::Seek(offset=%lu,bRelative=%lu)", this, ulOffset, bRelative);
     HX_RESULT retVal = HXR_UNEXPECTED;
 
@@ -235,7 +238,7 @@
         UINT32 ulNewOffset = ulOffset;
         if (bRelative)
         {
-            ulNewOffset = m_ulFileOffset + ulOffset;
+            ulNewOffset = (UINT32)(m_ulFileOffset + ulOffset);
         }
         // We will allow seeks to the very end of the file, but not beyond
         if (ulNewOffset <= m_pBuffer->GetSize())
@@ -430,7 +433,7 @@
     {
 	CHXString strLocalURL(pszURL);
 	HXXFile::GetReasonableLocalFileName(strLocalURL);	// Strip off protocol, for FileExists
-	INT16 nSep = strLocalURL.ReverseFind('?');
+	INT16 nSep = (INT16)strLocalURL.ReverseFind('?');
 	if (nSep >= 0)
 	{
 	    strLocalURL = strLocalURL.Left(nSep);		 // Strip off the options from the URL
Index: common/fileio/sio.cpp
===================================================================
RCS file: /cvsroot/common/fileio/sio.cpp,v
retrieving revision 1.8
diff -u -r1.8 sio.cpp
--- common/fileio/sio.cpp	6 Jul 2007 20:35:11 -0000	1.8
+++ common/fileio/sio.cpp	10 Sep 2010 18:14:57 -0000
@@ -80,7 +80,7 @@
 }
 
 SIO::Region*
-SIO::Region_list::find(off_t offt, SIO::Region**& regp)
+SIO::Region_list::find(HX_OFF_T offt, SIO::Region**& regp)
 {
     Region* r;
     Region **rp;
Index: common/fileio/unbufdataf.h
===================================================================
RCS file: /cvsroot/common/fileio/unbufdataf.h,v
retrieving revision 1.7
diff -u -r1.7 unbufdataf.h
--- common/fileio/unbufdataf.h	6 Jul 2007 20:35:11 -0000	1.7
+++ common/fileio/unbufdataf.h	10 Sep 2010 18:14:57 -0000
@@ -115,10 +115,10 @@
      * error.
      */
     STDMETHOD(Seek)			(THIS_
-					ULONG32 offset, UINT16 fromWhere);
+					HX_OFF_T offset, UINT16 fromWhere);
 
     /* Tell returns the current file position in the file */
-    STDMETHOD_(ULONG32, Tell)		(THIS);
+    STDMETHOD_(HX_OFF_T, Tell)		(THIS);
 
     /* Read reads up to count bytes of data into buf.
      * returns the number of bytes read, EOF, or -1 if the read failed 
Index: common/fileio/platform/unix/cunixf.cpp
===================================================================
RCS file: /cvsroot/common/fileio/platform/unix/cunixf.cpp,v
retrieving revision 1.11
diff -u -r1.11 cunixf.cpp
--- common/fileio/platform/unix/cunixf.cpp	19 Jan 2009 23:30:46 -0000	1.11
+++ common/fileio/platform/unix/cunixf.cpp	10 Sep 2010 18:14:57 -0000
@@ -204,7 +204,7 @@
 // Seek moves the current file position to the offset from the fromWhere
 // specifier returns HXR_OK or HXR_INVALID_FILE if an error occurred
 
-HX_RESULT CUnixFile::Seek(ULONG32 offset, UINT16 fromWhere)
+HX_RESULT CUnixFile::Seek(HX_OFF_T offset, UINT16 fromWhere)
 {
         if ( mFD > 0 )
         {
@@ -239,9 +239,9 @@
 
 // Tell returns the current file position
 // returns HXR_OK or -1 if an error occurred
-ULONG32 CUnixFile::Tell(void)
+HX_OFF_T CUnixFile::Tell(void)
 {   
-        long offset = -1;
+        HX_OFF_T offset = (HX_OFF_T)-1;
         if ( mFD > 0 )
         {
            mLastError = HXR_OK;       
@@ -259,7 +259,7 @@
 				mLastError = errno;
 			}
         }
-        return (ULONG32)offset;
+        return offset;
 }
 
 /*      Read reads up to count bytes of data into buf.
Index: common/fileio/platform/unix/cunixf.h
===================================================================
RCS file: /cvsroot/common/fileio/platform/unix/cunixf.h,v
retrieving revision 1.7
diff -u -r1.7 cunixf.h
--- common/fileio/platform/unix/cunixf.h	6 Jul 2007 20:35:16 -0000	1.7
+++ common/fileio/platform/unix/cunixf.h	10 Sep 2010 18:14:57 -0000
@@ -78,11 +78,11 @@
 /*      Seek moves the current file position to the offset from the
         fromWhere specifier returns HXR_OK or -1 if an error occurred */
 
-        virtual HX_RESULT		Seek(ULONG32 offset, UINT16 fromWhere);
+        virtual HX_RESULT		Seek(HX_OFF_T offset, UINT16 fromWhere);
 
 /*      Tell returns the current file position in the file */
 
-        virtual ULONG32        Tell(void);
+        virtual HX_OFF_T       Tell(void);
 
 /*      Read reads up to count bytes of data into buf.
         returns the number of bytes read, EOF, or -1 if the read failed */
Index: common/fileio/platform/unix/hxbufdataf.cpp
===================================================================
RCS file: /cvsroot/common/fileio/platform/unix/hxbufdataf.cpp,v
retrieving revision 1.13
diff -u -r1.13 hxbufdataf.cpp
--- common/fileio/platform/unix/hxbufdataf.cpp	6 Jul 2007 20:35:16 -0000	1.13
+++ common/fileio/platform/unix/hxbufdataf.cpp	10 Sep 2010 18:14:57 -0000
@@ -321,7 +321,7 @@
 // Method
 //     HXBufferedDataFile::Seek:
 // Purpose:
-//     Just move the seek offset according to the value of whense.
+//     Just move the seek offset according to the value of whence.
 //     This only sets the local idea of the current offset, no system
 //     level seek is performed.  If seek is ok, the current value of
 //     seek offset is returned.  Otherwise -1 is returned.
@@ -332,23 +332,41 @@
 //       the offset is passed in as an unsigned, it should be signed to
 //       allow seeks in both directions.  Right now we do the ugly cast.
 //
+//     XXXDC: 31-Aug-2010
+//       64-bit file seek/tell operations use signed offsets by default
+//
 STDMETHODIMP
-HXBufferedDataFile::Seek(ULONG32 offset, UINT16 whense)
+HXBufferedDataFile::Seek(HX_OFF_T offset, UINT16 whence)
 {
-    ULONG32 size = 0;
-    LONG32 signed_offset = (LONG32) offset;
+#if defined(_LONG_IS_64) || defined(_WIN64) || defined(_LARGEFILE_SOURCE) || defined(_LARGEFILE64_SOURCE)
+    UINT64 size = 0;
+
+    if (whence == SEEK_SET && offset >= 0)
+	m_Offset = offset;
+    else if (whence == SEEK_CUR && m_Offset + offset >= 0)
+	m_Offset += offset;
+    else if (whence == SEEK_END &&
+	     (size = LogicalSize()) + offset >= 0)
+	m_Offset = size + offset;
+    else
+	return HXR_FAIL;
+#else
+    UINT32 size = 0;
+    INT32 signed_offset = (INT32)offset;
 
-    if (whense == SEEK_SET && signed_offset >= 0)
+    if (whence == SEEK_SET && signed_offset >= 0)
 	m_Offset = signed_offset;
-    else if (whense == SEEK_CUR && (LONG32) m_Offset + signed_offset >= 0)
+    else if (whence == SEEK_CUR && (LONG32) m_Offset + signed_offset >= 0)
 	m_Offset += signed_offset;
-    else if (whense == SEEK_END &&
+    else if (whence == SEEK_END &&
 	     (LONG32) (size = LogicalSize()) + signed_offset >= 0)
 	m_Offset = size + signed_offset;
     else
 	return HXR_FAIL;
+#endif
 
     return HXR_OK;
+
 }
 
 /////////////////////////////////////////////////////////////////////////
@@ -358,7 +376,7 @@
 // Purpose:
 //      Tell returns the current (logical) file position in the file
 //
-STDMETHODIMP_(ULONG32)
+STDMETHODIMP_(HX_OFF_T)
 HXBufferedDataFile::Tell()
 {
     return m_Offset;
@@ -377,7 +395,7 @@
 //
 //        0, if the current seek pointer is at or beyond the end of file.
 //      
-//        -1, if errors occure.  The LastError() member function returns
+//        -1, if errors occur.  The LastError() member function returns
 //        the errno of the last system request.
 //
 STDMETHODIMP_(ULONG32)
@@ -397,8 +415,8 @@
 	    if (m_Begin <= m_Offset && m_Offset < m_Begin + m_BufFill ||
 		(m_Offset < FlushSize() && (rval = NewBuf()) > 0))
 	    {
-		UINT32 off = m_Offset - m_Begin;  // offset within buffer
-						 // and how much to copy
+		HX_OFF_T off = m_Offset - m_Begin;  // offset within buffer
+						    // and how much to copy
 		UINT32 ncopy = m_Begin + m_BufFill - m_Offset;
 		if (nleft < ncopy)
 		    ncopy = nleft;
@@ -447,7 +465,7 @@
 	    if (m_Begin <= m_Offset && m_Offset < m_Begin + m_BufSize ||
 		(rval = NewBuf()) >= 0)
 	    {
-		UINT32 off = m_Offset - m_Begin;  // offset within buffer
+		HX_OFF_T off = m_Offset - m_Begin;  // offset within buffer
 						  // and how much to copy
 		UINT32 ncopy = m_Begin + m_BufSize - m_Offset;
 		if (nleft < ncopy)
Index: common/fileio/platform/unix/mmapdatf.cpp
===================================================================
RCS file: /cvsroot/common/fileio/platform/unix/mmapdatf.cpp,v
retrieving revision 1.20
diff -u -r1.20 mmapdatf.cpp
--- common/fileio/platform/unix/mmapdatf.cpp	26 Jan 2010 20:17:49 -0000	1.20
+++ common/fileio/platform/unix/mmapdatf.cpp	10 Sep 2010 18:14:57 -0000
@@ -417,9 +417,9 @@
  * error.
  */
 STDMETHODIMP
-MemoryMapDataFile::Seek(ULONG32 offset, UINT16 fromWhere)
+MemoryMapDataFile::Seek(HX_OFF_T offset, UINT16 fromWhere)
 {
-    ULONG32 offset2 = 0;
+    HX_OFF_T offset2 = 0;
     m_ulLastError = HXR_OK;
 
     switch (fromWhere)
@@ -457,7 +457,7 @@
 	}
 	else
 	{
-	    if (((LONG32) offset2) > 0)
+	    if (offset2 > 0)
 	    {
 		return Seek(offset2, SEEK_CUR);
 	    }
@@ -469,10 +469,10 @@
 
 
 /* Tell returns the current file position in the file */
-STDMETHODIMP_(ULONG32)
+STDMETHODIMP_(HX_OFF_T)
 MemoryMapDataFile::Tell()
 {
-    INT32 offset = -1;
+    HX_OFF_T offset = (HX_OFF_T)-1;
     if (MmapHandle)
     {
 	return m_ulPos;
@@ -486,7 +486,7 @@
 	    m_ulLastError = errno;
 	}
     }
-    return (ULONG32)offset;
+    return offset;
 }
 
 void
Index: common/fileio/platform/unix/mmapdatf.h
===================================================================
RCS file: /cvsroot/common/fileio/platform/unix/mmapdatf.h,v
retrieving revision 1.6
diff -u -r1.6 mmapdatf.h
--- common/fileio/platform/unix/mmapdatf.h	6 Jul 2007 20:35:16 -0000	1.6
+++ common/fileio/platform/unix/mmapdatf.h	10 Sep 2010 18:14:57 -0000
@@ -120,10 +120,10 @@
      * error.
      */
     STDMETHOD(Seek)			(THIS_
-					ULONG32 offset, UINT16 fromWhere);
+					HX_OFF_T offset, UINT16 fromWhere);
 
     /* Tell returns the current file position in the file */
-    STDMETHOD_(ULONG32, Tell)		(THIS);
+    STDMETHOD_(HX_OFF_T, Tell)		(THIS);
 
     /* Read reads up to count bytes of data into buf.
      * returns the number of bytes read, EOF, or -1 if the read failed 
Index: common/fileio/platform/unix/unbufdataf.cpp
===================================================================
RCS file: /cvsroot/common/fileio/platform/unix/unbufdataf.cpp,v
retrieving revision 1.8
diff -u -r1.8 unbufdataf.cpp
--- common/fileio/platform/unix/unbufdataf.cpp	6 Jul 2007 20:35:16 -0000	1.8
+++ common/fileio/platform/unix/unbufdataf.cpp	10 Sep 2010 18:14:57 -0000
@@ -262,7 +262,7 @@
  * error.
  */
 STDMETHODIMP
-UnBufferedDataFile::Seek(ULONG32 offset, UINT16 fromWhere)
+UnBufferedDataFile::Seek(HX_OFF_T offset, UINT16 fromWhere)
 {
     if (m_nFD > 0)
     {
@@ -279,10 +279,10 @@
 
 
 /* Tell returns the current file position in the file */
-STDMETHODIMP_(ULONG32)
+STDMETHODIMP_(HX_OFF_T)
 UnBufferedDataFile::Tell()
 {
-    INT32 offset = -1;
+    HX_OFF_T offset = (HX_OFF_T)-1;
     if (m_nFD > 0)
     {
 	m_ulLastError = HXR_OK;       
@@ -292,7 +292,7 @@
 	    m_ulLastError = errno;
 	}
     }
-    return (ULONG32)offset;
+    return offset;
 }
 
 
Index: common/fileio/platform/win/cwinfile.cpp
===================================================================
RCS file: /cvsroot/common/fileio/platform/win/cwinfile.cpp,v
retrieving revision 1.10
diff -u -r1.10 cwinfile.cpp
--- common/fileio/platform/win/cwinfile.cpp	12 Dec 2007 18:44:34 -0000	1.10
+++ common/fileio/platform/win/cwinfile.cpp	10 Sep 2010 18:14:57 -0000
@@ -244,7 +244,7 @@
 
 // Simply uses stat to get the size of the file in bytes.  If the file
 // is closed, it will still work.
-ULONG32 CWinFile::GetSize(void)
+UINT32 CWinFile::GetSize(void)
 {
     struct _stat filestats;
     if (mFD >= 0) 
@@ -256,12 +256,12 @@
 }
 
 
-HX_RESULT CWinFile::ChangeSize	(ULONG32 newSize)
+HX_RESULT CWinFile::ChangeSize	(UINT32 newSize)
 {
     if (mFD >= 0)
     {
         // Ff the file pointer is passed the new size, we ought to position it in a valid spot.
-        ULONG32 pos = Tell();
+        HX_OFF_T pos = Tell();
         if (pos > newSize)
             Seek(newSize, SEEK_SET);
                 
@@ -277,7 +277,7 @@
 // Seek moves the current file position to the offset from the fromWhere
 // specifier returns HXR_OK or HXR_INVALID_FILE if an error occurred
 
-HX_RESULT CWinFile::Seek(ULONG32 offset, UINT16 fromWhere)
+HX_RESULT CWinFile::Seek(HX_OFF_T offset, UINT16 fromWhere)
 {
 	if ( mFD >= 0 )
 	{
@@ -312,9 +312,9 @@
 
 // Tell returns the current file position
 // returns HXR_OK or -1 if an error occurred
-ULONG32 CWinFile::Tell(void)
+HX_OFF_T CWinFile::Tell(void)
 {   
-	long offset = -1;
+	HX_OFF_T offset = -1;
 
 	if ( mFD >= 0 )
 	{
@@ -324,7 +324,7 @@
 			mLastError = HXR_INVALID_FILE;
 		}
 	}
-	return (ULONG32)offset;
+	return offset;
 }
 
 /*      Read reads up to count bytes of data into buf.
@@ -337,7 +337,7 @@
 	if ( mFD >= 0 )
 	{ 
 		mLastError = HXR_OK;
-		ULONG32 tmpCheck = Tell();
+		HX_OFF_T tmpCheck = Tell();
 
 		HX_ASSERT(count < UINT_MAX);
 
Index: common/fileio/platform/win/filespecutils.cpp
===================================================================
RCS file: /cvsroot/common/fileio/platform/win/filespecutils.cpp,v
retrieving revision 1.19
diff -u -r1.19 filespecutils.cpp
--- common/fileio/platform/win/filespecutils.cpp	6 Jan 2009 10:38:51 -0000	1.19
+++ common/fileio/platform/win/filespecutils.cpp	10 Sep 2010 18:14:57 -0000
@@ -840,7 +840,7 @@
         void* pBufData = pOutBuffer->GetBuffer();
         int nRead;
 
-        nRead = fread(pBufData, 1, aStatBuf.st_size, pFile);
+        nRead = (int)fread(pBufData, 1, aStatBuf.st_size, pFile);
 
         HX_ASSERT(nRead == aStatBuf.st_size);
     }
@@ -872,7 +872,7 @@
         goto bail;
 
     fseek(f, 0, SEEK_END);
-    cbFile = ftell(f);
+    cbFile = (long)ftell(f); //XXX not 64-bit safe
     if(!cbFile)
         goto bail;
 
@@ -907,12 +907,10 @@
     FILE* pFile = fopen(fileSpec.GetPathName(), "wb");
     if(pFile)
     {
-        int nWritten;
         int nBufferSize = inBuffer->GetSize();
         void* pBufferData = inBuffer->GetBuffer();
-
-        nWritten = fwrite(pBufferData, 1, nBufferSize, pFile);
-        if (nWritten == nBufferSize)
+        size_t nWritten = fwrite(pBufferData, 1, nBufferSize, pFile);
+        if (nWritten == (size_t)nBufferSize)
         {
             res = HXR_OK;
         }
Index: common/fileio/platform/win/mmapdatf.cpp
===================================================================
RCS file: /cvsroot/common/fileio/platform/win/mmapdatf.cpp,v
retrieving revision 1.15
diff -u -r1.15 mmapdatf.cpp
--- common/fileio/platform/win/mmapdatf.cpp	19 Jan 2010 23:14:27 -0000	1.15
+++ common/fileio/platform/win/mmapdatf.cpp	10 Sep 2010 18:14:57 -0000
@@ -75,7 +75,7 @@
     : m_lRefCount(0)
     , m_hFile(INVALID_HANDLE_VALUE)
     , m_pFilename(0)
-    , m_ulPos(-1)
+    , m_nPos(-1)
     , MmapHandle(0)
     , m_ulChunkSize(ulChunkSize)
     , m_ulLastError(HXR_OK)
@@ -323,7 +323,7 @@
 	    return HXR_FAIL;
 	}
     }
-    m_ulPos = 0;
+    m_nPos = 0;
 
 //  On windows we do now want to use memory mapped IO if we are going across
 //  a network share. And we only want to disable this for clients, not servers.
@@ -453,7 +453,7 @@
 	    return HXR_FAIL;
 	}
     }
-    m_ulPos = 0;
+    m_nPos = 0;
 
     if (MmapHandle)
     {
@@ -506,7 +506,7 @@
 	CloseHandle(m_hFile);
 	m_hFile = INVALID_HANDLE_VALUE;
     }
-    m_ulPos = -1;
+    m_nPos = -1;
 
     if (MmapHandle)
     {
@@ -564,9 +564,9 @@
  * error.
  */
 STDMETHODIMP
-MemoryMapDataFile::Seek(ULONG32 offset, UINT16 fromWhere)
+MemoryMapDataFile::Seek(HX_OFF_T offset, UINT16 fromWhere)
 {
-    LONG32 lHighOffset = 0;
+    HX_OFF_T lHighOffset = 0;
     m_ulLastError = HXR_OK;
 
     DWORD fw = 0;
@@ -574,7 +574,7 @@
     {
 	case SEEK_CUR:
 	    fw = FILE_CURRENT;
-	    m_ulPos += offset;
+	    m_nPos += offset;
 	    if (((LONG32) offset) < 0)
 	    {
 		lHighOffset = -1;
@@ -583,42 +583,47 @@
 
 	case SEEK_END:
 	    fw = FILE_END;
-	    if (offset > m_ulPos)
+	    if (offset > m_nPos)
 	    {
-		m_ulPos = 0;
+		m_nPos = 0;
 	    }
 	    else
 	    {
-		m_ulPos -= offset;
+		m_nPos -= offset;
 	    }
 	    break;
 
 	case SEEK_SET:
 	    fw = FILE_BEGIN;
-	    m_ulPos = offset;
+	    m_nPos = offset;
 	    break;
     }
 
-    DWORD dwRet = SetFilePointer(m_hFile, offset, &lHighOffset, fw);
-    if (dwRet == -1)
+    LARGE_INTEGER liOffset;
+    LARGE_INTEGER liNewFilePtr;
+    liOffset.QuadPart = offset;
+    liNewFilePtr.QuadPart = 0;
+    BOOL bRet = SetFilePointerEx(m_hFile, liOffset, &liNewFilePtr, fw);
+    if (bRet != 0)
     {
 	if (GetLastError() != NO_ERROR)
 	{
-	    m_ulPos = -1;
+	    m_nPos = -1;
 	    m_ulLastError = HXR_FAIL;
 	    return HXR_FAIL;
 	}
     }
+
     
     return 0;
 }
 
 /* Tell returns the current file position in the file */
-STDMETHODIMP_(ULONG32)
+STDMETHODIMP_(HX_OFF_T)
 MemoryMapDataFile::Tell()
 {
     m_ulLastError = HXR_OK;
-    return m_ulPos;
+    return m_nPos;
 }
 
 void MemoryMapDataFile::StopMmap()
@@ -627,7 +632,7 @@
 	return;
     m_zpMMM->CloseMap(MmapHandle);
     MmapHandle = 0;
-    Seek(m_ulPos, SEEK_SET);
+    Seek(m_nPos, SEEK_SET);
 }
 
 /* Read reads up to count bytes of data into buf.
@@ -648,7 +653,7 @@
 
     if (MmapHandle)
     {
-	ulRead = m_zpMMM->GetBlock(pBuf, MmapHandle, m_ulPos, count);
+	ulRead = m_zpMMM->GetBlock(pBuf, MmapHandle, (UINT32)m_nPos, count); //not 64-bit safe
 	if (ulRead >= MMAP_EXCEPTION)
 	{
 	    if (ulRead != MMAP_EOF_EXCEPTION)
@@ -657,14 +662,14 @@
 	    }
 	    else
 	    {
-		Seek(m_ulPos, SEEK_SET);
+		Seek(m_nPos, SEEK_SET);
 	    }
 
 	    goto normal_read;
 	}
 	if (ulRead > 0)
 	{
-	    m_ulPos += ulRead;
+	    m_nPos += ulRead;
 	}
 	return ulRead;
     }
@@ -700,7 +705,7 @@
 	    }
 	}
 
-	m_ulPos += ulRead;
+	m_nPos += ulRead;
 
 	if (ulRead < count)
 	{
Index: common/fileio/platform/win/mmapdatf.h
===================================================================
RCS file: /cvsroot/common/fileio/platform/win/mmapdatf.h,v
retrieving revision 1.6
diff -u -r1.6 mmapdatf.h
--- common/fileio/platform/win/mmapdatf.h	6 Jul 2007 20:35:17 -0000	1.6
+++ common/fileio/platform/win/mmapdatf.h	10 Sep 2010 18:14:57 -0000
@@ -118,10 +118,10 @@
      * error.
      */
     STDMETHOD(Seek)			(THIS_
-					ULONG32 offset, UINT16 fromWhere);
+					HX_OFF_T offset, UINT16 fromWhere);
 
     /* Tell returns the current file position in the file */
-    STDMETHOD_(ULONG32, Tell)		(THIS);
+    STDMETHOD_(HX_OFF_T, Tell)		(THIS);
 
     /* Read reads up to count bytes of data into buf.
      * returns the number of bytes read, EOF, or -1 if the read failed 
@@ -171,7 +171,7 @@
     HANDLE m_hFile;
     INT32 m_lRefCount;
     char* m_pFilename;
-    UINT32 m_ulPos;
+    HX_OFF_T m_nPos;
     void*				MmapHandle;
     IUnknown*				m_pContext;
     UINT16				m_uOpenMode;
Index: common/fileio/platform/win/mmfile.cpp
===================================================================
RCS file: /cvsroot/common/fileio/platform/win/mmfile.cpp,v
retrieving revision 1.7
diff -u -r1.7 mmfile.cpp
--- common/fileio/platform/win/mmfile.cpp	6 Jul 2007 20:35:17 -0000	1.7
+++ common/fileio/platform/win/mmfile.cpp	10 Sep 2010 18:14:57 -0000
@@ -88,13 +88,10 @@
 }
 
 HX_RESULT 
-_CBufferWinMemMapped::_SetMapping
-(
-    HANDLE hfmoFile, 
-    UINT32 ulOffsetHigh, 
-    UINT32 ulOffsetLow , 
-    UINT32 ulLength
-)
+_CBufferWinMemMapped::_SetMapping (HANDLE hfmoFile, 
+                                   UINT32 ulOffsetHigh, 
+                                   UINT32 ulOffsetLow, 
+                                   UINT32 ulLength)
 {
     _UnMap();
     
@@ -103,25 +100,20 @@
 	return HXR_INVALID_PARAMETER;
     }
 
-    m_ulOffset = ulOffsetLow%_AllocGran();
-    if (m_ulOffset < ulOffsetLow)
+    m_nOffset = ulOffsetLow % _AllocGran();
+    if (m_nOffset < ulOffsetLow)
     {
-	ulOffsetLow -= m_ulOffset;
+	ulOffsetLow -= (UINT32)m_nOffset;
     }
     else
     {
-	m_ulOffset = ulOffsetLow;
+	m_nOffset = ulOffsetLow;
 	ulOffsetLow = 0;
     }
 
-    m_pData = (UCHAR*)MapViewOfFile
-    (
-	hfmoFile, 
-	FILE_MAP_READ,
-	ulOffsetHigh, 
-	ulOffsetLow, 
-	ulLength+m_ulOffset
-    );
+    m_pData = (UCHAR*)MapViewOfFile (hfmoFile, FILE_MAP_READ,
+	                             ulOffsetHigh, ulOffsetLow, 
+	                             ulLength + m_nOffset);
 
     if(m_pData)
     {
@@ -284,11 +276,8 @@
 
 /*  Seek moves the current file position to the offset from the fromWhere 
 specifier */
-HX_RESULT	CWin32MMFile::Seek
-(
-    ULONG32 offset, 
-    UINT16 fromWhere
-)
+HX_RESULT CWin32MMFile::Seek (HX_OFF_T offset, 
+                              UINT16 fromWhere)
 {
     if(!m_hfmoFile)
     {
@@ -300,7 +289,7 @@
     case SEEK_SET:
 	{
 	    m_ulPositionHigh = 0;
-	    m_ulPositionLow = offset;
+	    m_ulPositionLow = (UINT32)offset; //XXX not 64-bit safe
 	}
 	break;
     case SEEK_END:
@@ -312,7 +301,7 @@
 	// Then do the offset..
     case SEEK_CUR:
 	{
-	    m_ulPositionLow += offset;
+	    m_ulPositionLow += (UINT32)offset; //XXX not 64-bit safe
 
 	    // Handle overflow
 	    //
@@ -328,11 +317,11 @@
 }
 
 /*  Tell returns the current file position in the ra file */
-ULONG32	CWin32MMFile::Tell		(void)
+HX_OFF_T CWin32MMFile::Tell (void)
 {
     if (!m_hfmoFile || m_ulPositionHigh)
     {
-	return UINT32(-1);
+	return (HX_OFF_T)-1;
     }
 
     return m_ulPositionLow;
Index: common/fileio/platform/win/winff.cpp
===================================================================
RCS file: /cvsroot/common/fileio/platform/win/winff.cpp,v
retrieving revision 1.9
diff -u -r1.9 winff.cpp
--- common/fileio/platform/win/winff.cpp	6 Jul 2007 20:35:17 -0000	1.9
+++ common/fileio/platform/win/winff.cpp	10 Sep 2010 18:14:57 -0000
@@ -137,11 +137,11 @@
     UINT16 ulPatLen = 0;
     if (m_pattern)
     {
-	ulPatLen = strlen(m_pattern);
+	ulPatLen = (UINT16)strlen(m_pattern);
     }
 
     /* 1 for \ and 1 for NULL at end */
-    UINT32 ulLen = strlen(dirname) + ulPatLen + 2;
+    UINT32 ulLen = (UINT32)(strlen(dirname) + ulPatLen + 2);
     m_pCurrentDirectory = new char[ulLen];
     if (!m_pCurrentDirectory)
 	return FALSE;
Index: common/fileio/platform/win/winfile.cpp
===================================================================
RCS file: /cvsroot/common/fileio/platform/win/winfile.cpp,v
retrieving revision 1.9
diff -u -r1.9 winfile.cpp
--- common/fileio/platform/win/winfile.cpp	6 Jul 2007 20:35:17 -0000	1.9
+++ common/fileio/platform/win/winfile.cpp	10 Sep 2010 18:14:57 -0000
@@ -64,7 +64,7 @@
 : m_lRefCount(0)
 , m_hFile(INVALID_HANDLE_VALUE)
 , m_pFilename(0)
-, m_ulPos(-1)
+, m_nPos(-1)
 , m_pContext(pContext)
 {
     HX_ADDREF(m_pContext);
@@ -212,7 +212,7 @@
     {
 	return HXR_FAIL;
     }
-    m_ulPos = 0;
+    m_nPos = 0;
     return HXR_OK;
 	
 }
@@ -231,7 +231,7 @@
 	CloseHandle(m_hFile);
 	m_hFile = INVALID_HANDLE_VALUE;
     }
-    m_ulPos = -1;
+    m_nPos = -1;
     return HXR_OK;
 }
 
@@ -276,43 +276,42 @@
  * error.
  */
 STDMETHODIMP
-WinFile::Seek(ULONG32 offset, UINT16 fromWhere)
+WinFile::Seek(HX_OFF_T offset, UINT16 fromWhere)
 {
     DWORD fw = 0;
     switch (fromWhere)
     {
 	case SEEK_CUR:
 	    fw = FILE_CURRENT;
-	    m_ulPos += offset;
+	    m_nPos += offset;
 	    break;
 
 	case SEEK_END:
 	    fw = FILE_END;
-	    if (offset > m_ulPos)
+	    if (offset > m_nPos)
 	    {
-		m_ulPos = 0;
+		m_nPos = 0;
 	    }
 	    else
 	    {
-		m_ulPos -= offset;
+		m_nPos -= offset;
 	    }
 	    break;
 
 	case SEEK_SET:
 	    fw = FILE_BEGIN;
-	    m_ulPos = offset;
+	    m_nPos = offset;
 	    break;
     }
 
     DWORD dwRet;
-    dwRet = SetFilePointer(m_hFile,
-	offset,
-	NULL,
-	fw);
+    LARGE_INTEGER liOffset;
+    liOffset.QuadPart = offset;
+    dwRet = SetFilePointerEx(m_hFile, liOffset, NULL, fw);
     
-    if (dwRet == -1)
+    if (dwRet == 0)
     {
-	m_ulPos = -1;
+	m_nPos = -1;
 	return HXR_FAIL;
     }
     
@@ -320,10 +319,10 @@
 }
 
 /* Tell returns the current file position in the file */
-STDMETHODIMP_(ULONG32)
+STDMETHODIMP_(HX_OFF_T)
 WinFile::Tell()
 {
-    return m_ulPos;
+    return m_nPos;
 }
 
 /* Read reads up to count bytes of data into buf.
Index: common/fileio/platform/win/winfile.h
===================================================================
RCS file: /cvsroot/common/fileio/platform/win/winfile.h,v
retrieving revision 1.8
diff -u -r1.8 winfile.h
--- common/fileio/platform/win/winfile.h	6 Jul 2007 20:35:17 -0000	1.8
+++ common/fileio/platform/win/winfile.h	10 Sep 2010 18:14:57 -0000
@@ -113,10 +113,10 @@
      * error.
      */
     STDMETHOD(Seek)			(THIS_
-					ULONG32 offset, UINT16 fromWhere);
+					HX_OFF_T offset, UINT16 fromWhere);
 
     /* Tell returns the current file position in the file */
-    STDMETHOD_(ULONG32, Tell)		(THIS);
+    STDMETHOD_(HX_OFF_T, Tell)		(THIS);
 
     /* Read reads up to count bytes of data into buf.
      * returns the number of bytes read, EOF, or -1 if the read failed 
@@ -159,7 +159,7 @@
     HANDLE m_hFile;
     INT32 m_lRefCount;
     char* m_pFilename;
-    UINT32 m_ulPos;
+    HX_OFF_T m_nPos;
 };
 
 #endif
Index: common/fileio/pub/bio.h
===================================================================
RCS file: /cvsroot/common/fileio/pub/bio.h,v
retrieving revision 1.4
diff -u -r1.4 bio.h
--- common/fileio/pub/bio.h	6 Jul 2007 20:35:18 -0000	1.4
+++ common/fileio/pub/bio.h	10 Sep 2010 18:14:57 -0000
@@ -62,11 +62,11 @@
 
     virtual INT32	read(void* buf, INT32 size) = 0;
     virtual INT32	write(const void* buf, INT32 size) = 0;
-    virtual off_t	seek(off_t off, INT32 whence) = 0;
+    virtual HX_OFF_T	seek(HX_OFF_T off, INT32 whence) = 0;
     virtual INT32	close() = 0;
     virtual INT32	error() = 0;
     virtual INT32	flags() = 0;
-    virtual off_t	file_size() = 0;
+    virtual HX_OFF_T	file_size() = 0;
 };
 
 inline
Index: common/fileio/pub/bufio.h
===================================================================
RCS file: /cvsroot/common/fileio/pub/bufio.h,v
retrieving revision 1.5
diff -u -r1.5 bufio.h
--- common/fileio/pub/bufio.h	6 Jul 2007 20:35:18 -0000	1.5
+++ common/fileio/pub/bufio.h	10 Sep 2010 18:14:57 -0000
@@ -66,13 +66,13 @@
 			~Buffer_IO();
     virtual INT32	read(void* buf, INT32 size) = 0;
     INT32		write(const void* buf, INT32 size);
-    virtual off_t	seek(off_t new_off, INT32 whence) = 0;
+    virtual HX_OFF_T	seek(HX_OFF_T new_off, INT32 whence) = 0;
     virtual INT32	flush() = 0;
     INT32		close() { return 0; };
     Buffer*		buf;
     INT32		flags();
     INT32		error();
-    virtual off_t	file_size();
+    virtual HX_OFF_T	file_size();
 
 protected:
     INT32		_flags;
@@ -85,7 +85,7 @@
 		PipeBuf_IO();
 		~PipeBuf_IO();
     INT32	read(void* buf, INT32 size);
-    off_t	seek(off_t new_off, INT32 whence);
+    HX_OFF_T	seek(HX_OFF_T new_off, INT32 whence);
     INT32	flush();
 };
 
@@ -96,11 +96,11 @@
 		FileBuf_IO(GrowBuffer* buffer, INT32 o_flags = O_RDWR);
 		~FileBuf_IO();
     INT32	read(void* buf, INT32 size);
-    off_t	seek(off_t new_off, INT32 whence);
+    HX_OFF_T	seek(HX_OFF_T new_off, INT32 whence);
     INT32	flush();
 
 private:
-    off_t	offset;
+    HX_OFF_T	offset;
 };
 
 inline
@@ -138,7 +138,7 @@
     return size;
 }
 
-inline off_t
+inline HX_OFF_T
 Buffer_IO::file_size()
 {
     ASSERT(1);
@@ -170,10 +170,10 @@
     return size;
 }
 
-inline off_t
-PipeBuf_IO::seek(off_t new_off, INT32 whence) 
+inline HX_OFF_T
+PipeBuf_IO::seek(HX_OFF_T new_off, INT32 whence) 
 {
-    return (off_t)-1;
+    return (HX_OFF_T)-1;
 }
 
 inline INT32
@@ -218,8 +218,8 @@
     return size;
 }
 
-inline off_t
-FileBuf_IO::seek(off_t new_off, INT32 whence) 
+inline HX_OFF_T
+FileBuf_IO::seek(HX_OFF_T new_off, INT32 whence) 
 {
 
     /*
Index: common/fileio/pub/chxdataf_stdio.h
===================================================================
RCS file: /cvsroot/common/fileio/pub/chxdataf_stdio.h,v
retrieving revision 1.9
diff -u -r1.9 chxdataf_stdio.h
--- common/fileio/pub/chxdataf_stdio.h	27 Feb 2009 22:55:09 -0000	1.9
+++ common/fileio/pub/chxdataf_stdio.h	10 Sep 2010 18:14:57 -0000
@@ -103,10 +103,10 @@
 	HX_RESULT	ChangeSize		(ULONG32 newSize) { return HXR_NOTIMPL; };
 	
 /*	Seek moves the current file position to the offset from the fromWhere specifier */
-	HX_RESULT	Seek			(ULONG32 offset, UINT16 fromWhere);
+	HX_RESULT	Seek			(ULONG32 HX_OFF_T, UINT16 fromWhere);
 
 /* 	Tell returns the current file position in the ra file */
-	ULONG32		Tell			(void);
+	HX_OFF_T	Tell			(void);
 
 /* 	Read reads up to count bytes of data into buf.
 	returns the number of bytes read, EOF, or -1 if the read failed */
Index: common/fileio/pub/chxdataf_virtual.h
===================================================================
RCS file: /cvsroot/common/fileio/pub/chxdataf_virtual.h,v
retrieving revision 1.7
diff -u -r1.7 chxdataf_virtual.h
--- common/fileio/pub/chxdataf_virtual.h	6 Jul 2007 20:35:18 -0000	1.7
+++ common/fileio/pub/chxdataf_virtual.h	10 Sep 2010 18:14:57 -0000
@@ -96,16 +96,16 @@
 	virtual HX_RESULT	Close			(void) = 0;
 
 /*	Returns the size of the file in bytes. */
-	virtual ULONG32		GetSize			(void) { return 0;};
+	virtual UINT32  	GetSize			(void) { return 0;};
 
 /*      Changes the size of the file to the newSize */
-	virtual HX_RESULT	ChangeSize		(ULONG32 newSize) { return HXR_NOTIMPL; };
+	virtual HX_RESULT	ChangeSize		(UINT32 newSize) { return HXR_NOTIMPL; };
 	
 /*	Seek moves the current file position to the offset from the fromWhere specifier */
-	virtual HX_RESULT	Seek			(ULONG32 offset, UINT16 fromWhere) = 0;
+	virtual HX_RESULT	Seek			(HX_OFF_T offset, UINT16 fromWhere) = 0;
 
 /* 	Tell returns the current file position in the ra file */
-	virtual ULONG32		Tell			(void) = 0;
+	virtual HX_OFF_T	Tell			(void) = 0;
 
 /* 	Read reads up to count bytes of data into buf.
 	returns the number of bytes read, EOF, or -1 if the read failed */
Index: common/fileio/pub/chxdfmem.h
===================================================================
RCS file: /cvsroot/common/fileio/pub/chxdfmem.h,v
retrieving revision 1.6
diff -u -r1.6 chxdfmem.h
--- common/fileio/pub/chxdfmem.h	6 Jul 2007 20:35:18 -0000	1.6
+++ common/fileio/pub/chxdfmem.h	10 Sep 2010 18:14:57 -0000
@@ -88,10 +88,10 @@
 												{ return HXR_OK; }
 	
 /*	Seek moves the current file position to the offset from the fromWhere specifier */
-	virtual HX_RESULT	Seek				(ULONG32 offset, UINT16 fromWhere);
+	virtual HX_RESULT	Seek				(HX_OFF_T offset, UINT16 fromWhere);
 
 /* 	Tell returns the current file position in the ra file */
-	virtual ULONG32		Tell				(void);
+	virtual HX_OFF_T	Tell				(void);
 
 /* 	Read reads up to count bytes of data into buf.
 	returns the number of bytes read, EOF, or -1 if the read failed */
@@ -124,7 +124,7 @@
 #endif
 
 private:
-	ULONG32				m_Offset;
+	HX_OFF_T			m_Offset;
 #ifdef DONT_USE_CHUNKYRES /////////////////////////
 	ULONG32				m_MemSize;
 	const char*			m_pMemData;
Index: common/fileio/pub/fmemio.h
===================================================================
RCS file: /cvsroot/common/fileio/pub/fmemio.h,v
retrieving revision 1.4
diff -u -r1.4 fmemio.h
--- common/fileio/pub/fmemio.h	6 Jul 2007 20:35:18 -0000	1.4
+++ common/fileio/pub/fmemio.h	10 Sep 2010 18:14:57 -0000
@@ -61,9 +61,9 @@
     virtual		~FMEMIO();
     virtual LONG32	read(void* buf, LONG32 size);
     virtual LONG32	write(const void* buf, LONG32 size);
-    virtual off_t	seek(off_t off, LONG32 whence);
+    virtual HX_OFF_T	seek(HX_OFF_T off, LONG32 whence);
     virtual LONG32	close();
-    virtual off_t	file_size();
+    virtual HX_OFF_T	file_size();
 
     LONG32		error();
     LONG32		flags();
Index: common/fileio/pub/fsio.h
===================================================================
RCS file: /cvsroot/common/fileio/pub/fsio.h,v
retrieving revision 1.4
diff -u -r1.4 fsio.h
--- common/fileio/pub/fsio.h	6 Jul 2007 20:35:18 -0000	1.4
+++ common/fileio/pub/fsio.h	10 Sep 2010 18:14:57 -0000
@@ -64,10 +64,10 @@
 			~FSIO();
 	int		set_bufsize(int size);
 	int		get_bufsize();
-	Byte*		read_alloc(int& size, off_t seek, int whence);
-	Byte*		write_alloc(int& size, off_t seek, int whence);
-	off_t		read_seek(off_t off, int whence);
-	off_t		write_seek(off_t off, int whence);
+	Byte*		read_alloc(int& size, HX_OFF_T seek, int whence);
+	Byte*		write_alloc(int& size, HX_OFF_T seek, int whence);
+	HX_OFF_T	read_seek(HX_OFF_T off, int whence);
+	HX_OFF_T	write_seek(HX_OFF_T off, int whence);
 	int		read_pushback(Byte* buf, int len);
 	char *		get_pathname() { return pathname; }
 	int		get_would_block();
@@ -81,7 +81,7 @@
 	Byte*		_write_alloc(int& size);
 	int		_write_free(Byte* buf);
 	int		_write_flush(Region* reg);
-	off_t		file_size();
+	HX_OFF_T	file_size();
 	int		would_block;
 };
 
Index: common/fileio/pub/hxdatasource.h
===================================================================
RCS file: /cvsroot/common/fileio/pub/hxdatasource.h,v
retrieving revision 1.9
diff -u -r1.9 hxdatasource.h
--- common/fileio/pub/hxdatasource.h	1 Jul 2010 21:23:04 -0000	1.9
+++ common/fileio/pub/hxdatasource.h	10 Sep 2010 18:14:57 -0000
@@ -73,7 +73,7 @@
     STDMETHOD_(ULONG32,Release)     (THIS);
 
     STDMETHOD(Open)    (THIS_ IHXRequest *pRequest, const char *mode, IHXMMFDataSourceObserver* pObserver = NULL);
-    STDMETHOD(Seek)    (THIS_ UINT32 offset, INT32 fromWhere);
+    STDMETHOD(Seek)    (THIS_ HX_OFF_T offset, INT32 fromWhere);
     STDMETHOD(Stat)    (THIS_ struct stat *buf);
     STDMETHOD(GetStringAttribute)(THIS_ UINT32 ulAttibute,
                              REF(IHXBuffer*)  pBuffer);
@@ -104,7 +104,7 @@
 
 protected:
     ULONG32              m_ulRefCount;
-    ULONG32              m_ulPosition; // current offset for the data
+    HX_OFF_T             m_ulPosition; // current offset for the data
     UINT32               m_ulLastError;
     IHXRequest*          m_pRequest;
     IHXBuffer*           m_pHXBuffer;
Index: common/fileio/pub/hxxfile.h
===================================================================
RCS file: /cvsroot/common/fileio/pub/hxxfile.h,v
retrieving revision 1.7
diff -u -r1.7 hxxfile.h
--- common/fileio/pub/hxxfile.h	6 Jul 2007 20:35:18 -0000	1.7
+++ common/fileio/pub/hxxfile.h	10 Sep 2010 18:14:57 -0000
@@ -65,7 +65,7 @@
 	static	HXBOOL	IsPlusURL(const char* pURL);
 	static	HXBOOL	ConvertHexCodesToChars(CHXString& fileName);
 	static	HXBOOL	FindAndReplaceInFile(CHXString& fileNameIn, CHXString& fileNameOut, const char* pFind, const char* pReplace);
-	static	ULONG32 GetFileLength(FILE* in);
+	static	HX_OFF_T GetFileLength(FILE* in);
 	static	void	ExtractFileAndPath(const char* pFullPath, char* pFileName, UINT32 ulFileNameBufLen,
                                            char* pPath, UINT32 ulPathBufLen);
 };
Index: common/fileio/pub/packet_file_object.h
===================================================================
RCS file: /cvsroot/common/fileio/pub/packet_file_object.h,v
retrieving revision 1.2
diff -u -r1.2 packet_file_object.h
--- common/fileio/pub/packet_file_object.h	12 Feb 2009 20:10:31 -0000	1.2
+++ common/fileio/pub/packet_file_object.h	10 Sep 2010 18:14:57 -0000
@@ -85,7 +85,7 @@
     STDMETHOD(Close)       (THIS);
     STDMETHOD(Read)        (THIS_ ULONG32 ulCount);
     STDMETHOD(Write)       (THIS_ IHXBuffer* pBuffer);
-    STDMETHOD(Seek)        (THIS_ ULONG32 ulOffset, HXBOOL bRelative);
+    STDMETHOD(Seek)        (THIS_ HX_OFF_T offset, HXBOOL bRelative);
     STDMETHOD(Advise)      (THIS_ ULONG32 ulInfo);
 
     // IHXFileStat methods
@@ -121,7 +121,7 @@
     IHXRequest*         m_pRequest;
     IHXScheduler*       m_pScheduler;
     IHXMutex*           m_pBufferQueueMutex;
-    UINT32              m_ulFileOffset;
+    HX_OFF_T            m_ulFileOffset;
     UINT32              m_ulFileSize;
     UINT32              m_ulBytesWritten;
     HXBOOL              m_bFileOffsetInBuffer;
@@ -135,8 +135,8 @@
     ~CHXPacketFileObject();
 
     void      ClearBufferQueue();
-    void      PurgeQueueToOffset(UINT32 ulFileOffset);
-    HX_RESULT ReadFromBufferQueue(UINT32 ulFileOffset, UINT32 ulNumBytes, REF(IHXBuffer*) rpBuffer);
+    void      PurgeQueueToOffset(HX_OFF_T ulFileOffset);
+    HX_RESULT ReadFromBufferQueue(HX_OFF_T ulFileOffset, UINT32 ulNumBytes, REF(IHXBuffer*) rpBuffer);
     UINT32    GetFileWindowMin();
     UINT32    GetFileWindowMax();
     HX_RESULT TryRead(UINT32 ulCount);
Index: common/fileio/pub/single_buffer_file_object.h
===================================================================
RCS file: /cvsroot/common/fileio/pub/single_buffer_file_object.h,v
retrieving revision 1.3
diff -u -r1.3 single_buffer_file_object.h
--- common/fileio/pub/single_buffer_file_object.h	30 May 2007 21:44:16 -0000	1.3
+++ common/fileio/pub/single_buffer_file_object.h	10 Sep 2010 18:14:57 -0000
@@ -79,7 +79,7 @@
     STDMETHOD(Close)       (THIS);
     STDMETHOD(Read)        (THIS_ ULONG32 ulCount);
     STDMETHOD(Write)       (THIS_ IHXBuffer* pBuffer);
-    STDMETHOD(Seek)        (THIS_ ULONG32 ulOffset, HXBOOL bRelative);
+    STDMETHOD(Seek)        (THIS_ HX_OFF_T offset, HXBOOL bRelative);
     STDMETHOD(Advise)      (THIS_ ULONG32 ulInfo);
 
     // IHXFileStat methods
@@ -101,7 +101,7 @@
     IHXBuffer*       m_pBuffer;
     IHXFileResponse* m_pFileResponse;
     IHXRequest*      m_pRequest;
-    UINT32           m_ulFileOffset;
+    HX_OFF_T         m_ulFileOffset;
 
     CHXSingleBufferFileObject(IHXBuffer* pBuffer);
     ~CHXSingleBufferFileObject();
Index: common/fileio/pub/sio.h
===================================================================
RCS file: /cvsroot/common/fileio/pub/sio.h,v
retrieving revision 1.8
diff -u -r1.8 sio.h
--- common/fileio/pub/sio.h	18 May 2010 17:51:24 -0000	1.8
+++ common/fileio/pub/sio.h	10 Sep 2010 18:14:57 -0000
@@ -66,27 +66,27 @@
     int			end_of_file();
 
     Byte*		read_alloc(int& size);
-    virtual Byte*	read_alloc(int& size, off_t seek, int whence)=0;
+    virtual Byte*	read_alloc(int& size, HX_OFF_T seek, int whence)=0;
     Byte*		read_realloc(Byte* buf, int oldsize, int& size);
     int			read_undo(Byte* buf, int len);
     void		read_free(Byte* buf);
-    off_t		read_offset();
-    virtual off_t	read_seek(off_t off, int whence) = 0;
+    HX_OFF_T		read_offset();
+    virtual HX_OFF_T	read_seek(HX_OFF_T off, int whence) = 0;
     virtual int		read_pushback(Byte* buf, int len) = 0;
     int			read_count();
 
     Byte*		write_alloc(int& size);
-    virtual Byte*	write_alloc(int& size, off_t seek, int whence)=0;
+    virtual Byte*	write_alloc(int& size, HX_OFF_T seek, int whence)=0;
     Byte*		write_realloc(Byte* buf, int oldsize, int& size);
     int			write_undo(Byte* buf, int len);
     int			write_free(Byte* buf);
-    off_t		write_offset();
-    virtual off_t	write_seek(off_t off, int whence) = 0;
+    HX_OFF_T		write_offset();
+    virtual HX_OFF_T	write_seek(HX_OFF_T off, int whence) = 0;
     int			write_flush();
     int			write_flush_count();
     HXBOOL		write_flush_needed();
 
-    virtual off_t	file_size() = 0;
+    virtual HX_OFF_T	file_size() = 0;
     void		unset_eof();
     virtual char *	get_pathname() { return NULL;};
     virtual int		get_would_block() {return 0;}
@@ -97,20 +97,20 @@
     {
 	Region*		next;
 	Region*		prev;
-	off_t		off;	    // offset into file
-	off_t		flush_off;  // offset into file for writing
+	HX_OFF_T	off;	    // offset into file
+	HX_OFF_T	flush_off;  // offset into file for writing
 	Byte*		base;	    // this is where data starts
 	Byte*		limit;	    // this is where data ends
 	int		refcount;
 
 			Region();
 			Region(Region* link);
-	void		set_buf(Byte* b, int size, off_t offset = 0);
+	void		set_buf(Byte* b, int size, HX_OFF_T offset = 0);
     };
 protected:
     struct Region_list
     {
-	off_t		off;	// current offset into file
+	HX_OFF_T	off;	// current offset into file
 	Byte*		ptr;	// ptr to data on next access
 	Byte*		end;	// data ends here
 	Region*		regs;	// list of regions
@@ -120,12 +120,12 @@
 			Region_list();
 			~Region_list();
 	Region*		find(Byte* buf, Region**& rp);
-	Region*		find(off_t offt, Region**& rp);
+	Region*		find(HX_OFF_T offt, Region**& rp);
 	Byte*		remove(Region* reg);
     };
     IO*			io;		// object that does the real io
     int			flags;
-    off_t		write_off;	// data written up to this point
+    HX_OFF_T		write_off;	// data written up to this point
     Region_list		reader;
     Region_list		writer;
     int			err;		// last error
@@ -159,7 +159,7 @@
 }
 
 inline void
-SIO::Region::set_buf(Byte* b, int size, off_t offset) {
+SIO::Region::set_buf(Byte* b, int size, HX_OFF_T offset) {
     base = b;
     limit = b + size;
     flush_off = off = offset;
@@ -213,9 +213,9 @@
     return (int)(reader.creg->limit - reader.end);
 }
 
-inline off_t
+inline HX_OFF_T
 SIO::read_offset() {
-    return (off_t)(reader.creg->off + (reader.ptr - reader.creg->base));
+    return (HX_OFF_T)(reader.creg->off + (reader.ptr - reader.creg->base));
 }
 
 inline Byte*
@@ -411,9 +411,9 @@
     return 0;
 }
 
-inline off_t
+inline HX_OFF_T
 SIO::write_offset() {
-    return (off_t)(writer.creg->off + (writer.ptr - writer.creg->base));
+    return (HX_OFF_T)(writer.creg->off + (writer.ptr - writer.creg->base));
 }
 
 inline void
Index: common/fileio/pub/platform/win/cwin32file.h
===================================================================
RCS file: /cvsroot/common/fileio/pub/platform/win/cwin32file.h,v
retrieving revision 1.7
diff -u -r1.7 cwin32file.h
--- common/fileio/pub/platform/win/cwin32file.h	6 Jul 2007 20:35:22 -0000	1.7
+++ common/fileio/pub/platform/win/cwin32file.h	10 Sep 2010 18:14:57 -0000
@@ -85,11 +85,11 @@
 /*      Seek moves the current file position to the offset from the
         fromWhere specifier returns HXR_OK or -1 if an error occurred */
     
-    virtual HX_RESULT Seek(ULONG32 offset, UINT16 fromWhere);
+    virtual HX_RESULT Seek(HX_OFF_T offset, UINT16 fromWhere);
 
 /*      Tell returns the current file position in the file */
 
-    virtual ULONG32 Tell(void);
+    virtual HX_OFF_T Tell(void);
 
 /*      Read reads up to count bytes of data into buf.
         returns the number of bytes read, EOF, or -1 if the read failed */
@@ -107,10 +107,10 @@
     virtual HX_RESULT Rewind(void);
     
 /*	Returns the size of the file in bytes */
-    virtual ULONG32 GetSize (void);
+    virtual UINT32 GetSize (void);
 
 /*      Changes the size of the file to the newSize */
-    virtual HX_RESULT ChangeSize (ULONG32 newSize) ;
+    virtual HX_RESULT ChangeSize (UINT32 newSize) ;
 
 
 /*      Return the file descriptor                      */
Index: common/fileio/pub/platform/win/cwinfile.h
===================================================================
RCS file: /cvsroot/common/fileio/pub/platform/win/cwinfile.h,v
retrieving revision 1.7
diff -u -r1.7 cwinfile.h
--- common/fileio/pub/platform/win/cwinfile.h	6 Jul 2007 20:35:22 -0000	1.7
+++ common/fileio/pub/platform/win/cwinfile.h	10 Sep 2010 18:14:57 -0000
@@ -80,11 +80,11 @@
 /*      Seek moves the current file position to the offset from the
         fromWhere specifier returns HXR_OK or -1 if an error occurred */
 
-        virtual HX_RESULT		Seek(ULONG32 offset, UINT16 fromWhere);
+        virtual HX_RESULT		Seek(HX_OFF_T offset, UINT16 fromWhere);
 
 /*      Tell returns the current file position in the file */
 
-        virtual ULONG32        Tell(void);
+        virtual HX_OFF_T       Tell(void);
 
 /*      Read reads up to count bytes of data into buf.
         returns the number of bytes read, EOF, or -1 if the read failed */
@@ -102,10 +102,10 @@
         virtual HX_RESULT		Rewind(void);
 
 /*	Returns the size of the file in bytes */
-	virtual ULONG32		GetSize			(void);
+	virtual UINT32 		GetSize			(void);
 
 /*      Changes the size of the file to the newSize */
-	virtual HX_RESULT	ChangeSize		(ULONG32 newSize) ;
+	virtual HX_RESULT	ChangeSize		(UINT32 newSize) ;
 
 
 /*      Return the file descriptor                      */
Index: common/fileio/pub/platform/win/fio.h
===================================================================
RCS file: /cvsroot/common/fileio/pub/platform/win/fio.h,v
retrieving revision 1.6
diff -u -r1.6 fio.h
--- common/fileio/pub/platform/win/fio.h	6 Jul 2007 20:35:22 -0000	1.6
+++ common/fileio/pub/platform/win/fio.h	10 Sep 2010 18:14:57 -0000
@@ -72,10 +72,10 @@
     virtual LONG32	close();
     virtual LONG32	read(void* buf, LONG32 size);
     virtual LONG32	write(const void* buf, LONG32 size);
-    virtual off_t	seek(off_t off, LONG32 whence);
+    virtual HX_OFF_T	seek(HX_OFF_T off, LONG32 whence);
     virtual LONG32	error();
     virtual LONG32	flags();
-    virtual off_t	file_size();
+    virtual HX_OFF_T	file_size();
 
     static void		local_path(char* path);
     static const enum { MAXPATH = 1024 };
@@ -118,10 +118,14 @@
     fd = -1;
 }
 
-inline off_t
-FileIO::seek(off_t off, LONG32 whence) 
+inline HX_OFF_T
+FileIO::seek(HX_OFF_T off, LONG32 whence) 
 {
-    off_t ret = ::_lseek(fd, off, HX_SAFEINT(whence));
+#ifdef _WIN64
+    HX_OFF_T ret = lseek(fd, off, HX_SAFEINT(whence));
+#else
+    HX_OFF_T ret = _lseek(fd, off, HX_SAFEINT(whence));
+#endif
     if (ret < 0)
 	err = errno;
     return ret;
@@ -145,19 +149,19 @@
     return ret;
 }
 
-inline off_t
+inline HX_OFF_T
 FileIO::file_size()
 {
 #ifdef _WIN32 
     // fstat always returns a size of zero for network files
     // under win95, so we use the proper Win32 api here...
-    return (off_t)GetFileSize((HANDLE)_get_osfhandle(fd),NULL);
+    return (HX_OFF_T)GetFileSize((HANDLE)_get_osfhandle(fd),NULL);
 #else
     struct stat st;
     if (fstat(fd, &st) < 0)
     {
 	err = errno;
-	return (off_t)-1;
+	return (HX_OFF_T)-1;
     }
     return st.st_size;
 #endif // 0
Index: common/fileio/pub/platform/win/mmfile.h
===================================================================
RCS file: /cvsroot/common/fileio/pub/platform/win/mmfile.h,v
retrieving revision 1.6
diff -u -r1.6 mmfile.h
--- common/fileio/pub/platform/win/mmfile.h	6 Jul 2007 20:35:22 -0000	1.6
+++ common/fileio/pub/platform/win/mmfile.h	10 Sep 2010 18:14:57 -0000
@@ -64,7 +64,7 @@
     _CBufferWinMemMapped()
 	: m_pData(NULL)
 	, m_ulLength(0)
-	, m_ulOffset(0)
+	, m_nOffset(0)
     {}
     ~_CBufferWinMemMapped()
     {_UnMap();}
@@ -78,7 +78,7 @@
 	REF(ULONG32)    ulLength
     )
     {
-	pData = m_pData+m_ulOffset; 
+	pData = m_pData + m_nOffset; 
 	ulLength = m_ulLength; 
 	return HXR_OK;
     }
@@ -115,25 +115,22 @@
 	THIS
     )
     {
-	return m_pData+m_ulOffset;
+	return m_pData + m_nOffset;
     }
 
 private:
     static UINT32 _AllocGran();
     void _UnMap();
-    HX_RESULT _SetMapping
-    (
-	HANDLE hfmoFile, 
-	UINT32 ulOffsetHigh, 
-	UINT32 ulOffsetLow , 
-	UINT32 ulLength
-    );
+    HX_RESULT _SetMapping (HANDLE hfmoFile, 
+                           UINT32 ulOffsetHigh, 
+                           UINT32 ulOffsetLow, 
+                           UINT32 ulLength);
 
     friend class CWin32MMFile;
 
     UCHAR* m_pData;
     UINT32 m_ulLength;
-    UINT32 m_ulOffset;
+    HX_OFF_T m_nOffset;
 };
 
 class CWin32MMFile : public CHXDataFile
@@ -173,10 +170,10 @@
     
 /*  Seek moves the current file position to the offset from the fromWhere 
     specifier */
-    virtual HX_RESULT	Seek		(ULONG32 offset, UINT16 fromWhere);
+    virtual HX_RESULT	Seek		(HX_OFF_T offset, UINT16 fromWhere);
 
 /*  Tell returns the current file position in the ra file */
-    virtual ULONG32	Tell		(void);
+    virtual HX_OFF_T	Tell		(void);
 
 /*  Read reads up to count bytes of data into buf.
     returns the number of bytes read, EOF, or -1 if the read failed */
Index: common/fileio/pub/platform/win/winff.h
===================================================================
RCS file: /cvsroot/common/fileio/pub/platform/win/winff.h,v
retrieving revision 1.6
diff -u -r1.6 winff.h
--- common/fileio/pub/platform/win/winff.h	6 Jul 2007 20:35:22 -0000	1.6
+++ common/fileio/pub/platform/win/winff.h	10 Sep 2010 18:14:57 -0000
@@ -83,7 +83,11 @@
 	char*		    m_pCurrentDirectory;
 	char*		    m_pCurrentFileName;
 	char*		    m_pNextFileName;
-#if defined(_WIN32) && !defined(WIN32_PLATFORM_PSPC)
+#if defined(_WIN64)
+	PTR_INT		    m_lFileHandle;
+	HXBOOL		    m_bDone;
+	struct _finddata_t  m_FileInfo;
+#elif defined(_WIN32) && !defined(WIN32_PLATFORM_PSPC)
 	long		    m_lFileHandle;
 	HXBOOL		    m_bDone;
 	struct _finddata_t  m_FileInfo;
From dcollins at real.com  Fri Sep 10 14:55:12 2010
From: dcollins at real.com (Dean Collins)
Date: Fri Sep 10 21:16:22 2010
Subject: [Common-dev] CR: Implements more enhancements related to 64-bit
	Large File Support (part 3)
Message-ID: <20100910225512.GL20409@dropzone.prognet.com>

Synopsis
========
Implements more enhancements related to 64-bit Large File Support (part 3)

Branches: SERVER_CURRENT_RN (HEAD)
Suggested Reviewer: Chytanya


Description
===========

This implements some common, datatype, filesystem, and protocol module
related updates necessary for supporting large files (greater than 4GB)
in our 64-bit Helix Server builds.  These updates relate primarily to
the seek/tell/stat types of calls.

In some cases, the underlying implementation remains 32-bit, in which
case a comment is typically added to help me find these as I continue
enhancing and extending 64-bit/LFS functionality.

These changes are implented so that the impact on non-64-bit builds,
and non-server builds, should be minimal, ideally transparent.


Files Affected
==============
common/appext/vsrcplin/pub/vfobj.h
common/appext/vsrcplin/vfobj.cpp
common/appext/vsrctag/pub/vsrcrep.h
common/appext/vsrctag/vsrcrep.cpp
common/container/hxstradv.cpp
common/container/pub/hxstring.h
common/util/cachobj.cpp
datatype/au/fileformat/auffplin.cpp
datatype/au/fileformat/pub/auffplin.h
datatype/common/filewriter/flcreatr.cpp
datatype/common/filewriter/pub/flcreatr.h
datatype/common/util/pub/riff.h
datatype/common/util/riff.cpp
datatype/flash/flv/fileformat/flv_file_format.cpp
datatype/flash/flv/fileformat/pub/flv_file_format.h
datatype/image/gif/fileformat/gifvsrc.cpp
datatype/image/gif/fileformat/pub/gifvsrc.h
datatype/image/gif/fileformat/pub/pxgifff.h
datatype/image/gif/fileformat/pxgifff.cpp
datatype/image/jpg/fileformat/jpegvsrc.cpp
datatype/image/jpg/fileformat/pub/jpegvsrc.h
datatype/image/jpg/fileformat/pub/pxjpgff.h
datatype/image/jpg/fileformat/pxjpgff.cpp
datatype/image/realpix/fileformat/filehdlr.cpp
datatype/image/realpix/fileformat/pub/filehdlr.h
datatype/image/realpix/fileformat/pub/shadvsrc.h
datatype/image/realpix/fileformat/shadvsrc.cpp
datatype/mp3/fileformat/mp3ff.cpp
datatype/mp3/fileformat/pub/mp3ff.h
datatype/mp4/fileformat/pub/qtffplin.h
datatype/mp4/fileformat/qtffplin.cpp
datatype/ngt/fileformat/ngtfileobject.cpp
datatype/ngt/fileformat/pub/ngtfileobject.h
datatype/smil/fileformat/shadvsrc.cpp
datatype/smil/fileformat/shadvsrc.h
datatype/text/realtext/fileformat/rtffplin.cpp
datatype/text/realtext/fileformat/rtffplin.h
datatype/text/realtext/fileformat/shadvsrc.cpp
datatype/text/realtext/fileformat/shadvsrc.h
filesystem/data/datafsys.cpp
filesystem/data/pub/datafsys.h
filesystem/http/httpfsys.cpp
filesystem/http/httpfsys.h
filesystem/local/full/smplfsys.cpp
filesystem/local/full/smplfsys.h
protocol/http/chxhttp.cpp
protocol/http/pub/chxhttp.h


Testing Performed
=================

Unit Tests:
- N/A

Integration Tests:
- RTSP streaming and HTTP download of realvideo10.rm.

Leak Tests:
- N/A

Performance Tests:
- N/A

Platforms Tested: linux-rhel5-x86_64, sunos-5.10-sparc64, win-x86_64-vc10, win-x86-vc10
Build verified: linux-rhel5-x86_64, sunos-5.10-sparc64, win-x86_64-vc10, win-x86-vc10


QA Hints
========
* N/A
-------------- next part --------------
Index: common/appext/vsrcplin/pub/vfobj.h
===================================================================
RCS file: /cvsroot/common/appext/vsrcplin/pub/vfobj.h,v
retrieving revision 1.5
diff -u -r1.5 vfobj.h
--- common/appext/vsrcplin/pub/vfobj.h	6 Jul 2007 20:34:50 -0000	1.5
+++ common/appext/vsrcplin/pub/vfobj.h	10 Sep 2010 21:36:39 -0000
@@ -147,7 +147,7 @@
      *	    of the completeness of the operation.
      */
     STDMETHOD(Seek)		(THIS_
-    	    	    	    	 ULONG32	    ulOffset,
+    	    	    	    	 HX_OFF_T	      ulOffset,
 				 HXBOOL               bRelative);
 
     /************************************************************************
@@ -225,11 +225,11 @@
 
     STDMETHOD(StatDone)		(THIS_
 				 HX_RESULT status,
-				 UINT32 ulSize,
-				 UINT32 ulCreationTime,
-				 UINT32 ulAccessTime,
-				 UINT32 ulModificationTime,
-				 UINT32 ulMode);
+				 HX_OFF_T size,
+				 HX_STAT_TIME_T tCreationTime,
+				 HX_STAT_TIME_T tAccessTime,
+				 HX_STAT_TIME_T tModificationTime,
+				 HX_STAT_MODE_T mode);
 
     /************************************************************************
      *	Method:
@@ -336,7 +336,7 @@
     ULONG32		    m_ulInitFlags;
     VSrcShadowFObj*	    m_pShad;
     char*		    m_pRealVPath;
-    UINT32		    m_ulModificationTime;
+    HX_STAT_TIME_T	    m_tModificationTime;
 
     /* Special URL handling */
     HXBOOL		    m_bSpecialURL;
Index: common/appext/vsrcplin/vfobj.cpp
===================================================================
RCS file: /cvsroot/common/appext/vsrcplin/vfobj.cpp,v
retrieving revision 1.5
diff -u -r1.5 vfobj.cpp
--- common/appext/vsrcplin/vfobj.cpp	6 Jul 2007 20:34:50 -0000	1.5
+++ common/appext/vsrcplin/vfobj.cpp	10 Sep 2010 21:36:40 -0000
@@ -324,7 +324,7 @@
 }
 
 STDMETHODIMP
-ViewSourceFileObject::Seek(ULONG32 ulOffset, HXBOOL bRelative)
+ViewSourceFileObject::Seek(HX_OFF_T ulOffset, HXBOOL bRelative)
 {
     if (m_bSpecialURL)
     {
@@ -644,15 +644,15 @@
 }
 
 STDMETHODIMP
-ViewSourceFileObject::StatDone( HX_RESULT status,
-				UINT32 ulSize,
-				UINT32 ulCreationTime,
-				UINT32 ulAccessTime,
-				UINT32 ulModificationTime,
-				UINT32 ulMode)
+ViewSourceFileObject::StatDone(HX_RESULT status,
+                               HX_OFF_T size,
+                               HX_STAT_TIME_T tCreationTime,
+                               HX_STAT_TIME_T tAccessTime,
+                               HX_STAT_TIME_T tModificationTime,
+                               HX_STAT_MODE_T mode)
 {
     HXBOOL bCheck = TRUE;
-    m_ulModificationTime = ulModificationTime;
+    m_tModificationTime = tModificationTime;
     if ( FAILED(CheckRegistryCache(bCheck)) )
     {
 	m_state = kStateReady;
@@ -706,11 +706,11 @@
     UINT32 id = 0;
     if ( id = pReg->GetId(pName) )
     {
-	ret = pReg->SetIntById(id, (INT32)m_ulModificationTime);
+	ret = pReg->SetIntById(id, (INT32)m_tModificationTime); //XXX not 64-bit safe
     }
     else
     {
-	pReg->AddInt(pName, (INT32)m_ulModificationTime);
+	pReg->AddInt(pName, (INT32)m_tModificationTime); //XXX not 64-bit safe
     }
     if ( SUCCEEDED(ret) )
     {
@@ -759,7 +759,7 @@
     INT32 nDate = 0;
     if ( SUCCEEDED(pReg->GetIntByName(pName, nDate)) )
     {
-	if ( (UINT32)nDate == m_ulModificationTime )
+	if ( nDate == (INT32)m_tModificationTime ) //XXX not 64-bit safe
 	{
 	    strcat(pName, "jdh");
 	    INT32 nValue = 0;
@@ -785,6 +785,7 @@
     HX_VECTOR_DELETE(pName);
     return ret;
 }
+
 /************************************************************************
  *	Method:
  *	    IHXFileResponse::CloseDone
Index: common/appext/vsrctag/pub/vsrcrep.h
===================================================================
RCS file: /cvsroot/common/appext/vsrctag/pub/vsrcrep.h,v
retrieving revision 1.7
diff -u -r1.7 vsrcrep.h
--- common/appext/vsrctag/pub/vsrcrep.h	6 Jul 2007 20:34:51 -0000	1.7
+++ common/appext/vsrctag/pub/vsrcrep.h	10 Sep 2010 21:36:41 -0000
@@ -95,9 +95,13 @@
     /************************************************************************
      *  IHXXMLFileStatResponce
      */
-    STDMETHOD(StatDone) (THIS_ HX_RESULT status, UINT32 ulSize, 
-        UINT32 ulCreationTime, UINT32 ulAccessTime, 
-        UINT32 ulModificationTime, UINT32 ulMode);
+    STDMETHOD(StatDone) (THIS_
+                        HX_RESULT status,
+                        HX_OFF_T size, 
+                        HX_STAT_TIME_T tCreationTime,
+                        HX_STAT_TIME_T tAccessTime, 
+                        HX_STAT_TIME_T tModificationTime,
+                        HX_STAT_MODE_T mode);
     
     /************************************************************************
      *  IHXFormatResponse
@@ -249,8 +253,9 @@
     IHXFileFormatObject* m_pFileFormatObj;
     IHXBuffer*  m_pRequestedPath;
 
-    UINT32 m_ulFileSize;
-    UINT32 m_ulModificationTime;
+    HX_OFF_T m_nFileSize;
+    HX_STAT_TIME_T m_tModificationTime;
+
     IHXValues* m_pFileHeader;
     UINT16 m_usNumStreams;
     UINT16 m_usCurrentStream;
Index: common/appext/vsrctag/vsrcrep.cpp
===================================================================
RCS file: /cvsroot/common/appext/vsrctag/vsrcrep.cpp,v
retrieving revision 1.9
diff -u -r1.9 vsrcrep.cpp
--- common/appext/vsrctag/vsrcrep.cpp	2 Oct 2009 20:23:23 -0000	1.9
+++ common/appext/vsrctag/vsrcrep.cpp	10 Sep 2010 21:36:41 -0000
@@ -114,8 +114,8 @@
 , m_pSource(NULL)
 , m_pSourceFinder(NULL)
 , m_pFileFormatObj(NULL)
-, m_ulModificationTime(0)
-, m_ulFileSize(0)
+, m_tModificationTime(0)
+, m_nFileSize(0)
 , m_pFileHeader(NULL)
 , m_usCurrentStream(0)
 , m_usNumStreams(0)
@@ -240,8 +240,8 @@
     HX_RELEASE(m_pFileHeader);
     m_usNumStreams = 0;
     m_usCurrentStream = 0;
-    m_ulFileSize = 0;
-    m_ulModificationTime = 0;
+    m_nFileSize = 0;
+    m_tModificationTime = 0;
     if ( m_pFileViewSource != NULL )
     {
         m_pFileViewSource->Close();
@@ -1100,11 +1100,11 @@
  */
 STDMETHODIMP
 ViewSourceTagRepObj::StatDone(HX_RESULT status,
-                             UINT32 ulSize,
-                             UINT32 ulCreationTime,
-                             UINT32 ulAccessTime,
-                             UINT32 ulModificationTime,
-                             UINT32 ulMode)
+                             HX_OFF_T size,
+                             HX_STAT_TIME_T tCreationTime,
+                             HX_STAT_TIME_T tAccessTime,
+                             HX_STAT_TIME_T tModificationTime,
+                             HX_STAT_MODE_T mode)
 {
     if ( m_state != kStateStatPending )
     {
@@ -1119,8 +1119,8 @@
         HX_ASSERT(m_pFileFormatObj);
         HX_ASSERT(m_pFileObject);
         m_state              = kStateInitFileFormatPending;
-        m_ulModificationTime = ulModificationTime;
-        m_ulFileSize         = ulSize;
+        m_tModificationTime  = tModificationTime;
+        m_nFileSize          = size;
         ret = m_pFileFormatObj->InitFileFormat(m_pFileObjectRequest,
                                                this,
                                                m_pFileObject);
@@ -2379,8 +2379,8 @@
     
     if ( m_state == kStateCreateOtherFormatInfoBuffer && !bLive )
     {
-        QueueModificationTime(&queue, m_ulModificationTime);
-        QueueFileSize(&queue, m_ulFileSize);
+        QueueModificationTime(&queue, m_tModificationTime);
+        QueueFileSize(&queue, m_nFileSize);
     }
     
     if ( m_pFileHeader )
Index: common/container/hxstradv.cpp
===================================================================
RCS file: /cvsroot/common/container/hxstradv.cpp,v
retrieving revision 1.19
diff -u -r1.19 hxstradv.cpp
--- common/container/hxstradv.cpp	18 May 2010 17:51:23 -0000	1.19
+++ common/container/hxstradv.cpp	10 Sep 2010 21:36:41 -0000
@@ -152,6 +152,17 @@
     *this += buf;
 }
 
+void CHXString::AppendUINT64(UINT64 value)
+{
+    static const int MaxULongString = 24;
+
+    char buf[MaxULongString]; /* Flawfinder: ignore */
+    int tmp=0;
+	tmp = SafeSprintf(buf, MaxULongString, "%llu", value);
+    HX_ASSERT(tmp < MaxULongString);
+    *this += buf;
+}
+
 void CHXString::AppendEndOfLine()
 {
 #if defined(_WINDOWS) || defined(_SYMBIAN)
Index: common/container/pub/hxstring.h
===================================================================
RCS file: /cvsroot/common/container/pub/hxstring.h,v
retrieving revision 1.20
diff -u -r1.20 hxstring.h
--- common/container/pub/hxstring.h	18 May 2010 17:51:24 -0000	1.20
+++ common/container/pub/hxstring.h	10 Sep 2010 21:36:42 -0000
@@ -195,6 +195,7 @@
     void FormatV(const char* pFmt, va_list args);
 
     void AppendULONG(ULONG32 value);
+    void AppendUINT64(UINT64 value);
     void AppendFormat(const char* pFmt, ...);
     void AppendEndOfLine();
 
Index: common/util/cachobj.cpp
===================================================================
RCS file: /cvsroot/common/util/cachobj.cpp,v
retrieving revision 1.12
diff -u -r1.12 cachobj.cpp
--- common/util/cachobj.cpp	6 Jul 2007 20:39:16 -0000	1.12
+++ common/util/cachobj.cpp	10 Sep 2010 21:36:42 -0000
@@ -66,6 +66,7 @@
 #include "basepkt.h"
 #include "hxbuffer.h"
 #include "timebuff.h"
+#include "hxfiles.h"
 #include "hxcache.h"
 #include "ihxpckts.h"
 #include "pckunpck.h"
Index: datatype/au/fileformat/auffplin.cpp
===================================================================
RCS file: /cvsroot/datatype/au/fileformat/auffplin.cpp,v
retrieving revision 1.5
diff -u -r1.5 auffplin.cpp
--- datatype/au/fileformat/auffplin.cpp	9 Dec 2005 07:25:57 -0000	1.5
+++ datatype/au/fileformat/auffplin.cpp	10 Sep 2010 21:36:43 -0000
@@ -1243,12 +1243,12 @@
     return hResult;
 }
 
-STDMETHODIMP CAUFileFormat::StatDone(HX_RESULT status,
-                                     UINT32    ulSize,
-                                     UINT32    ulCreationTime,
-                                     UINT32    ulAccessTime,
-                                     UINT32    ulModificationTime,
-                                     UINT32    ulMode)
+STDMETHODIMP CAUFileFormat::StatDone(HX_RESULT         status,
+                                     HX_OFF_T          size,
+                                     HX_STAT_TIME_T    ulCreationTime,
+                                     HX_STAT_TIME_T    ulAccessTime,
+                                     HX_STAT_TIME_T    ulModificationTime,
+                                     HX_STAT_MODE_T    ulMode)
 {
     HX_RESULT retVal = HXR_UNEXPECTED;
 
@@ -1259,7 +1259,7 @@
         // Save the file size
         if (SUCCEEDED(status))
         {
-            m_ulFileSize = ulSize;
+            m_ulFileSize = (UINT32)size; //XXX not 64-bit safe
         }
         // To give the header we need to be make sure the file is positioned
         // at the start of the file. We need to call the file object's
Index: datatype/au/fileformat/pub/auffplin.h
===================================================================
RCS file: /cvsroot/datatype/au/fileformat/pub/auffplin.h,v
retrieving revision 1.5
diff -u -r1.5 auffplin.h
--- datatype/au/fileformat/pub/auffplin.h	6 Dec 2005 22:47:46 -0000	1.5
+++ datatype/au/fileformat/pub/auffplin.h	10 Sep 2010 21:36:43 -0000
@@ -332,12 +332,12 @@
 
 
     /* IHXFileStatResponse methods */
-    STDMETHOD(StatDone) (THIS_ HX_RESULT status,
-                               UINT32    ulSize,
-                               UINT32    ulCreationTime,
-                               UINT32    ulAccessTime,
-                               UINT32    ulModificationTime,
-                               UINT32    ulMode);
+    STDMETHOD(StatDone) (THIS_ HX_RESULT         status,
+                               HX_OFF_T          size,
+                               HX_STAT_TIME_T    tCreationTime,
+                               HX_STAT_TIME_T    tAccessTime,
+                               HX_STAT_TIME_T    tModificationTime,
+                               HX_STAT_MODE_T    mode);
 
   /*
      *	IHXInterruptSafe methods
Index: datatype/common/filewriter/flcreatr.cpp
===================================================================
RCS file: /cvsroot/datatype/common/filewriter/flcreatr.cpp,v
retrieving revision 1.6
diff -u -r1.6 flcreatr.cpp
--- datatype/common/filewriter/flcreatr.cpp	10 Feb 2006 17:30:07 -0000	1.6
+++ datatype/common/filewriter/flcreatr.cpp	10 Sep 2010 21:36:44 -0000
@@ -581,15 +581,12 @@
 }
 
 STDMETHODIMP
-CFileCreator::StatDone
-(
-    HX_RESULT status,
-    UINT32 ulSize,
-    UINT32 ulCreationTime,
-    UINT32 ulAccessTime,
-    UINT32 ulModificationTime,
-    UINT32 ulMode
-)
+CFileCreator::StatDone(HX_RESULT      status,
+                       HX_OFF_T       size,
+                       HX_STAT_TIME_T tCreationTime,
+                       HX_STAT_TIME_T tAccessTime,
+                       HX_STAT_TIME_T tModificationTime,
+                       HX_STAT_MODE_T mode)
 {
     HX_RESULT	    hResult = HXR_OK;
     IHXFileObject* pObject = NULL;
@@ -603,7 +600,7 @@
     {
 	if (m_FCStatus == FC_CREATING_DIR)
 	{
-	    if ((ulMode & HX_S_IFDIR) && (!m_bResolveConflict))
+	    if ((mode & HX_S_IFDIR) && (!m_bResolveConflict))
 	    {
 		// If we are creating a directory and the existing object
 		// is a directory, just leave it alone and return success
@@ -619,7 +616,7 @@
 		if (HXR_OK != hResult)
 		{
 		    m_FCStatus = FC_READY;
-		    if (ulMode & HX_S_IFDIR)
+		    if (mode & HX_S_IFDIR)
 		    {
 			// We failed to move the directory out of the way, but
 			// we have a directory... proceeed without error.
@@ -638,7 +635,7 @@
 	{
 	    // If we are creating a file, make sure we clear the way for its
 	    // creation.
-	    if ((!m_bBlastFiles) || (ulMode & HX_S_IFDIR))
+	    if ((!m_bBlastFiles) || (mode & HX_S_IFDIR))
 	    {
 		// If we are not blastiong awaythe existing files or the
 		// existing object is a directory, rename the existing object
Index: datatype/common/filewriter/pub/flcreatr.h
===================================================================
RCS file: /cvsroot/datatype/common/filewriter/pub/flcreatr.h,v
retrieving revision 1.3
diff -u -r1.3 flcreatr.h
--- datatype/common/filewriter/pub/flcreatr.h	14 Mar 2005 19:24:45 -0000	1.3
+++ datatype/common/filewriter/pub/flcreatr.h	10 Sep 2010 21:36:44 -0000
@@ -96,12 +96,12 @@
      *	IHXFileStatResponse methods
      */
     STDMETHOD(StatDone)			(THIS_
-					HX_RESULT status,
-					UINT32 ulSize,
-					UINT32 ulCreationTime,
-					UINT32 ulAccessTime,
-					UINT32 ulModificationTime,
-					UINT32 ulMode);
+					HX_RESULT      status,
+					HX_OFF_T       size,
+					HX_STAT_TIME_T tCreationTime,
+					HX_STAT_TIME_T tAccessTime,
+					HX_STAT_TIME_T tModificationTime,
+					HX_STAT_MODE_T mode);
 
     /*
      *  Public API
Index: datatype/common/util/pub/riff.h
===================================================================
RCS file: /cvsroot/datatype/common/util/pub/riff.h,v
retrieving revision 1.10
diff -u -r1.10 riff.h
--- datatype/common/util/pub/riff.h	1 Feb 2010 15:53:52 -0000	1.10
+++ datatype/common/util/pub/riff.h	10 Sep 2010 21:36:45 -0000
@@ -62,8 +62,8 @@
     HX_RESULT Open(char* filename);
 
     IHXFileStat*           m_pFileStatObj; //for getting the file size.
-    UINT32			m_ulTotalFileSizeInBytes;
-    UINT32 GetCurrentFileOffset();
+    HX_OFF_T		   m_nTotalFileSizeInBytes;
+    HX_OFF_T GetCurrentFileOffset();
     /*
      * Close: Close the file
      */
@@ -96,7 +96,7 @@
      * If relative, seek relative to the current file position.
      * If not relative, seek relative to the beginning of the chunk
      */
-    HX_RESULT Seek(UINT32, HXBOOL);
+    HX_RESULT Seek(HX_OFF_T offset, HXBOOL bRelative);
     /*
      * FileSeek:
      * Seek to the absolute position in the file.  Mainly for file formats
@@ -104,7 +104,7 @@
      * check to see if a chunk boundary is crossed, make sure you know
      * what you're doing!
      */
-    HX_RESULT FileSeek(UINT32);
+    HX_RESULT FileSeek(HX_OFF_T offset);
     /*
      * GetChunk:
      * Read an entire chunk into a buffer
@@ -113,7 +113,7 @@
 
     HX_RESULT FindNextChunk();
 
-    UINT32  CurrentOffset() { return m_ulCurOffset - m_ulThisChunkOffset; };
+    HX_OFF_T  CurrentOffset() { return m_nCurOffset - m_nThisChunkOffset; };
 
     UINT32  FileType();
     UINT32  FileSubtype();
@@ -130,11 +130,12 @@
     STDMETHOD(InitDone)      (THIS_
                   HX_RESULT status);
     STDMETHOD(StatDone)  (THIS_
-                HX_RESULT status, UINT32 ulSize,
-				      ULONG32 ulCreationTime,
-				      UINT32 ulAccessTime,
-				      UINT32 ulModificationTime,
-				      UINT32 ulMode);	
+                  HX_RESULT      status,
+                  HX_OFF_T       size,
+		  HX_STAT_TIME_T tCreationTime,
+		  HX_STAT_TIME_T tAccessTime,
+		  HX_STAT_TIME_T tModificationTime,
+		  HX_STAT_MODE_T mode);	
     STDMETHOD(ReadDone)      (THIS_
                   HX_RESULT status,
                   IHXBuffer* pBuffer);
@@ -180,8 +181,8 @@
     };
 
     UINT32 GetListType();
-    UINT32 GetOffset();
-    UINT32 GetTotalFileSize();	
+    HX_OFF_T GetOffset();
+    HX_OFF_T GetTotalFileSize();	
     UINT32 GetChunkType();
     UINT32 GetChunkRawSize(void);
 
@@ -210,14 +211,14 @@
     UINT32                m_ulChunkBodyLen;
     HXBOOL                  m_bLittleEndian;
     UINT32                m_ulLevel;
-    UINT32                m_ulSeekOffset;
-    UINT32                m_ulCurOffset;
+    HX_OFF_T              m_nSeekOffset;
+    HX_OFF_T              m_nCurOffset;
     UINT32                m_ulFileType;
     UINT32                m_ulSubFileType;
     UINT32                m_ulChunkType;
     UINT32                m_ulChunkSubType;
     LevelInfo             m_levelInfo[MAXLEVELS];
-    UINT32                m_ulThisChunkOffset;
+    HX_OFF_T              m_nThisChunkOffset;
     UINT32                m_ulGetChunkType;
     UINT32                m_ulSizeDiff;
 
Index: datatype/common/util/riff.cpp
===================================================================
RCS file: /cvsroot/datatype/common/util/riff.cpp,v
retrieving revision 1.19
diff -u -r1.19 riff.cpp
--- datatype/common/util/riff.cpp	1 Feb 2010 15:53:52 -0000	1.19
+++ datatype/common/util/riff.cpp	10 Sep 2010 21:36:45 -0000
@@ -112,7 +112,7 @@
     , m_ulChunkSize(0)
     , m_ulChunkType(0)
     , m_pFileStatObj(NULL)
-    , m_ulTotalFileSizeInBytes(0L) 
+    , m_nTotalFileSizeInBytes(0) 
 {
     m_pContext = pContext;
     m_pResponse = pResponse;
@@ -135,7 +135,7 @@
     m_lRefCount = 0;
     m_pFilename = 0;
     m_ulSizeDiff = 0;
-    m_ulThisChunkOffset = 0;
+    m_nThisChunkOffset = 0;
 
     //Every time we Read() a data chunk and the amount of the Read is
     // odd, we add one to byte-align for the next Read, but we want to
@@ -172,7 +172,7 @@
     }
     m_state = RS_InitPending;
 
-    m_ulCurOffset = 0;
+    m_nCurOffset = 0;
     m_levelInfo[0].m_startOffset = 0;
     m_ulLevel = 0;
 
@@ -198,9 +198,10 @@
 //    return HXR_OK;
 }
 
-UINT32 CRIFFReader::GetCurrentFileOffset()
+HX_OFF_T
+CRIFFReader::GetCurrentFileOffset()
 {
-    return m_ulCurOffset;
+    return m_nCurOffset;
 }
 
 STDMETHODIMP
@@ -237,9 +238,9 @@
         // the beginning of the file. Set the state.
         m_state = RS_InitialSeekDonePending;
         // Set the desired seek offset
-        m_ulSeekOffset = 0;
+        m_nSeekOffset = 0;
         // Seek the file to the beginning
-        retVal = m_pFileObject->Seek(m_ulSeekOffset, FALSE);
+        retVal = m_pFileObject->Seek(m_nSeekOffset, FALSE);
 }
 
     return retVal;
@@ -250,11 +251,12 @@
 //	IHXFileFormatObject::StatDone
 //
 STDMETHODIMP
-CRIFFReader::StatDone(HX_RESULT status, UINT32 ulSize,
-				      ULONG32 ulCreationTime,
-                                      UINT32 ulAccessTime,
-				      UINT32 ulModificationTime,
-				      UINT32 ulMode)
+CRIFFReader::StatDone(HX_RESULT      status,
+                      HX_OFF_T       size,
+		      HX_STAT_TIME_T tCreationTime,
+		      HX_STAT_TIME_T tAccessTime,
+		      HX_STAT_TIME_T tModificationTime,
+		      HX_STAT_MODE_T mode)
 {
     // Check the state
     if (m_state != RS_StatDonePending)
@@ -268,19 +270,20 @@
     {
         // Now we know how big the file is, so we can calculate the
         // actual duration for all streams using it.
-        m_ulTotalFileSizeInBytes = ulSize;
+        m_nTotalFileSizeInBytes = size;
     }
     // Now we need to seek the file to the beginning, so set the state
     m_state = RS_InitialSeekDonePending;
     // Set the desired seek offset
-    m_ulSeekOffset = 0;
+    m_nSeekOffset = 0;
     // Seek the file to the beginning
-    return m_pFileObject->Seek(m_ulSeekOffset, FALSE);
+    return m_pFileObject->Seek(m_nSeekOffset, FALSE);
 }
 
-UINT32 CRIFFReader::GetTotalFileSize()
+HX_OFF_T
+CRIFFReader::GetTotalFileSize()
 {
-    return m_ulTotalFileSizeInBytes;
+    return m_nTotalFileSizeInBytes;
 }
 
 HX_RESULT
@@ -309,7 +312,7 @@
     m_bFileIsOpen = FALSE;
 
     HX_RELEASE(m_pFileStatObj);
-    m_ulTotalFileSizeInBytes = 0L;	
+    m_nTotalFileSizeInBytes = 0L;	
     return HXR_OK;
 }
 
@@ -320,13 +323,13 @@
     m_state = RS_FileStartSeekPending;
 
     if ( bRelative && m_levelInfo[m_ulLevel].started )
-        m_ulSeekOffset = m_levelInfo[m_ulLevel].m_nextChunkOffset;
+        m_nSeekOffset = m_levelInfo[m_ulLevel].m_nextChunkOffset;
     else
-        m_ulSeekOffset = m_levelInfo[m_ulLevel].m_startOffset;
+        m_nSeekOffset = m_levelInfo[m_ulLevel].m_startOffset;
 
     m_levelInfo[m_ulLevel].started = TRUE;
 
-    return(m_pFileObject->Seek(m_ulSeekOffset, FALSE) );
+    return(m_pFileObject->Seek(m_nSeekOffset, FALSE) );
 }
 
 HX_RESULT
@@ -357,7 +360,7 @@
 
     if ( pBuffer )
         pBuffer->Get(buf, len);
-    m_ulCurOffset += len;
+    m_nCurOffset += len;
 
     //Keep track of "bytes read" value so CRIFFReader::ReadDone()
     // can know whether or not it needs to decrement by one the size
@@ -394,7 +397,7 @@
                 m_bLittleEndian = TRUE;
                 m_ulChunkBodyLen = GetLong(&buf[4]);
                 m_ulSizeDiff = 0;
-                m_levelInfo[m_ulLevel].m_nextChunkOffset = m_ulCurOffset + m_ulChunkBodyLen;
+                m_levelInfo[m_ulLevel].m_nextChunkOffset = m_nCurOffset + m_ulChunkBodyLen;
                 m_pFileObject->Read(sizeof(UINT32));
                 return status;
             }
@@ -405,7 +408,7 @@
                 m_bLittleEndian = FALSE;
                 m_ulChunkBodyLen = GetLong(&buf[4]);
                 m_ulSizeDiff = 0;
-                m_levelInfo[m_ulLevel].m_nextChunkOffset = m_ulCurOffset + m_ulChunkBodyLen;
+                m_levelInfo[m_ulLevel].m_nextChunkOffset = m_nCurOffset + m_ulChunkBodyLen;
                 m_levelInfo[m_ulLevel].m_startOffset = 12;
 
                 m_pFileObject->Read(sizeof(UINT32));
@@ -417,7 +420,7 @@
                 m_bLittleEndian = FALSE;
                 m_ulChunkBodyLen = GetLong(&buf[4]);
                 m_ulSizeDiff = 8;
-                m_levelInfo[m_ulLevel].m_nextChunkOffset = m_ulCurOffset + m_ulChunkBodyLen - 8;
+                m_levelInfo[m_ulLevel].m_nextChunkOffset = m_nCurOffset + m_ulChunkBodyLen - 8;
             }
 
             m_state = RS_Ready;
@@ -463,8 +466,8 @@
                     }
                 }
 
-                m_levelInfo[m_ulLevel].m_nextChunkOffset = m_ulCurOffset + m_ulChunkBodyLen;
-                m_ulThisChunkOffset = m_ulCurOffset;
+                m_levelInfo[m_ulLevel].m_nextChunkOffset = m_nCurOffset + m_ulChunkBodyLen;
+                m_nThisChunkOffset = m_nCurOffset;
 
                 m_levelInfo[m_ulLevel].m_nextChunkOffset -= m_ulSizeDiff;
 
@@ -487,10 +490,10 @@
             {
                 // Didn't find it, go to the next chunk.
                 m_state = RS_ChunkBodySeekPending;
-                m_ulSeekOffset = m_ulCurOffset + GetLong(&buf[4]);
+                m_nSeekOffset = m_nCurOffset + GetLong(&buf[4]);
 
                 /* Are we at the end of .rm file */
-                if ( m_ulSeekOffset == m_ulCurOffset &&
+                if ( m_nSeekOffset == m_nCurOffset &&
                      m_ulFileType != RIFF_FILE_MAGIC_NUMBER &&
                      m_ulFileType != IFF_FILE_MAGIC_NUMBER )
                 {
@@ -502,22 +505,22 @@
                      m_ulFileType == IFF_FILE_MAGIC_NUMBER )
                 {
                     // Make sure the seek offset is aligned(2 bytes)
-                    uRem = (UINT16)(m_ulSeekOffset % 2);
+                    uRem = (UINT16)(m_nSeekOffset % 2);
                     if ( uRem != 0 )
                     {
-                        m_ulSeekOffset += 1;
+                        m_nSeekOffset += 1;
                     }
                 }
 
-                m_ulSeekOffset -= m_ulSizeDiff;
+                m_nSeekOffset -= m_ulSizeDiff;
 
-                if ( m_ulSeekOffset == m_ulCurOffset )
+                if ( m_nSeekOffset == m_nCurOffset )
                 {
                     m_state = RS_ChunkHeaderReadPending;
                     return m_pFileObject->Read(sizeof(UINT32) * 2);
                 }
                 m_state = RS_ChunkBodySeekPending;
-                return m_pFileObject->Seek(m_ulSeekOffset, FALSE);
+                return m_pFileObject->Seek(m_nSeekOffset, FALSE);
             }
 
         case RS_GetListTypePending:
@@ -596,7 +599,7 @@
                     // Make sure the chunk is aligned(2 bytes)
                     uRem = (UINT16)((baseLen) % 2);
 
-                    //NOTE: if m_ulCurOffset is greater than 0x7FFFFFFF, GetLong
+                    //NOTE: if m_nCurOffset is greater than 0x7FFFFFFF, GetLong
                     // returns a negative number.  Any negative number % 2 (at
                     // least in Windows) returns 0 or -1, and ((UINT16)-1) == 0xFFFF
                     // so uRem thus can be one of the following: {0, 1, 0xFFFF}.
@@ -696,7 +699,7 @@
                         // Make sure the chunk is aligned(2 bytes)
                         uRem = (UINT16)((baseLen) % 2);
 
-                        //NOTE: if m_ulCurOffset is greater than 0x7FFFFFFF, GetLong
+                        //NOTE: if m_nCurOffset is greater than 0x7FFFFFFF, GetLong
                         // returns a negative number.  Any negative number % 2 (at
                         // least in Windows) returns 0 or -1, and ((UINT16)-1) == 0xFFFF
                         // so uRem thus can be one of the following: {0, 1, 0xFFFF}.
@@ -751,7 +754,7 @@
 
     if ( status == HXR_OK )
     {
-        m_ulCurOffset = m_ulSeekOffset;
+        m_nCurOffset = m_nSeekOffset;
     }
 
     HX_RESULT result = HXR_OK;
@@ -789,21 +792,21 @@
 }
 
 HX_RESULT
-CRIFFReader::Seek(UINT32 offset, HXBOOL bRelative)
+CRIFFReader::Seek(HX_OFF_T offset, HXBOOL bRelative)
 {
-    m_ulSeekOffset = bRelative ?
-                     m_ulCurOffset + offset :
-                     m_ulThisChunkOffset + offset;
+    m_nSeekOffset = bRelative ?
+                     m_nCurOffset + offset :
+                     m_nThisChunkOffset + offset;
     m_state = RS_UserSeekPending;
-    return m_pFileObject->Seek(m_ulSeekOffset, FALSE);
+    return m_pFileObject->Seek(m_nSeekOffset, FALSE);
 }
 
 HX_RESULT
-CRIFFReader::FileSeek(UINT32 offset)
+CRIFFReader::FileSeek(HX_OFF_T offset)
 {
-    m_ulSeekOffset = offset;
+    m_nSeekOffset = offset;
     m_state = RS_UserSeekPending;
-    return m_pFileObject->Seek(m_ulSeekOffset, FALSE);
+    return m_pFileObject->Seek(m_nSeekOffset, FALSE);
 }
 
 HX_RESULT
@@ -816,12 +819,12 @@
     }
 
     m_ulLevel++;
-    m_levelInfo[m_ulLevel].m_startOffset = m_ulCurOffset;
+    m_levelInfo[m_ulLevel].m_startOffset = m_nCurOffset;
 
     if (m_ulFileType == RIFF_FILE_MAGIC_NUMBER ||
         m_ulFileType == IFF_FILE_MAGIC_NUMBER)
     {
-        if (m_ulCurOffset % 2 == 1)
+        if (m_nCurOffset % 2 == 1)
         {
             m_levelInfo[m_ulLevel].m_startOffset++;
         }
@@ -838,13 +841,13 @@
     m_ulLevel--;
     m_state = RS_AscendSeekPending;
     if ( m_ulLevel == 0 )
-        m_ulSeekOffset = 0;
+        m_nSeekOffset = 0;
     else
     {
-        m_ulSeekOffset = m_levelInfo[m_ulLevel].m_nextChunkOffset;
+        m_nSeekOffset = m_levelInfo[m_ulLevel].m_nextChunkOffset;
     }
 
-    m_pFileObject->Seek(m_ulSeekOffset, FALSE);
+    m_pFileObject->Seek(m_nSeekOffset, FALSE);
     return HXR_NOTIMPL;
 }
 
@@ -900,10 +903,10 @@
     return m_ulChunkSubType;
 }
 
-UINT32
+HX_OFF_T
 CRIFFReader::GetOffset()
 {
-    return m_ulCurOffset;
+    return m_nCurOffset;
 }
 
 UINT32
Index: datatype/flash/flv/fileformat/flv_file_format.cpp
===================================================================
RCS file: /cvsroot/datatype/flash/flv/fileformat/flv_file_format.cpp,v
retrieving revision 1.33
diff -u -r1.33 flv_file_format.cpp
--- datatype/flash/flv/fileformat/flv_file_format.cpp	23 Oct 2009 18:48:35 -0000	1.33
+++ datatype/flash/flv/fileformat/flv_file_format.cpp	10 Sep 2010 21:36:45 -0000
@@ -1922,8 +1922,12 @@
     return retVal;
 }
 
-STDMETHODIMP CHXFLVFileFormat::StatDone(HX_RESULT status, UINT32 ulSize, UINT32 ulCreationTime,
-                                        UINT32 ulAccessTime, UINT32 ulModificationTime, UINT32 ulMode)
+STDMETHODIMP CHXFLVFileFormat::StatDone(HX_RESULT      status,
+                                        HX_OFF_T       size,
+                                        HX_STAT_TIME_T tCreationTime,
+                                        HX_STAT_TIME_T tAccessTime,
+                                        HX_STAT_TIME_T tModificationTime,
+                                        HX_STAT_MODE_T mode)
 {
     HX_RESULT retVal = HXR_UNEXPECTED;
 
@@ -1935,7 +1939,7 @@
             // Set the flag saying we have the file size
             m_bHaveFileSize = TRUE;
             // Save the file size
-            m_ulFileSize = ulSize;
+            m_ulFileSize = (UINT32)size; //XXX not 64-bit safe
         }
         // Whether the stat succeeded or not, we will still return success to InitDone()
         //
Index: datatype/flash/flv/fileformat/pub/flv_file_format.h
===================================================================
RCS file: /cvsroot/datatype/flash/flv/fileformat/pub/flv_file_format.h,v
retrieving revision 1.19
diff -u -r1.19 flv_file_format.h
--- datatype/flash/flv/fileformat/pub/flv_file_format.h	23 Oct 2009 18:48:35 -0000	1.19
+++ datatype/flash/flv/fileformat/pub/flv_file_format.h	10 Sep 2010 21:36:47 -0000
@@ -152,8 +152,12 @@
     STDMETHOD(SeekDone)  (THIS_ HX_RESULT status);
 
     // IHXFileStatResponse methods
-    STDMETHOD(StatDone)  (THIS_ HX_RESULT status, UINT32 ulSize, UINT32 ulCreationTime,
-                                UINT32 ulAccessTime, UINT32 ulModificationTime, UINT32 ulMode);
+    STDMETHOD(StatDone)  (THIS_ HX_RESULT status,
+                                HX_OFF_T size,
+                                HX_STAT_TIME_T tCreationTime,
+                                HX_STAT_TIME_T tAccessTime,
+                                HX_STAT_TIME_T tModificationTime,
+                                HX_STAT_MODE_T mode);
 
     // IHXInterruptSafe methods
     STDMETHOD_(HXBOOL,IsInterruptSafe) (THIS) { return TRUE; }
Index: datatype/image/gif/fileformat/gifvsrc.cpp
===================================================================
RCS file: /cvsroot/datatype/image/gif/fileformat/gifvsrc.cpp,v
retrieving revision 1.5
diff -u -r1.5 gifvsrc.cpp
--- datatype/image/gif/fileformat/gifvsrc.cpp	6 Jul 2007 22:00:40 -0000	1.5
+++ datatype/image/gif/fileformat/gifvsrc.cpp	10 Sep 2010 21:36:47 -0000
@@ -79,7 +79,8 @@
     ,	m_pViewSourceResponse(NULL)
     ,	m_type(HTML_SOURCE)
     ,	m_pContainer(NULL)
-    ,	m_ulFileSize(0)
+    ,	m_nFileSize(0)
+    ,	m_tModTime(0)
     ,	m_pFileBuffer(NULL)
     ,	m_bIsGIF89a(FALSE)
     ,	m_state(kStateConstructed)
@@ -295,9 +296,12 @@
  *	IHXStatResponse::StatDone
  */
 STDMETHODIMP 
-CGIFViewSource::StatDone(HX_RESULT status,  UINT32 ulSize,
-    UINT32 ulCreationTime, UINT32 ulAccessTime, UINT32 ulModificationTime,
-    UINT32 ulMode)
+CGIFViewSource::StatDone(HX_RESULT      status,
+                         HX_OFF_T       size,
+                         HX_STAT_TIME_T tCreationTime,
+                         HX_STAT_TIME_T tAccessTime,
+                         HX_STAT_TIME_T tModificationTime,
+                         HX_STAT_MODE_T mode)
 {
     if ( m_state != kStateStatPending )
     {
@@ -309,8 +313,8 @@
     {
 	HX_ASSERT(m_pViewSourceResponse != NULL);
 	HX_ASSERT(m_pFileObject != NULL);
-	m_ulFileSize = ulSize;
-	m_ulModTime = ulModificationTime;
+	m_nFileSize = size;
+	m_tModTime = tModificationTime;
         // Now we read we only need the first 13 bytes -
 	m_state = kStateReadPending;
         ret = m_pFileObject->Read(13);
@@ -484,8 +488,8 @@
     queue.EnQueue(pFileName);
     queue.EnQueue(z_pEndLine);
     
-    QueueModificationTime(&queue, m_ulModTime);
-    QueueFileSize(&queue, m_ulFileSize);
+    QueueModificationTime(&queue, m_tModTime);
+    QueueFileSize(&queue, m_nFileSize);
     
     sprintf(buf, z_pImageDimen_ii, lsd.m_ulLogicalScreenWidth, /* Flawfinder: ignore */
 	lsd.m_ulLogicalScreenHeight);
Index: datatype/image/gif/fileformat/pub/gifvsrc.h
===================================================================
RCS file: /cvsroot/datatype/image/gif/fileformat/pub/gifvsrc.h,v
retrieving revision 1.5
diff -u -r1.5 gifvsrc.h
--- datatype/image/gif/fileformat/pub/gifvsrc.h	6 Jul 2007 22:00:41 -0000	1.5
+++ datatype/image/gif/fileformat/pub/gifvsrc.h	10 Sep 2010 21:36:47 -0000
@@ -72,8 +72,8 @@
     SOURCE_TYPE			m_type;
     IHXValues*			m_pViewSourceOptions;
 
-    UINT32			m_ulFileSize;
-    UINT32			m_ulModTime;
+    HX_OFF_T			m_nFileSize;
+    HX_STAT_TIME_T		m_tModTime;
     HXBOOL			m_bIsGIF89a;
     // FileFormat...
     IHXFileObject*		m_pFileObject;
@@ -149,11 +149,11 @@
      */
     STDMETHOD(StatDone)		(THIS_
 				 HX_RESULT status,
-				 UINT32 ulSize,
-				 UINT32 ulCreationTime,
-				 UINT32 ulAccessTime,
-				 UINT32 ulModificationTime,
-				 UINT32 ulMode);
+				 HX_OFF_T size,
+				 HX_STAT_TIME_T tCreationTime,
+				 HX_STAT_TIME_T tAccessTime,
+				 HX_STAT_TIME_T tModificationTime,
+				 HX_STAT_MODE_T mode);
 
 };
 
Index: datatype/image/gif/fileformat/pub/pxgifff.h
===================================================================
RCS file: /cvsroot/datatype/image/gif/fileformat/pub/pxgifff.h,v
retrieving revision 1.6
diff -u -r1.6 pxgifff.h
--- datatype/image/gif/fileformat/pub/pxgifff.h	18 Aug 2007 00:03:24 -0000	1.6
+++ datatype/image/gif/fileformat/pub/pxgifff.h	10 Sep 2010 21:36:48 -0000
@@ -108,8 +108,12 @@
     STDMETHOD(CloseDone) (THIS_ HX_RESULT status);
 
     // IHXFileStatResponse methods
-    STDMETHOD(StatDone) (THIS_ HX_RESULT status, UINT32 ulSize, UINT32 ulCreationTime,
-                               UINT32 ulAccessTime, UINT32 ulModificationTime, UINT32 ulMode);
+    STDMETHOD(StatDone) (THIS_ HX_RESULT status,
+                               HX_OFF_T size,
+                               HX_STAT_TIME_T tCreationTime,
+                               HX_STAT_TIME_T tAccessTime,
+                               HX_STAT_TIME_T tModificationTime,
+                               HX_STAT_MODE_T mode);
 
     // CGIFFileFormat methods
     static HX_RESULT STDAPICALLTYPE HXCreateInstance(IUnknown** ppIUnknown);
Index: datatype/image/gif/fileformat/pxgifff.cpp
===================================================================
RCS file: /cvsroot/datatype/image/gif/fileformat/pxgifff.cpp,v
retrieving revision 1.11
diff -u -r1.11 pxgifff.cpp
--- datatype/image/gif/fileformat/pxgifff.cpp	18 Aug 2007 00:03:23 -0000	1.11
+++ datatype/image/gif/fileformat/pxgifff.cpp	10 Sep 2010 21:36:48 -0000
@@ -532,8 +532,12 @@
     return m_pFileStat->Stat(this);
 }
 
-STDMETHODIMP CGIFFileFormat::StatDone(HX_RESULT status, UINT32 ulSize, UINT32 ulCreationTime,
-                                      UINT32 ulAccessTime, UINT32 ulModificationTime, UINT32 ulMode)
+STDMETHODIMP CGIFFileFormat::StatDone(HX_RESULT status,
+                                      HX_OFF_T size,
+                                      HX_STAT_TIME_T tCreationTime,
+                                      HX_STAT_TIME_T tAccessTime,
+                                      HX_STAT_TIME_T tModificationTime,
+                                      HX_STAT_MODE_T mode)
 {
 #ifdef XXXMEH_DEBUG_LOG
     DEBUG_OUTF("pxgifff.log", (s, "0x%08x::StatDone(0x%08x,%lu,,,,)\n", this, status, ulSize));
@@ -545,7 +549,7 @@
         if (SUCCEEDED(status))
         {
             // Set the file size
-            m_ulFileSize = ulSize;
+            m_ulFileSize = (UINT32)size; //XXX not 64-bit safe
 
             // Now we no longer need the IHXFileStat interface
             HX_RELEASE(m_pFileStat);
Index: datatype/image/jpg/fileformat/jpegvsrc.cpp
===================================================================
RCS file: /cvsroot/datatype/image/jpg/fileformat/jpegvsrc.cpp,v
retrieving revision 1.6
diff -u -r1.6 jpegvsrc.cpp
--- datatype/image/jpg/fileformat/jpegvsrc.cpp	6 Jul 2007 22:00:45 -0000	1.6
+++ datatype/image/jpg/fileformat/jpegvsrc.cpp	10 Sep 2010 21:36:49 -0000
@@ -294,9 +294,12 @@
  *	IHXStatResponse::StatDone
  */
 STDMETHODIMP 
-CJPEGViewSource::StatDone(HX_RESULT status,  UINT32 ulSize,
-    UINT32 ulCreationTime, UINT32 ulAccessTime, UINT32 ulModificationTime,
-    UINT32 ulMode)
+CJPEGViewSource::StatDone(HX_RESULT status,
+                          HX_OFF_T size,
+                          HX_STAT_TIME_T tCreationTime,
+                          HX_STAT_TIME_T tAccessTime,
+                          HX_STAT_TIME_T tModificationTime,
+                          HX_STAT_MODE_T mode)
 {
     if ( m_state != kStateStatPending )
     {
@@ -309,8 +312,8 @@
     {
 	HX_ASSERT(m_pViewSourceResponse != NULL);
 	HX_ASSERT(m_pFileObject != NULL);
-	m_ulFileSize = ulSize;
-	m_ulModTime = ulModificationTime;
+	m_ulFileSize = (UINT32)size; //XXX not 64-bit safe
+	m_ulModTime = (UINT32)tModificationTime; //XXX not 64-bit safe
 	
 	// Create an IHXFragmentedBuffer to hold the file
 	HX_RELEASE(m_pFragFileBuffer);
Index: datatype/image/jpg/fileformat/pub/jpegvsrc.h
===================================================================
RCS file: /cvsroot/datatype/image/jpg/fileformat/pub/jpegvsrc.h,v
retrieving revision 1.5
diff -u -r1.5 jpegvsrc.h
--- datatype/image/jpg/fileformat/pub/jpegvsrc.h	6 Jul 2007 22:00:47 -0000	1.5
+++ datatype/image/jpg/fileformat/pub/jpegvsrc.h	10 Sep 2010 21:36:50 -0000
@@ -159,12 +159,12 @@
      *	IHXFileStatResponse
      */
     STDMETHOD(StatDone)		(THIS_
-				 HX_RESULT status,
-				 UINT32 ulSize,
-				 UINT32 ulCreationTime,
-				 UINT32 ulAccessTime,
-				 UINT32 ulModificationTime,
-				 UINT32 ulMode);
+				 HX_RESULT      status,
+				 HX_OFF_T       size,
+				 HX_STAT_TIME_T tCreationTime,
+				 HX_STAT_TIME_T tAccessTime,
+				 HX_STAT_TIME_T tModificationTime,
+				 HX_STAT_MODE_T mode);
 
 };
 
Index: datatype/image/jpg/fileformat/pub/pxjpgff.h
===================================================================
RCS file: /cvsroot/datatype/image/jpg/fileformat/pub/pxjpgff.h,v
retrieving revision 1.6
diff -u -r1.6 pxjpgff.h
--- datatype/image/jpg/fileformat/pub/pxjpgff.h	18 Aug 2007 00:03:24 -0000	1.6
+++ datatype/image/jpg/fileformat/pub/pxjpgff.h	10 Sep 2010 21:36:50 -0000
@@ -109,12 +109,12 @@
     STDMETHOD(CloseDone)         (THIS_ HX_RESULT status);
 
     // IHXFileStatResponse methods
-    STDMETHOD(StatDone)          (THIS_ HX_RESULT status,
-                                        UINT32    ulSize,
-                                        UINT32    ulCreationTime,
-                                        UINT32    ulAccessTime,
-                                        UINT32    ulModificationTime,
-                                        UINT32    ulMode);
+    STDMETHOD(StatDone)          (THIS_ HX_RESULT       status,
+                                        HX_OFF_T        size,
+                                        HX_STAT_TIME_T  tCreationTime,
+                                        HX_STAT_TIME_T  tAccessTime,
+                                        HX_STAT_TIME_T  tModificationTime,
+                                        HX_STAT_MODE_T  mode);
 
     // IHXBackChannel methods
     STDMETHOD(PacketReady)       (THIS_ IHXPacket* pPacket);
Index: datatype/image/jpg/fileformat/pxjpgff.cpp
===================================================================
RCS file: /cvsroot/datatype/image/jpg/fileformat/pxjpgff.cpp,v
retrieving revision 1.7
diff -u -r1.7 pxjpgff.cpp
--- datatype/image/jpg/fileformat/pxjpgff.cpp	18 Aug 2007 00:03:24 -0000	1.7
+++ datatype/image/jpg/fileformat/pxjpgff.cpp	10 Sep 2010 21:36:51 -0000
@@ -530,12 +530,12 @@
     return m_pFileStat->Stat(this);
 }
 
-STDMETHODIMP CJPEGFileFormat::StatDone(HX_RESULT status,
-                                       UINT32    ulSize,
-                                       UINT32    ulCreationTime,
-                                       UINT32    ulAccessTime,
-                                       UINT32    ulModificationTime,
-                                       UINT32    ulMode)
+STDMETHODIMP CJPEGFileFormat::StatDone(HX_RESULT      status,
+                                       HX_OFF_T       size,
+                                       HX_STAT_TIME_T tCreationTime,
+                                       HX_STAT_TIME_T tAccessTime,
+                                       HX_STAT_TIME_T tModificationTime,
+                                       HX_STAT_MODE_T mode)
 {
     // Check the state
     if (m_ulState != kStateFileStatPending)
@@ -550,7 +550,7 @@
     }
 
     // Save the file size
-    m_ulFileSize = ulSize;
+    m_ulFileSize = (UINT32)size; //XXX not 64-bit safe
 
     // Check the size just to be sure
     if (!m_ulFileSize)
Index: datatype/image/realpix/fileformat/filehdlr.cpp
===================================================================
RCS file: /cvsroot/datatype/image/realpix/fileformat/filehdlr.cpp,v
retrieving revision 1.8
diff -u -r1.8 filehdlr.cpp
--- datatype/image/realpix/fileformat/filehdlr.cpp	29 Jul 2009 14:26:01 -0000	1.8
+++ datatype/image/realpix/fileformat/filehdlr.cpp	10 Sep 2010 21:36:51 -0000
@@ -1048,12 +1048,16 @@
     return retVal;
 }
 
-STDMETHODIMP PXFileHandler::StatDone(HX_RESULT status, UINT32 ulSize, UINT32 ulCreationTime,
-                                     UINT32 ulAccessTime, UINT32 ulModificationTime, UINT32 ulMode)
+STDMETHODIMP PXFileHandler::StatDone(HX_RESULT      status,
+                                     HX_OFF_T       size,
+                                     HX_STAT_TIME_T tCreationTime,
+                                     HX_STAT_TIME_T tAccessTime,
+                                     HX_STAT_TIME_T tModificationTime,
+                                     HX_STAT_MODE_T mode)
 {
 #ifdef XXXMEH_DEBUG_LOG
     DEBUG_OUTF("c:\\pxff.log", (s, "PXFileHandler::StatDone(0x%08X,0x%08x,%lu,...) ",
-               this, status, ulSize));
+               this, status, size));
 #endif
     HX_RESULT retVal = HXR_OK;
 
@@ -1066,7 +1070,7 @@
         HX_RELEASE(m_pFileStat);
 
         // Save the size
-        m_ulImageFileSize = ulSize;
+        m_ulImageFileSize = (UINT32)size; //XXX not 64-bit safe
 
         if (SUCCEEDED(status))
         {
Index: datatype/image/realpix/fileformat/pub/filehdlr.h
===================================================================
RCS file: /cvsroot/datatype/image/realpix/fileformat/pub/filehdlr.h,v
retrieving revision 1.6
diff -u -r1.6 filehdlr.h
--- datatype/image/realpix/fileformat/pub/filehdlr.h	29 Jul 2009 14:26:02 -0000	1.6
+++ datatype/image/realpix/fileformat/pub/filehdlr.h	10 Sep 2010 21:36:52 -0000
@@ -93,8 +93,12 @@
     STDMETHOD(SeekDone)  (THIS_ HX_RESULT status);
 
     // IHXFileStatResponse methods
-    STDMETHOD(StatDone) (THIS_ HX_RESULT status, UINT32 ulSize, UINT32 ulCreationTime,
-                               UINT32 ulAccessTime, UINT32 ulModificationTime, UINT32 ulMode);
+    STDMETHOD(StatDone) (THIS_ HX_RESULT      status,
+                               HX_OFF_T       size,
+                               HX_STAT_TIME_T tCreationTime,
+                               HX_STAT_TIME_T tAccessTime,
+                               HX_STAT_TIME_T tModificationTime,
+                               HX_STAT_MODE_T mode);
 
     // IHXFileMimeMapperResponse methods
     STDMETHOD(MimeTypeFound) (THIS_ HX_RESULT status, const char* pMimeType);
Index: datatype/image/realpix/fileformat/pub/shadvsrc.h
===================================================================
RCS file: /cvsroot/datatype/image/realpix/fileformat/pub/shadvsrc.h,v
retrieving revision 1.5
diff -u -r1.5 shadvsrc.h
--- datatype/image/realpix/fileformat/pub/shadvsrc.h	6 Jul 2007 22:01:04 -0000	1.5
+++ datatype/image/realpix/fileformat/pub/shadvsrc.h	10 Sep 2010 21:36:53 -0000
@@ -121,12 +121,13 @@
      *	    Called in response to our request for a stat.
      */
     STDMETHOD(StatDone)		(THIS_
-				 HX_RESULT status,
-				 UINT32 ulSize,
-				 UINT32 ulCreationTime,
-				 UINT32 ulAccessTime,
-				 UINT32 ulModificationTime,
-				 UINT32 ulMode);
+				 HX_RESULT      status,
+				 HX_OFF_T       size,
+				 HX_STAT_TIME_T tCreationTime,
+				 HX_STAT_TIME_T tAccessTime,
+				 HX_STAT_TIME_T tModificationTime,
+				 HX_STAT_MODE_T mode);
+
     /************************************************************************
     *  Method:
     *    IHXFileResponse::InitDone
Index: datatype/image/realpix/fileformat/shadvsrc.cpp
===================================================================
RCS file: /cvsroot/datatype/image/realpix/fileformat/shadvsrc.cpp,v
retrieving revision 1.6
diff -u -r1.6 shadvsrc.cpp
--- datatype/image/realpix/fileformat/shadvsrc.cpp	6 Jul 2007 22:01:03 -0000	1.6
+++ datatype/image/realpix/fileformat/shadvsrc.cpp	10 Sep 2010 21:36:53 -0000
@@ -248,12 +248,15 @@
 
 
 STDMETHODIMP
-CRPViewSource::StatDone(HX_RESULT status, UINT32 ulSize, UINT32 ulCreationTime,
-			    UINT32 ulAccessTime, UINT32 ulModificationTime, 
-			    UINT32 ulMode)
+CRPViewSource::StatDone(HX_RESULT      status,
+                        HX_OFF_T       size,
+                        HX_STAT_TIME_T tCreationTime,
+			HX_STAT_TIME_T tAccessTime,
+                        HX_STAT_TIME_T tModificationTime, 
+			HX_STAT_MODE_T mode)
 {
-    m_pOptions->SetPropertyULONG32("FileSize", ulSize);
-    m_pOptions->SetPropertyULONG32("ModificationTime", ulModificationTime);
+    m_pOptions->SetPropertyULONG32("FileSize", (ULONG32)size); //XXX not 64-bit safe
+    m_pOptions->SetPropertyULONG32("ModificationTime", (ULONG32)tModificationTime); //XXX not 64-bit safe
     IHXBuffer* pName = NULL;
     const char* p = NULL;
     m_pFileObject->GetFilename(p);
Index: datatype/mp3/fileformat/mp3ff.cpp
===================================================================
RCS file: /cvsroot/datatype/mp3/fileformat/mp3ff.cpp,v
retrieving revision 1.78
diff -u -r1.78 mp3ff.cpp
--- datatype/mp3/fileformat/mp3ff.cpp	26 May 2010 02:29:53 -0000	1.78
+++ datatype/mp3/fileformat/mp3ff.cpp	10 Sep 2010 21:36:53 -0000
@@ -1961,21 +1961,23 @@
 //
 //
 STDMETHODIMP
-CRnMp3Fmt::StatDone(HX_RESULT status,
-                    UINT32 ulSize,
-                    UINT32 ulCreationTime,
-                    UINT32 ulAccessTime,
-                    UINT32 ulModificationTime,
-                    UINT32 ulMode)
+CRnMp3Fmt::StatDone(HX_RESULT      status,
+                    HX_OFF_T       size,
+                    HX_STAT_TIME_T tCreationTime,
+                    HX_STAT_TIME_T tAccessTime,
+                    HX_STAT_TIME_T tModificationTime,
+                    HX_STAT_MODE_T mode)
 {
     HXLOGL4(HXLOG_MP3X, "StatDone(0x%08x,%lu,%lu,%lu,%lu,%lu)",
-            status, ulSize, ulCreationTime, ulAccessTime, ulModificationTime, ulMode);
+            status, size, tCreationTime, tAccessTime, tModificationTime, mode);
     HX_RESULT retVal = HXR_UNEXPECTED;
     if (m_bClosed)
     {
         return HXR_UNEXPECTED;
     }
 
+    UINT32 ulSize = (UINT32)size; //XXX not 64-bit safe
+
     // Save the time of the last stat
     m_ulLastStatTick = HX_GET_BETTERTICKCOUNT();
 
Index: datatype/mp3/fileformat/pub/mp3ff.h
===================================================================
RCS file: /cvsroot/datatype/mp3/fileformat/pub/mp3ff.h,v
retrieving revision 1.24
diff -u -r1.24 mp3ff.h
--- datatype/mp3/fileformat/pub/mp3ff.h	3 Dec 2009 19:46:36 -0000	1.24
+++ datatype/mp3/fileformat/pub/mp3ff.h	10 Sep 2010 21:36:54 -0000
@@ -215,13 +215,13 @@
 
     ///////////////////////////////////////////////////////////////////////////
     // IHXFileStatResponse methods
-    STDMETHOD(StatDone)         (THIS_
-                HX_RESULT status,
-                UINT32 ulSize,
-                UINT32 ulCreationTime,
-                UINT32 ulAccessTime,
-                UINT32 ulModificationTime,
-                UINT32 ulMode);
+    STDMETHOD(StatDone)(THIS_
+                        HX_RESULT      status,
+                        HX_OFF_T       size,
+                        HX_STAT_TIME_T tCreationTime,
+                        HX_STAT_TIME_T tAccessTime,
+                        HX_STAT_TIME_T tModificationTime,
+                        HX_STAT_MODE_T mode);
 
 #if defined(MPA_FMT_DRAFT00)
     ///////////////////////////////////////////////////////////////////////////
Index: datatype/mp4/fileformat/pub/qtffplin.h
===================================================================
RCS file: /cvsroot/datatype/mp4/fileformat/pub/qtffplin.h,v
retrieving revision 1.30
diff -u -r1.30 qtffplin.h
--- datatype/mp4/fileformat/pub/qtffplin.h	24 Mar 2010 23:45:18 -0000	1.30
+++ datatype/mp4/fileformat/pub/qtffplin.h	10 Sep 2010 21:36:54 -0000
@@ -207,11 +207,11 @@
      */
     STDMETHOD(StatDone)         (THIS_
                                  HX_RESULT status,
-                                 UINT32 ulSize,
-                                 UINT32 ulCreationTime,
-                                 UINT32 ulAccessTime,
-                                 UINT32 ulModificationTime,
-                                 UINT32 ulMode);
+                                 HX_OFF_T size,
+                                 HX_STAT_TIME_T tCreationTime,
+                                 HX_STAT_TIME_T tAccessTime,
+                                 HX_STAT_TIME_T tModificationTime,
+                                 HX_STAT_MODE_T mode);
 
     /*
      *	IHXAtomizationCommander
Index: datatype/mp4/fileformat/qtffplin.cpp
===================================================================
RCS file: /cvsroot/datatype/mp4/fileformat/qtffplin.cpp,v
retrieving revision 1.91
diff -u -r1.91 qtffplin.cpp
--- datatype/mp4/fileformat/qtffplin.cpp	24 Mar 2010 23:45:18 -0000	1.91
+++ datatype/mp4/fileformat/qtffplin.cpp	10 Sep 2010 21:36:55 -0000
@@ -2401,15 +2401,15 @@
  *	stat of the file is complete.
  */
 STDMETHODIMP CQTFileFormat::StatDone(HX_RESULT status,
-				     UINT32 ulSize,
-				     UINT32 ulCreationTime,
-				     UINT32 ulAccessTime,
-				     UINT32 ulModificationTime,
-				     UINT32 ulMode)
+				     HX_OFF_T size,
+				     HX_STAT_TIME_T tCreationTime,
+				     HX_STAT_TIME_T tAccessTime,
+				     HX_STAT_TIME_T tModificationTime,
+				     HX_STAT_MODE_T mode)
 {
     if (SUCCEEDED(status))
     {
-	m_ulFileSize = ulSize;
+	m_ulFileSize = (UINT32)size; //XXX not 64-bit safe
     }
 
     return _InternalInitDone(HXR_OK);
Index: datatype/ngt/fileformat/ngtfileobject.cpp
===================================================================
RCS file: /cvsroot/datatype/ngt/fileformat/ngtfileobject.cpp,v
retrieving revision 1.4
diff -u -r1.4 ngtfileobject.cpp
--- datatype/ngt/fileformat/ngtfileobject.cpp	18 Aug 2007 00:03:26 -0000	1.4
+++ datatype/ngt/fileformat/ngtfileobject.cpp	10 Sep 2010 21:36:56 -0000
@@ -308,7 +308,7 @@
     return retVal;
 }
 
-STDMETHODIMP CNGTFileObject::Seek(ULONG32 ulOffset, HXBOOL bRelative)
+STDMETHODIMP CNGTFileObject::Seek(HX_OFF_T ulOffset, HXBOOL bRelative)
 {
     HX_RESULT retVal = HXR_UNEXPECTED;
 
@@ -692,12 +692,12 @@
 /************************************************************************
  *  IHXFileStatResponse method
  */
-STDMETHODIMP CNGTFileObject::StatDone(HX_RESULT status,
-				      UINT32 ulSize,
-				      UINT32 ulCreationTime,
-				      UINT32 ulAccessTime,
-				      UINT32 ulModificationTime,
-				      UINT32 ulMode)
+STDMETHODIMP CNGTFileObject::StatDone(HX_RESULT      status,
+				      HX_OFF_T       size,
+				      HX_STAT_TIME_T tCreationTime,
+				      HX_STAT_TIME_T tAccessTime,
+				      HX_STAT_TIME_T tModificationTime,
+				      HX_STAT_MODE_T mode)
 {
     IHXFileStatResponse* pFileStatResponse = m_pFileStatResponse;
     HX_RESULT retVal = HXR_UNEXPECTED;
@@ -706,21 +706,21 @@
 
     if (m_pFileResponse && pFileStatResponse)
     {
-	if (ulSize >= m_ulMetaFileSize)
+	if (size >= m_ulMetaFileSize)
 	{
-	    ulSize -= m_ulMetaFileSize;
+	    size -= m_ulMetaFileSize;
 	}
 	else
 	{
-	    ulSize = 0;
+	    size = 0;
 	}
 
 	retVal = pFileStatResponse->StatDone(status,
-					     ulSize,
-					     ulCreationTime,
-					     ulAccessTime,
-					     ulModificationTime,
-					     ulMode);
+					     size,
+					     tCreationTime,
+					     tAccessTime,
+					     tModificationTime,
+					     mode);
     }
 
     HX_RELEASE(pFileStatResponse);
Index: datatype/ngt/fileformat/pub/ngtfileobject.h
===================================================================
RCS file: /cvsroot/datatype/ngt/fileformat/pub/ngtfileobject.h,v
retrieving revision 1.4
diff -u -r1.4 ngtfileobject.h
--- datatype/ngt/fileformat/pub/ngtfileobject.h	6 Jul 2007 22:01:27 -0000	1.4
+++ datatype/ngt/fileformat/pub/ngtfileobject.h	10 Sep 2010 21:36:56 -0000
@@ -174,7 +174,7 @@
      *      an absolute seek.
      */
     STDMETHOD(Seek)     (THIS_
-                        ULONG32 ulOffset,
+                        HX_OFF_T  ulOffset,
                         HXBOOL    bRelative);
 
     /************************************************************************
@@ -268,12 +268,12 @@
      *  IHXFileStatResponse method
      */
     STDMETHOD(StatDone)         (THIS_
-                                 HX_RESULT status,
-                                 UINT32 ulSize,
-                                 UINT32 ulCreationTime,
-                                 UINT32 ulAccessTime,
-                                 UINT32 ulModificationTime,
-                                 UINT32 ulMode);
+                                 HX_RESULT      status,
+				 HX_OFF_T       size,
+				 HX_STAT_TIME_T tCreationTime,
+				 HX_STAT_TIME_T tAccessTime,
+				 HX_STAT_TIME_T tModificationTime,
+				 HX_STAT_MODE_T mode);
 
     /*
      *	Public Meta-file methods
Index: datatype/smil/fileformat/shadvsrc.cpp
===================================================================
RCS file: /cvsroot/datatype/smil/fileformat/shadvsrc.cpp,v
retrieving revision 1.5
diff -u -r1.5 shadvsrc.cpp
--- datatype/smil/fileformat/shadvsrc.cpp	6 Jul 2007 22:01:46 -0000	1.5
+++ datatype/smil/fileformat/shadvsrc.cpp	10 Sep 2010 21:36:56 -0000
@@ -243,10 +243,16 @@
 
 
 STDMETHODIMP
-CShadowViewSource::StatDone(HX_RESULT status, UINT32 ulSize, UINT32 ulCreationTime,
-			    UINT32 ulAccessTime, UINT32 ulModificationTime, 
-			    UINT32 ulMode)
+CShadowViewSource::StatDone(HX_RESULT status,
+                            HX_OFF_T size,
+                            HX_STAT_TIME_T tCreationTime,
+			    HX_STAT_TIME_T tAccessTime,
+                            HX_STAT_TIME_T tModificationTime, 
+			    HX_STAT_MODE_T mode)
 {
+    UINT32 ulSize = (UINT32)size; //XXX not 64-bit safe
+    UINT32 ulModificationTime = (UINT32)tModificationTime; //XXX not 64-bit safe
+
     m_pOptions->SetPropertyULONG32("FileSize", ulSize);
     m_pOptions->SetPropertyULONG32("ModificationTime", ulModificationTime);
     IHXBuffer* pName = NULL;
Index: datatype/smil/fileformat/shadvsrc.h
===================================================================
RCS file: /cvsroot/datatype/smil/fileformat/shadvsrc.h,v
retrieving revision 1.5
diff -u -r1.5 shadvsrc.h
--- datatype/smil/fileformat/shadvsrc.h	6 Jul 2007 22:01:46 -0000	1.5
+++ datatype/smil/fileformat/shadvsrc.h	10 Sep 2010 21:36:57 -0000
@@ -119,12 +119,12 @@
      *	    Called in response to our request for a stat.
      */
     STDMETHOD(StatDone)		(THIS_
-				 HX_RESULT status,
-				 UINT32 ulSize,
-				 UINT32 ulCreationTime,
-				 UINT32 ulAccessTime,
-				 UINT32 ulModificationTime,
-				 UINT32 ulMode);
+				 HX_RESULT      status,
+				 HX_OFF_T       size,
+				 HX_STAT_TIME_T tCreationTime,
+				 HX_STAT_TIME_T tAccessTime,
+				 HX_STAT_TIME_T tModificationTime,
+				 HX_STAT_MODE_T mode);
 
     /************************************************************************
     *  Method:
Index: datatype/text/realtext/fileformat/rtffplin.cpp
===================================================================
RCS file: /cvsroot/datatype/text/realtext/fileformat/rtffplin.cpp,v
retrieving revision 1.8
diff -u -r1.8 rtffplin.cpp
--- datatype/text/realtext/fileformat/rtffplin.cpp	18 Aug 2007 00:03:27 -0000	1.8
+++ datatype/text/realtext/fileformat/rtffplin.cpp	10 Sep 2010 21:36:58 -0000
@@ -2657,11 +2657,12 @@
 //	IHXFileFormatObject::StatDone
 //
 STDMETHODIMP
-CRealTextFileFormat::StatDone(HX_RESULT status, UINT32 ulSize,
-				      ULONG32 ulCreationTime,
-                                      UINT32 ulAccessTime,
-				      UINT32 ulModificationTime,
-				      UINT32 ulMode)
+CRealTextFileFormat::StatDone(HX_RESULT      status,
+                              HX_OFF_T       size,
+                              HX_STAT_TIME_T tCreationTime,
+                              HX_STAT_TIME_T tAccessTime,
+                              HX_STAT_TIME_T tModificationTime,
+                              HX_STAT_MODE_T mode)
 {
     // We're finished with the IHXFileStat interface, so we'll release it:
     HX_RELEASE(m_pFileStatObj);
@@ -2669,7 +2670,7 @@
     // Now we know how big the .avi file is, so we can calculate the
     // total average bit rate for all streams by dividing
     // m_ulTotalFileSizeInBytes by duration:
-    m_ulTotalFileSizeInBytes = ulSize;
+    m_ulTotalFileSizeInBytes = (UINT32)size; //XXX not 64-bit safe
 
     // Check for input error conditions:
     if (status != HXR_OK)
Index: datatype/text/realtext/fileformat/rtffplin.h
===================================================================
RCS file: /cvsroot/datatype/text/realtext/fileformat/rtffplin.h,v
retrieving revision 1.6
diff -u -r1.6 rtffplin.h
--- datatype/text/realtext/fileformat/rtffplin.h	18 Aug 2007 00:03:27 -0000	1.6
+++ datatype/text/realtext/fileformat/rtffplin.h	10 Sep 2010 21:36:58 -0000
@@ -412,9 +412,13 @@
 				REF(UINT16) ulPercentDone);
 
     // IHXFileStatResponse Methods
-    STDMETHOD(StatDone)	    (THIS_ HX_RESULT status, UINT32 ulSize,
-	    ULONG32 ulCreationTime, UINT32 ulAccessTime,
-	    UINT32 ulModificationTime, UINT32 ulMode);
+    STDMETHOD(StatDone)	    (THIS_
+                            HX_RESULT      status,
+                            HX_OFF_T       size,
+                            HX_STAT_TIME_T tCreationTime,
+                            HX_STAT_TIME_T tAccessTime,
+                            HX_STAT_TIME_T tModificationTime,
+                            HX_STAT_MODE_T mode);
 
 
     void HandleGetSeekBackReadPending(  HX_RESULT	status,
Index: datatype/text/realtext/fileformat/shadvsrc.cpp
===================================================================
RCS file: /cvsroot/datatype/text/realtext/fileformat/shadvsrc.cpp,v
retrieving revision 1.5
diff -u -r1.5 shadvsrc.cpp
--- datatype/text/realtext/fileformat/shadvsrc.cpp	6 Jul 2007 22:01:57 -0000	1.5
+++ datatype/text/realtext/fileformat/shadvsrc.cpp	10 Sep 2010 21:36:59 -0000
@@ -245,10 +245,16 @@
 
 
 STDMETHODIMP
-CRTViewSource::StatDone(HX_RESULT status, UINT32 ulSize, UINT32 ulCreationTime,
-			    UINT32 ulAccessTime, UINT32 ulModificationTime, 
-			    UINT32 ulMode)
+CRTViewSource::StatDone(HX_RESULT      status,
+                        HX_OFF_T       size,
+                        HX_STAT_TIME_T tCreationTime,
+                        HX_STAT_TIME_T tAccessTime,
+                        HX_STAT_TIME_T tModificationTime,
+                        HX_STAT_MODE_T mode)
 {
+    UINT32 ulSize = (UINT32)size; //XXX not 64-bit safe
+    UINT32 ulModificationTime = (UINT32)tModificationTime; //XXX not 64-bit safe
+
     m_pOptions->SetPropertyULONG32("FileSize", ulSize);
     m_pOptions->SetPropertyULONG32("ModificationTime", ulModificationTime);
     IHXBuffer* pName = NULL;
Index: datatype/text/realtext/fileformat/shadvsrc.h
===================================================================
RCS file: /cvsroot/datatype/text/realtext/fileformat/shadvsrc.h,v
retrieving revision 1.5
diff -u -r1.5 shadvsrc.h
--- datatype/text/realtext/fileformat/shadvsrc.h	6 Jul 2007 22:01:57 -0000	1.5
+++ datatype/text/realtext/fileformat/shadvsrc.h	10 Sep 2010 21:36:59 -0000
@@ -128,12 +128,12 @@
      *	    Called in response to our request for a stat.
      */
     STDMETHOD(StatDone)		(THIS_
-				 HX_RESULT status,
-				 UINT32 ulSize,
-				 UINT32 ulCreationTime,
-				 UINT32 ulAccessTime,
-				 UINT32 ulModificationTime,
-				 UINT32 ulMode);
+				 HX_RESULT      status,
+				 HX_OFF_T       size,
+				 HX_STAT_TIME_T tCreationTime,
+				 HX_STAT_TIME_T tAccessTime,
+				 HX_STAT_TIME_T tModificationTime,
+				 HX_STAT_MODE_T mode);
 
     /************************************************************************
     *  Method:
Index: filesystem/data/datafsys.cpp
===================================================================
RCS file: /cvsroot/filesystem/data/datafsys.cpp,v
retrieving revision 1.17
diff -u -r1.17 datafsys.cpp
--- filesystem/data/datafsys.cpp	5 Dec 2006 19:45:41 -0000	1.17
+++ filesystem/data/datafsys.cpp	10 Sep 2010 21:37:00 -0000
@@ -679,7 +679,7 @@
 *	the caller via the IHXFileResponse interface passed in to Init,
 *	of the completeness of the operation.
 */
-STDMETHODIMP DataFileObject::Seek(ULONG32 ulOffset, HXBOOL bRelative)
+STDMETHODIMP DataFileObject::Seek(HX_OFF_T ulOffset, HXBOOL bRelative)
 {
     HX_RESULT pnr = HXR_OK;
 
Index: filesystem/data/pub/datafsys.h
===================================================================
RCS file: /cvsroot/filesystem/data/pub/datafsys.h,v
retrieving revision 1.6
diff -u -r1.6 datafsys.h
--- filesystem/data/pub/datafsys.h	12 Jun 2006 19:02:58 -0000	1.6
+++ filesystem/data/pub/datafsys.h	10 Sep 2010 21:37:00 -0000
@@ -242,7 +242,7 @@
      *      of the completeness of the operation.
      */
     STDMETHOD(Seek)             (THIS_
-                                 ULONG32 ulOffset,
+                                 HX_OFF_T ulOffset,
                                  HXBOOL  bRelative);
 
     /************************************************************************
Index: filesystem/http/httpfsys.cpp
===================================================================
RCS file: /cvsroot/filesystem/http/httpfsys.cpp,v
retrieving revision 1.143
diff -u -r1.143 httpfsys.cpp
--- filesystem/http/httpfsys.cpp	23 Apr 2010 21:15:53 -0000	1.143
+++ filesystem/http/httpfsys.cpp	10 Sep 2010 21:37:01 -0000
@@ -1969,7 +1969,7 @@
  *      the caller via the IHXFileResponse interface passed in to Init,
  *      of the completeness of the operation.
  */
-STDMETHODIMP CHTTPFileObject::Seek(ULONG32 ulOffset, HXBOOL bRelative)
+STDMETHODIMP CHTTPFileObject::Seek(HX_OFF_T ulOffset, HXBOOL bRelative)
 {
     HXScopeLock lock(m_pMutex);
 
@@ -3304,7 +3304,7 @@
 //      without error.
 //
 //
-HX_RESULT CHTTPFileObject::BeginGet(ULONG32 ulOffsetStart)
+HX_RESULT CHTTPFileObject::BeginGet(HX_OFF_T ulOffsetStart)
 {
 //    HX_ASSERT(m_pSocket == NULL);
 
@@ -3678,7 +3678,7 @@
         HX_ASSERT(m_bSupportsByteRanges);
 
         m_strRequest += "\r\nRange:bytes=";
-        m_strRequest.AppendULONG(ulOffsetStart);
+        m_strRequest.AppendUINT64(ulOffsetStart);
         m_strRequest += "-";
 
         // XXXbobclark when we get smarter we can remember
@@ -4546,7 +4546,7 @@
 // server that supports grabbing a range of bytes, and Seek has
 // been called to an invalid place of the file.
 HX_RESULT
-CHTTPFileObject::_HandleByteRangeSeek(ULONG32 ulSeekLocation)
+CHTTPFileObject::_HandleByteRangeSeek(HX_OFF_T ulSeekLocation)
 {
     HX_RESULT   theErr = HXR_OK;
 
@@ -5053,7 +5053,7 @@
 }
 
 void
-CHTTPFileObject::_SetCurrentReadPos(UINT32 ulNewCurrentReadPosition)
+CHTTPFileObject::_SetCurrentReadPos(HX_OFF_T ulNewCurrentReadPosition)
 {
     // if the new value is between the old value and the max contig,
     // we don't have to change the max contig; otherwise we do.
Index: filesystem/http/httpfsys.h
===================================================================
RCS file: /cvsroot/filesystem/http/httpfsys.h,v
retrieving revision 1.50
diff -u -r1.50 httpfsys.h
--- filesystem/http/httpfsys.h	7 Apr 2010 20:08:56 -0000	1.50
+++ filesystem/http/httpfsys.h	10 Sep 2010 21:37:01 -0000
@@ -379,7 +379,7 @@
      *      of the completeness of the operation.
      */
     STDMETHOD(Seek)             (THIS_
-                                ULONG32     ulOffset,
+                                HX_OFF_T      ulOffset,
                                 HXBOOL        bRelative);
 
     /************************************************************************
@@ -616,7 +616,7 @@
 private:
 
     HX_RESULT       _OpenFileExt        ();
-    HX_RESULT       BeginGet            (ULONG32 ulOffsetStart=0);
+    HX_RESULT       BeginGet            (HX_OFF_T ulOffsetStart=0);
     const char*     GetActualHost       () const;
     const char*     GetActualResource   () const;
     HX_RESULT       GetUserAgent        (REF(IHXBuffer*) pBuffer);
@@ -639,7 +639,7 @@
 
     HX_RESULT       _EnsureThatWeAreReadingWisely();
 
-    HX_RESULT       _HandleByteRangeSeek(ULONG32 ulSeekLocation);
+    HX_RESULT       _HandleByteRangeSeek(HX_OFF_T ulSeekLocation);
 
     HX_RESULT       _HandleServerReconnect(void);
 
@@ -647,7 +647,7 @@
 
     HX_RESULT       _DoSomeReadingFromSocket(HXBOOL bHandleBuffersImmediately);
 
-    void            _SetCurrentReadPos(UINT32 ulNewCurrentReadPosition); // so it can clear out cached contig
+    void            _SetCurrentReadPos(HX_OFF_T ulNewCurrentReadPosition); // so it can clear out cached contig
     UINT32          _GetContiguousLength();
 
     void            _ClearPreprocessedBuffers();
@@ -815,7 +815,7 @@
     HXBOOL                        m_bSupportsByteRanges;
     HXBOOL                        m_bDisableByteRanges;
     HXBOOL                        m_bExternalByteRangeRequests;
-    ULONG32                     m_uByteRangeSeekOffset;
+    HX_OFF_T                      m_uByteRangeSeekOffset;
     HXBOOL                        m_bByteRangeSeekPending;
     HXBOOL                        m_bCheckingWhetherByteRangeWorks;
     HXBOOL                        m_bServerPresumablyWorksWithByteRangeRequests;
Index: filesystem/local/full/smplfsys.cpp
===================================================================
RCS file: /cvsroot/filesystem/local/full/smplfsys.cpp,v
retrieving revision 1.59
diff -u -r1.59 smplfsys.cpp
--- filesystem/local/full/smplfsys.cpp	29 Jul 2010 21:08:39 -0000	1.59
+++ filesystem/local/full/smplfsys.cpp	10 Sep 2010 21:37:02 -0000
@@ -1777,7 +1777,7 @@
  *	the caller via the IHXFileResponse interface passed in to Init,
  *	of the completeness of the operation.
  */
-STDMETHODIMP CSimpleFileObject::Seek(ULONG32 ulOffset, HXBOOL bRelative)
+STDMETHODIMP CSimpleFileObject::Seek(HX_OFF_T ulOffset, HXBOOL bRelative)
 {
     MLOG_GEN(NULL, "CSimpleFileObject::Seek(%lu,%lu) this=0x%08x tick=%lu\n",
              ulOffset, bRelative, this, HX_GET_BETTERTICKCOUNT());
@@ -1883,18 +1883,18 @@
     return result;
 }
 
-void CSimpleFileObject::SeekBackwards(UINT32 ulNumBytes)
+void CSimpleFileObject::SeekBackwards(HX_OFF_T ulNumBytes)
 {
     if (m_pDataFile && ulNumBytes)
     {
         // Get the current offset
-        UINT32 ulCurOffset = m_pDataFile->Tell();
+        HX_OFF_T ulCurOffset = m_pDataFile->Tell();
         // Make sure the number of bytes we 
         // are supposed to back up is not greater
         // than the current offset
         if (ulNumBytes > ulCurOffset) ulNumBytes = ulCurOffset;
         // Compute the new absolute offset
-        UINT32 ulNewOffset = ulCurOffset - ulNumBytes;
+        HX_OFF_T ulNewOffset = ulCurOffset - ulNumBytes;
         // Seek the data file to this offset
         m_pDataFile->Seek(ulNewOffset, SEEK_SET);
     }
Index: filesystem/local/full/smplfsys.h
===================================================================
RCS file: /cvsroot/filesystem/local/full/smplfsys.h,v
retrieving revision 1.23
diff -u -r1.23 smplfsys.h
--- filesystem/local/full/smplfsys.h	29 Jul 2010 21:08:39 -0000	1.23
+++ filesystem/local/full/smplfsys.h	10 Sep 2010 21:37:02 -0000
@@ -235,7 +235,7 @@
 {
 private:
     UINT32		    m_ulSize;
-    UINT32		    m_ulPos;
+    HX_OFF_T		    m_ulPos;
     HXBOOL		    m_bCanBeReOpened;
     HXBOOL		    m_bProxyMode; // For the 'fileproxy://' filesystem
     void		    UpdateFileNameMember();
@@ -267,7 +267,7 @@
     UINT32		    m_ulPendingReadCount;
     CFindFile*		    m_pDirList;
     IUnknown*		    m_pUnknownUserContext;
-    UINT32                  m_ulPendingSeekOffset;
+    HX_OFF_T                m_ulPendingSeekOffset;
     UINT16                  m_usPendingSeekWhence;
     HXBOOL          m_bDisableMemoryMappedIO;
 
@@ -281,7 +281,7 @@
     HX_RESULT ActualAsyncSeekDone(HX_RESULT result);
     HX_RESULT DoRead(REF(HXBOOL) rbProgFail);
     HX_RESULT DoSeek(REF(HX_RESULT) rSeekDoneResult);
-    void      SeekBackwards(UINT32 ulNumBytes);
+    void      SeekBackwards(HX_OFF_T ulNumBytes);
     HX_RESULT FinishDoRead(UINT32 actual, REF(IHXBuffer*) pBuffer);
 
     HX_RESULT InitDataFile();
@@ -306,7 +306,7 @@
     IHXFileStatResponse*    m_pFileStatResponse;
     IHXFileStat2Response*   m_pFile2StatResponse;
     SeekReason		    m_eSeekReason;
-    UINT32		    m_ulPreSeekPosition;
+    HX_OFF_T		    m_ulPreSeekPosition;
     HXBOOL		    m_bFileToBeClosed;
 
 #endif
@@ -443,7 +443,7 @@
      *	    of the completeness of the operation.
      */
     STDMETHOD(Seek)		(THIS_
-    	    	    	    	 ULONG32	    ulOffset,
+    	    	    	    	 HX_OFF_T	    ulOffset,
 				 HXBOOL               bRelative);
 
     /************************************************************************
Index: protocol/http/chxhttp.cpp
===================================================================
RCS file: /cvsroot/protocol/http/chxhttp.cpp,v
retrieving revision 1.9
diff -u -r1.9 chxhttp.cpp
--- protocol/http/chxhttp.cpp	19 Jan 2009 04:52:02 -0000	1.9
+++ protocol/http/chxhttp.cpp	10 Sep 2010 21:37:03 -0000
@@ -778,18 +778,17 @@
 
 
 STDMETHODIMP
-CHXHttpFileResponse::StatDone(
-    HX_RESULT status,
-    UINT32 ulSize,
-    UINT32 ulCreationTime,
-    UINT32 ulAccessTime,
-    UINT32 ulModificationTime,
-    UINT32 ulMode)
+CHXHttpFileResponse::StatDone(HX_RESULT      status,
+                              HX_OFF_T       size,
+                              HX_STAT_TIME_T tCreationTime,
+                              HX_STAT_TIME_T tAccessTime,
+                              HX_STAT_TIME_T tModificationTime,
+                              HX_STAT_MODE_T mode)
 {
     m_pHttp->m_statResult = status;
     if(SUCCEEDED(status))
     {	
-        m_pHttp->m_nContentLength = ulSize;
+        m_pHttp->m_nContentLength = (UINT32)size; //XXX not 64-bit safe
     }
     return HXR_OK;
 }
Index: protocol/http/pub/chxhttp.h
===================================================================
RCS file: /cvsroot/protocol/http/pub/chxhttp.h,v
retrieving revision 1.4
diff -u -r1.4 chxhttp.h
--- protocol/http/pub/chxhttp.h	13 Jul 2007 16:56:03 -0000	1.4
+++ protocol/http/pub/chxhttp.h	10 Sep 2010 21:37:03 -0000
@@ -164,12 +164,12 @@
                                  HX_RESULT	status);
 
     STDMETHOD(StatDone)		(THIS_
-				 HX_RESULT status,
-				 UINT32 ulSize,
-				 UINT32 ulCreationTime,
-				 UINT32 ulAccessTime,
-				 UINT32 ulModificationTime,
-				 UINT32 ulMode);
+                                 HX_RESULT      status,
+                                 HX_OFF_T       size,
+                                 HX_STAT_TIME_T tCreationTime,
+                                 HX_STAT_TIME_T tAccessTime,
+                                 HX_STAT_TIME_T tModificationTime,
+                                 HX_STAT_MODE_T mode);
 
     /*
      *	IHXHTTPRedirectResponse methods
From jgordon at real.com  Mon Sep 13 08:43:01 2010
From: jgordon at real.com (Jamie Gordon)
Date: Mon Sep 13 15:06:25 2010
Subject: [Common-dev] CR: Implements common/fileio enhancements related
	to	64-bit Large File Support
In-Reply-To: <20100910210603.GI20409@dropzone.prognet.com>
References: <20100910210603.GI20409@dropzone.prognet.com>
Message-ID: <4C8E5495.2090007@real.com>

ok

On 9/10/2010 2:06 PM, Dean Collins wrote:
> Synopsis
> ========
> Implements common/fileio enhancements related to 64-bit Large File Support
>
> Branches: SERVER_CURRENT_RN (HEAD)
> Suggested Reviewer: Chytanya
>
>
> Description
> ===========
>
> This implements some common/fileio related updates necessary for
> supporting large files (greater than 4GB) in our 64-bit Helix Server
> builds.  These updates relate primarily to the seek/tell/stat types
> of calls.
>
> In some cases, the underlying implementation remains 32-bit, in which
> case a comment is typically added to help me find these as I continue
> enhancing and extending 64-bit/LFS functionality.
>
> For Win64, this depends on inline wrapper routines for fseek, ftell, and
> lseek, which are added to the Helix runtime library for this platform.
> On this platform, these calls will be mapped to their 64-bit variations
> (_fseeki64(), etc.).  The 32-bit variation is still available as _fseek,
> _ftell, and _lseek, if required.
>
> These changes are implented so that the impact on non-64-bit builds,
> and non-server builds, should be minimal.  However, something that
> subclasses from one of the modified common/fileio classes might not build
> on Win32 since off_t has been changed to HX_OFF_T in several places.
> (Due to COM API compatability constraints, HX_OFF_T is UINT32 on Win32).
> Just change off_t to HX_OFF_T in the affected class and it should build.
> They're both 32-bits on Win32.  Also note that if you use off_t it will
> not be 64-bit safe since this is 32-bits even in 64-bit Windows builds.
>
>
> Files Affected
> ==============
> common/runtime/pub/hlxclib/stdio.h
> common/fileio/bufdataf.cpp
> common/fileio/bufdataf.h
> common/fileio/cchx2ihxdataf.cpp
> common/fileio/cchx2ihxdataf.h
> common/fileio/chunkres.cpp
> common/fileio/chxdataf_stdio.cpp
> common/fileio/chxdfmem.cpp
> common/fileio/cihx2chxdataf.cpp
> common/fileio/cihx2chxdataf.h
> common/fileio/fdbufdataf.cpp
> common/fileio/fdbufdataf.h
> common/fileio/fmemio.cpp
> common/fileio/fsio.cpp
> common/fileio/hxbufdataf.h
> common/fileio/hxdatasource.cpp
> common/fileio/hxxfile.cpp
> common/fileio/packet_file_object.cpp
> common/fileio/single_buffer_file_object.cpp
> common/fileio/sio.cpp
> common/fileio/unbufdataf.h
> common/fileio/platform/unix/cunixf.cpp
> common/fileio/platform/unix/cunixf.h
> common/fileio/platform/unix/hxbufdataf.cpp
> common/fileio/platform/unix/mmapdatf.cpp
> common/fileio/platform/unix/mmapdatf.h
> common/fileio/platform/unix/unbufdataf.cpp
> common/fileio/platform/win/cwinfile.cpp
> common/fileio/platform/win/filespecutils.cpp
> common/fileio/platform/win/mmapdatf.cpp
> common/fileio/platform/win/mmapdatf.h
> common/fileio/platform/win/mmfile.cpp
> common/fileio/platform/win/winff.cpp
> common/fileio/platform/win/winfile.cpp
> common/fileio/platform/win/winfile.h
> common/fileio/pub/bio.h
> common/fileio/pub/chxdataf_stdio.h
> common/fileio/pub/chxdataf_virtual.h
> common/fileio/pub/chxdfmem.h
> common/fileio/pub/fmemio.h
> common/fileio/pub/fsio.h
> common/fileio/pub/hxdatasource.h
> common/fileio/pub/hxxfile.h
> common/fileio/pub/packet_file_object.h
> common/fileio/pub/single_buffer_file_object.h
> common/fileio/pub/sio.h
> common/fileio/pub/platform/win/cwin32file.h
> common/fileio/pub/platform/win/cwinfile.h
> common/fileio/pub/platform/win/fio.h
> common/fileio/pub/platform/win/mmfile.h
> common/fileio/pub/platform/win/winff.h
>
>
> Testing Performed
> =================
>
> Unit Tests:
> - N/A
>
> Integration Tests:
> - RTSP streaming and HTTP download of realvideo10.rm.
>
> Leak Tests:
> - N/A
>
> Performance Tests:
> - N/A
>
> Platforms Tested: linux-rhel5-x86_64, sunos-5.10-sparc64, win-x86_64-vc10, win-x86-vc10
> Build verified:
>    * Server: linux-rhel5-x86_64, sunos-5.10-sparc64, win-x86_64-vc10, win-x86-vc10
>    * splay_rn: win32-i386-vc7 (there were build-busters in my build but these
>        happened before patching-in the changes as well, I'll look at this again
>        using the build-farm post-checkin.)
>
>
> QA Hints
> ========
> * N/A

From jgordon at real.com  Mon Sep 13 08:46:01 2010
From: jgordon at real.com (Jamie Gordon)
Date: Mon Sep 13 15:09:26 2010
Subject: [Common-dev] CR: Implements more enhancements related to 64-bit
	Large File Support (part 3)
In-Reply-To: <20100910225512.GL20409@dropzone.prognet.com>
References: <20100910225512.GL20409@dropzone.prognet.com>
Message-ID: <4C8E5549.6030504@real.com>

ok

On 9/10/2010 3:55 PM, Dean Collins wrote:
> Synopsis
> ========
> Implements more enhancements related to 64-bit Large File Support (part 3)
>
> Branches: SERVER_CURRENT_RN (HEAD)
> Suggested Reviewer: Chytanya
>
>
> Description
> ===========
>
> This implements some common, datatype, filesystem, and protocol module
> related updates necessary for supporting large files (greater than 4GB)
> in our 64-bit Helix Server builds.  These updates relate primarily to
> the seek/tell/stat types of calls.
>
> In some cases, the underlying implementation remains 32-bit, in which
> case a comment is typically added to help me find these as I continue
> enhancing and extending 64-bit/LFS functionality.
>
> These changes are implented so that the impact on non-64-bit builds,
> and non-server builds, should be minimal, ideally transparent.
>
>
> Files Affected
> ==============
> common/appext/vsrcplin/pub/vfobj.h
> common/appext/vsrcplin/vfobj.cpp
> common/appext/vsrctag/pub/vsrcrep.h
> common/appext/vsrctag/vsrcrep.cpp
> common/container/hxstradv.cpp
> common/container/pub/hxstring.h
> common/util/cachobj.cpp
> datatype/au/fileformat/auffplin.cpp
> datatype/au/fileformat/pub/auffplin.h
> datatype/common/filewriter/flcreatr.cpp
> datatype/common/filewriter/pub/flcreatr.h
> datatype/common/util/pub/riff.h
> datatype/common/util/riff.cpp
> datatype/flash/flv/fileformat/flv_file_format.cpp
> datatype/flash/flv/fileformat/pub/flv_file_format.h
> datatype/image/gif/fileformat/gifvsrc.cpp
> datatype/image/gif/fileformat/pub/gifvsrc.h
> datatype/image/gif/fileformat/pub/pxgifff.h
> datatype/image/gif/fileformat/pxgifff.cpp
> datatype/image/jpg/fileformat/jpegvsrc.cpp
> datatype/image/jpg/fileformat/pub/jpegvsrc.h
> datatype/image/jpg/fileformat/pub/pxjpgff.h
> datatype/image/jpg/fileformat/pxjpgff.cpp
> datatype/image/realpix/fileformat/filehdlr.cpp
> datatype/image/realpix/fileformat/pub/filehdlr.h
> datatype/image/realpix/fileformat/pub/shadvsrc.h
> datatype/image/realpix/fileformat/shadvsrc.cpp
> datatype/mp3/fileformat/mp3ff.cpp
> datatype/mp3/fileformat/pub/mp3ff.h
> datatype/mp4/fileformat/pub/qtffplin.h
> datatype/mp4/fileformat/qtffplin.cpp
> datatype/ngt/fileformat/ngtfileobject.cpp
> datatype/ngt/fileformat/pub/ngtfileobject.h
> datatype/smil/fileformat/shadvsrc.cpp
> datatype/smil/fileformat/shadvsrc.h
> datatype/text/realtext/fileformat/rtffplin.cpp
> datatype/text/realtext/fileformat/rtffplin.h
> datatype/text/realtext/fileformat/shadvsrc.cpp
> datatype/text/realtext/fileformat/shadvsrc.h
> filesystem/data/datafsys.cpp
> filesystem/data/pub/datafsys.h
> filesystem/http/httpfsys.cpp
> filesystem/http/httpfsys.h
> filesystem/local/full/smplfsys.cpp
> filesystem/local/full/smplfsys.h
> protocol/http/chxhttp.cpp
> protocol/http/pub/chxhttp.h
>
>
> Testing Performed
> =================
>
> Unit Tests:
> - N/A
>
> Integration Tests:
> - RTSP streaming and HTTP download of realvideo10.rm.
>
> Leak Tests:
> - N/A
>
> Performance Tests:
> - N/A
>
> Platforms Tested: linux-rhel5-x86_64, sunos-5.10-sparc64, win-x86_64-vc10, win-x86-vc10
> Build verified: linux-rhel5-x86_64, sunos-5.10-sparc64, win-x86_64-vc10, win-x86-vc10
>
>
> QA Hints
> ========
> * N/A

From dcollins at real.com  Tue Sep 14 09:16:16 2010
From: dcollins at real.com (Dean Collins)
Date: Tue Sep 14 15:36:19 2010
Subject: [Common-dev] Checkin: Helix API enhancements related to 64-bit
	Large File Support
Message-ID: <20100914171616.GR20409@dropzone.prognet.com>

Checked-in to: HEAD (SERVER_CURRENT_RN)
Reviewed by: Chytanya
Verification Build:
* http://build.dev.prognet.com/~build/report.cgi?id=217460


----- Forwarded message from Dean Collins  -----

Date: Fri, 10 Sep 2010 09:38:41 -0700
From: Dean Collins 
To: common-dev 
Subject: CR: Helix API enhancements related to 64-bit Large File Support

Synopsis
========
Implements Helix API enhancements related to 64-bit Large File Support

Branches: SERVER_CURRENT_RN (HEAD)
Reviewer: Chytanya (already reviewed)


Description
===========

This implements some Helix API updates related to supporting large
files (greater than 4GB) in our 64-bit server builds.  (There is some
already-existing Helix code related to supporting large (>4GB) files
with 32-bit builds.  This is unaffected.)

For example, IHXDataFile::Seek() is changed from this:
    STDMETHOD(Seek)     (THIS_
                         ULONG32 offset, UINT16 fromWhere) PURE;

To this:
    STDMETHOD(Seek)     (THIS_
                         HX_OFF_T offset, UINT16 fromWhere) PURE;

The HX_OFF_T type is defined like this:

#if defined(_LONG_IS_64)
typedef off_t HX_OFF_T;
#elif defined(_WIN64)
typedef INT64 HX_OFF_T;
#else
#define HX_OFF_T ULONG32
#endif
...

Because the default non-64-bit definition of HX_OFF_T is identical
to the existing type (ULONG32), 32-bit builds should be unaffected by
these changes.

Similar updates are included for:

IHXFileObject::Seek()
IHXFileStatResponse::StatDone()
IHXDataFile::Tell()
IHXCacheFile::AddBlock()
IHXCacheFile::VerifyBlock()
IHXCacheFile::ReadBlock()
IHXCacheFile::SetStat()
IHXAsyncDataFile::Seek()

Others will be added as needed in the future.

(This feature requires quite a few updates to other modules which
are not in this diff.)


Files Affected
==============
common/include/hxtypes.h
common/include/hxdataf.h
common/include/hxfiles.h
common/include/hxcache.h


Testing Performed
=================

Unit Tests:
- N/A

Integration Tests:
- RTSP streaming and HTTP download of several media clips.

Leak Tests:
- N/A

Performance Tests:
- N/A

Platforms Tested: linux-rhel5-x86_64
Build verified: linux-rhel5-x86_64, linux-rhel5-x86, sunos-5.10-sparc64, win-x86_64-vc10


QA Hints
========
* N/A

----- End forwarded message -----

From dcollins at real.com  Tue Sep 14 09:17:49 2010
From: dcollins at real.com (Dean Collins)
Date: Tue Sep 14 15:37:53 2010
Subject: [Common-dev] Checkin: Implements common/fileio enhancements related
	to 64-bit Large File Support
Message-ID: <20100914171749.GT20409@dropzone.prognet.com>

Checked-in to: HEAD (SERVER_CURRENT_RN)
Reviewed by: Jamie
Verification Build:
* http://build.dev.prognet.com/~build/report.cgi?id=217460

----- Forwarded message from Dean Collins  -----

Date: Fri, 10 Sep 2010 14:04:49 -0700
From: Dean Collins 
To: server-dev@real.com
Subject: CR: Implements common/fileio enhancements related to 64-bit Large
	File Support

Synopsis
========
Implements common/fileio enhancements related to 64-bit Large File Support

Branches: SERVER_CURRENT_RN (HEAD)
Suggested Reviewer: Chytanya


Description
===========

This implements some common/fileio related updates necessary for
supporting large files (greater than 4GB) in our 64-bit Helix Server
builds.  These updates relate primarily to the seek/tell/stat types
of calls.

In some cases, the underlying implementation remains 32-bit, in which
case a comment is typically added to help me find these as I continue
enhancing and extending 64-bit/LFS functionality.

For Win64, this depends on inline wrapper routines for fseek, ftell, and
lseek, which are added to the Helix runtime library for this platform.
On this platform, these calls will be mapped to their 64-bit variations
(_fseeki64(), etc.).  The 32-bit variation is still available as _fseek,
_ftell, and _lseek, if required.

These changes are implented so that the impact on non-64-bit builds,
and non-server builds, should be minimal.  However, something that
subclasses from one of the modified common/fileio classes might not build
on Win32 since off_t has been changed to HX_OFF_T in several places.
(Due to COM API compatability constraints, HX_OFF_T is UINT32 on Win32).
Just change off_t to HX_OFF_T in the affected class and it should build.
They're both 32-bits on Win32.  Also note that if you use off_t it will
not be 64-bit safe since this is 32-bits even in 64-bit Windows builds.


Files Affected
==============
common/runtime/pub/hlxclib/stdio.h
common/fileio/bufdataf.cpp
common/fileio/bufdataf.h
common/fileio/cchx2ihxdataf.cpp
common/fileio/cchx2ihxdataf.h
common/fileio/chunkres.cpp
common/fileio/chxdataf_stdio.cpp
common/fileio/chxdfmem.cpp
common/fileio/cihx2chxdataf.cpp
common/fileio/cihx2chxdataf.h
common/fileio/fdbufdataf.cpp
common/fileio/fdbufdataf.h
common/fileio/fmemio.cpp
common/fileio/fsio.cpp
common/fileio/hxbufdataf.h
common/fileio/hxdatasource.cpp
common/fileio/hxxfile.cpp
common/fileio/packet_file_object.cpp
common/fileio/single_buffer_file_object.cpp
common/fileio/sio.cpp
common/fileio/unbufdataf.h
common/fileio/platform/unix/cunixf.cpp
common/fileio/platform/unix/cunixf.h
common/fileio/platform/unix/hxbufdataf.cpp
common/fileio/platform/unix/mmapdatf.cpp
common/fileio/platform/unix/mmapdatf.h
common/fileio/platform/unix/unbufdataf.cpp
common/fileio/platform/win/cwinfile.cpp
common/fileio/platform/win/filespecutils.cpp
common/fileio/platform/win/mmapdatf.cpp
common/fileio/platform/win/mmapdatf.h
common/fileio/platform/win/mmfile.cpp
common/fileio/platform/win/winff.cpp
common/fileio/platform/win/winfile.cpp
common/fileio/platform/win/winfile.h
common/fileio/pub/bio.h
common/fileio/pub/chxdataf_stdio.h
common/fileio/pub/chxdataf_virtual.h
common/fileio/pub/chxdfmem.h
common/fileio/pub/fmemio.h
common/fileio/pub/fsio.h
common/fileio/pub/hxdatasource.h
common/fileio/pub/hxxfile.h
common/fileio/pub/packet_file_object.h
common/fileio/pub/single_buffer_file_object.h
common/fileio/pub/sio.h
common/fileio/pub/platform/win/cwin32file.h
common/fileio/pub/platform/win/cwinfile.h
common/fileio/pub/platform/win/fio.h
common/fileio/pub/platform/win/mmfile.h
common/fileio/pub/platform/win/winff.h


Testing Performed
=================

Unit Tests:
- N/A

Integration Tests:
- RTSP streaming and HTTP download of realvideo10.rm.

Leak Tests:
- N/A

Performance Tests:
- N/A

Platforms Tested: linux-rhel5-x86_64, sunos-5.10-sparc64, win-x86_64-vc10, win-x86-vc10
Build verified:
  * Server: linux-rhel5-x86_64, sunos-5.10-sparc64, win-x86_64-vc10, win-x86-vc10
  * splay_rn: win32-i386-vc7 (there were build-busters in my build but these
      happened before patching-in the changes as well, I'll look at this again
      using the build-farm post-checkin.)


QA Hints
========
* N/A

----- End forwarded message -----

From dcollins at real.com  Tue Sep 14 09:19:22 2010
From: dcollins at real.com (Dean Collins)
Date: Tue Sep 14 15:39:26 2010
Subject: [Common-dev] Checkin: Implements more enhancements related to
	64-bit Large File Support (part 3)
Message-ID: <20100914171922.GV20409@dropzone.prognet.com>

Checked-in to: HEAD (SERVER_CURRENT_RN)
Reviewed by: Jamie
Verification Build:
* http://build.dev.prognet.com/~build/report.cgi?id=217460

----- Forwarded message from Dean Collins  -----

Date: Fri, 10 Sep 2010 15:54:41 -0700
From: Dean Collins 
To: server-dev@real.com
Subject: CR: Implements more enhancements related to 64-bit Large File
	Support (part 3)

Synopsis
========
Implements more enhancements related to 64-bit Large File Support (part 3)

Branches: SERVER_CURRENT_RN (HEAD)
Suggested Reviewer: Chytanya


Description
===========

This implements some common, datatype, filesystem, and protocol module
related updates necessary for supporting large files (greater than 4GB)
in our 64-bit Helix Server builds.  These updates relate primarily to
the seek/tell/stat types of calls.

In some cases, the underlying implementation remains 32-bit, in which
case a comment is typically added to help me find these as I continue
enhancing and extending 64-bit/LFS functionality.

These changes are implented so that the impact on non-64-bit builds,
and non-server builds, should be minimal, ideally transparent.


Files Affected
==============
common/appext/vsrcplin/pub/vfobj.h
common/appext/vsrcplin/vfobj.cpp
common/appext/vsrctag/pub/vsrcrep.h
common/appext/vsrctag/vsrcrep.cpp
common/container/hxstradv.cpp
common/container/pub/hxstring.h
common/util/cachobj.cpp
datatype/au/fileformat/auffplin.cpp
datatype/au/fileformat/pub/auffplin.h
datatype/common/filewriter/flcreatr.cpp
datatype/common/filewriter/pub/flcreatr.h
datatype/common/util/pub/riff.h
datatype/common/util/riff.cpp
datatype/flash/flv/fileformat/flv_file_format.cpp
datatype/flash/flv/fileformat/pub/flv_file_format.h
datatype/image/gif/fileformat/gifvsrc.cpp
datatype/image/gif/fileformat/pub/gifvsrc.h
datatype/image/gif/fileformat/pub/pxgifff.h
datatype/image/gif/fileformat/pxgifff.cpp
datatype/image/jpg/fileformat/jpegvsrc.cpp
datatype/image/jpg/fileformat/pub/jpegvsrc.h
datatype/image/jpg/fileformat/pub/pxjpgff.h
datatype/image/jpg/fileformat/pxjpgff.cpp
datatype/image/realpix/fileformat/filehdlr.cpp
datatype/image/realpix/fileformat/pub/filehdlr.h
datatype/image/realpix/fileformat/pub/shadvsrc.h
datatype/image/realpix/fileformat/shadvsrc.cpp
datatype/mp3/fileformat/mp3ff.cpp
datatype/mp3/fileformat/pub/mp3ff.h
datatype/mp4/fileformat/pub/qtffplin.h
datatype/mp4/fileformat/qtffplin.cpp
datatype/ngt/fileformat/ngtfileobject.cpp
datatype/ngt/fileformat/pub/ngtfileobject.h
datatype/smil/fileformat/shadvsrc.cpp
datatype/smil/fileformat/shadvsrc.h
datatype/text/realtext/fileformat/rtffplin.cpp
datatype/text/realtext/fileformat/rtffplin.h
datatype/text/realtext/fileformat/shadvsrc.cpp
datatype/text/realtext/fileformat/shadvsrc.h
filesystem/data/datafsys.cpp
filesystem/data/pub/datafsys.h
filesystem/http/httpfsys.cpp
filesystem/http/httpfsys.h
filesystem/local/full/smplfsys.cpp
filesystem/local/full/smplfsys.h
protocol/http/chxhttp.cpp
protocol/http/pub/chxhttp.h


Testing Performed
=================

Unit Tests:
- N/A

Integration Tests:
- RTSP streaming and HTTP download of realvideo10.rm.

Leak Tests:
- N/A

Performance Tests:
- N/A

Platforms Tested: linux-rhel5-x86_64, sunos-5.10-sparc64, win-x86_64-vc10, win-x86-vc10
Build verified: linux-rhel5-x86_64, sunos-5.10-sparc64, win-x86_64-vc10, win-x86-vc10


QA Hints
========
* N/A

----- End forwarded message -----

From richard.ching.li at gmail.com  Wed Sep 15 18:37:57 2010
From: richard.ching.li at gmail.com (Ching Li)
Date: Thu Sep 16 01:00:50 2010
Subject: [Common-dev] CR: Redefine DEFINE_NULL_VA_LIST and NULL_VA_LIST macro
Message-ID: 

Skipped content of type multipart/alternative-------------- next part --------------
A non-text attachment was scrubbed...
Name: hxtwritermanager.cpp.diff
Type: text/x-patch
Size: 832 bytes
Desc: not available
Url : http://lists.helixcommunity.org/pipermail/common-dev/attachments/20100916/a2a3d6f1/hxtwritermanager.cpp-0001.bin
From lqing at real.com  Sun Sep 26 20:23:44 2010
From: lqing at real.com (Li Qing)
Date: Mon Sep 27 02:46:46 2010
Subject: [Common-dev] CR: Redefine DEFINE_NULL_VA_LIST and NULL_VA_LIST
	macro
Message-ID: <4A242CD46F4C34418D17941FF9746F97740027BB6A@SEAMBX.corp.real.com>

Committed into head, 310, 361, 362 and 363


Best Regards!
                           Li Qing


On Sun, Sep 26, 2010 at 1:21 PM, Qiang Luo  wrote:

    Hi Li Ching,

    Please merge Renjie's fix to head, 310, 361, 362 and 363 branches and send a check-in notification.

    Thanks,
    Qiang


    On 9/25/2010 3:12 AM, Ching Li wrote:
>     I verified the patch, it's OK.
>     And I consulted manual again, it said: "After the call va_end(ap) the variable ap is undefined", so Renjie's solution is better.
>     --
>     Best Regards!
>                           Li Qing
>
>      
>     On Fri, Sep 24, 2010 at 2:16 AM, Renjie Huang  wrote:
>
>
>         I only checked into my own branch. I remember this compilation error happens when the gcc compiler version is >= 4.4 , where the mangling of va_list has changed. It is not allowed to be defined as NULL. I think your CR may destroy the build under other platforms where, for example, NULL_VA_LIST should be defined as NULL. Qiang, can you confirm this?  If the problem is really compiler dependent,  a safer patch could be:
>
>
>         +#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 3 )
>         +#define DEFINE_NULL_VA_LIST   va_list Null_arg = {}
>         +#define NULL_VA_LIST          Null_arg
>         +#else
>          #ifdef VA_LIST_IS_STRUCT
>          // va_list is not of same type in all platform.
>          // It is struct in some platforms (eg: RVCT) and pointer on others
>         @@ -84,5 +88,6 @@
>          #else
>          #define DEFINE_NULL_VA_LIST
>          #define NULL_VA_LIST          NULL
>         -#endif
>         +#endif /* VA_LIST_IS_STRUCT */
>         +#endif /* __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 3 ) */
>          #endif /* HLXSYS_STDARG_H */
>
>         I think the fix for this problem  should also be checked into head and 310. We do not expect to run into the same problem again in the future.
>         ________________________________________
>         From: Qiang Luo
>         Sent: Thursday, September 23, 2010 10:13 AM
>         To: Ching Li
>         Cc: Renjie Huang
>         Subject: Re: [Common-dev] CR: Redefine DEFINE_NULL_VA_LIST and NULL_VA_LIST macro
>
>         Renjie,
>
>         Could you please review this CR?  I think once you sent a cr to fix the same issue and I forgot if you ever checked-in the code or not.
>
>         Thanks,
>         Qiang
>
>         On 9/15/2010 7:37 PM, Ching Li wrote:
>         Modified by: richard.ching.li@gmail.com
>
>         Date: 09/13/2010
>
>         Project: RealPlayer for Android Smartphones
>
>         Synopsis: Redefine DEFINE_NULL_VA_LIST and NULL_VA_LIST macro
>
>         Overview:
>            If VA_LIST_IS_STRUCT is undefined while va_list is struct, compiling will fail because converting NULL_VA_LIST (which is defined as NULL) to struct is unacceptable. On the other side, if VA_LIST_IS_STRUCT is defined while va_list is struct, compiling will also fail because the definition of DEFINE_NULL_VA_LIST  (in */common/runtime/pub/hlxclib/stdarg.h) is invalid.
>            Because va_end() is a standard C function, and can be used to reset a va_list no matter what its type is, we can redefine DEFINE_NULL_VA_LIST and NULL_VA_LIST as below:
>         #define DEFINE_NULL_VA_LIST va_list NULL_arg; va_end(NULL_arg)
>         #define NULL_VA_LIST NULL_arg
>
>         Files Added: none
>
>         Files Modified:
>            */common/log/logsystem/hxtwritermanager.cpp (or */common/runtime/pub/hlxlib/stdarg.h)
>
>         Image Size and Heap Use impact (Client -Only): none
>
>         Platforms and Profiles Affected:
>            Platform: android-2.2-arm-qsd_8650a, android-2.2-arm-qsd_8250
>            Profile: helix-client-android-full.
>
>         Distribution Libraries Affected: none
>
>         Distribution library impact and planned action: none
>
>         Platforms and Profiles Build Verified:
>            Platform: android-2.2-arm-qsd_8650a, android-2.2-arm-qsd_8250
>            Profile: helix-client-android-full
>
>         Platforms and Profiles Functionality verified: none
>
>         Branch:
>            HEAD, hxclient_3_6_1_atlas, hxclient_3_6_2_atlas, hxclient_3_6_3_atlas
>
>         Copyright assignment: I am a RealNetworks employee or contractor
>
>
>

From lqing at real.com  Mon Sep 27 18:25:22 2010
From: lqing at real.com (Li Qing)
Date: Tue Sep 28 00:48:08 2010
Subject: [Common-dev] 
	RE: [Common-cvs] runtime/pub/hlxclib stdarg.h, 1.6.2.1, 1.6.2.1.56.1
In-Reply-To: <766B5A29D28DA442AB229AAEE2AFC44508043BEB36@SEAMBX.corp.real.com>
References: <20100927035039.0D53F79C83D@seamx02.real.com>,
	<766B5A29D28DA442AB229AAEE2AFC44508043BEB35@SEAMBX.corp.real.com>,
	<4A242CD46F4C34418D17941FF9746F97740027BB6D@SEAMBX.corp.real.com>,
	<766B5A29D28DA442AB229AAEE2AFC44508043BEB36@SEAMBX.corp.real.com>
Message-ID: <4A242CD46F4C34418D17941FF9746F97740027BB70@SEAMBX.corp.real.com>

SSBoYXZlIGNvbW1pdHRlZCBpbnRvIGhlYWQsIDMxMGF0bGFzLCAzNjFhdGxhcywgMzYyYXRsYXMg
YW5kIDM2M2F0bGFzDQoNCkJlc3QgUmVnYXJkcyENCiAgICAgICAgICAgICAgICAgICAgICAgICAg
IExpIFFpbmcNCi0tDQpSZWFsTmV0d29ya3MgQ2hpbmEsIEJlaWppbmcgT2ZmaWNlDQpUZWw6IDAw
ODYwMTA1OTU0Mjg0OA0KRmF4OiAwMDg2MDEwODU2NTY0NzcNCkFkZHJlc3M6IDE4dGggRmxvb3Is
VG93ZXIgQixQYWNpZmljIENlbnR1cnkgUGxhY2UsMkEgR29uZ1RpQmVpTHUsQ2hhb3lhbmcgRGlz
dHJpY3QsQmVpamluZywgQ2hpbmENClBvc3QgQ29kZTogMTAwMDI3DQpfX19fX19fX19fX19fX19f
X19fX19fX19fX19fX19fX19fX19fX19fDQpGcm9tOiBSZW5qaWUgSHVhbmcNClNlbnQ6IFR1ZXNk
YXksIFNlcHRlbWJlciAyOCwgMjAxMCAxMjo1MCBBTQ0KVG86IExpIFFpbmcNCkNjOiBRaWFuZyBM
dW8NClN1YmplY3Q6IFJFOiBbQ29tbW9uLWN2c10gcnVudGltZS9wdWIvaGx4Y2xpYiBzdGRhcmcu
aCwxLjYuMi4xLDEuNi4yLjEuNTYuMQ0KDQpIaSBRaW5nDQoNCk5vLiBUaGUgbWVhbmluZyBvZiB0
aGUgcGF0Y2ggaXMgOg0KIDEpIGlmIHRoZSBHQ0MgdmVyc2lvbiA+PTQuNCwgd2UgZGVmaW5lIERF
RklORV9OVUxMX1ZBX0xJU1QgIGFzICB7fTsNCiAyKSBlbHNlIGlmIFZBX0xJU1RfSVNfU1RSVUNU
IGlzIGRlZmluZWQgKEkgZG9uJ3Qga25vdyBmb3Igd2hpY2ggcHJvamVjdCksIHRoZW4geW91IGRl
ZmluZSBERUZJTkVfTlVMTF9WQV9MSVNUICBhcyAge05VTEx9Ow0KIDMpIGVsc2UgREVGSU5FX05V
TExfVkFfTElTVCBpcyBOVUxMLg0KDQpJbiB5b3VyIGNhc2UsIGl0IGlzIDEpLiBJIGRvbid0IHVu
ZGVyc3RhbmQgd2h5IGl0IGRvZXMgbm90IGNvbXBpbGUgb24geW91ciBtYWNoaW5lLiBNeSBwb2lu
dCBpcyB0aGF0IG5vIG1hdHRlciBob3cgd2UgY2hhbmdlIGl0LCB3ZSBzaG91bGQgbm90IGJyZWFr
IGNvbmRpdGlvbiAyKSBhbmQgMykgc2luY2UgaXQgaXMgZGlmZmljdWx0IGZvciB5b3UgdG8gdGVz
dCB5b3VyIHBhdGNoIG9uIGFsbCBwbGF0Zm9ybXMuIEFzIHRvIHdoZXRoZXIgZGVmaW5pbmcgREVG
SU5FX05VTExfVkFfTElTVCAgYXMgIHt9IGlzIGNvcnJlY3Qgb3Igbm90IGlzIGFub3RoZXIgcHJv
YmxlbS4NCl9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18NCkZyb206IExp
IFFpbmcNClNlbnQ6IE1vbmRheSwgU2VwdGVtYmVyIDI3LCAyMDEwIDE6MTAgQU0NClRvOiBSZW5q
aWUgSHVhbmcNCkNjOiBRaWFuZyBMdW8NClN1YmplY3Q6ILTwuLQ6IFtDb21tb24tY3ZzXSBydW50
aW1lL3B1Yi9obHhjbGliIHN0ZGFyZy5oLDEuNi4yLjEsMS42LjIuMS41Ni4xDQoNCkkgZG9uJ3Qg
ZW5zdXJlIGlmIGl0IHdpbGwgYmV0IGFuIGlzc3VlLCBidXQgdGhlIGV4cHJlc3Npb24gdmFfbGlz
dCBOdWxsX2FyZyA9IHtOVUxMfTsgaXMgdW5hY2NlcHRhYmxlIGluIG15IG1hY2hpbmUsIHRoZSBj
b21waWxlciBwcm9tcHRlZDogImNhbm5vdCBjb252ZXJ0ICdpbnQnIHRvICd2YV9saXN0JyBpbiBp
bml0aWFsaXphdGlvbiIsIHNvIEkgbW9kaWZpZWQgdGhlIGV4cHJlc3Npb24gdG8gY29uc2lzdGVu
dCB3aXRoIHlvdXIgcGF0Y2guDQoNCg0KDQpCdXQgeW91ciB3b3JyeSBpcyByYXRpb25hbCwgSSB0
aGluayB3ZSBzaG91bGQgcmVkZWZpbmUgdGhlIERFRklORV9OVUxMX1ZBX0xJU1QgbWFjcm8gYXMg
c3RhdGljIHZhX2xpc3QgTnVsbF9hcmcgPSB7fSwgYmVjYXVzZSBhIHN0YXRpYyBzdG9yYWdlIHZh
cmlhYmxlIGlzIGluaXRpYWxpemVkIHdpdGggMCwgc2VlIHRoZSBleHRyYWN0aW9uIGZyb20gbWFu
dWFsOg0KDQoNCg0KSWYgeW91IGRvIG5vdCBpbml0aWFsaXplIGEgc3RydWN0dXJlIHZhcmlhYmxl
LCB0aGUgZWZmZWN0IGRlcGVuZHMgb24gd2hldGhlciBpdCBpcyBoYXMgc3RhdGljIHN0b3JhZ2Ug
KHNlZSBTdG9yYWdlIENsYXNzIDxodHRwOi8vd3d3LmdudS5vcmcvc29mdHdhcmUvZ251LWMtbWFu
dWFsL2dudS1jLW1hbnVhbC5odG1sI1N0b3JhZ2UtQ2xhc3MtU3BlY2lmaWVycz4gU3BlY2lmaWVy
cykgb3Igbm90LiBJZiBpdCBpcywgbWVtYmVycyB3aXRoIGludGVncmFsIHR5cGVzIGFyZSBpbml0
aWFsaXplZCB3aXRoIDAgYW5kIHBvaW50ZXIgbWVtYmVycyBhcmUgaW5pdGlhbGl6ZWQgdG8gTlVM
TDsgb3RoZXJ3aXNlLCB0aGUgdmFsdWUgb2YgdGhlIHN0cnVjdHVyZSdzIG1lbWJlcnMgaXMgaW5k
ZXRlcm1pbmF0ZS4NCg0KQmVzdCBSZWdhcmRzIQ0KICAgICAgICAgICAgICAgICAgICAgICAgICAg
TGkgUWluZw0KLS0NClJlYWxOZXR3b3JrcyBDaGluYSwgQmVpamluZyBPZmZpY2UNClRlbDogMDA4
NjAxMDU5NTQyODQ4DQpGYXg6IDAwODYwMTA4NTY1NjQ3Nw0KQWRkcmVzczogMTh0aCBGbG9vcixU
b3dlciBCLFBhY2lmaWMgQ2VudHVyeSBQbGFjZSwyQSBHb25nVGlCZWlMdSxDaGFveWFuZyBEaXN0
cmljdCxCZWlqaW5nLCBDaGluYQ0KUG9zdCBDb2RlOiAxMDAwMjcNCl9fX19fX19fX19fX19fX19f
X19fX19fX19fX19fX19fX19fX19fX18NCreivP7IyzogUmVuamllIEh1YW5nDQq3osvNyrG85Dog
MjAxMMTqOdTCMjfI1SAxNDoyMw0KytW8/sjLOiBMaSBRaW5nOyBRaWFuZyBMdW8NCtb3zOI6IEZX
OiBbQ29tbW9uLWN2c10gcnVudGltZS9wdWIvaGx4Y2xpYiBzdGRhcmcuaCwxLjYuMi4xLDEuNi4y
LjEuNTYuMQ0KDQpJIHNhdyB0aGUgY2hlY2tpbiBhbmQgaXQgbG9va3MgY29uY2lzZS4gTXkgY29u
Y2VybiBpcyAge05VTEx9ICBtYXkgbm90IGJlIGVxdWl2YWxlbnQgdG8ge30uIFdpbGwgdGhpcyBi
ZXQgYW4gaXNzdWU/IFRoYW5rcy4NCl9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f
X19fX18NCkZyb206IGNvbW1vbi1jdnMtYm91bmNlc0BoZWxpeGNvbW11bml0eS5vcmcgW2NvbW1v
bi1jdnMtYm91bmNlc0BoZWxpeGNvbW11bml0eS5vcmddIE9uIEJlaGFsZiBPZiBjaGluZ19saUBo
ZWxpeGNvbW11bml0eS5vcmcgW2NoaW5nX2xpQGhlbGl4Y29tbXVuaXR5Lm9yZ10NClNlbnQ6IFN1
bmRheSwgU2VwdGVtYmVyIDI2LCAyMDEwIDg6NTEgUE0NClRvOiBjb21tb24tY3ZzQGxpc3RzLmhl
bGl4Y29tbXVuaXR5Lm9yZw0KU3ViamVjdDogW0NvbW1vbi1jdnNdIHJ1bnRpbWUvcHViL2hseGNs
aWIgc3RkYXJnLmgsMS42LjIuMSwxLjYuMi4xLjU2LjENCg0KVXBkYXRlIG9mIC9jdnNyb290L2Nv
bW1vbi9ydW50aW1lL3B1Yi9obHhjbGliDQpJbiBkaXJlY3RvcnkgY3ZzMDEuaW50ZXJuYWwuaGVs
aXhjb21tdW5pdHkub3JnOi90bXAvY3ZzLXNlcnYxNzg0Ng0KDQpNb2RpZmllZCBGaWxlczoNCiAg
ICAgIFRhZzogaHhjbGllbnRfM182XzJfYXRsYXMNCiAgICAgICAgc3RkYXJnLmgNCkxvZyBNZXNz
YWdlOg0KQ29tcGlsaW5nIGZhaWxzIHdoZW4gdGhlIGdjYyBjb21waWxlciB2ZXJzaW9uIGlzID49
IDQuNCAsIHdoZXJlIHRoZSBtYW5nbGluZyBvZiB2YV9saXN0IGhhcyBjaGFuZ2VkLiBJdCBpcyBu
b3QgYWxsb3dlZCB0byBiZSBkZWZpbmVkIGFzIE5VTEwuDQoNCg0KSW5kZXg6IHN0ZGFyZy5oDQo9
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09DQpSQ1MgZmlsZTogL2N2c3Jvb3QvY29tbW9uL3J1bnRpbWUvcHViL2hseGNsaWIv
c3RkYXJnLmgsdg0KcmV0cmlldmluZyByZXZpc2lvbiAxLjYuMi4xDQpyZXRyaWV2aW5nIHJldmlz
aW9uIDEuNi4yLjEuNTYuMQ0KZGlmZiAtdSAtZCAtcjEuNi4yLjEgLXIxLjYuMi4xLjU2LjENCi0t
LSBzdGRhcmcuaCAgICAxOCBKYW4gMjAwOCAwOTozMzowOCAtMDAwMCAgICAgIDEuNi4yLjENCisr
KyBzdGRhcmcuaCAgICAyNyBTZXAgMjAxMCAwMzo1MTowMSAtMDAwMCAgICAgIDEuNi4yLjEuNTYu
MQ0KQEAgLTc2LDEwICs3NiwxMCBAQA0KICMgIGVuZGlmDQogI2VuZGlmDQoNCi0jaWZkZWYgVkFf
TElTVF9JU19TVFJVQ1QNCisjaWYgX19HTlVDX18gPiA0IHx8ICg0ID09IF9fR05VQ19fICYmIF9f
R05VQ19NSU5PUl9fID4gMykgfHwgZGVmaW5lZChWQV9MSVNUX0lTX1NUUlVDVCkNCiAvLyB2YV9s
aXN0IGlzIG5vdCBvZiBzYW1lIHR5cGUgaW4gYWxsIHBsYXRmb3JtLg0KIC8vIEl0IGlzIHN0cnVj
dCBpbiBzb21lIHBsYXRmb3JtcyAoZWc6IFJWQ1QpIGFuZCBwb2ludGVyIG9uIG90aGVycw0KLSNk
ZWZpbmUgREVGSU5FX05VTExfVkFfTElTVCAgIHZhX2xpc3QgTnVsbF9hcmcgPSB7TlVMTH0NCisj
ZGVmaW5lIERFRklORV9OVUxMX1ZBX0xJU1QgICB2YV9saXN0IE51bGxfYXJnID0ge30NCiAjZGVm
aW5lIE5VTExfVkFfTElTVCAgICAgICAgICBOdWxsX2FyZw0KICNlbHNlDQogI2RlZmluZSBERUZJ
TkVfTlVMTF9WQV9MSVNUDQoNCg0KX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f
X19fX19fX19fX18NCkNvbW1vbi1jdnMgbWFpbGluZyBsaXN0DQpDb21tb24tY3ZzQGhlbGl4Y29t
bXVuaXR5Lm9yZw0KaHR0cDovL2xpc3RzLmhlbGl4Y29tbXVuaXR5Lm9yZy9tYWlsbWFuL2xpc3Rp
bmZvL2NvbW1vbi1jdnMNCg0K

From ext-debashis.2.panigrahi at nokia.com  Tue Sep 28 21:28:37 2010
From: ext-debashis.2.panigrahi at nokia.com (ext-debashis.2.panigrahi@nokia.com)
Date: Wed Sep 29 03:48:06 2010
Subject: [Common-dev] [Commit Notification] CR: ou1cimx1#583901:
 HLXTNESERVER crashes randomly at some point after startup
In-Reply-To: <1FFEF31EBAA4F64B80D33027D42977603429D36427@NOK-EUMSG-02.mgdnok.nokia.com>
References: <20D73E2631F7914F868646E119DEC1CE28F41BE5DA@NOK-EUMSG-02.mgdnok.nokia.com>,
	<1FFEF31EBAA4F64B80D33027D42977603429D35D1D@NOK-EUMSG-02.mgdnok.nokia.com>
	<20D73E2631F7914F868646E119DEC1CE28F41BE5E6@NOK-EUMSG-02.mgdnok.nokia.com>
	<1FFEF31EBAA4F64B80D33027D42977603429D36427@NOK-EUMSG-02.mgdnok.nokia.com>
Message-ID: <20D73E2631F7914F868646E119DEC1CE28F4451331@NOK-EUMSG-02.mgdnok.nokia.com>

Hi,

This is now checked on to 210CayS, 420Bizo and HEAD.

Thanks and Regards,
Debashis.

-----Original Message-----
From: Amick Patrick (Nokia-MS/Dallas) 
Sent: Tuesday, September 28, 2010 8:53 PM
To: Panigrahi Debashis.2 (EXT-Sasken/Bangalore); I_EXT_HELIX_ALL_GMS DG
Subject: RE: ou1cimx1#583901: HLXTNESERVER crashes randomly at some point after startup

Yes, please go ahead with the checkin.

-----Original Message-----
From: Panigrahi Debashis.2 (EXT-Sasken/Bangalore) 
Sent: Tuesday, September 28, 2010 6:31 AM
To: Amick Patrick (Nokia-MS/Dallas); I_EXT_HELIX_ALL_GMS DG
Subject: RE: ou1cimx1#583901: HLXTNESERVER crashes randomly at some point after startup

Hi Pat,

We have not yet received files from the failure originator. This changes were  done only after analyzing the the crash log that is attached with the reported case. 
Is it ok to commit this change without testing with the reported test contents?

Thanks and Regards,
Debashis.

________________________________________
From: Amick Patrick (Nokia-MS/Dallas)
Sent: 28 September 2010 00:15
To: Panigrahi Debashis.2 (EXT-Sasken/Bangalore); I_EXT_HELIX_ALL_GMS DG
Subject: RE: ou1cimx1#583901: HLXTNESERVER crashes randomly at some point after startup

Looks good.

Did we ever get a clip from the originator that causes this error?


pat

-----Original Message-----
From: Panigrahi Debashis.2 (EXT-Sasken/Bangalore)
Sent: Friday, September 24, 2010 8:12 AM
To: I_EXT_HELIX_ALL_GMS DG
Subject: CR: ou1cimx1#583901: HLXTNESERVER crashes randomly at some point after startup

"Nokia submits this code under the terms of a commercial contribution agreement with Real Networks, and I am authorized to contribute this code under said agreement."

Modified by:  ext-debashis.2.panigrahi@nokia.com

Reviewed by:

RC Id: ou1cimx1#583901

Date: 09/24/2010

Project: SymbianMmf_wm

Synopsis: HLXTNESERVER crashes randomly at some point after startup

Overview:
The Thumbnail server crash seen in CHXDataSourceCContent::ReadDone() is USER 130 (accessing array which is out of bound), where we are trying to access ' m_lLastFileObjectIndex' element from the queue(m_MultiReadQueue of type RArray) and send ReadDone for that.

Fix:
Now checking for the File object Index if it is within the RArray Count() and is greater than zero then only going for Read done on that object.

Files modified & changes:
common/fileio/platform/symbian/hxdatasource_ccontent.cpp

Image Size and Heap Use impact: No major impact

Module Release testing (STIF) : Passed

Test case(s) Added  : No

Memory leak check performed : Passed, No additional leaks introduced.

Platforms and Profiles Build Verified: helix-client-s60-52-mmf-mdf-dsp

Platforms and Profiles Functionality verified: armv5, winscw

Branch: 210CayS, 420Bizo and HEAD

CVS Diff on 210CayS:
Index: hxdatasource_ccontent.cpp
===================================================================
RCS file: /cvsroot/common/fileio/platform/symbian/hxdatasource_ccontent.cpp,v
retrieving revision 1.1.2.11
diff -u -w -r1.1.2.11 hxdatasource_ccontent.cpp
--- hxdatasource_ccontent.cpp   4 Jun 2010 04:39:11 -0000       1.1.2.11
+++ hxdatasource_ccontent.cpp   23 Sep 2010 09:11:51 -0000
@@ -1082,9 +1082,12 @@
                  {
                    bytesRead = 0;
                    HX_RELEASE(aElement.m_pBuffer);
+                   if( m_lLastFileObjectIndex < m_MultiReadQueue.Count() && m_lLastFileObjectIndex >= 0 )
+                   {
                    m_MultiReadQueue[m_lLastFileObjectIndex].m_pObserver2->ReadDone(aElement.m_pBuffer ,bytesRead);
             }
       }
+      }


     else // 32 bit read done
@@ -1112,8 +1115,11 @@
                 {
                    bytesRead = 0;
                    HX_RELEASE(aElement.m_pBuffer);
+                   if( m_lLastFileObjectIndex < m_MultiReadQueue.Count() && m_lLastFileObjectIndex >= 0 )
+                   {
                    m_MultiReadQueue[m_lLastFileObjectIndex].m_pObserver2->ReadDone(aElement.m_pBuffer ,bytesRead);
                         }
+                        }

       }


From lqing at real.com  Wed Sep 29 02:21:19 2010
From: lqing at real.com (Li Qing)
Date: Wed Sep 29 08:40:54 2010
Subject: [Common-dev] CR-Resend: Fix Bug #10679: can not play a particular
	mp3 file
Message-ID: <4A242CD46F4C34418D17941FF9746F97740027BB71@SEAMBX.corp.real.com>

Modified by: lqing@real.com
Date: 09/17/2010
Project: RealPlayer for Android Smartphones
Bug Number: 10679
Bug URL: https://bugs.helixcommunity.org/show_bug.cgi?id=10679

Synopsis: Fix Bug #10679: can not play a particular mp3 file

Overview: The bug happens when there are a lot of junk information in file header, so that the player can not find the sync word in a block of buffered data, then it causes a INVALID_FILE error. I modified the CRnMp3Fmt::InitStream_n function to ignore all unknown data until found a valid frame. I think it would not bring other problems except to waste a few time on type checking.

Files Modified:
datatype/mp3/fileformat/mp3ff.cpp

Image Size and Heap Use impact (Client -Only):
None

Platforms and Profiles Affected:
Platform: android-donut3230-arm-qsd_8x50, android-2.2-arm-qsd_8250
Profile: helix-client-android-full

Distribution Libraries Affected:
None

Distribution library impact and planned action:
None

Platforms and Profiles Build Verified:
Platform: android-donut3230-arm-qsd_8x50, android-2.2-arm-qsd_8250
Profile: helix-client-android-full

Platforms and Profiles Functionality verified:
Platform: android-donut3230-arm-qsd_8x50
Profile: helix-client-android-full

Branch: HEAD, 361atlas, 362atlas

Copyright assignment: I am a RealNetworks employee or contractor



Best Regards!
                           Li Qing
--
RealNetworks China, Beijing Office
Tel: 008601059542848
Fax: 008601085656477
Address: 18th Floor,Tower B,Pacific Century Place,2A GongTiBeiLu,Chaoyang District,Beijing, China
Post Code: 100027
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mp3ff.cpp.diff
Type: text/x-patch
Size: 619 bytes
Desc: mp3ff.cpp.diff
Url : http://lists.helixcommunity.org/pipermail/common-dev/attachments/20100929/63eb5a63/mp3ff.cpp.bin
From jgordon at real.com  Wed Sep 29 09:54:48 2010
From: jgordon at real.com (Jamie Gordon)
Date: Wed Sep 29 16:14:17 2010
Subject: [Common-dev] CR-Resend: Fix Bug #10679: can not play a particular
	mp3 file
In-Reply-To: <4A242CD46F4C34418D17941FF9746F97740027BB71@SEAMBX.corp.real.com>
References: <4A242CD46F4C34418D17941FF9746F97740027BB71@SEAMBX.corp.real.com>
Message-ID: <4CA37D68.3020606@real.com>

ok

On 9/29/2010 3:21 AM, Li Qing wrote:
> Modified by: lqing@real.com
> Date: 09/17/2010
> Project: RealPlayer for Android Smartphones
> Bug Number: 10679
> Bug URL: https://bugs.helixcommunity.org/show_bug.cgi?id=10679
>
> Synopsis: Fix Bug #10679: can not play a particular mp3 file
>
> Overview: The bug happens when there are a lot of junk information in file header, so that the player can not find the sync word in a block of buffered data, then it causes a INVALID_FILE error. I modified the CRnMp3Fmt::InitStream_n function to ignore all unknown data until found a valid frame. I think it would not bring other problems except to waste a few time on type checking.
>
> Files Modified:
> datatype/mp3/fileformat/mp3ff.cpp
>
> Image Size and Heap Use impact (Client -Only):
> None
>
> Platforms and Profiles Affected:
> Platform: android-donut3230-arm-qsd_8x50, android-2.2-arm-qsd_8250
> Profile: helix-client-android-full
>
> Distribution Libraries Affected:
> None
>
> Distribution library impact and planned action:
> None
>
> Platforms and Profiles Build Verified:
> Platform: android-donut3230-arm-qsd_8x50, android-2.2-arm-qsd_8250
> Profile: helix-client-android-full
>
> Platforms and Profiles Functionality verified:
> Platform: android-donut3230-arm-qsd_8x50
> Profile: helix-client-android-full
>
> Branch: HEAD, 361atlas, 362atlas
>
> Copyright assignment: I am a RealNetworks employee or contractor
>
>
>
> Best Regards!
>                             Li Qing
> --
> RealNetworks China, Beijing Office
> Tel: 008601059542848
> Fax: 008601085656477
> Address: 18th Floor,Tower B,Pacific Century Place,2A GongTiBeiLu,Chaoyang District,Beijing, China
> Post Code: 100027

 

Site Map   |   Terms of Use   |   Privacy Policy   |   Contact Us

Copyright © 1995-2007 RealNetworks, Inc. All rights reserved. RealNetworks and Helix are trademarks of RealNetworks.
All other trademarks or registered trademarks are the property of their respective holders.