[BUG][VW 7.7 NC] Win32SystemSupport class>>CreateProcess:arguments:creationFlags: broken

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

[BUG][VW 7.7 NC] Win32SystemSupport class>>CreateProcess:arguments:creationFlags: broken

Joachim Geidel
Win32SystemSupport class>>CreateProcess:arguments:creationFlags: sends
#encodeWide: to self. #encodeWide: isn't implemented as a class method of
Win32SystemSupport. The message should be sent to the temporary variable
"interface" instead. The method also contains a superfluous
    ... ifNil: [nil] ifNotNil: [...]
This might of course be intentional to make absolutely clear that the result
is nil in one of the two cases.
Shouldn't the method be implemented as an instance method of
Win32SystemSupport, and having a class side method which simply creates a
new instance of Win32SystemSupport and delegates everything else to it,
including the #initializeStartupInfo:?

The following version of the method works:

----
CreateProcess: aProgramNameString arguments: anArgumentString creationFlags:
creationFlags
    "Create a new detached process with a specific argument list and
creationFlags.
    Answer aCCompositePointer to a PROCESS_INFORMATION struct."

    | interface startupInfo processInfo |
    interface := self new.
    startupInfo := interface STARTUPINFO gcMalloc.
    self initializeStartupInfo: startupInfo.
    processInfo := interface PROCESS_INFORMATION gcMalloc.
    interface
        CreateProcess: (aProgramNameString ifNotNil: [interface encodeWide:
aProgramNameString])
        commandLine: (interface encodeWide: anArgumentString)
        pSecurity: nil
        tSecurity: nil
        inheritHandles: 0
        creationFlags: creationFlags
        environment: nil
        currentDirectoryName: nil
        startupInfo: startupInfo
        processInfo: processInfo.

    ^processInfo
----

Best regards,
Joachim Geidel


_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: [BUG][VW 7.7 NC] Win32SystemSupport class>>CreateProcess:arguments:creationFlags: broken

Niall Ross
Dear Joachim,
    this has been fixed in 7.8 in AR 58657 "Win32SystemSupport
class>>CreateProcess:arguments:creationFlags: DNUs on encodeWide:"  The
fix is the same as your code, which users of this in 7.7 should
certainly take.

          Yours faithfully
             Niall Ross

>Win32SystemSupport class>>CreateProcess:arguments:creationFlags: sends
>#encodeWide: to self. #encodeWide: isn't implemented as a class method of
>Win32SystemSupport. The message should be sent to the temporary variable
>"interface" instead. The method also contains a superfluous
>    ... ifNil: [nil] ifNotNil: [...]
>This might of course be intentional to make absolutely clear that the result
>is nil in one of the two cases.
>Shouldn't the method be implemented as an instance method of
>Win32SystemSupport, and having a class side method which simply creates a
>new instance of Win32SystemSupport and delegates everything else to it,
>including the #initializeStartupInfo:?
>
>The following version of the method works:
>
>----
>CreateProcess: aProgramNameString arguments: anArgumentString creationFlags:
>creationFlags
>    "Create a new detached process with a specific argument list and
>creationFlags.
>    Answer aCCompositePointer to a PROCESS_INFORMATION struct."
>
>    | interface startupInfo processInfo |
>    interface := self new.
>    startupInfo := interface STARTUPINFO gcMalloc.
>    self initializeStartupInfo: startupInfo.
>    processInfo := interface PROCESS_INFORMATION gcMalloc.
>    interface
>        CreateProcess: (aProgramNameString ifNotNil: [interface encodeWide:
>aProgramNameString])
>        commandLine: (interface encodeWide: anArgumentString)
>        pSecurity: nil
>        tSecurity: nil
>        inheritHandles: 0
>        creationFlags: creationFlags
>        environment: nil
>        currentDirectoryName: nil
>        startupInfo: startupInfo
>        processInfo: processInfo.
>
>    ^processInfo
>----
>
>Best regards,
>Joachim Geidel
>
>
>_______________________________________________
>vwnc mailing list
>[hidden email]
>http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
>
>
>  
>


_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: [BUG][VW 7.7 NC] Win32SystemSupport class>>CreateProcess:arguments:creationFlags: broken

Boris Popov, DeepCove Labs (SNN)
Niall,

Is this going to be added to
http://www.cincomsmalltalk.com/ResolutionsApplication/CincomResolutionsP
ortal under 7.7 by chance?

Regards,

-Boris

--
DeepCove Labs Ltd.
+1 (604) 689-0322
4th floor, 595 Howe Street
Vancouver, British Columbia
Canada V6C 2T5
http://tinyurl.com/r7uw4

PacNet Services (Europe) Ltd.
+353 (0)61 714-360
Shannon Airport House, SFZ
County Clare, Ireland
http://tinyurl.com/y952amr

CONFIDENTIALITY NOTICE

This email is intended only for the persons named in the message header.
Unless otherwise indicated, it contains information that is private and
confidential. If you have received it in error, please notify the sender
and delete the entire message including any attachments.

Thank you.


-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On
Behalf Of Niall Ross
Sent: 15 February 2010 14:36
To: Joachim Geidel
Cc: VWNC List
Subject: Re: [vwnc] [BUG][VW 7.7 NC] Win32SystemSupport
class>>CreateProcess:arguments:creationFlags: broken

Dear Joachim,
    this has been fixed in 7.8 in AR 58657 "Win32SystemSupport
class>>CreateProcess:arguments:creationFlags: DNUs on encodeWide:"  The
fix is the same as your code, which users of this in 7.7 should
certainly take.

          Yours faithfully
             Niall Ross

>Win32SystemSupport class>>CreateProcess:arguments:creationFlags: sends
>#encodeWide: to self. #encodeWide: isn't implemented as a class method
of
>Win32SystemSupport. The message should be sent to the temporary
variable
>"interface" instead. The method also contains a superfluous
>    ... ifNil: [nil] ifNotNil: [...]
>This might of course be intentional to make absolutely clear that the
result
>is nil in one of the two cases.
>Shouldn't the method be implemented as an instance method of
>Win32SystemSupport, and having a class side method which simply creates
a
>new instance of Win32SystemSupport and delegates everything else to it,
>including the #initializeStartupInfo:?
>
>The following version of the method works:
>
>----
>CreateProcess: aProgramNameString arguments: anArgumentString
creationFlags:

>creationFlags
>    "Create a new detached process with a specific argument list and
>creationFlags.
>    Answer aCCompositePointer to a PROCESS_INFORMATION struct."
>
>    | interface startupInfo processInfo |
>    interface := self new.
>    startupInfo := interface STARTUPINFO gcMalloc.
>    self initializeStartupInfo: startupInfo.
>    processInfo := interface PROCESS_INFORMATION gcMalloc.
>    interface
>        CreateProcess: (aProgramNameString ifNotNil: [interface
encodeWide:

>aProgramNameString])
>        commandLine: (interface encodeWide: anArgumentString)
>        pSecurity: nil
>        tSecurity: nil
>        inheritHandles: 0
>        creationFlags: creationFlags
>        environment: nil
>        currentDirectoryName: nil
>        startupInfo: startupInfo
>        processInfo: processInfo.
>
>    ^processInfo
>----
>
>Best regards,
>Joachim Geidel
>
>
>_______________________________________________
>vwnc mailing list
>[hidden email]
>http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
>
>
>  
>


_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc

_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: [BUG][VW 7.7 NC] Win32SystemSupport class>>CreateProcess:arguments:creationFlags: broken

Holger Guhl
The resolution is Res97621. You need to download
/ftp.cincom.com/support/VisualWorks/VW7.7/Res97621/Res97621-2.zip. When
searching the resolution make sure to search for all states, since it's
a fresh resolution, still in TOPUBLISH.

Holger Guhl
--
Senior Consultant * Certified Scrum Master * [hidden email]
Tel: +49 231 9 75 99 21 * Fax: +49 231 9 75 99 20
Georg Heeg eK Dortmund
Handelsregister: Amtsgericht Dortmund  A 12812



Boris Popov, DeepCove Labs (YVR) schrieb:
> Niall,
>
> Is this going to be added to
> http://www.cincomsmalltalk.com/ResolutionsApplication/CincomResolutionsP
> ortal under 7.7 by chance?
>
> Regards,
>
> -Boris
_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc