Does anyone have problems with the Stackwalk-API on Windows Vista
(32bit)?

We have an application (written in VB6) which lists a callstack when
an error occurs. This works well on WXP and W2K. The code relates to
Dan Fergus' article in the VSM 05/2002 "Get Debug Info From Production
apps".

Vista: the first call to Stackwalk() returns 1 (True), the 2nd call
returns 0 with GetLastError() returning also 0.

We also tried to create the PDB-File on Vista, without success.

Call:

lRet = StackWalk(IMAGE_FILE_MACHINE_I386, _
m_hProcess, _
m_hThread, _
m_oStackFrame, _
0&, _
0&, _
m_ProcAddrSymFunctionTableAddress, _
m_ProcAddrSymGetModuleBase, _
0&)

m_hThread = GetCurrentThread()

With m_oStackFrame
.tAddrPC.lOffset = GetIP.Call
.tAddrPC.Mode = AddrModeFlat
.tAddrFrame.lOffset = GetEBP.Call
.tAddrFrame.Mode = AddrModeFlat
.tAddrStack.lOffset = GetESP.Call
.tAddrStack.Mode = AddrModeFlat
End With

Re: Vista & Stackwalk API (Dbghelp.dll) by Ivan

Ivan
Tue Jun 26 12:24:44 CDT 2007

Can you move to StackWalk64 ?
Jochen Kalmbach blog has a ton on information on how to use that API.
On average, I would expect that you need to pass valid `start-point`
information
and a valid symbol handler.

--
--
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of any included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm


<Patrick.Simons@intecsoft.com> wrote in message
news:1182851068.821883.30890@m36g2000hse.googlegroups.com...
> Does anyone have problems with the Stackwalk-API on Windows Vista
> (32bit)?
>
> We have an application (written in VB6) which lists a callstack when
> an error occurs. This works well on WXP and W2K. The code relates to
> Dan Fergus' article in the VSM 05/2002 "Get Debug Info From Production
> apps".
>
> Vista: the first call to Stackwalk() returns 1 (True), the 2nd call
> returns 0 with GetLastError() returning also 0.
>
> We also tried to create the PDB-File on Vista, without success.
>
> Call:
>
> lRet = StackWalk(IMAGE_FILE_MACHINE_I386, _
> m_hProcess, _
> m_hThread, _
> m_oStackFrame, _
> 0&, _
> 0&, _
> m_ProcAddrSymFunctionTableAddress, _
> m_ProcAddrSymGetModuleBase, _
> 0&)
>
> m_hThread = GetCurrentThread()
>
> With m_oStackFrame
> .tAddrPC.lOffset = GetIP.Call
> .tAddrPC.Mode = AddrModeFlat
> .tAddrFrame.lOffset = GetEBP.Call
> .tAddrFrame.Mode = AddrModeFlat
> .tAddrStack.lOffset = GetESP.Call
> .tAddrStack.Mode = AddrModeFlat
> End With
>



Re: Vista & Stackwalk API (Dbghelp.dll) by Jochen

Jochen
Tue Jun 26 13:03:58 CDT 2007

Hi Patrick!
> Does anyone have problems with the Stackwalk-API on Windows Vista
> (32bit)?

No... but I tried only in x64 and wow64 (x86) mode...

> lRet = StackWalk(IMAGE_FILE_MACHINE_I386, _
> m_hProcess, _
> m_hThread, _
> m_oStackFrame, _
> 0&, _
> 0&, _
> m_ProcAddrSymFunctionTableAddress, _
> m_ProcAddrSymGetModuleBase, _
> 0&)

I think you *must* provide a valid "CONTEXT"!
(the parameter after "m_oStackFrame")

The documentation says:
<quote>
However, it is recommended that this parameter contain a valid context
record. This allows StackWalk64 to handle a greater variety of situations.
</quote>

See my stackwalker:
http://www.codeproject.com/threads/StackWalker.asp

--
Greetings
Jochen

My blog about Win32 and .NET
http://blog.kalmbachnet.de/