Skip to content

Use WPARAM as uint64_t and LPARAM as int64_t - #3256

Merged
zcbenz merged 3 commits into
electron:masterfrom
omrilitov:master
Oct 29, 2015
Merged

zcbenz merged 3 commits into
electron:masterfrom
omrilitov:master

Conversation

@omrilitov

Copy link
Copy Markdown
Contributor

@anaisbetts

Copy link
Copy Markdown
Contributor

WPARAM and LPARAM are 32-bit in 32-bit executables

@omrilitov

Copy link
Copy Markdown
Contributor Author

Yea, but i saw here b86267a
@zcbenz decided to use uint64_t so I just fixed the types

@anaisbetts

Copy link
Copy Markdown
Contributor

Hm, odd - well, since we never pass the WPARAM / LPARAM back to Win32, it's probably fine

@omrilitov

Copy link
Copy Markdown
Contributor Author

What would be the problem in passing back to Win32?
By my understanding as long as you convert back to WPARAM / LPARAM it should be fine

@anaisbetts

Copy link
Copy Markdown
Contributor

@omrilitov You'd truncate the value, since you'd extend it out to 64-bits, V8 would give you back a different 64-bit number that may or may not fit into 32-bits, then you smush it back into a WPARAM

@omrilitov

Copy link
Copy Markdown
Contributor Author

Well, sometimes WPARAM and LPARAM are pointers to structs, So maybe another solution should be considered.
Passing it back to win32 is needed to get/alter the data.

@anaisbetts

Copy link
Copy Markdown
Contributor

Hm, if you want to guarantee pointer-sized'ness, maybe a Buffer is more appropriate?

@omrilitov

Copy link
Copy Markdown
Contributor Author

The same problem exists here #3219
Seems like Buffer should solve both issues

@omrilitov

Copy link
Copy Markdown
Contributor Author

I hope I didn't over complicate the use of buffers but it seems to do the job just fine 😄

@zcbenz

zcbenz commented Oct 29, 2015

Copy link
Copy Markdown
Contributor

Using Buffer is perfect 👍.

zcbenz added a commit that referenced this pull request Oct 29, 2015
Use WPARAM as uint64_t and LPARAM as int64_t
@zcbenz
zcbenz merged commit bf9e6ba into electron:master Oct 29, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants