├── .gitattributes ├── .project ├── LICENSE ├── README.md └── src ├── .properties ├── BaselineOfOSWindows ├── BaselineOfOSWindows.class.st └── package.st ├── OS-Windows-Core-Tests ├── WinDebuggerTest.class.st ├── WinErrorConstantsTest.class.st ├── WinErrorTest.class.st ├── WinHandleTest.class.st ├── WinRegistryKeyTest.class.st ├── WinRegistryTest.class.st ├── WinSystemTimeTest.class.st ├── WinTStringTest.class.st ├── WindowsSpecificTest.class.st └── package.st ├── OS-Windows-Core ├── ManifestOSWindowsCore.class.st ├── WinAccessDenied.class.st ├── WinBaseConstants.class.st ├── WinDatabaseDoesNotExist.class.st ├── WinDebugger.class.st ├── WinError.class.st ├── WinErrorConstants.class.st ├── WinHandle.class.st ├── WinInvalidName.class.st ├── WinNTConstants.class.st ├── WinRegistry.class.st ├── WinRegistryConstants.class.st ├── WinRegistryKey.class.st ├── WinShutdownInProgress.class.st ├── WinSystemTime.class.st ├── WinTCHAR.class.st ├── WinTString.class.st ├── WinTypes.class.st ├── WinUserConstants.class.st ├── WinWideString.class.st └── package.st ├── OS-Windows-Cryptography ├── ManifestOSWindowsCryptography.class.st ├── WinCryptConstants.class.st ├── WinCryptoProvider.class.st └── package.st ├── OS-Windows-Environment-Tests ├── WinCaretTest.class.st ├── WinClipboardBitmapFormatTest.class.st ├── WinClipboardColorPaletteFormatTest.class.st ├── WinClipboardDIBFormatTest.class.st ├── WinClipboardDIBV5FormatTest.class.st ├── WinClipboardDIFFormatTest.class.st ├── WinClipboardDSPBitmapFormatTest.class.st ├── WinClipboardDSPEnhancedMetafileFormatTest.class.st ├── WinClipboardDSPMetafilePictureFormatTest.class.st ├── WinClipboardDSPTextFormatTest.class.st ├── WinClipboardEnhancedMetafileFormatTest.class.st ├── WinClipboardEntryTest.class.st ├── WinClipboardFileDropFormatTest.class.st ├── WinClipboardFormatTest.class.st ├── WinClipboardGDIObjectFirstFormatTest.class.st ├── WinClipboardGDIObjectLastFormatTest.class.st ├── WinClipboardLocaleFormatTest.class.st ├── WinClipboardMetafilePictureFormatTest.class.st ├── WinClipboardOEMTextFormatTest.class.st ├── WinClipboardOwnerDisplayFormatTest.class.st ├── WinClipboardPenDataFormatTest.class.st ├── WinClipboardPrivateFirstFormatTest.class.st ├── WinClipboardPrivateLastFormatTest.class.st ├── WinClipboardRIFFFormatTest.class.st ├── WinClipboardSYLKFormatTest.class.st ├── WinClipboardTIFFFormatTest.class.st ├── WinClipboardTextFormatTest.class.st ├── WinClipboardUnicodeTextFormatTest.class.st ├── WinClipboardWaveFormatTest.class.st ├── WinConsoleTest.class.st ├── WinCustomClipboardFormatTest.class.st ├── WinEnvironmentTest.class.st ├── WinLibraryTest.class.st ├── WinProcessTest.class.st ├── WinProxyTest.class.st ├── WinStandardClipboardFormatTest.class.st ├── WinThreadTest.class.st └── package.st ├── OS-Windows-Environment ├── WinCaret.class.st ├── WinClipboard.class.st ├── WinClipboardBitmapFormat.class.st ├── WinClipboardColorPaletteFormat.class.st ├── WinClipboardDIBFormat.class.st ├── WinClipboardDIBV5Format.class.st ├── WinClipboardDIFFormat.class.st ├── WinClipboardDSPBitmapFormat.class.st ├── WinClipboardDSPEnhancedMetafileFormat.class.st ├── WinClipboardDSPMetafilePictureFormat.class.st ├── WinClipboardDSPTextFormat.class.st ├── WinClipboardEnhancedMetafileFormat.class.st ├── WinClipboardEntry.class.st ├── WinClipboardFileDropFormat.class.st ├── WinClipboardFormat.class.st ├── WinClipboardGDIObjectFirstFormat.class.st ├── WinClipboardGDIObjectLastFormat.class.st ├── WinClipboardHTMLFormat.class.st ├── WinClipboardInkscapeSVGFormat.class.st ├── WinClipboardLocaleFormat.class.st ├── WinClipboardMetafilePictureFormat.class.st ├── WinClipboardOEMTextFormat.class.st ├── WinClipboardOwnerDisplayFormat.class.st ├── WinClipboardPenDataFormat.class.st ├── WinClipboardPrivateFirstFormat.class.st ├── WinClipboardPrivateLastFormat.class.st ├── WinClipboardRIFFFormat.class.st ├── WinClipboardSVGFormat.class.st ├── WinClipboardSYLKFormat.class.st ├── WinClipboardTIFFFormat.class.st ├── WinClipboardTextFormat.class.st ├── WinClipboardUnicodeTextFormat.class.st ├── WinClipboardWaveFormat.class.st ├── WinConsole.class.st ├── WinConsoleBackgroundColor.class.st ├── WinConsoleColor.class.st ├── WinConsoleConstants.class.st ├── WinConsoleCoordinates.class.st ├── WinConsoleCursor.class.st ├── WinConsoleFont.class.st ├── WinConsoleForegroundColor.class.st ├── WinConsoleScreenBuffer.class.st ├── WinConsoleSmallRectangle.class.st ├── WinControlPanel.class.st ├── WinCustomClipboardFormat.class.st ├── WinEnvironment.class.st ├── WinExplorer.class.st ├── WinInternetExplorer.class.st ├── WinLibrary.class.st ├── WinProcess.class.st ├── WinProcessInformation.class.st ├── WinProxy.class.st ├── WinSecurityAttributes.class.st ├── WinShell.class.st ├── WinShellConstants.class.st ├── WinShellFolder.class.st ├── WinStandardClipboardFormat.class.st ├── WinStartupInfo.class.st ├── WinThread.class.st ├── WinUserSession.class.st └── package.st ├── OS-Windows-LDAP-Tests ├── WinLDAPConnectionTest.class.st ├── WinLDAPTest.class.st ├── WinLDAPTimeIntervalTest.class.st └── package.st ├── OS-Windows-LDAP ├── Duration.extension.st ├── WinLDAP.class.st ├── WinLDAPConnection.class.st ├── WinLDAPConstants.class.st ├── WinLDAPMessage.class.st ├── WinLDAPSecureConnection.class.st ├── WinLDAPTimeInterval.class.st ├── WinLDAPUnableToConnect.class.st └── package.st ├── OS-Windows-Services ├── WinService.class.st ├── WinServiceHandle.class.st ├── WinServiceManager.class.st ├── WinServicesConstants.class.st └── package.st ├── OS-Windows-Tools ├── DBMon.class.st ├── WinToolIcons.class.st ├── WinTools.class.st └── package.st ├── OS-Windows-UI-Tests ├── WinDeviceContextTest.class.st ├── WinPointTest.class.st ├── WinRectangleTest.class.st ├── WinWindowTest.class.st └── package.st └── OS-Windows-UI ├── WinDeviceContext.class.st ├── WinFrameWindow.class.st ├── WinMenu.class.st ├── WinMessageBox.class.st ├── WinOpenFileName.class.st ├── WinPoint.class.st ├── WinRectangle.class.st ├── WinWidget.class.st ├── WinWindow.class.st ├── WinWndClassEx.class.st └── package.st /.gitattributes: -------------------------------------------------------------------------------- 1 | # Bash needs lf even on windows/cygwin 2 | *.st eol=lf 3 | *.sh eol=lf 4 | 5 | # st files are always text, even if they contain invalid encoded chars 6 | *.st text diff 7 | 8 | # GitHub is unable to properly detect Smalltalk code, so help it a bit 9 | *.st linguist-language=Smalltalk 10 | -------------------------------------------------------------------------------- /.project: -------------------------------------------------------------------------------- 1 | { 2 | 'srcDirectory' : 'src', 3 | 'tags' : [ #astares ] 4 | } 5 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2013-2023 Dipl.-Inf. Torsten Bergmann, ASTARES.COM with contributions 4 | from Pierre Laborde, Eric Le Pors, OpenSmock 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | SOFTWARE. -------------------------------------------------------------------------------- /src/.properties: -------------------------------------------------------------------------------- 1 | { 2 | #format : #tonel 3 | } -------------------------------------------------------------------------------- /src/BaselineOfOSWindows/BaselineOfOSWindows.class.st: -------------------------------------------------------------------------------- 1 | " 2 | Baseline for OS-Windows support from the OS series, see [https://github.com/astares/Pharo-OS-Windows](https://github.com/astares/Pharo-OS-Windows) 3 | " 4 | Class { 5 | #name : #BaselineOfOSWindows, 6 | #superclass : #BaselineOf, 7 | #category : #BaselineOfOSWindows 8 | } 9 | 10 | { #category : #baselines } 11 | BaselineOfOSWindows >> baseline: spec [ 12 | 13 | 14 | spec for: #'common' do: [ 15 | "Packages" 16 | spec 17 | package: 'OS-Windows-Core'; 18 | package: 'OS-Windows-Core-Tests' with: [ spec requires: #('OS-Windows-Core') ]; 19 | package: 'OS-Windows-UI' with: [ spec requires: #('OS-Windows-Core') ]; 20 | package: 'OS-Windows-UI-Tests' with: [ spec requires: #('OS-Windows-UI'). ]; 21 | package: 'OS-Windows-Environment' with: [ spec requires: #('OS-Windows-Core') ]; 22 | package: 'OS-Windows-Environment-Tests' with: [ spec requires: #('OS-Windows-Environment') ]; 23 | package: 'OS-Windows-Cryptography' with: [ spec requires: #('OS-Windows-Core' ) ]; 24 | package: 'OS-Windows-Services' with: [ spec requires: #('OS-Windows-Core' ) ]; 25 | package: 'OS-Windows-LDAP' with: [ spec requires: #('OS-Windows-Core' ) ]; 26 | package: 'OS-Windows-LDAP-Tests' with: [ spec requires: #('OS-Windows-LDAP') ]; 27 | package: 'OS-Windows-Tools' with: [ spec requires: #('OS-Windows-Core' 'OS-Windows-Environment') ]. 28 | "Groups" 29 | spec 30 | group: 'default' with: #('Core' 'Tests' 'Tools'); 31 | group: 'Tests' with: #('OS-Windows-Core-Tests' 'OS-Windows-UI-Tests' 'OS-Windows-Environment-Tests' 'OS-Windows-LDAP-Tests'); 32 | group: 'Core' with: #('OS-Windows-Core' 'OS-Windows-Environment' 'OS-Windows-UI'); 33 | group: 'Tools' with: #('OS-Windows-Tools' ) ] 34 | ] 35 | -------------------------------------------------------------------------------- /src/BaselineOfOSWindows/package.st: -------------------------------------------------------------------------------- 1 | Package { #name : #BaselineOfOSWindows } 2 | -------------------------------------------------------------------------------- /src/OS-Windows-Core-Tests/WinDebuggerTest.class.st: -------------------------------------------------------------------------------- 1 | " 2 | SUnit tests for WinDebugger 3 | " 4 | Class { 5 | #name : 'WinDebuggerTest', 6 | #superclass : 'WindowsSpecificTest', 7 | #category : 'OS-Windows-Core-Tests-Debugging', 8 | #package : 'OS-Windows-Core-Tests', 9 | #tag : 'Debugging' 10 | } 11 | 12 | { #category : 'tests' } 13 | WinDebuggerTest >> testIsAbleToOutputDebugString [ 14 | self 15 | shouldnt: [ WinDebugger outputDebugString: 'Test Case' ] 16 | raise: Exception 17 | description: 'Not possible to write windows debug stream' 18 | ] 19 | 20 | { #category : 'tests' } 21 | WinDebuggerTest >> testIsDebuggerPresent [ 22 | "Usually there is no debugger attached to the Pharo VM process" 23 | 24 | self deny: WinDebugger isDebuggerPresent 25 | ] 26 | -------------------------------------------------------------------------------- /src/OS-Windows-Core-Tests/WinErrorConstantsTest.class.st: -------------------------------------------------------------------------------- 1 | " 2 | SUnit tests for WinErrorConstants pool 3 | " 4 | Class { 5 | #name : 'WinErrorConstantsTest', 6 | #superclass : 'WindowsSpecificTest', 7 | #pools : [ 8 | 'WinErrorConstants' 9 | ], 10 | #category : 'OS-Windows-Core-Tests-Support', 11 | #package : 'OS-Windows-Core-Tests', 12 | #tag : 'Support' 13 | } 14 | 15 | { #category : 'tests' } 16 | WinErrorConstantsTest >> testErrorNameFromNumber [ 17 | 18 | self 19 | assert: (WinErrorConstants errorNameFromNumber: 1) equals: #ERROR_INVALID_FUNCTION; 20 | assert: (WinErrorConstants errorNameFromNumber: 2) equals: #ERROR_FILE_NOT_FOUND; 21 | assert: (WinErrorConstants errorNameFromNumber: 3) equals: #ERROR_PATH_NOT_FOUND 22 | ] 23 | -------------------------------------------------------------------------------- /src/OS-Windows-Core-Tests/WinErrorTest.class.st: -------------------------------------------------------------------------------- 1 | " 2 | A test for WinError 3 | " 4 | Class { 5 | #name : 'WinErrorTest', 6 | #superclass : 'WindowsSpecificTest', 7 | #category : 'OS-Windows-Core-Tests-Exceptions', 8 | #package : 'OS-Windows-Core-Tests', 9 | #tag : 'Exceptions' 10 | } 11 | 12 | { #category : 'tests' } 13 | WinErrorTest >> testLastError [ 14 | 15 | self assert: WinError lastErrorCode isNumber 16 | ] 17 | -------------------------------------------------------------------------------- /src/OS-Windows-Core-Tests/WinHandleTest.class.st: -------------------------------------------------------------------------------- 1 | " 2 | Unit test for WinHandle 3 | " 4 | Class { 5 | #name : 'WinHandleTest', 6 | #superclass : 'WindowsSpecificTest', 7 | #category : 'OS-Windows-Core-Tests-Common', 8 | #package : 'OS-Windows-Core-Tests', 9 | #tag : 'Common' 10 | } 11 | 12 | { #category : 'tests' } 13 | WinHandleTest >> testIsInvalid [ 14 | 15 | self assert: WinHandle new isInvalid 16 | ] 17 | -------------------------------------------------------------------------------- /src/OS-Windows-Core-Tests/WinRegistryKeyTest.class.st: -------------------------------------------------------------------------------- 1 | " 2 | SUnit tests for WinRegistryKey 3 | " 4 | Class { 5 | #name : 'WinRegistryKeyTest', 6 | #superclass : 'WindowsSpecificTest', 7 | #pools : [ 8 | 'WinRegistryConstants' 9 | ], 10 | #category : 'OS-Windows-Core-Tests-Registry', 11 | #package : 'OS-Windows-Core-Tests', 12 | #tag : 'Registry' 13 | } 14 | 15 | { #category : 'tests - defaults' } 16 | WinRegistryKeyTest >> testAllUsers [ 17 | 18 | self assert: WinRegistryKey allUsers getHandle = HKEY_USERS 19 | ] 20 | 21 | { #category : 'tests - defaults' } 22 | WinRegistryKeyTest >> testClassesRoot [ 23 | 24 | self assert: WinRegistryKey classesRoot getHandle = HKEY_CLASSES_ROOT 25 | ] 26 | 27 | { #category : 'tests - defaults' } 28 | WinRegistryKeyTest >> testCurrentConfig [ 29 | 30 | self assert: 31 | WinRegistryKey currentConfig getHandle = HKEY_CURRENT_CONFIG 32 | ] 33 | 34 | { #category : 'tests - defaults' } 35 | WinRegistryKeyTest >> testCurrentUser [ 36 | 37 | self assert: WinRegistryKey currentUser getHandle = HKEY_CURRENT_USER 38 | ] 39 | 40 | { #category : 'tests - defaults' } 41 | WinRegistryKeyTest >> testDynamicData [ 42 | 43 | self assert: WinRegistryKey dynamicData getHandle = HKEY_DYN_DATA 44 | ] 45 | 46 | { #category : 'tests' } 47 | WinRegistryKeyTest >> testKeyNames [ 48 | 49 | self 50 | assert: WinRegistryKey allUsers keyName equals: #HKEY_USERS; 51 | assert: WinRegistryKey classesRoot keyName equals: #HKEY_CLASSES_ROOT; 52 | assert: WinRegistryKey currentConfig keyName equals: #HKEY_CURRENT_CONFIG; 53 | assert: WinRegistryKey currentUser keyName equals: #HKEY_CURRENT_USER; 54 | assert: WinRegistryKey dynamicData keyName equals: #HKEY_DYN_DATA; 55 | assert: WinRegistryKey localMachine keyName equals: #HKEY_LOCAL_MACHINE; 56 | assert: WinRegistryKey performanceData keyName equals: #HKEY_PERFORMANCE_DATA 57 | ] 58 | 59 | { #category : 'tests - defaults' } 60 | WinRegistryKeyTest >> testLocalMachine [ 61 | 62 | self assert: 63 | WinRegistryKey localMachine getHandle = HKEY_LOCAL_MACHINE 64 | ] 65 | 66 | { #category : 'tests - defaults' } 67 | WinRegistryKeyTest >> testPerformanceData [ 68 | 69 | self assert: 70 | WinRegistryKey performanceData getHandle = HKEY_PERFORMANCE_DATA 71 | ] 72 | 73 | { #category : 'tests' } 74 | WinRegistryKeyTest >> testPrinting [ 75 | 76 | self 77 | assert: (WinRegistryKey classesRoot printString endsWith: ' - HKEY_CLASSES_ROOT'); 78 | assert: (WinRegistryKey currentUser printString endsWith: ' - HKEY_CURRENT_USER'); 79 | assert: (WinRegistryKey localMachine printString endsWith: ' - HKEY_LOCAL_MACHINE'); 80 | assert: (WinRegistryKey allUsers printString endsWith: ' - HKEY_USERS'); 81 | assert: (WinRegistryKey currentConfig printString endsWith: ' - HKEY_CURRENT_CONFIG'); 82 | assert: (WinRegistryKey dynamicData printString endsWith: ' - HKEY_DYN_DATA') 83 | ] 84 | 85 | { #category : 'tests - queries' } 86 | WinRegistryKeyTest >> testQueryBinaryValue [ 87 | 88 | | value | 89 | value:= WinRegistryKey localMachine 90 | queryValue: 'Component Information' fromSubkey: 'HARDWARE\\DESCRIPTION\\System\\CentralProcessor\\0'. 91 | 92 | self 93 | assert: value notEmpty; 94 | assert: (value isKindOf: ByteArray) 95 | ] 96 | 97 | { #category : 'tests - queries' } 98 | WinRegistryKeyTest >> testQueryDWord [ 99 | 100 | | value | 101 | value := WinRegistryKey localMachine 102 | queryValue: '~MHz' fromSubkey: 'HARDWARE\\DESCRIPTION\\System\\CentralProcessor\\0'. 103 | 104 | self 105 | assert: value isInteger; 106 | assert: value > 0 107 | ] 108 | 109 | { #category : 'tests - queries' } 110 | WinRegistryKeyTest >> testQueryStringValue [ 111 | 112 | | value | 113 | value := WinRegistryKey localMachine 114 | queryValue: 'VendorIdentifier' fromSubkey: 'HARDWARE\\DESCRIPTION\\System\\CentralProcessor\\0'. 115 | 116 | self assert: value notEmpty 117 | ] 118 | -------------------------------------------------------------------------------- /src/OS-Windows-Core-Tests/WinRegistryTest.class.st: -------------------------------------------------------------------------------- 1 | " 2 | SUnit tests for WinRegistry 3 | " 4 | Class { 5 | #name : 'WinRegistryTest', 6 | #superclass : 'WindowsSpecificTest', 7 | #pools : [ 8 | 'WinErrorConstants', 9 | 'WinRegistryConstants' 10 | ], 11 | #category : 'OS-Windows-Core-Tests-Registry', 12 | #package : 'OS-Windows-Core-Tests', 13 | #tag : 'Registry' 14 | } 15 | 16 | { #category : 'tests - queries' } 17 | WinRegistryTest >> testQueryBinaryValue [ 18 | 19 | |hKey value | 20 | hKey := (WinRegistryKey localMachine queryOpenSubkey: 'HARDWARE\\DESCRIPTION\\System\\CentralProcessor\\0'). 21 | value := WinRegistry queryValue: 'Component Information' fromKey: hKey. 22 | hKey close. 23 | 24 | self 25 | assert: value notEmpty; 26 | assert: (value isKindOf: ByteArray) 27 | ] 28 | 29 | { #category : 'tests - queries' } 30 | WinRegistryTest >> testQueryDWord [ 31 | 32 | |hKey value | 33 | hKey := (WinRegistryKey localMachine queryOpenSubkey: 'HARDWARE\\DESCRIPTION\\System\\CentralProcessor\\0'). 34 | value := WinRegistry queryValue: '~MHz' fromKey: hKey. 35 | hKey close. 36 | 37 | self 38 | assert: value isInteger; 39 | assert: value > 0 40 | ] 41 | 42 | { #category : 'tests - queries' } 43 | WinRegistryTest >> testQueryStringValue [ 44 | 45 | |hKey value | 46 | hKey := (WinRegistryKey localMachine queryOpenSubkey: 'HARDWARE\\DESCRIPTION\\System\\CentralProcessor\\0'). 47 | value := WinRegistry queryValue: 'VendorIdentifier' fromKey: hKey. 48 | hKey close. 49 | 50 | self assert: value notEmpty 51 | ] 52 | 53 | { #category : 'tests - primitives' } 54 | WinRegistryTest >> testRegistryKeyOpenAndClose [ 55 | 56 | | hKey | 57 | hKey := WinRegistryKey new. 58 | self assert: (WinRegistry 59 | regOpenKeyExA: WinRegistryKey localMachine 60 | with: 'HARDWARE\\DESCRIPTION\\System\\CentralProcessor\\0' 61 | with: 0 62 | with: KEY_QUERY_VALUE 63 | with: hKey) = ERROR_SUCCESS. 64 | self assert: hKey getHandle value > 0. "Assert we have a valid handle" 65 | 66 | self assert: (WinRegistry regCloseKey: hKey) = ERROR_SUCCESS 67 | ] 68 | 69 | { #category : 'tests - primitives' } 70 | WinRegistryTest >> testSubkeyCreationAndDeletion [ 71 | "Due to permissions we can only create registry key HKEY_CURRENT_USER\SOFTWARE\" 72 | 73 | | hKey hNewKey | 74 | hKey := WinRegistryKey currentUser queryOpenSubkey: 'SOFTWARE'. 75 | self assert: hKey value > 0. "make sure we have a valid handle to a key" 76 | 77 | hNewKey := WinRegistryKey new. 78 | self assert: (WinRegistry regCreateKeyA: hKey with: 'PHAROTEST' with: hNewKey) 79 | equals: ERROR_SUCCESS. 80 | 81 | self assert: hNewKey value > 0. "make sure we have a valid handle to a new key now" 82 | 83 | self assert: (WinRegistry regDeleteKeyA: hKey with: 'PHAROTEST') 84 | equals: ERROR_SUCCESS 85 | ] 86 | -------------------------------------------------------------------------------- /src/OS-Windows-Core-Tests/WinSystemTimeTest.class.st: -------------------------------------------------------------------------------- 1 | " 2 | SUnit tests for WinSystemTime 3 | " 4 | Class { 5 | #name : 'WinSystemTimeTest', 6 | #superclass : 'WindowsSpecificTest', 7 | #instVars : [ 8 | 'localTime' 9 | ], 10 | #category : 'OS-Windows-Core-Tests-Base', 11 | #package : 'OS-Windows-Core-Tests', 12 | #tag : 'Base' 13 | } 14 | 15 | { #category : 'running' } 16 | WinSystemTimeTest >> setUp [ 17 | 18 | super setUp. 19 | localTime := WinSystemTime localTime 20 | ] 21 | 22 | { #category : 'running' } 23 | WinSystemTimeTest >> tearDown [ 24 | localTime := nil. 25 | super tearDown 26 | ] 27 | 28 | { #category : 'tests - fields' } 29 | WinSystemTimeTest >> testDay [ 30 | 31 | self assert: localTime day < 32 32 | ] 33 | 34 | { #category : 'tests - fields' } 35 | WinSystemTimeTest >> testDayOfWeek [ 36 | 37 | self assert: localTime dayOfWeek < 7 38 | ] 39 | 40 | { #category : 'tests - fields' } 41 | WinSystemTimeTest >> testHour [ 42 | 43 | self assert: localTime hour < 24 44 | ] 45 | 46 | { #category : 'tests - fields' } 47 | WinSystemTimeTest >> testLocalTime [ 48 | 49 | self assert: WinSystemTime localTime notNil 50 | ] 51 | 52 | { #category : 'tests - fields' } 53 | WinSystemTimeTest >> testMilliseconds [ 54 | 55 | self assert: localTime milliseconds > 0 56 | ] 57 | 58 | { #category : 'tests - fields' } 59 | WinSystemTimeTest >> testMinute [ 60 | 61 | self assert: localTime minute < 60 62 | ] 63 | 64 | { #category : 'tests - fields' } 65 | WinSystemTimeTest >> testMonth [ 66 | 67 | self assert: localTime month < 13 68 | ] 69 | 70 | { #category : 'tests - fields' } 71 | WinSystemTimeTest >> testSecond [ 72 | 73 | self assert: localTime second < 60 74 | ] 75 | 76 | { #category : 'tests - fields' } 77 | WinSystemTimeTest >> testSystemTime [ 78 | 79 | self assert: WinSystemTime systemTime notNil 80 | ] 81 | 82 | { #category : 'tests - fields' } 83 | WinSystemTimeTest >> testYear [ 84 | 85 | self assert: localTime year > 2014 86 | ] 87 | -------------------------------------------------------------------------------- /src/OS-Windows-Core-Tests/WinTStringTest.class.st: -------------------------------------------------------------------------------- 1 | " 2 | SUnit tests for WinTString 3 | " 4 | Class { 5 | #name : 'WinTStringTest', 6 | #superclass : 'WindowsSpecificTest', 7 | #category : 'OS-Windows-Core-Tests-Base', 8 | #package : 'OS-Windows-Core-Tests', 9 | #tag : 'Base' 10 | } 11 | 12 | { #category : 'tests' } 13 | WinTStringTest >> testLengthOfASCIIString [ 14 | 15 | self assert: (WinTString primLstrlenA: 'Pharo') = 5 16 | ] 17 | -------------------------------------------------------------------------------- /src/OS-Windows-Core-Tests/WindowsSpecificTest.class.st: -------------------------------------------------------------------------------- 1 | " 2 | Subclasses represent tests that only run on Windows operating systems 3 | " 4 | Class { 5 | #name : 'WindowsSpecificTest', 6 | #superclass : 'TestCase', 7 | #category : 'OS-Windows-Core-Tests-Common', 8 | #package : 'OS-Windows-Core-Tests', 9 | #tag : 'Common' 10 | } 11 | 12 | { #category : 'testing' } 13 | WindowsSpecificTest class >> isAbstract [ 14 | "only run test subclasses on Windows" 15 | 16 | ^(self name = #WindowsSpecificTest) 17 | or: [ Smalltalk os isWindows not ] 18 | ] 19 | -------------------------------------------------------------------------------- /src/OS-Windows-Core-Tests/package.st: -------------------------------------------------------------------------------- 1 | Package { #name : 'OS-Windows-Core-Tests' } 2 | -------------------------------------------------------------------------------- /src/OS-Windows-Core/ManifestOSWindowsCore.class.st: -------------------------------------------------------------------------------- 1 | " 2 | Please describe the package using the class comment of the included manifest class. The manifest class also includes other additional metadata for the package. These meta data are used by other tools such as the SmalllintManifestChecker and the critics Browser 3 | " 4 | Class { 5 | #name : #ManifestOSWindowsCore, 6 | #superclass : #PackageManifest, 7 | #category : #'OS-Windows-Core-Manifest' 8 | } 9 | 10 | { #category : #'code-critics' } 11 | ManifestOSWindowsCore class >> ruleLongMethodsRuleV1FalsePositive [ 12 | 13 | 14 | ^ #(#(#(#RGMetaclassDefinition #(#'WinBaseConstants class' #WinBaseConstants)) #'2023-03-19T01:52:03.459+01:00') #(#(#RGMetaclassDefinition #(#'WinUserConstants class' #WinUserConstants)) #'2023-03-27T07:01:13.548+02:00') ) 15 | ] 16 | -------------------------------------------------------------------------------- /src/OS-Windows-Core/WinAccessDenied.class.st: -------------------------------------------------------------------------------- 1 | " 2 | Access to a windows resource is denied (error) 3 | " 4 | Class { 5 | #name : #WinAccessDenied, 6 | #superclass : #WinError, 7 | #category : #'OS-Windows-Core-Exceptions' 8 | } 9 | -------------------------------------------------------------------------------- /src/OS-Windows-Core/WinDatabaseDoesNotExist.class.st: -------------------------------------------------------------------------------- 1 | " 2 | The (service) database does not exist. (Error on Windows) 3 | " 4 | Class { 5 | #name : #WinDatabaseDoesNotExist, 6 | #superclass : #WinError, 7 | #category : #'OS-Windows-Core-Exceptions' 8 | } 9 | -------------------------------------------------------------------------------- /src/OS-Windows-Core/WinDebugger.class.st: -------------------------------------------------------------------------------- 1 | " 2 | Provides access to the windows debug stream 3 | 4 | You should install 5 | 6 | dbmon.exe from the Windows SDK to use methods like #outputDebugString: 7 | " 8 | Class { 9 | #name : #WinDebugger, 10 | #superclass : #Object, 11 | #pools : [ 12 | 'WinTypes' 13 | ], 14 | #category : #'OS-Windows-Core-Debugging' 15 | } 16 | 17 | { #category : #testing } 18 | WinDebugger class >> isDebuggerPresent [ 19 | "Indicates whether the calling process is running under the context of a debugger." 20 | 21 | ^self ffiCall: #(BOOL IsDebuggerPresent()) module: #kernel32 22 | ] 23 | 24 | { #category : #testing } 25 | WinDebugger class >> outputDebugString: lpOutputString [ 26 | "Sends a string to the debugger for display. Use free tools like 27 | - 'DebugView' from Sysinternals or 28 | - 'dbmon.exe' from Miicrosoft SDK to display" 29 | 30 | ^self ffiCall: #(void OutputDebugStringA(LPCSTR lpOutputString)) module: #Kernel32 31 | ] 32 | -------------------------------------------------------------------------------- /src/OS-Windows-Core/WinError.class.st: -------------------------------------------------------------------------------- 1 | " 2 | Provides access to windows errors 3 | " 4 | Class { 5 | #name : #WinError, 6 | #superclass : #Error, 7 | #pools : [ 8 | 'WinTypes' 9 | ], 10 | #category : #'OS-Windows-Core-Exceptions' 11 | } 12 | 13 | { #category : #accessing } 14 | WinError class >> lastErrorCode [ 15 | "Returns the calling thread's last-error code value" 16 | 17 | ^ self ffiCall: #( DWORD GetLastError()) module: #kernel32 18 | ] 19 | 20 | { #category : #accessing } 21 | WinError class >> lastErrorCode: dwErrCode [ 22 | "Sets the last-error code for the calling thread. " 23 | 24 | ^ self ffiCall: #( VOID SetLastError(DWORD dwErrCode)) module: #kernel32 25 | ] 26 | 27 | { #category : #accessing } 28 | WinError class >> lastErrorCodeMessage [ 29 | 30 | ^ 'Windows error code: ', self lastErrorCode asString 31 | ] 32 | -------------------------------------------------------------------------------- /src/OS-Windows-Core/WinErrorConstants.class.st: -------------------------------------------------------------------------------- 1 | " 2 | Error constants defined in WinError.h 3 | " 4 | Class { 5 | #name : #WinErrorConstants, 6 | #superclass : #SharedPool, 7 | #classVars : [ 8 | 'ERROR_ACCESS_DENIED', 9 | 'ERROR_ARENA_TRASHED', 10 | 'ERROR_FILE_NOT_FOUND', 11 | 'ERROR_INVALID_FUNCTION', 12 | 'ERROR_INVALID_HANDLE', 13 | 'ERROR_NOT_ENOUGH_MEMORY', 14 | 'ERROR_PATH_NOT_FOUND', 15 | 'ERROR_SUCCESS', 16 | 'ERROR_TOO_MANY_OPEN_FILES' 17 | ], 18 | #category : #'OS-Windows-Core-Support' 19 | } 20 | 21 | { #category : #accessing } 22 | WinErrorConstants class >> errorNameFromNumber: errorNumber [ 23 | ^ self classPool keyAtValue: errorNumber 24 | ] 25 | 26 | { #category : #'private - initialization' } 27 | WinErrorConstants class >> initSystemErrorCodes [ 28 | 29 | ERROR_SUCCESS := 16r0. "The operation completed successfully." 30 | ERROR_INVALID_FUNCTION := 16r1. "Incorrect function." 31 | ERROR_FILE_NOT_FOUND := 16r2. "The system cannot find the file specified." 32 | ERROR_PATH_NOT_FOUND := 16r3. "The system cannot find the path specified." 33 | ERROR_TOO_MANY_OPEN_FILES := 16r4. "The system cannot open the file." 34 | ERROR_ACCESS_DENIED := 16r5. "Access is denied" 35 | ERROR_INVALID_HANDLE := 16r6. "The handle is invalid." 36 | ERROR_ARENA_TRASHED := 16r7. "The storage control blocks were destroyed." 37 | ERROR_NOT_ENOUGH_MEMORY := 16r8. "Not enough storage is available to process this command." 38 | ] 39 | 40 | { #category : #'class initialization' } 41 | WinErrorConstants class >> initialize [ 42 | "Intializes the receiver" 43 | 44 | self initSystemErrorCodes 45 | ] 46 | -------------------------------------------------------------------------------- /src/OS-Windows-Core/WinHandle.class.st: -------------------------------------------------------------------------------- 1 | " 2 | Superclass for any external object that is referenced by a windows handle 3 | " 4 | Class { 5 | #name : #WinHandle, 6 | #superclass : #FFIConstantHandle, 7 | #pools : [ 8 | 'WinTypes' 9 | ], 10 | #category : #'OS-Windows-Core-Common' 11 | } 12 | 13 | { #category : #'private - finalization' } 14 | WinHandle class >> closeHandle: aHandle [ 15 | "Closes the given handle" 16 | 17 | ^self ffiCall: #(BOOL CloseHandle(HANDLE aHandle)) module: #kernel32 18 | ] 19 | 20 | { #category : #finalization } 21 | WinHandle class >> finalizeResourceData: aWinHandle [ 22 | "Finalize the external resource by closing" 23 | 24 | (aWinHandle value = 0) ifTrue: [ ^ self ]. 25 | self closeHandle: aWinHandle 26 | ] 27 | 28 | { #category : #'instance creation' } 29 | WinHandle class >> fromExternalHandle: anInteger [ 30 | 31 | ^(self new) 32 | setHandle: anInteger; 33 | yourself 34 | ] 35 | 36 | { #category : #finalization } 37 | WinHandle >> closeHandle [ 38 | 39 | ^self class closeHandle: self 40 | ] 41 | 42 | { #category : #initialization } 43 | WinHandle >> initialize [ 44 | super initialize. 45 | self autoRelease 46 | ] 47 | 48 | { #category : #testing } 49 | WinHandle >> isInvalid [ 50 | 51 | ^self value = 0 52 | ] 53 | 54 | { #category : #'external resource management' } 55 | WinHandle >> resourceData [ 56 | "Return the resource data used for managing the external resource" 57 | 58 | ^ self 59 | ] 60 | -------------------------------------------------------------------------------- /src/OS-Windows-Core/WinInvalidName.class.st: -------------------------------------------------------------------------------- 1 | " 2 | The specified service name is invalid. 3 | " 4 | Class { 5 | #name : #WinInvalidName, 6 | #superclass : #WinError, 7 | #category : #'OS-Windows-Core-Exceptions' 8 | } 9 | -------------------------------------------------------------------------------- /src/OS-Windows-Core/WinNTConstants.class.st: -------------------------------------------------------------------------------- 1 | " 2 | This pool includes constants as defined in winnt.h header file 3 | " 4 | Class { 5 | #name : #WinNTConstants, 6 | #superclass : #SharedPool, 7 | #classVars : [ 8 | 'ACCESS_ALLOWED_ACE_TYPE', 9 | 'ACCESS_DENIED_ACE_TYPE', 10 | 'ACE_INHERITED_OBJECT_TYPE_PRESENT', 11 | 'ACE_OBJECT_TYPE_PRESENT', 12 | 'APPLICATION_ERROR_MASK', 13 | 'COMPRESSION_ENGINE_HIBER', 14 | 'COMPRESSION_ENGINE_MAXIMUM', 15 | 'COMPRESSION_ENGINE_STANDARD', 16 | 'COMPRESSION_FORMAT_DEFAULT', 17 | 'COMPRESSION_FORMAT_LZNT1', 18 | 'COMPRESSION_FORMAT_NONE', 19 | 'DUPLICATE_CLOSE_SOURCE', 20 | 'DUPLICATE_SAME_ACCESS', 21 | 'ERROR_SEVERITY_ERROR', 22 | 'ERROR_SEVERITY_INFORMATIONAL', 23 | 'ERROR_SEVERITY_SUCCESS', 24 | 'ERROR_SEVERITY_WARNING', 25 | 'SYSTEM_ALARM_ACE_TYPE', 26 | 'SYSTEM_AUDIT_ACE_TYPE' 27 | ], 28 | #category : #'OS-Windows-Core-Support' 29 | } 30 | 31 | { #category : #'private - initialization' } 32 | WinNTConstants class >> initConstants [ 33 | "self initConstants" 34 | 35 | ACE_OBJECT_TYPE_PRESENT := 16r00000001. 36 | ACE_INHERITED_OBJECT_TYPE_PRESENT := 16r00000002. 37 | APPLICATION_ERROR_MASK := 16r20000000. 38 | 39 | ERROR_SEVERITY_SUCCESS := 16r00000000. 40 | ERROR_SEVERITY_INFORMATIONAL := 16r40000000. 41 | ERROR_SEVERITY_WARNING := 16r80000000. 42 | ERROR_SEVERITY_ERROR := 16rC0000000. 43 | 44 | COMPRESSION_FORMAT_NONE := 16r0000. 45 | COMPRESSION_FORMAT_DEFAULT := 16r0001. 46 | COMPRESSION_FORMAT_LZNT1 := 16r0002. 47 | COMPRESSION_ENGINE_STANDARD := 16r0000. 48 | COMPRESSION_ENGINE_MAXIMUM := 16r0100. 49 | COMPRESSION_ENGINE_HIBER := 16r0200. 50 | 51 | ACCESS_ALLOWED_ACE_TYPE := 16r0. 52 | ACCESS_DENIED_ACE_TYPE := 16r1. 53 | SYSTEM_AUDIT_ACE_TYPE := 16r2. 54 | SYSTEM_ALARM_ACE_TYPE := 16r3. 55 | 56 | DUPLICATE_CLOSE_SOURCE := 16r1. 57 | DUPLICATE_SAME_ACCESS := 16r2 58 | ] 59 | 60 | { #category : #'class initialization' } 61 | WinNTConstants class >> initialize [ 62 | "Initializes the receiver class 63 | 64 | self initialize 65 | " 66 | 67 | self 68 | initConstants 69 | ] 70 | -------------------------------------------------------------------------------- /src/OS-Windows-Core/WinRegistryConstants.class.st: -------------------------------------------------------------------------------- 1 | " 2 | Includes constants as defined in winreg.h 3 | " 4 | Class { 5 | #name : #WinRegistryConstants, 6 | #superclass : #SharedPool, 7 | #classVars : [ 8 | 'HKEY', 9 | 'HKEY_CLASSES_ROOT', 10 | 'HKEY_CURRENT_CONFIG', 11 | 'HKEY_CURRENT_USER', 12 | 'HKEY_DYN_DATA', 13 | 'HKEY_LOCAL_MACHINE', 14 | 'HKEY_PERFORMANCE_DATA', 15 | 'HKEY_USERS', 16 | 'KEY_ALL_ACCESS', 17 | 'KEY_CREATE_LINK', 18 | 'KEY_CREATE_SUB_KEY', 19 | 'KEY_ENUMERATE_SUB_KEYS', 20 | 'KEY_EXECUTE', 21 | 'KEY_NOTIFY', 22 | 'KEY_QUERY_VALUE', 23 | 'KEY_READ', 24 | 'KEY_SET_VALUE', 25 | 'KEY_WOW64_32KEY', 26 | 'KEY_WOW64_64KEY', 27 | 'KEY_WRITE', 28 | 'PHKEY', 29 | 'REG_BINARY', 30 | 'REG_CREATED_NEW_KEY', 31 | 'REG_DWORD', 32 | 'REG_DWORD_BIG_ENDIAN', 33 | 'REG_DWORD_LITTLE_ENDIAN', 34 | 'REG_EXPAND_SZ', 35 | 'REG_FULL_RESOURCE_DESCRIPTOR', 36 | 'REG_LINK', 37 | 'REG_MULTI_SZ', 38 | 'REG_NONE', 39 | 'REG_NOTIFY_CHANGE_ATTRIBUTES', 40 | 'REG_NOTIFY_CHANGE_LAST_SET', 41 | 'REG_NOTIFY_CHANGE_NAME', 42 | 'REG_NOTIFY_CHANGE_SECURITY', 43 | 'REG_OPENED_EXISTING_KEY', 44 | 'REG_OPTION_NON_VOLATILE', 45 | 'REG_OPTION_VOLATILE', 46 | 'REG_QWORD', 47 | 'REG_QWORD_LITTLE_ENDIAN', 48 | 'REG_RESOURCE_LIST', 49 | 'REG_RESOURCE_REQUIREMENTS_LIST', 50 | 'REG_SZ' 51 | ], 52 | #category : #'OS-Windows-Core-Support' 53 | } 54 | 55 | { #category : #'private - initialization' } 56 | WinRegistryConstants class >> initRegistryConstants [ 57 | 58 | HKEY_CLASSES_ROOT := 16r80000000. 59 | HKEY_CURRENT_USER := 16r80000001 . 60 | HKEY_LOCAL_MACHINE := 16r80000002. 61 | HKEY_USERS := 16r80000003. 62 | 63 | HKEY_PERFORMANCE_DATA := 16r80000004. 64 | HKEY_CURRENT_CONFIG := 16r80000005. 65 | HKEY_DYN_DATA := 16r80000006. 66 | 67 | REG_OPTION_VOLATILE := 1. 68 | REG_OPTION_NON_VOLATILE := 0. 69 | 70 | REG_CREATED_NEW_KEY := 1. 71 | REG_OPENED_EXISTING_KEY := 2. 72 | 73 | REG_NONE := 0. 74 | REG_SZ := 1. 75 | REG_EXPAND_SZ := 2. 76 | REG_BINARY := 3. 77 | REG_DWORD_LITTLE_ENDIAN := 4. 78 | REG_DWORD := 4. 79 | REG_DWORD_BIG_ENDIAN := 5. 80 | REG_LINK := 6. 81 | REG_MULTI_SZ := 7. 82 | REG_RESOURCE_LIST := 8. 83 | REG_FULL_RESOURCE_DESCRIPTOR := 9. 84 | REG_RESOURCE_REQUIREMENTS_LIST := 10. 85 | REG_QWORD_LITTLE_ENDIAN := 11. 86 | REG_QWORD := 11. 87 | REG_NOTIFY_CHANGE_NAME := 1. 88 | REG_NOTIFY_CHANGE_ATTRIBUTES := 2. 89 | REG_NOTIFY_CHANGE_LAST_SET := 4. 90 | REG_NOTIFY_CHANGE_SECURITY := 8. 91 | 92 | KEY_ALL_ACCESS := 16rF003F. 93 | KEY_CREATE_LINK := 16r0020. 94 | KEY_CREATE_SUB_KEY := 16r0004. 95 | KEY_ENUMERATE_SUB_KEYS := 16r0008. 96 | KEY_EXECUTE := 16r20019. 97 | KEY_NOTIFY := 16r0010. 98 | KEY_QUERY_VALUE := 16r0001. 99 | KEY_READ := 16r20019. 100 | KEY_SET_VALUE := 16r0002. 101 | KEY_WOW64_32KEY := 16r0200. 102 | KEY_WOW64_64KEY := 16r0100. 103 | KEY_WRITE := 16r20006 104 | ] 105 | 106 | { #category : #'private - initialization' } 107 | WinRegistryConstants class >> initRegistryTypes [ 108 | 109 | HKEY := #WinRegistryKey. 110 | PHKEY := 'HKEY*' 111 | ] 112 | 113 | { #category : #'class initialization' } 114 | WinRegistryConstants class >> initialize [ 115 | "Initializes the receiver class 116 | 117 | self initialize 118 | " 119 | 120 | self 121 | initRegistryConstants; 122 | initRegistryTypes 123 | ] 124 | -------------------------------------------------------------------------------- /src/OS-Windows-Core/WinRegistryKey.class.st: -------------------------------------------------------------------------------- 1 | " 2 | Represents a registry key 3 | " 4 | Class { 5 | #name : #WinRegistryKey, 6 | #superclass : #WinHandle, 7 | #pools : [ 8 | 'WinRegistryConstants' 9 | ], 10 | #category : #'OS-Windows-Core-Registry' 11 | } 12 | 13 | { #category : #defaults } 14 | WinRegistryKey class >> allUsers [ 15 | 16 | ^ self fromExternalHandle: HKEY_USERS 17 | ] 18 | 19 | { #category : #converting } 20 | WinRegistryKey class >> asExternalTypeOn: generator [ 21 | ^ FFIConstantHandleType objectClass: self 22 | ] 23 | 24 | { #category : #defaults } 25 | WinRegistryKey class >> classesRoot [ 26 | 27 | ^ self fromExternalHandle: HKEY_CLASSES_ROOT 28 | ] 29 | 30 | { #category : #'private - finalization' } 31 | WinRegistryKey class >> closeHandle: aHandle [ 32 | "Closes the given handle" 33 | 34 | ^self ffiCall: #(BOOL CloseHandle(HKEY aHandle)) module: #kernel32 35 | ] 36 | 37 | { #category : #defaults } 38 | WinRegistryKey class >> currentConfig [ 39 | 40 | ^ self fromExternalHandle: HKEY_CURRENT_CONFIG 41 | ] 42 | 43 | { #category : #defaults } 44 | WinRegistryKey class >> currentUser [ 45 | 46 | ^ self fromExternalHandle: HKEY_CURRENT_USER 47 | ] 48 | 49 | { #category : #defaults } 50 | WinRegistryKey class >> dynamicData [ 51 | 52 | ^ self fromExternalHandle: HKEY_DYN_DATA 53 | ] 54 | 55 | { #category : #examples } 56 | WinRegistryKey class >> example1 [ 57 | 58 | WinRegistryKey localMachine inspect 59 | ] 60 | 61 | { #category : #examples } 62 | WinRegistryKey class >> example2 [ 63 | "Query a value from the registry" 64 | 65 | (WinRegistryKey localMachine 66 | queryValue: 'CommonFilesDir' fromSubkey: 'SOFTWARE\Microsoft\Windows\CurrentVersion') inspect 67 | ] 68 | 69 | { #category : #defaults } 70 | WinRegistryKey class >> localMachine [ 71 | 72 | ^ self fromExternalHandle: HKEY_LOCAL_MACHINE 73 | ] 74 | 75 | { #category : #defaults } 76 | WinRegistryKey class >> performanceData [ 77 | 78 | ^ self fromExternalHandle: HKEY_PERFORMANCE_DATA 79 | ] 80 | 81 | { #category : #lifetime } 82 | WinRegistryKey >> close [ 83 | 84 | WinRegistry regCloseKey: self 85 | ] 86 | 87 | { #category : #initialization } 88 | WinRegistryKey >> createDefaultHandle [ 89 | ^ 0 90 | ] 91 | 92 | { #category : #accessing } 93 | WinRegistryKey >> enumerateSubKeys [ 94 | 95 | ^ WinRegistry enumerateSubKeys: self 96 | ] 97 | 98 | { #category : #accessing } 99 | WinRegistryKey >> enumerateValueNames [ 100 | 101 | ^ WinRegistry enumerateValueNames: self 102 | ] 103 | 104 | { #category : #accessing } 105 | WinRegistryKey >> enumerateValuesIntoDict [ 106 | 107 | ^ WinRegistry enumerateValuesIntoDict: self 108 | ] 109 | 110 | { #category : #accessing } 111 | WinRegistryKey >> keyName [ 112 | "Returns the key name" 113 | 114 | (handle value allMask: 16r80000000) ifFalse: [ ^nil ]. 115 | ^WinRegistryConstants classVarNames 116 | detect: [:each | (each printString beginsWith: '#HKEY_') and: [ handle = (WinRegistryConstants classVarNamed: each) ]] 117 | ifNone: [ 'NOT FOUND' ] 118 | ] 119 | 120 | { #category : #printing } 121 | WinRegistryKey >> printOn: aStream [ 122 | super printOn: aStream. 123 | self getHandle 124 | ifNotNil: [ 125 | aStream 126 | nextPutAll: ' - '; 127 | nextPutAll: self keyName asString ] 128 | ] 129 | 130 | { #category : #accessing } 131 | WinRegistryKey >> queryOpenSubkey: subKeyString [ 132 | "Creates and returns a new key for the given subkeyString. Do not forget to close the resulting key after usage. 133 | 134 | WinRegistryKey localMachine 135 | queryOpenSubkey: 'HARDWARE\\DESCRIPTION\\System\\CentralProcessor\\0' 136 | " 137 | 138 | |result| 139 | result := self class new. 140 | WinRegistry regOpenKeyExA: self 141 | with: subKeyString 142 | with: 0 143 | with: KEY_QUERY_VALUE | KEY_WOW64_64KEY 144 | with: result. 145 | ^result 146 | ] 147 | 148 | { #category : #accessing } 149 | WinRegistryKey >> queryValue: value [ 150 | 151 | ^ WinRegistry queryValue: value fromKey: self 152 | ] 153 | 154 | { #category : #accessing } 155 | WinRegistryKey >> queryValue: value fromSubkey: subkey [ 156 | |hKey result| 157 | hKey := self queryOpenSubkey: subkey. 158 | result := WinRegistry queryValue: value fromKey: hKey. 159 | hKey closeHandle. 160 | ^result 161 | ] 162 | -------------------------------------------------------------------------------- /src/OS-Windows-Core/WinShutdownInProgress.class.st: -------------------------------------------------------------------------------- 1 | " 2 | The system is shutting down. 3 | " 4 | Class { 5 | #name : #WinShutdownInProgress, 6 | #superclass : #WinError, 7 | #category : #'OS-Windows-Core-Exceptions' 8 | } 9 | -------------------------------------------------------------------------------- /src/OS-Windows-Core/WinTCHAR.class.st: -------------------------------------------------------------------------------- 1 | " 2 | A Win32 character string that can be used to describe ANSI, DBCS, or Unicode strings 3 | 4 | Depending on context, acts either as char or wchar 5 | " 6 | Class { 7 | #name : #WinTCHAR, 8 | #superclass : #FFIExternalType, 9 | #category : #'OS-Windows-Core-Types' 10 | } 11 | 12 | { #category : #converting } 13 | WinTCHAR class >> asExternalTypeOn: generator [ 14 | 15 | ^(generator optionAt: #WinUnicode) 16 | ifTrue: [ 'wchar_t' asExternalTypeOn: generator ] 17 | ifFalse: [ #uchar asExternalTypeOn: generator ] 18 | ] 19 | -------------------------------------------------------------------------------- /src/OS-Windows-Core/WinTString.class.st: -------------------------------------------------------------------------------- 1 | " 2 | Depending on context, acts either as char* or wchar* string 3 | " 4 | Class { 5 | #name : #WinTString, 6 | #superclass : #FFIExternalType, 7 | #category : #'OS-Windows-Core-Types' 8 | } 9 | 10 | { #category : #utilities } 11 | WinTString class >> asExternalTypeOn: gen [ 12 | 13 | ^ "(gen optionAt: #WinUnicode) 14 | ifTrue: [ WinWideString asExternalTypeOn: gen ] 15 | ifFalse: [ "FFIExternalString asExternalTypeOn: gen "]" 16 | ] 17 | 18 | { #category : #utilities } 19 | WinTString class >> primLstrlenA: lpString [ 20 | "Determines the length of the specified string (not including the terminating null character)." 21 | 22 | ^ self ffiCall: #(int lstrlen(String lpString)) module: #kernel32 23 | ] 24 | -------------------------------------------------------------------------------- /src/OS-Windows-Core/WinTypes.class.st: -------------------------------------------------------------------------------- 1 | " 2 | Windows type definitions 3 | " 4 | Class { 5 | #name : #WinTypes, 6 | #superclass : #SharedPool, 7 | #classVars : [ 8 | 'ATOM', 9 | 'BOOL', 10 | 'BOOLEAN', 11 | 'BYTE', 12 | 'CALLBACK', 13 | 'CHAR', 14 | 'COLORREF', 15 | 'DWORD', 16 | 'DWORD32', 17 | 'DWORD64', 18 | 'DWORDLONG', 19 | 'FLOAT', 20 | 'HANDLE', 21 | 'HBRUSH', 22 | 'HCURSOR', 23 | 'HDC', 24 | 'HICON', 25 | 'HINSTANCE', 26 | 'HMENU', 27 | 'HMODULE', 28 | 'HRESULT', 29 | 'HWND', 30 | 'INT', 31 | 'INT32', 32 | 'INT64', 33 | 'LANGID', 34 | 'LCID', 35 | 'LCTYPE', 36 | 'LGRPID', 37 | 'LONG', 38 | 'LONG32', 39 | 'LONG64', 40 | 'LONGLONG', 41 | 'LONG_PTR', 42 | 'LPARAM', 43 | 'LPBOOL', 44 | 'LPBYTE', 45 | 'LPCOLORREF', 46 | 'LPCSTR', 47 | 'LPCTSTR', 48 | 'LPCVOID', 49 | 'LPCWSTR', 50 | 'LPDWORD', 51 | 'LPHANDLE', 52 | 'LPOFNHOOKPROC', 53 | 'LPSTR', 54 | 'LPSYSTEMTIME', 55 | 'LPTCH', 56 | 'LPTSTR', 57 | 'LPVOID', 58 | 'LPWCH', 59 | 'LPWSTR', 60 | 'PBOOL', 61 | 'PBOOLEAN', 62 | 'PCSTR', 63 | 'PCTSTR', 64 | 'PCWSTR', 65 | 'POINT', 66 | 'PSTR', 67 | 'PTSTR', 68 | 'PVOID', 69 | 'PWSTR', 70 | 'RECT', 71 | 'SHORT', 72 | 'SYSTEMTIME', 73 | 'TCHAR', 74 | 'UINT', 75 | 'ULONG', 76 | 'USHORT', 77 | 'VOID', 78 | 'WCHAR', 79 | 'WNDCLASSEX', 80 | 'WNDENUMPROC', 81 | 'WNDPROC', 82 | 'WORD' 83 | ], 84 | #category : #'OS-Windows-Core-Support' 85 | } 86 | 87 | { #category : #'private - initialization' } 88 | WinTypes class >> initBasicTypes [ 89 | 90 | BOOL := #bool. 91 | DWORD := #ulong. 92 | 93 | VOID := #void. 94 | 95 | POINT := #WinPoint. 96 | RECT := #WinRectangle. 97 | 98 | HDC := #WinDeviceContext. 99 | HWND := #WinWindow. 100 | HMENU := #WinMenu. 101 | 102 | SYSTEMTIME := #WinSystemTime. 103 | LPSYSTEMTIME := #'SYSTEMTIME*' 104 | ] 105 | 106 | { #category : #'private - initialization' } 107 | WinTypes class >> initCallbacks [ 108 | 109 | WNDENUMPROC := #WinEnumWindowsProc 110 | ] 111 | 112 | { #category : #'private - initialization' } 113 | WinTypes class >> initKnownTypes [ 114 | 115 | UINT := #ulong. 116 | USHORT := #ushort. 117 | SHORT := 'short'. 118 | 119 | ATOM := #WORD. 120 | BOOLEAN := #BYTE. 121 | BYTE := #unsignedByte. 122 | CALLBACK := #'void*'. 123 | CHAR := #char. 124 | COLORREF := #DWORD. 125 | 126 | WORD := #ushort. 127 | DWORD := #ulong. 128 | DWORDLONG := #ULONGLONG. 129 | 130 | DWORD32 := #ulong. 131 | DWORD64 := #ulonglong. 132 | FLOAT := #float. 133 | 134 | HRESULT := #LONG. 135 | INT := #long. 136 | INT32 := #long. 137 | INT64 := #longlong. 138 | LANGID := #WORD. 139 | LCID := #DWORD. 140 | LCTYPE := #DWORD. 141 | LGRPID := #DWORD. 142 | 143 | ULONG := #ulong. 144 | LONG := #long. 145 | LONGLONG := #longlong. 146 | 147 | LONG32 := #long. 148 | LONG64 := #longlong. 149 | LONG_PTR := #long. 150 | LPOFNHOOKPROC := LONG_PTR. 151 | LPARAM := #'LONG_PTR'. 152 | LPBOOL := #'BOOL*'. 153 | LPBYTE := #'BYTE*'. 154 | LPCOLORREF := #'DWORD*'. 155 | 156 | VOID := #void. 157 | PVOID := 'void*'. 158 | LPVOID := 'void*'. 159 | LPCVOID := #'void*'. 160 | LPDWORD := #'DWORD*'. 161 | 162 | BOOL := #bool. 163 | PBOOL := 'BOOL*'. 164 | PBOOLEAN := 'BOOLEAN*'. 165 | 166 | WNDPROC := #'void*'. 167 | HWND := #'void*'. 168 | HANDLE := #WinHandle. 169 | LPHANDLE := #'HANDLE*'. 170 | HINSTANCE := HMODULE := HICON := HCURSOR := HBRUSH := #HANDLE. 171 | 172 | LPARAM := 'void *'. 173 | LPOFNHOOKPROC := LONG_PTR 174 | ] 175 | 176 | { #category : #'private - initialization' } 177 | WinTypes class >> initObjectTypes [ 178 | 179 | WNDCLASSEX := #WinWndClassEx 180 | ] 181 | 182 | { #category : #'private - initialization' } 183 | WinTypes class >> initStringTypes [ 184 | TCHAR := #WinTCHAR. 185 | LPTCH := 'TCHAR*'. 186 | WCHAR := 'wchar_t'. 187 | LPWCH := 'WCHAR*'. 188 | 189 | LPTSTR := #WinTString. 190 | LPWSTR := #WinWideString. 191 | 192 | LPCSTR := #FFIExternalString. 193 | 194 | LPCWSTR := #FFIExternalString. 195 | 196 | LPCTSTR := #LPTSTR 197 | ] 198 | 199 | { #category : #'class initialization' } 200 | WinTypes class >> initialize [ 201 | 202 | self 203 | initBasicTypes; 204 | initKnownTypes; 205 | initStringTypes; 206 | initObjectTypes; 207 | initCallbacks 208 | ] 209 | -------------------------------------------------------------------------------- /src/OS-Windows-Core/WinWideString.class.st: -------------------------------------------------------------------------------- 1 | " 2 | A wide string (unicode) 3 | " 4 | Class { 5 | #name : #WinWideString, 6 | #superclass : #FFIExternalType, 7 | #category : #'OS-Windows-Core-Types' 8 | } 9 | -------------------------------------------------------------------------------- /src/OS-Windows-Core/package.st: -------------------------------------------------------------------------------- 1 | Package { #name : #'OS-Windows-Core' } 2 | -------------------------------------------------------------------------------- /src/OS-Windows-Cryptography/ManifestOSWindowsCryptography.class.st: -------------------------------------------------------------------------------- 1 | " 2 | Please describe the package using the class comment of the included manifest class. The manifest class also includes other additional metadata for the package. These meta data are used by other tools such as the SmalllintManifestChecker and the critics Browser 3 | " 4 | Class { 5 | #name : #ManifestOSWindowsCryptography, 6 | #superclass : #PackageManifest, 7 | #category : #'OS-Windows-Cryptography-Manifest' 8 | } 9 | 10 | { #category : #'code-critics' } 11 | ManifestOSWindowsCryptography class >> ruleLongMethodsRuleV1FalsePositive [ 12 | 13 | 14 | ^ #(#(#(#RGMetaclassDefinition #(#'WinCryptConstants class' #WinCryptConstants)) #'2023-03-19T02:00:25.162+01:00') ) 15 | ] 16 | -------------------------------------------------------------------------------- /src/OS-Windows-Cryptography/WinCryptoProvider.class.st: -------------------------------------------------------------------------------- 1 | " 2 | A handle to a crypto service provider (CSP). These handles are used to indicate which CSP module performs specific operations. 3 | 4 | It is analog to HCRYPTPROV in C/C++ from wincrypt.h 5 | " 6 | Class { 7 | #name : #WinCryptoProvider, 8 | #superclass : #WinHandle, 9 | #pools : [ 10 | 'WinCryptConstants' 11 | ], 12 | #category : #'OS-Windows-Cryptography-Provider' 13 | } 14 | 15 | { #category : #accessing } 16 | WinCryptoProvider >> acquireContextExample1 [ 17 | 18 | ^ self ffiCall: #(BOOL CryptAcquireContextA(HCRYPTPROV self, 0, 0, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT | CRYPT_SILENT)) module: #advapi32 19 | ] 20 | 21 | { #category : #accessing } 22 | WinCryptoProvider >> acquireContextExample2 [ 23 | 24 | ^self ffiCall: #(BOOL CryptAcquireContextA(HCRYPTPROV self, 0, 0, PROV_RSA_FULL, 4026531904)) module: #advapi32 25 | ] 26 | -------------------------------------------------------------------------------- /src/OS-Windows-Cryptography/package.st: -------------------------------------------------------------------------------- 1 | Package { #name : #'OS-Windows-Cryptography' } 2 | -------------------------------------------------------------------------------- /src/OS-Windows-Environment-Tests/WinCaretTest.class.st: -------------------------------------------------------------------------------- 1 | " 2 | SUnit tests for WinCaret 3 | " 4 | Class { 5 | #name : 'WinCaretTest', 6 | #superclass : 'WindowsSpecificTest', 7 | #category : 'OS-Windows-Environment-Tests-Caret', 8 | #package : 'OS-Windows-Environment-Tests', 9 | #tag : 'Caret' 10 | } 11 | 12 | { #category : 'tests' } 13 | WinCaretTest >> testBlinkTime [ 14 | 15 | self assert: WinCaret blinkTime isInteger 16 | ] 17 | -------------------------------------------------------------------------------- /src/OS-Windows-Environment-Tests/WinClipboardBitmapFormatTest.class.st: -------------------------------------------------------------------------------- 1 | " 2 | A WinClipboardBitmapFormatTest is a test class for testing the behavior of WinClipboardBitmapFormat 3 | " 4 | Class { 5 | #name : 'WinClipboardBitmapFormatTest', 6 | #superclass : 'TestCase', 7 | #pools : [ 8 | 'WinUserConstants' 9 | ], 10 | #category : 'OS-Windows-Environment-Tests-Clipboard-Formats', 11 | #package : 'OS-Windows-Environment-Tests', 12 | #tag : 'Clipboard-Formats' 13 | } 14 | 15 | { #category : 'tests' } 16 | WinClipboardBitmapFormatTest >> testFormatFromID [ 17 | 18 | self assert: (WinClipboardFormat formatFromID: CF_BITMAP) equals: WinClipboardBitmapFormat 19 | ] 20 | 21 | { #category : 'tests' } 22 | WinClipboardBitmapFormatTest >> testFormatID [ 23 | 24 | self assert: WinClipboardBitmapFormat formatID equals: CF_BITMAP. 25 | self assert: WinClipboardBitmapFormat formatID equals: 2 26 | ] 27 | 28 | { #category : 'tests' } 29 | WinClipboardBitmapFormatTest >> testGeneral [ 30 | 31 | self 32 | assert: WinClipboardBitmapFormat isStandardFormat; 33 | deny: WinClipboardBitmapFormat isCustomFormat 34 | ] 35 | -------------------------------------------------------------------------------- /src/OS-Windows-Environment-Tests/WinClipboardColorPaletteFormatTest.class.st: -------------------------------------------------------------------------------- 1 | " 2 | A WinClipboardColorPaletteFormatTest is a test class for testing the behavior of WinClipboardColorPaletteFormat 3 | " 4 | Class { 5 | #name : 'WinClipboardColorPaletteFormatTest', 6 | #superclass : 'TestCase', 7 | #pools : [ 8 | 'WinUserConstants' 9 | ], 10 | #category : 'OS-Windows-Environment-Tests-Clipboard-Formats', 11 | #package : 'OS-Windows-Environment-Tests', 12 | #tag : 'Clipboard-Formats' 13 | } 14 | 15 | { #category : 'tests' } 16 | WinClipboardColorPaletteFormatTest >> testFormatFromID [ 17 | 18 | self assert: (WinClipboardFormat formatFromID: CF_PALETTE) equals: WinClipboardColorPaletteFormat 19 | ] 20 | 21 | { #category : 'tests' } 22 | WinClipboardColorPaletteFormatTest >> testFormatID [ 23 | 24 | self assert: WinClipboardColorPaletteFormat formatID equals: CF_PALETTE. 25 | self assert: WinClipboardColorPaletteFormat formatID equals: 9 26 | ] 27 | 28 | { #category : 'tests' } 29 | WinClipboardColorPaletteFormatTest >> testGeneral [ 30 | 31 | self 32 | assert: WinClipboardColorPaletteFormat isStandardFormat; 33 | deny: WinClipboardColorPaletteFormat isCustomFormat 34 | ] 35 | -------------------------------------------------------------------------------- /src/OS-Windows-Environment-Tests/WinClipboardDIBFormatTest.class.st: -------------------------------------------------------------------------------- 1 | " 2 | A WinClipboardDIBFormatTest is a test class for testing the behavior of WinClipboardDIBFormat 3 | " 4 | Class { 5 | #name : 'WinClipboardDIBFormatTest', 6 | #superclass : 'TestCase', 7 | #pools : [ 8 | 'WinUserConstants' 9 | ], 10 | #category : 'OS-Windows-Environment-Tests-Clipboard-Formats', 11 | #package : 'OS-Windows-Environment-Tests', 12 | #tag : 'Clipboard-Formats' 13 | } 14 | 15 | { #category : 'tests' } 16 | WinClipboardDIBFormatTest >> testFormatFromID [ 17 | 18 | self assert: (WinClipboardFormat formatFromID: CF_DIB) equals: WinClipboardDIBFormat 19 | ] 20 | 21 | { #category : 'tests' } 22 | WinClipboardDIBFormatTest >> testFormatID [ 23 | 24 | self assert: WinClipboardDIBFormat formatID equals: CF_DIB. 25 | self assert: WinClipboardDIBFormat formatID equals: 8 26 | ] 27 | 28 | { #category : 'tests' } 29 | WinClipboardDIBFormatTest >> testGeneral [ 30 | 31 | self 32 | assert: WinClipboardDIBFormat isStandardFormat; 33 | deny: WinClipboardDIBFormat isCustomFormat 34 | ] 35 | -------------------------------------------------------------------------------- /src/OS-Windows-Environment-Tests/WinClipboardDIBV5FormatTest.class.st: -------------------------------------------------------------------------------- 1 | " 2 | A WinClipboardDIBV5FormatTest is a test class for testing the behavior of WinClipboardDIBV5Format 3 | " 4 | Class { 5 | #name : 'WinClipboardDIBV5FormatTest', 6 | #superclass : 'TestCase', 7 | #pools : [ 8 | 'WinUserConstants' 9 | ], 10 | #category : 'OS-Windows-Environment-Tests-Clipboard-Formats', 11 | #package : 'OS-Windows-Environment-Tests', 12 | #tag : 'Clipboard-Formats' 13 | } 14 | 15 | { #category : 'tests' } 16 | WinClipboardDIBV5FormatTest >> testFormatFromID [ 17 | 18 | self assert: (WinClipboardFormat formatFromID: CF_DIBV5) equals: WinClipboardDIBV5Format 19 | ] 20 | 21 | { #category : 'tests' } 22 | WinClipboardDIBV5FormatTest >> testFormatID [ 23 | 24 | self assert: WinClipboardDIBV5Format formatID equals: CF_DIBV5. 25 | self assert: WinClipboardDIBV5Format formatID equals: 17 26 | ] 27 | 28 | { #category : 'tests' } 29 | WinClipboardDIBV5FormatTest >> testGeneral [ 30 | 31 | self 32 | assert: WinClipboardDIBV5Format isStandardFormat; 33 | deny: WinClipboardDIBV5Format isCustomFormat 34 | ] 35 | -------------------------------------------------------------------------------- /src/OS-Windows-Environment-Tests/WinClipboardDIFFormatTest.class.st: -------------------------------------------------------------------------------- 1 | " 2 | A WinClipboardDIFFormatTest is a test class for testing the behavior of WinClipboardDIFFormat 3 | " 4 | Class { 5 | #name : 'WinClipboardDIFFormatTest', 6 | #superclass : 'TestCase', 7 | #pools : [ 8 | 'WinUserConstants' 9 | ], 10 | #category : 'OS-Windows-Environment-Tests-Clipboard-Formats', 11 | #package : 'OS-Windows-Environment-Tests', 12 | #tag : 'Clipboard-Formats' 13 | } 14 | 15 | { #category : 'tests' } 16 | WinClipboardDIFFormatTest >> testFormatFromID [ 17 | 18 | self assert: (WinClipboardFormat formatFromID: CF_DIF) equals: WinClipboardDIFFormat 19 | ] 20 | 21 | { #category : 'tests' } 22 | WinClipboardDIFFormatTest >> testFormatID [ 23 | 24 | self assert: WinClipboardDIFFormat formatID equals: CF_DIF. 25 | self assert: WinClipboardDIFFormat formatID equals: 5 26 | ] 27 | 28 | { #category : 'tests' } 29 | WinClipboardDIFFormatTest >> testGeneral [ 30 | 31 | self 32 | assert: WinClipboardDIFFormat isStandardFormat; 33 | deny: WinClipboardDIFFormat isCustomFormat 34 | ] 35 | -------------------------------------------------------------------------------- /src/OS-Windows-Environment-Tests/WinClipboardDSPBitmapFormatTest.class.st: -------------------------------------------------------------------------------- 1 | " 2 | A WinClipboardDSPBitmapFormatTest is a test class for testing the behavior of WinClipboardDSPBitmapFormat 3 | " 4 | Class { 5 | #name : 'WinClipboardDSPBitmapFormatTest', 6 | #superclass : 'TestCase', 7 | #pools : [ 8 | 'WinUserConstants' 9 | ], 10 | #category : 'OS-Windows-Environment-Tests-Clipboard-Formats', 11 | #package : 'OS-Windows-Environment-Tests', 12 | #tag : 'Clipboard-Formats' 13 | } 14 | 15 | { #category : 'tests' } 16 | WinClipboardDSPBitmapFormatTest >> testFormatFromID [ 17 | 18 | self assert: (WinClipboardFormat formatFromID: CF_DSPBITMAP) equals: WinClipboardDSPBitmapFormat 19 | ] 20 | 21 | { #category : 'tests' } 22 | WinClipboardDSPBitmapFormatTest >> testFormatID [ 23 | 24 | self assert: WinClipboardDSPBitmapFormat formatID equals: CF_DSPBITMAP. 25 | self assert: WinClipboardDSPBitmapFormat formatID equals: 16r0082 26 | ] 27 | 28 | { #category : 'tests' } 29 | WinClipboardDSPBitmapFormatTest >> testGeneral [ 30 | 31 | self 32 | assert: WinClipboardDSPBitmapFormat isStandardFormat; 33 | deny: WinClipboardDSPBitmapFormat isCustomFormat 34 | ] 35 | -------------------------------------------------------------------------------- /src/OS-Windows-Environment-Tests/WinClipboardDSPEnhancedMetafileFormatTest.class.st: -------------------------------------------------------------------------------- 1 | " 2 | A WinClipboardDSPEnhancedMetafileFormatTest is a test class for testing the behavior of WinClipboardDSPEnhancedMetafileFormat 3 | " 4 | Class { 5 | #name : 'WinClipboardDSPEnhancedMetafileFormatTest', 6 | #superclass : 'TestCase', 7 | #pools : [ 8 | 'WinUserConstants' 9 | ], 10 | #category : 'OS-Windows-Environment-Tests-Clipboard-Formats', 11 | #package : 'OS-Windows-Environment-Tests', 12 | #tag : 'Clipboard-Formats' 13 | } 14 | 15 | { #category : 'tests' } 16 | WinClipboardDSPEnhancedMetafileFormatTest >> testFormatFromID [ 17 | 18 | self assert: (WinClipboardFormat formatFromID: CF_DSPENHMETAFILE) equals: WinClipboardDSPEnhancedMetafileFormat 19 | ] 20 | 21 | { #category : 'tests' } 22 | WinClipboardDSPEnhancedMetafileFormatTest >> testFormatID [ 23 | 24 | self assert: WinClipboardDSPEnhancedMetafileFormat formatID equals: CF_DSPENHMETAFILE. 25 | self assert: WinClipboardDSPEnhancedMetafileFormat formatID equals: 16r008E 26 | ] 27 | 28 | { #category : 'tests' } 29 | WinClipboardDSPEnhancedMetafileFormatTest >> testGeneral [ 30 | 31 | self 32 | assert: WinClipboardDSPEnhancedMetafileFormat isStandardFormat; 33 | deny: WinClipboardDSPEnhancedMetafileFormat isCustomFormat 34 | ] 35 | -------------------------------------------------------------------------------- /src/OS-Windows-Environment-Tests/WinClipboardDSPMetafilePictureFormatTest.class.st: -------------------------------------------------------------------------------- 1 | " 2 | A WinClipboardDSPMetafilePictureFormatTest is a test class for testing the behavior of WinClipboardDSPMetafilePictureFormat 3 | " 4 | Class { 5 | #name : 'WinClipboardDSPMetafilePictureFormatTest', 6 | #superclass : 'TestCase', 7 | #pools : [ 8 | 'WinUserConstants' 9 | ], 10 | #category : 'OS-Windows-Environment-Tests-Clipboard-Formats', 11 | #package : 'OS-Windows-Environment-Tests', 12 | #tag : 'Clipboard-Formats' 13 | } 14 | 15 | { #category : 'tests' } 16 | WinClipboardDSPMetafilePictureFormatTest >> testFormatFromID [ 17 | 18 | self assert: (WinClipboardFormat formatFromID: CF_DSPMETAFILEPICT) equals: WinClipboardDSPMetafilePictureFormat 19 | ] 20 | 21 | { #category : 'tests' } 22 | WinClipboardDSPMetafilePictureFormatTest >> testFormatID [ 23 | 24 | self assert: WinClipboardDSPMetafilePictureFormat formatID equals: CF_DSPMETAFILEPICT. 25 | self assert: WinClipboardDSPMetafilePictureFormat formatID equals: 16r0083 26 | ] 27 | 28 | { #category : 'tests' } 29 | WinClipboardDSPMetafilePictureFormatTest >> testGeneral [ 30 | 31 | self 32 | assert: WinClipboardDSPMetafilePictureFormat isStandardFormat; 33 | deny: WinClipboardDSPMetafilePictureFormat isCustomFormat 34 | ] 35 | -------------------------------------------------------------------------------- /src/OS-Windows-Environment-Tests/WinClipboardDSPTextFormatTest.class.st: -------------------------------------------------------------------------------- 1 | " 2 | A WinClipboardDSPTextFormatTest is a test class for testing the behavior of WinClipboardDSPTextFormat 3 | " 4 | Class { 5 | #name : 'WinClipboardDSPTextFormatTest', 6 | #superclass : 'TestCase', 7 | #pools : [ 8 | 'WinUserConstants' 9 | ], 10 | #category : 'OS-Windows-Environment-Tests-Clipboard-Formats', 11 | #package : 'OS-Windows-Environment-Tests', 12 | #tag : 'Clipboard-Formats' 13 | } 14 | 15 | { #category : 'tests' } 16 | WinClipboardDSPTextFormatTest >> testFormatFromID [ 17 | 18 | self assert: (WinClipboardFormat formatFromID: CF_DSPTEXT) equals: WinClipboardDSPTextFormat 19 | ] 20 | 21 | { #category : 'tests' } 22 | WinClipboardDSPTextFormatTest >> testFormatID [ 23 | 24 | self assert: WinClipboardDSPTextFormat formatID equals: CF_DSPTEXT. 25 | self assert: WinClipboardDSPTextFormat formatID equals: 16r0081 26 | ] 27 | 28 | { #category : 'tests' } 29 | WinClipboardDSPTextFormatTest >> testGeneral [ 30 | 31 | self 32 | assert: WinClipboardDSPTextFormat isStandardFormat; 33 | deny: WinClipboardDSPTextFormat isCustomFormat 34 | ] 35 | -------------------------------------------------------------------------------- /src/OS-Windows-Environment-Tests/WinClipboardEnhancedMetafileFormatTest.class.st: -------------------------------------------------------------------------------- 1 | " 2 | A WinClipboardEnhancedMetafileFormatTest is a test class for testing the behavior of WinClipboardEnhancedMetafileFormat 3 | " 4 | Class { 5 | #name : 'WinClipboardEnhancedMetafileFormatTest', 6 | #superclass : 'TestCase', 7 | #pools : [ 8 | 'WinUserConstants' 9 | ], 10 | #category : 'OS-Windows-Environment-Tests-Clipboard-Formats', 11 | #package : 'OS-Windows-Environment-Tests', 12 | #tag : 'Clipboard-Formats' 13 | } 14 | 15 | { #category : 'tests' } 16 | WinClipboardEnhancedMetafileFormatTest >> testFormatFromID [ 17 | 18 | self assert: (WinClipboardFormat formatFromID: CF_ENHMETAFILE) equals: WinClipboardEnhancedMetafileFormat 19 | ] 20 | 21 | { #category : 'tests' } 22 | WinClipboardEnhancedMetafileFormatTest >> testFormatID [ 23 | 24 | self assert: WinClipboardEnhancedMetafileFormat formatID equals: CF_ENHMETAFILE. 25 | self assert: WinClipboardEnhancedMetafileFormat formatID equals: 14 26 | ] 27 | 28 | { #category : 'tests' } 29 | WinClipboardEnhancedMetafileFormatTest >> testGeneral [ 30 | 31 | self 32 | assert: WinClipboardEnhancedMetafileFormat isStandardFormat; 33 | deny: WinClipboardEnhancedMetafileFormat isCustomFormat 34 | ] 35 | -------------------------------------------------------------------------------- /src/OS-Windows-Environment-Tests/WinClipboardEntryTest.class.st: -------------------------------------------------------------------------------- 1 | " 2 | A WinClipboardEntryTest is a test class for testing the behavior of WinClipboardEntry 3 | " 4 | Class { 5 | #name : 'WinClipboardEntryTest', 6 | #superclass : 'TestCase', 7 | #category : 'OS-Windows-Environment-Tests-Clipboard', 8 | #package : 'OS-Windows-Environment-Tests', 9 | #tag : 'Clipboard' 10 | } 11 | -------------------------------------------------------------------------------- /src/OS-Windows-Environment-Tests/WinClipboardFileDropFormatTest.class.st: -------------------------------------------------------------------------------- 1 | " 2 | A WinClipboardFileDropFormatTest is a test class for testing the behavior of WinClipboardFileDropFormat 3 | " 4 | Class { 5 | #name : 'WinClipboardFileDropFormatTest', 6 | #superclass : 'TestCase', 7 | #pools : [ 8 | 'WinUserConstants' 9 | ], 10 | #category : 'OS-Windows-Environment-Tests-Clipboard-Formats', 11 | #package : 'OS-Windows-Environment-Tests', 12 | #tag : 'Clipboard-Formats' 13 | } 14 | 15 | { #category : 'tests' } 16 | WinClipboardFileDropFormatTest >> testFormatFromID [ 17 | 18 | self assert: (WinClipboardFormat formatFromID: CF_HDROP) equals: WinClipboardFileDropFormat 19 | ] 20 | 21 | { #category : 'tests' } 22 | WinClipboardFileDropFormatTest >> testFormatID [ 23 | 24 | self assert: WinClipboardFileDropFormat formatID equals: CF_HDROP. 25 | self assert: WinClipboardFileDropFormat formatID equals: 15 26 | ] 27 | 28 | { #category : 'tests' } 29 | WinClipboardFileDropFormatTest >> testGeneral [ 30 | 31 | self 32 | assert: WinClipboardFileDropFormat isStandardFormat; 33 | deny: WinClipboardFileDropFormat isCustomFormat 34 | ] 35 | -------------------------------------------------------------------------------- /src/OS-Windows-Environment-Tests/WinClipboardFormatTest.class.st: -------------------------------------------------------------------------------- 1 | " 2 | A WinClipboardFormatTest is a test class for testing the behavior of WinClipboardFormat 3 | " 4 | Class { 5 | #name : 'WinClipboardFormatTest', 6 | #superclass : 'TestCase', 7 | #category : 'OS-Windows-Environment-Tests-Clipboard-Formats', 8 | #package : 'OS-Windows-Environment-Tests', 9 | #tag : 'Clipboard-Formats' 10 | } 11 | 12 | { #category : 'tests' } 13 | WinClipboardFormatTest >> testFormatSymbol [ 14 | 15 | | formats | 16 | formats := WinClipboardFormat allSubclasses reject: [ :each | each isAbstract ]. 17 | formats do: [ :each | self assert: each formatID isInteger ] 18 | ] 19 | 20 | { #category : 'tests' } 21 | WinClipboardFormatTest >> testIsAbstract [ 22 | 23 | self assert: WinClipboardFormat isAbstract 24 | ] 25 | 26 | { #category : 'tests' } 27 | WinClipboardFormatTest >> testIsNotCustomFormatByDefault [ 28 | 29 | self deny: WinClipboardFormat isCustomFormat 30 | ] 31 | 32 | { #category : 'tests' } 33 | WinClipboardFormatTest >> testIsStandardFormatByDefault [ 34 | 35 | self assert: WinClipboardFormat isStandardFormat 36 | ] 37 | -------------------------------------------------------------------------------- /src/OS-Windows-Environment-Tests/WinClipboardGDIObjectFirstFormatTest.class.st: -------------------------------------------------------------------------------- 1 | " 2 | A WinClipboardGDIObjectFirstFormatTest is a test class for testing the behavior of WinClipboardGDIObjectFirstFormat 3 | " 4 | Class { 5 | #name : 'WinClipboardGDIObjectFirstFormatTest', 6 | #superclass : 'TestCase', 7 | #pools : [ 8 | 'WinUserConstants' 9 | ], 10 | #category : 'OS-Windows-Environment-Tests-Clipboard-Formats', 11 | #package : 'OS-Windows-Environment-Tests', 12 | #tag : 'Clipboard-Formats' 13 | } 14 | 15 | { #category : 'tests' } 16 | WinClipboardGDIObjectFirstFormatTest >> testFormatFromID [ 17 | 18 | self assert: (WinClipboardFormat formatFromID: CF_GDIOBJFIRST) equals: WinClipboardGDIObjectFirstFormat 19 | ] 20 | 21 | { #category : 'tests' } 22 | WinClipboardGDIObjectFirstFormatTest >> testFormatID [ 23 | 24 | self assert: WinClipboardGDIObjectFirstFormat formatID equals: CF_GDIOBJFIRST. 25 | self assert: WinClipboardGDIObjectFirstFormat formatID equals: 16r0300 26 | ] 27 | 28 | { #category : 'tests' } 29 | WinClipboardGDIObjectFirstFormatTest >> testGeneral [ 30 | 31 | self 32 | assert: WinClipboardGDIObjectFirstFormat isStandardFormat; 33 | deny: WinClipboardGDIObjectFirstFormat isCustomFormat 34 | ] 35 | -------------------------------------------------------------------------------- /src/OS-Windows-Environment-Tests/WinClipboardGDIObjectLastFormatTest.class.st: -------------------------------------------------------------------------------- 1 | " 2 | A WinClipboardGDIObjectLastFormatTest is a test class for testing the behavior of WinClipboardGDIObjectLastFormat 3 | " 4 | Class { 5 | #name : 'WinClipboardGDIObjectLastFormatTest', 6 | #superclass : 'TestCase', 7 | #pools : [ 8 | 'WinUserConstants' 9 | ], 10 | #category : 'OS-Windows-Environment-Tests-Clipboard-Formats', 11 | #package : 'OS-Windows-Environment-Tests', 12 | #tag : 'Clipboard-Formats' 13 | } 14 | 15 | { #category : 'tests' } 16 | WinClipboardGDIObjectLastFormatTest >> testFormatFromID [ 17 | 18 | self assert: (WinClipboardFormat formatFromID: CF_GDIOBJLAST) equals: WinClipboardGDIObjectLastFormat 19 | ] 20 | 21 | { #category : 'tests' } 22 | WinClipboardGDIObjectLastFormatTest >> testFormatID [ 23 | 24 | self assert: WinClipboardGDIObjectLastFormat formatID equals: CF_GDIOBJLAST. 25 | self assert: WinClipboardGDIObjectLastFormat formatID equals: 16r03FF 26 | ] 27 | 28 | { #category : 'tests' } 29 | WinClipboardGDIObjectLastFormatTest >> testGeneral [ 30 | 31 | self 32 | assert: WinClipboardGDIObjectLastFormat isStandardFormat; 33 | deny: WinClipboardGDIObjectLastFormat isCustomFormat 34 | ] 35 | -------------------------------------------------------------------------------- /src/OS-Windows-Environment-Tests/WinClipboardLocaleFormatTest.class.st: -------------------------------------------------------------------------------- 1 | " 2 | A WinClipboardLocaleFormatTest is a test class for testing the behavior of WinClipboardLocaleFormat 3 | " 4 | Class { 5 | #name : 'WinClipboardLocaleFormatTest', 6 | #superclass : 'TestCase', 7 | #pools : [ 8 | 'WinUserConstants' 9 | ], 10 | #category : 'OS-Windows-Environment-Tests-Clipboard-Formats', 11 | #package : 'OS-Windows-Environment-Tests', 12 | #tag : 'Clipboard-Formats' 13 | } 14 | 15 | { #category : 'tests' } 16 | WinClipboardLocaleFormatTest >> testFormatFromID [ 17 | 18 | self assert: (WinClipboardFormat formatFromID: CF_LOCALE) equals: WinClipboardLocaleFormat 19 | ] 20 | 21 | { #category : 'tests' } 22 | WinClipboardLocaleFormatTest >> testFormatID [ 23 | 24 | self assert: WinClipboardLocaleFormat formatID equals: CF_LOCALE. 25 | self assert: WinClipboardLocaleFormat formatID equals: 16 26 | ] 27 | 28 | { #category : 'tests' } 29 | WinClipboardLocaleFormatTest >> testGeneral [ 30 | 31 | self 32 | assert: WinClipboardLocaleFormat isStandardFormat; 33 | deny: WinClipboardLocaleFormat isCustomFormat 34 | ] 35 | -------------------------------------------------------------------------------- /src/OS-Windows-Environment-Tests/WinClipboardMetafilePictureFormatTest.class.st: -------------------------------------------------------------------------------- 1 | " 2 | A WinClipboardMetafilePictureFormatTest is a test class for testing the behavior of WinClipboardMetafilePictureFormat 3 | " 4 | Class { 5 | #name : 'WinClipboardMetafilePictureFormatTest', 6 | #superclass : 'TestCase', 7 | #pools : [ 8 | 'WinUserConstants' 9 | ], 10 | #category : 'OS-Windows-Environment-Tests-Clipboard-Formats', 11 | #package : 'OS-Windows-Environment-Tests', 12 | #tag : 'Clipboard-Formats' 13 | } 14 | 15 | { #category : 'tests' } 16 | WinClipboardMetafilePictureFormatTest >> testFormatFromID [ 17 | 18 | self assert: (WinClipboardFormat formatFromID: CF_METAFILEPICT) equals: WinClipboardMetafilePictureFormat 19 | ] 20 | 21 | { #category : 'tests' } 22 | WinClipboardMetafilePictureFormatTest >> testFormatID [ 23 | 24 | self assert: WinClipboardMetafilePictureFormat formatID equals: CF_METAFILEPICT. 25 | self assert: WinClipboardMetafilePictureFormat formatID equals: 3 26 | ] 27 | 28 | { #category : 'tests' } 29 | WinClipboardMetafilePictureFormatTest >> testGeneral [ 30 | 31 | self 32 | assert: WinClipboardMetafilePictureFormat isStandardFormat; 33 | deny: WinClipboardMetafilePictureFormat isCustomFormat 34 | ] 35 | -------------------------------------------------------------------------------- /src/OS-Windows-Environment-Tests/WinClipboardOEMTextFormatTest.class.st: -------------------------------------------------------------------------------- 1 | " 2 | A WinClipboardOEMTextFormatTest is a test class for testing the behavior of WinClipboardOEMTextFormat 3 | " 4 | Class { 5 | #name : 'WinClipboardOEMTextFormatTest', 6 | #superclass : 'TestCase', 7 | #pools : [ 8 | 'WinUserConstants' 9 | ], 10 | #category : 'OS-Windows-Environment-Tests-Clipboard-Formats', 11 | #package : 'OS-Windows-Environment-Tests', 12 | #tag : 'Clipboard-Formats' 13 | } 14 | 15 | { #category : 'tests' } 16 | WinClipboardOEMTextFormatTest >> testFormatFromID [ 17 | 18 | self assert: (WinClipboardFormat formatFromID: CF_OEMTEXT) equals: WinClipboardOEMTextFormat 19 | ] 20 | 21 | { #category : 'tests' } 22 | WinClipboardOEMTextFormatTest >> testFormatID [ 23 | 24 | self assert: WinClipboardOEMTextFormat formatID equals: CF_OEMTEXT. 25 | self assert: WinClipboardOEMTextFormat formatID equals: 7 26 | ] 27 | 28 | { #category : 'tests' } 29 | WinClipboardOEMTextFormatTest >> testGeneral [ 30 | 31 | self 32 | assert: WinClipboardOEMTextFormat isStandardFormat; 33 | deny: WinClipboardOEMTextFormat isCustomFormat 34 | ] 35 | -------------------------------------------------------------------------------- /src/OS-Windows-Environment-Tests/WinClipboardOwnerDisplayFormatTest.class.st: -------------------------------------------------------------------------------- 1 | " 2 | A WinClipboardOwnerDisplayFormatTest is a test class for testing the behavior of WinClipboardOwnerDisplayFormat 3 | " 4 | Class { 5 | #name : 'WinClipboardOwnerDisplayFormatTest', 6 | #superclass : 'TestCase', 7 | #pools : [ 8 | 'WinUserConstants' 9 | ], 10 | #category : 'OS-Windows-Environment-Tests-Clipboard-Formats', 11 | #package : 'OS-Windows-Environment-Tests', 12 | #tag : 'Clipboard-Formats' 13 | } 14 | 15 | { #category : 'tests' } 16 | WinClipboardOwnerDisplayFormatTest >> testFormatFromID [ 17 | 18 | self assert: (WinClipboardFormat formatFromID: CF_OWNERDISPLAY) equals: WinClipboardOwnerDisplayFormat 19 | ] 20 | 21 | { #category : 'tests' } 22 | WinClipboardOwnerDisplayFormatTest >> testFormatID [ 23 | 24 | self assert: WinClipboardOwnerDisplayFormat formatID equals: CF_OWNERDISPLAY. 25 | self assert: WinClipboardOwnerDisplayFormat formatID equals: 16r0080 26 | ] 27 | 28 | { #category : 'tests' } 29 | WinClipboardOwnerDisplayFormatTest >> testGeneral [ 30 | 31 | self 32 | assert: WinClipboardOwnerDisplayFormat isStandardFormat; 33 | deny: WinClipboardOwnerDisplayFormat isCustomFormat 34 | ] 35 | -------------------------------------------------------------------------------- /src/OS-Windows-Environment-Tests/WinClipboardPenDataFormatTest.class.st: -------------------------------------------------------------------------------- 1 | " 2 | A WinClipboardPenDataFormatTest is a test class for testing the behavior of WinClipboardPenDataFormat 3 | " 4 | Class { 5 | #name : 'WinClipboardPenDataFormatTest', 6 | #superclass : 'TestCase', 7 | #pools : [ 8 | 'WinUserConstants' 9 | ], 10 | #category : 'OS-Windows-Environment-Tests-Clipboard-Formats', 11 | #package : 'OS-Windows-Environment-Tests', 12 | #tag : 'Clipboard-Formats' 13 | } 14 | 15 | { #category : 'tests' } 16 | WinClipboardPenDataFormatTest >> testFormatFromID [ 17 | 18 | self assert: (WinClipboardFormat formatFromID: CF_PENDATA) equals: WinClipboardPenDataFormat 19 | ] 20 | 21 | { #category : 'tests' } 22 | WinClipboardPenDataFormatTest >> testFormatID [ 23 | 24 | self assert: WinClipboardPenDataFormat formatID equals: CF_PENDATA. 25 | self assert: WinClipboardPenDataFormat formatID equals: 10 26 | ] 27 | 28 | { #category : 'tests' } 29 | WinClipboardPenDataFormatTest >> testGeneral [ 30 | 31 | self 32 | assert: WinClipboardPenDataFormat isStandardFormat; 33 | deny: WinClipboardPenDataFormat isCustomFormat 34 | ] 35 | -------------------------------------------------------------------------------- /src/OS-Windows-Environment-Tests/WinClipboardPrivateFirstFormatTest.class.st: -------------------------------------------------------------------------------- 1 | " 2 | A WinClipboardPrivateFirstFormatTest is a test class for testing the behavior of WinClipboardPrivateFirstFormat 3 | " 4 | Class { 5 | #name : 'WinClipboardPrivateFirstFormatTest', 6 | #superclass : 'TestCase', 7 | #pools : [ 8 | 'WinUserConstants' 9 | ], 10 | #category : 'OS-Windows-Environment-Tests-Clipboard-Formats', 11 | #package : 'OS-Windows-Environment-Tests', 12 | #tag : 'Clipboard-Formats' 13 | } 14 | 15 | { #category : 'tests' } 16 | WinClipboardPrivateFirstFormatTest >> testFormatFromID [ 17 | 18 | self assert: (WinClipboardFormat formatFromID: CF_PRIVATEFIRST) equals: WinClipboardPrivateFirstFormat 19 | ] 20 | 21 | { #category : 'tests' } 22 | WinClipboardPrivateFirstFormatTest >> testFormatID [ 23 | 24 | self assert: WinClipboardPrivateFirstFormat formatID equals: CF_PRIVATEFIRST. 25 | self assert: WinClipboardPrivateFirstFormat formatID equals: 16r0200 26 | ] 27 | 28 | { #category : 'tests' } 29 | WinClipboardPrivateFirstFormatTest >> testGeneral [ 30 | 31 | self 32 | assert: WinClipboardPrivateFirstFormat isStandardFormat; 33 | deny: WinClipboardPrivateFirstFormat isCustomFormat 34 | ] 35 | -------------------------------------------------------------------------------- /src/OS-Windows-Environment-Tests/WinClipboardPrivateLastFormatTest.class.st: -------------------------------------------------------------------------------- 1 | " 2 | A WinClipboardPrivateLastFormatTest is a test class for testing the behavior of WinClipboardPrivateLastFormat 3 | " 4 | Class { 5 | #name : 'WinClipboardPrivateLastFormatTest', 6 | #superclass : 'TestCase', 7 | #pools : [ 8 | 'WinUserConstants' 9 | ], 10 | #category : 'OS-Windows-Environment-Tests-Clipboard-Formats', 11 | #package : 'OS-Windows-Environment-Tests', 12 | #tag : 'Clipboard-Formats' 13 | } 14 | 15 | { #category : 'tests' } 16 | WinClipboardPrivateLastFormatTest >> testFormatFromID [ 17 | 18 | self assert: (WinClipboardFormat formatFromID: CF_PRIVATELAST) equals: WinClipboardPrivateLastFormat 19 | ] 20 | 21 | { #category : 'tests' } 22 | WinClipboardPrivateLastFormatTest >> testFormatID [ 23 | 24 | self assert: WinClipboardPrivateLastFormat formatID equals: CF_PRIVATELAST. 25 | self assert: WinClipboardPrivateLastFormat formatID equals: 16r02FF 26 | ] 27 | 28 | { #category : 'tests' } 29 | WinClipboardPrivateLastFormatTest >> testGeneral [ 30 | 31 | self 32 | assert: WinClipboardPrivateLastFormat isStandardFormat; 33 | deny: WinClipboardPrivateLastFormat isCustomFormat 34 | ] 35 | -------------------------------------------------------------------------------- /src/OS-Windows-Environment-Tests/WinClipboardRIFFFormatTest.class.st: -------------------------------------------------------------------------------- 1 | " 2 | A WinClipboardRIFFFormatTest is a test class for testing the behavior of WinClipboardRIFFFormat 3 | " 4 | Class { 5 | #name : 'WinClipboardRIFFFormatTest', 6 | #superclass : 'TestCase', 7 | #pools : [ 8 | 'WinUserConstants' 9 | ], 10 | #category : 'OS-Windows-Environment-Tests-Clipboard-Formats', 11 | #package : 'OS-Windows-Environment-Tests', 12 | #tag : 'Clipboard-Formats' 13 | } 14 | 15 | { #category : 'tests' } 16 | WinClipboardRIFFFormatTest >> testFormatFromID [ 17 | 18 | self assert: (WinClipboardFormat formatFromID: CF_RIFF) equals: WinClipboardRIFFFormat 19 | ] 20 | 21 | { #category : 'tests' } 22 | WinClipboardRIFFFormatTest >> testFormatID [ 23 | 24 | self assert: WinClipboardRIFFFormat formatID equals: CF_RIFF. 25 | self assert: WinClipboardRIFFFormat formatID equals: 11 26 | ] 27 | 28 | { #category : 'tests' } 29 | WinClipboardRIFFFormatTest >> testGeneral [ 30 | 31 | self 32 | assert: WinClipboardRIFFFormat isStandardFormat; 33 | deny: WinClipboardRIFFFormat isCustomFormat 34 | ] 35 | -------------------------------------------------------------------------------- /src/OS-Windows-Environment-Tests/WinClipboardSYLKFormatTest.class.st: -------------------------------------------------------------------------------- 1 | " 2 | A WinClipboardSYLKFormatTest is a test class for testing the behavior of WinClipboardSYLKFormat 3 | " 4 | Class { 5 | #name : 'WinClipboardSYLKFormatTest', 6 | #superclass : 'TestCase', 7 | #pools : [ 8 | 'WinUserConstants' 9 | ], 10 | #category : 'OS-Windows-Environment-Tests-Clipboard-Formats', 11 | #package : 'OS-Windows-Environment-Tests', 12 | #tag : 'Clipboard-Formats' 13 | } 14 | 15 | { #category : 'tests' } 16 | WinClipboardSYLKFormatTest >> testFormatFromID [ 17 | 18 | self assert: (WinClipboardFormat formatFromID: CF_SYLK) equals: WinClipboardSYLKFormat 19 | ] 20 | 21 | { #category : 'tests' } 22 | WinClipboardSYLKFormatTest >> testFormatID [ 23 | 24 | self assert: WinClipboardSYLKFormat formatID equals: CF_SYLK. 25 | self assert: WinClipboardSYLKFormat formatID equals: 4 26 | ] 27 | 28 | { #category : 'tests' } 29 | WinClipboardSYLKFormatTest >> testGeneral [ 30 | 31 | self 32 | assert: WinClipboardSYLKFormat isStandardFormat; 33 | deny: WinClipboardSYLKFormat isCustomFormat 34 | ] 35 | -------------------------------------------------------------------------------- /src/OS-Windows-Environment-Tests/WinClipboardTIFFFormatTest.class.st: -------------------------------------------------------------------------------- 1 | " 2 | A WinClipboardTIFFFormatTest is a test class for testing the behavior of WinClipboardTIFFFormat 3 | " 4 | Class { 5 | #name : 'WinClipboardTIFFFormatTest', 6 | #superclass : 'TestCase', 7 | #pools : [ 8 | 'WinUserConstants' 9 | ], 10 | #category : 'OS-Windows-Environment-Tests-Clipboard-Formats', 11 | #package : 'OS-Windows-Environment-Tests', 12 | #tag : 'Clipboard-Formats' 13 | } 14 | 15 | { #category : 'tests' } 16 | WinClipboardTIFFFormatTest >> testFormatFromID [ 17 | 18 | self assert: (WinClipboardFormat formatFromID: CF_TIFF) equals: WinClipboardTIFFFormat 19 | ] 20 | 21 | { #category : 'tests' } 22 | WinClipboardTIFFFormatTest >> testFormatID [ 23 | 24 | self assert: WinClipboardTIFFFormat formatID equals: CF_TIFF. 25 | self assert: WinClipboardTIFFFormat formatID equals: 6 26 | ] 27 | 28 | { #category : 'tests' } 29 | WinClipboardTIFFFormatTest >> testGeneral [ 30 | 31 | self 32 | assert: WinClipboardTIFFFormat isStandardFormat; 33 | deny: WinClipboardTIFFFormat isCustomFormat 34 | ] 35 | -------------------------------------------------------------------------------- /src/OS-Windows-Environment-Tests/WinClipboardTextFormatTest.class.st: -------------------------------------------------------------------------------- 1 | " 2 | A WinClipboardTextFormatTest is a test class for testing the behavior of WinClipboardTextFormat 3 | " 4 | Class { 5 | #name : 'WinClipboardTextFormatTest', 6 | #superclass : 'TestCase', 7 | #pools : [ 8 | 'WinUserConstants' 9 | ], 10 | #category : 'OS-Windows-Environment-Tests-Clipboard-Formats', 11 | #package : 'OS-Windows-Environment-Tests', 12 | #tag : 'Clipboard-Formats' 13 | } 14 | 15 | { #category : 'tests' } 16 | WinClipboardTextFormatTest >> testFormatFromID [ 17 | 18 | self assert: (WinClipboardFormat formatFromID: CF_TEXT) equals: WinClipboardTextFormat 19 | ] 20 | 21 | { #category : 'tests' } 22 | WinClipboardTextFormatTest >> testFormatID [ 23 | 24 | self assert: WinClipboardTextFormat formatID equals: CF_TEXT. 25 | self assert: WinClipboardTextFormat formatID equals: 1 26 | ] 27 | 28 | { #category : 'tests' } 29 | WinClipboardTextFormatTest >> testGeneral [ 30 | 31 | self 32 | assert: WinClipboardTextFormat isStandardFormat; 33 | deny: WinClipboardTextFormat isCustomFormat 34 | ] 35 | -------------------------------------------------------------------------------- /src/OS-Windows-Environment-Tests/WinClipboardUnicodeTextFormatTest.class.st: -------------------------------------------------------------------------------- 1 | " 2 | A WinClipboardUnicodeTextFormatTest is a test class for testing the behavior of WinClipboardUnicodeTextFormat 3 | " 4 | Class { 5 | #name : 'WinClipboardUnicodeTextFormatTest', 6 | #superclass : 'TestCase', 7 | #pools : [ 8 | 'WinUserConstants' 9 | ], 10 | #category : 'OS-Windows-Environment-Tests-Clipboard-Formats', 11 | #package : 'OS-Windows-Environment-Tests', 12 | #tag : 'Clipboard-Formats' 13 | } 14 | 15 | { #category : 'tests' } 16 | WinClipboardUnicodeTextFormatTest >> testFormatFromID [ 17 | 18 | self assert: (WinClipboardFormat formatFromID: CF_UNICODETEXT) equals: WinClipboardUnicodeTextFormat 19 | ] 20 | 21 | { #category : 'tests' } 22 | WinClipboardUnicodeTextFormatTest >> testFormatID [ 23 | 24 | self assert: WinClipboardUnicodeTextFormat formatID equals: CF_UNICODETEXT. 25 | self assert: WinClipboardUnicodeTextFormat formatID equals: 13 26 | ] 27 | 28 | { #category : 'tests' } 29 | WinClipboardUnicodeTextFormatTest >> testGeneral [ 30 | 31 | self 32 | assert: WinClipboardUnicodeTextFormat isStandardFormat; 33 | deny: WinClipboardUnicodeTextFormat isCustomFormat 34 | ] 35 | -------------------------------------------------------------------------------- /src/OS-Windows-Environment-Tests/WinClipboardWaveFormatTest.class.st: -------------------------------------------------------------------------------- 1 | " 2 | A WinClipboardWaveFormatTest is a test class for testing the behavior of WinClipboardWaveFormat 3 | " 4 | Class { 5 | #name : 'WinClipboardWaveFormatTest', 6 | #superclass : 'TestCase', 7 | #pools : [ 8 | 'WinUserConstants' 9 | ], 10 | #category : 'OS-Windows-Environment-Tests-Clipboard-Formats', 11 | #package : 'OS-Windows-Environment-Tests', 12 | #tag : 'Clipboard-Formats' 13 | } 14 | 15 | { #category : 'tests' } 16 | WinClipboardWaveFormatTest >> testFormatFromID [ 17 | 18 | self assert: (WinClipboardFormat formatFromID: CF_WAVE) equals: WinClipboardWaveFormat 19 | ] 20 | 21 | { #category : 'tests' } 22 | WinClipboardWaveFormatTest >> testFormatID [ 23 | 24 | self assert: WinClipboardWaveFormat formatID equals: CF_WAVE. 25 | self assert: WinClipboardWaveFormat formatID equals: 12 26 | ] 27 | 28 | { #category : 'tests' } 29 | WinClipboardWaveFormatTest >> testGeneral [ 30 | 31 | self 32 | assert: WinClipboardWaveFormat isStandardFormat; 33 | deny: WinClipboardWaveFormat isCustomFormat 34 | ] 35 | -------------------------------------------------------------------------------- /src/OS-Windows-Environment-Tests/WinConsoleTest.class.st: -------------------------------------------------------------------------------- 1 | " 2 | SUnit tests for WinConsole 3 | " 4 | Class { 5 | #name : 'WinConsoleTest', 6 | #superclass : 'WindowsSpecificTest', 7 | #instVars : [ 8 | 'stdoutConsole' 9 | ], 10 | #pools : [ 11 | 'WinBaseConstants' 12 | ], 13 | #category : 'OS-Windows-Environment-Tests-Console', 14 | #package : 'OS-Windows-Environment-Tests', 15 | #tag : 'Console' 16 | } 17 | 18 | { #category : 'accessing' } 19 | WinConsoleTest >> defaultTestClass [ 20 | 21 | ^WinConsole 22 | ] 23 | 24 | { #category : 'running' } 25 | WinConsoleTest >> setUp [ 26 | 27 | super setUp. 28 | stdoutConsole := self defaultTestClass createOutputConsoleForCurrentProcess 29 | ] 30 | 31 | { #category : 'running' } 32 | WinConsoleTest >> tearDown [ 33 | 34 | stdoutConsole := nil. 35 | self defaultTestClass reset. 36 | super tearDown. 37 | "Give windows enough time to close the window - otherwise it will affect other tests (like WinWindowsTest)" 38 | (Delay forMilliseconds: 10) wait 39 | ] 40 | 41 | { #category : 'tests' } 42 | WinConsoleTest >> testConsoleSize [ 43 | 44 | self assert: stdoutConsole screenBuffer size species = Point 45 | ] 46 | 47 | { #category : 'tests' } 48 | WinConsoleTest >> testCursorHasSize [ 49 | 50 | self assert: stdoutConsole cursor size isInteger 51 | ] 52 | 53 | { #category : 'tests' } 54 | WinConsoleTest >> testCursorIsVisibleByDefault [ 55 | 56 | self assert: stdoutConsole cursor isVisible 57 | ] 58 | 59 | { #category : 'tests' } 60 | WinConsoleTest >> testCursorSettingSize [ 61 | 62 | |size| 63 | size := 100. 64 | stdoutConsole cursorSize: size. 65 | self assert: stdoutConsole cursor size equals: size 66 | ] 67 | 68 | { #category : 'tests' } 69 | WinConsoleTest >> testFontSize [ 70 | 71 | self assert: stdoutConsole font fontSize isPoint 72 | ] 73 | 74 | { #category : 'tests' } 75 | WinConsoleTest >> testIsConsoleType [ 76 | 77 | | fileType | 78 | fileType := WinConsole getFileType: 79 | (WinHandle fromExternalHandle: stdoutConsole getHandle). 80 | self assert: fileType = FILE_TYPE_CHAR "The specified file is a character file, typically an LPT device or a console." 81 | ] 82 | -------------------------------------------------------------------------------- /src/OS-Windows-Environment-Tests/WinCustomClipboardFormatTest.class.st: -------------------------------------------------------------------------------- 1 | " 2 | A WinCustomClipboardFormatTest is a test class for testing the behavior of WinCustomClipboardFormat 3 | " 4 | Class { 5 | #name : 'WinCustomClipboardFormatTest', 6 | #superclass : 'TestCase', 7 | #category : 'OS-Windows-Environment-Tests-Clipboard-Formats', 8 | #package : 'OS-Windows-Environment-Tests', 9 | #tag : 'Clipboard-Formats' 10 | } 11 | 12 | { #category : 'tests' } 13 | WinCustomClipboardFormatTest >> testIsAbstract [ 14 | 15 | self assert: WinCustomClipboardFormat isAbstract 16 | ] 17 | 18 | { #category : 'tests' } 19 | WinCustomClipboardFormatTest >> testIsCustomFormatByDefault [ 20 | 21 | self assert: WinCustomClipboardFormat isCustomFormat 22 | ] 23 | 24 | { #category : 'tests' } 25 | WinCustomClipboardFormatTest >> testIsNotStandardFormatByDefault [ 26 | 27 | self deny: WinCustomClipboardFormat isStandardFormat 28 | ] 29 | -------------------------------------------------------------------------------- /src/OS-Windows-Environment-Tests/WinEnvironmentTest.class.st: -------------------------------------------------------------------------------- 1 | " 2 | SUnit tests for WinEnvironment 3 | " 4 | Class { 5 | #name : 'WinEnvironmentTest', 6 | #superclass : 'WindowsSpecificTest', 7 | #category : 'OS-Windows-Environment-Tests-Environment', 8 | #package : 'OS-Windows-Environment-Tests', 9 | #tag : 'Environment' 10 | } 11 | 12 | { #category : 'tests' } 13 | WinEnvironmentTest >> testComputerName [ 14 | 15 | self assert: WinEnvironment getComputerName notEmpty 16 | ] 17 | 18 | { #category : 'tests' } 19 | WinEnvironmentTest >> testGetHomeDrive [ 20 | "Usually the home drive is C:" 21 | 22 | self assert: WinEnvironment getHomeDrive = 'C:' 23 | ] 24 | 25 | { #category : 'tests' } 26 | WinEnvironmentTest >> testGetSystemDrive [ 27 | "Usually the system drive where Windows is installed is C:" 28 | 29 | self assert: WinEnvironment getSystemDrive = 'C:' 30 | ] 31 | 32 | { #category : 'tests' } 33 | WinEnvironmentTest >> testNumberOfProcessors [ 34 | 35 | self assert: WinEnvironment getNumberOfProcessors asInteger > 0 36 | ] 37 | 38 | { #category : 'tests' } 39 | WinEnvironmentTest >> testPathEntries [ 40 | 41 | self assert: WinEnvironment getPathEntries isCollection 42 | ] 43 | 44 | { #category : 'tests' } 45 | WinEnvironmentTest >> testUptime [ 46 | 47 | self assert: WinEnvironment getComputerUptime > 0 seconds 48 | ] 49 | 50 | { #category : 'tests' } 51 | WinEnvironmentTest >> testUserName [ 52 | 53 | self assert: WinEnvironment getUserName notEmpty 54 | ] 55 | -------------------------------------------------------------------------------- /src/OS-Windows-Environment-Tests/WinLibraryTest.class.st: -------------------------------------------------------------------------------- 1 | " 2 | A WinLibraryTest is a test class for testing the behavior of WinLibrary 3 | " 4 | Class { 5 | #name : 'WinLibraryTest', 6 | #superclass : 'TestCase', 7 | #category : 'OS-Windows-Environment-Tests-Processing', 8 | #package : 'OS-Windows-Environment-Tests', 9 | #tag : 'Processing' 10 | } 11 | 12 | { #category : 'running' } 13 | WinLibraryTest >> testLoadLibrary [ 14 | 15 | | lib | 16 | lib := WinLibrary fromLibraryClass: TFTestLibraryUsingSameThreadRunner. 17 | self assert: lib getHandle isNull not 18 | ] 19 | 20 | { #category : 'running' } 21 | WinLibraryTest >> testReloadLibrary [ 22 | "reload the lib test" 23 | 24 | | lib calls | 25 | lib := WinLibrary fromLibraryClass: TFTestLibraryUsingSameThreadRunner. 26 | self assert: lib getHandle isNull not. 27 | lib reloadLibrary. 28 | calls := lib findCalls asArray. 29 | calls do: [ :c | 30 | self 31 | assert: (c methodClass lookupSelector: c selector) sourceCode 32 | equals: (c propertyAt: #ffiNonCompiledMethod) sourceCode ] 33 | ] 34 | 35 | { #category : 'running' } 36 | WinLibraryTest >> testUnLoadLibrary [ 37 | 38 | | lib | 39 | lib := WinLibrary fromLibraryClass: 40 | TFTestLibraryUsingSameThreadRunner. 41 | self assert: lib getHandle isNull not. 42 | lib freeLibrary. 43 | self assert: lib getHandle isNull. 44 | lib loadLibrary 45 | ] 46 | -------------------------------------------------------------------------------- /src/OS-Windows-Environment-Tests/WinProcessTest.class.st: -------------------------------------------------------------------------------- 1 | " 2 | Tests for the native windows OS process wrappers. 3 | 4 | Instance Variables 5 | vmProcess: 6 | 7 | vmProcess 8 | - the native VM OS process of the windows virtual machine 9 | 10 | " 11 | Class { 12 | #name : 'WinProcessTest', 13 | #superclass : 'WindowsSpecificTest', 14 | #instVars : [ 15 | 'vmProcess' 16 | ], 17 | #pools : [ 18 | 'WinBaseConstants' 19 | ], 20 | #category : 'OS-Windows-Environment-Tests-Processing', 21 | #package : 'OS-Windows-Environment-Tests', 22 | #tag : 'Processing' 23 | } 24 | 25 | { #category : 'accessing' } 26 | WinProcessTest >> defaultTestClass [ 27 | 28 | ^WinProcess 29 | ] 30 | 31 | { #category : 'running' } 32 | WinProcessTest >> setUp [ 33 | 34 | super setUp. 35 | vmProcess := self defaultTestClass currentProcess 36 | ] 37 | 38 | { #category : 'running' } 39 | WinProcessTest >> tearDown [ 40 | 41 | vmProcess := nil. 42 | super tearDown 43 | ] 44 | 45 | { #category : 'tests' } 46 | WinProcessTest >> testAllProcessIdentifiers [ 47 | 48 | self 49 | assert: self defaultTestClass allProcessIdentifiers notEmpty; 50 | assert: (self defaultTestClass allProcessIdentifiers includes: self defaultTestClass currentProcessId) 51 | ] 52 | 53 | { #category : 'tests' } 54 | WinProcessTest >> testCurrentProcess [ 55 | 56 | self assert: self defaultTestClass currentProcess getHandle value > 0 57 | ] 58 | 59 | { #category : 'tests' } 60 | WinProcessTest >> testCurrentProcessExitCodeWhileRunning [ 61 | 62 | self assert: WinProcess currentProcess getExitCode equals: STILL_ACTIVE 63 | ] 64 | 65 | { #category : 'tests' } 66 | WinProcessTest >> testCurrentProcessId [ 67 | 68 | self assert: self defaultTestClass currentProcessId > 0 69 | ] 70 | 71 | { #category : 'tests' } 72 | WinProcessTest >> testCurrentProcessIsRunning [ 73 | 74 | self assert: WinProcess currentProcess isRunning 75 | ] 76 | 77 | { #category : 'tests' } 78 | WinProcessTest >> testGetVMModuleHandle [ 79 | 80 | | handle | 81 | handle := WinProcess getVMModuleHandle. 82 | self 83 | assert: handle notNil; 84 | assert: handle getHandle value > 0 85 | ] 86 | 87 | { #category : 'tests' } 88 | WinProcessTest >> testIsNotRunningUnderWOW64 [ 89 | "Pharo is running with a 64bit VM (so it is not running as a 32 bit app under 90 | WOW64 on 64 bit systems anymore). We assume running on a 64 bit machine here" 91 | 92 | self deny: WinProcess currentProcess isWow64Process 93 | ] 94 | 95 | { #category : 'tests' } 96 | WinProcessTest >> testPriorityClasses [ 97 | 98 | self assert: self defaultTestClass currentProcess getPriorityClass isInteger 99 | ] 100 | 101 | { #category : 'tests' } 102 | WinProcessTest >> testStartAndTerminateCommandShell [ 103 | 104 | |processInfo process | 105 | processInfo := self defaultTestClass createProcess: 'cmd.exe'. 106 | process := processInfo process. 107 | self assert: process notNil. 108 | processInfo process terminateProcessWithExitCode: 0 109 | ] 110 | 111 | { #category : 'tests' } 112 | WinProcessTest >> testStartedFromShortcut [ 113 | 114 | self assert: (self defaultTestClass startupInfo wasStartedFromAShortcut isKindOf: Boolean) 115 | ] 116 | 117 | { #category : 'tests' } 118 | WinProcessTest >> testStartupInfo [ 119 | 120 | self assert: (self defaultTestClass startupInfo) notNil 121 | ] 122 | -------------------------------------------------------------------------------- /src/OS-Windows-Environment-Tests/WinProxyTest.class.st: -------------------------------------------------------------------------------- 1 | " 2 | Test for WinProxy 3 | " 4 | Class { 5 | #name : 'WinProxyTest', 6 | #superclass : 'WindowsSpecificTest', 7 | #category : 'OS-Windows-Environment-Tests-Network', 8 | #package : 'OS-Windows-Environment-Tests', 9 | #tag : 'Network' 10 | } 11 | 12 | { #category : 'tests' } 13 | WinProxyTest >> testIsEnabled [ 14 | 15 | self assert: (WinProxy isEnabled isKindOf: Boolean) 16 | ] 17 | 18 | { #category : 'tests' } 19 | WinProxyTest >> testServerAddressWhenEnabled [ 20 | 21 | WinProxy isEnabled ifFalse: [ ^self ]. 22 | 23 | self assert: (WinProxy address substrings: '.') size = 4 "Regular IP address" 24 | ] 25 | 26 | { #category : 'tests' } 27 | WinProxyTest >> testServerPortWhenEnabled [ 28 | 29 | WinProxy isEnabled ifFalse: [ ^self ]. 30 | 31 | self assert: WinProxy port asNumber > 0 32 | ] 33 | -------------------------------------------------------------------------------- /src/OS-Windows-Environment-Tests/WinStandardClipboardFormatTest.class.st: -------------------------------------------------------------------------------- 1 | " 2 | A WinStandardClipboardFormatTest is a test class for testing the behavior of WinStandardClipboardFormat 3 | " 4 | Class { 5 | #name : 'WinStandardClipboardFormatTest', 6 | #superclass : 'TestCase', 7 | #category : 'OS-Windows-Environment-Tests-Clipboard-Formats', 8 | #package : 'OS-Windows-Environment-Tests', 9 | #tag : 'Clipboard-Formats' 10 | } 11 | 12 | { #category : 'accessing' } 13 | WinStandardClipboardFormatTest >> standardClipboardFormats [ 14 | 15 | ^ #( CF_BITMAP 16 | CF_DIB 17 | CF_DIBV5 18 | CF_DIF 19 | CF_DSPBITMAP 20 | CF_DSPENHMETAFILE 21 | CF_DSPMETAFILEPICT 22 | CF_DSPTEXT 23 | CF_ENHMETAFILE 24 | CF_GDIOBJFIRST 25 | CF_GDIOBJLAST 26 | CF_HDROP 27 | CF_LOCALE 28 | CF_METAFILEPICT 29 | CF_OEMTEXT 30 | CF_OWNERDISPLAY 31 | CF_PALETTE 32 | CF_PENDATA 33 | CF_PRIVATEFIRST 34 | CF_PRIVATELAST 35 | CF_RIFF 36 | CF_SYLK 37 | CF_TEXT 38 | CF_TIFF 39 | CF_UNICODETEXT 40 | CF_WAVE) 41 | ] 42 | 43 | { #category : 'tests' } 44 | WinStandardClipboardFormatTest >> testIsAbstract [ 45 | 46 | self assert: WinStandardClipboardFormat isAbstract 47 | ] 48 | 49 | { #category : 'tests' } 50 | WinStandardClipboardFormatTest >> testIsNotCustomFormatByDefault [ 51 | 52 | self deny: WinStandardClipboardFormat isCustomFormat 53 | ] 54 | 55 | { #category : 'tests' } 56 | WinStandardClipboardFormatTest >> testIsStandardFormatByDefault [ 57 | 58 | self assert: WinStandardClipboardFormat isStandardFormat 59 | ] 60 | 61 | { #category : 'tests' } 62 | WinStandardClipboardFormatTest >> testStandardClipboardFormats [ 63 | 64 | WinStandardClipboardFormat allSubInstancesDo: [:each | 65 | self assert: (self standardClipboardFormats includes: each formatSymbol) ] 66 | ] 67 | -------------------------------------------------------------------------------- /src/OS-Windows-Environment-Tests/WinThreadTest.class.st: -------------------------------------------------------------------------------- 1 | " 2 | Tests for the native windows OS thread wrappers 3 | " 4 | Class { 5 | #name : 'WinThreadTest', 6 | #superclass : 'WindowsSpecificTest', 7 | #instVars : [ 8 | 'vmThread' 9 | ], 10 | #category : 'OS-Windows-Environment-Tests-Processing', 11 | #package : 'OS-Windows-Environment-Tests', 12 | #tag : 'Processing' 13 | } 14 | 15 | { #category : 'accessing' } 16 | WinThreadTest >> defaultTestClass [ 17 | 18 | ^WinThread 19 | ] 20 | 21 | { #category : 'running' } 22 | WinThreadTest >> setUp [ 23 | 24 | super setUp. 25 | vmThread := WinThread currentThread 26 | ] 27 | 28 | { #category : 'running' } 29 | WinThreadTest >> tearDown [ 30 | 31 | vmThread := nil. 32 | super tearDown 33 | ] 34 | 35 | { #category : 'tests' } 36 | WinThreadTest >> testCurrentThread [ 37 | 38 | self assert: self defaultTestClass currentThread getHandle value > 0 39 | ] 40 | 41 | { #category : 'tests' } 42 | WinThreadTest >> testCurrentThreadId [ 43 | 44 | self assert: self defaultTestClass currentThreadId > 0 45 | ] 46 | 47 | { #category : 'tests' } 48 | WinThreadTest >> testIsThreadAllAccess [ 49 | "by default the main thread of the VM is not all access" 50 | 51 | self deny: vmThread isThreadAllAccess 52 | ] 53 | -------------------------------------------------------------------------------- /src/OS-Windows-Environment-Tests/package.st: -------------------------------------------------------------------------------- 1 | Package { #name : 'OS-Windows-Environment-Tests' } 2 | -------------------------------------------------------------------------------- /src/OS-Windows-Environment/WinCaret.class.st: -------------------------------------------------------------------------------- 1 | " 2 | A caret is a blinking line, block, or bitmap in the client area of a window. The caret typically indicates the place at which text or graphics will be inserted. 3 | " 4 | Class { 5 | #name : 'WinCaret', 6 | #superclass : 'Object', 7 | #category : 'OS-Windows-Environment-Caret', 8 | #package : 'OS-Windows-Environment', 9 | #tag : 'Caret' 10 | } 11 | 12 | { #category : 'accessing' } 13 | WinCaret class >> blinkTime [ 14 | "Returns the elapsed time, in milliseconds, required to invert the caret's pixels. The user can set this value using the Control Panel." 15 | 16 | 17 | ^ self ffiCall: #( uint GetCaretBlinkTime()) module: #user32 18 | ] 19 | -------------------------------------------------------------------------------- /src/OS-Windows-Environment/WinClipboard.class.st: -------------------------------------------------------------------------------- 1 | " 2 | The native Windows clipboard 3 | " 4 | Class { 5 | #name : 'WinClipboard', 6 | #superclass : 'WinHandle', 7 | #pools : [ 8 | 'WinBaseConstants', 9 | 'WinTypes', 10 | 'WinUserConstants' 11 | ], 12 | #category : 'OS-Windows-Environment-Clipboard', 13 | #package : 'OS-Windows-Environment', 14 | #tag : 'Clipboard' 15 | } 16 | 17 | { #category : 'cleanup' } 18 | WinClipboard class >> cleanUp: anObject [ 19 | 20 | super cleanUp: anObject. 21 | self resetClipboard 22 | ] 23 | 24 | { #category : 'api - utils' } 25 | WinClipboard class >> clearClipboard [ 26 |