Win32OperatingSystem.st
changeset 24543 eb3802830398
parent 24371 b38f6de3d73d
child 24771 c2ac84744237
--- a/Win32OperatingSystem.st	Tue Aug 13 17:52:51 2019 +0200
+++ b/Win32OperatingSystem.st	Tue Aug 13 17:53:24 2019 +0200
@@ -1920,53 +1920,54 @@
     |resultInfo error fileSize osPathname osModTime osCrtTime osAccTime osFileAttributes|
 
 %{
-    HANDLE d;
     WIN32_FIND_DATAW data;
     int rslt;
 
     if ((dirPointer != nil)
     && __isExternalAddressLike(dirPointer)) {
-	// __INST(lastErrorNumber) = nil;
-	d = _HANDLEVal(dirPointer);
-
-	do {
-	    __threadErrno = 0;
-	    // do not cast to INT - will loose sign bit then!
-	    rslt = (int)(STX_API_NOINT_CALL2( "FindNextFileW", FindNextFileW, d, &data ));
-	} while ((rslt < 0) && (__threadErrno == EINTR));
-
-	if (rslt > 0) {
-	    fileSize  = __MKLARGEINT64(1, (unsigned INT)data.nFileSizeLow, (unsigned INT)data.nFileSizeHigh);
-	    osPathname = __mkStringOrU16String_maxlen( data.cFileName, MAXPATHLEN );
-	    osFileAttributes = __mkSmallInteger( data.dwFileAttributes );
-
-	    osCrtTime = FileTimeToOsTime1970(&data.ftCreationTime);
-	    osAccTime = FileTimeToOsTime1970(&data.ftLastAccessTime);
-	    osModTime = FileTimeToOsTime1970(&data.ftLastWriteTime);
-	} else {
-	    // we signal end-of-directory through a nil osPathName
-	    if (__threadErrno != __WIN32_ERR(ERROR_NO_MORE_FILES))
-		error = __mkSmallInteger( __threadErrno );
-	}
+        // __INST(lastErrorNumber) = nil;
+        HANDLE d = _HANDLEVal(dirPointer);
+
+        do {
+            __threadErrno = 0;
+            // do not cast to INT - will loose sign bit then!
+            rslt = (int)(STX_API_NOINT_CALL2( "FindNextFileW", FindNextFileW, d, &data ));
+        } while ((rslt < 0) && (__threadErrno == EINTR));
+
+        if (rslt > 0) {
+            fileSize  = __MKLARGEINT64(1, (unsigned INT)data.nFileSizeLow, (unsigned INT)data.nFileSizeHigh);
+            osPathname = __mkStringOrU16String_maxlen( data.cFileName, MAXPATHLEN );
+            osFileAttributes = __mkSmallInteger( data.dwFileAttributes );
+
+            osCrtTime = FileTimeToOsTime1970(&data.ftCreationTime);
+            osAccTime = FileTimeToOsTime1970(&data.ftLastAccessTime);
+            osModTime = FileTimeToOsTime1970(&data.ftLastWriteTime);
+        } else {
+            // we signal end-of-directory through a nil osPathName
+            if (__threadErrno != __WIN32_ERR(ERROR_NO_MORE_FILES))
+                error = __mkSmallInteger( __threadErrno );
+        }
     }
 %}.
     error notNil ifTrue:[
-	^ StreamIOError newException
-	    errorCode:error;
-	    osErrorHolder:(OperatingSystem errorHolderForNumber:error);
-	    parameter:aDirectoryStream;
-	    raiseRequest
+        ^ StreamIOError newException
+            errorCode:error;
+            osErrorHolder:(OperatingSystem errorHolderForNumber:error);
+            parameter:aDirectoryStream;
+            raiseRequest
     ].
 
     osPathname isNil ifTrue:[^ nil].
 
     ^ self
-	linkInfoFor:osPathname
-	fileSize:fileSize
-	fileAttributes:osFileAttributes
-	osCrtTime:osCrtTime
-	osAccTime:osAccTime
-	osModTime:osModTime
+        linkInfoFor:osPathname
+        fileSize:fileSize
+        fileAttributes:osFileAttributes
+        osCrtTime:osCrtTime
+        osAccTime:osAccTime
+        osModTime:osModTime
+
+    "Modified: / 13-08-2019 / 17:37:39 / Stefan Vogel"
 ! !
 
 !Win32OperatingSystem class methodsFor:'error messages'!