cosmo0920 / windows-pr

A collection of Windows functions, constants and macros predefined for you for win32-api
23 stars 9 forks source link

INVALID_FILE_HANDLE is incorrect in 64bit Windows #13

Closed cosmo0920 closed 8 years ago

cosmo0920 commented 8 years ago

See: https://github.com/fluent/fluentd/issues/920#issuecomment-225178221

phasis68 commented 8 years ago

Here is a possible patch

INVALID_FILE_HANDLE = (1 << ['a'].pack('p').length*8) - 1

cosmo0920 commented 8 years ago

How about this patch? (Also included fixing test) https://github.com/cosmo0920/windows-pr/commit/3a86f096b3f7dea7e0e2fd11ece377f0a9511d47

djberg96 commented 8 years ago

['a'].pack('P').length > 4 ? "64Bit" : "32Bit"

djberg96 commented 8 years ago

Looking at my win32-eventlog code you can check for JRuby like so:

RUBY_PLATFORM == 'java' && ENV_JAVA['sun.arch.data.model'] == '64'