คำถาม Module32First returns ERROR_BAD_LENGTH

  • 6 เมษายน 2555 13:56
     
     

    Hi,

    My application calls CreateToolhelp32Snapshot , Module32First and Module32Nextto to retrieve module information of current process.

    Module32First always return ERROR_BAD_LENGTH even there is a loop to keep trying. Could anyone give me some help?

    Thanks,

    Frank



    • แก้ไขโดย Feng L 6 เมษายน 2555 13:57
    •  

ตอบทั้งหมด

  • 6 เมษายน 2555 21:35
     
     

    Documentation:

    The calling application must set the dwSize member of MODULEENTRY32 to the size, in bytes, of the structure.

    ERROR_BAD_LENGTH is what you get if you don't do that, or if you pass a null pointer for the second parameter.