Ports
June 20, 2013, 07:23:21 am
Welcome,
Guest
. Please
login
or
register
.
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News
: SMF - Just Installed!
Home
Help
Search
Login
Register
Welcome to the PORTS Forum. Please post your questions, answers, and comments relating to USB and other hardware interfaces in the appropriate forums below. - Jan
Ports
>
General Category
>
USB
>
IntPtr <-> Int32 safety
Pages: [
1
]
« previous
next »
Print
Author
Topic: IntPtr <-> Int32 safety (Read 672 times)
vanweric
Member
Posts: 24
IntPtr <-> Int32 safety
«
on:
January 10, 2012, 06:25:18 pm »
Jan -
I noticed this line in one of your demos, and was worried about the type safety:
IntPtr pDevicePathName = new IntPtr(detailDataBuffer.ToInt32() + 4);
(Generic_hid_cs -> DeviceManagement.cs)
In 64 bit environment, this will chop off the high word. Are we guaranteed that this will be in the lower 4 gigs?
I replaced it with this to be on the safe side:
IntPtr pDevicePathName = detailDataBuffer + 4;
Logged
Jan Axelson
Administrator
Frequent Contributor
Posts: 1642
Re: IntPtr <-> Int32 safety
«
Reply #1 on:
January 10, 2012, 06:28:29 pm »
Thank you for the suggestion!
Jan
Logged
Pages: [
1
]
Print
« previous
next »
Jump to:
Please select a destination:
-----------------------------
General Category
-----------------------------
=> USB
=> Serial Ports
=> Embedded Ethernet
=> Parallel Port
=> Other Interfaces
=> General Discussion
Loading...