Jump-start your project by learning from devs who
write Windows drivers and file systems every day.
Take an OSR seminar!

OSR is Hiring! Click here to find out more.

Windows Internals & Software Drivers Lab, Santa Clara, CA 5-9 August, 2013
Kernel Debugging & Crash Analysis for Windows Lab, Santa Clara, CA 9-13 September, 2013
Upcoming OSR Seminars:
Writing WDF Drivers for Windows Lab, Boston, MA 7-11 October, 2013
Developing File Systems for Windows, Seattle, WA 5-8 November, 2013


Go Back   OSR Online Lists > ntdev
Welcome, Guest
You must login to post to this list
  Message 1 of 4  
24 Sep 12 06:15
Nv
xxxxxx@hotmail.co.uk
Join Date: 28 Oct 2009
Posts To This List: 103
0x%.16X

Hi, I have been using 0x%.16X for a long time in 64bit drivers without a second thought. I have just noticed that when I tried displaying 0x1122334455667788 through DbgView it displays 0x0000000055667788 when I use 0x%.16X. Does anyone know what I am missing. I have tried searching. Thankyou as always,
  Message 2 of 4  
24 Sep 12 06:27
James Harper
xxxxxx@bendigoit.com.au
Join Date: 01 Dec 2008
Posts To This List: 1510
RE: 0x%.16X

> Hi, > > I have been using 0x%.16X for a long time in 64bit drivers without a second > thought. I have just noticed that when I tried displaying 0x1122334455667788 > through DbgView it displays 0x0000000055667788 when I use 0x%.16X. > > Does anyone know what I am missing. I have tried searching. > I use %I64d, so I assume %I64X, or %.16I64X or something like that is what you want. It's a bit of a pain... under Linux I'd just use %lx but that doesn't work under Windows. WCHAR strings are different between the two too. I couldn't find it anywhere when I searched either. James
  Message 3 of 4  
24 Sep 12 06:49
Nv
xxxxxx@hotmail.co.uk
Join Date: 28 Oct 2009
Posts To This List: 103
RE: 0x%.16X

Hi, Thankyou very much %.16I64X worked perfectly. Thankyou again. > Hi, > > I have been using 0x%.16X for a long time in 64bit drivers without a second > thought. I have just noticed that when I tried displaying 0x1122334455667788 > through DbgView it displays 0x0000000055667788 when I use 0x%.16X. > > Does anyone know what I am missing. I have tried searching. > I use %I64d, so I assume %I64X, or %.16I64X or something like that is what you want. It's a bit of a pain... under Linux I'd just use %lx but that doesn't work under Windows. WCHAR strings are different between the two too. I couldn't find it anywhere when I searched either. James
  Message 4 of 4  
24 Sep 12 10:14
Pavel A
xxxxxx@fastmail.fm
Join Date: 21 Jul 2008
Posts To This List: 1885
Re: 0x%.16X

On 24-Sep-2012 12:27, James Harper wrote: >> Hi, >> >> I have been using 0x%.16X for a long time in 64bit drivers without a second >> thought. I have just noticed that when I tried displaying 0x1122334455667788 >> through DbgView it displays 0x0000000055667788 when I use 0x%.16X. >> >> Does anyone know what I am missing. I have tried searching. >> > > I use %I64d, so I assume %I64X, or %.16I64X or something like that is what you want. <...excess quoted lines suppressed...> In Windows C type long is 32-bit. Always. And 64-bit is long long. This is documented in MSDN, where the C compiler and library belong. Newer kernels support also %ll prefix (long long, like in VC++ 2008) but for backward compatibility with XP use only %I64. Note that stdint.h defines correct format strings for various types, but this wasn't available in WDK, at least before win8. -- pa
Posting Rules  
You may not post new threads
You may not post replies
You may not post attachments
You must login to OSR Online AND be a member of the ntdev list to be able to post.

All times are GMT -5. The time now is 07:27.


Copyright ©2012, OSR Open Systems Resources, Inc.
Based on vBulletin Copyright ©2000 - 2005, Jelsoft Enterprises Ltd.
Modified under license