title: windows 7 c++ pointer address
body: <p>I work on an application that runs Windows OSes. Right now, it's running on Windows 7 32-bit and 64-bit, and Windows 2008 R2 64-bit. The application is a .NET app that is compiled for both x86 and x64.</p>
  
  <p>Anyway, this application uses third party COM objects. There are 32-bit and 64-bit versions of these COM objects. These COM objects are written in C++/ATL.</p>
  
  <p>Recently, we have discovered a problem with the 64-bit COM Objects. From talking to the developer of these COM objects, the code is casting pointers (64-bit) to longs (32-bit) and then back to pointers. Of course, this is bad as the cast to longs could truncate the pointer value.</p>
  
  <p>What's strange is these COM objects have been working fine on Windows 7 64-bit and Windows Server 2008 R2 74-bit for a year or so. Never had a problem.</p>
  
  <p>Now when we test on Windows 10 we are getting crashes in these COM objects.</p>
  
  <p>The reason is for this is obvious. What I don't understand is why does this only happen in Windows 10. The developer who wrote the COM objects is only seeing the pointers taking up the lower 32-bits. The upper 32-bits are always zero. On Windows 10, the pointers are using addresses larger than just the 32-bits--i.e. the upper 32-bits are NOT all zeros.</p>
  
  <p>Has anyone heard of this? Is this intentional by MS?</p>
  
  <p>Thanks!</p>