New dbghelp.dll (v6.6.3.5) can´t load module infos...

12 Aufrufe
Direkt zur ersten ungelesenen Nachricht

Jochen Kalmbach [MVP]

ungelesen,
01.02.2006, 16:22:5401.02.06
an
Hi!

The function "SymGetModuleInfo64" does not work and always returns FALSE...
The same code works on all previous version of dbghelp.dll...

<code>
#include <atlbase.h>
#include <atlconv.h>
#include <windows.h>
#include <tchar.h>
#include <assert.h>
#include <tlhelp32.h>
#include <dbghelp.h>
#pragma comment(lib, "dbghelp.lib")

int _tmain()
{
HANDLE hProc = GetCurrentProcess();
BOOL bRet = SymInitialize(hProc, NULL, FALSE);
assert(bRet != FALSE);
HANDLE hSnap = CreateToolhelp32Snapshot(TH32CS_SNAPMODULE,
GetCurrentProcessId());
assert(hSnap != INVALID_HANDLE_VALUE);

MODULEENTRY32 exeMod;
exeMod.dwSize = sizeof(exeMod);
bRet = Module32First(hSnap, &exeMod);
assert(bRet != FALSE);

DWORD64 baseAddr = SymLoadModule64(hProc, NULL,
CT2CA(exeMod.szExePath), CT2CA(exeMod.szModule), (DWORD64)
exeMod.modBaseAddr, exeMod.modBaseSize);
assert(baseAddr != 0);
IMAGEHLP_MODULE64 modInfo;
ZeroMemory(&modInfo, sizeof(modInfo));
modInfo.SizeOfStruct = sizeof(modInfo);
bRet = SymGetModuleInfo64(hProc, baseAddr, &modInfo);
assert(bRet != FALSE);
SymCleanup(hProc);
return 0;
}
</code>

Even is you specify the path in SymInitialize to all the symbols, it has
the same effect... it fails...

I´m starting to hate new releases of windbg... this is at least the
second time that a new release has some "changes" in dbghelp.dll...


I think the windbg team should hire some testers asap!!!

--
Greetings
Jochen

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

Jochen Kalmbach [MVP]

ungelesen,
01.02.2006, 16:48:2001.02.06
an

> The function "SymGetModuleInfo64" does not work and always returns FALSE...

Also it seems that it does not use the provided "SizeOfStruct" and
simply overwrites memory which is larger than this provided struct. Even
if the call to this method failed...

You can simply prove this by using the following

IMAGEHLP_MODULE64 *modInfo = new IMAGEHLP_MODULE64;
ZeroMemory(modInfo, sizeof(IMAGEHLP_MODULE64));
modInfo->SizeOfStruct = sizeof(IMAGEHLP_MODULE64);
bRet = SymGetModuleInfo64(hProc, baseAddr, modInfo);
delete modInfo; // here you will get a CRT asserting... (Heap
block at 00AB2F80 modified at 00AB31F4 past requested size of 26c)


What is the recommended solution to these bugs?

Pat Styles

ungelesen,
01.02.2006, 18:57:1301.02.06
an
Hello Jochen.

I have tried out your code and it worked just fine here using our latest
bits. So am I wondering if something else might be the matter. What
version of dbghelp are you using? Also, from where did you get the header
and lib that you used to build? You might send me a copy of the header
direct to my email at pat.s...@microsoft.com.

I think we need to work out this problem before addressing the other issue
you raised. They may be related.

.pat styles (microsoft)

"Jochen Kalmbach [MVP]" <nospam-Joch...@holzma.de> wrote in message
news:uyWvtW3J...@TK2MSFTNGP14.phx.gbl...

Jochen Kalmbach [MVP]

ungelesen,
02.02.2006, 01:53:4002.02.06
an
Hi Pat!

> I have tried out your code and it worked just fine here using our latest
> bits. So am I wondering if something else might be the matter. What
> version of dbghelp are you using?

The latest beta: v6.6.3.5
Be sure that you put this version into the same dir as your EXE!


> Also, from where did you get the header
> and lib that you used to build?

I compiled with VC7.1 (and also the LIBs from this version).
OS: XP-SP2


> You might send me a copy of the header
> direct to my email at pat.s...@microsoft.com.

I think you should have it ;-)
But let me know if I should sent you the project / files!

> I think we need to work out this problem before addressing the other issue
> you raised. They may be related.

Maybe...

Pat Styles

ungelesen,
02.02.2006, 10:42:3102.02.06
an
Hello Jochen.

If you run against the latest version of dbghelp, it is advisable to use the
lib and header that came with it, and not the one in VC7. That might be
your problem.

.pat styles (microsoft)

"Jochen Kalmbach [MVP]" <nospam-Joch...@holzma.de> wrote in message

news:OlLP%23V8JG...@TK2MSFTNGP11.phx.gbl...

Jochen Kalmbach [MVP]

ungelesen,
02.02.2006, 13:28:3402.02.06
an
Hi Pat!

> If you run against the latest version of dbghelp, it is advisable to use the
> lib and header that came with it, and not the one in VC7. That might be
> your problem.

I don´t think this is the right answer ;-(
Why the heck do you think you must compile and link with the (form your
point) correct version of H/LIB???

If this would really be the case, then you never talked to the PSDK/DDK
team!
Can you please explain to me why do you make such a statement?
Also can you please refer the documentation that the h/lib files are
neither upward nor downward compatible???


Also it has nothing to do with the LIB, becaus it only contains
import-entries for the DLL. So there is no LIB-specific dependecy.

The bug is definitiv in the dbghel.dll not the LIB!

Jochen Kalmbach [MVP]

ungelesen,
02.02.2006, 13:35:0102.02.06
an
Hi Pat

> If you run against the latest version of dbghelp, it is advisable to use the
> lib and header that came with it, and not the one in VC7. That might be
> your problem.

I am really upset about your statement...

Why have you added a "SizeOfStruct" field to the "IMAGEHLP_MODULE64"
struct???? Was this just a bad joke? and now never reads it again???

I really can´t understand the dbghelp-team...

Pat Styles

ungelesen,
02.02.2006, 15:55:2102.02.06
an
Hello Jochen.

The behavior in SymLoadModule64 is not deliberate and is fixed in upcoming
releases. However to use the version in this beta, you will have to use the
header that ships with it.

.pat styles (microsoft)

"Jochen Kalmbach [MVP]" <nospam-Joch...@holzma.de> wrote in message

news:uQQcidCK...@TK2MSFTNGP10.phx.gbl...

Jochen Kalmbach [MVP]

ungelesen,
02.02.2006, 16:24:4502.02.06
an
Hi Pat!

> The behavior in SymLoadModule64 is not deliberate and is fixed in upcoming
> releases. However to use the version in this beta, you will have to use the
> header that ships with it.

That´s ok...

The problem is that it is not clearly visible that this is a beta
version... Hopefully you can fix the download-page...

Thanks!

Allen antworten
Dem Autor antworten
Weiterleiten
0 neue Nachrichten