Modify

Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#1056 closed Bug (Completed)

InetGet rundll32.exe error on Vista / Windows 7 on "Screen-saver" desktop

Reported by: caplant@… Owned by: Valik
Milestone: 3.3.1.5 Component: AutoIt
Version: 3.3.0.0 Severity: Blocking
Keywords: Cc:

Description

InetGet("valid url") generates an error window:
"rundll32.exe - Application Error"
"The application failed to initilize properly (0xc0000142). Click OK to terminate the application."

The issue only occurs on Windows Vista or Windows 7 when the system is displaying the "Screen-saver" desktop.
To duplicate the error:

  1. Compile this script
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
Global $getting = 0
Global $windowinfodata = 0
_EnumDesktops()

GUICreate(Default,400,280)
$url = "http://www.irs.gov/pub/irs-pdf/fw4.pdf"
$label = GUICtrlCreateLabel("No Results",10,10,200,50)
$label2 = GUICtrlCreateLabel($windowinfodata,220,10,150,300)
$input = GUICtrlCreateInput($url,10,120,350,25)
$buttonI = GUICtrlCreateButton("InetGet Input", 10, 150)
$buttonP = GUICtrlCreateButton("Run Input", 10, 180)
$buttonIE = GUICtrlCreateButton("Run Internet Explorer", 10, 210)
$buttonD = GUICtrlCreateButton("Get Desktops", 10, 240)
GUISetState(@SW_SHOW)

; Run the GUI until the dialog is closed
While 1
	$msg = GUIGetMsg()
	Select
	Case $msg = $GUI_EVENT_CLOSE 
		GUIDelete()	
		Exit
	Case $msg = $buttonD
		GUICtrlSetData($label2, "")
		Sleep(100)
		_EnumDesktops()
		GUICtrlSetData($label2, $windowinfodata)
	Case $msg = $buttonI
		$url = GUICtrlRead($input)
		$new = InetGet($url,@TempDir & "\" & StringMid($url,StringInStr($url,"/",0,-1)+1),1,1)
		$getting = 1
		GUICtrlSetData($label, $new)
	Case $msg = $buttonP
		$url = GUICtrlRead($input)
		$new = Run($url)
		GUICtrlSetData($label, "ProcessID: " & $new)
	Case $msg = $buttonIE
		$new = Run("C:\Program Files\Internet Explorer\iexplore.exe")
		GUICtrlSetData($label, "ProcessID: " & $new)
	Case Else
		;nothing
	EndSelect
	If $getting = 1 Then
		GUICtrlSetData($label, @InetGetBytesRead)
		If @InetGetActive = 0 Then
			$getting = 0
			GUICtrlSetData($label, @InetGetBytesRead & " done.")
		EndIf	
	EndIf
WEnd
GUIDelete()
Exit

;enum desktops
Func _EnumDesktops()
	$windowinfodata = ""
	$HWNDWindowStation = DllCall("user32.dll", "HWnd", "GetProcessWindowStation")
	$handle2 =  DLLCallbackRegister("_EnumDesktopProc", "int", "str;lParam")     
	DllCall("user32.dll", "int", "EnumDesktops", "HWnd", $HWNDWindowStation[0], "ptr", DllCallbackGetPtr($handle2), "lparam", 10)
EndFunc

Func _EnumDesktopProc($lpszDesktop, $lParam)
	$windowinfodata = "Desktop: " & $lpszDesktop & @CRLF & $windowinfodata
	Return 1
EndFunc

  1. Rename the script from .exe to .scr.
  2. Copy the script to C:\Windows\System32\
  3. In C:\Windows\System32\ Right-click on the script scr & select install.
  4. Close the script when it runs.
  5. In Screen Saver Settings check On resume, display logon screen.
  6. Close Screen Saver Settings and wait for screen saver to start.
  7. Click InetGet Input.
  8. Error 0xc0000142 should be displayed.

I have tested with Vista / Windows 7 / IE7 / IE8 / AutoIt 3.3.0.0 / AutoIt 3.3.1.1 all fail.
It does not error on Windows XP.
Stumbled across this while implamenting automatic update functionality into a screen saver.
The "Screen-saver" desktop is created only when "On resume, display logon screen" is checked.

Attachments (0)

Change History (11)

comment:1 Changed 10 years ago by Jpm

  • Resolution set to Fixed
  • Status changed from new to closed

You cannot run under screen saver a function which need to be loggin as you request the "On Resume, display logon screen" which means that when the screen saver fire no user are logon

comment:2 Changed 10 years ago by Jpm

  • Resolution Fixed deleted
  • Status changed from closed to reopened

comment:3 Changed 10 years ago by Jpm

  • Resolution set to No Bug
  • Status changed from reopened to closed

comment:4 in reply to: ↑ description Changed 10 years ago by Caplan77

The user is still logged in when the locked Screen-saver desktop is displayed.
The only change is the active desktop, that is why I included a button for Internet Explorer in my example because IE runs fine & even downloads files.
If you check SysInternals process explorer you will see what I mean. The screen saver is run as the logged in user, even when the desktop is locked.
The system creates a second desktop called Screen-saver, switches to it, & runs the app. The regular "Default" desktop still exists, it just doesn't have focus.

InetGet() works properly at the system login prompt (not the user locked desktop login).
At system login screen the screen saver is run by SYSTEM on XP & LOCAL SERVICE on Vista/W7, so the theory that a user needs to be logged into the PC for InetGet() to work is incorrect.

It's definitely a bug of some kind. Please, please take a look before closing the ticket again.

comment:5 Changed 10 years ago by Jpm

  • Resolution No Bug deleted
  • Status changed from closed to reopened

I reopen so Valik or other dev can have a look. For me the security token is not validate when this screen saver run that's the reason of the failure

comment:6 Changed 10 years ago by Jpm

  • Owner set to Valik
  • Status changed from reopened to assigned

comment:7 Changed 10 years ago by Valik

  • Severity changed from None to Blocking

comment:8 Changed 10 years ago by Valik

Well that's kind of obscure. By default AutoIt sets a flag to force you online before it tries to use your connection. On Vista/Windows 7 the OS apparently tries to force you online even when you are already online. I guess the "force online" stuff is shelled off to rundll32.exe or something which fails.

It's a pretty simple fix. I'll add a flag along the lines of "do not force online state" which will by-pass the setting of the flag. This will leave the default behavior as is but provide the option to by-pass the check for people who don't need it or can't use it.

comment:9 Changed 10 years ago by Valik

Addendum: I figured this out by modifying the script to run Process Explorer so I could see what process was running when I hit the button and received the error message. From there I found this which didn't work but did give me enough of a hint to know what to test in AutoIt.

comment:10 Changed 10 years ago by Valik

  • Milestone set to 3.3.1.5
  • Resolution set to Completed
  • Status changed from assigned to closed

Added by revision [5347] in version: 3.3.1.5

comment:11 Changed 10 years ago by Valik

This has been solved in 3.3.1.5 thanks to a new option for InetGet(). See the documentation in 3.3.1.5 for the new flag.

Guidelines for posting comments:

  • You cannot re-open a ticket but you may still leave a comment if you have additional information to add.
  • In-depth discussions should take place on the forum.

For more information see the full version of the ticket guidelines here.

Add Comment

Modify Ticket

Action
as closed The owner will remain Valik.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.