eryksun added the comment: > 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. ---------- nosy: +eryksun _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue19143> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com