I never tried to build WinDbg extension but encountered problems with MSVCRT8 in different projects. So few comments:
ad 1. it usually works but it is necessary to copy also the manifest. Basically, everything from directory (hey, I almost used the buzzword “folder”!) with MSVCRT redistributables from VS 2005.
ad 3. yes, it works. It is also possible to create a simple installation with MSVCRT redistributables only but don’t ask me how to do it.
ad 5. static library is the way to go if possible. It eliminates all the neverending problems. We use switched to it for our internal tools. Executables are huge but any QA person can use them with no problem. For released software we of course create installations with all necessary redistributables.
Both #1 and #3 solve problem at one OS installation only and it is necessary to repeat the procedure at any new OS/machine. It really sucks. That’s why we switched to static library.
Best regards,
Michal Vodicka
UPEK, Inc.
[xxxxx@upek.com, http://www.upek.com]
From: xxxxx@lists.osr.com[SMTP:xxxxx@lists.osr.com] on behalf of xxxxx@evitechnology.com[SMTP:xxxxx@evitechnology.com]
Reply To: Windows System Software Devs Interest List
Sent: Thursday, September 20, 2007 12:51 AM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] building debugger extension dll with longhorn
Why are you compiling for Longhorn? WinDbg Extensions are somewhat strange in that they usually compile for 2K3 no matter on what platform they are to run, so it may not cause problems. In either case, it is not the cause of your “_except_handler4_common” problem. That is, indeed, a MSVCRT8 export. MSVCRT8 is the file name; it’s resource name is still MSVCRT, so what’s happening is that Depends is finding MSVCRT.DLL, and it does not contain the export, because only MSVCRT8 has it.
This problem really deeply sucks to fix, because, unlike previous versions, MSVCRT8 uses assemblies, so just pointing your path to it does not (in my experience) fix the problem, as the assemblies force it to do otherwise. Unfortunately, I don’t have much to tell you here that will help, as this is not a problem for which I had patience when I ran it to it the first time. Here are my basic ideas, such as they are, in no particular order:
-
Try copying MSVCRT8.DLL to the same folder as your extension and see what happens. I don’t believe that this will fix it, although there is a lot out there that says that this will word. This has not been my experience, but it’s worth a shot.
-
Someone on this list told me that the solution to this problem (1) is to create something called a “Setup Project” in VS. I don’t recall who told me this, but it was someone who definitely knows what they’re doing; I just didn’t have the patience for this.
-
If you’re trying to use the extension on a machine on which you do not have VS 2005 installed, and you have an available license, install it on that machine. Not a pretty solution, but it does fix it.
-
If the sample you chose is the one based on EngExtCpp, rebuild the sources for it (provided with the WinDbg SDK) to not use MSVCRT8. This is what I usually do, but it won’t help you if you’re not using this specific sample.
-
Get out the WDK documentation and see if there is a macro that determines what/where CRT you link against. You need to make sure that you are not using the import library for MSVCRT8, but rather one of the olders ones. Option B is basically the same, but make BUILD use the static multithreaded version (-MT). I do not personally use BUILD, so I can’t help you here.
-
If you’re familiar with Makefiles, it’s quite easy and quick to write one that will compile a WinDbg Extension without using MSVCRT8; just use the -MT CL option, -NODEFAULTLIB with the linker, and specify library paths. This is what I do, if I’m not using EngExtCpp (actually, I still use a custom Makefile there as well).>
Although not exactly PC, I would recommend 6, assuming that you are familiar with Makefiles, and that you don’t get better advice. It’s easy, it works, and you can beat your head against the wall for a long time trying to get MSVCRT8 to cooperate, unless someone else here can tell you specifically what to do.
Good luck,
mm
NTDEV is sponsored by OSR
For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars
To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer