bug in wsh 5.6 doesn't respect interfaces like 5.5 
Author Message
 bug in wsh 5.6 doesn't respect interfaces like 5.5

Hi all,

i came across a hairy bug in windows scripting host 5.6 recently:

here's the scenario, asp talking to vb objects where more than one
interface is available:

The classes:
IReportSetReadOnly   - interface
ReportSet implements IReportSetReadOnly

so in plain english i have a reportset which is created then written
to in a vb com object, then a read-only interface for asp clients is
passed back.

in the vb class:
----------------------------------
Function A() As IReportSetReadOnly
   Dim ToReturn As ReportSet
   Set ToReturn = New ReportSet
   Set A = ToReturn                   <- cast to IReportSetReadOnly
End Function
----------------------------------

In the ASP:

Set Report = VbClass.A

should return an object against the IReportSetReadOnly interface, but
instead it is returning it against the ReportSet interface. In both
5.5 and 5.6, TypeName(Report) will return ReportSet, but in 5.5 it
would actually respect the type of the return parameter. 5.6 seems to
be throwing it away and just using that of the class.

this effectively eliminates the ability to cast objects... nice!

<<extremely frustrated>>

Getting the client to revert their system to 5.5 resolved the issue.

<<relieved but still annoyed>>

I hope this helps some other hapless soul.

Regards,

Matthew Herrmann
Far Edge Pty. Ltd.



Tue, 17 Aug 2004 16:35:56 GMT  
 bug in wsh 5.6 doesn't respect interfaces like 5.5
Hi

This is a known bug introduced in the recent security fix for VBScript.dll.
Microsoft is working on the problem and will hopefully release a new bug-fixed
version in the near future.

--
torgeir

Quote:

> Hi all,

> i came across a hairy bug in windows scripting host 5.6 recently:

> here's the scenario, asp talking to vb objects where more than one
> interface is available:

> The classes:
> IReportSetReadOnly   - interface
> ReportSet implements IReportSetReadOnly

> so in plain english i have a reportset which is created then written
> to in a vb com object, then a read-only interface for asp clients is
> passed back.

> in the vb class:
> ----------------------------------
> Function A() As IReportSetReadOnly
>    Dim ToReturn As ReportSet
>    Set ToReturn = New ReportSet
>    Set A = ToReturn                   <- cast to IReportSetReadOnly
> End Function
> ----------------------------------

> In the ASP:

> Set Report = VbClass.A

> should return an object against the IReportSetReadOnly interface, but
> instead it is returning it against the ReportSet interface. In both
> 5.5 and 5.6, TypeName(Report) will return ReportSet, but in 5.5 it
> would actually respect the type of the return parameter. 5.6 seems to
> be throwing it away and just using that of the class.

> this effectively eliminates the ability to cast objects... nice!

> <<extremely frustrated>>

> Getting the client to revert their system to 5.5 resolved the issue.

> <<relieved but still annoyed>>

> I hope this helps some other hapless soul.

> Regards,

> Matthew Herrmann
> Far Edge Pty. Ltd.



Tue, 17 Aug 2004 18:24:20 GMT  
 bug in wsh 5.6 doesn't respect interfaces like 5.5
A "short term" fix...

1) Find a "good" copy of vbscript.dll
2) copy it to a temporary folder (NOT system32)
3) manually register this copy with regsvr32.exe

When the corrected fix is eventually available and installed, the system32 copy will be updated abd re-registered and the temp copy can be deleted.

This avoids issues with backleveling DLLs that are under system file protection on Win2000 and WinXP (and perhaps WinME).

--
Michael Harris
Microsoft.MVP.Scripting
Seattle WA US
--

Quote:

> Hi

> This is a known bug introduced in the recent security fix for vbscript.dll.
> Microsoft is working on the problem and will hopefully release a new bug-fixed
> version in the near future.

> --
> torgeir


> > Hi all,

> > i came across a hairy bug in windows scripting host 5.6 recently:

> > here's the scenario, asp talking to vb objects where more than one
> > interface is available:

> > The classes:
> > IReportSetReadOnly   - interface
> > ReportSet implements IReportSetReadOnly

> > so in plain english i have a reportset which is created then written
> > to in a vb com object, then a read-only interface for asp clients is
> > passed back.

> > in the vb class:
> > ----------------------------------
> > Function A() As IReportSetReadOnly
> >    Dim ToReturn As ReportSet
> >    Set ToReturn = New ReportSet
> >    Set A = ToReturn                   <- cast to IReportSetReadOnly
> > End Function
> > ----------------------------------

> > In the ASP:

> > Set Report = VbClass.A

> > should return an object against the IReportSetReadOnly interface, but
> > instead it is returning it against the ReportSet interface. In both
> > 5.5 and 5.6, TypeName(Report) will return ReportSet, but in 5.5 it
> > would actually respect the type of the return parameter. 5.6 seems to
> > be throwing it away and just using that of the class.

> > this effectively eliminates the ability to cast objects... nice!

> > <<extremely frustrated>>

> > Getting the client to revert their system to 5.5 resolved the issue.

> > <<relieved but still annoyed>>

> > I hope this helps some other hapless soul.

> > Regards,

> > Matthew Herrmann
> > Far Edge Pty. Ltd.



Wed, 18 Aug 2004 01:48:26 GMT  
 bug in wsh 5.6 doesn't respect interfaces like 5.5
The MS02-009 VBScript Security Update (Feb 14, 2002) - the English Packages
only - were all updated during last weekend to fix the error for accessing
secondary interfaces in ActiveX Objects. The packages can be downloaded
from:

<http://www.microsoft.com/windows/ie/downloads/critical/q318089/defaul...>

International customers can download the English packages -they all carry
the same bits; they differ only by the EULAs.

Regards,
Gang
This posting is provided "AS IS" with no warranties, and confers no rights.
Got .Net?  http://www.gotdotnet.com



Sat, 21 Aug 2004 10:02:05 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. WSH 5.6 bug report - StdIn.AtEndOfLine doesn't work

2. Private Constants in Class definitions still doesn't work in wsh 5.6

3. crash with WSH 5.6 beta 2 and IE 5.5

4. BUG in WSH 5.6 install if Wscript.exe is running while updating WSH

5. BUG in WSH 5.6 install if Wscript.exe is running while updating WSH

6. WSH bug status (pre-WSH 5.6 beta)

7. BUG in WSH 5.6 install if Wscript.exe is running while updating WSH

8. NUMLOCK doesn't understand SendKeys in 5.6

9. WSH 5.6 release bug (stdin/stdout)

10. wsh 5.6 beta 2 bug - floppy access during exec

11. Sessions doesn't work in Internet Explorer 5.5

12. ExecWB doesn't work in IE 5.5?

 

 
Powered by phpBB® Forum Software