Win32OperatingSystem.st
changeset 9108 b67a03ebcf56
parent 9100 0ebdc95e88ff
child 9111 4a1d0a1d1576
--- a/Win32OperatingSystem.st	Tue Feb 14 15:32:32 2006 +0100
+++ b/Win32OperatingSystem.st	Tue Feb 14 15:33:27 2006 +0100
@@ -28,20 +28,6 @@
 	privateIn:Win32OperatingSystem
 !
 
-OSHandle subclass:#Win32Handle
-	instanceVariableNames:''
-	classVariableNames:''
-	poolDictionaries:''
-	privateIn:Win32OperatingSystem
-!
-
-Win32OperatingSystem::Win32Handle subclass:#ITypeLib
-	instanceVariableNames:''
-	classVariableNames:''
-	poolDictionaries:''
-	privateIn:Win32OperatingSystem
-!
-
 Object subclass:#OSProcessStatus
 	instanceVariableNames:'pid status code core'
 	classVariableNames:''
@@ -58,20 +44,6 @@
 	privateIn:Win32OperatingSystem
 !
 
-Object subclass:#TYPEATTR
-	instanceVariableNames:''
-	classVariableNames:''
-	poolDictionaries:''
-	privateIn:Win32OperatingSystem
-!
-
-Win32OperatingSystem::Win32Handle subclass:#ITypeInfo
-	instanceVariableNames:''
-	classVariableNames:''
-	poolDictionaries:''
-	privateIn:Win32OperatingSystem
-!
-
 OSHandle subclass:#Win32IOHandle
 	instanceVariableNames:''
 	classVariableNames:'Lobby'
@@ -79,7 +51,7 @@
 	privateIn:Win32OperatingSystem
 !
 
-Win32OperatingSystem::Win32Handle subclass:#Win32ProcessHandle
+Win32Handle subclass:#Win32ProcessHandle
 	instanceVariableNames:'pid'
 	classVariableNames:''
 	poolDictionaries:''
@@ -5323,14 +5295,6 @@
     "Modified: 28.1.1998 / 14:27:18 / md"
 ! !
 
-!Win32OperatingSystem class methodsFor:'ole/com support'!
-
-iTypeLibAccessor
-    "provide access to the type library class"
-
-    ^ ITypeLib
-! !
-
 !Win32OperatingSystem class methodsFor:'os queries'!
 
 executableFileExtensions
@@ -8334,197 +8298,6 @@
     ^ type == #unknown
 ! !
 
-!Win32OperatingSystem::Win32Handle class methodsFor:'documentation'!
-
-documentation
-"
-    I represent a non-I/O HANDLE.
-"
-! !
-
-!Win32OperatingSystem::Win32Handle methodsFor:'release'!
-
-closeHandle
-    "close the handle"
-
-%{
-    HANDLE h = (HANDLE)(__externalAddressVal(self));
-
-    if (h) {
-        __externalAddressVal(self) = (HANDLE)0;
-        CloseHandle(h);
-    }
-%}.
-!
-
-finalize
-    "a filedescriptor was garbage collected - close the underlying handle"
-
-    self closeHandle
-! !
-
-!Win32OperatingSystem::ITypeLib class methodsFor:'instance creation'!
-
-loadTypeLib:pathName
-    |errorNumber newHandle|
-%{
-#ifdef WANT_OLE
-    if ( __isString(pathName) || __isUnicode16String(pathName)) {
-        OLECHAR __olePathNameBuffer[MAX_PATH+1];
-        OLECHAR *__olePathName;
-        ITypeLib *pTypeLib;
-        HRESULT rslt;
-
-        if (__isString(pathName)) {
-            char *__pathName = __stringVal(pathName);
-
-            /* convert to widechar */
-            {
-                int i = 0;
-                char *cp;
-
-                for (cp = __pathName; i<MAX_PATH; i++) {
-                    __olePathNameBuffer[i] = cp[i];
-                    if (cp[i] == 0) break;
-                }
-                __olePathName[MAX_PATH] = 0;
-            }
-            __olePathName = __olePathNameBuffer;
-        } else {
-            __olePathName = __unicode16StringVal(pathName);
-        }
-        rslt = LoadTypeLib(__olePathName, &pTypeLib);
-# ifdef OLE_DEBUG
-        fprintf(stderr, "rslt: 0x%x handle: %x\n", rslt, pTypeLib);
-        switch (rslt) {
-            case S_OK:
-                fprintf(stderr, "OK\n");
-                break;
-
-            case E_OUTOFMEMORY:
-                fprintf(stderr, "Out of memory\n");
-                break;
-
-            case E_INVALIDARG:
-                fprintf(stderr, "One or more arguments is invalid\n");
-                break;
-
-            case TYPE_E_IOERROR:
-                fprintf(stderr, "The function could not write to the file\n");
-                break;
-
-            case TYPE_E_INVALIDSTATE:
-                fprintf(stderr, "The type library could not be opened\n");
-                break;
-
-            case TYPE_E_INVDATAREAD:
-                fprintf(stderr, "The function could not read from the file\n");
-                break;
-
-            case TYPE_E_UNSUPFORMAT:
-                fprintf(stderr, "The type library has an older format\n");
-                break;
-
-            case TYPE_E_UNKNOWNLCID:
-                fprintf(stderr, "The LCID could not be found in the OLE-supported DLLs\n");
-                break;
-
-            case TYPE_E_CANTLOADLIBRARY:
-                fprintf(stderr, "The type library or DLL could not be loaded\n");
-                break;
-
-            default:
-                fprintf(stderr, "other error\n");
-                break;
-        }
-# endif /* OLE_DEBUG */
-        if (rslt == S_OK) {
-            if (pTypeLib) {
-                newHandle = __MKEXTERNALADDRESS(pTypeLib);
-                __qClass(newHandle) = self; __STORE(newHandle, self);
-            }
-        } else {
-            errorNumber = __mkSmallInteger( __WIN32_ERR(GetLastError()) );
-        }
-    }
-#endif /* WANT_OLE */
-%}.
-    newHandle notNil ifTrue:[
-        newHandle registerForFinalization.
-        ^ newHandle.
-    ].
-
-    errorNumber isNil ifTrue:[
-        self error:'invalid argument(s)'.
-    ] ifFalse:[
-        (OperatingSystem errorHolderForNumber:errorNumber) reportError
-    ].
-! !
-
-!Win32OperatingSystem::ITypeLib methodsFor:'accessing'!
-
-getTypeInfo:index
-    |errorNumber newHandle|
-%{
-#ifdef WANT_OLE
-    ITypeLib *pTypeLib = (ITypeLib *)(__externalAddressVal(self));
-
-    if (pTypeLib && __isSmallInteger(index)) {
-        int __index = __intVal(index);
-        if (__index >= 0) {
-            HRESULT rslt;
-            ITypeInfo *pTypeInfo;
-
-#ifdef DOES_NOT_WORK
-            rslt = ITypeLib_GetTypeInfo(pTypeLib, __index, &pTypeInfo);
-#else
-            rslt = pTypeLib->lpVtbl->GetTypeInfo(pTypeLib, __index, &pTypeInfo);
-#endif
-            if (rslt == S_OK) {
-                if (pTypeLib) {
-                    newHandle = __MKEXTERNALADDRESS(pTypeLib);
-                    __qClass(newHandle) = @global(Win32OperatingSystem::ITypeInfo);
-                    __STORE(newHandle, self);
-                }
-            } else {
-                errorNumber = __mkSmallInteger( __WIN32_ERR(GetLastError()) );
-            }
-        }
-    }
-#endif /* WANT_OLE */
-%}.
-    newHandle notNil ifTrue:[
-        newHandle registerForFinalization.
-        ^ newHandle.
-    ].
-
-    errorNumber isNil ifTrue:[
-        self error:'invalid argument(s)'.
-    ] ifFalse:[
-        (OperatingSystem errorHolderForNumber:errorNumber) reportError
-    ].
-!
-
-getTypeInfoCount
-%{
-#ifdef WANT_OLE
-    ITypeLib *pTypeLib = (ITypeLib *)(__externalAddressVal(self));
-
-    if (pTypeLib) {
-	int typeInfoCount;
-
-#ifdef DOES_NOT_WORK
-	typeInfoCount = ITypeLib_GetTypeInfoCount(pTypeLib);
-#else
-	typeInfoCount = pTypeLib->lpVtbl->GetTypeInfoCount(pTypeLib);
-#endif
-	return (__mkSmallInteger( typeInfoCount ));
-    }
-#endif /* WANT_OLE */
-%}.
-    self error:'invalid argument(s)'.
-! !
-
 !Win32OperatingSystem::OSProcessStatus class methodsFor:'documentation'!
 
 documentation
@@ -9758,98 +9531,6 @@
     "Created: / 19.5.1999 / 21:45:05 / cg"
 ! !
 
-!Win32OperatingSystem::ITypeInfo methodsFor:'accessing'!
-
-getDocumentation:memberID
-    |errorNumber ok name docString helpContext helpFile|
-%{
-#ifdef WANT_OLE
-    ITypeInfo *pTypeInfo = (ITypeInfo *)(__externalAddressVal(self));
-
-    if (pTypeInfo) {
-	HRESULT rslt;
-	TYPEATTR *pTypeAttr;
-	MEMBERID __memberID = (MEMBERID)-1;
-	BSTR __name;
-	BSTR __docString;
-	DWORD __helpContext;
-	BSTR __helpFile;
-
-	if (__isSmallInteger(memberID)) {
-	    __memberID = __intVal(memberID);
-	}
-
-#ifdef DOES_NOT_WORK
-	rslt = ITypeInfo_GetDocumentation(pTypeInfo, __memberID, &__name, &__docString, &__helpContext, &__helpFile);
-#else
-	rslt = pTypeInfo->lpVtbl->GetDocumentation(pTypeInfo, __memberID, &__name, &__docString, &__helpContext, &__helpFile);
-#endif
-	if (rslt == S_OK) {
-	    if (pTypeAttr) {
-		extern OBJ __MKU16STRING(short *);
-
-		name = __MKU16STRING(__name);
-		docString = __MKU16STRING(__docString);
-		helpFile = __MKU16STRING(__helpFile);
-		helpContext = __mkSmallInteger(__helpContext);
-		ok = true;
-	    }
-	} else {
-	    errorNumber = __mkSmallInteger( __WIN32_ERR(GetLastError()) );
-	}
-    }
-#endif /* WANT_OLE */
-%}.
-    ok == true ifTrue:[
-	^ Array with:name with:docString with:helpContext with:helpFile.
-    ].
-
-    errorNumber isNil ifTrue:[
-	self error:'invalid argument(s)'.
-    ] ifFalse:[
-	(OperatingSystem errorHolderForNumber:errorNumber) reportError
-    ].
-!
-
-getTypeAttr
-    |errorNumber newHandle|
-%{
-#ifdef WANT_OLE
-    ITypeInfo *pTypeInfo = (ITypeInfo *)(__externalAddressVal(self));
-
-    if (pTypeInfo) {
-        HRESULT rslt;
-        TYPEATTR *pTypeAttr;
-
-#ifdef DOES_NOT_WORK
-        rslt = ITypeInfo_GetTypeAttr(pTypeInfo, &pTypeAttr);
-#else
-        rslt = pTypeInfo->lpVtbl->GetTypeAttr(pTypeInfo, &pTypeAttr);
-#endif
-        if (rslt == S_OK) {
-            if (pTypeAttr) {
-                newHandle = __MKEXTERNALADDRESS(pTypeAttr);
-                __qClass(newHandle) = @global(Win32OperatingSystem::TYPEATTR);
-                __STORE(newHandle, self);
-            }
-        } else {
-            errorNumber = __mkSmallInteger( __WIN32_ERR(GetLastError()) );
-        }
-    }
-#endif /* WANT_OLE */
-%}.
-    newHandle notNil ifTrue:[
-        newHandle registerForFinalization.
-        ^ newHandle.
-    ].
-
-    errorNumber isNil ifTrue:[
-        self error:'invalid argument(s)'.
-    ] ifFalse:[
-        (OperatingSystem errorHolderForNumber:errorNumber) reportError
-    ].
-! !
-
 !Win32OperatingSystem::Win32IOHandle class methodsFor:'documentation'!
 
 documentation
@@ -11231,7 +10912,7 @@
 !Win32OperatingSystem class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Win32OperatingSystem.st,v 1.197 2006-02-08 18:26:59 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Win32OperatingSystem.st,v 1.198 2006-02-14 14:33:27 cg Exp $'
 ! !
 
 Win32OperatingSystem initialize!