Error while trying to update

Error while trying to update

Postby Willes » 28.06.2018, 13:44

After running UpdateInstaller, I get the following error when running Start :

Error #0 (API error code 203) when calling Wow64DisableWow64FsRedirection

Trying to update Win7 64 bit machines which cannot connect to the Internet.

Any help please
Willes
 
Posts: 1
Joined: 28.06.2018, 13:28

Re: Error while trying to update

Postby Dalai » 28.06.2018, 16:55

Hi, and welcome to the forum :)

Do you use the latest version of WSUS Offline (11.4)? Where is your WSUS Offline located (local disk, network share, external drive)? Also, please post the output of the SET command on a CMD.

For other readers: Error 203 means
Code: Select all
ERROR_ENVVAR_NOT_FOUND
    203 (0xCB)
    The system could not find the environment option that was entered.


Regards
Dalai
Dalai
 
Posts: 609
Joined: 12.07.2016, 22:00

Re: Error while trying to update

Postby Bernd » 06.09.2018, 20:01

Hello Dalai,

I just registered to inform you that I have exactly the same problem (same error number).
And I also have a solution but it requires to change the UpdateInstaller.au3 script.

The problem lies in how the function GetLastError( ) is applied.
GetLastError( ) retrieves the result of the last called API function.
But if you call an API function like Wow64DisableWow64FsRedirection via DllCall, the AutoIT Runtime probably calls some additional API functions before and after calling the desired function.
Therefore GetLastError does not retrieve the result of Wow64DisableWow64FsRedirection but the result of the last API function that the AutoIT Runtime called.
You can verify this if you check the boolean return value of Wow64DisableWow64FsRedirection.
Wow64DisableWow64FsRedirection succeeded (TRUE) but GetLastError( ) still returns an error value (203).

The only reliable way to check the result of the Wow64DisableWow64FsRedirection call is to check the boolean return value.
Using GetLastError( ) is not reliable.

You would have to change
Code: Select all
DllCall("kernel32.dll", "bool", "Wow64DisableWow64FsRedirection", "ptr*", DllStructGetPtr($pRedirect))
If (@error <> 0) OR (_WinAPI_GetLastError() <> 0) Then
  ...
EndIf


to something like this:
Code: Select all
Dim $aDllCallResult
$aDllCallResult = DllCall("kernel32.dll", "bool", "Wow64DisableWow64FsRedirection", "ptr", DllStructGetPtr($pRedirect, 1))
If (@error <> 0) OR ($aDllCallResult[0] = 0) Then
  ...
EndIf


Regards,
Bernd
Bernd
 
Posts: 1
Joined: 06.09.2018, 19:11

Re: Error while trying to update

Postby Dalai » 06.09.2018, 20:43

Hello Bernd,

you're probably right that GetLastError may not be reliable, but it's required nontheless to retrieve the error code to hopefully find out what exactly went wrong.

Furthermore, I'd rather write the code like this (because you should never directly compare a bool to an integer value):
Code: Select all
Dim $aDllCallResult
$aDllCallResult = DllCall("kernel32.dll", "bool", "Wow64DisableWow64FsRedirection", "ptr", DllStructGetPtr($pRedirect, 1))
If (@error <> 0) OR (NOT $aDllCallResult[0]) Then
  ...
; use _WinAPI_GetLastError() to add the error code to the message shown to the user
EndIf

Apart from that, good and useful post :). Thanks.

Regards
Dalai
Dalai
 
Posts: 609
Joined: 12.07.2016, 22:00


Return to Installation / Updating

Who is online

Users browsing this forum: Dalai and 24 guests