Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8102597
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T23:16:54+00:00 2026-06-05T23:16:54+00:00

I have been researching this issue pretty extensively and cannot seem to find an

  • 0

I have been researching this issue pretty extensively and cannot seem to find an answer.

I know that the Only part of a ReadProcessMemory or WriteProcessMemory request was completed exception is thrown when a 32-bit process tries to access a 64-bit process and the same for a 64-bit modifying a 32-bit process.

The solution to that issue is to change the Platform Target to ‘Any CPU’. I have tried this and unfortunately this does not solve my issue.

The next block of code is what keeps throwing the exception. The program that runs this code is used to open up applications on remote computers and keeps a list of all the processes that the program itself opened so that I don’t have to loop through all the processes.

Process processToRemove = null;
lock (_runningProcesses)
{
    foreach (Process p in _runningProcesses)
    {
        foreach (ProcessModule module in p.Modules)
        {
            string[] strs = text.Split('\\');

            if (module.ModuleName.Equals(strs[strs.Length - 1]))
            {
                processToRemove = p;
                break;
            }
        }
        if (processToRemove != null)
        {
            break;
        }
    }
    if (processToRemove != null)
    {
        processToRemove.Kill();
        _runningProcesses.Remove(processToRemove);
    }
}

These processes can and most likely will be 32-bit and 64-bit, mixed together.

Is there anything I am doing that I shouldn’t be doing, or is there just a better way to do all of this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T23:16:55+00:00Added an answer on June 5, 2026 at 11:16 pm

    As detailed in the comments of the MSDN page for Process.Modules and this thread there is a known issue in Process.Modules when enumerating 32 bit processes from a 64 bit process and visa-versa:

    Internally .NET’s Process.Modules is using function EnumProcessModules
    from PSAPI.dll. This function has a known issue that it cannot work
    across 32/64 bit process boundary. Therefore enumerating another
    64-bit process from 32-bit process or vice versa doesn’t work
    correctly.

    The solution seems to be to use the EnumProcessModulesEx function, (which must be called via P/Invoke), however this function is only available on later versions of Windows.

    We fixed this issue by adding
    a new function called EnumProcessModulesEx to PSAPI.dll
    (http://msdn2.microsoft.com/en-us/library/ms682633.aspx), but we
    currently cannot use it in this case:

    • it only works on Windows Vista or Windows Server 2008
    • currently .NET 2.0 Framework don’t have a service pack or hotfix to make Process.Modules use this new API
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been researching all over the internet about this, and unfortunately cannot find
I've been researching this all day and can't seem to find an answer so
I have been researching this for a while but got no convinced answer. From
I have been researching this for a few hours and I feel that I
I am beyond frustrated. I have been researching an answer to this for hours
I have been researching this issue for long. But I haven't come across any
Hopefully, someone here can give me some light. I have been researching this issue
I've been researching this for quite long time now, can't find the answer. How
I've been researching this problem I have and I can't seem to understand it
I have been researching intently and have been unable to find a solution to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.