I am using vc7 to call a dll function from another dll. The function
seems to execute correctly (it writes binary data to the registry) but
when it comes out of the function, and tries to execute a standard
windows debug trace (or any other line of code for that matter, I tried
replacing the debug line with) it crashes giving a first chance
exception, and then a access violation. I have a feeling that this has
something to do with the target dll being called, though I am not sure
what.
Below is the debug disassembly.
if (_ProfileRegistryWriteBinary( HKEY_CURRENT_USER, szSubKey,
sKey, pDataOut.cbData, pDataOut.pbData )) // Local stub to the dll
method.
0475132D mov eax,dword ptr [ebp-18h]
04751330 push eax
04751331 mov ecx,dword ptr [pDataOut]
04751334 push ecx
04751335 mov edx,dword ptr [sKey]
04751338 push edx
04751339 mov eax,dword ptr [szSubKey]
0475133C push eax
0475133D push 80000001h
04751342 call _ProfileRegistryWriteBinary (47515D0h)
04751347 add esp,14h
0475134A movzx ecx,al
0475134D test ecx,ecx
0475134F je _StorePrivateData+118h (4751378h)
{
debug ("Private data has been written successfully :)");
04751351 push ecx
04751352 mov ecx,esp
/************************************************** ***************
04751354 mov dword ptr [ebp-118h],esp <- Crashes on this line
************************************************** ***************/
0475135A push offset string "Private data has been written
su"... (4815D04h)
0475135F call
ATL::CStringT<char,StrTraitMFC<char,ATL::ChTraitsC RT<char> >
::CStringT<char,StrTraitMFC<char,ATL::ChTraitsCRT <char> > > (4751710h)
04751364 mov dword ptr [ebp-144h],eax
0475136A call debug (4751450h)
0475136F add esp,4
bRetval = true;
04751372 mov byte ptr [bRetval],1
}
Thanks a Lot!
Mongoose7