Anil15

I have vista installed with Visual Studio 2005. I wrote a simple Hello.cs file and from there , tried loading a C++ dll. When Hello.exe tries loading the C++ dll, the loading fails with an error message :

"Microsoft Visual C++ Runtime Library

Runtime Error

R6034 An application has made an attemt to load the C runtime library incorrectly . Pl contact ......."

Now, i ran dependency walker on Hello.exe , used profiling then in stack trace it goes like this :

"

00:00:00.000: Started "c:\users\admin\if_sources\HELLO.EXE" (process 0xCF4) at address 0x01040000 by thread 1. Successfully hooked module.

00:00:00.000: Loaded "c:\windows\system32\NTDLL.DLL" at address 0x77910000 by thread 1. Successfully hooked module.

00:00:00.047: Loaded "c:\windows\system32\MSCOREE.DLL" at address 0x79000000 by thread 1. Successfully hooked module.

00:00:00.094: Loaded "c:\windows\system32\KERNEL32.DLL" at address 0x765A0000 by thread 1. Successfully hooked module.

00:00:00.094: DllMain(0x765A0000, DLL_PROCESS_ATTACH, 0x00000000) in "c:\windows\system32\KERNEL32.DLL" called by thread 1.

00:00:00.125: DllMain(0x765A0000, DLL_PROCESS_ATTACH, 0x00000000) in "c:\windows\system32\KERNEL32.DLL" returned 1 (0x1) by thread 1.

00:00:00.125: Injected "c:\users\admin\desktop\depends22_x86\DEPENDS.DLL" at address 0x08370000 by thread 1.

00:00:00.157: DllMain(0x79000000, DLL_PROCESS_ATTACH, 0x00000000) in "c:\windows\system32\MSCOREE.DLL" called by thread 1.

00:00:00.172: DllMain(0x08370000, DLL_PROCESS_ATTACH, 0x00000000) in "c:\users\admin\desktop\depends22_x86\DEPENDS.DLL" called by thread 1.

00:00:00.172: DllMain(0x08370000, DLL_PROCESS_ATTACH, 0x00000000) in "c:\users\admin\desktop\depends22_x86\DEPENDS.DLL" returned 1 (0x1) by thread 1.

00:00:00.172: GetProcAddress(0x765A0000 [c:\windows\system32\KERNEL32.DLL], "FlsAlloc") called from "c:\windows\system32\MSCOREE.DLL" at address 0x79005B9C and returned 0x765CAB08 by thread 1.

00:00:00.188:

00:00:00.188: STATUS_STACK_BUFFER_OVERRUN encountered

00:00:00.188: Entrypoint reached. All implicit modules have been loaded.

00:00:00.204: Exited "c:\users\admin\if_sources\HELLO.EXE" (process 0xCF4) with code -1073740791 (0xC0000409) by thread 1.

"

In log file , i get this error : "Unable to load FWrap DLL. A DLL initialization routine failed"

So i am reporting here 3 results for the same run ....

In Hello.cs ,First i tried using DllImport("FWrap") and then by calling LoadLibrary() routine to load the DLL, but in both the cases same error is coming.

This Fwrap DLL was generated in some other application , and there also same error is coming when that application tries to load this DLL.

**Everything works fine if i run my application on XP machines.

Needed urgent look...

thanks

Anil.



Re: Visual C++ General problem in Loading a DLL

nobugz

You are probably getting the wrong diagnostic from DependencyWalker. It is running out of gas on apps built with the VS2005 CRT. It can't get past the new security enhancements, detecting stack buffer overruns is one of them. A great loss, I hope Steve Miller is hard at work to find a workaround.

The generic diagnostic for R6034 is a missing or invalid manifest. Read more about it in this MSDN library topic. Off topic for the CLR, moved to the C++ General forum.





Re: Visual C++ General problem in Loading a DLL

Simple Samples

The description of the message, as provided previously, is probably enough to solve this problem. Often it helps to look at the description of the message. In other situations, it often helps tosearch the MSDN, as in:

http://search.msdn.microsoft.com/search/Default.aspx query=application%20attemt%20load%20runtime%20library%20incorrectly%20&brand=msdn&locale=en-us&refinement=00&lang=en-us