Re: Call DLL sets WinLastError to 203
Marcus,
I have added the SetLastError(0) API to the runtime (just before the "Call
DLL" function is executed) to clear the last error code.
This is your test project compiled with the modified runtime:
http://www.lindersoft.com/projects/t...terrorsetA.zip
Does this change anything?
Friedrich
Re: Call DLL sets WinLastError to 203
BTW, this is just to find out whether the "Call DLL" function sets this
error code.
Friedrich
Re: Call DLL sets WinLastError to 203
|10/28/2013|14:40:05.330|Logging started:
C:\ProgramData\AIDAOrga\Logs\test_setlasterrorsetA .exe
|10/28/2013|14:40:05.332|Resource:
0001.lib->C:\Users\HOFMEI~1\AppData\Local\Temp\~SB58F4.tm p
|10/28/2013|14:40:05.335|RichEdID: 1
|10/28/2013|14:40:05.335|Set Variable {SELLNG} to 1033
|10/28/2013|14:40:05.352|InitScriptBegin
|10/28/2013|14:40:05.352|Set Variable {NULL} to
|10/28/2013|14:40:05.353|Set Variable {SB5VAR1} to
|10/28/2013|14:40:05.353|Set Variable {SB5VAR2} to
|10/28/2013|14:40:05.353|Set Variable {SB5VAR3} to
|10/28/2013|14:40:05.353|Set Variable %_SB_ERRORCODE% to
|10/28/2013|14:40:05.353|Set Variable %_SB_RETURN% to
|10/28/2013|14:40:05.353|Set Variable %_SB_RETURNEX% to
|10/28/2013|14:40:05.353|Set Variable %_SB_RESUME% to 0
|10/28/2013|14:40:05.353|Set Variable %_SB_TMP% to
|10/28/2013|14:40:05.353|Set Variable %_SB_PARAM1% to
|10/28/2013|14:40:05.353|Set Variable %_SB_PARAM2% to
|10/28/2013|14:40:05.353|Set Variable %_SB_PARAM3% to
|10/28/2013|14:40:05.353|Set Variable %_SB_PARAM4% to
|10/28/2013|14:40:05.353|Set Variable %_SB_PARAM5% to
|10/28/2013|14:40:05.353|Set Variable %_SB_DIALOGID% to 0
|10/28/2013|14:40:05.353|Set Variable %_SB_DIALOGNEXTID% to 0
|10/28/2013|14:40:05.353|Set Variable %_SB_DIALOGMAX% to 0
|10/28/2013|14:40:05.353|Set Variable %_SB_BUTTONID% to 0
|10/28/2013|14:40:05.353|Set Variable %_SB_CONTROLID% to 0
|10/28/2013|14:40:05.353|Set Variable %_SB_EVENTID% to 0
|10/28/2013|14:40:05.353|Set Variable %_SB_WIZHWND% to 0
|10/28/2013|14:40:05.353|Set Variable %_SB_FEATURESID% to _0000_
|10/28/2013|14:40:05.353|Set Variable %_SB_SETUPTYPEID% to 0
|10/28/2013|14:40:05.353|Set Variable %_SB_USERNAME% to Microsoft
|10/28/2013|14:40:05.353|Set Variable %_SB_USERCOMPANY% to Microsoft
|10/28/2013|14:40:05.353|Set Variable %_SB_USERSERIAL% to
|10/28/2013|14:40:05.353|Set Variable %_SB_PASSWORD% to
|10/28/2013|14:40:05.353|Set Variable {WINVER} to 1024
|10/28/2013|14:40:05.353|Set Variable %WINVER% to 1024
|10/28/2013|14:40:05.353|Set Variable %SYSLNG% to 1031
|10/28/2013|14:40:05.353|Set Variable {CURLNG} to 1033
|10/28/2013|14:40:05.353|Set Variable %CURLNG% to 1033
|10/28/2013|14:40:05.353|Set Variable {WINDIR} to C:\Windows
|10/28/2013|14:40:05.353|Set Variable %WINDIR% to C:\Windows
|10/28/2013|14:40:05.353|Set Variable {SYSDIR} to %WINDIR%\System
|10/28/2013|14:40:05.353|Set Variable %SYSDIR% to %WINDIR%\System
|10/28/2013|14:40:05.353|Set Variable {SYS32DIR} to C:\Windows\SysWOW64
|10/28/2013|14:40:05.353|Set Variable %SYS32DIR% to C:\Windows\SysWOW64
|10/28/2013|14:40:05.358|Set Variable {FONTSDIR} to C:\Windows\Fonts
|10/28/2013|14:40:05.358|Set Variable %FONTSDIR% to C:\Windows\Fonts
|10/28/2013|14:40:05.358|Set Variable {TMPDIR} to
C:\Users\HOFMEI~1\AppData\Local\Temp\35c25c10-3fd7-11e3-4823-019758f00029
|10/28/2013|14:40:05.358|Set Variable %TMPDIR% to
C:\Users\HOFMEI~1\AppData\Local\Temp\35c25c10-3fd7-11e3-4823-019758f00029
|10/28/2013|14:40:05.358|Set Variable %TMPWINDIR% to
C:\Users\HOFMEI~1\AppData\Local\Temp
|10/28/2013|14:40:05.358|Set Variable %_SB_BACKUPDIR% to
C:\Users\HOFMEI~1\AppData\Local\Temp
|10/28/2013|14:40:05.358|Set Variable {PROGRAMFILESDIR} to C:\Program
Files (x86)
|10/28/2013|14:40:05.358|Set Variable %PROGRAMFILESDIR% to C:\Program
Files (x86)
|10/28/2013|14:40:05.358|Set Variable {COMMONFILESDIR} to C:\Program
Files (x86)\Common Files
|10/28/2013|14:40:05.358|Set Variable %COMMONFILESDIR% to C:\Program
Files (x86)\Common Files
|10/28/2013|14:40:05.358|Set Variable {PRIVILEGES} to Admin
|10/28/2013|14:40:05.358|Set Variable %PRIVILEGES% to Admin
|10/28/2013|14:40:05.358|Set Variable %_SB_INSTALLERFLAG% to
000110000000000001000000000000
|10/28/2013|14:40:05.358|Set Variable {CURDIR} to
C:\ProgramData\AIDAOrga\Logs
|10/28/2013|14:40:05.358|Set Variable %CURDIR% to
C:\ProgramData\AIDAOrga\Logs
|10/28/2013|14:40:05.358|Set Variable %_SB_ROOT% to
|10/28/2013|14:40:05.358|Set Variable %_SB_INSTALLDIR% to
|10/28/2013|14:40:05.358|Set Variable %_SB_ROOT% to
|10/28/2013|14:40:05.358|Set Variable {SRCDRV} to C:
|10/28/2013|14:40:05.358|Set Variable %SRCDRV% to C:
|10/28/2013|14:40:05.358|Set Variable %_SB_PROGRAMGROUP% to
|10/28/2013|14:40:05.358|Set Variable %_SB_DISKSPACEREQ% to 0
|10/28/2013|14:40:05.358|Set Variable %_SB_DISKSPACEFREE% to 0
|10/28/2013|14:40:05.360|Set Variable %_CSIDL_DESKTOP% to
C:\Users\hofmeister\Desktop
|10/28/2013|14:40:05.362|Set Variable %_CSIDL_PROGRAMS% to
C:\Users\hofmeister\AppData\Roaming\Microsoft\Wind ows\Start Menu\Programs
|10/28/2013|14:40:05.364|Set Variable %_CSIDL_PERSONAL% to
C:\Users\hofmeister\Documents
|10/28/2013|14:40:05.366|Set Variable %_CSIDL_FAVORITES% to
C:\Users\hofmeister\Favorites
|10/28/2013|14:40:05.368|Set Variable %_CSIDL_STARTUP% to
C:\Users\hofmeister\AppData\Roaming\Microsoft\Wind ows\Start
Menu\Programs\Startup
|10/28/2013|14:40:05.370|Set Variable %_CSIDL_RECENT% to
C:\Users\hofmeister\AppData\Roaming\Microsoft\Wind ows\Recent
|10/28/2013|14:40:05.371|Set Variable %_CSIDL_SENDTO% to
C:\Users\hofmeister\AppData\Roaming\Microsoft\Wind ows\SendTo
|10/28/2013|14:40:05.373|Set Variable %_CSIDL_STARTMENU% to
C:\Users\hofmeister\AppData\Roaming\Microsoft\Wind ows\Start Menu
|10/28/2013|14:40:05.374|Set Variable %_CSIDL_DESKTOPDIRECTORY% to
C:\Users\hofmeister\Desktop
|10/28/2013|14:40:05.376|Set Variable %_CSIDL_NETHOOD% to
C:\Users\hofmeister\AppData\Roaming\Microsoft\Wind ows\Network Shortcuts
|10/28/2013|14:40:05.376|Set Variable %_CSIDL_FONTS% to C:\Windows\Fonts
|10/28/2013|14:40:05.378|Set Variable %_CSIDL_TEMPLATES% to
C:\Users\hofmeister\AppData\Roaming\Microsoft\Wind ows\Templates
|10/28/2013|14:40:05.379|Set Variable %_CSIDL_COMMON_STARTMENU% to
C:\ProgramData\Microsoft\Windows\Start Menu
|10/28/2013|14:40:05.381|Set Variable %_CSIDL_COMMON_PROGRAMS% to
C:\ProgramData\Microsoft\Windows\Start Menu\Programs
|10/28/2013|14:40:05.382|Set Variable %_CSIDL_COMMON_STARTUP% to
C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup
|10/28/2013|14:40:05.384|Set Variable %_CSIDL_COMMON_DESKTOPDIRECTORY%
to C:\Users\Public\Desktop
|10/28/2013|14:40:05.385|Set Variable %_CSIDL_APPDATA% to
C:\Users\hofmeister\AppData\Roaming
|10/28/2013|14:40:05.386|Set Variable %_CSIDL_PRINTHOOD% to
C:\Users\hofmeister\AppData\Roaming\Microsoft\Wind ows\Printer Shortcuts
|10/28/2013|14:40:05.387|Set Variable %_CSIDL_LOCAL_APPDATA% to
C:\Users\hofmeister\AppData\Local
|10/28/2013|14:40:05.388|Set Variable %_CSIDL_COMMON_APPDATA% to
C:\ProgramData
|10/28/2013|14:40:05.389|Set Variable %_CSIDL_PROGRAM_FILES% to
C:\Program Files (x86)
|10/28/2013|14:40:05.390|Set Variable %_CSIDL_PROGRAM_FILES_COMMON% to
C:\Program Files (x86)\Common Files
|10/28/2013|14:40:05.391|Set Variable %_CSIDL_COMMON_DOCUMENTS% to
C:\Users\Public\Documents
|10/28/2013|14:40:05.393|Set Variable %_CSIDL_RESOURCES% to
C:\Windows\Resources
|10/28/2013|14:40:05.393|RunScriptBegin
|10/28/2013|14:40:05.393|Global: Start
|10/28/2013|14:40:05.393|Set Variable %_SB_DISKSPACEREQ% to 0
|10/28/2013|14:40:05.393|Set Variable {IDEPLOY_CLI} to IDEPLOY.CLI
|10/28/2013|14:40:05.393|sbkernel: 8.1.4210 : WinID: 1024 : HTTP_Timeout : 0
|10/28/2013|14:40:05.393|Global: End
|10/28/2013|14:40:05.393|SetLastError(0)
|10/28/2013|14:40:05.393|@CALLDLL kernel32.dll : SetLastError
|10/28/2013|14:40:05.393|Set Variable %_SB_RETURN% to 0
|10/28/2013|14:40:05.393|SetLastError(0)
|10/28/2013|14:40:05.393|@CALLDLL kernel32.dll : GetLastError
|10/28/2013|14:40:05.393|Set Variable %_SB_RETURN% to 203
|10/28/2013|14:40:05.393|RunScriptEnd
|10/28/2013|14:40:05.393|InitScriptBeforeScriptClose
|10/28/2013|14:40:05.393|InitScriptEnd
|10/28/2013|14:40:05.393|ShutDown1
|10/28/2013|14:40:05.393|ShutDown2
|10/28/2013|14:40:05.393|ShutDown3
|10/28/2013|14:40:05.393|RebootStatus: 0
|10/28/2013|14:40:05.393|ShutDown4
|10/28/2013|14:40:05.393|ShutDown5
|10/28/2013|14:40:05.443|ShutDown6
|10/28/2013|14:40:05.443|ShutDown7
|10/28/2013|14:40:05.443|ShutDown8
|10/28/2013|14:40:05.444|ShutDown9
|10/28/2013|14:40:05.444|FreeDialogQueueMemoryBegin
|10/28/2013|14:40:05.444|FreeDialogQueueMemoryEnd
|10/28/2013|14:40:05.444|ShutDown10
|10/28/2013|14:40:05.444|ShutDown11
|10/28/2013|14:40:05.444|Logging terminated
Markus Zander
Re: Call DLL sets WinLastError to 203
FWIW, I get a %_SB_RETURN% of 2 if I comment out the SetLastError and
zero with the SetLastError() in place.
This is on Markus' script.
The SetLastError() seems like a reasonable way de-undefine the last
error.
SB7 had the exact same behavior.
Jeff Slarve
www.jssoftware.com
www.twitter.com/jslarve
I'll search help files & Google for you.
Re: Call DLL sets WinLastError to 203
> |10/28/2013|14:40:05.393|SetLastError(0)
> |10/28/2013|14:40:05.393|@CALLDLL kernel32.dll : SetLastError
> |10/28/2013|14:40:05.393|Set Variable %_SB_RETURN% to 0
> |10/28/2013|14:40:05.393|SetLastError(0)
> |10/28/2013|14:40:05.393|@CALLDLL kernel32.dll : GetLastError
> |10/28/2013|14:40:05.393|Set Variable %_SB_RETURN% to 203
Okay, that means the "GetLastError" value is definitely set in the "Call
DLL" function.
I have removed all environment variables in Windows 7 (expect the following
ones) and still do not see ERROR_ENVVAR_NOT_FOUND:
NUMBER_OF_PROCESSORS
OS
PROCESSOR_ARCHITECTURE
PROCESSOR_IDENTIFIER
PROCESSOR_LEVEL
PROCESSOR_REVISION
windir
I'll add some more event messages to find out which API sets the error code.
Friedrich
Re: Call DLL sets WinLastError to 203
I have added more event log "breakpoints".
This is your test project compiled with the modified runtime:
http://www.lindersoft.com/projects/t...terrorsetB.zip
c:\test\test_setlasterrorsetB.exe /E2 "c:\test\test.txt"
Could you please post the resulting event log?
Thanks,
Friedrich
Re: Call DLL sets WinLastError to 203
|10/28/2013|16:05:10.879|RunScriptBegin
|10/28/2013|16:05:10.879|Global: Start
|10/28/2013|16:05:10.879|Set Variable %_SB_DISKSPACEREQ% to 0
|10/28/2013|16:05:10.879|Set Variable {IDEPLOY_CLI} to IDEPLOY.CLI
|10/28/2013|16:05:10.879|sbkernel: 8.1.4210 : WinID: 1024 : HTTP_Timeout : 0
|10/28/2013|16:05:10.879|Global: End
|10/28/2013|16:05:10.880|@CALLDLL kernel32.dll : SetLastError
|10/28/2013|16:05:10.880|@GETLASTERROR_1 2
|10/28/2013|16:05:10.880|@GETLASTERROR_2 2
|10/28/2013|16:05:10.880|@GETLASTERROR_7 2
|10/28/2013|16:05:10.880|@GETLASTERROR_8 203
|10/28/2013|16:05:10.880|@GETLASTERROR_9 203
|10/28/2013|16:05:10.880|@GETLASTERROR_10 203
|10/28/2013|16:05:10.880|@GETLASTERROR_11 203
|10/28/2013|16:05:10.880|@GETLASTERROR_12 203
|10/28/2013|16:05:10.880|@GETLASTERROR_13 203
|10/28/2013|16:05:10.880|@GETLASTERROR_14 203
|10/28/2013|16:05:10.880|@GETLASTERROR_15 203
|10/28/2013|16:05:10.880|@GETLASTERROR_16 203
|10/28/2013|16:05:10.880|@GETLASTERROR_17 0
|10/28/2013|16:05:10.880|@GETLASTERROR_19 0
|10/28/2013|16:05:10.880|@GETLASTERROR_20 0
|10/28/2013|16:05:10.880|@GETLASTERROR_21 0
|10/28/2013|16:05:10.880|@GETLASTERROR_22 0
|10/28/2013|16:05:10.880|@GETLASTERROR_23 0
|10/28/2013|16:05:10.880|@GETLASTERROR_24 0
|10/28/2013|16:05:10.880|Set Variable %_SB_RETURN% to 0
|10/28/2013|16:05:10.880|SetLastError(0)
|10/28/2013|16:05:10.880|@CALLDLL kernel32.dll : GetLastError
|10/28/2013|16:05:10.880|@GETLASTERROR_1 0
|10/28/2013|16:05:10.880|@GETLASTERROR_2 0
|10/28/2013|16:05:10.880|@GETLASTERROR_7 0
|10/28/2013|16:05:10.880|@GETLASTERROR_8 203
|10/28/2013|16:05:10.880|@GETLASTERROR_9 203
|10/28/2013|16:05:10.880|@GETLASTERROR_10 203
|10/28/2013|16:05:10.880|@GETLASTERROR_11 203
|10/28/2013|16:05:10.880|@GETLASTERROR_12 203
|10/28/2013|16:05:10.880|@GETLASTERROR_13 203
|10/28/2013|16:05:10.880|@GETLASTERROR_16 203
|10/28/2013|16:05:10.880|@GETLASTERROR_17 203
|10/28/2013|16:05:10.880|@GETLASTERROR_19 203
|10/28/2013|16:05:10.880|@GETLASTERROR_20 203
|10/28/2013|16:05:10.880|@GETLASTERROR_21 203
|10/28/2013|16:05:10.880|@GETLASTERROR_22 203
|10/28/2013|16:05:10.880|@GETLASTERROR_23 203
|10/28/2013|16:05:10.880|@GETLASTERROR_24 203
|10/28/2013|16:05:10.880|Set Variable %_SB_RETURN% to 203
|10/28/2013|16:05:10.880|SetLastError(0)
|10/28/2013|16:05:10.880|RunScriptEnd
Am 28.10.2013 16:01, schrieb Friedrich Linder:
> /E2 "c:\test\test.txt"
Markus Zander
Re: Call DLL sets WinLastError to 203
> |10/28/2013|16:05:10.879|RunScriptBegin
> |10/28/2013|16:05:10.879|Global: Start
> |10/28/2013|16:05:10.879|Set Variable %_SB_DISKSPACEREQ% to 0
> |10/28/2013|16:05:10.879|Set Variable {IDEPLOY_CLI} to IDEPLOY.CLI
> |10/28/2013|16:05:10.879|sbkernel: 8.1.4210 : WinID: 1024 : HTTP_Timeout :
> 0
> |10/28/2013|16:05:10.879|Global: End
> |10/28/2013|16:05:10.880|@CALLDLL kernel32.dll : SetLastError
> |10/28/2013|16:05:10.880|@GETLASTERROR_1 2
> |10/28/2013|16:05:10.880|@GETLASTERROR_2 2
> |10/28/2013|16:05:10.880|@GETLASTERROR_7 2
> |10/28/2013|16:05:10.880|@GETLASTERROR_8 203
> |10/28/2013|16:05:10.880|@GETLASTERROR_9 203
Okay, it happens between "breakpoint" 7 and 8:
This is the original "C" source code:
---
wsprintf(TmpString1, "@GETLASTERROR_7 %i", GetLastError());
LogAction(TmpString1, ScriptLogHandle, g_DebugMode);
hInst = LoadLibrary(Para1);
wsprintf(TmpString1, "@GETLASTERROR_8 %i", GetLastError());
LogAction(TmpString1, ScriptLogHandle, g_DebugMode);
---
That means, the LoadLibrary Windows API sets the last-error value to
ERROR_ENVVAR_NOT_FOUND on this machine.
Friedrich
Re: Call DLL sets WinLastError to 203
In other words, LoadLibrary("kernel32.dll"); sets the last-error value to
ERROR_ENVVAR_NOT_FOUND on this machine.
Friedrich
Re: Call DLL sets WinLastError to 203
Also, I ran that same test.exe on 3 different machines. Without the
SetLastError(), all return 2.
Jeff Slarve
www.jssoftware.com
www.twitter.com/jslarve
I'll search help files & Google for you.