Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

GetLastError does not work on XP...


1 reply to this topic

TLA

TLA
  • Members
  • 26 posts

Posted 14 November 2001 - 16:28

Hi,

I encounter a strange problem, the GetLastError win32 api error function always returns 0 under windows XP.
Under NT, 98 and 2000 this function runs correctly.

I know that under IS 6.x this function does not work, so we can use the err.lastDllError call but IS5.5x this call does not exist.

Anybody knows a solution to retrieve correct error code?

Thx


tresselt

tresselt
  • Members
  • 1 posts

Posted 12 December 2001 - 22:55

I have encountered the same problem....  After looking around a little bit, it seems that Microsoft has changed the location of the GetLastError() function...  To see this, do a dumpbin -exports kernel32.dll.  You will see something like:

**************************************************
Dump of file kernel32.dll
.
.
.
     346  159  000684FF GetLargestConsoleWindowSize
     347  15A                               GetLastError (forwarded to NTDLL.RtlGetLastWin32Error)
     348   15B   0006E21C  GetLinguistLangSize
 .
 .
 .
************************************************

 Compare this with the output from any version of kernel32.dll before WINXP, and you will see that the function is not forwarded....

 I have tried using the RtlGetLastWin32Error() function directly in my InstallScript, but this makes no difference...   The return is always 0...

 Has anybody figured out how to solve this....??

I guess I have to convert all of the code for installing services to a custom DLL.....