--- a/Win32OperatingSystem.st Thu Jan 21 19:36:50 2010 +0100
+++ b/Win32OperatingSystem.st Mon Jan 25 18:36:31 2010 +0100
@@ -4764,13 +4764,13 @@
getDriveType:aPathName
"returns:
- 0 -> Unknown
- 1 -> Invalid
- 2 -> removable
- 3 -> fixed
- 4 -> remote
- 5 -> cdrom
- 6 -> ramdisk.
+ 0 -> Unknown
+ 1 -> Invalid
+ 2 -> removable
+ 3 -> fixed
+ 4 -> remote
+ 5 -> cdrom
+ 6 -> ramdisk.
This is a stupid interface - do not use."
%{
@@ -4778,20 +4778,20 @@
if (__isStringLike(aPathName)) {
#ifdef DO_WRAP_CALLS
- char _aPathName[MAXPATHLEN];
-
- strncpy(_aPathName, __stringVal(aPathName), MAXPATHLEN-1); _aPathName[MAXPATHLEN-1] = '\0';
- do {
- __threadErrno = 0;
- ret = STX_API_CALL1( "GetDriveType", GetDriveType, _aPathName);
- } while ((ret < 0) && (__threadErrno == EINTR));
-#else
- ret = GetFileAttributes((char *) __stringVal(aPathName));
- if (ret < 0) {
- __threadErrno = __WIN32_ERR(GetLastError());
- }
-#endif
- RETURN (__MKSMALLINT(ret));
+ char _aPathName[MAXPATHLEN];
+
+ strncpy(_aPathName, __stringVal(aPathName), MAXPATHLEN-1); _aPathName[MAXPATHLEN-1] = '\0';
+ do {
+ __threadErrno = 0;
+ ret = STX_API_CALL1( "GetDriveType", GetDriveType, _aPathName);
+ } while ((ret < 0) && (__threadErrno == EINTR));
+#else
+ ret = GetDriveType((char *) __stringVal(aPathName));
+ if (ret < 0) {
+ __threadErrno = __WIN32_ERR(GetLastError());
+ }
+#endif
+ RETURN (__MKSMALLINT(ret));
}
%}.
^ self primitiveFailed
@@ -5610,52 +5610,52 @@
if (__isStringLike(aPathName)) {
#ifdef DO_WRAP_CALLS
- char _aPathName[MAXPATHLEN];
-
- strncpy(_aPathName, __stringVal(aPathName), MAXPATHLEN-1); _aPathName[MAXPATHLEN-1] = '\0';
- do {
- __threadErrno = 0;
- ret = STX_API_CALL1( "GetFileAttributes", GetFileAttributes, _aPathName);
- } while ((ret < 0) && (__threadErrno == EINTR));
-#else
- ret = GetFileAttributes((char *) __stringVal(aPathName));
- if (ret < 0) {
- __threadErrno = __WIN32_ERR(GetLastError());
- }
-#endif
- if (ret >= 0) {
- RETURN ( __mkSmallInteger(ret) );
- }
- __threadErrno = __WIN32_ERR(GetLastError());
- RETURN (nil);
+ char _aPathName[MAXPATHLEN];
+
+ strncpy(_aPathName, __stringVal(aPathName), MAXPATHLEN-1); _aPathName[MAXPATHLEN-1] = '\0';
+ do {
+ __threadErrno = 0;
+ ret = STX_API_CALL1( "GetFileAttributesA", GetFileAttributesA, _aPathName);
+ } while ((ret < 0) && (__threadErrno == EINTR));
+#else
+ ret = GetFileAttributesA((char *) __stringVal(aPathName));
+ if (ret < 0) {
+ __threadErrno = __WIN32_ERR(GetLastError());
+ }
+#endif
+ if (ret >= 0) {
+ RETURN ( __mkSmallInteger(ret) );
+ }
+ __threadErrno = __WIN32_ERR(GetLastError());
+ RETURN (nil);
}
if (__isUnicode16String(aPathName)) {
- wchar_t _wPathName[MAXPATHLEN+1];
- int i, l;
-
- l = __unicode16StringSize(aPathName);
- if (l > MAXPATHLEN) l = MAXPATHLEN;
- for (i=0; i<l; i++) {
- _wPathName[i] = __unicode16StringVal(aPathName)[i];
- }
- _wPathName[i] = 0;
+ wchar_t _wPathName[MAXPATHLEN+1];
+ int i, l;
+
+ l = __unicode16StringSize(aPathName);
+ if (l > MAXPATHLEN) l = MAXPATHLEN;
+ for (i=0; i<l; i++) {
+ _wPathName[i] = __unicode16StringVal(aPathName)[i];
+ }
+ _wPathName[i] = 0;
#ifdef DO_WRAP_CALLS
- do {
- __threadErrno = 0;
- ret = STX_API_CALL1( "GetFileAttributesW", GetFileAttributesW, _wPathName);
- } while ((ret < 0) && (__threadErrno == EINTR));
-#else
- ret = GetFileAttributesW(_wPathName);
- if (ret < 0) {
- __threadErrno = __WIN32_ERR(GetLastError());
- }
-#endif
- if (ret >= 0) {
- RETURN ( __mkSmallInteger(ret) );
- }
- __threadErrno = __WIN32_ERR(GetLastError());
- RETURN (nil);
+ do {
+ __threadErrno = 0;
+ ret = STX_API_CALL1( "GetFileAttributesW", GetFileAttributesW, _wPathName);
+ } while ((ret < 0) && (__threadErrno == EINTR));
+#else
+ ret = GetFileAttributesW(_wPathName);
+ if (ret < 0) {
+ __threadErrno = __WIN32_ERR(GetLastError());
+ }
+#endif
+ if (ret >= 0) {
+ RETURN ( __mkSmallInteger(ret) );
+ }
+ __threadErrno = __WIN32_ERR(GetLastError());
+ RETURN (nil);
}
%}.
^ self primitiveFailed
@@ -16417,11 +16417,11 @@
!Win32OperatingSystem class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libbasic/Win32OperatingSystem.st,v 1.386 2010-01-20 11:41:07 stefan Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic/Win32OperatingSystem.st,v 1.387 2010-01-25 17:36:31 cg Exp $'
!
version_CVS
- ^ '$Header: /cvs/stx/stx/libbasic/Win32OperatingSystem.st,v 1.386 2010-01-20 11:41:07 stefan Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic/Win32OperatingSystem.st,v 1.387 2010-01-25 17:36:31 cg Exp $'
! !
Win32OperatingSystem initialize!