Win32OperatingSystem.st
changeset 9475 c57956a348bf
parent 9431 cae760dd7d80
child 9484 b9c80492105b
equal deleted inserted replaced
9474:953a82a3d033 9475:c57956a348bf
    18 	classVariableNames:'HostName DomainName CurrentDirectory'
    18 	classVariableNames:'HostName DomainName CurrentDirectory'
    19 	poolDictionaries:''
    19 	poolDictionaries:''
    20 	category:'OS-Windows'
    20 	category:'OS-Windows'
    21 !
    21 !
    22 
    22 
       
    23 ByteArray variableByteSubclass:#DevModeStructure
       
    24 	instanceVariableNames:''
       
    25 	classVariableNames:''
       
    26 	poolDictionaries:''
       
    27 	privateIn:Win32OperatingSystem
       
    28 !
       
    29 
       
    30 ByteArray variableByteSubclass:#DocInfoStructure
       
    31 	instanceVariableNames:''
       
    32 	classVariableNames:''
       
    33 	poolDictionaries:''
       
    34 	privateIn:Win32OperatingSystem
       
    35 !
       
    36 
    23 Object subclass:#FileStatusInfo
    37 Object subclass:#FileStatusInfo
    24 	instanceVariableNames:'type mode uid gid size id accessed modified created statusChanged
    38 	instanceVariableNames:'type mode uid gid size id accessed modified created statusChanged
    25 		path fullName alternativeName'
    39 		path fullName alternativeName'
    26 	classVariableNames:''
    40 	classVariableNames:''
    27 	poolDictionaries:''
    41 	poolDictionaries:''
    28 	privateIn:Win32OperatingSystem
    42 	privateIn:Win32OperatingSystem
    29 !
    43 !
    30 
    44 
    31 Object subclass:#OSProcessStatus
    45 Object subclass:#OSProcessStatus
    32 	instanceVariableNames:'pid status code core'
    46 	instanceVariableNames:'pid status code core'
       
    47 	classVariableNames:''
       
    48 	poolDictionaries:''
       
    49 	privateIn:Win32OperatingSystem
       
    50 !
       
    51 
       
    52 ByteArray variableByteSubclass:#PrinterInfo2Structure
       
    53 	instanceVariableNames:''
    33 	classVariableNames:''
    54 	classVariableNames:''
    34 	poolDictionaries:''
    55 	poolDictionaries:''
    35 	privateIn:Win32OperatingSystem
    56 	privateIn:Win32OperatingSystem
    36 !
    57 !
    37 
    58 
    42 		HKEY_DYN_DATA'
    63 		HKEY_DYN_DATA'
    43 	poolDictionaries:''
    64 	poolDictionaries:''
    44 	privateIn:Win32OperatingSystem
    65 	privateIn:Win32OperatingSystem
    45 !
    66 !
    46 
    67 
       
    68 ByteArray variableByteSubclass:#TextMetricsStructure
       
    69 	instanceVariableNames:''
       
    70 	classVariableNames:''
       
    71 	poolDictionaries:''
       
    72 	privateIn:Win32OperatingSystem
       
    73 !
       
    74 
    47 OSHandle subclass:#Win32IOHandle
    75 OSHandle subclass:#Win32IOHandle
    48 	instanceVariableNames:''
    76 	instanceVariableNames:''
    49 	classVariableNames:'Lobby'
    77 	classVariableNames:'Lobby'
    50 	poolDictionaries:''
    78 	poolDictionaries:''
    51 	privateIn:Win32OperatingSystem
    79 	privateIn:Win32OperatingSystem
    52 !
    80 !
    53 
    81 
       
    82 Win32Handle subclass:#Win32PrinterHandle
       
    83 	instanceVariableNames:''
       
    84 	classVariableNames:''
       
    85 	poolDictionaries:''
       
    86 	privateIn:Win32OperatingSystem
       
    87 !
       
    88 
    54 Win32Handle subclass:#Win32ProcessHandle
    89 Win32Handle subclass:#Win32ProcessHandle
    55 	instanceVariableNames:'pid'
    90 	instanceVariableNames:'pid'
    56 	classVariableNames:''
    91 	classVariableNames:''
    57 	poolDictionaries:''
    92 	poolDictionaries:''
    58 	privateIn:Win32OperatingSystem
    93 	privateIn:Win32OperatingSystem
    64 	poolDictionaries:''
    99 	poolDictionaries:''
    65 	privateIn:Win32OperatingSystem
   100 	privateIn:Win32OperatingSystem
    66 !
   101 !
    67 
   102 
    68 Win32OperatingSystem::Win32IOHandle subclass:#Win32SocketHandle
   103 Win32OperatingSystem::Win32IOHandle subclass:#Win32SocketHandle
       
   104 	instanceVariableNames:''
       
   105 	classVariableNames:''
       
   106 	poolDictionaries:''
       
   107 	privateIn:Win32OperatingSystem
       
   108 !
       
   109 
       
   110 ByteArray variableByteSubclass:#WinPointStructure
    69 	instanceVariableNames:''
   111 	instanceVariableNames:''
    70 	classVariableNames:''
   112 	classVariableNames:''
    71 	poolDictionaries:''
   113 	poolDictionaries:''
    72 	privateIn:Win32OperatingSystem
   114 	privateIn:Win32OperatingSystem
    73 !
   115 !
  3528 
  3570 
  3529 createFileForReadWrite:pathName
  3571 createFileForReadWrite:pathName
  3530      ^ self openFile:pathName attributes:#(#'GENERIC_READ' #'GENERIC_WRITE' #'CREATE_ALWAYS')
  3572      ^ self openFile:pathName attributes:#(#'GENERIC_READ' #'GENERIC_WRITE' #'CREATE_ALWAYS')
  3531 !
  3573 !
  3532 
  3574 
       
  3575 getLastError
       
  3576 %{
       
  3577     RETURN ( __mkSmallInteger( __WIN32_ERR(GetLastError()) ));
       
  3578 %}.
       
  3579 
       
  3580     "Created: / 31-07-2006 / 12:40:39 / fm"
       
  3581 !
       
  3582 
  3533 linkFile:oldPath to:newPath
  3583 linkFile:oldPath to:newPath
  3534     "link the file 'oldPath' to 'newPath'. The link will be a hard link.
  3584     "link the file 'oldPath' to 'newPath'. The link will be a hard link.
  3535      Return true if successful, false if not."
  3585      Return true if successful, false if not."
  3536 
  3586 
  3537     (oldPath isString not or:[newPath isString not]) ifTrue:[
  3587     (oldPath isString not or:[newPath isString not]) ifTrue:[
  4868 	^ (aPathString at:1) asString.
  4918 	^ (aPathString at:1) asString.
  4869     ].
  4919     ].
  4870     ^ ''
  4920     ^ ''
  4871 ! !
  4921 ! !
  4872 
  4922 
       
  4923 !Win32OperatingSystem class methodsFor:'help support'!
       
  4924 
       
  4925 openDocumentationFilename: aFilename
       
  4926 
       
  4927 |result|
       
  4928 
       
  4929             Error catch:[
       
  4930                 result := self  
       
  4931                     shellExecute:nil
       
  4932                     lpOperation:'open'
       
  4933                     lpFile:aFilename pathName
       
  4934                     lpParameters:nil
       
  4935                     lpDirectory:aFilename directory pathName 
       
  4936                     nShowCmd:#SW_SHOWNORMAL.
       
  4937                 ^ self.
       
  4938             ]
       
  4939 
       
  4940 "
       
  4941         self openDocumentationFilename: 'C:\WINDOWS\Help\clipbrd.chm' asFilename
       
  4942 "
       
  4943 
       
  4944     "Created: / 04-08-2006 / 18:04:52 / fm"
       
  4945 ! !
       
  4946 
  4873 !Win32OperatingSystem class methodsFor:'interrupts & signals'!
  4947 !Win32OperatingSystem class methodsFor:'interrupts & signals'!
  4874 
  4948 
  4875 blockingTest
  4949 blockingTest
  4876     "this is a test method;
  4950     "this is a test method;
  4877      For testing double CTRL-C in blocking primitives"
  4951      For testing double CTRL-C in blocking primitives"
  5453     "Created: 28.1.1998 / 14:23:04 / md"
  5527     "Created: 28.1.1998 / 14:23:04 / md"
  5454     "Modified: 28.1.1998 / 14:27:18 / md"
  5528     "Modified: 28.1.1998 / 14:27:18 / md"
  5455 !
  5529 !
  5456 
  5530 
  5457 getPrivateProfileString:appNameString key:keyNameString default:defaultString fileName:fileName 
  5531 getPrivateProfileString:appNameString key:keyNameString default:defaultString fileName:fileName 
       
  5532     ^ self
       
  5533         getProfileString:appNameString key:keyNameString default:defaultString 
       
  5534         fileName:fileName private:true
       
  5535 
       
  5536     "Modified: / 27-07-2006 / 11:57:03 / fm"
       
  5537 !
       
  5538 
       
  5539 getProfileString:appNameString key:keyNameString default:defaultString 
  5458 %{
  5540 %{
  5459     char *__appNameString = NULL;
  5541     char *__appNameString = NULL;
  5460     char *__keyNameString = NULL;
  5542     char *__keyNameString = NULL;
  5461     char *__defaultString = NULL;
  5543     char *__defaultString = NULL;
  5462     char *__fileName = NULL;
       
  5463     char *__returnedString = NULL;
  5544     char *__returnedString = NULL;
  5464     char buffer[1024];
  5545     char quickBuffer[1024];
       
  5546     char *usedBuffer = quickBuffer;
       
  5547     int bufferSize = sizeof(quickBuffer);
  5465     int nChars;
  5548     int nChars;
       
  5549     OBJ retVal;
  5466 
  5550 
  5467     if (__isString(appNameString)) {
  5551     if (__isString(appNameString)) {
  5468         __appNameString = __stringVal(appNameString);
  5552         __appNameString = __stringVal(appNameString);
  5469     } else if (appNameString != nil)
  5553     } else if (appNameString != nil)
  5470         goto primitiveFail;
  5554         goto primitiveFail;
  5477     if (__isString(defaultString)) {
  5561     if (__isString(defaultString)) {
  5478         __defaultString = __stringVal(defaultString);
  5562         __defaultString = __stringVal(defaultString);
  5479     } else if (defaultString != nil)
  5563     } else if (defaultString != nil)
  5480         goto primitiveFail;
  5564         goto primitiveFail;
  5481 
  5565 
  5482     if (! __isString(fileName)) goto primitiveFail;
  5566     do {
  5483     __fileName = __stringVal(fileName);
  5567         nChars = GetProfileString(__appNameString, __keyNameString, __defaultString, usedBuffer, bufferSize);
  5484 
  5568         if (nChars >= 0) {
  5485     nChars = GetPrivateProfileString(__appNameString, __keyNameString, __defaultString, buffer, sizeof(buffer), __fileName);
  5569             if (nChars != bufferSize-1) {
  5486     if ((nChars >= 0) && (nChars != sizeof(buffer)-1)) {
  5570                 retVal = __MKSTRING_L(usedBuffer, nChars);
  5487         RETURN (__MKSTRING_L(buffer, nChars));
  5571                 if (usedBuffer != quickBuffer) free(usedBuffer);
  5488     }
  5572                 RETURN (retVal);
       
  5573             }
       
  5574 
       
  5575             {
       
  5576                 /* use a bigger buffer */
       
  5577                 char *newBuffer;
       
  5578                 int newBufferSize = bufferSize * 2;
       
  5579 
       
  5580                 newBuffer = (char *)malloc( newBufferSize );
       
  5581                 if (usedBuffer != quickBuffer) free(usedBuffer);
       
  5582                 usedBuffer = newBuffer;
       
  5583                 bufferSize = newBufferSize;
       
  5584             }
       
  5585         }
       
  5586         
       
  5587     } while (nChars > 0);
       
  5588     RETURN (nil);
  5489   primitiveFail: ;
  5589   primitiveFail: ;
  5490 %}.
  5590 %}.
  5491     self primitiveFailed
  5591     self primitiveFailed
       
  5592 
       
  5593     "Created: / 27-07-2006 / 11:54:59 / fm"
       
  5594 !
       
  5595 
       
  5596 getProfileString:appNameString key:keyNameString default:defaultString fileName:fileName private:private
       
  5597 %{
       
  5598     char *__appNameString = NULL;
       
  5599     char *__keyNameString = NULL;
       
  5600     char *__defaultString = NULL;
       
  5601     char *__returnedString = NULL;
       
  5602     char *__fileName = NULL;
       
  5603     char quickBuffer[1024];
       
  5604     char *usedBuffer = quickBuffer;
       
  5605     int bufferSize = sizeof(quickBuffer);
       
  5606     int nChars;
       
  5607     OBJ retVal;
       
  5608 
       
  5609     if (__isString(appNameString)) {
       
  5610         __appNameString = __stringVal(appNameString);
       
  5611     } else if (appNameString != nil)
       
  5612         goto primitiveFail;
       
  5613 
       
  5614     if (__isString(keyNameString)) {
       
  5615         __keyNameString = __stringVal(keyNameString);
       
  5616     } else if (keyNameString != nil)
       
  5617         goto primitiveFail;
       
  5618 
       
  5619     if (__isString(defaultString)) {
       
  5620         __defaultString = __stringVal(defaultString);
       
  5621     } else if (defaultString != nil)
       
  5622         goto primitiveFail;
       
  5623 
       
  5624     if (private == true) {
       
  5625         if (! __isString(fileName)) goto primitiveFail;
       
  5626         __fileName = __stringVal(fileName);
       
  5627     }
       
  5628 
       
  5629     do {
       
  5630         if (private == true) {
       
  5631             nChars = GetPrivateProfileString(__appNameString, __keyNameString, __defaultString, usedBuffer, bufferSize, __fileName);
       
  5632         } else {
       
  5633             nChars = GetProfileString(__appNameString, __keyNameString, __defaultString, usedBuffer, bufferSize);
       
  5634         }
       
  5635         if (nChars >= 0) {
       
  5636             if (nChars != bufferSize-1) {
       
  5637                 retVal = __MKSTRING_L(usedBuffer, nChars);
       
  5638                 if (usedBuffer != quickBuffer) free(usedBuffer);
       
  5639                 RETURN (retVal);
       
  5640             }
       
  5641 
       
  5642             {
       
  5643                 /* use a bigger buffer */
       
  5644                 char *newBuffer;
       
  5645                 int newBufferSize = bufferSize * 2;
       
  5646 
       
  5647                 newBuffer = (char *)malloc( newBufferSize );
       
  5648                 if (usedBuffer != quickBuffer) free(usedBuffer);
       
  5649                 usedBuffer = newBuffer;
       
  5650                 bufferSize = newBufferSize;
       
  5651             }
       
  5652         }
       
  5653         
       
  5654     } while (nChars > 0);
       
  5655     RETURN (nil);
       
  5656   primitiveFail: ;
       
  5657 %}.
       
  5658     self primitiveFailed
       
  5659 
       
  5660     "Created: / 27-07-2006 / 11:55:25 / fm"
  5492 ! !
  5661 ! !
  5493 
  5662 
  5494 !Win32OperatingSystem class methodsFor:'os queries'!
  5663 !Win32OperatingSystem class methodsFor:'os queries'!
  5495 
  5664 
  5496 executableFileExtensions
  5665 executableFileExtensions
  6894     "
  7063     "
  6895      OperatingSystem stxPackageDirPath
  7064      OperatingSystem stxPackageDirPath
  6896     "
  7065     "
  6897 
  7066 
  6898     "Created: / 24.12.1999 / 00:11:12 / cg"
  7067     "Created: / 24.12.1999 / 00:11:12 / cg"
       
  7068 ! !
       
  7069 
       
  7070 !Win32OperatingSystem class methodsFor:'printing support'!
       
  7071 
       
  7072 abortDoc: deviceContext
       
  7073 
       
  7074 ^self primAbortDoc:deviceContext
       
  7075 
       
  7076     "Created: / 02-08-2006 / 12:52:12 / fm"
       
  7077 !
       
  7078 
       
  7079 closePrinter:handle
       
  7080 
       
  7081 self primClosePrinter:handle
       
  7082 
       
  7083     "Created: / 28-07-2006 / 17:55:59 / fm"
       
  7084 !
       
  7085 
       
  7086 createPrinterDC:driverName device:deviceName output:outputMedium initData:driverData
       
  7087     |h|
       
  7088 
       
  7089     h := self primCreatePrinterDC:driverName device:deviceName output:outputMedium initData:driverData.
       
  7090     h notNil ifTrue:[
       
  7091         ^ (Win32Handle newAddress:h address) registerForFinalization
       
  7092     ].
       
  7093     ^ h
       
  7094 
       
  7095     "
       
  7096      |p hPrinter driverNm mediumNm deviceNm driverData hDC|
       
  7097 
       
  7098      p := self getPrinters first.
       
  7099      driverNm := p attributes at:#driverName.
       
  7100      mediumNm := p attributes at:#medium.
       
  7101      deviceNm := p printerName.
       
  7102 
       
  7103      hPrinter := self openPrinter:deviceNm.
       
  7104      driverData := self getDocumentProperties:nil hPrinter:hPrinter pDeviceName:deviceNm.
       
  7105      self primClosePrinter:hPrinter.
       
  7106 
       
  7107      hDC := self createPrinterDC:driverNm device:deviceNm output:mediumNm initData:driverData.
       
  7108     "
       
  7109 
       
  7110     "Created: / 27-07-2006 / 16:22:34 / fm"
       
  7111 !
       
  7112 
       
  7113 documentPropertiesDialogFor:hwndOrNil hPrinter:hPrinter pDeviceName:deviceName devModeInput:pDevModeInputOrNil
       
  7114     |nBytesNeeded hPrinter rslt devModeOutput|
       
  7115 
       
  7116 "
       
  7117 #define DM_UPDATE           1
       
  7118 #define DM_COPY             2
       
  7119 #define DM_PROMPT           4
       
  7120 #define DM_MODIFY           8
       
  7121 
       
  7122 #define DM_IN_BUFFER        DM_MODIFY
       
  7123 #define DM_IN_PROMPT        DM_PROMPT
       
  7124 #define DM_OUT_BUFFER       DM_COPY
       
  7125 #define DM_OUT_DEFAULT      DM_UPDATE
       
  7126 "
       
  7127     nBytesNeeded := self 
       
  7128            primDocumentProperties:nil 
       
  7129            hPrinter:hPrinter 
       
  7130            pDeviceName: deviceName 
       
  7131            pDevModeOutput:nil 
       
  7132            pDevModeInput:nil 
       
  7133            fMode:0.
       
  7134 
       
  7135     devModeOutput := DevModeStructure new:(nBytesNeeded * 2 "never trust MS !!").    
       
  7136 
       
  7137     rslt := self 
       
  7138            primDocumentProperties:nil 
       
  7139            hPrinter:hPrinter 
       
  7140            pDeviceName: deviceName 
       
  7141            pDevModeOutput:devModeOutput 
       
  7142            pDevModeInput:pDevModeInputOrNil 
       
  7143            fMode:4+2.
       
  7144 
       
  7145     ^ devModeOutput
       
  7146 
       
  7147     "
       
  7148      |h|
       
  7149 
       
  7150      h := self openPrinter:'\\http://exept.exept.de:631\lj4'.
       
  7151      self documentPropertiesDialogFor:nil hPrinter:h pDeviceName:'\\http://exept.exept.de:631\lj4' devModeInput:nil
       
  7152     "
       
  7153 
       
  7154     "Created: / 27-07-2006 / 15:39:21 / fm"
       
  7155 !
       
  7156 
       
  7157 endDoc: deviceContext
       
  7158 
       
  7159 ^self primEndDoc:deviceContext
       
  7160 
       
  7161     "Created: / 27-07-2006 / 19:46:19 / fm"
       
  7162     "Modified: / 28-07-2006 / 19:23:03 / fm"
       
  7163 !
       
  7164 
       
  7165 endPage: deviceContext
       
  7166 
       
  7167 ^self primEndPage:deviceContext
       
  7168 
       
  7169     "Created: / 27-07-2006 / 19:45:28 / fm"
       
  7170     "Modified: / 28-07-2006 / 18:49:40 / fm"
       
  7171 !
       
  7172 
       
  7173 getDefaultPrinterName
       
  7174     "returns the default printer name"
       
  7175 
       
  7176   ^(self getProfileString:'windows' key:'device' default:'')
       
  7177 
       
  7178 "OperatingSystem getDefaultPrinterName"
       
  7179 
       
  7180     "Created: / 02-08-2006 / 17:25:34 / fm"
       
  7181 !
       
  7182 
       
  7183 getDeviceCaps:hwnd index: index   
       
  7184 
       
  7185 ^self primGetDeviceCaps:hwnd index: index
       
  7186 
       
  7187     "Created: / 28-07-2006 / 17:45:27 / fm"
       
  7188 !
       
  7189 
       
  7190 getDocumentProperties:hwndOrNil hPrinter:hPrinter pDeviceName:deviceName
       
  7191     |nBytesNeeded rslt devModeOutput|
       
  7192 
       
  7193 "
       
  7194 #define DM_UPDATE           1
       
  7195 #define DM_COPY             2
       
  7196 #define DM_PROMPT           4
       
  7197 #define DM_MODIFY           8
       
  7198 
       
  7199 #define DM_IN_BUFFER        DM_MODIFY
       
  7200 #define DM_IN_PROMPT        DM_PROMPT
       
  7201 #define DM_OUT_BUFFER       DM_COPY
       
  7202 #define DM_OUT_DEFAULT      DM_UPDATE
       
  7203 "
       
  7204     nBytesNeeded := self 
       
  7205            primDocumentProperties:nil 
       
  7206            hPrinter:hPrinter 
       
  7207            pDeviceName: deviceName 
       
  7208            pDevModeOutput:nil 
       
  7209            pDevModeInput:nil 
       
  7210            fMode:0.
       
  7211     nBytesNeeded < 0 ifTrue:[^nil].
       
  7212     devModeOutput := DevModeStructure new:(nBytesNeeded * 2 "never trust MS !!").    
       
  7213 
       
  7214     rslt := self 
       
  7215            primDocumentProperties:nil 
       
  7216            hPrinter:hPrinter 
       
  7217            pDeviceName: deviceName 
       
  7218            pDevModeOutput:devModeOutput 
       
  7219            pDevModeInput:nil 
       
  7220            fMode:2.
       
  7221 
       
  7222      ^ devModeOutput
       
  7223 
       
  7224     "
       
  7225      |h|
       
  7226 
       
  7227      h := self openPrinter:'\\http://exept.exept.de:631\lj4'.
       
  7228      self getDocumentProperties:nil hPrinter:h pDeviceName:'\\http://exept.exept.de:631\lj4'
       
  7229     "
       
  7230 
       
  7231     "Created: / 27-07-2006 / 15:38:03 / fm"
       
  7232     "Modified: / 31-07-2006 / 13:02:02 / fm"
       
  7233 !
       
  7234 
       
  7235 getPrinterInfo2: printerName
       
  7236 
       
  7237 |hPrinter rslt informationBuffer bytesNeeded sizeBytesArray|
       
  7238 
       
  7239      hPrinter := self openPrinter: printerName .
       
  7240      sizeBytesArray := ByteArray new:4.
       
  7241      bytesNeeded := self 
       
  7242                 primGetPrinter:hPrinter 
       
  7243                 level:2 
       
  7244                 informationBuffer: nil 
       
  7245                 bufferSize: 0
       
  7246                 bufferNeededSize:sizeBytesArray. 
       
  7247      bytesNeeded := sizeBytesArray longAt:1.
       
  7248      informationBuffer := PrinterInfo2Structure new: bytesNeeded.
       
  7249      rslt := self 
       
  7250                 primGetPrinter:hPrinter 
       
  7251                 level:2 
       
  7252                 informationBuffer:informationBuffer 
       
  7253                 bufferSize: bytesNeeded 
       
  7254                 bufferNeededSize:sizeBytesArray.
       
  7255      self closePrinter: printerName.    
       
  7256      ^informationBuffer
       
  7257 
       
  7258     "Created: / 01-08-2006 / 13:47:19 / fm"
       
  7259 !
       
  7260 
       
  7261 getPrinters
       
  7262     "return a collection of PrinterInfos"
       
  7263 
       
  7264     |printerNames collectedInfo|
       
  7265 
       
  7266     printerNames := self getPrintersNames.
       
  7267     collectedInfo := OrderedCollection new.
       
  7268     printerNames do:[:eachName |
       
  7269         |fn vol attributes nm deviceInfo infoFields driverName|
       
  7270 
       
  7271         attributes := Dictionary new.
       
  7272 
       
  7273         fn := eachName asFilename.
       
  7274         vol := fn volume.
       
  7275         vol notEmptyOrNil ifTrue:[      
       
  7276             (vol startsWith:'\\') ifTrue:[      
       
  7277                 "/ a remote printer
       
  7278                 attributes at:#isRemotePrinter put:true.
       
  7279                 attributes at:#remotePrinterName put:(fn baseName).
       
  7280                 attributes at:#remotePrinterHost put:(fn directoryName copyFrom:3).
       
  7281             ] ifFalse:[
       
  7282                 "/ some other printer
       
  7283             ].
       
  7284         ] ifFalse:[
       
  7285             "/ some other printer
       
  7286         ].
       
  7287 
       
  7288         deviceInfo := self getProfileString:'PrinterPorts' key:eachName default:''.
       
  7289         "gives us smething like 'winspool,Ne00:,15,45',
       
  7290          which is: driverName, deviceName, ? , ?"
       
  7291 
       
  7292         infoFields := deviceInfo asCollectionOfSubstringsSeparatedBy:$,.
       
  7293         driverName := infoFields at:1.
       
  7294         2 to: infoFields size by:3 do:[:i |
       
  7295             |medium longName|
       
  7296 
       
  7297             medium := infoFields at:i.
       
  7298             longName := eachName ,',' , driverName , ',' , medium.
       
  7299             attributes at:#driverName put:driverName.
       
  7300             attributes at:#longName put:longName.
       
  7301             attributes at:#medium put:medium.
       
  7302 
       
  7303             collectedInfo add:
       
  7304                 (AbstractOperatingSystem::PrinterInfo new
       
  7305                     printerName:eachName 
       
  7306                     attributes:attributes;
       
  7307                     setDocumentProperties;
       
  7308                     yourself) 
       
  7309         ].
       
  7310     ].
       
  7311     ^ collectedInfo
       
  7312 
       
  7313     "
       
  7314      OperatingSystem getPrinters
       
  7315     "
       
  7316 
       
  7317     "Created: / 27-07-2006 / 12:18:11 / fm"
       
  7318     "Modified: / 31-07-2006 / 13:06:04 / fm"
       
  7319 !
       
  7320 
       
  7321 getPrintersNames
       
  7322     "return a collection of Printer names"
       
  7323 
       
  7324     |printerNames|
       
  7325 
       
  7326     printerNames := (self getProfileString:'PrinterPorts' key:nil default:'')
       
  7327                        asCollectionOfSubstringsSeparatedBy:(Character value:0).
       
  7328     printerNames := printerNames reject:[:nm | nm isEmpty].
       
  7329     ^printerNames
       
  7330 
       
  7331 "OperatingSystem getPrintersNames"
       
  7332 
       
  7333     "Created: / 27-07-2006 / 17:55:46 / fm"
       
  7334 !
       
  7335 
       
  7336 getTextExtentPoint: handle string: lpString size: pSize
       
  7337 
       
  7338    ^self primGetTextExtentPoint: handle string: lpString count: lpString size size: pSize
       
  7339 
       
  7340     "Created: / 03-08-2006 / 11:17:17 / fm"
       
  7341 !
       
  7342 
       
  7343 getTextMetrics: deviceContext lpMetrics: textMetrics
       
  7344 
       
  7345 ^self primGetTextMetrics: deviceContext lpMetrics: textMetrics
       
  7346 
       
  7347     "Created: / 02-08-2006 / 16:07:07 / fm"
       
  7348 !
       
  7349 
       
  7350 openPrinter:name
       
  7351     |h hh rslt|
       
  7352 
       
  7353     hh := ByteArray new:4.
       
  7354     rslt := self primOpenPrinter:name handleHolder:hh ignored:nil.
       
  7355     rslt ifFalse:[^ nil].
       
  7356 
       
  7357     h := Win32PrinterHandle new setAddressFromBytes:hh.
       
  7358     h registerForFinalization.
       
  7359     ^ h
       
  7360 
       
  7361     "
       
  7362      self openPrinter:'\\http://exept.exept.de:631\lj4'
       
  7363     "
       
  7364 
       
  7365     "Created: / 27-07-2006 / 14:40:41 / fm"
       
  7366 !
       
  7367 
       
  7368 primAbortDoc:hwnd
       
  7369     <apicall: int32 "AbortDoc" (handle) module: "gdi32.dll" >
       
  7370 
       
  7371     "Created: / 02-08-2006 / 12:52:32 / fm"
       
  7372 !
       
  7373 
       
  7374 primClosePrinter:handle
       
  7375     <apicall: bool "ClosePrinter" ( handle ) module: "winspool.drv" >
       
  7376 
       
  7377     "
       
  7378      |h hh rslt|
       
  7379 
       
  7380      hh := ByteArray new:4.
       
  7381      rslt := self primOpenPrinter:'\\http://exept.exept.de:631\lj4' handleHolder:hh ignored: nil.
       
  7382      h := Win32PrinterHandle new setAddressFromBytes:hh.
       
  7383      self primClosePrinter: h.
       
  7384     "
       
  7385 
       
  7386     "Created: / 27-07-2006 / 14:47:12 / fm"
       
  7387 !
       
  7388 
       
  7389 primCreatePrinterDC:driverName device:deviceName output:outputMedium initData:driverData
       
  7390     <apicall: handle "CreateDCA" ( lpstr lpstr lpstr pointer ) module: "gdi32.dll" >
       
  7391 
       
  7392     "Modified: / 27-07-2006 / 16:26:25 / fm"
       
  7393 !
       
  7394 
       
  7395 primDocumentProperties:hwndOrNil hPrinter:hPrinter pDeviceName:deviceName pDevModeOutput:pDevModeOutput pDevModeInput:pDevModeInput fMode:fMode
       
  7396     <apicall: int32 "DocumentPropertiesA" ( handle handle lpstr pointer pointer uint32) module: "winspool.drv" >
       
  7397 
       
  7398     "
       
  7399      |hPrinter rslt|
       
  7400 
       
  7401      hPrinter := self openPrinter:'\\http://exept.exept.de:631\lj4' .
       
  7402      rslt := self 
       
  7403             primDocumentProperties:nil 
       
  7404             hPrinter:hPrinter 
       
  7405             pDeviceName: '\\http://exept.exept.de:631\lj4' 
       
  7406             pDevModeOutput:nil 
       
  7407             pDevModeInput:nil 
       
  7408             fMode:0.
       
  7409 
       
  7410      self halt.
       
  7411     "
       
  7412 
       
  7413     "Created: / 27-07-2006 / 15:02:14 / fm"
       
  7414 !
       
  7415 
       
  7416 primEndDoc:hwnd
       
  7417     <apicall: int32 "EndDoc" (handle) module: "gdi32.dll" >
       
  7418 
       
  7419     "
       
  7420      |hPrinter rslt|
       
  7421 
       
  7422      hPrinter := self openPrinter:'\\http://exept.exept.de:631\lj4' .
       
  7423      rslt := self 
       
  7424             primDocumentProperties:nil 
       
  7425             hPrinter:hPrinter 
       
  7426             pDeviceName: '\\http://exept.exept.de:631\lj4' 
       
  7427             pDevModeOutput:nil 
       
  7428             pDevModeInput:nil 
       
  7429             fMode:0.
       
  7430 
       
  7431      self halt.
       
  7432     "
       
  7433 
       
  7434     "Created: / 27-07-2006 / 19:31:31 / fm"
       
  7435 !
       
  7436 
       
  7437 primEndPage:hwnd
       
  7438     <apicall: int32 "EndPage" (handle) module: "gdi32.dll" >
       
  7439 
       
  7440     "
       
  7441      |hPrinter rslt|
       
  7442 
       
  7443      hPrinter := self openPrinter:'\\http://exept.exept.de:631\lj4' .
       
  7444      rslt := self 
       
  7445             primDocumentProperties:nil 
       
  7446             hPrinter:hPrinter 
       
  7447             pDeviceName: '\\http://exept.exept.de:631\lj4' 
       
  7448             pDevModeOutput:nil 
       
  7449             pDevModeInput:nil 
       
  7450             fMode:0.
       
  7451 
       
  7452      self halt.
       
  7453     "
       
  7454 
       
  7455     "Created: / 27-07-2006 / 19:30:50 / fm"
       
  7456 !
       
  7457 
       
  7458 primGetDeviceCaps:hwnd index: index
       
  7459 "Returns driver specific information about the device"
       
  7460     <apicall: int32 "GetDeviceCaps" (handle int32) module: "gdi32.dll" >
       
  7461 
       
  7462     "Modified: / 01-08-2006 / 16:13:05 / fm"
       
  7463 !
       
  7464 
       
  7465 primGetPrinter:hwnd level:index informationBuffer:informationBuffer bufferSize:bufferSize bufferNeededSize:bufferNeededSize
       
  7466     <apicall: bool "GetPrinterA" (handle dword pointer dword pointer) module: "winspool.drv" >
       
  7467 
       
  7468 
       
  7469 "  
       
  7470 |hPrinter rslt printerName informationBuffer bytesNeeded sizeBytesArray|
       
  7471      printerName := '\\http://exept.exept.de:631\lj4'.
       
  7472      hPrinter := self openPrinter: printerName .
       
  7473      sizeBytesArray := ByteArray new:4.
       
  7474      bytesNeeded := self 
       
  7475                 primGetPrinter:hPrinter 
       
  7476                 level:2 
       
  7477                 informationBuffer: nil 
       
  7478                 bufferSize: 0
       
  7479                 bufferNeededSize:sizeBytesArray. 
       
  7480      bytesNeeded := sizeBytesArray longAt:1.
       
  7481      informationBuffer := PrinterInfo2 new: bytesNeeded.
       
  7482      rslt := self 
       
  7483                 primGetPrinter:hPrinter 
       
  7484                 level:2 
       
  7485                 informationBuffer:informationBuffer 
       
  7486                 bufferSize: bytesNeeded 
       
  7487                 bufferNeededSize:sizeBytesArray.
       
  7488      self assert: rslt.
       
  7489      informationBuffer inspect.
       
  7490      self closePrinter: printerName.
       
  7491 "
       
  7492 
       
  7493     "Modified: / 01-08-2006 / 12:39:26 / fm"
       
  7494 !
       
  7495 
       
  7496 primGetTextExtentPoint: handle string: lpString count: nCount size: pSize
       
  7497      <apicall: bool "GetTextExtentPointA" (handle pointer int32 pointer) module: "gdi32.dll" >
       
  7498 
       
  7499     "Created: / 03-08-2006 / 11:06:23 / fm"
       
  7500 !
       
  7501 
       
  7502 primGetTextMetrics: deviceContext lpMetrics: textMetrics
       
  7503 
       
  7504     <apicall: bool "GetTextMetricsA" (handle pointer) module: "gdi32.dll" >
       
  7505 
       
  7506     "Modified: / 02-08-2006 / 16:17:51 / fm"
       
  7507 !
       
  7508 
       
  7509 primOpenPrinter:name handleHolder:handleHolder ignored: ignored
       
  7510     <apicall: bool "OpenPrinterA" ( lpstr lpstr lpstr ) module: "winspool.drv" >
       
  7511 
       
  7512     "
       
  7513      |h hh rslt|
       
  7514 
       
  7515      hh := ByteArray new:4.
       
  7516      rslt := self primOpenPrinter:'\\http://exept.exept.de:631\lj4' handleHolder:hh ignored: nil.
       
  7517      h := Win32Handle new setAddressFromBytes:hh.
       
  7518      self halt.
       
  7519     "
       
  7520 
       
  7521     "Created: / 27-07-2006 / 14:39:35 / fm"
       
  7522 !
       
  7523 
       
  7524 primStartDoc:hwnd docInfo: aDocInfo
       
  7525     "Returns a jobId"
       
  7526     <apicall: int32 "StartDocA" (handle pointer) module: "gdi32.dll" >
       
  7527 
       
  7528     "Modified: / 31-07-2006 / 11:47:10 / fm"
       
  7529 !
       
  7530 
       
  7531 primStartPage:hwnd
       
  7532     <apicall: int32 "StartPage" (handle) module: "gdi32.dll" >
       
  7533 
       
  7534     "Created: / 27-07-2006 / 19:02:12 / fm"
       
  7535     "Modified: / 31-07-2006 / 11:47:06 / fm"
       
  7536 !
       
  7537 
       
  7538 startDoc: deviceContext docInfo: docInfoStruct
       
  7539 
       
  7540 ^self primStartDoc:deviceContext docInfo: docInfoStruct
       
  7541 
       
  7542     "Created: / 27-07-2006 / 19:42:39 / fm"
       
  7543 !
       
  7544 
       
  7545 startPage: deviceContext
       
  7546 
       
  7547 ^self primStartPage:deviceContext
       
  7548 
       
  7549     "Created: / 27-07-2006 / 19:43:56 / fm"
       
  7550     "Modified: / 28-07-2006 / 18:48:58 / fm"
  6899 ! !
  7551 ! !
  6900 
  7552 
  6901 !Win32OperatingSystem class methodsFor:'private'!
  7553 !Win32OperatingSystem class methodsFor:'private'!
  6902 
  7554 
  6903 mapLanguage:aWindowsLanguageString
  7555 mapLanguage:aWindowsLanguageString
  8350      invalid arg,
  9002      invalid arg,
  8351     "
  9003     "
  8352     ^ self primitiveFailed
  9004     ^ self primitiveFailed
  8353 ! !
  9005 ! !
  8354 
  9006 
       
  9007 !Win32OperatingSystem::DevModeStructure methodsFor:'accessing'!
       
  9008 
       
  9009 bitsPerPel
       
  9010     ^ self unsignedLongAt: 1+104
       
  9011 
       
  9012     "Created: / 27-07-2006 / 15:14:17 / fm"
       
  9013 !
       
  9014 
       
  9015 collate
       
  9016     ^ self shortAt: 1+68
       
  9017 
       
  9018     "Created: / 01-08-2006 / 09:56:38 / fm"
       
  9019 !
       
  9020 
       
  9021 collate: n
       
  9022     ^ self shortAt: 1+68 put: n
       
  9023 
       
  9024     "Created: / 01-08-2006 / 09:58:07 / fm"
       
  9025 !
       
  9026 
       
  9027 color
       
  9028     ^ self shortAt: 1+60
       
  9029 
       
  9030     "Created: / 27-07-2006 / 15:31:25 / fm"
       
  9031 !
       
  9032 
       
  9033 copies
       
  9034     ^ self shortAt: 1+54
       
  9035 
       
  9036     "Created: / 27-07-2006 / 15:30:52 / fm"
       
  9037 !
       
  9038 
       
  9039 copies: n
       
  9040     ^ self shortAt: 1+54 put: n
       
  9041 
       
  9042     "Created: / 27-07-2006 / 15:36:39 / fm"
       
  9043 !
       
  9044 
       
  9045 deviceName
       
  9046     ^ self stringAt: 1+0 size: 32
       
  9047 
       
  9048     "Created: / 27-07-2006 / 15:15:52 / fm"
       
  9049 !
       
  9050 
       
  9051 orientation
       
  9052     ^ self shortAt: 1+44
       
  9053 
       
  9054     "Created: / 27-07-2006 / 15:34:57 / fm"
       
  9055 !
       
  9056 
       
  9057 orientation: orientationInt
       
  9058     ^ self shortAt: 1+44 put: orientationInt
       
  9059 
       
  9060     "Created: / 27-07-2006 / 15:36:31 / fm"
       
  9061 !
       
  9062 
       
  9063 paperLength
       
  9064     ^ self shortAt: 1+48
       
  9065 
       
  9066     "Created: / 27-07-2006 / 15:32:59 / fm"
       
  9067 !
       
  9068 
       
  9069 paperSize
       
  9070     ^ self shortAt: 1+46
       
  9071 
       
  9072     "Created: / 27-07-2006 / 15:32:12 / fm"
       
  9073 !
       
  9074 
       
  9075 paperSize:funnyMSPaperSizeCode
       
  9076     ^ self shortAt: 1+46 put: funnyMSPaperSizeCode
       
  9077 
       
  9078     "Created: / 27-07-2006 / 15:35:53 / fm"
       
  9079 !
       
  9080 
       
  9081 paperWidth
       
  9082     ^ self shortAt: 1+50
       
  9083 
       
  9084     "Created: / 27-07-2006 / 15:32:25 / fm"
       
  9085 !
       
  9086 
       
  9087 printQuality
       
  9088     ^ self shortAt: 1+58
       
  9089 
       
  9090     "Created: / 27-07-2006 / 15:33:58 / fm"
       
  9091 !
       
  9092 
       
  9093 printQuality: qualityInteger
       
  9094     ^ self shortAt: 1+58 put: qualityInteger
       
  9095 
       
  9096     "Created: / 27-07-2006 / 15:36:20 / fm"
       
  9097 !
       
  9098 
       
  9099 scale
       
  9100     ^ self shortAt: 1+52
       
  9101 
       
  9102     "Created: / 27-07-2006 / 15:33:31 / fm"
       
  9103 !
       
  9104 
       
  9105 scale: percent
       
  9106     ^ self shortAt: 1+52 put: percent
       
  9107 
       
  9108     "Created: / 27-07-2006 / 15:36:05 / fm"
       
  9109 ! !
       
  9110 
       
  9111 !Win32OperatingSystem::DocInfoStructure class methodsFor:'instance creation'!
       
  9112 
       
  9113 new
       
  9114 
       
  9115 ^super new: self sizeInBytes
       
  9116 
       
  9117     "Created: / 02-08-2006 / 16:21:01 / fm"
       
  9118 !
       
  9119 
       
  9120 sizeInBytes
       
  9121 
       
  9122 ^20
       
  9123 
       
  9124     "Created: / 02-08-2006 / 16:21:10 / fm"
       
  9125 ! !
       
  9126 
       
  9127 !Win32OperatingSystem::DocInfoStructure methodsFor:'accessing'!
       
  9128 
       
  9129 cbSize
       
  9130 
       
  9131 ^self longAt: 0+1
       
  9132 
       
  9133     "Created: / 28-07-2006 / 18:36:02 / fm"
       
  9134 !
       
  9135 
       
  9136 cbSize: aValue
       
  9137 
       
  9138 self longAt: 0+1 put: aValue
       
  9139 
       
  9140     "Created: / 28-07-2006 / 18:37:25 / fm"
       
  9141 !
       
  9142 
       
  9143 fwType
       
  9144 
       
  9145 ^self longAt: 16+1
       
  9146 
       
  9147     "Created: / 28-07-2006 / 18:37:44 / fm"
       
  9148 !
       
  9149 
       
  9150 fwType: aValue
       
  9151 "Set a DWORD fwType"
       
  9152 
       
  9153 self longAt: 16+1 put:aValue
       
  9154 
       
  9155     "Created: / 28-07-2006 / 18:38:17 / fm"
       
  9156 !
       
  9157 
       
  9158 lpszDocName
       
  9159 
       
  9160 ^(ExternalBytes address:(self unsignedLongAt: 4+1)) stringAt:1
       
  9161 
       
  9162     "Created: / 03-08-2006 / 15:06:56 / fm"
       
  9163 !
       
  9164 
       
  9165 lpszDocName: aValue
       
  9166 
       
  9167 ^self unsignedLongAt: 4+1 put: aValue
       
  9168 
       
  9169     "Created: / 03-08-2006 / 15:08:32 / fm"
       
  9170 !
       
  9171 
       
  9172 lpszOutput
       
  9173 
       
  9174 ^(ExternalBytes address:(self unsignedLongAt: 8+1)) stringAt:1
       
  9175 
       
  9176     "Created: / 03-08-2006 / 15:07:52 / fm"
       
  9177 !
       
  9178 
       
  9179 lpszOutput: aValue
       
  9180 
       
  9181 ^self unsignedLongAt: 8+1 put: aValue
       
  9182 
       
  9183     "Created: / 03-08-2006 / 15:08:49 / fm"
       
  9184 ! !
       
  9185 
  8355 !Win32OperatingSystem::FileStatusInfo class methodsFor:'instance creation'!
  9186 !Win32OperatingSystem::FileStatusInfo class methodsFor:'instance creation'!
  8356 
  9187 
  8357 type:t mode:m uid:u gid:g size:s id:i accessed:aT modified:mT created:cT path:lP alternativeName:name2
  9188 type:t mode:m uid:u gid:g size:s id:i accessed:aT modified:mT created:cT path:lP alternativeName:name2
  8358     ^ self basicNew
  9189     ^ self basicNew
  8359 	type:t mode:m uid:u gid:g size:s
  9190 	type:t mode:m uid:u gid:g size:s
  8755 
  9586 
  8756     ^ status == #exit and:[code = 0]
  9587     ^ status == #exit and:[code = 0]
  8757 
  9588 
  8758     "Created: 28.12.1995 / 14:13:05 / stefan"
  9589     "Created: 28.12.1995 / 14:13:05 / stefan"
  8759     "Modified: 28.12.1995 / 14:13:41 / stefan"
  9590     "Modified: 28.12.1995 / 14:13:41 / stefan"
       
  9591 ! !
       
  9592 
       
  9593 !Win32OperatingSystem::PrinterInfo2Structure methodsFor:'accessing'!
       
  9594 
       
  9595 defaultPriority
       
  9596 
       
  9597 "Answer a DWORD"
       
  9598 
       
  9599 ^self unsignedLongAt: 60 + 1
       
  9600 
       
  9601     "Created: / 01-08-2006 / 12:46:50 / fm"
       
  9602 !
       
  9603 
       
  9604 pComment
       
  9605 
       
  9606 "Answer a LPSTR"
       
  9607 
       
  9608 ^(ExternalBytes address:(self unsignedLongAt: 20 + 1)) stringAt:1
       
  9609 
       
  9610     "Created: / 01-08-2006 / 14:02:55 / fm"
       
  9611 !
       
  9612 
       
  9613 pDriverName
       
  9614 
       
  9615 "Answer a LPSTR"
       
  9616 
       
  9617 ^ (ExternalBytes address:(self unsignedLongAt:16 + 1)) stringAt:1
       
  9618 
       
  9619     "Created: / 01-08-2006 / 14:05:18 / fm"
       
  9620 !
       
  9621 
       
  9622 pLocation
       
  9623 
       
  9624 "Answer a LPSTR"
       
  9625 
       
  9626 ^(ExternalBytes address:(self unsignedLongAt: 24 + 1)) stringAt: 1
       
  9627 
       
  9628     "Created: / 01-08-2006 / 14:03:21 / fm"
       
  9629 !
       
  9630 
       
  9631 priority
       
  9632 
       
  9633 "Answer a DWORD"
       
  9634 
       
  9635 ^self unsignedLongAt: 56 + 1
       
  9636 
       
  9637     "Created: / 01-08-2006 / 14:40:08 / fm"
       
  9638 !
       
  9639 
       
  9640 status
       
  9641 
       
  9642 "Answer a DWORD"
       
  9643 
       
  9644 ^self unsignedLongAt: 72 + 1
       
  9645 
       
  9646     "Created: / 31-07-2006 / 11:08:05 / fm"
  8760 ! !
  9647 ! !
  8761 
  9648 
  8762 !Win32OperatingSystem::RegistryEntry class methodsFor:'defaults'!
  9649 !Win32OperatingSystem::RegistryEntry class methodsFor:'defaults'!
  8763 
  9650 
  8764 rootKeyNames
  9651 rootKeyNames
  9965 
 10852 
  9966     t = __MKEXTERNALADDRESS(key); __INST(handle) = t; __STORE(self, t);
 10853     t = __MKEXTERNALADDRESS(key); __INST(handle) = t; __STORE(self, t);
  9967 %}.
 10854 %}.
  9968 
 10855 
  9969     "Created: / 19.5.1999 / 21:45:05 / cg"
 10856     "Created: / 19.5.1999 / 21:45:05 / cg"
       
 10857 ! !
       
 10858 
       
 10859 !Win32OperatingSystem::TextMetricsStructure class methodsFor:'instance creation'!
       
 10860 
       
 10861 new
       
 10862 
       
 10863 ^super new: self sizeInBytes
       
 10864 
       
 10865     "Created: / 02-08-2006 / 16:20:02 / fm"
       
 10866 !
       
 10867 
       
 10868 sizeInBytes 
       
 10869 
       
 10870   ^53
       
 10871 
       
 10872     "Created: / 02-08-2006 / 16:20:09 / fm"
       
 10873 ! !
       
 10874 
       
 10875 !Win32OperatingSystem::TextMetricsStructure methodsFor:'accessing'!
       
 10876 
       
 10877 tmDefaultChar
       
 10878     ^self byteAt: 46 + 1
       
 10879 
       
 10880     "Created: / 02-08-2006 / 16:15:35 / fm"
       
 10881 !
       
 10882 
       
 10883 tmExternalLeading
       
 10884     ^self longAt: 16 + 1
       
 10885 
       
 10886     "Created: / 02-08-2006 / 16:17:11 / fm"
       
 10887 !
       
 10888 
       
 10889 tmHeight
       
 10890     ^self longAt: 0 + 1
       
 10891 
       
 10892     "Created: / 02-08-2006 / 16:16:38 / fm"
  9970 ! !
 10893 ! !
  9971 
 10894 
  9972 !Win32OperatingSystem::Win32IOHandle class methodsFor:'documentation'!
 10895 !Win32OperatingSystem::Win32IOHandle class methodsFor:'documentation'!
  9973 
 10896 
  9974 documentation
 10897 documentation
 10356     if (h) {
 11279     if (h) {
 10357 	__externalAddressVal(self) = (HANDLE)0;
 11280 	__externalAddressVal(self) = (HANDLE)0;
 10358 	CloseHandle(h);
 11281 	CloseHandle(h);
 10359     }
 11282     }
 10360 %}.
 11283 %}.
       
 11284 ! !
       
 11285 
       
 11286 !Win32OperatingSystem::Win32PrinterHandle methodsFor:'release'!
       
 11287 
       
 11288 closeHandle
       
 11289     self address ~~ 0 ifTrue:[
       
 11290         OperatingSystem primClosePrinter:self.
       
 11291     ]
       
 11292 
       
 11293     "Created: / 27-07-2006 / 14:48:37 / fm"
 10361 ! !
 11294 ! !
 10362 
 11295 
 10363 !Win32OperatingSystem::Win32ProcessHandle methodsFor:'accessing'!
 11296 !Win32OperatingSystem::Win32ProcessHandle methodsFor:'accessing'!
 10364 
 11297 
 10365 pid
 11298 pid
 11345      self getNameInfo:#[1 2 3 4]
 12278      self getNameInfo:#[1 2 3 4]
 11346 	 wantHostName:true wantServiceName:true datagram:false flags:0
 12279 	 wantHostName:true wantServiceName:true datagram:false flags:0
 11347     "
 12280     "
 11348 ! !
 12281 ! !
 11349 
 12282 
       
 12283 !Win32OperatingSystem::WinPointStructure class methodsFor:'instance creation'!
       
 12284 
       
 12285 new
       
 12286 
       
 12287 ^super new: self sizeInBytes
       
 12288 
       
 12289     "Created: / 03-08-2006 / 10:37:59 / fm"
       
 12290 !
       
 12291 
       
 12292 sizeInBytes   
       
 12293 
       
 12294 ^8
       
 12295 
       
 12296     "Created: / 03-08-2006 / 10:38:06 / fm"
       
 12297 ! !
       
 12298 
       
 12299 !Win32OperatingSystem::WinPointStructure methodsFor:'accessing'!
       
 12300 
       
 12301 asPoint
       
 12302         "Private - Answer the receiver as a Point."
       
 12303     ^self x @ self y
       
 12304 
       
 12305     "Created: / 03-08-2006 / 10:45:55 / fm"
       
 12306 !
       
 12307 
       
 12308 x
       
 12309         "Private - Answer the x coordinate of the point."
       
 12310     ^self longAt: 0 + 1
       
 12311 
       
 12312     "Created: / 03-08-2006 / 10:46:11 / fm"
       
 12313 !
       
 12314 
       
 12315 x: anInteger
       
 12316         "Private - Set the x coordinate of the point."
       
 12317     self longAt: 0 + 1 put: anInteger
       
 12318 
       
 12319     "Created: / 03-08-2006 / 10:46:41 / fm"
       
 12320 !
       
 12321 
       
 12322 y
       
 12323         "Private - Answer the y coordinate of the point."
       
 12324     ^self longAt: 4 + 1
       
 12325 
       
 12326     "Created: / 03-08-2006 / 10:46:26 / fm"
       
 12327 !
       
 12328 
       
 12329 y: anInteger
       
 12330         "Private - Set the y coordinate of the point."
       
 12331     self longAt: 4 + 1 put: anInteger
       
 12332 
       
 12333     "Created: / 03-08-2006 / 10:46:56 / fm"
       
 12334 ! !
       
 12335 
       
 12336 !Win32OperatingSystem::WinPointStructure methodsFor:'printing'!
       
 12337 
       
 12338 printOn: aStream
       
 12339         "Append a textual representation of the receiver to aStream."
       
 12340     aStream nextPutAll: self class name, ' { ', self asPoint printString, ' } '
       
 12341 
       
 12342     "Created: / 03-08-2006 / 10:45:40 / fm"
       
 12343 ! !
       
 12344 
 11350 !Win32OperatingSystem class methodsFor:'documentation'!
 12345 !Win32OperatingSystem class methodsFor:'documentation'!
 11351 
 12346 
 11352 version
 12347 version
 11353     ^ '$Header: /cvs/stx/stx/libbasic/Win32OperatingSystem.st,v 1.234 2006-07-06 16:18:59 cg Exp $'
 12348     ^ '$Header: /cvs/stx/stx/libbasic/Win32OperatingSystem.st,v 1.235 2006-08-07 13:11:21 fm Exp $'
 11354 ! !
 12349 ! !
 11355 
 12350 
 11356 Win32OperatingSystem initialize!
 12351 Win32OperatingSystem initialize!
 11357 Win32OperatingSystem::RegistryEntry initialize!
 12352 Win32OperatingSystem::RegistryEntry initialize!