[VM] [ENH] [WIN32] Win32 enhancements

John M McIntosh johnmci at smalltalkconsulting.com
Wed Feb 20 22:14:33 UTC 2002


>I  built this on W2K with MSVC 6, all with recent patches.  I also 
>have an SDK on my system.
>My confidence that all these changes have produced a solid exe is 
>low, but it does seem to work.  My biggest doubts center on the 
>newly introduced __int64, which has no code changes supporting it, 
>and the code dealing with the 512 byte header (see my earlier post). 
>However, it may be that, since Win32 has its own file handling code, 
>the squeakInt64 that is set to __int64 never gets used at all.

It's used in the fileplugin and directory logic. File size for example reads

EXPORT(int) FilePlugin_primitiveFileSize(void) {
     squeakFileOffsetType size;
     SQFile * file;
     int objectPointer;

	/* begin fileValueOf: */
	objectPointer = interpreterProxy->stackValue(0);
	if (!((interpreterProxy->isBytes(objectPointer)) && 
((interpreterProxy->byteSizeOf(objectPointer)) == 
(fileRecordSize())))) {
		interpreterProxy->primitiveFail();
		file = null;
		goto l1;
	}
	file = interpreterProxy->firstIndexableField(objectPointer);
l1:	/* end fileValueOf: */;
	if (!(interpreterProxy->failed())) {
		size = sqFileSize(file);
	}
	if (!(interpreterProxy->failed())) {
		interpreterProxy->pop(2);
 
	interpreterProxy->push(interpreterProxy->positive64BitIntegerFor(size));
	}
}

mm of course if your implementation of sqFileSize returns int, then oh well.

The easy way to check is to create a 3.0GB file somewhere, even say a 
2.4GB DVD image file. The use the file list window and see what it 
thinks the size of the file is. That will determine if the directory 
logic works. Of course it's always interesting to see what is 
returned on 32bit systems overlaying a 64bit file system.

Then open the file as read and seek to the end (size of the file) and 
get the file postion. In both cases the numbers you expect to use 
should be > 2GB
-- 
--
===========================================================================
John M. McIntosh <johnmci at smalltalkconsulting.com> 1-800-477-2659
Corporate Smalltalk Consulting Ltd.  http://www.smalltalkconsulting.com
===========================================================================



More information about the Squeak-dev mailing list