Windows Developer Center > Software Development for Windows Client Forums > Windows SDK > Function EnumProcessModulesEx is failing on windows 64 bit OS using Visual Studio 2008.
Ask a questionAsk a question
 

QuestionFunction EnumProcessModulesEx is failing on windows 64 bit OS using Visual Studio 2008.

  • Monday, February 23, 2009 6:39 AMVivek Chandra Vallabh Puranik Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Hi,

    I want to enumerate modules of a .Net process on both 32 bit and 64 bit windows OS. i tried the following

    i used the EnumProcessModules for 32 bit platform and it works successfully. But when i used EnumProcessModulesEx on windows 2008 using Visual Sudio 2008 for a 64 bit process, it fails. On checking the GetLastError i got error code 299 which means the following:

    failed with error 299: Only part of a ReadProcessMemory or WriteProcessMemory request was completed.


    1) My ultimate goal is to find out(Programmatically) the CLR version of a .Net Process on 64 bit windows OS. How shall i do it? is there any direct way to do this . I want to achieve this using C++ and Not C# or some thing else. i am trying this on Visual Sudio 2008 on Windows 2008.

    2) Why EnumProcessModulesEx function is failing using Visual Studio 2008 on windows 2008 OS. My .Net process for which i am enumerating the modules is a 64 bit process.

    Any pointer or help in this regard is highly appreciated

    Thanks,
    Vivek Puranik

All Replies

  • Monday, February 23, 2009 1:49 PMVivek Chandra Vallabh Puranik Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
     Hi,

    My problem got resolved. By default  VC++ compiler on Visual Studio 2008 compiles in 32 bit mode. There was not configuration manager seetting for x64 platform. I reinstalled the VC++  selecting x64 compilers and tools option and then tested this function successfully.

    Thanks,
    Vivek Puranik