Crash in Process.MainModule:"Only part of a ReadProcessMemory or WriteProcessMemory request was completed"
-
Tuesday, June 29, 2010 2:05 PMHi every one i have been using Process.MainModule.FileName to get the filename of all the running processes in a windowsXP32bit application. It was working fine. But the same 32-bit application crashed in 64-bit XP system giving the error as "Only part of a ReadProcessMemory or WriteProcessMemory request was completed".Sorry if i am repeating the same question which might have been posted long back. I am posting this because there were no solutions or work around methods mentioned in the forum......please give me any suggestions!
Sharing is profitable only if it happens with knowledge.
All Replies
-
Tuesday, June 29, 2010 3:27 PM
Are you sure it is crashing on the statement which contains Process.MainModule.Filename?Did you build for "x86" or "Any CPU"? If you did not try "x86", that is the first thing to try.
--
Mike -
Wednesday, June 30, 2010 4:25 AMhi....actually the .exe is in C++ which loads a C# dll containing process related code .the .exe has only win32 and X64 configurations. For my default configuration win32 the targetmachine type option in linker is X86. My C# dll is set to ANYCPU
Sharing is profitable only if it happens with knowledge. -
Friday, July 02, 2010 2:34 AMModerator
Hi,
Have you tried to set target of it to x86?
Best regards,
Harry Zhu
- MSFT MSDN Subscriber Support in Forum
If you have any feedback of our support, please contact msdnmg@microsoft.com -
Friday, July 02, 2010 8:47 AM
yes..can anyone test the following code and infer whats happening? ....Actually it works fine with x64 and ANYCPU configurations....but the requirement is it should work for an application built in x86 configuration and executed on x64 platform(it runs it under WOW).
Process[] procArr = Process.GetProcesses();
foreach(Process CurProc in procArr)
{
string FileName = CurProc.Mainmodule.FileVersionInfo.FileName;
string version = CurProc.Mainmodule.FileVersionInfo.FileVersion
}
you can suggest even if there are any other alternate methods to get these informations
Thanks in advance.
Thanks in advance
Sharing is profitable only if it happens with knowledge. -
Monday, July 05, 2010 3:52 PMhi...Its been so long since i posted this....i am not getting any solutions or details related to this issue........can some one please redirect this to appropriate forums or help me in posting in any other forum where i can get the ideas of some more people..
Sharing is profitable only if it happens with knowledge. -
Wednesday, July 07, 2010 4:54 PMso shall i take this issue as a known bug in .NET class?
Sharing is profitable only if it happens with knowledge. -
Tuesday, August 03, 2010 2:41 AM

