none
Crash in Process.MainModule:"Only part of a ReadProcessMemory or WriteProcessMemory request was completed"

    Question

  • Hi 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.
    Tuesday, June 29, 2010 2:05 PM

All replies


  • 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
    Tuesday, June 29, 2010 3:27 PM
  • hi....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.
    Wednesday, June 30, 2010 4:25 AM
  • 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 2:34 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.
    Friday, July 02, 2010 8:47 AM
  • hi...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.
    Monday, July 05, 2010 3:52 PM
  • so shall i take this issue as a known bug in .NET class?
    Sharing is profitable only if it happens with knowledge.
    Wednesday, July 07, 2010 4:54 PM
  • Hi,

      Please take a look at here.


    Please mark the right answer at right time.
    Thanks,
    Sam
    Tuesday, August 03, 2010 2:41 AM