http://bugs.winehq.org/show_bug.cgi?id=32779
--- Comment #4 from Rico kgbricola@web.de 2013-01-22 05:10:28 CST --- ((HKEY)(ULONG_PTR)(LONG)0x80000001) does not work, but ((HKEY)(ULONG_PTR)(ULONG)0x80000001) works fine. This breaks the mingw build (see http://sourceforge.net/apps/trac/mingw-w64/browser/trunk/mingw-w64-headers/i... ).
Maybe the correct step is using ((HKEY)(ULONG_PTR)(ULONG)0x80000001) for HKEY_CURRENT_USER and later comparing hkey like: (hkey & 0xffffffff) == HKEY_CURRENT_USER ?