Author eryksun
Recipients brian.curtin, eryksun, giampaolo.rodola, jkloth, lemburg, loewis, pitrou, serhiy.storchaka, steve.dower, tim.golden, tim.peters, zach.ware
Date 2014-12-31.22:14:23
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1420064064.32.0.397033665013.issue19143@psf.upfronthosting.co.za>
In-reply-to
Content
> actual_len = kernel32.GetModuleFileNameW(kernel32._handle, name, len(name))

A module handle is the module's base address. kernel32 is loaded at a 32-bit base address in a 64-bit process, but I don't know whether that will always be true in current and future versions. It's safer to use HANDLE(kernel32._handle) instead of the default C int conversion.

> ver_block = byref(c_buffer(size))

byref is unnecessary. An array gets passed as a pointer.

> maj = int(pvi.contents.dwProductVersionMS >> 16)
> min = int(pvi.contents.dwProductVersionMS & 0xFFFF)
> build = int(pvi.contents.dwProductVersionLS >> 16)

pvi.contents.dwProductVersionMS is already an int, else the bitshift would fail.
History
Date User Action Args
2014-12-31 22:14:24eryksunsetrecipients: + eryksun, lemburg, tim.peters, loewis, pitrou, giampaolo.rodola, tim.golden, jkloth, brian.curtin, zach.ware, serhiy.storchaka, steve.dower
2014-12-31 22:14:24eryksunsetmessageid: <1420064064.32.0.397033665013.issue19143@psf.upfronthosting.co.za>
2014-12-31 22:14:24eryksunlinkissue19143 messages
2014-12-31 22:14:23eryksuncreate