[Win32utils-devel] Fwd: win32/process problem

Daniel Berger djberg96 at gmail.com
Sun Dec 9 00:52:19 EST 2007


Heesob Park wrote:

<snip>

> Ok, I saw it.
> Reinitializing buf after the first formatting like this works fine for me:
>  
>                # Try to retrieve message *without* expanding the inserts 
> yet
>                exe.split(';').each{ |file|
>                   hmodule  = LoadLibraryEx(file, 0, 
> DONT_RESOLVE_DLL_REFERENCES)
>                   event_id = rec[20,4].unpack('L')[0]
>                   if hmodule != 0
>                      FormatMessage(
>                         FORMAT_MESSAGE_FROM_HMODULE |
>                         FORMAT_MESSAGE_IGNORE_INSERTS,
>                         hmodule,
>                         event_id,
>                         0,
>                         buf,
>                         buf.size,
>                         nil
>                      )
>                     
>                      FreeLibrary(hmodule)
>                      break if buf.nstrip != "" # All messages read
>                   end
>                }
>               
>                buf  = 0.chr * 8192  # Reinitialize buf

Excellent, that worked, thanks! I'll put out 0.4.7 tonight.

Regards,

Dan


More information about the win32utils-devel mailing list